From 6652164b384221018bf605b1d5fb809425b26a8e Mon Sep 17 00:00:00 2001 From: jhh Date: Tue, 18 Oct 2022 12:08:45 -0500 Subject: Support optional cluster name in policy engine This allows also for correlation with running pod hostnames in the case of multiple drools pdp flavors coexist. Issue-ID: POLICY-4403 Signed-off-by: jhh Change-Id: I81affeeec622e6c0e9627651bf34c0775a796827 Signed-off-by: jhh --- .../org/onap/policy/drools/system/PolicyEngine.java | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java') diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java index 10623c50..75e7c74a 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java +++ b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2022 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. @@ -121,6 +121,25 @@ public interface PolicyEngine extends Startable, Lockable, TopicListener { */ String setEnvironmentProperty(String key, String value); + /** + * Gets the hostname used by this PDP-D. + */ + String getHostName(); + + /** + * Gets the cluster name as configured in $CLUSTER_NAME, + * otherwise it will assume an UUID as the cluster name. + */ + String getClusterName(); + + /** + * Gets the PDP Name from hostname and $CLUSTER_NAME, + * otherwise if CLUSTER_NAME is not set, the PdpName + * will be the concatenation of the hostname and a + * UUID. + */ + String getPdpName(); + /** * registers a new Policy Controller with the Policy Engine initialized per properties. * -- cgit 1.2.3-korg