diff options
author | 2018-03-27 13:13:57 +0100 | |
---|---|---|
committer | 2018-03-27 16:00:35 +0100 | |
commit | 03bded5317a0c50e2a7a3c95f553f612f877ddef (patch) | |
tree | ebb1f01121f8842e087a49abf10810705b78dd46 /controlloop/common/eventmanager/src/main/java/org | |
parent | 0c2b7a2fc65ec7c8252764acafdcc3852db7b411 (diff) |
Removed checkstyle warnings
Removed checkstyle warnings from:
policy/drools-applications/controlloop/common/model-impl/appc
policy/drools-applications/controlloop/common/model-impl/appclcm
policy/drools-applications/controlloop/common/model-impl/events
including changes to template files due to renamed methods
Issue-ID: POLICY-705
Change-Id: Ieb93baf43268aa608f204eef1a610354f2adec32
Signed-off-by: mmis <michael.morris@ericsson.com>
Diffstat (limited to 'controlloop/common/eventmanager/src/main/java/org')
3 files changed, 39 insertions, 39 deletions
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 39a4886a2..92b618f42 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 @@ -457,7 +457,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable { // LockResult<GuardResult, TargetLock> lockResult = PolicyGuard.lockTarget(this.currentOperation.policy.getTarget().getType(), - this.currentOperation.getTargetEntity(), this.onset.getRequestID(), this); + this.currentOperation.getTargetEntity(), this.onset.getRequestId(), this); // // Was it acquired? // @@ -613,7 +613,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable { if (event.getClosedLoopControlName() == null || event.getClosedLoopControlName().length() < 1) { throw new ControlLoopException("No control loop name"); } - if (event.getRequestID() == null) { + if (event.getRequestId() == null) { throw new ControlLoopException("No request ID"); } if (event.getClosedLoopEventStatus() == ControlLoopEventStatus.ABATED) { @@ -627,11 +627,11 @@ public class ControlLoopEventManager implements LockCallback, Serializable { && !GENERIC_VNF_VNF_NAME.equalsIgnoreCase(event.getTarget())) { throw new ControlLoopException("target field invalid - expecting VM_NAME or VNF_NAME"); } - if (event.getAAI() == null) { + if (event.getAai() == null) { throw new ControlLoopException("AAI is null"); } - if (event.getAAI().get(GENERIC_VNF_VNF_ID) == null && event.getAAI().get(VSERVER_VSERVER_NAME) == null - && event.getAAI().get(GENERIC_VNF_VNF_NAME) == null) { + if (event.getAai().get(GENERIC_VNF_VNF_ID) == null && event.getAai().get(VSERVER_VSERVER_NAME) == null + && event.getAai().get(GENERIC_VNF_VNF_NAME) == null) { throw new ControlLoopException( "generic-vnf.vnf-id or generic-vnf.vnf-name or vserver.vserver-name information missing"); } @@ -644,16 +644,16 @@ public class ControlLoopEventManager implements LockCallback, Serializable { * @throws AaiException if an error occurs retrieving information from A&AI */ public void queryAai(VirtualControlLoopEvent event) throws AaiException { - if ((event.getAAI().get(VSERVER_IS_CLOSED_LOOP_DISABLED) != null - || event.getAAI().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED) != null) && isClosedLoopDisabled(event)) { + if ((event.getAai().get(VSERVER_IS_CLOSED_LOOP_DISABLED) != null + || event.getAai().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED) != null) && isClosedLoopDisabled(event)) { throw new AaiException("is-closed-loop-disabled is set to true on VServer or VNF"); } try { - if (event.getAAI().get(GENERIC_VNF_VNF_ID) != null || event.getAAI().get(GENERIC_VNF_VNF_NAME) != null) { + if (event.getAai().get(GENERIC_VNF_VNF_ID) != null || event.getAai().get(GENERIC_VNF_VNF_NAME) != null) { vnfResponse = getAAIVnfInfo(event); - processVNFResponse(vnfResponse, event.getAAI().get(GENERIC_VNF_VNF_ID) != null); - } else if (event.getAAI().get(VSERVER_VSERVER_NAME) != null) { + processVNFResponse(vnfResponse, event.getAai().get(GENERIC_VNF_VNF_ID) != null); + } else if (event.getAai().get(VSERVER_VSERVER_NAME) != null) { vserverResponse = getAAIVserverInfo(event); processVServerResponse(vserverResponse); } @@ -714,16 +714,16 @@ public class ControlLoopEventManager implements LockCallback, Serializable { * @return <code>true</code> if the contol loop is disabled, <code>false</code> otherwise */ public static boolean isClosedLoopDisabled(VirtualControlLoopEvent event) { - if ("true".equalsIgnoreCase(event.getAAI().get(VSERVER_IS_CLOSED_LOOP_DISABLED)) - || "T".equalsIgnoreCase(event.getAAI().get(VSERVER_IS_CLOSED_LOOP_DISABLED)) - || "yes".equalsIgnoreCase(event.getAAI().get(VSERVER_IS_CLOSED_LOOP_DISABLED)) - || "Y".equalsIgnoreCase(event.getAAI().get(VSERVER_IS_CLOSED_LOOP_DISABLED))) { + if ("true".equalsIgnoreCase(event.getAai().get(VSERVER_IS_CLOSED_LOOP_DISABLED)) + || "T".equalsIgnoreCase(event.getAai().get(VSERVER_IS_CLOSED_LOOP_DISABLED)) + || "yes".equalsIgnoreCase(event.getAai().get(VSERVER_IS_CLOSED_LOOP_DISABLED)) + || "Y".equalsIgnoreCase(event.getAai().get(VSERVER_IS_CLOSED_LOOP_DISABLED))) { return true; } - return ("true".equalsIgnoreCase(event.getAAI().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED)) - || "T".equalsIgnoreCase(event.getAAI().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED)) - || "yes".equalsIgnoreCase(event.getAAI().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED)) - || "Y".equalsIgnoreCase(event.getAAI().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED))); + return ("true".equalsIgnoreCase(event.getAai().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED)) + || "T".equalsIgnoreCase(event.getAai().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED)) + || "yes".equalsIgnoreCase(event.getAai().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED)) + || "Y".equalsIgnoreCase(event.getAai().get(GENERIC_VNF_IS_CLOSED_LOOP_DISABLED))); } /** @@ -734,9 +734,9 @@ public class ControlLoopEventManager implements LockCallback, Serializable { * @throws ControlLoopException if an error occurs */ public static AaiGetVserverResponse getAAIVserverInfo(VirtualControlLoopEvent event) throws ControlLoopException { - UUID requestId = event.getRequestID(); + UUID requestId = event.getRequestId(); AaiGetVserverResponse response = null; - String vserverName = event.getAAI().get(VSERVER_VSERVER_NAME); + String vserverName = event.getAai().get(VSERVER_VSERVER_NAME); try { if (vserverName != null) { @@ -765,10 +765,10 @@ public class ControlLoopEventManager implements LockCallback, Serializable { * @throws ControlLoopException if an error occurs */ public static AaiGetVnfResponse getAAIVnfInfo(VirtualControlLoopEvent event) throws ControlLoopException { - UUID requestId = event.getRequestID(); + UUID requestId = event.getRequestId(); AaiGetVnfResponse response = null; - String vnfName = event.getAAI().get(GENERIC_VNF_VNF_NAME); - String vnfId = event.getAAI().get(GENERIC_VNF_VNF_ID); + String vnfName = event.getAai().get(GENERIC_VNF_VNF_NAME); + String vnfId = event.getAai().get(GENERIC_VNF_VNF_ID); aaiHostURL = PolicyEngine.manager.getEnvironmentProperty("aai.url"); aaiUser = PolicyEngine.manager.getEnvironmentProperty("aai.username"); @@ -811,7 +811,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable { @Override public String toString() { return "ControlLoopEventManager [closedLoopControlName=" + closedLoopControlName + ", requestID=" + requestID - + ", processor=" + processor + ", onset=" + (onset != null ? onset.getRequestID() : "null") + + ", 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 97eaf9048..7ef2a2e04 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 @@ -35,7 +35,7 @@ import org.eclipse.persistence.config.PersistenceUnitProperties; import org.onap.policy.aai.util.AaiException; import org.onap.policy.appc.Response; import org.onap.policy.appc.ResponseCode; -import org.onap.policy.appclcm.LCMResponseWrapper; +import org.onap.policy.appclcm.LcmResponseWrapper; import org.onap.policy.controlloop.ControlLoopEvent; import org.onap.policy.controlloop.ControlLoopException; import org.onap.policy.controlloop.ControlLoopOperation; @@ -63,7 +63,7 @@ public class ControlLoopOperationManager implements Serializable { @Override public String toString() { - return "ControlLoopOperationManager [onset=" + (onset != null ? onset.getRequestID() : "null") + ", policy=" + return "ControlLoopOperationManager [onset=" + (onset != null ? onset.getRequestId() : "null") + ", policy=" + (policy != null ? policy.getId() : "null") + ", attempts=" + attempts + ", policyResult=" + policyResult + ", currentOperation=" + currentOperation + ", operationHistory=" + operationHistory + "]"; @@ -152,15 +152,15 @@ public class ControlLoopOperationManager implements Serializable { case VNF: VirtualControlLoopEvent virtualOnset = (VirtualControlLoopEvent) this.onset; if (this.onset.getTarget().equalsIgnoreCase(VSERVER_VSERVER_NAME)) { - return virtualOnset.getAAI().get(VSERVER_VSERVER_NAME); + return virtualOnset.getAai().get(VSERVER_VSERVER_NAME); } else if (this.onset.getTarget().equalsIgnoreCase(GENERIC_VNF_VNF_ID)) { - return virtualOnset.getAAI().get(GENERIC_VNF_VNF_ID); + return virtualOnset.getAai().get(GENERIC_VNF_VNF_ID); } else if (this.onset.getTarget().equalsIgnoreCase(GENERIC_VNF_VNF_NAME)) { /* * If the onset is enriched with the vnf-id, we don't need an A&AI response */ - if (virtualOnset.getAAI().containsKey(GENERIC_VNF_VNF_ID)) { - return virtualOnset.getAAI().get(GENERIC_VNF_VNF_ID); + if (virtualOnset.getAai().containsKey(GENERIC_VNF_VNF_ID)) { + return virtualOnset.getAai().get(GENERIC_VNF_VNF_ID); } /* @@ -303,11 +303,11 @@ public class ControlLoopOperationManager implements Serializable { // Cast APPC response and handle it // return onResponse((Response) response); - } else if (response instanceof LCMResponseWrapper) { + } else if (response instanceof LcmResponseWrapper) { // // Cast LCM response and handle it // - return onResponse((LCMResponseWrapper) response); + return onResponse((LcmResponseWrapper) response); } else if (response instanceof SOResponseWrapper) { // // Cast SO response and handle it @@ -335,7 +335,7 @@ public class ControlLoopOperationManager implements Serializable { // Integer operationAttempt = null; try { - operationAttempt = Integer.parseInt(appcResponse.getCommonHeader().getSubRequestID()); + operationAttempt = Integer.parseInt(appcResponse.getCommonHeader().getSubRequestId()); } catch (NumberFormatException e) { // // We cannot tell what happened if this doesn't exist @@ -422,7 +422,7 @@ public class ControlLoopOperationManager implements Serializable { * @param dmaapResponse the LCM response * @return The result of the response handling */ - private PolicyResult onResponse(LCMResponseWrapper dmaapResponse) { + private PolicyResult onResponse(LcmResponseWrapper dmaapResponse) { /* * Parse out the operation attempt using the subrequestid */ @@ -789,7 +789,7 @@ public class ControlLoopOperationManager implements Serializable { OperationsHistoryDbEntry newEntry = new OperationsHistoryDbEntry(); newEntry.setClosedLoopName(this.onset.getClosedLoopControlName()); - newEntry.setRequestId(this.onset.getRequestID().toString()); + newEntry.setRequestId(this.onset.getRequestId().toString()); newEntry.setActor(this.currentOperation.clOperation.getActor()); newEntry.setOperation(this.currentOperation.clOperation.getOperation()); newEntry.setTarget(this.targetEntity); diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/drools/impl/PolicyEngineJUnitImpl.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/drools/impl/PolicyEngineJUnitImpl.java index d5f73c741..773299dc2 100644 --- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/drools/impl/PolicyEngineJUnitImpl.java +++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/drools/impl/PolicyEngineJUnitImpl.java @@ -28,7 +28,7 @@ import java.util.Map; import java.util.Queue; import org.onap.policy.appc.Request; -import org.onap.policy.appclcm.LCMRequestWrapper; +import org.onap.policy.appclcm.LcmRequestWrapper; import org.onap.policy.controlloop.ControlLoopNotification; import org.onap.policy.controlloop.util.Serialization; import org.onap.policy.drools.PolicyEngine; @@ -74,9 +74,9 @@ public class PolicyEngineJUnitImpl implements PolicyEngine { } if (obj instanceof Request) { Request request = (Request) obj; - logger.debug("Request: {} subrequest {}", request.getAction(), request.getCommonHeader().getSubRequestID()); - } else if (obj instanceof LCMRequestWrapper) { - LCMRequestWrapper dmaapRequest = (LCMRequestWrapper) obj; + logger.debug("Request: {} subrequest {}", request.getAction(), request.getCommonHeader().getSubRequestId()); + } else if (obj instanceof LcmRequestWrapper) { + LcmRequestWrapper dmaapRequest = (LcmRequestWrapper) obj; logger.debug("Request: {} subrequest {}", dmaapRequest.getBody().getAction(), dmaapRequest.getBody().getCommonHeader().getSubRequestId()); } |