aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.sdnr/src/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-01-23 18:56:40 -0500
committerJim Hahn <jrh3@att.com>2020-02-03 16:38:39 -0500
commit89ce8bc6075096d015cdc8735634e0be14fe0357 (patch)
tree166892169d2a52ebdddafc0f2c8bba2308fdad0d /models-interactions/model-actors/actor.sdnr/src/main
parentd789d26741b22fca83168ab209e517fbfbcefcc6 (diff)
Actor redesign.
Left original code intact so that it can continue to be used until everything has been converted to use the new approach. Simply added new methods and classes. (A few minor edits were required to the old code, e.g., added constructors to the Actor implementations). Code to be removed is annotated with "TODO". This only contains one revised actor, SDNC. This actor combines code from actor.sdnc, sdnc, and drools-applications. Coverage tests are incomplete, but I anticipate some simplification to this design in a couple of days; coverage will be added at that time. Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I4b75730e3621a9ee026ad10e557abe92df10dcf4
Diffstat (limited to 'models-interactions/model-actors/actor.sdnr/src/main')
-rw-r--r--models-interactions/model-actors/actor.sdnr/src/main/java/org/onap/policy/controlloop/actor/sdnr/SdnrActorServiceProvider.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/models-interactions/model-actors/actor.sdnr/src/main/java/org/onap/policy/controlloop/actor/sdnr/SdnrActorServiceProvider.java b/models-interactions/model-actors/actor.sdnr/src/main/java/org/onap/policy/controlloop/actor/sdnr/SdnrActorServiceProvider.java
index 4367f54c5..0919779a5 100644
--- a/models-interactions/model-actors/actor.sdnr/src/main/java/org/onap/policy/controlloop/actor/sdnr/SdnrActorServiceProvider.java
+++ b/models-interactions/model-actors/actor.sdnr/src/main/java/org/onap/policy/controlloop/actor/sdnr/SdnrActorServiceProvider.java
@@ -3,7 +3,7 @@
* SdnrActorServiceProvider
* ================================================================================
* Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,14 +23,12 @@ package org.onap.policy.controlloop.actor.sdnr;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
-
import java.util.Collections;
import java.util.List;
-
import org.onap.policy.controlloop.ControlLoopOperation;
import org.onap.policy.controlloop.ControlLoopResponse;
import org.onap.policy.controlloop.VirtualControlLoopEvent;
-import org.onap.policy.controlloop.actorserviceprovider.spi.Actor;
+import org.onap.policy.controlloop.actorserviceprovider.impl.ActorImpl;
import org.onap.policy.controlloop.policy.Policy;
import org.onap.policy.controlloop.policy.PolicyResult;
import org.onap.policy.sdnr.PciCommonHeader;
@@ -39,11 +37,12 @@ import org.onap.policy.sdnr.PciRequestWrapper;
import org.onap.policy.sdnr.PciResponse;
import org.onap.policy.sdnr.PciResponseCode;
import org.onap.policy.sdnr.PciResponseWrapper;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class SdnrActorServiceProvider implements Actor {
+public class SdnrActorServiceProvider extends ActorImpl {
+
+ private static final String NAME = "SDNR";
public static class Pair<A, B> {
public final A result;
@@ -81,9 +80,13 @@ public class SdnrActorServiceProvider implements Actor {
private static final ImmutableMap<String, List<String>> payloads = new ImmutableMap.Builder<String, List<String>>()
.put(RECIPE_MODIFY, ImmutableList.of(SDNR_REQUEST_PARAMS, SDNR_CONFIG_PARAMS)).build();
+ public SdnrActorServiceProvider() {
+ super(NAME);
+ }
+
@Override
public String actor() {
- return "SDNR";
+ return NAME;
}
@Override
@@ -275,7 +278,7 @@ public class SdnrActorServiceProvider implements Actor {
/* The ControlLoop response determined from the SDNR Response and input event. */
ControlLoopResponse clRsp = new ControlLoopResponse();
clRsp.setPayload(sdnrResponse.getPayload());
- clRsp.setFrom("SDNR");
+ clRsp.setFrom(NAME);
clRsp.setTarget("DCAE");
clRsp.setClosedLoopControlName(event.getClosedLoopControlName());
clRsp.setPolicyName(event.getPolicyName());