From a4e239da971509dfa2ffcd6c138abc87bc5d0aec Mon Sep 17 00:00:00 2001 From: jhh Date: Thu, 18 Feb 2021 12:01:05 -0600 Subject: support pdp-type configuration for PAP status Issue-ID: POLICY-3070 Signed-off-by: jhh Change-Id: Iaddd9bac102cbe79626fe91d78a457dcfd4cb1fb Signed-off-by: jhh --- .../java/org/onap/policy/drools/lifecycle/LifecycleFsm.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'feature-lifecycle/src/main/java/org') 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"; @@ -135,6 +139,10 @@ public class LifecycleFsm implements Startable { @Getter protected String subGroup; + @Getter + @Setter + protected String pdpType; + @Getter protected Set mandatoryPolicyTypes = new HashSet<>(); @@ -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; -- cgit 1.2.3-korg