aboutsummaryrefslogtreecommitdiffstats
path: root/feature-lifecycle/src/main
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2021-02-18 12:01:05 -0600
committerJorge Hernandez <jorge.hernandez-herrero@att.com>2021-02-18 18:57:04 +0000
commita4e239da971509dfa2ffcd6c138abc87bc5d0aec (patch)
treec519d89da42177716c42cdea23ec0835b684b3d8 /feature-lifecycle/src/main
parentdd8c5ad785a19c3af7249808aa01fe4f04abc61e (diff)
support pdp-type configuration for PAP status
Issue-ID: POLICY-3070 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Iaddd9bac102cbe79626fe91d78a457dcfd4cb1fb Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'feature-lifecycle/src/main')
-rw-r--r--feature-lifecycle/src/main/feature/config/feature-lifecycle.properties3
-rw-r--r--feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java11
2 files changed, 12 insertions, 2 deletions
diff --git a/feature-lifecycle/src/main/feature/config/feature-lifecycle.properties b/feature-lifecycle/src/main/feature/config/feature-lifecycle.properties
index b495664d..fc8127b9 100644
--- a/feature-lifecycle/src/main/feature/config/feature-lifecycle.properties
+++ b/feature-lifecycle/src/main/feature/config/feature-lifecycle.properties
@@ -1,7 +1,7 @@
# ============LICENSE_START=======================================================
# ONAP
# ================================================================================
-# Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2019-2021 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.
@@ -17,6 +17,7 @@
# ============LICENSE_END=========================================================
lifecycle.pdp.group=${envd:POLICY_PDP_PAP_GROUP:defaultGroup}
+lifecycle.pdp.type=${envd:POLICY_PDP_PAP_TYPE:drools}
# Mandatory policy types that this PDP-D must support at a minimum
lifecycle.pdp.policytypes=${envd:POLICY_PDP_PAP_POLICYTYPES}
diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java
index e2c50d4f..a595877a 100644
--- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java
+++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java
@@ -85,8 +85,12 @@ public class LifecycleFsm implements Startable {
protected static final String CONFIGURATION_PROPERTIES_NAME = "feature-lifecycle";
protected static final String GROUP_NAME = "lifecycle.pdp.group";
+ protected static final String PDP_TYPE = "lifecycle.pdp.type";
protected static final String MANDATORY_POLICY_TYPES = "lifecycle.pdp.policytypes";
+
protected static final String DEFAULT_PDP_GROUP = "defaultGroup";
+ protected static final String DEFAULT_PDP_TYPE = "drools";
+
protected static final long MIN_STATUS_INTERVAL_SECONDS = 5L;
protected static final String PDP_MESSAGE_NAME = "messageName";
@@ -136,6 +140,10 @@ public class LifecycleFsm implements Startable {
protected String subGroup;
@Getter
+ @Setter
+ protected String pdpType;
+
+ @Getter
protected Set<String> mandatoryPolicyTypes = new HashSet<>();
@Getter
@@ -153,6 +161,7 @@ public class LifecycleFsm implements Startable {
public LifecycleFsm() {
properties = SystemPersistenceConstants.getManager().getProperties(CONFIGURATION_PROPERTIES_NAME);
setGroup(properties.getProperty(GROUP_NAME, DEFAULT_PDP_GROUP));
+ setPdpType(properties.getProperty(PDP_TYPE, DEFAULT_PDP_TYPE));
policyTypesMap.put(POLICY_TYPE_DROOLS_NATIVE_CONTROLLER,
new PolicyTypeNativeDroolsController(this, POLICY_TYPE_DROOLS_NATIVE_CONTROLLER));
@@ -580,7 +589,7 @@ public class LifecycleFsm implements Startable {
status.setPdpSubgroup(subGroup);
status.setState(state);
status.setHealthy(isAlive() ? PdpHealthStatus.HEALTHY : PdpHealthStatus.NOT_HEALTHY);
- status.setPdpType("drools");
+ status.setPdpType(getPdpType());
status.setPolicies(new ArrayList<>(policiesMap.keySet()));
status.setStatistics(statisticsPayload());
return status;