summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2017-08-29 04:25:26 -0700
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2017-08-29 04:25:26 -0700
commit180d25d8a83bd521f82441b5caa68e9153e86d98 (patch)
treead588e755e7a18271340a2bdc803bae42e36a960 /src/main
parente35744d33b2633200362b841d1accffafa6fb94d (diff)
Rework the format of this file
The formatting was not correct and the imports were not sorted properly (according to Checkstyle) Change-Id: I4e0ddf8c2d493b41a335fd18070ccf285a43081d Issue-Id: CLAMP-43 Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/clamp/clds/client/req/OperationalPolicyReq.java27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/main/java/org/onap/clamp/clds/client/req/OperationalPolicyReq.java b/src/main/java/org/onap/clamp/clds/client/req/OperationalPolicyReq.java
index 41629cc11..950fcefe5 100644
--- a/src/main/java/org/onap/clamp/clds/client/req/OperationalPolicyReq.java
+++ b/src/main/java/org/onap/clamp/clds/client/req/OperationalPolicyReq.java
@@ -38,11 +38,11 @@ import org.onap.clamp.clds.model.prop.PolicyChain;
import org.onap.clamp.clds.model.prop.PolicyItem;
import org.onap.clamp.clds.model.prop.Tca;
import org.onap.clamp.clds.model.refprop.RefProp;
-import org.onap.policy.controlloop.policy.OperationsAccumulateParams;
import org.onap.policy.api.AttributeType;
import org.onap.policy.asdc.Resource;
import org.onap.policy.asdc.ResourceType;
import org.onap.policy.asdc.Service;
+import org.onap.policy.controlloop.policy.OperationsAccumulateParams;
import org.onap.policy.controlloop.policy.Policy;
import org.onap.policy.controlloop.policy.PolicyResult;
import org.onap.policy.controlloop.policy.Target;
@@ -274,21 +274,20 @@ public class OperationalPolicyReq {
Target target = new Target();
target.setType(TargetType.VM);
Policy lastPolicyObj = new Policy();
- for (int i = 0; i < policyItemList.size(); i++) {
+ for (int i = 0; i < policyItemList.size(); i++) {
org.onap.policy.controlloop.policy.Policy policyObj;
PolicyItem policyItem = policyItemList.get(i);
String policyName = policyItem.getRecipe() + " Policy";
if (i == 0) {
- //To set up time window payload for trigger policy
- Map<String, String> payloadMap = new HashMap<String, String>();
- payloadMap.put("timeWindow", refProp.getStringValue("op.eNodeB.timeWindow"));
- String policyDescription = policyItem.getRecipe()
+ // To set up time window payload for trigger policy
+ Map<String, String> payloadMap = new HashMap<String, String>();
+ payloadMap.put("timeWindow", refProp.getStringValue("op.eNodeB.timeWindow"));
+ String policyDescription = policyItem.getRecipe()
+ " Policy - the trigger (no parent) policy - created by CLDS";
policyObj = builder.setTriggerPolicy(policyName, policyDescription, policyItem.getActor(), target,
policyItem.getRecipe(), payloadMap, policyItem.getMaxRetries(), policyItem.getRetryTimeLimit());
} else {
- Policy parentPolicyObj = policyObjMap
- .get(policyItem.getParentPolicy());
+ Policy parentPolicyObj = policyObjMap.get(policyItem.getParentPolicy());
String policyDescription = policyItem.getRecipe() + " Policy - triggered conditionally by "
+ parentPolicyObj.getName() + " - created by CLDS";
policyObj = builder.setPolicyForPolicyResult(policyName, policyDescription, policyItem.getActor(),
@@ -300,12 +299,12 @@ public class OperationalPolicyReq {
}
policyObjMap.put(policyItem.getId(), policyObj);
}
- //To set up operations accumulate params
- OperationsAccumulateParams operationsAccumulateParams = new OperationsAccumulateParams();
- operationsAccumulateParams.setLimit(Integer.valueOf(refProp.getStringValue("op.eNodeB.limit")));
- operationsAccumulateParams.setPeriod(refProp.getStringValue("op.eNodeB.period"));
- builder.addOperationsAccumulateParams(lastPolicyObj.getId(), operationsAccumulateParams);
-
+ // To set up operations accumulate params
+ OperationsAccumulateParams operationsAccumulateParams = new OperationsAccumulateParams();
+ operationsAccumulateParams.setLimit(Integer.valueOf(refProp.getStringValue("op.eNodeB.limit")));
+ operationsAccumulateParams.setPeriod(refProp.getStringValue("op.eNodeB.period"));
+ builder.addOperationsAccumulateParams(lastPolicyObj.getId(), operationsAccumulateParams);
+
//
// Build the specification
//