summaryrefslogtreecommitdiffstats
path: root/controlloop/common/actors/actor.vfc/src
diff options
context:
space:
mode:
authorLiam Fallon <liam.fallon@ericsson.com>2018-01-18 10:55:53 +0000
committerLiam Fallon <liam.fallon@ericsson.com>2018-01-18 11:06:22 +0000
commitb2a9a8adbcf036780bf47c5c94dbf65a088ab540 (patch)
treef594ceccac054e76a67e83de0712cf3896d0c8c7 /controlloop/common/actors/actor.vfc/src
parentbdf5640a2c68a0899363503dafa0f7cb1557e4a6 (diff)
Fix Tech Debt/JUnit on control loop event POJOs
Mainly making fields private, fixing field and methods to follow Java guidelines, and adding getter and setter methods. Unit test added for all classes in org.onap.policy.controlloop Issue-ID: POLICY-455 Change-Id: I445b7cfaf9eb921a230bbb72b06ff4455fe003ce Signed-off-by: Liam Fallon <liam.fallon@ericsson.com>
Diffstat (limited to 'controlloop/common/actors/actor.vfc/src')
-rw-r--r--controlloop/common/actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VFCActorServiceProvider.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/controlloop/common/actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VFCActorServiceProvider.java b/controlloop/common/actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VFCActorServiceProvider.java
index efa3dba1f..dae60cb82 100644
--- a/controlloop/common/actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VFCActorServiceProvider.java
+++ b/controlloop/common/actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VFCActorServiceProvider.java
@@ -70,7 +70,7 @@ public class VFCActorServiceProvider implements Actor {
Policy policy, AAIGETVnfResponse vnfResponse) {
// Construct an VFC request
VFCRequest request = new VFCRequest();
- String serviceInstance = onset.AAI.get("service-instance.service-instance-id");
+ String serviceInstance = onset.getAAI().get("service-instance.service-instance-id");
if (serviceInstance == null || "".equals(serviceInstance))
{
AAIGETVnfResponse tempVnfResp = vnfResponse;
@@ -83,18 +83,18 @@ public class VFCActorServiceProvider implements Actor {
serviceInstance = tempVnfResp.getServiceId();
}
request.nsInstanceId = serviceInstance;
- request.requestId = onset.requestID;
+ request.requestId = onset.getRequestID();
request.healRequest = new VFCHealRequest();
- request.healRequest.vnfInstanceId = onset.AAI.get("generic-vnf.vnf-id");
- request.healRequest.cause = operation.message;
+ request.healRequest.vnfInstanceId = onset.getAAI().get("generic-vnf.vnf-id");
+ request.healRequest.cause = operation.getMessage();
request.healRequest.additionalParams = new VFCHealAdditionalParams();
switch (policy.getRecipe().toLowerCase()) {
case "restart":
request.healRequest.additionalParams.action = "restartvm";
request.healRequest.additionalParams.actionInfo = new VFCHealActionVmInfo();
- request.healRequest.additionalParams.actionInfo.vmid = onset.AAI.get("vserver.vserver-id");
- request.healRequest.additionalParams.actionInfo.vmname = onset.AAI.get("vserver.vserver-name");
+ request.healRequest.additionalParams.actionInfo.vmid = onset.getAAI().get("vserver.vserver-id");
+ request.healRequest.additionalParams.actionInfo.vmname = onset.getAAI().get("vserver.vserver-name");
break;
default:
return null;
@@ -105,9 +105,9 @@ public class VFCActorServiceProvider implements Actor {
private static AAIGETVnfResponse getAAIServiceInstance(VirtualControlLoopEvent event) {
AAIGETVnfResponse response = null;
- UUID requestID = event.requestID;
- String vnfName = event.AAI.get("generic-vnf.vnf-name");
- String vnfID = event.AAI.get("generic-vnf.vnf-id");
+ UUID requestID = event.getRequestID();
+ String vnfName = event.getAAI().get("generic-vnf.vnf-name");
+ String vnfID = event.getAAI().get("generic-vnf.vnf-id");
String aaiUrl = PolicyEngine.manager.getEnvironmentProperty("aai.url");
String aaiUsername = PolicyEngine.manager.getEnvironmentProperty("aai.username");
String aaiPassword = PolicyEngine.manager.getEnvironmentProperty("aai.password");