aboutsummaryrefslogtreecommitdiffstats
path: root/context/context-test-utils/src/main
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@ericsson.com>2018-08-30 09:37:29 +0100
committerliamfallon <liam.fallon@ericsson.com>2018-08-31 19:23:41 +0100
commitf32508381ce0b555fc14978cbaa458aa4e2d91c5 (patch)
tree1cab66e5372b6467f288ae1351ce836e4eba2d03 /context/context-test-utils/src/main
parent052038c7a7e0b385462b3b653b7d06094d472df3 (diff)
Use parameter service in apex
Switch parameter handling in apex to use the ONAP PF common parameter service Change-Id: Id318d19c726b18b1a69c630fa81ca7d695355e9c Issue-ID: POLICY-954 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'context/context-test-utils/src/main')
-rw-r--r--context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java14
-rw-r--r--context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVMThread.java8
-rw-r--r--context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java3
3 files changed, 12 insertions, 13 deletions
diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java
index 3288f56dd..0f6900dbb 100644
--- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java
+++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java
@@ -43,8 +43,8 @@ import org.onap.policy.apex.context.test.utils.Constants;
import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
import org.onap.policy.apex.model.basicmodel.concepts.ApexRuntimeException;
import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
-import org.onap.policy.apex.model.basicmodel.service.AbstractParameters;
-import org.onap.policy.apex.model.basicmodel.service.ParameterService;
+import org.onap.policy.common.parameters.ParameterGroup;
+import org.onap.policy.common.parameters.ParameterService;
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;
@@ -144,13 +144,13 @@ public final class ConcurrentContextJVM {
for (int p = 7; p < args.length - 1; p += 2) {
@SuppressWarnings("rawtypes")
final Class parametersClass = Class.forName(args[p]);
- final AbstractParameters parameters =
- (AbstractParameters) new Gson().fromJson(args[p + 1], parametersClass);
- ParameterService.registerParameters(parametersClass, parameters);
+ final ParameterGroup parameters =
+ (ParameterGroup) new Gson().fromJson(args[p + 1], parametersClass);
+ ParameterService.register(parameters);
}
- for (final Entry<Class<?>, AbstractParameters> parameterEntry : ParameterService.getAll()) {
- LOGGER.info("Parameter class " + parameterEntry.getKey().getCanonicalName() + "="
+ for (final Entry<String, ParameterGroup> parameterEntry : ParameterService.getAll()) {
+ LOGGER.info("Parameter class " + parameterEntry.getKey() + "="
+ parameterEntry.getValue().toString());
}
diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVMThread.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVMThread.java
index 117a396dc..0c2aa7a90 100644
--- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVMThread.java
+++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVMThread.java
@@ -31,8 +31,8 @@ import java.util.List;
import java.util.Map.Entry;
import org.onap.policy.apex.context.test.utils.ConfigrationProvider;
-import org.onap.policy.apex.model.basicmodel.service.AbstractParameters;
-import org.onap.policy.apex.model.basicmodel.service.ParameterService;
+import org.onap.policy.common.parameters.ParameterGroup;
+import org.onap.policy.common.parameters.ParameterService;
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;
@@ -79,8 +79,8 @@ public class ConcurrentContextJVMThread implements Runnable, Closeable {
commandList.add(new Integer(configrationProvider.getLockType().getValue()).toString());
commandList.add(System.getProperty("hazelcast.config", ""));
- for (final Entry<Class<?>, AbstractParameters> parameterServiceEntry : ParameterService.getAll()) {
- commandList.add(parameterServiceEntry.getKey().getCanonicalName());
+ for (final Entry<String, ParameterGroup> parameterServiceEntry : ParameterService.getAll()) {
+ commandList.add(parameterServiceEntry.getValue().getClass().getCanonicalName());
commandList.add(new Gson().toJson(parameterServiceEntry.getValue()));
}
diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java
index 5a7813a7e..654040d3f 100644
--- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java
+++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java
@@ -26,8 +26,7 @@ import java.net.InetSocketAddress;
import org.apache.zookeeper.server.NIOServerCnxnFactory;
import org.apache.zookeeper.server.ZooKeeperServer;
-import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
-import org.onap.policy.apex.model.basicmodel.handling.ApexModelException;
+
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;