diff options
author | mmis <michael.morris@ericsson.com> | 2018-08-27 23:29:24 +0100 |
---|---|---|
committer | mmis <michael.morris@ericsson.com> | 2018-08-30 16:52:30 +0100 |
commit | de6124af19910e5ebb1de6698843b8ab64b5931a (patch) | |
tree | 0a7ecfa5c8199e01108345bbd8957db46441b59d /forwarding/src/main/java/org | |
parent | e705197bb18af558fb7ea853b01e1297521763f2 (diff) |
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 <michael.morris@ericsson.com>
Diffstat (limited to 'forwarding/src/main/java/org')
2 files changed, 29 insertions, 1 deletions
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,10 +25,25 @@ import org.onap.policy.distribution.model.Policy; /** * Forwards polices. + * <p> + * 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. + * <p> + * 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. * * @param policies the policies to forward 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; } /** @@ -68,6 +72,15 @@ public class PolicyForwarderParameters implements ParameterGroup { } /** + * 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} */ @Override |