Fix checkstyle issues in feature-state-management 91/91191/2
authorJim Hahn <jrh3@att.com>
Wed, 10 Jul 2019 21:00:11 +0000 (17:00 -0400)
committerJim Hahn <jrh3@att.com>
Wed, 10 Jul 2019 21:17:22 +0000 (17:17 -0400)
Also deleted the checkstyle suppression file.

Change-Id: I41adf8c09fe0613134876976c6aadd193e38fbaa
Issue-ID: POLICY-1905
Signed-off-by: Jim Hahn <jrh3@att.com>
feature-state-management/checkstyle-suppressions.xml [deleted file]
feature-state-management/pom.xml
feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DbAudit.java
feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java [moved from feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPDPIntegrityMonitor.java with 97% similarity]
feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/IntegrityMonitorRestManager.java
feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java
feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java

diff --git a/feature-state-management/checkstyle-suppressions.xml b/feature-state-management/checkstyle-suppressions.xml
deleted file mode 100644 (file)
index 3c394a9..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  ============LICENSE_START=======================================================
-   Copyright (C) 2018 AT&T Technologies. All rights reserved.
-  ================================================================================
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-  
-       http://www.apache.org/licenses/LICENSE-2.0
-  
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  
-  SPDX-License-Identifier: Apache-2.0
-  ============LICENSE_END=========================================================
--->
-
-<!DOCTYPE suppressions PUBLIC
-     "-//Puppy Crawl//DTD Suppressions 1.0//EN"
-     "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
-<suppressions>
-  <suppress checks="AbbreviationAsWordInName"
-    files="DroolsPDPIntegrityMonitor.java"
-    lines="1-9999"/>
-</suppressions>
index f32276b..95f0fea 100644 (file)
@@ -2,7 +2,7 @@
   ============LICENSE_START=======================================================
   feature-state-management
   ================================================================================
-  Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+  Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
                             <includeTestResources>true</includeTestResources>
                             <excludes>
                             </excludes>
-                            <suppressionsLocation>${project.baseUri}checkstyle-suppressions.xml</suppressionsLocation>
                             <consoleOutput>true</consoleOutput>
                             <failsOnViolation>true</failsOnViolation>
                             <violationSeverity>warning</violationSeverity>
index 108ee6b..b34d64e 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * feature-state-management
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ import org.slf4j.LoggerFactory;
 
 /** This class audits the database.
  */
