* ONAP-PAP-REST
* ================================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
+ entityType + "," + newGroupId + ") called");
failedPaps = new ArrayList<>();
- List<?> otherServers = PolicyDBDao.getPolicyDBDaoInstance().getOtherServers();
+ List<?> otherServers = PolicyDbDao.getPolicyDbDaoInstance().getOtherServers();
// Notify other paps
startNotifyThreads(otherServers, entityId, entityType, newGroupId);
// Retry for failed paps
@Override
public void run() {
- PolicyDBDao dao = new PolicyDBDao();
+ PolicyDbDao dao = new PolicyDbDao();
PolicyDBDaoEntity dbdEntity = (PolicyDBDaoEntity) obj;
String otherPap = dbdEntity.getPolicyDBDaoUrl();
- String username = dbdEntity.getUsername();
String txt;
try {
txt = PeCryptoUtils.decrypt(dbdEntity.getPassword());
}
HttpURLConnection connection = null;
- UUID requestId = UUID.randomUUID();
URL url;
String papUrl;
try {
LOGGER.warn("Caught ProtocolException on connection.setRequestMethod(\"PUT\");", e);
return;
}
+
+ String username = dbdEntity.getUsername();
+ UUID requestId = UUID.randomUUID();
+
Base64.Encoder encoder = Base64.getEncoder();
String encoding = encoder.encodeToString((username + ":" + txt).getBytes(StandardCharsets.UTF_8));
connection.setRequestProperty("Authorization", "Basic " + encoding);