diff options
Diffstat (limited to 'api-state-management')
3 files changed, 95 insertions, 30 deletions
diff --git a/api-state-management/checkstyle-suppressions.xml b/api-state-management/checkstyle-suppressions.xml new file mode 100644 index 00000000..f208c3ab --- /dev/null +++ b/api-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="StateManagementFeatureAPI.java" + lines="1-9999"/> +</suppressions> diff --git a/api-state-management/pom.xml b/api-state-management/pom.xml index 564e5d91..9e2965ba 100644 --- a/api-state-management/pom.xml +++ b/api-state-management/pom.xml @@ -40,11 +40,6 @@ <swagger.version>1.5.0</swagger.version> </properties> - <build> - <plugins> - <!-- none --> - </plugins> - </build> <dependencies> <dependency> @@ -59,4 +54,45 @@ <version>${project.version}</version> </dependency> </dependencies> + + <build> + <plugins> + <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> </project> diff --git a/api-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeatureAPI.java b/api-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeatureAPI.java index 3afd0c74..be229ef3 100644 --- a/api-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeatureAPI.java +++ b/api-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeatureAPI.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * policy-core * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 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. @@ -82,7 +82,7 @@ public interface StateManagementFeatureAPI extends OrderedService, Lockable { * fail if any module has set the value ALLNOTWELL, stopping the forward progress counter and * eventually causing the operational state to become disabled. * - * ALLSEEMSWELL is passed to the method when the client is healthy ALLNOTWELL is passed to the + * <p>ALLSEEMSWELL is passed to the method when the client is healthy ALLNOTWELL is passed to the * method when the client is disabled * * @param key - This should be a unique identifier for the entity making the call (e.g., class @@ -91,48 +91,48 @@ public interface StateManagementFeatureAPI extends OrderedService, Lockable { * @param msg - A message is required. It should indicate why all is not well or a message * indicating that a component has been restored to health (perhaps indicating the * problem that has resolved). - * @throws AllSeemsWellException + * @throws AllSeemsWellException exception */ public void allSeemsWell(@NotNull String key, @NotNull Boolean asw, @NotNull String msg) throws AllSeemsWellException; /** - * This method is called to add an Observer to receive notifications of state changes + * This method is called to add an Observer to receive notifications of state changes. * - * @param stateChangeObserver + * @param stateChangeObserver observer */ public void addObserver(Observer stateChangeObserver); /** - * This method returns the X.731 Administrative State for this resource + * Returns the X.731 Administrative State for this resource. * * @return String (locked, unlocked) */ public String getAdminState(); /** - * This method returns the X.731 Operational State for this resource + * Returns the X.731 Operational State for this resource. * * @return String (enabled, disabled) - */ + */ public String getOpState(); /** - * This method returns the X.731 Availability Status for this resource + * Returns the X.731 Availability Status for this resource. * * @return String (failed; dependency; dependency,failed) - */ + */ public String getAvailStatus(); /** - * This method returns the X.731 Standby Status for this resource + * Returns the X.731 Standby Status for this resource. * * @return String (providingservice, hotstandby or coldstandby) - */ + */ public String getStandbyStatus(); /** - * This method returns the X.731 Standby Status for the named resource + * Returns the X.731 Standby Status for the named resource * * @param String (resourceName) * @return String (providingservice, hotstandby or coldstandby) @@ -144,8 +144,8 @@ public interface StateManagementFeatureAPI extends OrderedService, Lockable { * and the Availability Status to a value of failed. As a consequence the Standby Status value * will take a value of coldstandby. * - * @param String (resourceName) - * @throws Exception + * @param resourceName resource name + * @throws Exception exception */ public void disableFailed(String resourceName) throws Exception; @@ -154,8 +154,7 @@ public interface StateManagementFeatureAPI extends OrderedService, Lockable { * the Availability Status to a value of failed. As a consequence the Standby Status value will * take a value of coldstandby. * - * @param String (resourceName) - * @throws Exception + * @throws Exception exception */ public void disableFailed() throws Exception; @@ -165,7 +164,7 @@ public interface StateManagementFeatureAPI extends OrderedService, Lockable { * value is null, it will move to providingservice assuming the Operational State is enabled and * Administrative State is unlocked. * - * @throws Exception + * @throws Exception exception */ public void promote() throws Exception; @@ -174,28 +173,28 @@ public interface StateManagementFeatureAPI extends OrderedService, Lockable { * hotstandby. If the current value is null, it will move to hotstandby assuming the Operational * State is enabled and Administrative State is unlocked. Else, it will move to coldstandby * - * @throws Exception + * @throws Exception exception */ public void demote() throws Exception; /** - * This method returns the resourceName associated with this instance of the - * StateManagementFeature + * Returns the resourceName associated with this instance of the + * StateManagementFeature. * * @return String (resourceName) */ public String getResourceName(); /** - * This Lockable method will lock the StateManagement object Admin state + * This Lockable method will lock the StateManagement object Admin state. * - * @return true if successfull, false otherwise + * @return true if successful, false otherwise */ @Override public boolean lock(); /** - * This Lockable method will unlock the StateManagement object Admin state + * This Lockable method will unlock the StateManagement object Admin state. * * @return true if successfull, false otherwise */ @@ -203,7 +202,7 @@ public interface StateManagementFeatureAPI extends OrderedService, Lockable { public boolean unlock(); /** - * This Lockable method indicates the Admin state StateManagement object + * This Lockable method indicates the Admin state StateManagement object. * * @return true if locked, false otherwise */ |