summaryrefslogtreecommitdiffstats
path: root/controlloop/templates/template.demo.clc
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-01-14 14:30:46 -0500
committerJim Hahn <jrh3@att.com>2019-01-14 15:12:11 -0500
commit12fab6215a7a92b4959330ef179d38454dbb6225 (patch)
treec4edaa8ecdf3cfc59e15b20b739a481ed67f9ccd /controlloop/templates/template.demo.clc
parentdd691f02e2caa6028a868915b016a71bf6c1c876 (diff)
Remove guard checkstyle suppressions
Renamed a number of fields and methods, in the Guard classes, to conform to camel-case format. Also updated some toString() methods to return "xxxId=" instead of "xxxID=", if the corresponding field names were also xxxId. Updated license data in one changed file. Change-Id: Idac58f8744b5523d6daed7f369026495dd357bf8 Issue-ID: POLICY-1140 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'controlloop/templates/template.demo.clc')
-rw-r--r--controlloop/templates/template.demo.clc/src/main/java/org/onap/policy/guard/CallGuardTaskEmbedded.java4
-rw-r--r--controlloop/templates/template.demo.clc/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelperEmbedded.java12
-rw-r--r--controlloop/templates/template.demo.clc/src/main/resources/__closedLoopControlName__.drl50
3 files changed, 33 insertions, 33 deletions
diff --git a/controlloop/templates/template.demo.clc/src/main/java/org/onap/policy/guard/CallGuardTaskEmbedded.java b/controlloop/templates/template.demo.clc/src/main/java/org/onap/policy/guard/CallGuardTaskEmbedded.java
index c75c8a0b7..1c4cada61 100644
--- a/controlloop/templates/template.demo.clc/src/main/java/org/onap/policy/guard/CallGuardTaskEmbedded.java
+++ b/controlloop/templates/template.demo.clc/src/main/java/org/onap/policy/guard/CallGuardTaskEmbedded.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* guard
* ================================================================================
- * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018-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.
@@ -153,7 +153,7 @@ public class CallGuardTaskEmbedded implements Runnable {
//
if ("Indeterminate".equals(guardResponse.getResult())) {
guardResponse.setOperation(recipe);
- guardResponse.setRequestID(UUID.fromString(requestId));
+ guardResponse.setRequestId(UUID.fromString(requestId));
}
long estimatedTime = System.nanoTime() - startTime;
diff --git a/controlloop/templates/template.demo.clc/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelperEmbedded.java b/controlloop/templates/template.demo.clc/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelperEmbedded.java
index 64fb70bbd..1e9f3371b 100644
--- a/controlloop/templates/template.demo.clc/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelperEmbedded.java
+++ b/controlloop/templates/template.demo.clc/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelperEmbedded.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* guard
* ================================================================================
- * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018-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.
@@ -107,11 +107,11 @@ public class PolicyGuardXacmlHelperEmbedded {
// Build the json request
//
JSONObject attributes = new JSONObject();
- attributes.put("actor", xacmlReq.getActorID());
- attributes.put("recipe", xacmlReq.getOperationID());
- attributes.put("target", xacmlReq.getTargetID());
- if (xacmlReq.getClnameID() != null) {
- attributes.put("clname", xacmlReq.getClnameID());
+ attributes.put("actor", xacmlReq.getActorId());
+ attributes.put("recipe", xacmlReq.getOperationId());
+ attributes.put("target", xacmlReq.getTargetId());
+ if (xacmlReq.getClnameId() != null) {
+ attributes.put("clname", xacmlReq.getClnameId());
}
if (xacmlReq.getVfCount() != null) {
attributes.put("vfCount", xacmlReq.getVfCount());
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 1cbeac34c..f2584c063 100644
--- a/controlloop/templates/template.demo.clc/src/main/resources/__closedLoopControlName__.drl
+++ b/controlloop/templates/template.demo.clc/src/main/resources/__closedLoopControlName__.drl
@@ -109,7 +109,7 @@ end
*/
declare OperationTimer
closedLoopControlName : String
- requestID : String
+ requestId : String
delay : String
end
@@ -118,7 +118,7 @@ end
*/
declare ControlLoopTimer
closedLoopControlName : String
- requestID : String
+ requestId : String
delay : String
end
@@ -229,7 +229,7 @@ rule "${policyName}.EVENT"
//
ControlLoopTimer clTimer = new ControlLoopTimer();
clTimer.setClosedLoopControlName($event.getClosedLoopControlName());
- clTimer.setRequestID($event.getRequestId().toString());
+ clTimer.setRequestId($event.getRequestId().toString());
clTimer.setDelay(manager.getControlLoopTimeout(1500) + "s");
//
// Insert it
@@ -283,7 +283,7 @@ rule "${policyName}.EVENT.MANAGER"
$params : Params( getClosedLoopControlName() == "${closedLoopControlName}" )
$event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName() )
$manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId() )
- $clTimer : ControlLoopTimer ( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId().toString() )
+ $clTimer : ControlLoopTimer ( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId().toString() )
then
Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
@@ -461,7 +461,7 @@ rule "${policyName}.EVENT.MANAGER"
//
OperationTimer opTimer = new OperationTimer();
opTimer.setClosedLoopControlName($event.getClosedLoopControlName());
- opTimer.setRequestID($event.getRequestId().toString());
+ opTimer.setRequestId($event.getRequestId().toString());
opTimer.setDelay(operation.getOperationTimeout().toString() + "s");
insert(opTimer);
@@ -535,8 +535,8 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_PERMITTED"
$event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName() )
$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() )
+ $lock : TargetLock (requestId == $event.getRequestId())
+ $opTimer : OperationTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId().toString() )
then
Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
@@ -662,7 +662,7 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.LOCKED.GUARD_NOT_YET_QUERIED"
$event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName() )
$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())
+ $lock : TargetLock (requestId == $event.getRequestId())
then
Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
@@ -724,9 +724,9 @@ rule "${policyName}.GUARD.RESPONSE"
$event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET )
$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() )
- $guardResponse : PolicyGuardResponse(requestID == $event.getRequestId(), $operation.policy.recipe == operation)
+ $lock : TargetLock (requestId == $event.getRequestId())
+ $opTimer : OperationTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId().toString() )
+ $guardResponse : PolicyGuardResponse(requestId == $event.getRequestId(), $operation.policy.recipe == operation)
then
Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
@@ -788,8 +788,8 @@ rule "${policyName}.APPC.RESPONSE"
$event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET )
$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())
+ $opTimer : OperationTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId().toString() )
+ $lock : TargetLock (requestId == $event.getRequestId())
$response : Response( getCommonHeader().RequestId == $event.getRequestId() )
then
@@ -902,8 +902,8 @@ rule "${policyName}.APPC.LCM.RESPONSE"
$event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET )
$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())
+ $opTimer : OperationTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId().toString() )
+ $lock : TargetLock (requestId == $event.getRequestId())
$response : LcmResponseWrapper( getBody().getCommonHeader().getRequestId() == $event.getRequestId() )
then
@@ -1007,8 +1007,8 @@ rule "${policyName}.SO.RESPONSE"
$event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET )
$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())
+ $opTimer : OperationTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId().toString() )
+ $lock : TargetLock (requestId == $event.getRequestId())
$response : SoResponseWrapper(requestId.toString() == $event.getRequestId().toString() )
then
@@ -1091,8 +1091,8 @@ rule "${policyName}.VFC.RESPONSE"
$event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName(), closedLoopEventStatus == ControlLoopEventStatus.ONSET )
$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())
+ $opTimer : OperationTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId().toString() )
+ $lock : TargetLock (requestId == $event.getRequestId())
$response : VfcResponse( requestId.toString() == $event.getRequestId().toString() )
then
Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
@@ -1164,8 +1164,8 @@ rule "${policyName}.EVENT.MANAGER.OPERATION.TIMEOUT"
$event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName() )
$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())
+ $opTimer : OperationTimer( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId().toString(), $to : getDelay() )
+ $lock : TargetLock (requestId == $event.getRequestId())
then
Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
@@ -1228,7 +1228,7 @@ rule "${policyName}.EVENT.MANAGER.TIMEOUT"
$params : Params( getClosedLoopControlName() == "${closedLoopControlName}" )
$event : VirtualControlLoopEvent( closedLoopControlName == $params.getClosedLoopControlName() )
$manager : ControlLoopEventManager( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId() )
- $clTimer : ControlLoopTimer ( closedLoopControlName == $event.getClosedLoopControlName(), requestID == $event.getRequestId().toString(), $to : getDelay() )
+ $clTimer : ControlLoopTimer ( closedLoopControlName == $event.getClosedLoopControlName(), requestId == $event.getRequestId().toString(), $to : getDelay() )
then
Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
@@ -1266,13 +1266,13 @@ end
rule "${policyName}.EVENT.MANAGER.CLEANUP"
when
$manager : ControlLoopEventManager( $clName : getClosedLoopControlName(), $requestId : getRequestId() )
- $clTimer : ControlLoopTimer ( closedLoopControlName == $clName, requestID == $requestId.toString() )
+ $clTimer : ControlLoopTimer ( closedLoopControlName == $clName, requestId == $requestId.toString() )
$operations : LinkedList()
from collect( ControlLoopOperationManager( onset.closedLoopControlName == $clName, onset.getRequestId() == $requestId ) )
$opTimers : LinkedList()
- from collect( OperationTimer( closedLoopControlName == $clName, requestID == $requestId.toString() ) )
+ from collect( OperationTimer( closedLoopControlName == $clName, requestId == $requestId.toString() ) )
$locks : LinkedList()
- from collect( TargetLock (requestID == $requestId) )
+ from collect( TargetLock (requestId == $requestId) )
not( VirtualControlLoopEvent( closedLoopControlName == $clName, requestId == $requestId ) )
then