diff options
author | Jim Hahn <jrh3@att.com> | 2019-01-14 11:11:17 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2019-01-14 11:11:17 -0500 |
commit | dd691f02e2caa6028a868915b016a71bf6c1c876 (patch) | |
tree | 39e64269dca4cd717ef9c4bf6f0be716ba34ea26 /controlloop | |
parent | 45018c1970772037139134fcc2d69da360a03c66 (diff) |
Remove eventmanager checkstyle suppressions
Renamed enum class name and various method names in ControlLoopEventManager.
Change-Id: I18b4a7d30a24dfcf3b155fd662433590b9d4c769
Issue-ID: POLICY-1138
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'controlloop')
8 files changed, 118 insertions, 150 deletions
diff --git a/controlloop/common/eventmanager/checkstyle-suppressions.xml b/controlloop/common/eventmanager/checkstyle-suppressions.xml deleted file mode 100644 index 1bb593962..000000000 --- a/controlloop/common/eventmanager/checkstyle-suppressions.xml +++ /dev/null @@ -1,33 +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="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 f20cbeaad..6b8d2db9f 100644 --- a/controlloop/common/eventmanager/pom.xml +++ b/controlloop/common/eventmanager/pom.xml @@ -2,7 +2,7 @@ ============LICENSE_START======================================================= eventmanager ================================================================================ - 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. @@ -237,7 +237,6 @@ <includeTestResources>true</includeTestResources> <excludes> </excludes> - <suppressionsLocation>${project.basedir}/checkstyle-suppressions.xml</suppressionsLocation> <consoleOutput>true</consoleOutput> <failsOnViolation>true</failsOnViolation> <violationSeverity>warning</violationSeverity> 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 f063789c2..bfb8c13fe 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 @@ -186,7 +186,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable { return this.processor; } - public UUID getRequestID() { + public UUID getRequestId() { return requestId; } @@ -556,7 +556,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable { return returnLock; } - public enum NEW_EVENT_STATUS { + public enum NewEventStatus { FIRST_ONSET, SUBSEQUENT_ONSET, FIRST_ABATEMENT, SUBSEQUENT_ABATEMENT, SYNTAX_ERROR; } @@ -567,7 +567,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable { * @return the status * @throws AaiException if an error occurs retrieving information from A&AI */ - public NEW_EVENT_STATUS onNewEvent(VirtualControlLoopEvent event) throws AaiException { + public NewEventStatus onNewEvent(VirtualControlLoopEvent event) throws AaiException { try { this.checkEventSyntax(event); if (event.getClosedLoopEventStatus() == ControlLoopEventStatus.ONSET) { @@ -583,13 +583,13 @@ public class ControlLoopEventManager implements LockCallback, Serializable { // // DO NOT retract it // - return NEW_EVENT_STATUS.FIRST_ONSET; + return NewEventStatus.FIRST_ONSET; } // // Log that we got an onset // this.numOnsets++; - return NEW_EVENT_STATUS.SUBSEQUENT_ONSET; + return NewEventStatus.SUBSEQUENT_ONSET; } else if (event.getClosedLoopEventStatus() == ControlLoopEventStatus.ABATED) { // // Have we already got an abatement? @@ -606,7 +606,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable { // // // - return NEW_EVENT_STATUS.FIRST_ABATEMENT; + return NewEventStatus.FIRST_ABATEMENT; } else { // // Keep track that we received another @@ -615,13 +615,13 @@ public class ControlLoopEventManager implements LockCallback, Serializable { // // // - return NEW_EVENT_STATUS.SUBSEQUENT_ABATEMENT; + return NewEventStatus.SUBSEQUENT_ABATEMENT; } } } catch (ControlLoopException e) { logger.error("{}: onNewEvent threw: ", this, e); } - return NEW_EVENT_STATUS.SYNTAX_ERROR; + return NewEventStatus.SYNTAX_ERROR; } @@ -756,10 +756,10 @@ public class ControlLoopEventManager implements LockCallback, Serializable { try { if (aai.containsKey(GENERIC_VNF_VNF_ID) || aai.containsKey(GENERIC_VNF_VNF_NAME)) { - vnfResponse = getAAIVnfInfo(event); - processVNFResponse(vnfResponse, aai.containsKey(GENERIC_VNF_VNF_ID)); + vnfResponse = getAaiVnfInfo(event); + processVnfResponse(vnfResponse, aai.containsKey(GENERIC_VNF_VNF_ID)); } else if (aai.containsKey(VSERVER_VSERVER_NAME)) { - vserverResponse = getAAIVserverInfo(event); + vserverResponse = getAaiVserverInfo(event); processVServerResponse(vserverResponse); } } catch (AaiException e) { @@ -779,8 +779,8 @@ public class ControlLoopEventManager implements LockCallback, Serializable { * <code>false</code> if the query was based on vnf-name * @throws AaiException if an error occurs processing the response */ - private static void processVNFResponse(AaiGetVnfResponse aaiResponse, boolean queryByVNFID) throws AaiException { - String queryTypeString = (queryByVNFID ? "vnf-id" : "vnf-name"); + private static void processVnfResponse(AaiGetVnfResponse aaiResponse, boolean queryByVnfId) throws AaiException { + String queryTypeString = (queryByVnfId ? "vnf-id" : "vnf-name"); if (aaiResponse == null) { throw new AaiException("AAI Response is null (query by " + queryTypeString + ")"); @@ -872,7 +872,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable { * @return a AaiGetVserverResponse * @throws ControlLoopException if an error occurs */ - public static AaiGetVserverResponse getAAIVserverInfo(VirtualControlLoopEvent event) throws ControlLoopException { + public static AaiGetVserverResponse getAaiVserverInfo(VirtualControlLoopEvent event) throws ControlLoopException { UUID requestId = event.getRequestId(); AaiGetVserverResponse response = null; String vserverName = event.getAai().get(VSERVER_VSERVER_NAME); @@ -889,8 +889,8 @@ public class ControlLoopEventManager implements LockCallback, Serializable { vserverName); } } catch (Exception e) { - logger.error("getAAIVserverInfo exception: ", e); - throw new ControlLoopException("Exception in getAAIVserverInfo: ", e); + logger.error("getAaiVserverInfo exception: ", e); + throw new ControlLoopException("Exception in getAaiVserverInfo: ", e); } return response; @@ -903,7 +903,7 @@ public class ControlLoopEventManager implements LockCallback, Serializable { * @return a AaiGetVnfResponse * @throws ControlLoopException if an error occurs */ - public static AaiGetVnfResponse getAAIVnfInfo(VirtualControlLoopEvent event) throws ControlLoopException { + public static AaiGetVnfResponse getAaiVnfInfo(VirtualControlLoopEvent event) throws ControlLoopException { UUID requestId = event.getRequestId(); AaiGetVnfResponse response = null; String vnfName = event.getAai().get(GENERIC_VNF_VNF_NAME); @@ -928,8 +928,8 @@ public class ControlLoopEventManager implements LockCallback, Serializable { new AaiManager(new RestManager()).getQueryByVnfId(url, aaiUser, aaiPassword, requestId, vnfId); } } catch (Exception e) { - logger.error("getAAIVnfInfo exception: ", e); - throw new ControlLoopException("Exception in getAAIVnfInfo: ", e); + logger.error("getAaiVnfInfo exception: ", e); + throw new ControlLoopException("Exception in getAaiVnfInfo: ", e); } return response; diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java index 49a6258c1..7c3a38b38 100644 --- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java +++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * unit test * ================================================================================ - * 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. @@ -61,7 +61,7 @@ import org.onap.policy.controlloop.ControlLoopNotificationType; import org.onap.policy.controlloop.SupportUtil; import org.onap.policy.controlloop.VirtualControlLoopEvent; import org.onap.policy.controlloop.VirtualControlLoopNotification; -import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager.NEW_EVENT_STATUS; +import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager.NewEventStatus; import org.onap.policy.controlloop.policy.ControlLoopPolicy; import org.onap.policy.controlloop.policy.PolicyResult; import org.onap.policy.drools.system.PolicyEngine; @@ -74,6 +74,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class ControlLoopEventManagerTest { + private static final String PROCESS_VNF_RESPONSE_METHOD_NAME = "processVnfResponse"; + private static final String INVALID_URL = "http://localhost:9999"; private static final Logger logger = LoggerFactory.getLogger(ControlLoopEventManagerTest.class); @@ -230,7 +232,7 @@ public class ControlLoopEventManagerTest { assertNotNull(notification); assertEquals(ControlLoopNotificationType.ACTIVE, notification.getNotification()); - ControlLoopEventManager.NEW_EVENT_STATUS status = null; + ControlLoopEventManager.NewEventStatus status = null; try { status = manager.onNewEvent(event); } catch (AaiException e) { @@ -238,7 +240,7 @@ public class ControlLoopEventManagerTest { fail("A&AI Query Failed"); } assertNotNull(status); - assertEquals(ControlLoopEventManager.NEW_EVENT_STATUS.FIRST_ONSET, status); + assertEquals(ControlLoopEventManager.NewEventStatus.FIRST_ONSET, status); AaiGetVnfResponse response = manager.getVnfResponse(); assertNotNull(response); @@ -260,7 +262,7 @@ public class ControlLoopEventManagerTest { logger.warn(e.toString()); fail("A&AI Query Failed"); } - assertEquals(ControlLoopEventManager.NEW_EVENT_STATUS.SUBSEQUENT_ONSET, status); + assertEquals(ControlLoopEventManager.NewEventStatus.SUBSEQUENT_ONSET, status); AaiGetVnfResponse response2 = manager.getVnfResponse(); assertNotNull(response2); // We should not have queried AAI, so the stored response should be the same @@ -427,7 +429,7 @@ public class ControlLoopEventManagerTest { ControlLoopEventManager clem = new ControlLoopEventManager("MyClosedLoopName", requestId); assertEquals("MyClosedLoopName", clem.getClosedLoopControlName()); - assertEquals(requestId, clem.getRequestID()); + assertEquals(requestId, clem.getRequestId()); clem.setActivated(true); assertEquals(true, clem.isActivated()); @@ -793,9 +795,9 @@ public class ControlLoopEventManagerTest { assertNotNull(notification); assertEquals(ControlLoopNotificationType.ACTIVE, notification.getNotification()); - assertEquals(NEW_EVENT_STATUS.FIRST_ONSET, manager.onNewEvent(onsetEvent)); - assertEquals(NEW_EVENT_STATUS.FIRST_ABATEMENT, manager.onNewEvent(abatedEvent)); - assertEquals(NEW_EVENT_STATUS.SUBSEQUENT_ABATEMENT, manager.onNewEvent(abatedEvent)); + assertEquals(NewEventStatus.FIRST_ONSET, manager.onNewEvent(onsetEvent)); + assertEquals(NewEventStatus.FIRST_ABATEMENT, manager.onNewEvent(abatedEvent)); + assertEquals(NewEventStatus.SUBSEQUENT_ABATEMENT, manager.onNewEvent(abatedEvent)); VirtualControlLoopEvent checkSyntaxEvent = new VirtualControlLoopEvent(); checkSyntaxEvent.setAai(null); @@ -813,73 +815,73 @@ public class ControlLoopEventManagerTest { checkSyntaxEvent.setTargetType(null); checkSyntaxEvent.setVersion(null); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setClosedLoopControlName(null); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setClosedLoopControlName(""); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setClosedLoopControlName("TwoOnsetTest"); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setRequestId(null); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setRequestId(requestId); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setAai(null); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setAai(new HashMap<>()); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setTarget(""); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setTarget(null); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setTarget(""); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setTarget("OZ"); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setTarget("VM_NAME"); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setTarget("VNF_NAME"); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setTarget("vserver.vserver-name"); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setTarget("generic-vnf.vnf-id"); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setTarget("generic-vnf.vnf-name"); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setAai(null); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.setAai(new HashMap<>()); - assertEquals(NEW_EVENT_STATUS.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); + assertEquals(NewEventStatus.SYNTAX_ERROR, manager.onNewEvent(checkSyntaxEvent)); checkSyntaxEvent.getAai().put("generic-vnf.vnf-name", "onsetOne"); - assertEquals(NEW_EVENT_STATUS.SUBSEQUENT_ABATEMENT, manager.onNewEvent(abatedEvent)); + assertEquals(NewEventStatus.SUBSEQUENT_ABATEMENT, manager.onNewEvent(abatedEvent)); checkSyntaxEvent.getAai().put("vserver.vserver-name", "onsetOne"); - assertEquals(NEW_EVENT_STATUS.SUBSEQUENT_ABATEMENT, manager.onNewEvent(abatedEvent)); + assertEquals(NewEventStatus.SUBSEQUENT_ABATEMENT, manager.onNewEvent(abatedEvent)); checkSyntaxEvent.getAai().put("generic-vnf.vnf-id", "onsetOne"); - assertEquals(NEW_EVENT_STATUS.SUBSEQUENT_ABATEMENT, manager.onNewEvent(abatedEvent)); + assertEquals(NewEventStatus.SUBSEQUENT_ABATEMENT, manager.onNewEvent(abatedEvent)); } @Test @@ -1067,7 +1069,7 @@ public class ControlLoopEventManagerTest { AaiGetVnfResponse resp = new AaiGetVnfResponse(); resp.setIsClosedLoopDisabled(false); resp.setProvStatus(ControlLoopEventManager.PROV_STATUS_ACTIVE); - Whitebox.invokeMethod(ControlLoopEventManager.class, "processVNFResponse", resp, true); + Whitebox.invokeMethod(ControlLoopEventManager.class, PROCESS_VNF_RESPONSE_METHOD_NAME, resp, true); } @Test @@ -1076,7 +1078,7 @@ public class ControlLoopEventManagerTest { thrown.expectMessage("AAI Response is null (query by vnf-id)"); AaiGetVnfResponse resp = null; - Whitebox.invokeMethod(ControlLoopEventManager.class, "processVNFResponse", resp, true); + Whitebox.invokeMethod(ControlLoopEventManager.class, PROCESS_VNF_RESPONSE_METHOD_NAME, resp, true); } @Test @@ -1090,7 +1092,7 @@ public class ControlLoopEventManagerTest { resp.setIsClosedLoopDisabled(false); resp.setProvStatus(ControlLoopEventManager.PROV_STATUS_ACTIVE); - Whitebox.invokeMethod(ControlLoopEventManager.class, "processVNFResponse", resp, false); + Whitebox.invokeMethod(ControlLoopEventManager.class, PROCESS_VNF_RESPONSE_METHOD_NAME, resp, false); } @Test @@ -1101,7 +1103,7 @@ public class ControlLoopEventManagerTest { AaiGetVnfResponse resp = new AaiGetVnfResponse(); resp.setIsClosedLoopDisabled(true); resp.setProvStatus(ControlLoopEventManager.PROV_STATUS_ACTIVE); - Whitebox.invokeMethod(ControlLoopEventManager.class, "processVNFResponse", resp, true); + Whitebox.invokeMethod(ControlLoopEventManager.class, PROCESS_VNF_RESPONSE_METHOD_NAME, resp, true); } @Test @@ -1112,7 +1114,7 @@ public class ControlLoopEventManagerTest { AaiGetVnfResponse resp = new AaiGetVnfResponse(); resp.setIsClosedLoopDisabled(false); resp.setProvStatus("inactive1"); - Whitebox.invokeMethod(ControlLoopEventManager.class, "processVNFResponse", resp, false); + Whitebox.invokeMethod(ControlLoopEventManager.class, PROCESS_VNF_RESPONSE_METHOD_NAME, resp, false); } @Test diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java index 0189e17bf..82da603ff 100644 --- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java +++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java @@ -178,7 +178,7 @@ public class ControlLoopOperationManagerTest { assertNotNull(notification); assertEquals(ControlLoopNotificationType.ACTIVE, notification.getNotification()); - ControlLoopEventManager.NEW_EVENT_STATUS status = null; + ControlLoopEventManager.NewEventStatus status = null; try { status = eventManager.onNewEvent(onset); } catch (AaiException e) { @@ -186,7 +186,7 @@ public class ControlLoopOperationManagerTest { fail("A&AI Query Failed"); } assertNotNull(status); - assertEquals(ControlLoopEventManager.NEW_EVENT_STATUS.FIRST_ONSET, status); + assertEquals(ControlLoopEventManager.NewEventStatus.FIRST_ONSET, status); ControlLoopOperationManager manager = new ControlLoopOperationManager(onset, processor.getCurrentPolicy(), eventManager); @@ -309,7 +309,7 @@ public class ControlLoopOperationManagerTest { assertNotNull(notification); assertEquals(ControlLoopNotificationType.ACTIVE, notification.getNotification()); - ControlLoopEventManager.NEW_EVENT_STATUS status = null; + ControlLoopEventManager.NewEventStatus status = null; try { status = eventManager.onNewEvent(onset); } catch (AaiException e) { @@ -317,7 +317,7 @@ public class ControlLoopOperationManagerTest { fail("A&AI Query Failed"); } assertNotNull(status); - assertEquals(ControlLoopEventManager.NEW_EVENT_STATUS.FIRST_ONSET, status); + assertEquals(ControlLoopEventManager.NewEventStatus.FIRST_ONSET, status); ControlLoopOperationManager manager = new ControlLoopOperationManager(onset, processor.getCurrentPolicy(), eventManager); diff --git a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl index 4172b2d37..3368e9153 100644 --- a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl +++ b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl @@ -29,7 +29,7 @@ import org.onap.policy.controlloop.policy.PolicyResult; import org.onap.policy.controlloop.policy.ControlLoopPolicy; import org.onap.policy.controlloop.policy.Policy; import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager; -import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager.NEW_EVENT_STATUS; +import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager.NewEventStatus; import org.onap.policy.controlloop.eventmanager.ControlLoopOperationManager; import org.onap.policy.controlloop.actor.so.SoActorServiceProvider; import org.onap.policy.aai.AaiNqResponseWrapper; @@ -165,7 +165,7 @@ rule "${policyName}.EVENT" $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" ) $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName() ) not ( ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) ) + requestId == $event.getRequestId() ) ) then Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage()); @@ -285,7 +285,7 @@ rule "${policyName}.EVENT.MANAGER" $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" ) $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName() ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $clTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId().toString(), timerType == "ClosedLoop", !expired ) then @@ -299,11 +299,11 @@ rule "${policyName}.EVENT.MANAGER" // // Check which event this is. // - ControlLoopEventManager.NEW_EVENT_STATUS eventStatus = $manager.onNewEvent($event); + ControlLoopEventManager.NewEventStatus eventStatus = $manager.onNewEvent($event); // // Check what kind of event this is // - if (eventStatus == NEW_EVENT_STATUS.SUBSEQUENT_ONSET) { + if (eventStatus == NewEventStatus.SUBSEQUENT_ONSET) { // // We don't care about subsequent onsets // @@ -312,7 +312,7 @@ rule "${policyName}.EVENT.MANAGER" retract($event); return; } - if (eventStatus == NEW_EVENT_STATUS.SYNTAX_ERROR) { + if (eventStatus == NewEventStatus.SYNTAX_ERROR) { // // Ignore any bad syntax events // @@ -326,7 +326,7 @@ rule "${policyName}.EVENT.MANAGER" // all the other events need to be retracted to support // cleanup and avoid the other rules being fired for this event. // - if (eventStatus != NEW_EVENT_STATUS.FIRST_ONSET) { + if (eventStatus != NewEventStatus.FIRST_ONSET) { logger.warn("{}: {}: not first onset", $params.getClosedLoopControlName(), drools.getRule().getName()); retract($event); @@ -526,7 +526,7 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_PERMITTED" $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" ) $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName() ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId(), "Permit".equalsIgnoreCase(getGuardApprovalStatus()) ) $lock : TargetLock (requestID == $event.getRequestId()) @@ -674,7 +674,7 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_NOT_YET_QUERIED" $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" ) $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName() ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId(), getGuardApprovalStatus() == "NONE" ) $lock : TargetLock (requestID == $event.getRequestId()) @@ -743,7 +743,7 @@ rule "${policyName}.GUARD.RESPONSE" $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $lock : TargetLock (requestID == $event.getRequestId()) @@ -812,7 +812,7 @@ rule "${policyName}.APPC.RESPONSE" $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), @@ -930,7 +930,7 @@ rule "${policyName}.APPC.LCM.RESPONSE" $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), @@ -1039,7 +1039,7 @@ rule "${policyName}.SDNR.RESPONSE" $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), @@ -1148,7 +1148,7 @@ rule "${policyName}.SO.RESPONSE" $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), @@ -1236,7 +1236,7 @@ rule "${policyName}.VFC.RESPONSE" $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), @@ -1313,7 +1313,7 @@ rule "${policyName}.SDNC.RESPONSE" $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), @@ -1404,7 +1404,7 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.TIMEOUT" $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" ) $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName() ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), @@ -1471,7 +1471,7 @@ rule "${policyName}.EVENT.MANAGER.TIMEOUT" $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" ) $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName() ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $clTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId().toString(), expired, timerType == "ClosedLoop" ) then @@ -1510,7 +1510,7 @@ end */ rule "${policyName}.EVENT.MANAGER.CLEANUP" when - $manager : ControlLoopEventManager( $clName : getClosedLoopControlName(), $requestId : getRequestID() ) + $manager : ControlLoopEventManager( $clName : getClosedLoopControlName(), $requestId : getRequestId() ) $operations : LinkedList() from collect( ControlLoopOperationManager( onset.closedLoopControlName == $clName, onset.getRequestId() == $requestId ) ) diff --git a/controlloop/templates/archetype-cl-casablanca/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl b/controlloop/templates/archetype-cl-casablanca/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl index d1c8a0739..92fa87559 100644 --- a/controlloop/templates/archetype-cl-casablanca/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl +++ b/controlloop/templates/archetype-cl-casablanca/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl @@ -30,7 +30,7 @@ import org.onap.policy.controlloop.policy.PolicyResult; import org.onap.policy.controlloop.policy.ControlLoopPolicy; import org.onap.policy.controlloop.policy.Policy; import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager; -import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager.NEW_EVENT_STATUS; +import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager.NewEventStatus; import org.onap.policy.controlloop.eventmanager.ControlLoopOperationManager; import org.onap.policy.controlloop.actor.so.SoActorServiceProvider; import org.onap.policy.aai.AaiNqResponseWrapper; @@ -117,7 +117,7 @@ rule "EVENT" $params : ControlLoopParams( $clName : getClosedLoopControlName() ) $event : VirtualControlLoopEvent( closedLoopControlName == $clName ) not ( ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) ) + requestId == $event.getRequestId() ) ) then Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage()); @@ -236,7 +236,7 @@ rule "EVENT.MANAGER" $params : ControlLoopParams( $clName : getClosedLoopControlName() ) $event : VirtualControlLoopEvent( closedLoopControlName == $clName ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $clTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId().toString(), timerType == "ClosedLoop", !expired ) then @@ -250,11 +250,11 @@ rule "EVENT.MANAGER" // // Check which event this is. // - ControlLoopEventManager.NEW_EVENT_STATUS eventStatus = $manager.onNewEvent($event); + ControlLoopEventManager.NewEventStatus eventStatus = $manager.onNewEvent($event); // // Check what kind of event this is // - if (eventStatus == NEW_EVENT_STATUS.SUBSEQUENT_ONSET) { + if (eventStatus == NewEventStatus.SUBSEQUENT_ONSET) { // // We don't care about subsequent onsets // @@ -263,7 +263,7 @@ rule "EVENT.MANAGER" retract($event); return; } - if (eventStatus == NEW_EVENT_STATUS.SYNTAX_ERROR) { + if (eventStatus == NewEventStatus.SYNTAX_ERROR) { // // Ignore any bad syntax events // @@ -277,7 +277,7 @@ rule "EVENT.MANAGER" // all the other events need to be retracted to support // cleanup and avoid the other rules being fired for this event. // - if (eventStatus != NEW_EVENT_STATUS.FIRST_ONSET) { + if (eventStatus != NewEventStatus.FIRST_ONSET) { logger.warn("{}: {}: no first onset", $clName, $params.getPolicyName() + "." + drools.getRule().getName()); retract($event); @@ -475,7 +475,7 @@ rule "EVENT.MANAGER.OPERATION.LOCKED.GUARD_PERMITTED" $params : ControlLoopParams( $clName : getClosedLoopControlName() ) $event : VirtualControlLoopEvent( closedLoopControlName == $clName ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId(), "Permit".equalsIgnoreCase(getGuardApprovalStatus()) ) $lock : TargetLock (requestID == $event.getRequestId()) @@ -624,7 +624,7 @@ rule "EVENT.MANAGER.OPERATION.LOCKED.GUARD_NOT_YET_QUERIED" $params : ControlLoopParams( $clName : getClosedLoopControlName() ) $event : VirtualControlLoopEvent( closedLoopControlName == $clName ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId(), getGuardApprovalStatus() == "NONE" ) $lock : TargetLock (requestID == $event.getRequestId()) @@ -693,7 +693,7 @@ rule "GUARD.RESPONSE" $event : VirtualControlLoopEvent( closedLoopControlName == $clName, closedLoopEventStatus == ControlLoopEventStatus.ONSET ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $lock : TargetLock (requestID == $event.getRequestId()) @@ -762,7 +762,7 @@ rule "APPC.RESPONSE" $event : VirtualControlLoopEvent( closedLoopControlName == $clName, closedLoopEventStatus == ControlLoopEventStatus.ONSET ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), @@ -880,7 +880,7 @@ rule "APPC.LCM.RESPONSE" $event : VirtualControlLoopEvent( closedLoopControlName == $clName, closedLoopEventStatus == ControlLoopEventStatus.ONSET ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), @@ -989,7 +989,7 @@ rule "SO.RESPONSE" $event : VirtualControlLoopEvent( closedLoopControlName == $clName, closedLoopEventStatus == ControlLoopEventStatus.ONSET ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), @@ -1077,7 +1077,7 @@ rule "VFC.RESPONSE" $event : VirtualControlLoopEvent( closedLoopControlName == $clName, closedLoopEventStatus == ControlLoopEventStatus.ONSET ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), @@ -1151,7 +1151,7 @@ rule "SDNC.RESPONSE" when $params : ControlLoopParams( $clName : getClosedLoopControlName() ) $event : VirtualControlLoopEvent( closedLoopControlName == $clName, closedLoopEventStatus == ControlLoopEventStatus.ONSET ) - $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId() ) + $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId().toString(), timerType == "Operation", !expired ) @@ -1241,7 +1241,7 @@ rule "EVENT.MANAGER.OPERATION.TIMEOUT" $params : ControlLoopParams( $clName : getClosedLoopControlName() ) $event : VirtualControlLoopEvent( closedLoopControlName == $clName ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), @@ -1308,7 +1308,7 @@ rule "EVENT.MANAGER.TIMEOUT" $params : ControlLoopParams( $clName : getClosedLoopControlName() ) $event : VirtualControlLoopEvent( closedLoopControlName == $clName ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $clTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId().toString(), timerType == "ClosedLoop", expired ) then @@ -1347,7 +1347,7 @@ end */ rule "EVENT.MANAGER.CLEANUP" when - $manager : ControlLoopEventManager( $clName : getClosedLoopControlName(), $requestId : getRequestID() ) + $manager : ControlLoopEventManager( $clName : getClosedLoopControlName(), $requestId : getRequestId() ) $operations : LinkedList() from collect( ControlLoopOperationManager( onset.closedLoopControlName == $clName, onset.getRequestId() == $requestId ) ) @@ -1418,7 +1418,7 @@ rule "SDNR.RESPONSE" $event : VirtualControlLoopEvent( closedLoopControlName == $clName, closedLoopEventStatus == ControlLoopEventStatus.ONSET ) $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), - requestID == $event.getRequestId() ) + requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : ControlLoopTimer( closedLoopControlName == $event.getClosedLoopControlName(), diff --git a/controlloop/templates/template.demo.clc/src/main/resources/__closedLoopControlName__.drl b/controlloop/templates/template.demo.clc/src/main/resources/__closedLoopControlName__.drl index 5a2d8ded3..1cbeac34c 100644 --- a/controlloop/templates/template.demo.clc/src/main/resources/__closedLoopControlName__.drl +++ b/controlloop/templates/template.demo.clc/src/main/resources/__closedLoopControlName__.drl @@ -30,7 +30,7 @@ import org.onap.policy.controlloop.policy.PolicyResult; import org.onap.policy.controlloop.policy.ControlLoopPolicy; import org.onap.policy.controlloop.policy.Policy; import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager; -import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager.NEW_EVENT_STATUS; +import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager.NewEventStatus; import org.onap.policy.controlloop.eventmanager.ControlLoopOperationManager; import org.onap.policy.controlloop.actor.so.SoActorServiceProvider; import org.onap.policy.aai.AaiNqResponseWrapper; @@ -162,7 +162,7 @@ rule "${policyName}.EVENT" when $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" ) $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName() ) - not ( ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId() ) ) + not ( ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId() ) ) then Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage()); @@ -282,7 +282,7 @@ rule "${policyName}.EVENT.MANAGER" when $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" ) $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName() ) - $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId() ) + $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId() ) $clTimer : ControlLoopTimer ( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId().toString() ) then @@ -295,11 +295,11 @@ rule "${policyName}.EVENT.MANAGER" // // Check which event this is. // - ControlLoopEventManager.NEW_EVENT_STATUS eventStatus = $manager.onNewEvent($event); + ControlLoopEventManager.NewEventStatus eventStatus = $manager.onNewEvent($event); // // Check what kind of event this is // - if (eventStatus == NEW_EVENT_STATUS.SUBSEQUENT_ONSET) { + if (eventStatus == NewEventStatus.SUBSEQUENT_ONSET) { // // We don't care about subsequent onsets // @@ -308,7 +308,7 @@ rule "${policyName}.EVENT.MANAGER" retract($event); return; } - if (eventStatus == NEW_EVENT_STATUS.SYNTAX_ERROR) { + if (eventStatus == NewEventStatus.SYNTAX_ERROR) { // // Ignore any bad syntax events // @@ -322,7 +322,7 @@ rule "${policyName}.EVENT.MANAGER" // all the other events need to be retracted to support // cleanup and avoid the other rules being fired for this event. // - if (eventStatus != NEW_EVENT_STATUS.FIRST_ONSET) { + if (eventStatus != NewEventStatus.FIRST_ONSET) { logger.warn("{}: {}: not first onset", $params.getClosedLoopControlName(), drools.getRule().getName()); retract($event); @@ -533,7 +533,7 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_PERMITTED" when $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" ) $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName() ) - $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId() ) + $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId(), "Permit".equalsIgnoreCase(getGuardApprovalStatus()) ) $lock : TargetLock (requestID == $event.getRequestId()) $opTimer : OperationTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId().toString() ) @@ -660,7 +660,7 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_NOT_YET_QUERIED" when $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" ) $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName() ) - $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId() ) + $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId(), getGuardApprovalStatus() == "NONE" ) $lock : TargetLock (requestID == $event.getRequestId()) then @@ -722,7 +722,7 @@ rule "${policyName}.GUARD.RESPONSE" when $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" ) $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET ) - $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId() ) + $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $lock : TargetLock (requestID == $event.getRequestId()) $opTimer : OperationTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId().toString() ) @@ -786,7 +786,7 @@ rule "${policyName}.APPC.RESPONSE" when $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" ) $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET ) - $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId() ) + $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : OperationTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId().toString() ) $lock : TargetLock (requestID == $event.getRequestId()) @@ -900,7 +900,7 @@ rule "${policyName}.APPC.LCM.RESPONSE" when $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" ) $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET ) - $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId() ) + $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : OperationTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId().toString() ) $lock : TargetLock (requestID == $event.getRequestId()) @@ -1005,7 +1005,7 @@ rule "${policyName}.SO.RESPONSE" when $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" ) $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET ) - $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId() ) + $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : OperationTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId().toString() ) $lock : TargetLock (requestID == $event.getRequestId()) @@ -1089,7 +1089,7 @@ rule "${policyName}.VFC.RESPONSE" when $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" ) $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET ) - $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId() ) + $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : OperationTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId().toString() ) $lock : TargetLock (requestID == $event.getRequestId()) @@ -1162,7 +1162,7 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.TIMEOUT" when $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" ) $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName() ) - $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId() ) + $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId() ) $operation : ControlLoopOperationManager( onset.closedLoopControlName == $event.getClosedLoopControlName(), onset.getRequestId() == $event.getRequestId() ) $opTimer : OperationTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId().toString(), $to : getDelay() ) $lock : TargetLock (requestID == $event.getRequestId()) @@ -1227,7 +1227,7 @@ rule "${policyName}.EVENT.MANAGER.TIMEOUT" when $params : Params( getClosedLoopControlName() == "${closedLoopControlName}" ) $event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName() ) - $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId() ) + $manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId() ) $clTimer : ControlLoopTimer ( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId().toString(), $to : getDelay() ) then @@ -1265,7 +1265,7 @@ end */ rule "${policyName}.EVENT.MANAGER.CLEANUP" when - $manager : ControlLoopEventManager( $clName : getClosedLoopControlName(), $requestId : getRequestID() ) + $manager : ControlLoopEventManager( $clName : getClosedLoopControlName(), $requestId : getRequestId() ) $clTimer : ControlLoopTimer ( closedLoopControlName == $clName, requestID == $requestId.toString() ) $operations : LinkedList() from collect( ControlLoopOperationManager( onset.closedLoopControlName == $clName, onset.getRequestId() == $requestId ) ) |