From 87c95be02a8a4d77e165dede90777e811b59dcae Mon Sep 17 00:00:00 2001 From: Ravindra Bakkamanthala Date: Tue, 23 May 2017 14:56:12 -0400 Subject: Commit includes ControlLoopPolicy API and bugfixes Change-Id: I3e18bb8b4c31a0d908bb0cff4c85e2a3fb450a63 Signed-off-by: Ravindra Bakkamanthala --- .../openecomp/policy/xacml/std/pap/StdEngine.java | 16 +++++++-------- .../policy/xacml/std/pap/StdPAPPolicy.java | 6 +++--- .../org/openecomp/policy/xacml/std/pap/StdPDP.java | 4 ++-- .../policy/xacml/std/pap/StdPDPGroup.java | 8 ++++---- .../policy/xacml/std/pap/StdPDPGroupStatus.java | 24 +++++++++++----------- .../policy/xacml/std/pap/StdPDPPIPConfig.java | 2 +- .../policy/xacml/std/pap/StdPDPStatus.java | 14 ++++++------- .../xacml/std/pip/engines/aaf/AAFEngine.java | 8 ++++---- 8 files changed, 41 insertions(+), 41 deletions(-) (limited to 'ECOMP-XACML/src/main') diff --git a/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdEngine.java b/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdEngine.java index 951f89110..83ff56ebf 100644 --- a/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdEngine.java +++ b/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdEngine.java @@ -155,7 +155,7 @@ public class StdEngine extends StdPDPItemSetChangeNotifier implements PAPPolicyE this.groups = this.readProperties(this.repository, properties); } catch (IOException e) { PolicyLogger.error(MessageCodes.ERROR_DATA_ISSUE, e, "StdEngine", "Failed to load properties file"); - this.groups = new HashSet(); + this.groups = new HashSet<>(); } // // Initialize the default group @@ -377,7 +377,7 @@ public class StdEngine extends StdPDPItemSetChangeNotifier implements PAPPolicyE // Add the default PIP configuration. String list = props.getProperty(XACMLProperties.PROP_PIP_ENGINES); if (list != null && list.length() > 0) { - Set pipConfigs = new HashSet(); + Set pipConfigs = new HashSet<>(); for (String pipID : list.split("[,]")) { StdPDPPIPConfig config = new StdPDPPIPConfig(pipID, props); if (config.isConfigured()) { @@ -561,7 +561,7 @@ public class StdEngine extends StdPDPItemSetChangeNotifier implements PAPPolicyE // private Set readProperties(Path repository, Properties properties) throws PAPException { - Set groups = new HashSet(); + Set groups = new HashSet<>(); // // See if there is a groups property // @@ -616,7 +616,7 @@ public class StdEngine extends StdPDPItemSetChangeNotifier implements PAPPolicyE // // Iterate our groups // - List ids = new ArrayList(); + List ids = new ArrayList<>(); for (PDPGroup group : this.groups) { ids.add(group.getId()); properties.setProperty(group.getId() + ".name", (group.getName() == null ? "" : group.getName())); @@ -624,7 +624,7 @@ public class StdEngine extends StdPDPItemSetChangeNotifier implements PAPPolicyE // // Iterate its PDPs // - List pdps = new ArrayList(); + List pdps = new ArrayList<>(); for (PDP pdp : group.getPdps()) { pdps.add(pdp.getId()); properties.setProperty(pdp.getId() + ".name", (pdp.getName() == null ? "" : pdp.getName())); @@ -717,7 +717,7 @@ public class StdEngine extends StdPDPItemSetChangeNotifier implements PAPPolicyE if (group.getPdps().size() == 1) { pdpList = group.getPdps().iterator().next().getId(); } else if (group.getPdps().size() > 1) { - Set ids = new HashSet(); + Set ids = new HashSet<>(); for (PDP pdp : group.getPdps()) { ids.add(pdp.getId()); } @@ -792,7 +792,7 @@ public class StdEngine extends StdPDPItemSetChangeNotifier implements PAPPolicyE @Override public Set getEcompPDPGroups() throws PAPException { - final Set grps = new HashSet(); + final Set grps = new HashSet<>(); for (EcompPDPGroup g : this.groups) { grps.add(g); } @@ -978,7 +978,7 @@ public class StdEngine extends StdPDPItemSetChangeNotifier implements PAPPolicyE } // The movePDP function will modify the set of PDPs in the group. // To avoid concurrent modification exceptions we need to duplicate the list before calling that function. - List pdpList = new ArrayList(); + List pdpList = new ArrayList<>(); for (EcompPDP pdp : pdps) { pdpList.add(pdp); } diff --git a/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPAPPolicy.java b/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPAPPolicy.java index 0606daa79..61ba86b8a 100644 --- a/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPAPPolicy.java +++ b/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPAPPolicy.java @@ -35,9 +35,9 @@ public class StdPAPPolicy implements EcompPAPPolicy, Serializable{ private String policyDescription = null; private String ecompName = null; private String configName = null; - private Map dyanamicFieldConfigAttributes = new HashMap(); - private Map dropDownMap = new HashMap(); - private Map dynamicSettingsMap = new HashMap(); + private Map dyanamicFieldConfigAttributes = new HashMap<>(); + private Map dropDownMap = new HashMap<>(); + private Map dynamicSettingsMap = new HashMap<>(); private List dynamicRuleAlgorithmLabels; private List dynamicRuleAlgorithmCombo; private List dynamicRuleAlgorithmField1; diff --git a/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDP.java b/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDP.java index b8fb59b60..7e3c1e61a 100644 --- a/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDP.java +++ b/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDP.java @@ -47,9 +47,9 @@ public class StdPDP extends StdPDPItemSetChangeNotifier implements EcompPDP, Com private PDPStatus status = new StdPDPStatus(); - private Set policies = new HashSet(); + private Set policies = new HashSet<>(); - private Set pipConfigs = new HashSet(); + private Set pipConfigs = new HashSet<>(); public StdPDP() { diff --git a/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDPGroup.java b/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDPGroup.java index 1a52dcb73..b28c04e29 100644 --- a/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDPGroup.java +++ b/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDPGroup.java @@ -72,13 +72,13 @@ public class StdPDPGroup extends StdPDPItemSetChangeNotifier implements EcompPDP private StdPDPGroupStatus status = new StdPDPGroupStatus(Status.UNKNOWN); - private Set pdps = new HashSet(); + private Set pdps = new HashSet<>(); - private Set policies = new HashSet(); + private Set policies = new HashSet<>(); - private Set selectedPolicies = new HashSet(); + private Set selectedPolicies = new HashSet<>(); - private Set pipConfigs = new HashSet(); + private Set pipConfigs = new HashSet<>(); private String operation; diff --git a/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDPGroupStatus.java b/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDPGroupStatus.java index dcb1f8fe0..6b248bf69 100644 --- a/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDPGroupStatus.java +++ b/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDPGroupStatus.java @@ -33,29 +33,29 @@ public class StdPDPGroupStatus implements PDPGroupStatus { private Status status = Status.UNKNOWN; - private Set loadErrors = new HashSet(); + private Set loadErrors = new HashSet<>(); - private Set loadWarnings = new HashSet(); + private Set loadWarnings = new HashSet<>(); - private Set loadedPolicies = new HashSet(); + private Set loadedPolicies = new HashSet<>(); - private Set failedPolicies = new HashSet(); + private Set failedPolicies = new HashSet<>(); - private Set loadedPIPConfigs = new HashSet(); + private Set loadedPIPConfigs = new HashSet<>(); - private Set failedPIPConfigs = new HashSet(); + private Set failedPIPConfigs = new HashSet<>(); - private Set inSynchPDPs = new HashSet(); + private Set inSynchPDPs = new HashSet<>(); - private Set outOfSynchPDPs = new HashSet(); + private Set outOfSynchPDPs = new HashSet<>(); - private Set failedPDPs = new HashSet(); + private Set failedPDPs = new HashSet<>(); - private Set updatingPDPs = new HashSet(); + private Set updatingPDPs = new HashSet<>(); - private Set lastUpdateFailedPDPs = new HashSet(); + private Set lastUpdateFailedPDPs = new HashSet<>(); - private Set unknownPDPs = new HashSet(); + private Set unknownPDPs = new HashSet<>(); // Constructor needed for JSON deserialization diff --git a/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDPPIPConfig.java b/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDPPIPConfig.java index 909f64620..3a609fe07 100644 --- a/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDPPIPConfig.java +++ b/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDPPIPConfig.java @@ -42,7 +42,7 @@ public class StdPDPPIPConfig implements PDPPIPConfig, Serializable { private String classname; - private Map config = new HashMap(); + private Map config = new HashMap<>(); public StdPDPPIPConfig() { diff --git a/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDPStatus.java b/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDPStatus.java index dc297657a..ddb799964 100644 --- a/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDPStatus.java +++ b/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pap/StdPDPStatus.java @@ -34,19 +34,19 @@ public class StdPDPStatus implements Serializable, PDPStatus { private Status status = Status.UNKNOWN; - private Set loadErrors = new HashSet(); + private Set loadErrors = new HashSet<>(); - private Set loadWarnings = new HashSet(); + private Set loadWarnings = new HashSet<>(); - private Set loadedPolicies = new HashSet(); + private Set loadedPolicies = new HashSet<>(); - private Set loadedRootPolicies = new HashSet(); + private Set loadedRootPolicies = new HashSet<>(); - private Set failedPolicies = new HashSet(); + private Set failedPolicies = new HashSet<>(); - private Set loadedPIPConfigs = new HashSet(); + private Set loadedPIPConfigs = new HashSet<>(); - private Set failedPIPConfigs = new HashSet(); + private Set failedPIPConfigs = new HashSet<>(); public StdPDPStatus() { } diff --git a/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pip/engines/aaf/AAFEngine.java b/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pip/engines/aaf/AAFEngine.java index 581009d18..e8f9bfcb7 100644 --- a/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pip/engines/aaf/AAFEngine.java +++ b/ECOMP-XACML/src/main/java/org/openecomp/policy/xacml/std/pip/engines/aaf/AAFEngine.java @@ -76,7 +76,7 @@ public class AAFEngine extends StdConfigurableEngine { private static final PIPRequest PIP_REQUEST_INSTANCE = new StdPIPRequest(XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, new IdentifierImpl("AAF_INSTANCE"), XACML3.ID_DATATYPE_STRING); private static final PIPRequest PIP_REQUEST_ACTION = new StdPIPRequest(XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, new IdentifierImpl("AAF_ACTION"), XACML3.ID_DATATYPE_STRING); - private static final List mapRequiredAttributes = new ArrayList(); + private static final List mapRequiredAttributes = new ArrayList<>(); static{ mapRequiredAttributes.add(new StdPIPRequest(PIP_REQUEST_UID)); mapRequiredAttributes.add(new StdPIPRequest(PIP_REQUEST_PASS)); @@ -85,7 +85,7 @@ public class AAFEngine extends StdConfigurableEngine { mapRequiredAttributes.add(new StdPIPRequest(PIP_REQUEST_ACTION)); } - private static final Map mapSupportedAttributes = new HashMap(); + private static final Map mapSupportedAttributes = new HashMap<>(); static{ mapSupportedAttributes.put(new StdPIPRequest(XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, AAF_RESPONSE_ID, XACML3.ID_DATATYPE_STRING), "response"); mapSupportedAttributes.put(new StdPIPRequest(XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, AAF_RESULT_ID, XACML3.ID_DATATYPE_BOOLEAN), "result"); @@ -251,7 +251,7 @@ public class AAFEngine extends StdConfigurableEngine { @Override public Collection attributesRequired() { - List attributes = new ArrayList(); + List attributes = new ArrayList<>(); for (PIPRequest attribute: mapRequiredAttributes) { attributes.add(new StdPIPRequest(attribute)); } @@ -260,7 +260,7 @@ public class AAFEngine extends StdConfigurableEngine { @Override public Collection attributesProvided() { - List attributes = new ArrayList(); + List attributes = new ArrayList<>(); for (PIPRequest attribute : mapSupportedAttributes.keySet()) { attributes.add(new StdPIPRequest(attribute)); } -- cgit 1.2.3-korg