aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.vfc/src/main
diff options
context:
space:
mode:
authorpramod.jamkhedkar <pramod@research.att.com>2019-11-13 13:21:16 -0500
committerpramod.jamkhedkar <pramod@research.att.com>2019-11-13 15:41:00 -0500
commit6de5a0c9e2acf3a799f53c9fedf8a40861b6ddbe (patch)
tree8acb76dd6de88cef955ce0914046d072c3a6d1a0 /models-interactions/model-actors/actor.vfc/src/main
parentc34a4b6b2e111462cde7f5663b8fbbc4ad86fc7e (diff)
Removing Named Query.
Removing all the related files and necessary modifications for removing named query. The code now only supports Custom Query Issue-ID: POLICY-2125 Change-Id: Ifa5ccb74142aa424359c0dea85b90bbcf70147cb Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.vfc/src/main')
-rw-r--r--models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcActorServiceProvider.java74
1 files changed, 0 insertions, 74 deletions
diff --git a/models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcActorServiceProvider.java b/models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcActorServiceProvider.java
index a41d9e82d..482c25730 100644
--- a/models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcActorServiceProvider.java
+++ b/models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcActorServiceProvider.java
@@ -24,15 +24,11 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import java.util.Collections;
import java.util.List;
-import java.util.UUID;
import org.onap.policy.aai.AaiCqResponse;
-import org.onap.policy.aai.AaiGetVnfResponse;
-import org.onap.policy.aai.AaiManager;
import org.onap.policy.controlloop.ControlLoopOperation;
import org.onap.policy.controlloop.VirtualControlLoopEvent;
import org.onap.policy.controlloop.actorserviceprovider.spi.Actor;
import org.onap.policy.controlloop.policy.Policy;
-import org.onap.policy.rest.RestManager;
import org.onap.policy.vfc.VfcHealActionVmInfo;
import org.onap.policy.vfc.VfcHealAdditionalParams;
import org.onap.policy.vfc.VfcHealRequest;
@@ -79,76 +75,6 @@ public class VfcActorServiceProvider implements Actor {
}
/**
- * Construct a request.
- *
- * @param onset the onset event
- * @param operation the control loop operation
- * @param policy the policy
- * @param vnfResponse the VNF response
- * @return the constructed request
- */
- public static VfcRequest constructRequest(VirtualControlLoopEvent onset, ControlLoopOperation operation,
- Policy policy, AaiGetVnfResponse vnfResponse, String aaiUrl, String aaiUsername, String aaiPassword) {
-
- // Construct an VFC request
- VfcRequest request = new VfcRequest();
- String serviceInstance = onset.getAai().get("service-instance.service-instance-id");
- if (serviceInstance == null || "".equals(serviceInstance)) {
- AaiGetVnfResponse tempVnfResp = vnfResponse;
- if (tempVnfResp == null) { // if the response is null, we haven't queried
- // This does the AAI query since we haven't already
- tempVnfResp = getAaiServiceInstance(onset, aaiUrl, aaiUsername, aaiPassword);
- if (tempVnfResp == null) {
- return null;
- }
- }
- serviceInstance = tempVnfResp.getServiceId();
- }
- request.setNsInstanceId(serviceInstance);
- request.setRequestId(onset.getRequestId());
- request.setHealRequest(new VfcHealRequest());
- request.getHealRequest().setVnfInstanceId(onset.getAai().get(GENERIC_VNF_ID));
- request.getHealRequest().setCause(operation.getMessage());
- request.getHealRequest().setAdditionalParams(new VfcHealAdditionalParams());
-
- if (policy.getRecipe().toLowerCase().equalsIgnoreCase(RECIPE_RESTART)) {
- request.getHealRequest().getAdditionalParams().setAction("restartvm");
- request.getHealRequest().getAdditionalParams().setActionInfo(new VfcHealActionVmInfo());
- request.getHealRequest().getAdditionalParams().getActionInfo()
- .setVmid(onset.getAai().get("vserver.vserver-id"));
- request.getHealRequest().getAdditionalParams().getActionInfo()
- .setVmname(onset.getAai().get("vserver.vserver-name"));
- } else {
- return null;
- }
- return request;
- }
-
- private static AaiGetVnfResponse getAaiServiceInstance(VirtualControlLoopEvent event, String aaiUrl,
- String aaiUsername, String aaiPassword) {
- AaiGetVnfResponse response = null;
- UUID requestId = event.getRequestId();
- String vnfName = event.getAai().get("generic-vnf.vnf-name");
- String vnfId = event.getAai().get(GENERIC_VNF_ID);
- try {
- if (vnfName != null) {
- String url = aaiUrl + "/aai/v11/network/generic-vnfs/generic-vnf?vnf-name=";
- response = new AaiManager(new RestManager()).getQueryByVnfName(url, aaiUsername, aaiPassword, requestId,
- vnfName);
- } else if (vnfId != null) {
- String url = aaiUrl + "/aai/v11/network/generic-vnfs/generic-vnf/";
- response = new AaiManager(new RestManager()).getQueryByVnfId(url, aaiUsername, aaiPassword, requestId,
- vnfId);
- } else {
- logger.error("getAAIServiceInstance failed");
- }
- } catch (Exception e) {
- logger.error("getAAIServiceInstance exception: ", e);
- }
- return response;
- }
-
- /**
* This method constructs the VFC request.
*
* @param onset onset object