X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fmodel%2FPDPGroupContainer.java;h=6c4fd7e915494864929469733cddd8c20024089a;hp=e6c375808ea50dfa8c70b3ac8ddf337399ac76fa;hb=0950d79047d3404c15b4dd30cffeb81346565f64;hpb=6da5838f43a4bf0dc8786c539f9a9aa521139e55 diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/model/PDPGroupContainer.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/model/PDPGroupContainer.java index e6c375808..6c4fd7e91 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/model/PDPGroupContainer.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/model/PDPGroupContainer.java @@ -20,8 +20,8 @@ package org.onap.policy.model; - import com.att.research.xacml.api.pap.PAPException; + import java.awt.Checkbox; import java.util.ArrayList; import java.util.Collection; @@ -29,6 +29,7 @@ import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Set; + import org.onap.policy.common.logging.flexlogger.FlexLogger; import org.onap.policy.common.logging.flexlogger.Logger; import org.onap.policy.rest.util.PolicyContainer; @@ -112,6 +113,9 @@ public class PDPGroupContainer extends PolicyItemSetChangeNotifier return itemId instanceof OnapPDPGroup; } + /** + * refreshGroups. + */ public synchronized void refreshGroups() { synchronized (this.groups) { this.groups.clear(); @@ -133,6 +137,11 @@ public class PDPGroupContainer extends PolicyItemSetChangeNotifier return Collections.unmodifiableList(this.groups); } + /** + * makeDefault. + * + * @param group OnapPDPGroup + */ public void makeDefault(OnapPDPGroup group) { try { this.papEngine.setDefaultGroup(group); @@ -143,6 +152,13 @@ public class PDPGroupContainer extends PolicyItemSetChangeNotifier return; } + /** + * removeGroup. + * + * @param group OnapPDPGroup + * @param newGroup OnapPDPGroup + * @throws PAPException PAPException + */ public void removeGroup(OnapPDPGroup group, OnapPDPGroup newGroup) throws PAPException { if (LOGGER.isTraceEnabled()) { LOGGER.trace("removeGroup: " + group + " new group for PDPs: " + newGroup); @@ -158,6 +174,13 @@ public class PDPGroupContainer extends PolicyItemSetChangeNotifier } } + /** + * removePDP. + * + * @param pdp OnapPDP + * @param group OnapPDPGroup + * @throws PAPException PAPException + */ public void removePDP(OnapPDP pdp, OnapPDPGroup group) throws PAPException { if (LOGGER.isTraceEnabled()) { LOGGER.trace("removePDP: " + pdp + " from group: " + group); @@ -170,6 +193,11 @@ public class PDPGroupContainer extends PolicyItemSetChangeNotifier } } + /** + * updatePDP. + * + * @param pdp OnapPDP + */ public void updatePDP(OnapPDP pdp) { try { papEngine.updatePDP(pdp); @@ -178,6 +206,11 @@ public class PDPGroupContainer extends PolicyItemSetChangeNotifier } } + /** + * updateGroup. + * + * @param group OnapPDPGroup + */ public void updateGroup(OnapPDPGroup group) { try { papEngine.updateGroup(group); @@ -215,6 +248,17 @@ public class PDPGroupContainer extends PolicyItemSetChangeNotifier return Collections.unmodifiableCollection(items); } + @Override + public List getItemIds(int startIndex, int numberOfItems) { + synchronized (this.groups) { + int endIndex = startIndex + numberOfItems; + if (endIndex > this.groups.size()) { + endIndex = this.groups.size() - 1; + } + return this.groups.subList(startIndex, endIndex); + } + } + @Override public Class getType(Object propertyId) { if (propertyId.equals(PROPERTY_ID)) { @@ -268,6 +312,13 @@ public class PDPGroupContainer extends PolicyItemSetChangeNotifier throw new UnsupportedOperationException("PDP Container cannot add a given item."); } + /** + * addNewGroup. + * + * @param name String + * @param description String + * @throws PAPException PAPException + */ public void addNewGroup(String name, String description) throws PAPException { if (LOGGER.isTraceEnabled()) { LOGGER.trace("addNewGroup " + name + " " + description); @@ -275,6 +326,16 @@ public class PDPGroupContainer extends PolicyItemSetChangeNotifier this.papEngine.newGroup(name, description); } + /** + * addNewPDP. + * + * @param id String + * @param group OnapPDPGroup + * @param name String + * @param description String + * @param jmxport int + * @throws PAPException PAPException + */ public void addNewPDP(String id, OnapPDPGroup group, String name, String description, int jmxport) throws PAPException { if (LOGGER.isTraceEnabled()) { @@ -283,6 +344,12 @@ public class PDPGroupContainer extends PolicyItemSetChangeNotifier this.papEngine.newPDP(id, group, name, description, jmxport); } + /** + * movePDP. + * + * @param pdp OnapPDP + * @param group OnapPDPGroup + */ public void movePDP(OnapPDP pdp, OnapPDPGroup group) { try { this.papEngine.movePDP(pdp, group); @@ -426,17 +493,6 @@ public class PDPGroupContainer extends PolicyItemSetChangeNotifier return this.groups.get(index); } - @Override - public List getItemIds(int startIndex, int numberOfItems) { - synchronized (this.groups) { - int endIndex = startIndex + numberOfItems; - if (endIndex > this.groups.size()) { - endIndex = this.groups.size() - 1; - } - return this.groups.subList(startIndex, endIndex); - } - } - @Override public Object addItemAt(int index) { throw new UnsupportedOperationException("Cannot addItemAt");