package org.onap.policy.pap.xacml.rest.components;
import com.att.research.xacml.util.XACMLProperties;
-
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.util.LinkedList;
import java.util.List;
import java.util.UUID;
-
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.rest.XacmlRestProperties;
-import org.onap.policy.rest.jpa.PolicyDBDaoEntity;
+import org.onap.policy.rest.jpa.PolicyDbDaoEntity;
import org.onap.policy.utils.PeCryptoUtils;
public class NotifyOtherPaps {
private static final Logger LOGGER = FlexLogger.getLogger(NotifyOtherPaps.class);
- private List<PolicyDBDaoEntity> failedPaps = null;
+ private List<PolicyDbDaoEntity> failedPaps = null;
public void notifyOthers(long entityId, String entityType) {
notifyOthers(entityId, entityType, null);
*/
public void notifyOthers(long entityId, String entityType, String newGroupId) {
LOGGER.debug("notifyOthers(long entityId, String entityType, long newGroupId) as notifyOthers(" + entityId + ","
- + entityType + "," + newGroupId + ") called");
+ + entityType + "," + newGroupId + ") called");
failedPaps = new ArrayList<>();
List<?> otherServers = PolicyDbDao.getPolicyDbDaoInstance().getOtherServers();
}
}
- private void startNotifyThreads(List<?> otherServers, long entityId, String entityType, String newGroupId) {
+ protected void startNotifyThreads(List<?> otherServers, long entityId, String entityType, String newGroupId) {
LinkedList<Thread> notifyThreads = new LinkedList<>();
// we're going to run notifications in parallel threads to speed things
// up
@Override
public void run() {
PolicyDbDao dao = new PolicyDbDao();
- PolicyDBDaoEntity dbdEntity = (PolicyDBDaoEntity) obj;
- String otherPap = dbdEntity.getPolicyDBDaoUrl();
+ PolicyDbDaoEntity dbdEntity = (PolicyDbDaoEntity) obj;
+ String otherPap = dbdEntity.getPolicyDbDaoUrl();
String txt;
try {
txt = PeCryptoUtils.decrypt(dbdEntity.getPassword());
return;
}
if (newGroupId == null) {
- url = new URL(otherPap + "?policydbdaourl=" + papUrl + "&entityid=" + entityId + "&entitytype="
- + entityType);
+ url = new URL(
+ otherPap + "?policydbdaourl=" + papUrl + "&entityid=" + entityId + "&entitytype=" + entityType);
} else {
url = new URL(otherPap + "?policydbdaourl=" + papUrl + "&entityid=" + entityId + "&entitytype="
- + entityType + "&extradata=" + newGroupId);
+ + entityType + "&extradata=" + newGroupId);
}
} catch (MalformedURLException e) {
LOGGER.warn("Caught MalformedURLException on: new URL()", e);
int readTimeout;
try {
readTimeout =
- Integer.parseInt(XACMLProperties.getProperty(XacmlRestProperties.PROP_PAP_NOTIFY_TIMEOUT));
+ Integer.parseInt(XACMLProperties.getProperty(XacmlRestProperties.PROP_PAP_NOTIFY_TIMEOUT));
} catch (Exception e) {
LOGGER.error("xacml.rest.pap.notify.timeoutms property not set, using a default.", e);
readTimeout = 10000;
LOGGER.info("PolicyDBDao: NotifyOtherThread received response 200 from pap server on notify");
} else {
LOGGER.warn("PolicyDBDao: NotifyOtherThread connection response code not 200, received: "
- + connection.getResponseCode());
+ + connection.getResponseCode());
failedPaps.add(dbdEntity);
}
} catch (Exception e) {