Addressing technical debt integrity-monitor 37/30037/1
authorPamela Dragosh <pdragosh@research.att.com>
Thu, 1 Feb 2018 19:17:30 +0000 (14:17 -0500)
committerPamela Dragosh <pdragosh@research.att.com>
Thu, 1 Feb 2018 19:17:39 +0000 (14:17 -0500)
Issue-ID: POLICY-457
Change-Id: I6e4bc00bc85f73bcb4c58c54378f062d98e6876d
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
integrity-monitor/src/main/java/org/onap/policy/common/im/AdministrativeStateException.java
integrity-monitor/src/main/java/org/onap/policy/common/im/ForwardProgressException.java
integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java
integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitorException.java
integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitorPropertiesException.java
integrity-monitor/src/main/java/org/onap/policy/common/im/StandbyStatusException.java
integrity-monitor/src/main/java/org/onap/policy/common/im/StateElement.java
integrity-monitor/src/main/java/org/onap/policy/common/im/StateManagementException.java
integrity-monitor/src/main/java/org/onap/policy/common/im/StateTransition.java
integrity-monitor/src/main/java/org/onap/policy/common/im/StateTransitionException.java
integrity-monitor/src/main/java/org/onap/policy/common/im/jmx/JmxAgentConnection.java

index 048124b..31be3ce 100644 (file)
@@ -23,6 +23,7 @@ package org.onap.policy.common.im;
 public class AdministrativeStateException extends Exception{
        private static final long serialVersionUID = 1L;
        public AdministrativeStateException() {
+               super();
        }
        public AdministrativeStateException(String message) {
                super(message);
index 6f54cc9..fd545cd 100644 (file)
@@ -23,6 +23,7 @@ package org.onap.policy.common.im;
 public class ForwardProgressException extends Exception{
        private static final long serialVersionUID = 1L;
        public ForwardProgressException() {
+               super();
        }
        public ForwardProgressException(String message) {
                super(message);
index 4a09d66..17223ba 100644 (file)
@@ -1157,8 +1157,8 @@ public class IntegrityMonitor {
                                         * allow the the forward progress counter to advance.
                                         */
                                        String msg = "allNotWellMap:";
-                                       for(String key: allNotWellMap.keySet()){
-                                               msg = msg.concat("\nkey = " + key + " msg = " + allNotWellMap.get(key));
+                                       for(Entry<String, String> entry: allNotWellMap.entrySet()){
+                                               msg = msg.concat("\nkey = " + entry.getKey() + " msg = " + entry.getValue());
                                        }
                                        logger.error("endTransaction: allNotWellMap is NOT EMPTY.  Not advancing forward"
                                                        + "progress counter. \n{}\n", msg);
@@ -1168,8 +1168,8 @@ public class IntegrityMonitor {
                                                if(getAllSeemsWellMap() != null){
                                                        if(!(getAllSeemsWellMap().isEmpty())){
                                                                String msg = "allSeemsWellMap:";
-                                                               for(String key: allSeemsWellMap.keySet()){
-                                                                       msg = msg.concat("\nkey = " + key + " msg = " + allSeemsWellMap.get(key));
+                                                               for(Entry<String, String> entry: allSeemsWellMap.entrySet()){
+                                                                       msg = msg.concat("\nkey = " + entry.getKey() + " msg = " + entry.getValue());
                                                                }
                                                                logger.debug("endTransaction: allNotWellMap IS EMPTY and allSeemsWellMap is NOT EMPTY.  Advancing forward"
                                                                                + "progress counter. \n{}\n", msg);
@@ -1941,11 +1941,11 @@ public class IntegrityMonitor {
                }
 
                if(logger.isDebugEnabled()){
-                       for(Entry<String, String> ent: allSeemsWellMap.entrySet()) {
-                               logger.debug("allSeemsWellMap: key = {}  msg = {}", ent.getKey(), ent.getValue());                                                      
+                       for(Entry<String, String> entry: allSeemsWellMap.entrySet()){
+                               logger.debug("allSeemsWellMap: key = {}  msg = {}", entry.getKey(), entry.getValue());                                                  
                        }
-                       for(Entry<String, String> ent: allNotWellMap.entrySet()) {
-                               logger.debug("allNotWellMap: key = {}  msg = {}", ent.getKey(), ent.getValue());                                                        
+                       for(Entry<String, String> entry: allNotWellMap.entrySet()){
+                               logger.debug("allNotWellMap: key = {}  msg = {}", entry.getKey(), entry.getValue());                                                    
                        }
                        logger.debug("allSeemsWell exit");
                }
index 95b0a75..072af23 100644 (file)
@@ -23,6 +23,7 @@ package org.onap.policy.common.im;
 public class IntegrityMonitorException extends Exception{
        private static final long serialVersionUID = 1L;
        public IntegrityMonitorException() {
+               super();
        }
        public IntegrityMonitorException(String message) {
                super(message);
index 1d56e28..24a3aeb 100644 (file)
@@ -23,6 +23,7 @@ package org.onap.policy.common.im;
 public class IntegrityMonitorPropertiesException extends Exception{
        private static final long serialVersionUID = 1L;
        public IntegrityMonitorPropertiesException() {
+               super();
        }
        public IntegrityMonitorPropertiesException(String message) {
                super(message);
index 787030d..b871c9f 100644 (file)
@@ -28,6 +28,7 @@ public class StandbyStatusException extends Exception {
 
        public StandbyStatusException()
        {
+               super();
        }
 
        public StandbyStatusException(String message)
index e38971e..fd5afc6 100644 (file)
@@ -40,6 +40,7 @@ public class StateElement {
         
        public StateElement()
        {
+               // Empty constructor
        }
        
        public String getAdminState()
index daebed9..7591c1a 100644 (file)
@@ -23,6 +23,7 @@ package org.onap.policy.common.im;
 public class StateManagementException extends Exception{
        private static final long serialVersionUID = 1L;
        public StateManagementException() {
+               super();
        }
        public StateManagementException(String message) {
                super(message);
index 3f69018..a7f2d0e 100644 (file)
@@ -143,7 +143,7 @@ public class StateTransition {
              
             if (value != null) {
              try {
-                    String parts[] = value.split(",", 5);
+                    String[] parts = value.split(",", 5);
                     stateElement.setEndingAdminState(parts[0].trim());
                     stateElement.setEndingOpState(parts[1].trim());
                     stateElement.setEndingAvailStatus(parts[2].trim().replace(".",  ","));
index 07a4326..3945ddc 100644 (file)
@@ -23,6 +23,7 @@ package org.onap.policy.common.im;
 public class StateTransitionException extends Exception{
        private static final long serialVersionUID = 1L;
        public StateTransitionException() {
+               super();
        }
        public StateTransitionException(String message) {
                super(message);
index 091f2d5..d15fc5e 100644 (file)
@@ -79,10 +79,8 @@ public final class JmxAgentConnection {
         */
        private static String jmxAgentUrl(String host, String port) {
 
-               String url = "service:jmx:rmi:///jndi/rmi://" + host + ":" + port
+               return "service:jmx:rmi:///jndi/rmi://" + host + ":" + port
                                + "/jmxrmi";
-
-               return url;
        }
 
        /**