From 1aa30b7d83f97103097c7f5d3e4cbd2fad92f659 Mon Sep 17 00:00:00 2001 From: Ritu Sood Date: Mon, 11 Sep 2017 14:20:13 -0700 Subject: Add VFC Response in Working Memory & JUNIT Adding code to insert VFC reponse in working memory and handling that response. Also adding JUNIT and yaml file for VoLTE usecase. Issue-Id: POLICY-212 Change-Id: I74a13272ccd931478d27d80715d8c3ac756fb5c7 Signed-off-by: Ritu Sood --- .../controlloop/actor/vfc/VFCActorServiceProvider.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'controlloop/common/actors/actor.vfc/src') 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 49b93e8aa..1ea65faa5 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 @@ -19,10 +19,8 @@ package org.onap.policy.controlloop.actor.vfc; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; - +import java.util.UUID; import org.onap.policy.controlloop.VirtualControlLoopEvent; import org.onap.policy.vfc.VFCRequest; import org.onap.policy.vfc.VFCHealRequest; @@ -30,15 +28,12 @@ import org.onap.policy.vfc.VFCHealAdditionalParams; import org.onap.policy.vfc.VFCHealActionVmInfo; import org.onap.policy.controlloop.ControlLoopOperation; import org.onap.policy.controlloop.policy.Policy; - import org.onap.policy.controlloop.actorServiceProvider.spi.Actor; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.onap.policy.aai.AAIManager; import org.onap.policy.aai.AAIGETVnfResponse; - -import java.util.UUID; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -76,7 +71,7 @@ public class VFCActorServiceProvider implements Actor { VFCRequest request = new VFCRequest(); // TODO: Verify service-instance-id is part of onset event request.nsInstanceId = getAAIServiceInstance(onset); // onset.AAI.get("service-instance.service-instance-id"); - + request.requestId = onset.requestID; request.healRequest = new VFCHealRequest(); request.healRequest.vnfInstanceId = onset.AAI.get("generic-vnf.vnf-id"); request.healRequest.cause = operation.message; @@ -110,14 +105,13 @@ public class VFCActorServiceProvider implements Actor { String password = "testPass"; if (serviceInstance == null) { try { - AAIManager manager = new AAIManager(); if (vnfName != null) { String url = urlBase + "/aai/v11/network/generic-vnfs/generic-vnf?vnf-name="; - response = manager.getQueryByVnfName(url, username, password, requestID, vnfName); + response = AAIManager.getQueryByVnfName(url, username, password, requestID, vnfName); serviceInstance = response.serviceId; } else if (vnfID != null) { String url = urlBase + "/aai/v11/network/generic-vnfs/generic-vnf/"; - response = manager.getQueryByVnfID(url, username, password, requestID, vnfID); + response = AAIManager.getQueryByVnfID(url, username, password, requestID, vnfID); serviceInstance = response.serviceId; } else { logger.error("getAAIServiceInstance failed"); -- cgit 1.2.3-korg