-public class DbAudit extends DroolsPDPIntegrityMonitor.AuditBase {
+public class DbAudit extends DroolsPdpIntegrityMonitor.AuditBase {
     // get an instance of logger
     private static Logger logger = LoggerFactory.getLogger(DbAudit.class);
     // single global instance of this audit object
@@ -66,7 +66,7 @@ public class DbAudit extends DroolsPDPIntegrityMonitor.AuditBase {
      * Get the instance.
      *  
      * @return the single 'DbAudit' instance. */
-    public static DroolsPDPIntegrityMonitor.AuditBase getInstance() {
+    public static DroolsPdpIntegrityMonitor.AuditBase getInstance() {
         return instance;
     }
 
@@ -36,15 +36,15 @@ import org.slf4j.LoggerFactory;
  * This class extends 'IntegrityMonitor' for use in the 'Drools PDP' virtual machine. The included
  * audits are 'Database' and 'Repository'.
  */
-public class DroolsPDPIntegrityMonitor extends IntegrityMonitor {
+public class DroolsPdpIntegrityMonitor extends IntegrityMonitor {
 
     private static final String INVALID_PROPERTY_VALUE = "init: property {} does not have the expected value of {}";
 
     // get an instance of logger
-    private static final Logger logger = LoggerFactory.getLogger(DroolsPDPIntegrityMonitor.class);
+    private static final Logger logger = LoggerFactory.getLogger(DroolsPdpIntegrityMonitor.class);
 
     // static global instance
-    private static DroolsPDPIntegrityMonitor im = null;
+    private static DroolsPdpIntegrityMonitor im = null;
 
     // list of audits to run
     private static AuditBase[] audits = new AuditBase[] {DbAudit.getInstance(), RepositoryAudit.getInstance()};
@@ -61,7 +61,7 @@ public class DroolsPDPIntegrityMonitor extends IntegrityMonitor {
      * @param properties properties used locally, as well as by 'IntegrityMonitor'
      * @throws IntegrityMonitorException (passed from superclass)
      */
-    private DroolsPDPIntegrityMonitor(String resourceName, Properties consolidatedProperties)
+    private DroolsPdpIntegrityMonitor(String resourceName, Properties consolidatedProperties)
             throws IntegrityMonitorException {
         super(resourceName, consolidatedProperties);
     }
@@ -85,7 +85,7 @@ public class DroolsPDPIntegrityMonitor extends IntegrityMonitor {
      *
      * @throws IntegrityMonitorException exception
      */
-    public static DroolsPDPIntegrityMonitor init(String configDir) throws IntegrityMonitorException {
+    public static DroolsPdpIntegrityMonitor init(String configDir) throws IntegrityMonitorException {
 
         logger.info("init: Entering and invoking PropertyUtil.getProperties() on '{}'", configDir);
 
@@ -150,11 +150,11 @@ public class DroolsPDPIntegrityMonitor extends IntegrityMonitor {
      * @return monitor object
      * @throws IntegrityMonitorException exception
      */
-    private static DroolsPDPIntegrityMonitor makeMonitor(String resourceName, Properties properties)
+    private static DroolsPdpIntegrityMonitor makeMonitor(String resourceName, Properties properties)
             throws IntegrityMonitorException {
 
         try {
-            return new DroolsPDPIntegrityMonitor(resourceName, properties);
+            return new DroolsPdpIntegrityMonitor(resourceName, properties);
 
         } catch (Exception e) {
             throw new IntegrityMonitorException(e);
@@ -426,7 +426,7 @@ public class DroolsPDPIntegrityMonitor extends IntegrityMonitor {
      * @return DroolsPDPIntegrityMonitor object
      * @throws IntegrityMonitorException exception
      */
-    public static DroolsPDPIntegrityMonitor getInstance() throws IntegrityMonitorException {
+    public static DroolsPdpIntegrityMonitor getInstance() throws IntegrityMonitorException {
         if (logger.isDebugEnabled()) {
             logger.debug("getInstance() called");
         }
index 77c188d..7dca9e6 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * feature-state-management
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
 @Path("/")
 public class IntegrityMonitorRestManager {
     private static Logger logger = LoggerFactory.getLogger(IntegrityMonitorRestManager.class);
-    private DroolsPDPIntegrityMonitor im;
+    private DroolsPdpIntegrityMonitor im;
 
     /**
      * Test interface for Integrity Monitor.
@@ -78,7 +78,7 @@ public class IntegrityMonitorRestManager {
 
             if (im == null) {
                 try {
-                    im = DroolsPDPIntegrityMonitor.getInstance();
+                    im = DroolsPdpIntegrityMonitor.getInstance();
                 } catch (Exception e) {
                     logger.error("IntegrityMonitorRestManager: test() interface caught an exception", e);
                     body.append("\nException: " + e + "\n");
index 92ec2ac..e78b0a1 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * feature-state-management
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
 /**
  * This class audits the Maven repository.
  */
-public class RepositoryAudit extends DroolsPDPIntegrityMonitor.AuditBase {
+public class RepositoryAudit extends DroolsPdpIntegrityMonitor.AuditBase {
     private static final long DEFAULT_TIMEOUT = 60; //timeout in 60 seconds
 
     // get an instance of logger
@@ -59,7 +59,7 @@ public class RepositoryAudit extends DroolsPDPIntegrityMonitor.AuditBase {
      * 
      * @return the single 'RepositoryAudit' instance
      */
-    public static DroolsPDPIntegrityMonitor.AuditBase getInstance() {
+    public static DroolsPdpIntegrityMonitor.AuditBase getInstance() {
         return instance;
     }
 
index 94f3540..be9cc53 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * feature-state-management
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -49,7 +49,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI,
     private static final Logger logger =
             LoggerFactory.getLogger(StateManagementFeature.class);
 
-    private DroolsPDPIntegrityMonitor droolsPdpIntegrityMonitor = null;
+    private DroolsPdpIntegrityMonitor droolsPdpIntegrityMonitor = null;
     private StateManagement stateManagement = null;
 
     public StateManagementFeature() {
@@ -62,7 +62,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI,
         logger.debug("StateManagementFeature.globalInit({}) entry", configDir);
 
         try {
-            droolsPdpIntegrityMonitor = DroolsPDPIntegrityMonitor.init(configDir);
+            droolsPdpIntegrityMonitor = DroolsPdpIntegrityMonitor.init(configDir);
         } catch (Exception e) {
             logger.debug("DroolsPDPIntegrityMonitor initialization exception: ", e);
             logger.error("DroolsPDPIntegrityMonitor.init()", e);
@@ -72,7 +72,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI,
 
         //At this point the DroolsPDPIntegrityMonitor instance must exist. Let's check it.
         try {
-            droolsPdpIntegrityMonitor = DroolsPDPIntegrityMonitor.getInstance();
+            droolsPdpIntegrityMonitor = DroolsPdpIntegrityMonitor.getInstance();
             stateManagement = droolsPdpIntegrityMonitor.getStateManager();
 
             if (stateManagement == null) {