diff options
Diffstat (limited to 'ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPaps.java')
-rw-r--r-- | ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPaps.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPaps.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPaps.java index b703917c4..c3171de39 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPaps.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/NotifyOtherPaps.java @@ -3,6 +3,7 @@ * 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. @@ -60,7 +61,7 @@ public class NotifyOtherPaps { + 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 @@ -104,10 +105,9 @@ public class NotifyOtherPaps { @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()); @@ -118,7 +118,6 @@ public class NotifyOtherPaps { } HttpURLConnection connection = null; - UUID requestId = UUID.randomUUID(); URL url; String papUrl; try { @@ -176,6 +175,10 @@ public class NotifyOtherPaps { 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); |