Sonar cleanup in controllers etc
[policy/engine.git] / POLICY-SDK-APP / src / main / java / org / onap / policy / model / PDPGroupContainer.java
index e6c3758..6c4fd7e 100644 (file)
@@ -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");