summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actorServiceProvider
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-02-26 17:14:34 -0500
committerJim Hahn <jrh3@att.com>2020-02-26 17:14:34 -0500
commit51a885d5c7d61094c39c9c1942147bed5c9049a3 (patch)
tree690103c13bb486a5023d95e26c0d6a0223fd3730 /models-interactions/model-actors/actorServiceProvider
parent1bba8b33d25069f61d27bbd125cccccde9947f3d (diff)
Change ActorService config to Map<String,Object>
It's a bit of a pain to pass Map<String, Map<String,Object>> to the ActorService configure() method. Changed it to simply take a Map<String,Object>, as it had been in a previous iteration. Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Ib6e703115027bc4919cc93762ca5b38d254f2b8f
Diffstat (limited to 'models-interactions/model-actors/actorServiceProvider')
-rw-r--r--models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/ActorService.java10
-rw-r--r--models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/ActorServiceTest.java2
2 files changed, 7 insertions, 5 deletions
diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/ActorService.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/ActorService.java
index e1b875dd0..b0d70fda0 100644
--- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/ActorService.java
+++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/ActorService.java
@@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory;
* {@link #start()} to start all of the actors. When finished using the actor service,
* invoke {@link #stop()} or {@link #shutdown()}.
*/
-public class ActorService extends StartConfigPartial<Map<String, Map<String, Object>>> {
+public class ActorService extends StartConfigPartial<Map<String, Object>> {
private static final Logger logger = LoggerFactory.getLogger(ActorService.class);
private final Map<String, Actor> name2actor;
@@ -115,16 +115,18 @@ public class ActorService extends StartConfigPartial<Map<String, Map<String, Obj
}
@Override
- protected void doConfigure(Map<String, Map<String, Object>> parameters) {
+ protected void doConfigure(Map<String, Object> parameters) {
logger.info("configuring actors");
BeanValidationResult valres = new BeanValidationResult("ActorService", parameters);
for (Actor actor : name2actor.values()) {
String actorName = actor.getName();
- Map<String, Object> subparams = parameters.get(actorName);
+ Object paramValue = parameters.get(actorName);
- if (subparams != null) {
+ if (paramValue instanceof Map) {
+ @SuppressWarnings("unchecked")
+ Map<String, Object> subparams = (Map<String, Object>) paramValue;
try {
actor.configure(subparams);
diff --git a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/ActorServiceTest.java b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/ActorServiceTest.java
index 989fc8d6e..401e0ca58 100644
--- a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/ActorServiceTest.java
+++ b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/ActorServiceTest.java
@@ -65,7 +65,7 @@ public class ActorServiceTest {
private Map<String, Object> sub2;
private Map<String, Object> sub3;
private Map<String, Object> sub4;
- private Map<String, Map<String, Object>> params;
+ private Map<String, Object> params;
private ActorService service;