X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=ONAP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fmodel%2FPDPPolicyContainer.java;h=23aa761be69d80afed80315d424df981575dc1c4;hp=18f0636a810128451df72d4d50289e13dbd85ce4;hb=24c6b1682bb59691f8d5e631b1074355b7d82a54;hpb=461b2b7eeca1586423349bc0c4c65f80f027292d diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/model/PDPPolicyContainer.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/model/PDPPolicyContainer.java index 18f0636a8..23aa761be 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/model/PDPPolicyContainer.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/model/PDPPolicyContainer.java @@ -71,23 +71,23 @@ public class PDPPolicyContainer extends PolicyItemSetChangeNotifier implements P /** * List of the string identifiers for the available properties. */ - public static Collection PDPPOLICY_PROPERTIES; + private static Collection pdpPolicyProperties; - private final Object data; - private List policies; + private final transient Object data; + private transient List policies; @SuppressWarnings("unchecked") public PDPPolicyContainer(Object data) { super(); this.data = data; if (this.data instanceof PDPGroup) { - policies = new ArrayList (((PDPGroup) this.data).getPolicies()); + policies = new ArrayList<> (((PDPGroup) this.data).getPolicies()); } if (this.data instanceof PDP) { - policies = new ArrayList (((PDP) this.data).getPolicies()); + policies = new ArrayList<> (((PDP) this.data).getPolicies()); } if (this.data instanceof Set) { - policies = new ArrayList ((Set)data); + policies = new ArrayList<> ((Set)data); } if (this.policies == null) { logger.info("NULL policies"); @@ -165,14 +165,13 @@ public class PDPPolicyContainer extends PolicyItemSetChangeNotifier implements P } @Override - public Object addItemAfter(Object previousItemId) - throws UnsupportedOperationException { + public Object addItemAfter(Object previousItemId){ return null; } @Override public Collection getContainerPropertyIds() { - return PDPPOLICY_PROPERTIES; + return pdpPolicyProperties; } @Override @@ -220,13 +219,12 @@ public class PDPPolicyContainer extends PolicyItemSetChangeNotifier implements P } @Override - public Object addItem() throws UnsupportedOperationException { + public Object addItem(){ throw new UnsupportedOperationException("Cannot add an empty policy."); } @Override - public boolean removeItem(Object itemId) - throws UnsupportedOperationException { + public boolean removeItem(Object itemId){ if (logger.isTraceEnabled()) { logger.trace("removeItem: " + itemId); } @@ -248,18 +246,17 @@ public class PDPPolicyContainer extends PolicyItemSetChangeNotifier implements P @Override public boolean addContainerProperty(Object propertyId, Class type, - Object defaultValue) throws UnsupportedOperationException { + Object defaultValue){ return false; } @Override - public boolean removeContainerProperty(Object propertyId) - throws UnsupportedOperationException { + public boolean removeContainerProperty(Object propertyId){ return false; } @Override - public boolean removeAllItems() throws UnsupportedOperationException { + public boolean removeAllItems(){ return false; } @@ -291,7 +288,7 @@ public class PDPPolicyContainer extends PolicyItemSetChangeNotifier implements P } @Override - public Object addItemAt(int index) throws UnsupportedOperationException { + public Object addItemAt(int index) { if (logger.isTraceEnabled()) { logger.trace("addItemAt: " + index); }