summaryrefslogtreecommitdiffstats
path: root/services/services-onappf/src
diff options
context:
space:
mode:
authora.sreekumar <ajith.sreekumar@bell.ca>2021-04-08 11:06:14 +0100
committera.sreekumar <ajith.sreekumar@bell.ca>2021-04-08 11:06:21 +0100
commitae01c8d07c3b62dd9b06958a62702816e2f7bfc1 (patch)
tree8cefce8760ab75ba49cb7377a4993482dbb46c78 /services/services-onappf/src
parent7e30c78bc1b37d311f045b90e0cda41a6b0bf94d (diff)
APEX-PDP incorrectly reports successful policy deployment to PAP
Change-Id: I2fbf0303805b4c5feead522ad78fd4ef518659af Issue-ID: POLICY-3173 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
Diffstat (limited to 'services/services-onappf/src')
-rw-r--r--services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/ApexEngineHandler.java7
-rw-r--r--services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpUpdateMessageHandler.java4
2 files changed, 7 insertions, 4 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 9fe3c94ce..65c4b0373 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
@@ -160,9 +160,10 @@ public class ApexEngineHandler {
policyMapToRetain.putAll(policyModel.getPolicies().getPolicyMap());
});
for (ApexMain main : undeployedPoliciesMainMap.values()) {
- handleParametersRemoval(inputParamKeysToRetain, outputParamKeysToRetain, taskParametersToRetain,
- executorParamKeysToRetain, schemaParamKeysToRetain, main);
-
+ if (null != main.getApexParameters()) {
+ handleParametersRemoval(inputParamKeysToRetain, outputParamKeysToRetain, taskParametersToRetain,
+ executorParamKeysToRetain, schemaParamKeysToRetain, main);
+ }
if (null != main.getActivator() && null != main.getActivator().getPolicyModel()) {
handleAxConceptsRemoval(keyInfoMapToRetain, schemaMapToRetain, eventMapToRetain, albumMapToRetain,
taskMapToRetain, policyMapToRetain, main);
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 bf72b0999..8dc49eefb 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
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
+ * Modifications Copyright (C) 2021 Bell Canada. 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.
@@ -97,7 +98,8 @@ public class PdpUpdateMessageHandler {
if (pdpStatusContext.getState().equals(PdpState.ACTIVE)) {
pdpResponseDetails = startOrStopApexEngineBasedOnPolicies(pdpUpdateMsg, pdpMessageHandler);
- ApexEngineHandler apexEngineHandler = Registry.get(ApexStarterConstants.REG_APEX_ENGINE_HANDLER);
+ ApexEngineHandler apexEngineHandler =
+ Registry.getOrDefault(ApexStarterConstants.REG_APEX_ENGINE_HANDLER, ApexEngineHandler.class, null);
// in hearbeat while in active state, only the policies which are running should be there.
// if some policy fails, that shouldn't go in the heartbeat.
// If no policies are running, then the policy list in the heartbeat can be empty