summaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager/src/main
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2020-08-21 13:29:21 -0500
committerjhh <jorge.hernandez-herrero@att.com>2020-08-21 13:32:52 -0500
commit0a5d9cf30c61956e62cc7db4faf84f999a7196cc (patch)
treecb5bf992abb5faa0c300b77e5d85e3e953e4f9be /controlloop/common/eventmanager/src/main
parent56efff004af2d1be64c67f7c8091cb4553a0e86b (diff)
remove legacy operational policies support
Issue-ID: POLICY-2765 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I454365943465863b108ba8668b2bc4b201986959
Diffstat (limited to 'controlloop/common/eventmanager/src/main')
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/processor/ControlLoopProcessor.java20
1 files changed, 1 insertions, 19 deletions
diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/processor/ControlLoopProcessor.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/processor/ControlLoopProcessor.java
index f1835d740..f578c8a85 100644
--- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/processor/ControlLoopProcessor.java
+++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/processor/ControlLoopProcessor.java
@@ -22,8 +22,6 @@ package org.onap.policy.controlloop.processor;
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
-import java.net.URLDecoder;
-import java.nio.charset.StandardCharsets;
import java.util.stream.Collectors;
import lombok.Getter;
import org.apache.commons.beanutils.BeanUtils;
@@ -39,7 +37,6 @@ import org.onap.policy.controlloop.policy.PolicyResult;
import org.onap.policy.controlloop.policy.Target;
import org.onap.policy.controlloop.policy.TargetType;
import org.onap.policy.drools.domain.models.DroolsPolicy;
-import org.onap.policy.drools.domain.models.legacy.LegacyPolicy;
import org.onap.policy.drools.domain.models.operational.Operation;
import org.onap.policy.drools.domain.models.operational.OperationalPolicy;
import org.onap.policy.drools.domain.models.operational.OperationalTarget;
@@ -93,11 +90,7 @@ public class ControlLoopProcessor implements Serializable {
*/
public ControlLoopProcessor(ToscaPolicy toscaPolicy) throws ControlLoopException {
try {
- // TODO: automate policy type to models mapping
- this.policy =
- ("onap.policies.controlloop.Operational".equals(toscaPolicy.getType()))
- ? buildPolicyFromToscaLegacy(toscaPolicy)
- : buildPolicyFromToscaCompliant(toscaPolicy);
+ this.policy = buildPolicyFromToscaCompliant(toscaPolicy);
this.currentNestedPolicyId = this.policy.getControlLoop().getTrigger_policy();
this.toscaOpPolicy = toscaPolicy;
@@ -106,17 +99,6 @@ public class ControlLoopProcessor implements Serializable {
}
}
- protected ControlLoopPolicy buildPolicyFromToscaLegacy(ToscaPolicy policy)
- throws CoderException {
- LegacyPolicy legacyPolicy =
- PolicyEngineConstants.getManager().getDomainMaker().convertTo(policy, LegacyPolicy.class);
- this.domainOpPolicy = legacyPolicy;
- String decodedPolicy = URLDecoder.decode(legacyPolicy.getProperties().getContent(), StandardCharsets.UTF_8);
- return new Yaml(
- new CustomClassLoaderConstructor(
- ControlLoopPolicy.class, ControlLoopPolicy.class.getClassLoader())).load(decodedPolicy);
- }
-
private Target toStandardTarget(OperationalTarget opTarget) {
Target target = new Target(TargetType.valueOf(opTarget.getTargetType()));
try {