aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common-logging/src/main/java/org/openecomp/policy/common/logging/ECOMPLoggingContext.java8
-rw-r--r--common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/ErrorCodeMap.java3
-rw-r--r--common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/EventData.java2
-rw-r--r--common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/EventTrackInfo.java6
-rw-r--r--common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/EventTrackInfoHandler.java2
-rw-r--r--common-logging/src/main/java/org/openecomp/policy/common/logging/flexlogger/EelfLogger.java12
-rw-r--r--common-logging/src/main/java/org/openecomp/policy/common/logging/flexlogger/Logger4J.java6
-rw-r--r--common-logging/src/main/java/org/openecomp/policy/common/logging/flexlogger/SystemOutLogger.java6
-rw-r--r--integrity-audit/src/main/java/org/openecomp/policy/common/ia/DbDAO.java1
-rw-r--r--integrity-audit/src/main/java/org/openecomp/policy/common/ia/jpa/IntegrityAuditEntity.java1
-rw-r--r--integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditCompareEntriesTest.java7
-rw-r--r--integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditTest.java1
-rw-r--r--integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbDAOTest.java24
-rw-r--r--integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/jpa/IaTestEntity.java6
-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
-rw-r--r--site-manager/src/main/java/org/openecomp/policy/common/sitemanager/Main.java6
29 files changed, 53 insertions, 138 deletions
diff --git a/common-logging/src/main/java/org/openecomp/policy/common/logging/ECOMPLoggingContext.java b/common-logging/src/main/java/org/openecomp/policy/common/logging/ECOMPLoggingContext.java
index e6e2b1ca..606e872d 100644
--- a/common-logging/src/main/java/org/openecomp/policy/common/logging/ECOMPLoggingContext.java
+++ b/common-logging/src/main/java/org/openecomp/policy/common/logging/ECOMPLoggingContext.java
@@ -24,18 +24,10 @@ package org.openecomp.policy.common.logging;
//import static org.openecomp.policy.common.logging.eelf.Configuration.TRANSACTION_ELAPSED_TIME;
//import static org.openecomp.policy.common.logging.eelf.Configuration.TRANSACTION_END_TIME_STAMP;
-import static com.att.eelf.configuration.Configuration.MDC_ALERT_SEVERITY;
-import static com.att.eelf.configuration.Configuration.MDC_INSTANCE_UUID;
-
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.Instant;
-import java.time.ZoneOffset;
import java.util.Date;
-import java.util.Properties;
-import java.util.Timer;
-import java.util.TimerTask;
-
import org.slf4j.MDC;
import org.openecomp.policy.common.logging.nsa.LoggingContextFactory;
diff --git a/common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/ErrorCodeMap.java b/common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/ErrorCodeMap.java
index 4e4457d0..abd972e1 100644
--- a/common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/ErrorCodeMap.java
+++ b/common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/ErrorCodeMap.java
@@ -21,7 +21,6 @@
package org.openecomp.policy.common.logging.eelf;
import java.util.HashMap;
-import java.util.Map;
/**
*
@@ -31,7 +30,7 @@ import java.util.Map;
public class ErrorCodeMap {
- public static HashMap<MessageCodes, ErrorCodeInfo> hm = new HashMap();
+ public static HashMap<MessageCodes, ErrorCodeInfo> hm = new HashMap<MessageCodes, ErrorCodeInfo>();
private static String ERROR_PERMISSIONS = "POLICY-100E";
private static String ERROR_PERMISSIONS_DESCRIPTION = "This is a Permissions Error. Please check the error message for detail information";
diff --git a/common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/EventData.java b/common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/EventData.java
index eb0bffc7..d26a4977 100644
--- a/common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/EventData.java
+++ b/common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/EventData.java
@@ -22,8 +22,6 @@ package org.openecomp.policy.common.logging.eelf;
import java.time.Instant;
-import javax.swing.text.html.parser.Entity;
-
/**
*
* EventData can be used for logging a rule event.
diff --git a/common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/EventTrackInfo.java b/common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/EventTrackInfo.java
index c6ed63d4..f1b7afb5 100644
--- a/common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/EventTrackInfo.java
+++ b/common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/EventTrackInfo.java
@@ -20,14 +20,8 @@
package org.openecomp.policy.common.logging.eelf;
-import java.io.IOException;
-import java.time.Instant;
-import java.util.Properties;
-import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
-import org.openecomp.policy.common.logging.flexlogger.PropertyUtil;
-
/**
*
* EventTrackInfo contains a ConcurrentHashMap of EventData
diff --git a/common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/EventTrackInfoHandler.java b/common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/EventTrackInfoHandler.java
index a947ed01..e45f8998 100644
--- a/common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/EventTrackInfoHandler.java
+++ b/common-logging/src/main/java/org/openecomp/policy/common/logging/eelf/EventTrackInfoHandler.java
@@ -23,8 +23,6 @@ package org.openecomp.policy.common.logging.eelf;
import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Timer;
import java.util.TimerTask;
/**
diff --git a/common-logging/src/main/java/org/openecomp/policy/common/logging/flexlogger/EelfLogger.java b/common-logging/src/main/java/org/openecomp/policy/common/logging/flexlogger/EelfLogger.java
index 31c17554..106c734c 100644
--- a/common-logging/src/main/java/org/openecomp/policy/common/logging/flexlogger/EelfLogger.java
+++ b/common-logging/src/main/java/org/openecomp/policy/common/logging/flexlogger/EelfLogger.java
@@ -36,14 +36,18 @@ import com.att.eelf.configuration.EELFLogger.Level;
public class EelfLogger implements Logger, Serializable {
- private String className = "";
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5385586713941277192L;
+ private String className = "";
private String transId = UUID.randomUUID().toString();
/**
* Constructor
* @param clazz
*/
- public EelfLogger(Class clazz) {
+ public EelfLogger(Class<?> clazz) {
if(clazz != null){
className = clazz.getName();
}
@@ -66,7 +70,7 @@ public class EelfLogger implements Logger, Serializable {
* @param clazz
* @param isNewTransaction
*/
- public EelfLogger(Class clazz, boolean isNewTransaction) {
+ public EelfLogger(Class<?> clazz, boolean isNewTransaction) {
if(clazz != null){
className = clazz.getName();
}
@@ -98,7 +102,7 @@ public class EelfLogger implements Logger, Serializable {
* @param clazz
* @param transId
*/
- public EelfLogger(Class clazz, String transId) {
+ public EelfLogger(Class<?> clazz, String transId) {
if(clazz != null){
className = clazz.getName();
}
diff --git a/common-logging/src/main/java/org/openecomp/policy/common/logging/flexlogger/Logger4J.java b/common-logging/src/main/java/org/openecomp/policy/common/logging/flexlogger/Logger4J.java
index 23cafb41..506e1ea7 100644
--- a/common-logging/src/main/java/org/openecomp/policy/common/logging/flexlogger/Logger4J.java
+++ b/common-logging/src/main/java/org/openecomp/policy/common/logging/flexlogger/Logger4J.java
@@ -40,6 +40,10 @@ import com.att.eelf.configuration.EELFLogger.Level;
*/
public class Logger4J implements org.openecomp.policy.common.logging.flexlogger.Logger, Serializable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3183729429888828471L;
private Logger log = null;
private String methodName = "";
private String className = "";
@@ -49,7 +53,7 @@ public class Logger4J implements org.openecomp.policy.common.logging.flexlogger.
* Constructor
* @param clazz
*/
- public Logger4J (Class clazz){
+ public Logger4J (Class<?> clazz){
System.out.println("create instance of Logger4J");
if(clazz != null){
log = Logger.getLogger(clazz);
diff --git a/common-logging/src/main/java/org/openecomp/policy/common/logging/flexlogger/SystemOutLogger.java b/common-logging/src/main/java/org/openecomp/policy/common/logging/flexlogger/SystemOutLogger.java
index 91e16b97..596914a2 100644
--- a/common-logging/src/main/java/org/openecomp/policy/common/logging/flexlogger/SystemOutLogger.java
+++ b/common-logging/src/main/java/org/openecomp/policy/common/logging/flexlogger/SystemOutLogger.java
@@ -34,6 +34,10 @@ import com.att.eelf.configuration.EELFLogger.Level;
*/
public class SystemOutLogger implements Logger, Serializable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 4956408061058933929L;
private String className = "";
private boolean isDebugEnabled = true;
private boolean isInfoEnabled = true;
@@ -47,7 +51,7 @@ public class SystemOutLogger implements Logger, Serializable {
* Constructor
* @param clazz
*/
- public SystemOutLogger (Class clazz){
+ public SystemOutLogger (Class<?> clazz){
System.out.println("create instance of SystemOutLogger");
if(clazz != null){
className = clazz.getName();
diff --git a/integrity-audit/src/main/java/org/openecomp/policy/common/ia/DbDAO.java b/integrity-audit/src/main/java/org/openecomp/policy/common/ia/DbDAO.java
index 70f39a2b..5ab16d58 100644
--- a/integrity-audit/src/main/java/org/openecomp/policy/common/ia/DbDAO.java
+++ b/integrity-audit/src/main/java/org/openecomp/policy/common/ia/DbDAO.java
@@ -42,7 +42,6 @@ import javax.persistence.metamodel.Metamodel;
//import org.apache.log4j.Logger;
-import org.openecomp.policy.common.ia.IntegrityAuditProperties.NodeTypeEnum;
import org.openecomp.policy.common.ia.jpa.IntegrityAuditEntity;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
diff --git a/integrity-audit/src/main/java/org/openecomp/policy/common/ia/jpa/IntegrityAuditEntity.java b/integrity-audit/src/main/java/org/openecomp/policy/common/ia/jpa/IntegrityAuditEntity.java
index 3d50d835..21b200c8 100644
--- a/integrity-audit/src/main/java/org/openecomp/policy/common/ia/jpa/IntegrityAuditEntity.java
+++ b/integrity-audit/src/main/java/org/openecomp/policy/common/ia/jpa/IntegrityAuditEntity.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-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditCompareEntriesTest.java b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditCompareEntriesTest.java
index 5b3c7550..e2fd922d 100644
--- a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditCompareEntriesTest.java
+++ b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditCompareEntriesTest.java
@@ -340,12 +340,9 @@ public class DbAuditCompareEntriesTest {
dbDAO = new DbDAO(resourceName, persistenceUnit, properties);
DbAudit dbAudit = new DbAudit(dbDAO);
- @SuppressWarnings("unused")
- String className = null;
HashSet<String> classNameSet = dbDAO.getPersistenceClassNames();
HashSet<Object> mismatchResult = new HashSet<Object>();
for(String c : classNameSet) {
- className = c;
if (c.equals("org.openecomp.policy.common.ia.jpa.IntegrityAuditEntity")){
String resourceName1 = resourceName;
String resourceName2 = resourceName;
@@ -529,12 +526,12 @@ public class DbAuditCompareEntriesTest {
// Add entries into DB1
dbDAO = new DbDAO(resourceName, persistenceUnit, properties);
- DbDAO dbDAO2 = new DbDAO("pdp2", persistenceUnit, properties);
+ new DbDAO("pdp2", persistenceUnit, properties);
DbAudit dbAudit = new DbAudit(dbDAO);
// Add entries into DB2
DbDAO dbDAO3 = new DbDAO(resourceName, persistenceUnit, properties2);
- DbDAO dbDAO4 = new DbDAO("pdp2", persistenceUnit, properties2);
+ new DbDAO("pdp2", persistenceUnit, properties2);
// Pull all entries and compare
HashSet<String> classNameSet = dbDAO.getPersistenceClassNames();
diff --git a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditTest.java b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditTest.java
index 21e3bfab..82ea8669 100644
--- a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditTest.java
+++ b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditTest.java
@@ -27,7 +27,6 @@ import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.util.Date;
-import java.util.HashSet;
import java.util.List;
import java.util.Properties;
diff --git a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbDAOTest.java b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbDAOTest.java
index 351fe5f8..3bd847c2 100644
--- a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbDAOTest.java
+++ b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbDAOTest.java
@@ -228,9 +228,9 @@ public class DbDAOTest {
try {
// Add some entries to the DB
d = new DbDAO(resourceName, persistenceUnit, properties);
- DbDAO d2 = new DbDAO("pdp1", persistenceUnit, properties);
+ new DbDAO("pdp1", persistenceUnit, properties);
properties.put(IntegrityAuditProperties.NODE_TYPE, "pdp_drools");
- DbDAO d3 = new DbDAO("pdp2", persistenceUnit, properties);
+ new DbDAO("pdp2", persistenceUnit, properties);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -474,8 +474,8 @@ public class DbDAOTest {
try {
// create entries for the IntegrityAuditEntity table
d = new DbDAO(resourceName, persistenceUnit, properties);
- DbDAO d2 = new DbDAO("pdp1", persistenceUnit, properties);
- DbDAO d3 = new DbDAO("pdp2", persistenceUnit, properties);
+ new DbDAO("pdp1", persistenceUnit, properties);
+ new DbDAO("pdp2", persistenceUnit, properties);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -516,8 +516,8 @@ public class DbDAOTest {
try {
// create entries for the IntegrityAuditEntity table
d = new DbDAO(resourceName, persistenceUnit, properties);
- DbDAO d2 = new DbDAO("pdp1", persistenceUnit, properties);
- DbDAO d3 = new DbDAO("pdp2", persistenceUnit, properties);
+ new DbDAO("pdp1", persistenceUnit, properties);
+ new DbDAO("pdp2", persistenceUnit, properties);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -578,8 +578,8 @@ public class DbDAOTest {
try {
// create entries for the IntegrityAuditEntity table
d = new DbDAO(resourceName, persistenceUnit, properties);
- DbDAO d2 = new DbDAO("pdp1", persistenceUnit, properties);
- DbDAO d3 = new DbDAO("pdp2", persistenceUnit, properties);
+ new DbDAO("pdp1", persistenceUnit, properties);
+ new DbDAO("pdp2", persistenceUnit, properties);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -620,8 +620,8 @@ public class DbDAOTest {
try {
// create entries for the IntegrityAuditEntity table
d = new DbDAO(resourceName, persistenceUnit, properties);
- DbDAO d2 = new DbDAO("pdp1", persistenceUnit, properties);
- DbDAO d3 = new DbDAO("pdp2", persistenceUnit, properties);
+ new DbDAO("pdp1", persistenceUnit, properties);
+ new DbDAO("pdp2", persistenceUnit, properties);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -682,8 +682,8 @@ public class DbDAOTest {
try {
// create entries for the IntegrityAuditEntity table
d = new DbDAO(resourceName, persistenceUnit, properties);
- DbDAO d2 = new DbDAO("pdp1", persistenceUnit, properties);
- DbDAO d3 = new DbDAO("pdp2", persistenceUnit, properties);
+ new DbDAO("pdp1", persistenceUnit, properties);
+ new DbDAO("pdp2", persistenceUnit, properties);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
diff --git a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/jpa/IaTestEntity.java b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/jpa/IaTestEntity.java
index e875fa3d..21b09460 100644
--- a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/jpa/IaTestEntity.java
+++ b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/jpa/IaTestEntity.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="IaTestEntity")
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 {
diff --git a/site-manager/src/main/java/org/openecomp/policy/common/sitemanager/Main.java b/site-manager/src/main/java/org/openecomp/policy/common/sitemanager/Main.java
index 52f36e33..5bb8474e 100644
--- a/site-manager/src/main/java/org/openecomp/policy/common/sitemanager/Main.java
+++ b/site-manager/src/main/java/org/openecomp/policy/common/sitemanager/Main.java
@@ -597,13 +597,13 @@ public class Main
String formatString = sb.toString();
// display column headers
- System.out.printf(formatString, labels);
- System.out.printf(formatString, underlines);
+ System.out.printf(formatString, (Object[])labels);
+ System.out.printf(formatString, (Object[])underlines);
// display all of the rows
for (String[] values : treeset)
{
- System.out.printf(formatString, values);
+ System.out.printf(formatString, (Object[])values);
}
}
}