summaryrefslogtreecommitdiffstats
path: root/services/services-onappf/src
diff options
context:
space:
mode:
Diffstat (limited to 'services/services-onappf/src')
-rw-r--r--services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/ApexEngineHandler.java4
-rw-r--r--services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpStateChangeMessageHandler.java2
-rw-r--r--services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpUpdateMessageHandler.java4
3 files changed, 5 insertions, 5 deletions
diff --git a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/ApexEngineHandler.java b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/ApexEngineHandler.java
index 85d666c2b..1c9413020 100644
--- a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/ApexEngineHandler.java
+++ b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/ApexEngineHandler.java
@@ -53,11 +53,11 @@ public class ApexEngineHandler {
* @throws ApexStarterException if the apex engine instantiation failed using the properties passed
*/
- public ApexEngineHandler(final String properties) throws ApexStarterException {
+ public ApexEngineHandler(final Object properties) throws ApexStarterException {
final StandardCoder standardCoder = new StandardCoder();
JsonObject body;
try {
- body = standardCoder.decode(new StringReader(properties), JsonObject.class);
+ body = standardCoder.decode(new StringReader(properties.toString()), JsonObject.class);
} catch (final CoderException e) {
throw new ApexStarterException(e);
}
diff --git a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpStateChangeMessageHandler.java b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpStateChangeMessageHandler.java
index 9c53fb196..495bceccd 100644
--- a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpStateChangeMessageHandler.java
+++ b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpStateChangeMessageHandler.java
@@ -97,7 +97,7 @@ public class PdpStateChangeMessageHandler {
try {
// assumed that the apex policies list contains only one entry.
final ApexEngineHandler apexEngineHandler =
- new ApexEngineHandler((String) policies.get(0).getProperties().get("content"));
+ new ApexEngineHandler(policies.get(0).getProperties().get("content"));
Registry.registerOrReplace(ApexStarterConstants.REG_APEX_ENGINE_HANDLER, apexEngineHandler);
pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpStateChangeMsg.getRequestId(),
PdpResponseStatus.SUCCESS, "Apex engine started. State changed to active.");
diff --git a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpUpdateMessageHandler.java b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpUpdateMessageHandler.java
index 478d1c757..64d465784 100644
--- a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpUpdateMessageHandler.java
+++ b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpUpdateMessageHandler.java
@@ -120,8 +120,8 @@ public class PdpUpdateMessageHandler {
if (null != apexEngineHandler && apexEngineHandler.isApexEngineRunning()) {
apexEngineHandler.shutdown();
}
- apexEngineHandler = new ApexEngineHandler(
- (String) pdpUpdateMsg.getPolicies().get(0).getProperties().get("content"));
+ apexEngineHandler =
+ new ApexEngineHandler(pdpUpdateMsg.getPolicies().get(0).getProperties().get("content"));
Registry.registerOrReplace(ApexStarterConstants.REG_APEX_ENGINE_HANDLER, apexEngineHandler);
pdpResponseDetails = pdpMessageHandler.createPdpResonseDetails(pdpUpdateMsg.getRequestId(),
PdpResponseStatus.SUCCESS, "Apex engine started and policies are running.");