summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.appc
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-02-17 22:25:03 +0000
committerGerrit Code Review <gerrit@onap.org>2020-02-17 22:25:03 +0000
commit85a2fee4074903012e77f78e26328b9a03a8bdfc (patch)
treee4c281ec3d174150a62bbb640ba7883aef23fd0e /models-interactions/model-actors/actor.appc
parent22e831dbd5820b54bb24131e007190b70e3321d4 (diff)
parent28ca4d196bb0e8c50ad64b5bfde117a93ace3e04 (diff)
Merge "Use BidirectionalTopicClient from policy-common"
Diffstat (limited to 'models-interactions/model-actors/actor.appc')
-rw-r--r--models-interactions/model-actors/actor.appc/pom.xml114
-rw-r--r--models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcActorServiceProvider.java38
2 files changed, 90 insertions, 62 deletions
diff --git a/models-interactions/model-actors/actor.appc/pom.xml b/models-interactions/model-actors/actor.appc/pom.xml
index 74bff9aa9..26eb7c1b7 100644
--- a/models-interactions/model-actors/actor.appc/pom.xml
+++ b/models-interactions/model-actors/actor.appc/pom.xml
@@ -18,57 +18,71 @@
============LICENSE_END=========================================================
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
- <artifactId>model-actors</artifactId>
- <version>2.2.1-SNAPSHOT</version>
- </parent>
+ <parent>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
+ <artifactId>model-actors</artifactId>
+ <version>2.2.1-SNAPSHOT</version>
+ </parent>
- <artifactId>actor.appc</artifactId>
+ <artifactId>actor.appc</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
- <artifactId>actorServiceProvider</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>appc</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>events</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions</groupId>
- <artifactId>simulators</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.common</groupId>
- <artifactId>policy-endpoints</artifactId>
- <version>${policy.common.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
+ <artifactId>actorServiceProvider</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+ <artifactId>appc</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+ <artifactId>aai</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+ <artifactId>events</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
+ <artifactId>actor.aai</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models.policy-models-interactions</groupId>
+ <artifactId>simulators</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>policy-endpoints</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
</project>
diff --git a/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcActorServiceProvider.java b/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcActorServiceProvider.java
index 0da1e2a27..2491c33a1 100644
--- a/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcActorServiceProvider.java
+++ b/models-interactions/model-actors/actor.appc/src/main/java/org/onap/policy/controlloop/actor/appc/AppcActorServiceProvider.java
@@ -33,17 +33,19 @@ import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.controlloop.ControlLoopOperation;
import org.onap.policy.controlloop.VirtualControlLoopEvent;
-import org.onap.policy.controlloop.actorserviceprovider.impl.ActorImpl;
+import org.onap.policy.controlloop.actorserviceprovider.impl.BidirectionalTopicActor;
import org.onap.policy.controlloop.policy.Policy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class AppcActorServiceProvider extends ActorImpl {
+public class AppcActorServiceProvider extends BidirectionalTopicActor {
private static final String NAME = "APPC";
private static final Logger logger = LoggerFactory.getLogger(AppcActorServiceProvider.class);
+ // TODO old code: remove lines down to **HERE**
+
private static final StandardCoder coder = new StandardCoder();
// Strings for targets
@@ -57,17 +59,26 @@ public class AppcActorServiceProvider extends ActorImpl {
private static final String RECIPE_MODIFY = "ModifyConfig";
private static final ImmutableList<String> recipes =
- ImmutableList.of(RECIPE_RESTART, RECIPE_REBUILD, RECIPE_MIGRATE, RECIPE_MODIFY);
+ ImmutableList.of(RECIPE_RESTART, RECIPE_REBUILD, RECIPE_MIGRATE, RECIPE_MODIFY);
private static final ImmutableMap<String, List<String>> targets = new ImmutableMap.Builder<String, List<String>>()
- .put(RECIPE_RESTART, ImmutableList.of(TARGET_VM)).put(RECIPE_REBUILD, ImmutableList.of(TARGET_VM))
- .put(RECIPE_MIGRATE, ImmutableList.of(TARGET_VM)).put(RECIPE_MODIFY, ImmutableList.of(TARGET_VNF)).build();
+ .put(RECIPE_RESTART, ImmutableList.of(TARGET_VM)).put(RECIPE_REBUILD, ImmutableList.of(TARGET_VM))
+ .put(RECIPE_MIGRATE, ImmutableList.of(TARGET_VM)).put(RECIPE_MODIFY, ImmutableList.of(TARGET_VNF))
+ .build();
private static final ImmutableMap<String, List<String>> payloads = new ImmutableMap.Builder<String, List<String>>()
- .put(RECIPE_MODIFY, ImmutableList.of("generic-vnf.vnf-id")).build();
+ .put(RECIPE_MODIFY, ImmutableList.of("generic-vnf.vnf-id")).build();
+
+ // **HERE**
+ /**
+ * Constructs the object.
+ */
public AppcActorServiceProvider() {
super(NAME);
}
+
+ // TODO old code: remove lines down to **HERE**
+
@Override
public String actor() {
return NAME;
@@ -89,17 +100,19 @@ public class AppcActorServiceProvider extends ActorImpl {
}
/**
- * Constructs an APPC request conforming to the legacy API. The legacy API will be deprecated in
- * future releases as all legacy functionality is moved into the LCM API.
+ * Constructs an APPC request conforming to the legacy API. The legacy API will be
+ * deprecated in future releases as all legacy functionality is moved into the LCM
+ * API.
*
* @param onset the event that is reporting the alert for policy to perform an action
- * @param operation the control loop operation specifying the actor, operation, target, etc.
- * @param policy the policy the was specified from the yaml generated by CLAMP or through the
- * Policy GUI/API
+ * @param operation the control loop operation specifying the actor, operation,
+ * target, etc.
+ * @param policy the policy the was specified from the yaml generated by CLAMP or
+ * through the Policy GUI/API
* @return an APPC request conforming to the legacy API
*/
public static Request constructRequest(VirtualControlLoopEvent onset, ControlLoopOperation operation, Policy policy,
- String targetVnf) {
+ String targetVnf) {
/*
* Construct an APPC request
*/
@@ -144,4 +157,5 @@ public class AppcActorServiceProvider extends ActorImpl {
}
}
+ // **HERE**
}