summaryrefslogtreecommitdiffstats
path: root/feature-state-management
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2018-09-28 04:58:26 -0400
committerPamela Dragosh <pdragosh@research.att.com>2018-10-01 10:28:44 -0400
commita0e0c7840f72392152a970d88a5a66d394c4a793 (patch)
tree1a1976844cb52020407b4d20e019f81ec25d5abf /feature-state-management
parent367f9d25434202a4fd6f5e54cb19196c7ec3d058 (diff)
Set drools-pdp checkstyle config
Fixed last remaining checkstyle issues along with setting the pom.xml to the correct path setting. Fixed forbidden summary fragments, not allowed to prepend summary with "This method returns" Issue-ID: POLICY-1153 Change-Id: I267842080494132a7b5507731e14f027a3f6fe44 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'feature-state-management')
-rw-r--r--feature-state-management/checkstyle-suppressions.xml30
-rw-r--r--feature-state-management/pom.xml36
-rw-r--r--feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPDPIntegrityMonitor.java5
-rw-r--r--feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/IntegrityMonitorRestManager.java2
-rw-r--r--feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java33
5 files changed, 87 insertions, 19 deletions
diff --git a/feature-state-management/checkstyle-suppressions.xml b/feature-state-management/checkstyle-suppressions.xml
new file mode 100644
index 00000000..3c394a9c
--- /dev/null
+++ b/feature-state-management/checkstyle-suppressions.xml
@@ -0,0 +1,30 @@
+<?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>
diff --git a/feature-state-management/pom.xml b/feature-state-management/pom.xml
index 4f8a9cf4..dd662f76 100644
--- a/feature-state-management/pom.xml
+++ b/feature-state-management/pom.xml
@@ -82,6 +82,42 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>onap-java-style</id>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <phase>process-sources</phase>
+ <configuration>
+ <!-- Use Google Java Style Guide: https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
+ with minor changes -->
+ <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
+ <!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory -->
+ <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
+ <includeResources>true</includeResources>
+ <includeTestSourceDirectory>true</includeTestSourceDirectory>
+ <includeTestResources>true</includeTestResources>
+ <excludes>
+ </excludes>
+ <suppressionsLocation>${project.baseUri}checkstyle-suppressions.xml</suppressionsLocation>
+ <consoleOutput>true</consoleOutput>
+ <failsOnViolation>true</failsOnViolation>
+ <violationSeverity>warning</violationSeverity>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.oparent</groupId>
+ <artifactId>checkstyle</artifactId>
+ <version>${oparent.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ </plugin>
</plugins>
</build>
diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPDPIntegrityMonitor.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPDPIntegrityMonitor.java
index 3cb99f23..8dd211b4 100644
--- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPDPIntegrityMonitor.java
+++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPDPIntegrityMonitor.java
@@ -83,7 +83,6 @@ public class DroolsPDPIntegrityMonitor extends IntegrityMonitor {
* Static initialization -- create Drools Integrity Monitor, and an HTTP server to handle REST
* 'test' requests.
*
- * @throws StateManagementPropertiesException exception
* @throws IntegrityMonitorException exception
*/
public static DroolsPDPIntegrityMonitor init(String configDir) throws IntegrityMonitorException {
@@ -134,7 +133,7 @@ public class DroolsPDPIntegrityMonitor extends IntegrityMonitor {
// Now that we've validated the properties, create Drools Integrity Monitor
// with these properties.
im = makeMonitor(resourceName, stateManagementProperties);
- logger.info("init: New DroolsPDPIntegrityMonitor instantiated, resourceName = ", resourceName);
+ logger.info("init: New DroolsPDPIntegrityMonitor instantiated, resourceName = {}", resourceName);
// create http server
makeRestServer(testHost, testPort, stateManagementProperties);
@@ -174,7 +173,7 @@ public class DroolsPDPIntegrityMonitor extends IntegrityMonitor {
throws IntegrityMonitorException {
try {
- logger.info("init: Starting HTTP server, addr= {}", testHost + ":" + testPort);
+ logger.info("init: Starting HTTP server, addr= {}:{}", testHost, testPort);
IntegrityMonitorRestServer server = new IntegrityMonitorRestServer();
server.init(properties);
diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/IntegrityMonitorRestManager.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/IntegrityMonitorRestManager.java
index 49e4577c..77c188d0 100644
--- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/IntegrityMonitorRestManager.java
+++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/IntegrityMonitorRestManager.java
@@ -59,7 +59,7 @@ public class IntegrityMonitorRestManager {
code = 500,
message = "Integrity monitor sanity check encountered an exception. "
+ "This can indicate operational state disabled or administrative state locked")
- })
+ })
@GET
@Path("test")
public Response test() {
diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java
index d7f9d108..94f35409 100644
--- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java
+++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java
@@ -91,7 +91,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI,
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
*/
@Override
public void addObserver(Observer stateChangeObserver) {
@@ -105,7 +105,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI,
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
*/
@Override
public String getAdminState() {
@@ -113,7 +113,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI,
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
*/
@Override
public String getOpState() {
@@ -121,7 +121,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI,
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
*/
@Override
public String getAvailStatus() {
@@ -129,7 +129,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI,
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
*/
@Override
public String getStandbyStatus() {
@@ -137,7 +137,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI,
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
*/
@Override
public String getStandbyStatus(String resourceName) {
@@ -145,7 +145,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI,
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
*/
@Override
public void disableFailed(String resourceName) throws Exception {
@@ -154,7 +154,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI,
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
*/
@Override
public void disableFailed() throws Exception {
@@ -162,7 +162,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI,
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
*/
@Override
public void promote() throws Exception {
@@ -170,7 +170,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI,
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
*/
@Override
public void demote() throws Exception {
@@ -178,7 +178,7 @@ public class StateManagementFeature implements StateManagementFeatureAPI,
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
*/
@Override
public String getResourceName() {
@@ -186,8 +186,9 @@ public class StateManagementFeature implements StateManagementFeatureAPI,
}
/**
- * {@inheritDoc}
- * @return
+ * {@inheritDoc}.
+ *
+ * @return true if locked or false if failed
*/
@Override
public boolean lock() {
@@ -201,7 +202,8 @@ public class StateManagementFeature implements StateManagementFeatureAPI,
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
+ *
* @throws Exception exception
*/
@Override
@@ -216,7 +218,8 @@ public class StateManagementFeature implements StateManagementFeatureAPI,
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
+ *
* @throws Exception exception
*/
@Override