summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.so
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-04-05 21:07:07 -0400
committerPamela Dragosh <pdragosh@research.att.com>2019-04-08 10:42:22 -0400
commitada55be1b59899e461dc5177782e381f89cbc407 (patch)
tree7bdb3eb5fe44e166a75a3333bf81f2293a3585de /models-interactions/model-actors/actor.so
parenteb7127ac85b3df30a09277721a5f9271033843e7 (diff)
Remove drools PDP dependency
Removing working memory and use of PolicyEngine from drools in these classes. Cleaned up some unused imports and checkstyle. Issue-ID: POLICY-1264 Change-Id: Id059da9689a721b0eafc6b310adcbdad43574ce7 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'models-interactions/model-actors/actor.so')
-rw-r--r--models-interactions/model-actors/actor.so/pom.xml12
-rw-r--r--models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SoActorServiceProvider.java17
-rw-r--r--models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoActorServiceProviderTest.java2
3 files changed, 11 insertions, 20 deletions
diff --git a/models-interactions/model-actors/actor.so/pom.xml b/models-interactions/model-actors/actor.so/pom.xml
index f8d91a6f9..0af56bbbc 100644
--- a/models-interactions/model-actors/actor.so/pom.xml
+++ b/models-interactions/model-actors/actor.so/pom.xml
@@ -55,12 +55,6 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.drools</groupId>
- <artifactId>drools-core</artifactId>
- <version>6.5.0.Final</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<scope>provided</scope>
@@ -72,12 +66,6 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.onap.policy.drools-pdp</groupId>
- <artifactId>policy-management</artifactId>
- <version>${policy.drools-pdp.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
diff --git a/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SoActorServiceProvider.java b/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SoActorServiceProvider.java
index eef6e7c12..2a14bb19a 100644
--- a/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SoActorServiceProvider.java
+++ b/models-interactions/model-actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SoActorServiceProvider.java
@@ -28,7 +28,6 @@ import java.lang.reflect.Type;
import java.util.Collections;
import java.util.List;
import java.util.Map;
-import org.drools.core.WorkingMemory;
import org.onap.policy.aai.AaiNqExtraProperty;
import org.onap.policy.aai.AaiNqInventoryResponseItem;
import org.onap.policy.aai.AaiNqResponseWrapper;
@@ -374,12 +373,16 @@ public class SoActorServiceProvider implements Actor {
* in the asyncSORestCall.
*
* @param requestId the request Id
- * @param wm the working memory
+ * @param callback callback method
* @param request the request
+ * @param url SO REST URL
+ * @param user username
+ * @param password password
*/
- public static void sendRequest(String requestId, WorkingMemory wm, Object request) {
- SoManager soManager = new SoManager();
- soManager.asyncSoRestCall(requestId, wm, lastServiceItemServiceInstanceId, lastVNFItemVnfId,
+ public static void sendRequest(String requestId, SoManager.SoCallback callback, Object request,
+ String url, String user, String password) {
+ SoManager soManager = new SoManager(url, user, password);
+ soManager.asyncSoRestCall(requestId, callback, lastServiceItemServiceInstanceId, lastVNFItemVnfId,
lastVfModuleItemVfModuleInstanceId, (SoRequest) request);
}
@@ -406,7 +409,7 @@ public class SoActorServiceProvider implements Actor {
private void buildRequestParameters(Policy policy, SoRequestDetails request) {
// assume null until proven otherwise
request.setRequestParameters(null);
-
+
if (policy.getPayload() == null) {
return;
}
@@ -428,7 +431,7 @@ public class SoActorServiceProvider implements Actor {
private void buildConfigurationParameters(Policy policy, SoRequestDetails request) {
// assume null until proven otherwise
request.setConfigurationParameters(null);
-
+
if (policy.getPayload() == null) {
return;
}
diff --git a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoActorServiceProviderTest.java b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoActorServiceProviderTest.java
index d0eab120c..a7bdf1a76 100644
--- a/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoActorServiceProviderTest.java
+++ b/models-interactions/model-actors/actor.so/src/test/java/org/onap/policy/controlloop/actor/so/SoActorServiceProviderTest.java
@@ -145,7 +145,7 @@ public class SoActorServiceProviderTest {
@Test
public void testSendRequest() {
try {
- SoActorServiceProvider.sendRequest(UUID.randomUUID().toString(), null, null);
+ SoActorServiceProvider.sendRequest(UUID.randomUUID().toString(), null, null, null, null, null);
} catch (Exception e) {
fail("Test should not throw an exception");
}