diff options
author | Jim Hahn <jrh3@att.com> | 2020-07-13 16:06:57 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-07-13 16:07:54 -0400 |
commit | c88676ec64c4c870252502bc1cfaa8990c8fd964 (patch) | |
tree | d88ec0ac29d5c3066fab025392df4a69256cf288 /models-interactions/model-actors/actor.sdnc/src/main | |
parent | e4e7d15db6d2f79658e3a5f9e8326ea092afcfab (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.sdnc/src/main')
-rw-r--r-- | models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/SdncActor.java | 182 |
1 files changed, 0 insertions, 182 deletions
diff --git a/models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/SdncActor.java b/models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/SdncActor.java index a5cf65f34..c67b58b8d 100644 --- a/models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/SdncActor.java +++ b/models-interactions/model-actors/actor.sdnc/src/main/java/org/onap/policy/controlloop/actor/sdnc/SdncActor.java @@ -22,56 +22,13 @@ package org.onap.policy.controlloop.actor.sdnc; -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.controlloop.ControlLoopOperation; -import org.onap.policy.controlloop.VirtualControlLoopEvent; import org.onap.policy.controlloop.actorserviceprovider.impl.HttpActor; import org.onap.policy.controlloop.actorserviceprovider.impl.HttpOperator; import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpActorParams; -import org.onap.policy.controlloop.policy.Policy; -import org.onap.policy.sdnc.SdncHealNetworkInfo; -import org.onap.policy.sdnc.SdncHealRequest; -import org.onap.policy.sdnc.SdncHealRequestHeaderInfo; -import org.onap.policy.sdnc.SdncHealRequestInfo; -import org.onap.policy.sdnc.SdncHealServiceInfo; -import org.onap.policy.sdnc.SdncHealVfModuleInfo; -import org.onap.policy.sdnc.SdncHealVfModuleParameter; -import org.onap.policy.sdnc.SdncHealVfModuleParametersInfo; -import org.onap.policy.sdnc.SdncHealVfModuleRequestInput; -import org.onap.policy.sdnc.SdncHealVnfInfo; -import org.onap.policy.sdnc.SdncRequest; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class SdncActor extends HttpActor<HttpActorParams> { - private static final Logger logger = LoggerFactory.getLogger(SdncActor.class); - public static final String NAME = "SDNC"; - // TODO old code: remove lines down to **HERE** - - // Strings for Sdnc Actor - private static final String SDNC_ACTOR = "SDNC"; - - // Strings for targets - private static final String TARGET_VM = "VM"; - - // Strings for recipes - private static final String RECIPE_REROUTE = "Reroute"; - - // Strings for recipes - private static final String RECIPE_BW_ON_DEMAND = "BandwidthOnDemand"; - - private static final ImmutableList<String> recipes = ImmutableList.of(RECIPE_REROUTE); - private static final ImmutableMap<String, List<String>> targets = new ImmutableMap.Builder<String, List<String>>() - .put(RECIPE_REROUTE, ImmutableList.of(TARGET_VM)).build(); - - // **HERE** - /** * Constructs the object. */ @@ -81,143 +38,4 @@ public class SdncActor extends HttpActor<HttpActorParams> { addOperator(new HttpOperator(NAME, RerouteOperation.NAME, RerouteOperation::new)); addOperator(new HttpOperator(NAME, BandwidthOnDemandOperation.NAME, BandwidthOnDemandOperation::new)); } - - - // TODO old code: remove lines down to **HERE** - - @Override - public String actor() { - return SDNC_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(); - } - - /** - * Construct a request. - * - * @param onset the onset event - * @param operation the control loop operation - * @param policy the policy - * @return the constructed request - */ - public SdncRequest constructRequest(VirtualControlLoopEvent onset, ControlLoopOperation operation, Policy policy) { - switch (policy.getRecipe()) { - case RECIPE_REROUTE: - return constructReOptimizeRequest(onset); - case RECIPE_BW_ON_DEMAND: - logger.info("Construct request for receipe {}", RECIPE_BW_ON_DEMAND); - return constructBwOnDemandRequest(onset); - default: - logger.info("Unsupported recipe {}", policy.getRecipe()); - return null; - } - } - - private SdncRequest constructBwOnDemandRequest(VirtualControlLoopEvent onset) { - // Construct an Sdnc request - String serviceInstance = onset.getAai().get("service-instance.service-instance-id"); - if (serviceInstance == null || serviceInstance.isEmpty()) { - // This indicates that AAI Enrichment needs to be done by event producer. - return null; - } - SdncHealVfModuleParameter bandwidth = new SdncHealVfModuleParameter(); - bandwidth.setName("bandwidth"); - bandwidth.setValue(onset.getAai().get("bandwidth")); - - SdncHealVfModuleParameter timeStamp = new SdncHealVfModuleParameter(); - timeStamp.setName("bandwidth-change-time"); - timeStamp.setValue(onset.getAai().get("bandwidth-change-time")); - - SdncHealVfModuleParametersInfo vfParametersInfo = new SdncHealVfModuleParametersInfo(); - vfParametersInfo.addParameters(bandwidth); - vfParametersInfo.addParameters(timeStamp); - - SdncHealVfModuleRequestInput vfRequestInfo = new SdncHealVfModuleRequestInput(); - vfRequestInfo.setVfModuleParametersInfo(vfParametersInfo); - - SdncHealServiceInfo serviceInfo = new SdncHealServiceInfo(); - serviceInfo.setServiceInstanceId(serviceInstance); - - SdncHealRequestInfo requestInfo = new SdncHealRequestInfo(); - requestInfo.setRequestAction("SdwanBandwidthChange"); - - SdncHealRequestHeaderInfo headerInfo = new SdncHealRequestHeaderInfo(); - headerInfo.setSvcAction("update"); - headerInfo.setSvcRequestId(UUID.randomUUID().toString()); - - SdncRequest request = new SdncRequest(); - request.setNsInstanceId(serviceInstance); - request.setRequestId(onset.getRequestId()); - request.setUrl("/GENERIC-RESOURCE-API:vf-module-topology-operation"); - - SdncHealVnfInfo vnfInfo = new SdncHealVnfInfo(); - vnfInfo.setVnfId(onset.getAai().get("vnfId")); - - SdncHealVfModuleInfo vfModuleInfo = new SdncHealVfModuleInfo(); - vfModuleInfo.setVfModuleId(""); - - SdncHealRequest healRequest = new SdncHealRequest(); - healRequest.setVnfInfo(vnfInfo); - healRequest.setVfModuleInfo(vfModuleInfo); - healRequest.setRequestHeaderInfo(headerInfo); - healRequest.setVfModuleRequestInput(vfRequestInfo); - healRequest.setRequestInfo(requestInfo); - healRequest.setServiceInfo(serviceInfo); - request.setHealRequest(healRequest); - return request; - } - - private SdncRequest constructReOptimizeRequest(VirtualControlLoopEvent onset) { - // Construct an Sdnc request - String serviceInstance = onset.getAai().get("service-instance.service-instance-id"); - if (serviceInstance == null || serviceInstance.isEmpty()) { - // This indicates that AAI Enrichment needs to be done by event producer. - return null; - } - SdncHealServiceInfo serviceInfo = new SdncHealServiceInfo(); - serviceInfo.setServiceInstanceId(serviceInstance); - - String networkId = onset.getAai().get("network-information.network-id"); - if (networkId == null || networkId.isEmpty()) { - // This indicates that AAI Enrichment needs to be done by event producer. - return null; - } - SdncHealNetworkInfo networkInfo = new SdncHealNetworkInfo(); - networkInfo.setNetworkId(networkId); - - SdncHealRequestInfo requestInfo = new SdncHealRequestInfo(); - requestInfo.setRequestAction("ReoptimizeSOTNInstance"); - - SdncHealRequestHeaderInfo headerInfo = new SdncHealRequestHeaderInfo(); - headerInfo.setSvcAction("reoptimize"); - headerInfo.setSvcRequestId(UUID.randomUUID().toString()); - - SdncRequest request = new SdncRequest(); - request.setNsInstanceId(serviceInstance); - request.setRequestId(onset.getRequestId()); - request.setUrl("/GENERIC-RESOURCE-API:network-topology-operation"); - - SdncHealRequest healRequest = new SdncHealRequest(); - healRequest.setRequestHeaderInfo(headerInfo); - healRequest.setNetworkInfo(networkInfo); - healRequest.setRequestInfo(requestInfo); - healRequest.setServiceInfo(serviceInfo); - request.setHealRequest(healRequest); - return request; - } - - // **HERE** } |