aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/common/eventmanager')
-rw-r--r--controlloop/common/eventmanager/checkstyle-suppressions.xml33
-rw-r--r--controlloop/common/eventmanager/pom.xml40
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java17
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java14
4 files changed, 89 insertions, 15 deletions
diff --git a/controlloop/common/eventmanager/checkstyle-suppressions.xml b/controlloop/common/eventmanager/checkstyle-suppressions.xml
new file mode 100644
index 000000000..1bb593962
--- /dev/null
+++ b/controlloop/common/eventmanager/checkstyle-suppressions.xml
@@ -0,0 +1,33 @@
+<?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="ControlLoopEventManager.java"
+ lines="1-9999"/>
+ <suppress checks="TypeName"
+ files="ControlLoopEventManager.java"
+ lines="1-9999"/>
+</suppressions>
diff --git a/controlloop/common/eventmanager/pom.xml b/controlloop/common/eventmanager/pom.xml
index 6897317d5..e14d62ffc 100644
--- a/controlloop/common/eventmanager/pom.xml
+++ b/controlloop/common/eventmanager/pom.xml
@@ -205,4 +205,44 @@
<scope>test</scope>
</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}/src/main/java</sourceDirectory>
+ <includeResources>true</includeResources>
+ <includeTestSourceDirectory>true</includeTestSourceDirectory>
+ <includeTestResources>true</includeTestResources>
+ <excludes>
+ </excludes>
+ <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/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java
index 93535efc1..5241bd2fc 100644
--- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java
+++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java
@@ -29,8 +29,8 @@ import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.UUID;
import java.util.NoSuchElementException;
+import java.util.UUID;
import org.onap.policy.aai.AaiGetVnfResponse;
import org.onap.policy.aai.AaiGetVserverResponse;
@@ -91,7 +91,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
private static final long serialVersionUID = -1216568161322872641L;
public final String closedLoopControlName;
- public final UUID requestID;
+ private final UUID requestId;
private String controlLoopResult;
private ControlLoopProcessor processor = null;
@@ -125,9 +125,9 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
requiredAAIKeys.add(VM_NAME);
}
- public ControlLoopEventManager(String closedLoopControlName, UUID requestID) {
+ public ControlLoopEventManager(String closedLoopControlName, UUID requestId) {
this.closedLoopControlName = closedLoopControlName;
- this.requestID = requestID;
+ this.requestId = requestId;
}
public String getClosedLoopControlName() {
@@ -187,7 +187,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
}
public UUID getRequestID() {
- return requestID;
+ return requestId;
}
/**
@@ -499,7 +499,8 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
this.currentOperation.getTargetEntity(),
this.onset.getRequestId(), this);
this.targetLock = lock;
- LockResult<GuardResult, TargetLock> lockResult = LockResult.createLockResult(GuardResult.LOCK_ACQUIRED, lock);
+ LockResult<GuardResult, TargetLock> lockResult =
+ LockResult.createLockResult(GuardResult.LOCK_ACQUIRED, lock);
return lockResult;
}
//
@@ -637,7 +638,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
logger.error("{}: commitAbatement: no operation manager", this);
return;
}
- try{
+ try {
this.lastOperationManager.commitAbatement(message,outcome);
} catch (NoSuchElementException e) {
logger.error("{}: commitAbatement threw an exception ", this, e);
@@ -1027,7 +1028,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable {
@Override
public String toString() {
- return "ControlLoopEventManager [closedLoopControlName=" + closedLoopControlName + ", requestID=" + requestID
+ return "ControlLoopEventManager [closedLoopControlName=" + closedLoopControlName + ", requestId=" + requestId
+ ", processor=" + processor + ", onset=" + (onset != null ? onset.getRequestId() : "null")
+ ", numOnsets=" + numOnsets + ", numAbatements=" + numAbatements + ", isActivated=" + isActivated
+ ", currentOperation=" + currentOperation + ", targetLock=" + targetLock + "]";
diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java
index 466c826b1..c5344e38b 100644
--- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java
+++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java
@@ -41,11 +41,11 @@ import org.onap.policy.controlloop.ControlLoopEvent;
import org.onap.policy.controlloop.ControlLoopException;
import org.onap.policy.controlloop.ControlLoopOperation;
import org.onap.policy.controlloop.VirtualControlLoopEvent;
-import org.onap.policy.controlloop.actor.appc.APPCActorServiceProvider;
+import org.onap.policy.controlloop.actor.appc.AppcActorServiceProvider;
import org.onap.policy.controlloop.actor.appclcm.AppcLcmActorServiceProvider;
import org.onap.policy.controlloop.actor.sdnr.SdnrActorServiceProvider;
-import org.onap.policy.controlloop.actor.so.SOActorServiceProvider;
-import org.onap.policy.controlloop.actor.vfc.VFCActorServiceProvider;
+import org.onap.policy.controlloop.actor.so.SoActorServiceProvider;
+import org.onap.policy.controlloop.actor.vfc.VfcActorServiceProvider;
import org.onap.policy.controlloop.policy.Policy;
import org.onap.policy.controlloop.policy.PolicyResult;
import org.onap.policy.drools.system.PolicyEngine;
@@ -258,7 +258,7 @@ public class ControlLoopOperationManager implements Serializable {
*/
this.currentOperation = operation;
if ("ModifyConfig".equalsIgnoreCase(policy.getRecipe())) {
- this.operationRequest = APPCActorServiceProvider.constructRequest((VirtualControlLoopEvent) onset,
+ this.operationRequest = AppcActorServiceProvider.constructRequest((VirtualControlLoopEvent) onset,
operation.clOperation, this.policy, this.targetEntity);
} else {
this.operationRequest = AppcLcmActorServiceProvider.constructRequest(
@@ -270,7 +270,7 @@ public class ControlLoopOperationManager implements Serializable {
return operationRequest;
case "SO":
- SOActorServiceProvider soActorSp = new SOActorServiceProvider();
+ SoActorServiceProvider soActorSp = new SoActorServiceProvider();
this.operationRequest = soActorSp.constructRequest((VirtualControlLoopEvent) onset,
operation.clOperation, this.policy, eventManager.getNqVserverFromAai());
@@ -283,7 +283,7 @@ public class ControlLoopOperationManager implements Serializable {
return operationRequest;
case "VFC":
- this.operationRequest = VFCActorServiceProvider.constructRequest((VirtualControlLoopEvent) onset,
+ this.operationRequest = VfcActorServiceProvider.constructRequest((VirtualControlLoopEvent) onset,
operation.clOperation, this.policy, this.eventManager.getVnfResponse());
this.currentOperation = operation;
if (this.operationRequest == null) {
@@ -935,5 +935,5 @@ public class ControlLoopOperationManager implements Serializable {
// Clear the current operation field
//
this.currentOperation = null;
- }
+ }
}