aboutsummaryrefslogtreecommitdiffstats
path: root/integrity-monitor/src
diff options
context:
space:
mode:
authorMagnusen, Drew (dm741q) <dm741q@att.com>2017-07-25 12:25:52 -0500
committerMagnusen, Drew (dm741q) <dm741q@att.com>2017-07-25 14:19:50 -0500
commitae2b3da4f94f0ba59708042912c941732243496f (patch)
tree94517def2c3cb5d7d2d10dd74da0e2d20b4ac5ac /integrity-monitor/src
parent85f5fade13c0c326c808cea21d85e79814fd862a (diff)
[POLICY-81] Code cleanup to eliminate the presence of warning messages in Eclipse.
Change-Id: Id98fdf0241487d56707ac91cde47975c91225f3c Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
Diffstat (limited to 'integrity-monitor/src')
-rw-r--r--integrity-monitor/src/main/java/org/openecomp/policy/common/im/IntegrityMonitor.java10
-rw-r--r--integrity-monitor/src/main/java/org/openecomp/policy/common/im/StandbyStatusException.java5
-rw-r--r--integrity-monitor/src/main/java/org/openecomp/policy/common/im/StateElement.java4
-rw-r--r--integrity-monitor/src/main/java/org/openecomp/policy/common/im/StateManagement.java6
-rw-r--r--integrity-monitor/src/main/java/org/openecomp/policy/common/im/StateTransition.java8
-rw-r--r--integrity-monitor/src/main/java/org/openecomp/policy/common/im/jmx/JmxAgentConnection.java2
-rw-r--r--integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/ForwardProgressEntity.java1
-rw-r--r--integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/ImTestEntity.java6
-rw-r--r--integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/ResourceRegistrationEntity.java1
-rw-r--r--integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/StateManagementEntity.java1
-rw-r--r--integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/IntegrityMonitorTest.java13
-rw-r--r--integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/StateManagementEntityTest.java4
-rw-r--r--integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/StateManagementTest.java22
-rw-r--r--integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/StateTransitionTest.java17
14 files changed, 17 insertions, 83 deletions
diff --git a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/IntegrityMonitor.java b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/IntegrityMonitor.java
index 57182f7a..4e573d8c 100644
--- a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/IntegrityMonitor.java
+++ b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/IntegrityMonitor.java
@@ -62,7 +62,6 @@ public class IntegrityMonitor {
private static IntegrityMonitor instance = null;
private static String resourceName = null;
- private boolean fpcError = false;
boolean alarmExists = false;
/*
@@ -79,7 +78,6 @@ public class IntegrityMonitor {
// Persistence Unit for JPA
private static final String PERSISTENCE_UNIT = "operationalPU";
- private ComponentAdmin admin = null;
private StateManagement stateManager = null;
private static final int CYCLE_INTERVAL_MILLIS = 1000;
@@ -350,13 +348,12 @@ public class IntegrityMonitor {
// create management bean
try {
- admin = new ComponentAdmin(resourceName, this, stateManager);
+ new ComponentAdmin(resourceName, this, stateManager);
} catch (Exception e) {
logger.error("ComponentAdmin constructor exception: " + e.toString());
}
- // create FPManager inner class
- FPManager fpMonitor = new FPManager();
+ new FPManager();
}
@@ -1244,8 +1241,6 @@ public class IntegrityMonitor {
// no forward progress
missedCycles += 1;
if (missedCycles >= failedCounterThreshold && !alarmExists) {
- // set op state to disabled failed
- fpcError = true;
logger.info("Forward progress not detected for resource " + resourceName + ". Setting state to disable failed.");
if(!(stateManager.getOpState()).equals(StateManagement.DISABLED)){
// Note: The refreshStateAudit will make redundant calls
@@ -1258,7 +1253,6 @@ public class IntegrityMonitor {
// forward progress has occurred
lastFpCounter = fpCounter;
missedCycles = 0;
- fpcError = false;
// set op state to enabled
logger.debug("Forward progress detected for resource " + resourceName + ". Setting state to enable not failed.");
if(!(stateManager.getOpState()).equals(StateManagement.ENABLED)){
diff --git a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/StandbyStatusException.java b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/StandbyStatusException.java
index 3167dded..1de08b0e 100644
--- a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/StandbyStatusException.java
+++ b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/StandbyStatusException.java
@@ -21,6 +21,11 @@
package org.openecomp.policy.common.im;
public class StandbyStatusException extends Exception {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -5262512285108747134L;
+
public StandbyStatusException()
{
}
diff --git a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/StateElement.java b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/StateElement.java
index 6c6ce59c..ad60b46d 100644
--- a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/StateElement.java
+++ b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/StateElement.java
@@ -20,8 +20,6 @@
package org.openecomp.policy.common.im;
-import java.util.*;
-
//import org.apache.log4j.Logger;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
@@ -40,7 +38,7 @@ public class StateElement {
String endingStandbyStatus = null;
String exception = null;
- public void StateElement()
+ public StateElement()
{
}
diff --git a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/StateManagement.java b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/StateManagement.java
index fd0f3d9f..d86cfcfb 100644
--- a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/StateManagement.java
+++ b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/StateManagement.java
@@ -34,7 +34,6 @@ import javax.persistence.Query;
import org.openecomp.policy.common.im.jpa.StateManagementEntity;
import org.openecomp.policy.common.im.StateElement;
import org.openecomp.policy.common.im.StandbyStatusException;
-import org.openecomp.policy.common.im.StateChangeNotifier;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
@@ -73,16 +72,12 @@ public class StateManagement extends Observable {
public static final String AVAILABLE_STATUS= "availStatus";
public static final String STANDBY_STATUS = "standbyStatus";
- private static final String REMOVE = "remove";
- private static final String ADD = "add";
-
private String resourceName = null;
private String adminState = null;
private String opState = null;
private String availStatus = null;
private String standbyStatus = null;
private EntityManager em;
- private EntityManagerFactory emf = null;
private StateTransition st = null;
/*
@@ -108,7 +103,6 @@ public class StateManagement extends Observable {
public StateManagement(EntityManagerFactory emf, String resourceName) throws Exception
{
logger.debug("StateManagement: constructor, resourceName: " + resourceName);
- this.emf = emf;
em = emf.createEntityManager();
EntityTransaction et = em.getTransaction();
diff --git a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/StateTransition.java b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/StateTransition.java
index 3bc5bbc7..c3805340 100644
--- a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/StateTransition.java
+++ b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/StateTransition.java
@@ -126,7 +126,7 @@ public class StateTransition {
}
String key = adminState + "," + opState + "," + availStatus2 + "," + standbyStatus + "," + actionName;
logger.debug("Ending State search key: " + key);
- String value = (String)StateTable.get(key);
+ String value = StateTable.get(key);
if (value != null) {
try {
@@ -715,11 +715,11 @@ public class StateTransition {
public void displayStateTable()
{
- Set set = StateTable.entrySet();
- Iterator iter = set.iterator();
+ Set<?> set = StateTable.entrySet();
+ Iterator<?> iter = set.iterator();
while(iter.hasNext()) {
- Map.Entry me = (Map.Entry)iter.next();
+ Map.Entry<?, ?> me = (Map.Entry<?, ?>)iter.next();
logger.debug((String)me.getKey() + ((String)me.getValue()).replace(".", ","));
}
}
diff --git a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jmx/JmxAgentConnection.java b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jmx/JmxAgentConnection.java
index 4940c4d2..bc28c485 100644
--- a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jmx/JmxAgentConnection.java
+++ b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jmx/JmxAgentConnection.java
@@ -26,8 +26,6 @@ package org.openecomp.policy.common.im.jmx;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
-import java.util.Properties;
-
import javax.management.MBeanServerConnection;
import javax.management.Notification;
import javax.management.NotificationListener;
diff --git a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/ForwardProgressEntity.java b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/ForwardProgressEntity.java
index 4662f581..99a0d0ad 100644
--- a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/ForwardProgressEntity.java
+++ b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/ForwardProgressEntity.java
@@ -32,7 +32,6 @@ import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
-import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
diff --git a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/ImTestEntity.java b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/ImTestEntity.java
index 0eee38b0..c7ae0abc 100644
--- a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/ImTestEntity.java
+++ b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/ImTestEntity.java
@@ -28,19 +28,13 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
-import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
-import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
-import javax.persistence.Version;
-/*
- * The Entity class to persist a policy object Action Body
- */
@Entity
@Table(name="ImTestEntity")
diff --git a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/ResourceRegistrationEntity.java b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/ResourceRegistrationEntity.java
index c7eec085..29443088 100644
--- a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/ResourceRegistrationEntity.java
+++ b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/ResourceRegistrationEntity.java
@@ -32,7 +32,6 @@ import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
-import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
diff --git a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/StateManagementEntity.java b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/StateManagementEntity.java
index b747c8f9..737daec3 100644
--- a/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/StateManagementEntity.java
+++ b/integrity-monitor/src/main/java/org/openecomp/policy/common/im/jpa/StateManagementEntity.java
@@ -31,7 +31,6 @@ import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
-import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
diff --git a/integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/IntegrityMonitorTest.java b/integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/IntegrityMonitorTest.java
index d2fbac46..8e8720da 100644
--- a/integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/IntegrityMonitorTest.java
+++ b/integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/IntegrityMonitorTest.java
@@ -49,7 +49,6 @@ import org.openecomp.policy.common.im.IntegrityMonitor;
import org.openecomp.policy.common.im.IntegrityMonitorProperties;
import org.openecomp.policy.common.im.StateManagement;
import org.openecomp.policy.common.im.jpa.ForwardProgressEntity;
-import org.openecomp.policy.common.im.jpa.ImTestEntity;
import org.openecomp.policy.common.im.jpa.ResourceRegistrationEntity;
import org.openecomp.policy.common.im.jpa.StateManagementEntity;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
@@ -603,9 +602,8 @@ public class IntegrityMonitorTest {
StateManagement stateManager = new StateManagement(emf, "group2_dep1");
stateManager.lock();
- //Now add new group1 stateManager instances
- StateManagement sm2 = new StateManagement(emf, "group1_dep1");
- StateManagement sm3 = new StateManagement(emf, "group1_dep2");
+ new StateManagement(emf, "group1_dep1");
+ new StateManagement(emf, "group1_dep2");
boolean sanityPass = true;
Thread.sleep(15000);
@@ -658,7 +656,7 @@ public class IntegrityMonitorTest {
IntegrityMonitor.deleteInstance();
- IntegrityMonitor im = IntegrityMonitor.getInstance(resourceName, myProp);
+ IntegrityMonitor.getInstance(resourceName, myProp);
//the state here is unlocked, enabled, null, null
StateManagementEntity sme = null;
@@ -790,8 +788,7 @@ public class IntegrityMonitorTest {
em.flush();
et.commit();
- //Now add new group1 stateManager instances
- StateManagement sm2 = new StateManagement(emf, "group1_dep1");
+ new StateManagement(emf, "group1_dep1");
boolean sanityPass = true;
//Thread.sleep(15000);
@@ -990,7 +987,7 @@ public class IntegrityMonitorTest {
logger.debug("\nIntegrityMonitorTest:testStateAudit getting list of StateManagementEntity entries\n\n");
Query query = em.createQuery("SELECT s FROM StateManagementEntity s");
- List smeList = query.getResultList();
+ List<?> smeList = query.getResultList();
logger.debug("\n\n");
logger.debug("IntegrityMonitorTest:testStateAudit:StateManagementEntity entries");
diff --git a/integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/StateManagementEntityTest.java b/integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/StateManagementEntityTest.java
index b4222568..6116ef07 100644
--- a/integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/StateManagementEntityTest.java
+++ b/integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/StateManagementEntityTest.java
@@ -20,9 +20,6 @@
package org.openecomp.policy.common.im.test;
-import static org.junit.Assert.*;
-
-import java.util.Date;
import java.util.List;
import java.util.Properties;
@@ -160,7 +157,6 @@ public class StateManagementEntityTest {
//Just test that we are retrieving the right object
@SuppressWarnings("rawtypes")
List resourceList = query.getResultList();
- String resource = null;
if (!resourceList.isEmpty()) {
// exist
StateManagementEntity sme2 = (StateManagementEntity) resourceList.get(0);
diff --git a/integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/StateManagementTest.java b/integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/StateManagementTest.java
index f51f5ac7..92fc225c 100644
--- a/integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/StateManagementTest.java
+++ b/integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/StateManagementTest.java
@@ -20,38 +20,16 @@
package org.openecomp.policy.common.im.test;
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.List;
import java.util.Properties;
-import java.util.StringTokenizer;
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-
-import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.LockModeType;
-import javax.persistence.PersistenceException;
-import javax.persistence.Query;
-
-
-
-
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.openecomp.policy.common.im.StateManagement;
-import org.openecomp.policy.common.im.StateTransition;
import org.openecomp.policy.common.im.StandbyStatusException;
import org.openecomp.policy.common.im.StateChangeNotifier;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
diff --git a/integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/StateTransitionTest.java b/integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/StateTransitionTest.java
index d76cad0d..d90e27bc 100644
--- a/integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/StateTransitionTest.java
+++ b/integrity-monitor/src/test/java/org/openecomp/policy/common/im/test/StateTransitionTest.java
@@ -20,21 +20,8 @@
package org.openecomp.policy.common.im.test;
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.List;
import java.util.Properties;
-import java.util.StringTokenizer;
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-
-import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
-import javax.persistence.EntityTransaction;
-import javax.persistence.Persistence;
-
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -46,8 +33,6 @@ import org.junit.Test;
import org.openecomp.policy.common.im.StateTransition;
import org.openecomp.policy.common.im.StateElement;
-import org.openecomp.policy.common.im.StandbyStatusException;
-import org.openecomp.policy.common.im.StateChangeNotifier;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
/*
@@ -90,8 +75,6 @@ public class StateTransitionTest {
@Test
public void testJPA() throws Exception {
logger.info("\n\nlogger.infor StateTransitionTest: Entering\n\n");
- boolean standbyExceptionThrown = false;
-
//These parameters are in a properties file
EntityManagerFactory emf = null;
try {