summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.vfc/src/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-07-13 16:06:57 -0400
committerJim Hahn <jrh3@att.com>2020-07-13 16:07:54 -0400
commitc88676ec64c4c870252502bc1cfaa8990c8fd964 (patch)
treed88ec0ac29d5c3066fab025392df4a69256cf288 /models-interactions/model-actors/actor.vfc/src/main
parente4e7d15db6d2f79658e3a5f9e8326ea092afcfab (diff)
Remove legacy actor code from models
Deleted legacy actor code. That includes deleting most of the XxxManager classes. Issue-ID: POLICY-2559 Change-Id: I1ef1b900ca1d23e88da64b2c95a18986feb1b765 Signed-off-by: Jim Hahn <jrh3@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/VfcActor.java105
1 files changed, 1 insertions, 104 deletions
diff --git a/models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcActor.java b/models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcActor.java
index cf4173176..c3b9028be 100644
--- a/models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcActor.java
+++ b/models-interactions/model-actors/actor.vfc/src/main/java/org/onap/policy/controlloop/actor/vfc/VfcActor.java
@@ -20,43 +20,12 @@
package org.onap.policy.controlloop.actor.vfc;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import java.util.Collections;
-import java.util.List;
-import org.onap.policy.aai.AaiCqResponse;
-import org.onap.policy.controlloop.ControlLoopOperation;
-import org.onap.policy.controlloop.VirtualControlLoopEvent;
import org.onap.policy.controlloop.actorserviceprovider.impl.HttpActor;
import org.onap.policy.controlloop.actorserviceprovider.impl.HttpPollingOperator;
import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpPollingActorParams;
-import org.onap.policy.controlloop.policy.Policy;
-import org.onap.policy.vfc.VfcHealActionVmInfo;
-import org.onap.policy.vfc.VfcHealAdditionalParams;
-import org.onap.policy.vfc.VfcHealRequest;
-import org.onap.policy.vfc.VfcRequest;
public class VfcActor extends HttpActor<HttpPollingActorParams> {
- private static final String GENERIC_VNF_ID = "generic-vnf.vnf-id";
-
- // TODO old code: remove lines down to **HERE**
-
- // Strings for VFC Actor
- private static final String VFC_ACTOR = "VFC";
-
- public static final String NAME = VFC_ACTOR;
-
- // Strings for targets
- private static final String TARGET_VM = "VM";
-
- // Strings for recipes
- private static final String RECIPE_RESTART = "Restart";
-
- private static final ImmutableList<String> recipes = ImmutableList.of(RECIPE_RESTART);
- private static final ImmutableMap<String, List<String>> targets =
- new ImmutableMap.Builder<String, List<String>>().put(RECIPE_RESTART, ImmutableList.of(TARGET_VM)).build();
-
- // **HERE**
+ public static final String NAME = "VFC";
/**
* Constructor.
@@ -66,76 +35,4 @@ public class VfcActor extends HttpActor<HttpPollingActorParams> {
addOperator(new HttpPollingOperator(NAME, Restart.NAME, Restart::new));
}
-
- // TODO old code: remove lines down to **HERE**
-
- @Override
- public String actor() {
- return VFC_ACTOR;
- }
-
- @Override
- public List<String> recipes() {
- return ImmutableList.copyOf(recipes);
- }
-
- @Override
- public List<String> recipeTargets(String recipe) {
- return ImmutableList.copyOf(targets.getOrDefault(recipe, Collections.emptyList()));
- }
-
- @Override
- public List<String> recipePayloads(String recipe) {
- return Collections.emptyList();
- }
-
- /**
- * This method constructs the VFC request.
- *
- * @param onset onset object
- * @param operation operation object
- * @param policy policy object
- * @param aaiCqResponse response from aai custom query
- * @return VfcRequest
- */
- public static VfcRequest constructRequestCq(VirtualControlLoopEvent onset, ControlLoopOperation operation,
- Policy policy, AaiCqResponse aaiCqResponse) {
-
- // Construct an VFC request
- VfcRequest request = new VfcRequest();
- String serviceInstance = onset.getAai().get("service-instance.service-instance-id");
- if (serviceInstance == null || "".equals(serviceInstance)) {
- // get service instance from AaiCqResponse
- if (aaiCqResponse == null) {
- return null;
- }
- serviceInstance = aaiCqResponse.getServiceInstance().getServiceInstanceId();
- // If the serviceInstanceId returned is null then return null
- if (serviceInstance == null) {
- return null;
- }
-
- }
- 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;
- }
-
- // **HERE**
-
}