From de6124af19910e5ebb1de6698843b8ab64b5931a Mon Sep 17 00:00:00 2001 From: mmis Date: Mon, 27 Aug 2018 23:29:24 +0100 Subject: Create code infrastructure for policy forwarding Added sending of polices from the policy forwarder to the xacml PDP and added handling of parameters for configuring the policy forwarders Issue-ID: POLICY-926 Change-Id: I26effe70769f7edc765470a1a9ad40ed9faad82d Signed-off-by: mmis --- .../policy/distribution/forwarding/PolicyForwarder.java | 15 +++++++++++++++ .../forwarding/parameters/PolicyForwarderParameters.java | 15 ++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) (limited to 'forwarding') diff --git a/forwarding/src/main/java/org/onap/policy/distribution/forwarding/PolicyForwarder.java b/forwarding/src/main/java/org/onap/policy/distribution/forwarding/PolicyForwarder.java index 5272fc9b..5bd53804 100644 --- a/forwarding/src/main/java/org/onap/policy/distribution/forwarding/PolicyForwarder.java +++ b/forwarding/src/main/java/org/onap/policy/distribution/forwarding/PolicyForwarder.java @@ -25,9 +25,24 @@ import org.onap.policy.distribution.model.Policy; /** * Forwards polices. + *

+ * To create a policy forwarder a class implementing this interface must be created, along with a + * concrete sub class of PolicyForwarderConfigurationParameterGroup to handle configuration + * parameters for the policy forwarder. */ public interface PolicyForwarder { + /** + * Configure the policy forwarder. + *

+ * This method will be invoked immediately after instantiation in order for the policy forwarder + * to configure itself. + * + * @param parameterGroupName the name of the parameter group which contains the configuration + * for the policy forwarder + */ + void configure(String parameterGroupName); + /** * Forward the given policies. * diff --git a/forwarding/src/main/java/org/onap/policy/distribution/forwarding/parameters/PolicyForwarderParameters.java b/forwarding/src/main/java/org/onap/policy/distribution/forwarding/parameters/PolicyForwarderParameters.java index 28a1b1be..2426cccd 100644 --- a/forwarding/src/main/java/org/onap/policy/distribution/forwarding/parameters/PolicyForwarderParameters.java +++ b/forwarding/src/main/java/org/onap/policy/distribution/forwarding/parameters/PolicyForwarderParameters.java @@ -37,16 +37,20 @@ public class PolicyForwarderParameters implements ParameterGroup { private String forwarderType; private String forwarderClassName; + private String forwarderConfigurationName; /** * Constructor for instantiating PolicyForwarderParameters. * * @param forwarderType the policy forwarder type * @param forwarderClassName the policy forwarder class name + * @param forwarderConfigurationName the name of the configuration for the policy forwarder */ - public PolicyForwarderParameters(final String forwarderType, final String forwarderClassName) { + public PolicyForwarderParameters(final String forwarderType, final String forwarderClassName, + final String forwarderConfigurationName) { this.forwarderType = forwarderType; this.forwarderClassName = forwarderClassName; + this.forwarderConfigurationName = forwarderConfigurationName; } /** @@ -67,6 +71,15 @@ public class PolicyForwarderParameters implements ParameterGroup { return forwarderClassName; } + /** + * Return the name of the forwarder configuration of this PolicyForwarderParameters instance. + * + * @return the the name of the forwarder configuration + */ + public String getForwarderConfigurationName() { + return forwarderConfigurationName; + } + /** * {@inheritDoc} */ -- cgit 1.2.3-korg