aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmis <michael.morris@ericsson.com>2018-09-05 17:12:03 +0100
committermmis <michael.morris@ericsson.com>2018-09-05 17:34:25 +0100
commit0089e8bc429001eca2997b44168b05889cb75d38 (patch)
tree943152987d7aa192fa35bdd76db713bec2463d55
parent461cafda67a99f4cc27ea41539d1748b6c87a79c (diff)
Refactored reception handler parameter handling
Refactored parameter handling for configuration of reception handlers as the previous implementation does not align with the plugin architecture (.e. plugin specific parameters being handled in core code) Issue-ID: POLICY-1094 Change-Id: I31a9fc7f712ca43f0f69c42a6d99fa481b02cd4b Signed-off-by: mmis <michael.morris@ericsson.com>
-rw-r--r--main/src/main/java/org/onap/policy/distribution/main/parameters/DistributionParameterGroup.java23
-rw-r--r--main/src/main/java/org/onap/policy/distribution/main/parameters/DistributionParameterHandler.java10
-rw-r--r--main/src/main/java/org/onap/policy/distribution/main/startstop/DistributionActivator.java14
-rw-r--r--main/src/test/java/org/onap/policy/distribution/main/parameters/CommonTestData.java38
-rw-r--r--main/src/test/java/org/onap/policy/distribution/main/parameters/TestDistributionParameterGroup.java156
-rw-r--r--main/src/test/java/org/onap/policy/distribution/main/parameters/TestReceptionHandlerParameters.java85
-rw-r--r--main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyReceptionHandlerParameterGroup.java98
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json10
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_InvalidDecoderAndForwarderParameters.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_InvalidForwarderConfigurationClassName.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerParameters.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerParameters.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json10
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_UnknownForwarderConfigurationClassName.json10
-rw-r--r--main/src/test/resources/parameters/MinimumParameters.json35
-rw-r--r--plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcConfiguration.java6
-rw-r--r--plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java5
-rw-r--r--plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandlerConfigurationParameterGroup.java (renamed from reception/src/main/java/org/onap/policy/distribution/reception/parameters/PssdConfigurationParametersGroup.java)38
-rw-r--r--plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcConfiguration.java9
-rw-r--r--plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcReceptionHandler.java5
-rw-r--r--reception/pom.xml4
-rw-r--r--reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java23
-rw-r--r--reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerConfigurationParameterGroup.java44
-rw-r--r--reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerConfigurationParametersJsonAdapter.java80
-rw-r--r--reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerParameters.java19
31 files changed, 619 insertions, 453 deletions
diff --git a/main/src/main/java/org/onap/policy/distribution/main/parameters/DistributionParameterGroup.java b/main/src/main/java/org/onap/policy/distribution/main/parameters/DistributionParameterGroup.java
index 27291255..1f3e48e6 100644
--- a/main/src/main/java/org/onap/policy/distribution/main/parameters/DistributionParameterGroup.java
+++ b/main/src/main/java/org/onap/policy/distribution/main/parameters/DistributionParameterGroup.java
@@ -27,6 +27,7 @@ import org.onap.policy.common.parameters.GroupValidationResult;
import org.onap.policy.common.parameters.ParameterGroup;
import org.onap.policy.common.parameters.ValidationStatus;
import org.onap.policy.common.utils.validation.ParameterValidationUtils;
+import org.onap.policy.distribution.reception.parameters.ReceptionHandlerConfigurationParameterGroup;
import org.onap.policy.distribution.reception.parameters.ReceptionHandlerParameters;
/**
@@ -38,6 +39,8 @@ public class DistributionParameterGroup implements ParameterGroup {
private String name;
private RestServerParameters restServerParameters;
private Map<String, ReceptionHandlerParameters> receptionHandlerParameters;
+ private Map<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfigurationParameters =
+ new LinkedHashMap<>();
private Map<String, PolicyForwarderConfigurationParameterGroup> policyForwarderConfigurationParameters =
new LinkedHashMap<>();
@@ -49,10 +52,12 @@ public class DistributionParameterGroup implements ParameterGroup {
*/
public DistributionParameterGroup(final String name, final RestServerParameters restServerParameters,
final Map<String, ReceptionHandlerParameters> receptionHandlerParameters,
+ final Map<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfigurationParameters,
final Map<String, PolicyForwarderConfigurationParameterGroup> policyForwarderConfigurationParameters) {
this.name = name;
this.restServerParameters = restServerParameters;
this.receptionHandlerParameters = receptionHandlerParameters;
+ this.receptionHandlerConfigurationParameters = receptionHandlerConfigurationParameters;
this.policyForwarderConfigurationParameters = policyForwarderConfigurationParameters;
}
@@ -94,6 +99,24 @@ public class DistributionParameterGroup implements ParameterGroup {
return restServerParameters;
}
+ /**
+ * Gets the reception handler configuration parameter map.
+ *
+ * @return the reception handler configuration parameter map
+ */
+ public Map<String, ReceptionHandlerConfigurationParameterGroup> getReceptionHandlerConfigurationParameters() {
+ return receptionHandlerConfigurationParameters;
+ }
+
+ /**
+ * Sets the reception handler configuration parameter map.
+ *
+ * @param eventInputParameters the reception handler configuration parameters
+ */
+ public void setReceptionHandlerConfigurationParameters(
+ final Map<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfigurationParameters) {
+ this.receptionHandlerConfigurationParameters = receptionHandlerConfigurationParameters;
+ }
/**
* Gets the policy forwarder configuration parameter map.
diff --git a/main/src/main/java/org/onap/policy/distribution/main/parameters/DistributionParameterHandler.java b/main/src/main/java/org/onap/policy/distribution/main/parameters/DistributionParameterHandler.java
index 5cc507e6..c1c64f7e 100644
--- a/main/src/main/java/org/onap/policy/distribution/main/parameters/DistributionParameterHandler.java
+++ b/main/src/main/java/org/onap/policy/distribution/main/parameters/DistributionParameterHandler.java
@@ -28,6 +28,8 @@ import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.common.parameters.GroupValidationResult;
import org.onap.policy.distribution.main.PolicyDistributionException;
import org.onap.policy.distribution.main.startstop.DistributionCommandLineArguments;
+import org.onap.policy.distribution.reception.parameters.ReceptionHandlerConfigurationParameterGroup;
+import org.onap.policy.distribution.reception.parameters.ReceptionHandlerConfigurationParametersJsonAdapter;
/**
* This class handles reading, parsing and validating of policy distribution parameters from JSON
@@ -50,8 +52,12 @@ public class DistributionParameterHandler {
// Read the parameters
try {
// Read the parameters from JSON using Gson
- final Gson gson = new GsonBuilder().registerTypeAdapter(PolicyForwarderConfigurationParameterGroup.class,
- new PolicyForwarderConfigurationParametersJsonAdapter()).create();
+ final Gson gson = new GsonBuilder()
+ .registerTypeAdapter(PolicyForwarderConfigurationParameterGroup.class,
+ new PolicyForwarderConfigurationParametersJsonAdapter())
+ .registerTypeAdapter(ReceptionHandlerConfigurationParameterGroup.class,
+ new ReceptionHandlerConfigurationParametersJsonAdapter())
+ .create();
distributionParameterGroup = gson.fromJson(new FileReader(arguments.getFullConfigurationFilePath()),
DistributionParameterGroup.class);
} catch (final Exception e) {
diff --git a/main/src/main/java/org/onap/policy/distribution/main/startstop/DistributionActivator.java b/main/src/main/java/org/onap/policy/distribution/main/startstop/DistributionActivator.java
index d4b7fb79..91052580 100644
--- a/main/src/main/java/org/onap/policy/distribution/main/startstop/DistributionActivator.java
+++ b/main/src/main/java/org/onap/policy/distribution/main/startstop/DistributionActivator.java
@@ -32,6 +32,7 @@ import org.onap.policy.distribution.main.parameters.PolicyForwarderConfiguration
import org.onap.policy.distribution.main.rest.DistributionRestServer;
import org.onap.policy.distribution.reception.decoding.PluginInitializationException;
import org.onap.policy.distribution.reception.handling.AbstractReceptionHandler;
+import org.onap.policy.distribution.reception.parameters.ReceptionHandlerConfigurationParameterGroup;
import org.onap.policy.distribution.reception.parameters.ReceptionHandlerParameters;
/**
@@ -143,10 +144,8 @@ public class DistributionActivator {
for (final ReceptionHandlerParameters params : distributionParameterGroup.getReceptionHandlerParameters()
.values()) {
params.setName(distributionParameterGroup.getName());
- params.getPssdConfigurationParametersGroup().setName(distributionParameterGroup.getName());
params.getPluginHandlerParameters().setName(distributionParameterGroup.getName());
ParameterService.register(params);
- ParameterService.register(params.getPssdConfigurationParametersGroup());
ParameterService.register(params.getPluginHandlerParameters());
}
for (final Entry<String, PolicyForwarderConfigurationParameterGroup> forwarderConfiguration : distributionParameterGroup
@@ -154,6 +153,11 @@ public class DistributionActivator {
forwarderConfiguration.getValue().setName(forwarderConfiguration.getKey());
ParameterService.register(forwarderConfiguration.getValue());
}
+ for (final Entry<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfiguration : distributionParameterGroup
+ .getReceptionHandlerConfigurationParameters().entrySet()) {
+ receptionHandlerConfiguration.getValue().setName(receptionHandlerConfiguration.getKey());
+ ParameterService.register(receptionHandlerConfiguration.getValue());
+ }
}
/**
@@ -166,7 +170,6 @@ public class DistributionActivator {
for (final ReceptionHandlerParameters params : distributionParameterGroup.getReceptionHandlerParameters()
.values()) {
ParameterService.deregister((params.getName()));
- ParameterService.deregister((params.getPssdConfigurationParametersGroup().getName()));
ParameterService.deregister((params.getPluginHandlerParameters().getName()));
}
for (final Entry<String, PolicyForwarderConfigurationParameterGroup> forwarderConfiguration : distributionParameterGroup
@@ -174,6 +177,11 @@ public class DistributionActivator {
forwarderConfiguration.getValue().setName(forwarderConfiguration.getKey());
ParameterService.deregister(forwarderConfiguration.getKey());
}
+ for (final Entry<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfiguration : distributionParameterGroup
+ .getReceptionHandlerConfigurationParameters().entrySet()) {
+ receptionHandlerConfiguration.getValue().setName(receptionHandlerConfiguration.getKey());
+ ParameterService.deregister(receptionHandlerConfiguration.getKey());
+ }
}
/**
diff --git a/main/src/test/java/org/onap/policy/distribution/main/parameters/CommonTestData.java b/main/src/test/java/org/onap/policy/distribution/main/parameters/CommonTestData.java
index 186aa821..b1903152 100644
--- a/main/src/test/java/org/onap/policy/distribution/main/parameters/CommonTestData.java
+++ b/main/src/test/java/org/onap/policy/distribution/main/parameters/CommonTestData.java
@@ -27,9 +27,11 @@ import java.util.Map;
import org.onap.policy.distribution.forwarding.parameters.PolicyForwarderParameters;
import org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup;
import org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup.DummyPolicyForwarderParameterGroupBuilder;
+import org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup;
+import org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup.DummyReceptionHandlerParameterGroupBuilder;
import org.onap.policy.distribution.reception.parameters.PluginHandlerParameters;
import org.onap.policy.distribution.reception.parameters.PolicyDecoderParameters;
-import org.onap.policy.distribution.reception.parameters.PssdConfigurationParametersGroup;
+import org.onap.policy.distribution.reception.parameters.ReceptionHandlerConfigurationParameterGroup;
import org.onap.policy.distribution.reception.parameters.ReceptionHandlerParameters;
/**
@@ -54,6 +56,11 @@ public class CommonTestData {
public static final String RECEPTION_HANDLER_TYPE = "DummyReceptionHandler";
public static final String RECEPTION_HANDLER_CLASS_NAME =
"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler";
+ public static final String RECEPTION_CONFIGURATION_PARAMETERS = "dummyReceptionHandlerConfiguration";
+ public static final String MY_STRING_PARAMETER_VALUE = "aStringValue";
+ public static final Boolean MY_BOOLEAN_PARAMETER_VALUE = true;
+ public static final int MY_INTEGER_PARAMETER_VALUE = 1234;
+
public static final String DUMMY_RECEPTION_HANDLER_KEY = "DummyReceptionHandler";
public static final String DUMMY_ENGINE_FORWARDER_KEY = "DummyForwarder";
public static final String DUMMY_DECODER_KEY = "DummyDecoder";
@@ -87,38 +94,37 @@ public class CommonTestData {
if (!isEmpty) {
final Map<String, PolicyDecoderParameters> policyDecoders = getPolicyDecoders(isEmpty);
final Map<String, PolicyForwarderParameters> policyForwarders = getPolicyForwarders(isEmpty);
- final PssdConfigurationParametersGroup pssdConfiguration = getPssdConfigurationParametersGroup(isEmpty);;
final PluginHandlerParameters pHParameters = new PluginHandlerParameters(policyDecoders, policyForwarders);
final ReceptionHandlerParameters rhParameters = new ReceptionHandlerParameters(RECEPTION_HANDLER_TYPE,
- RECEPTION_HANDLER_CLASS_NAME, pssdConfiguration, pHParameters);
+ RECEPTION_HANDLER_CLASS_NAME, RECEPTION_CONFIGURATION_PARAMETERS, pHParameters);
receptionHandlerParameters.put(DUMMY_RECEPTION_HANDLER_KEY, rhParameters);
}
return receptionHandlerParameters;
}
/**
- * Returns an instance of PssdConfigurationParametersGroup for test cases.
+ * Returns ReceptionHandlerConfigurationParameterGroups for test cases.
*
* @param isEmpty boolean value to represent that object created should be empty or not
- * @return the PssdConfigurationParametersGroup object
+ * @return the ReceptionHandlerConfigurationParameterGroups
*/
- public PssdConfigurationParametersGroup getPssdConfigurationParametersGroup(final boolean isEmpty) {
- final PssdConfigurationParametersGroup pssdConfiguration;
+ public Map<String, ReceptionHandlerConfigurationParameterGroup> getReceptionHandlerConfigurationParameters(
+ final boolean isEmpty) {
+ final Map<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfigurationParameters =
+ new HashMap<String, ReceptionHandlerConfigurationParameterGroup>();
if (!isEmpty) {
final List<String> messageBusAddress = new ArrayList<>();
messageBusAddress.add("localhost");
final List<String> artifactTypes = new ArrayList<>();
artifactTypes.add("TOSCA_CSAR");
- pssdConfiguration = new PssdConfigurationParametersGroup.PssdConfigurationBuilder()
- .setAsdcAddress("localhost").setMessageBusAddress(messageBusAddress).setUser("policy")
- .setPassword("policy").setPollingInterval(20).setPollingTimeout(30).setConsumerId("policy-id")
- .setArtifactTypes(artifactTypes).setConsumerGroup("policy-group").setEnvironmentName("TEST")
- .setKeystorePath("").setKeystorePassword("").setActiveserverTlsAuth(false)
- .setIsFilterinEmptyResources(true).setIsUseHttpsWithDmaap(false).build();
- } else {
- pssdConfiguration = new PssdConfigurationParametersGroup.PssdConfigurationBuilder().build();
+ DummyReceptionHandlerParameterGroup dummyReceptionHandlerParameterGroup =
+ new DummyReceptionHandlerParameterGroupBuilder().setMyStringParameter(MY_STRING_PARAMETER_VALUE)
+ .setMyIntegerParameter(MY_INTEGER_PARAMETER_VALUE)
+ .setMyBooleanParameter(MY_BOOLEAN_PARAMETER_VALUE).build();
+ receptionHandlerConfigurationParameters.put(RECEPTION_CONFIGURATION_PARAMETERS,
+ dummyReceptionHandlerParameterGroup);
}
- return pssdConfiguration;
+ return receptionHandlerConfigurationParameters;
}
/**
diff --git a/main/src/test/java/org/onap/policy/distribution/main/parameters/TestDistributionParameterGroup.java b/main/src/test/java/org/onap/policy/distribution/main/parameters/TestDistributionParameterGroup.java
index 0c8c80d6..2df1cd47 100644
--- a/main/src/test/java/org/onap/policy/distribution/main/parameters/TestDistributionParameterGroup.java
+++ b/main/src/test/java/org/onap/policy/distribution/main/parameters/TestDistributionParameterGroup.java
@@ -29,6 +29,8 @@ import java.util.Map;
import org.junit.Test;
import org.onap.policy.common.parameters.GroupValidationResult;
import org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup;
+import org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup;
+import org.onap.policy.distribution.reception.parameters.ReceptionHandlerConfigurationParameterGroup;
import org.onap.policy.distribution.reception.parameters.ReceptionHandlerParameters;
/**
@@ -42,36 +44,50 @@ public class TestDistributionParameterGroup {
@Test
public void testDistributionParameterGroup() {
final RestServerParameters restServerParameters = commonTestData.getRestServerParameters(false);
- final Map<String, ReceptionHandlerParameters> receptionHandlerParameters = commonTestData
- .getReceptionHandlerParameters(false);
+ final Map<String, ReceptionHandlerParameters> receptionHandlerParameters =
+ commonTestData.getReceptionHandlerParameters(false);
+ final Map<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfigurations =
+ commonTestData.getReceptionHandlerConfigurationParameters(false);
final Map<String, PolicyForwarderConfigurationParameterGroup> forwarderConfigurations =
commonTestData.getPolicyForwarderConfigurationParameters(false);
final DistributionParameterGroup distributionParameters =
new DistributionParameterGroup(CommonTestData.DISTRIBUTION_GROUP_NAME, restServerParameters,
- receptionHandlerParameters, forwarderConfigurations);
+ receptionHandlerParameters, receptionHandlerConfigurations, forwarderConfigurations);
final GroupValidationResult validationResult = distributionParameters.validate();
assertTrue(validationResult.isValid());
assertEquals(restServerParameters.getHost(), distributionParameters.getRestServerParameters().getHost());
assertEquals(restServerParameters.getPort(), distributionParameters.getRestServerParameters().getPort());
assertEquals(restServerParameters.getUserName(),
- distributionParameters.getRestServerParameters().getUserName());
+ distributionParameters.getRestServerParameters().getUserName());
assertEquals(restServerParameters.getPassword(),
- distributionParameters.getRestServerParameters().getPassword());
+ distributionParameters.getRestServerParameters().getPassword());
assertEquals(CommonTestData.DISTRIBUTION_GROUP_NAME, distributionParameters.getName());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getReceptionHandlerType(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getReceptionHandlerType());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getReceptionHandlerType(),
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getReceptionHandlerType());
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
.getReceptionHandlerClassName(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getReceptionHandlerClassName());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getPluginHandlerParameters(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getPluginHandlerParameters());
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getReceptionHandlerClassName());
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getPluginHandlerParameters(),
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getPluginHandlerParameters());
+ assertEquals(CommonTestData.MY_STRING_PARAMETER_VALUE,
+ ((DummyReceptionHandlerParameterGroup) distributionParameters
+ .getReceptionHandlerConfigurationParameters()
+ .get(CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS)).getMyStringParameter());
+ assertEquals(CommonTestData.MY_INTEGER_PARAMETER_VALUE,
+ ((DummyReceptionHandlerParameterGroup) distributionParameters
+ .getReceptionHandlerConfigurationParameters()
+ .get(CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS)).getMyIntegerParameter());
+ assertEquals(CommonTestData.MY_BOOLEAN_PARAMETER_VALUE,
+ ((DummyReceptionHandlerParameterGroup) distributionParameters
+ .getReceptionHandlerConfigurationParameters()
+ .get(CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS)).getMyBooleanParameter());
assertEquals(CommonTestData.FORWARDER_HOST,
((DummyPolicyForwarderParameterGroup) distributionParameters.getPolicyForwarderConfigurationParameters()
.get(CommonTestData.FORWARDER_CONFIGURATION_PARAMETERS)).getHostname());
@@ -80,72 +96,80 @@ public class TestDistributionParameterGroup {
@Test
public void testDistributionParameterGroup_NullName() {
final RestServerParameters restServerParameters = commonTestData.getRestServerParameters(false);
- final Map<String, ReceptionHandlerParameters> receptionHandlerParameters = commonTestData
- .getReceptionHandlerParameters(false);
+ final Map<String, ReceptionHandlerParameters> receptionHandlerParameters =
+ commonTestData.getReceptionHandlerParameters(false);
+ final Map<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfigurations =
+ commonTestData.getReceptionHandlerConfigurationParameters(false);
final Map<String, PolicyForwarderConfigurationParameterGroup> forwarderConfigurations =
commonTestData.getPolicyForwarderConfigurationParameters(false);
- final DistributionParameterGroup distributionParameters = new DistributionParameterGroup(null,
- restServerParameters, receptionHandlerParameters, forwarderConfigurations);
+ final DistributionParameterGroup distributionParameters =
+ new DistributionParameterGroup(null, restServerParameters, receptionHandlerParameters,
+ receptionHandlerConfigurations, forwarderConfigurations);
final GroupValidationResult validationResult = distributionParameters.validate();
assertFalse(validationResult.isValid());
assertEquals(null, distributionParameters.getName());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getReceptionHandlerType(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getReceptionHandlerType());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getReceptionHandlerType(),
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getReceptionHandlerType());
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
.getReceptionHandlerClassName(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getReceptionHandlerClassName());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getPluginHandlerParameters(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getPluginHandlerParameters());
- assertTrue(validationResult.getResult()
- .contains("field \"name\" type \"java.lang.String\" value \"null\" INVALID, "
- + "must be a non-blank string"));
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getReceptionHandlerClassName());
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getPluginHandlerParameters(),
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getPluginHandlerParameters());
+ assertTrue(validationResult.getResult().contains(
+ "field \"name\" type \"java.lang.String\" value \"null\" INVALID, " + "must be a non-blank string"));
}
@Test
public void testDistributionParameterGroup_EmptyName() {
final RestServerParameters restServerParameters = commonTestData.getRestServerParameters(false);
- final Map<String, ReceptionHandlerParameters> receptionHandlerParameters = commonTestData
- .getReceptionHandlerParameters(false);
+ final Map<String, ReceptionHandlerParameters> receptionHandlerParameters =
+ commonTestData.getReceptionHandlerParameters(false);
+ final Map<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfigurations =
+ commonTestData.getReceptionHandlerConfigurationParameters(false);
final Map<String, PolicyForwarderConfigurationParameterGroup> forwarderConfigurations =
commonTestData.getPolicyForwarderConfigurationParameters(false);
- final DistributionParameterGroup distributionParameters = new DistributionParameterGroup("",
- restServerParameters, receptionHandlerParameters, forwarderConfigurations);
+ final DistributionParameterGroup distributionParameters =
+ new DistributionParameterGroup("", restServerParameters, receptionHandlerParameters,
+ receptionHandlerConfigurations, forwarderConfigurations);
final GroupValidationResult validationResult = distributionParameters.validate();
assertFalse(validationResult.isValid());
assertEquals("", distributionParameters.getName());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getReceptionHandlerType(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getReceptionHandlerType());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getReceptionHandlerType(),
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getReceptionHandlerType());
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
.getReceptionHandlerClassName(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getReceptionHandlerClassName());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getPluginHandlerParameters(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getPluginHandlerParameters());
- assertTrue(validationResult.getResult().contains("field \"name\" type \"java.lang.String\" value \"\" INVALID, "
- + "must be a non-blank string"));
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getReceptionHandlerClassName());
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getPluginHandlerParameters(),
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getPluginHandlerParameters());
+ assertTrue(validationResult.getResult().contains(
+ "field \"name\" type \"java.lang.String\" value \"\" INVALID, " + "must be a non-blank string"));
}
@Test
public void testDistributionParameterGroup_NullReceptionHandlerParameters() {
final RestServerParameters restServerParameters = commonTestData.getRestServerParameters(false);
+ final Map<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfigurations =
+ commonTestData.getReceptionHandlerConfigurationParameters(false);
final Map<String, PolicyForwarderConfigurationParameterGroup> forwarderConfigurations =
commonTestData.getPolicyForwarderConfigurationParameters(false);
try {
- final DistributionParameterGroup distributionParameters = new DistributionParameterGroup(
- CommonTestData.DISTRIBUTION_GROUP_NAME, restServerParameters, null, forwarderConfigurations);
+ final DistributionParameterGroup distributionParameters =
+ new DistributionParameterGroup(CommonTestData.DISTRIBUTION_GROUP_NAME, restServerParameters, null,
+ receptionHandlerConfigurations, forwarderConfigurations);
distributionParameters.validate();
fail("test should throw an exception here");
} catch (final Exception e) {
@@ -157,13 +181,15 @@ public class TestDistributionParameterGroup {
@Test
public void testDistributionParameterGroup_EmptyReceptionHandlerParameters() {
final RestServerParameters restServerParameters = commonTestData.getRestServerParameters(false);
- final Map<String, ReceptionHandlerParameters> receptionHandlerParameters = commonTestData
- .getReceptionHandlerParameters(true);
+ final Map<String, ReceptionHandlerParameters> receptionHandlerParameters =
+ commonTestData.getReceptionHandlerParameters(true);
+ final Map<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfigurations =
+ commonTestData.getReceptionHandlerConfigurationParameters(false);
final Map<String, PolicyForwarderConfigurationParameterGroup> forwarderConfigurations =
commonTestData.getPolicyForwarderConfigurationParameters(false);
final DistributionParameterGroup distributionParameters =
new DistributionParameterGroup(CommonTestData.DISTRIBUTION_GROUP_NAME, restServerParameters,
- receptionHandlerParameters, forwarderConfigurations);
+ receptionHandlerParameters, receptionHandlerConfigurations, forwarderConfigurations);
distributionParameters.validate();
GroupValidationResult result = distributionParameters.validate();
assertFalse(result.isValid());
@@ -173,18 +199,20 @@ public class TestDistributionParameterGroup {
@Test
public void testDistributionParameterGroup_EmptyRestServerParameters() {
final RestServerParameters restServerParameters = commonTestData.getRestServerParameters(true);
- final Map<String, ReceptionHandlerParameters> receptionHandlerParameters = commonTestData
- .getReceptionHandlerParameters(false);
+ final Map<String, ReceptionHandlerParameters> receptionHandlerParameters =
+ commonTestData.getReceptionHandlerParameters(false);
+ final Map<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfigurations =
+ commonTestData.getReceptionHandlerConfigurationParameters(false);
final Map<String, PolicyForwarderConfigurationParameterGroup> forwarderConfigurations =
commonTestData.getPolicyForwarderConfigurationParameters(false);
final DistributionParameterGroup distributionParameters =
new DistributionParameterGroup(CommonTestData.DISTRIBUTION_GROUP_NAME, restServerParameters,
- receptionHandlerParameters, forwarderConfigurations);
+ receptionHandlerParameters, receptionHandlerConfigurations, forwarderConfigurations);
final GroupValidationResult validationResult = distributionParameters.validate();
assertFalse(validationResult.isValid());
assertTrue(validationResult.getResult()
- .contains("\"org.onap.policy.distribution.main.parameters.RestServerParameters\" INVALID, "
- + "parameter group has status INVALID"));
+ .contains("\"org.onap.policy.distribution.main.parameters.RestServerParameters\" INVALID, "
+ + "parameter group has status INVALID"));
}
}
diff --git a/main/src/test/java/org/onap/policy/distribution/main/parameters/TestReceptionHandlerParameters.java b/main/src/test/java/org/onap/policy/distribution/main/parameters/TestReceptionHandlerParameters.java
index ab86cb65..2dde9666 100644
--- a/main/src/test/java/org/onap/policy/distribution/main/parameters/TestReceptionHandlerParameters.java
+++ b/main/src/test/java/org/onap/policy/distribution/main/parameters/TestReceptionHandlerParameters.java
@@ -27,7 +27,6 @@ import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.onap.policy.common.parameters.GroupValidationResult;
import org.onap.policy.distribution.reception.parameters.PluginHandlerParameters;
-import org.onap.policy.distribution.reception.parameters.PssdConfigurationParametersGroup;
import org.onap.policy.distribution.reception.parameters.ReceptionHandlerParameters;
/**
@@ -41,15 +40,14 @@ public class TestReceptionHandlerParameters {
@Test
public void testReceptionHandlerParameters() {
final PluginHandlerParameters pHParameters = commonTestData.getPluginHandlerParameters(false);
- final PssdConfigurationParametersGroup pssdConfiguration = commonTestData
- .getPssdConfigurationParametersGroup(false);
final ReceptionHandlerParameters rHParameters = new ReceptionHandlerParameters(
- CommonTestData.RECEPTION_HANDLER_TYPE, CommonTestData.RECEPTION_HANDLER_CLASS_NAME,
- pssdConfiguration, pHParameters);
+ CommonTestData.RECEPTION_HANDLER_TYPE, CommonTestData.RECEPTION_HANDLER_CLASS_NAME,
+ CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS, pHParameters);
final GroupValidationResult validationResult = rHParameters.validate();
assertEquals(CommonTestData.RECEPTION_HANDLER_TYPE, rHParameters.getReceptionHandlerType());
assertEquals(CommonTestData.RECEPTION_HANDLER_CLASS_NAME, rHParameters.getReceptionHandlerClassName());
- assertEquals(pssdConfiguration, rHParameters.getPssdConfigurationParametersGroup());
+ assertEquals(CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS,
+ rHParameters.getReceptionHandlerConfigurationName());
assertEquals(pHParameters, rHParameters.getPluginHandlerParameters());
assertTrue(validationResult.isValid());
}
@@ -57,84 +55,79 @@ public class TestReceptionHandlerParameters {
@Test
public void testReceptionHandlerParameters_NullReceptionHandlerType() {
final PluginHandlerParameters pHParameters = commonTestData.getPluginHandlerParameters(false);
- final PssdConfigurationParametersGroup pssdConfiguration = commonTestData
- .getPssdConfigurationParametersGroup(false);
- final ReceptionHandlerParameters rHParameters = new ReceptionHandlerParameters(null,
- CommonTestData.RECEPTION_HANDLER_CLASS_NAME, pssdConfiguration, pHParameters);
+ final ReceptionHandlerParameters rHParameters =
+ new ReceptionHandlerParameters(null, CommonTestData.RECEPTION_HANDLER_CLASS_NAME,
+ CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS, pHParameters);
final GroupValidationResult validationResult = rHParameters.validate();
assertEquals(null, rHParameters.getReceptionHandlerType());
assertEquals(CommonTestData.RECEPTION_HANDLER_CLASS_NAME, rHParameters.getReceptionHandlerClassName());
- assertEquals(pssdConfiguration, rHParameters.getPssdConfigurationParametersGroup());
+ assertEquals(CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS,
+ rHParameters.getReceptionHandlerConfigurationName());
assertEquals(pHParameters, rHParameters.getPluginHandlerParameters());
assertFalse(validationResult.isValid());
assertTrue(validationResult.getResult()
- .contains("field \"receptionHandlerType\" type \"java.lang.String\" value \"null\" INVALID, "
- + "must be a non-blank string"));
+ .contains("field \"receptionHandlerType\" type \"java.lang.String\" value \"null\" INVALID, "
+ + "must be a non-blank string"));
}
@Test
public void testReceptionHandlerParameters_NullReceptionHandlerClassName() {
final PluginHandlerParameters pHParameters = commonTestData.getPluginHandlerParameters(false);
- final PssdConfigurationParametersGroup pssdConfiguration = commonTestData
- .getPssdConfigurationParametersGroup(false);
- final ReceptionHandlerParameters rHParameters = new ReceptionHandlerParameters(
- CommonTestData.RECEPTION_HANDLER_TYPE, null, pssdConfiguration, pHParameters);
+ final ReceptionHandlerParameters rHParameters =
+ new ReceptionHandlerParameters(CommonTestData.RECEPTION_HANDLER_TYPE, null,
+ CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS, pHParameters);
final GroupValidationResult validationResult = rHParameters.validate();
assertEquals(CommonTestData.RECEPTION_HANDLER_TYPE, rHParameters.getReceptionHandlerType());
assertEquals(null, rHParameters.getReceptionHandlerClassName());
- assertEquals(pssdConfiguration, rHParameters.getPssdConfigurationParametersGroup());
+ assertEquals(CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS,
+ rHParameters.getReceptionHandlerConfigurationName());
assertEquals(pHParameters, rHParameters.getPluginHandlerParameters());
assertFalse(validationResult.isValid());
- assertTrue(validationResult.getResult().contains(
- "field \"receptionHandlerClassName\" type \"java.lang.String\" value \"null\" INVALID, "
- + "must be a non-blank string containing full class name "
- + "of the reception handler"));
+ assertTrue(validationResult.getResult()
+ .contains("field \"receptionHandlerClassName\" type \"java.lang.String\" value \"null\" INVALID, "
+ + "must be a non-blank string containing full class name " + "of the reception handler"));
}
@Test
public void testReceptionHandlerParameters_EmptyReceptionHandlerType() {
final PluginHandlerParameters pHParameters = commonTestData.getPluginHandlerParameters(false);
- final PssdConfigurationParametersGroup pssdConfiguration = commonTestData
- .getPssdConfigurationParametersGroup(false);
- final ReceptionHandlerParameters rHParameters = new ReceptionHandlerParameters("",
- CommonTestData.RECEPTION_HANDLER_CLASS_NAME, pssdConfiguration, pHParameters);
+ final ReceptionHandlerParameters rHParameters =
+ new ReceptionHandlerParameters("", CommonTestData.RECEPTION_HANDLER_CLASS_NAME,
+ CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS, pHParameters);
final GroupValidationResult validationResult = rHParameters.validate();
assertEquals("", rHParameters.getReceptionHandlerType());
assertEquals(CommonTestData.RECEPTION_HANDLER_CLASS_NAME, rHParameters.getReceptionHandlerClassName());
assertEquals(pHParameters, rHParameters.getPluginHandlerParameters());
assertFalse(validationResult.isValid());
assertTrue(validationResult.getResult()
- .contains("field \"receptionHandlerType\" type \"java.lang.String\" value \"\" INVALID, "
- + "must be a non-blank string"));
+ .contains("field \"receptionHandlerType\" type \"java.lang.String\" value \"\" INVALID, "
+ + "must be a non-blank string"));
}
@Test
public void testReceptionHandlerParameters_EmptyReceptionHandlerClassName() {
final PluginHandlerParameters pHParameters = commonTestData.getPluginHandlerParameters(false);
- final PssdConfigurationParametersGroup pssdConfiguration = commonTestData
- .getPssdConfigurationParametersGroup(false);
- final ReceptionHandlerParameters rHParameters = new ReceptionHandlerParameters(
- CommonTestData.RECEPTION_HANDLER_TYPE, "", pssdConfiguration, pHParameters);
+ final ReceptionHandlerParameters rHParameters =
+ new ReceptionHandlerParameters(CommonTestData.RECEPTION_HANDLER_TYPE, "",
+ CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS, pHParameters);
final GroupValidationResult validationResult = rHParameters.validate();
assertEquals(CommonTestData.RECEPTION_HANDLER_TYPE, rHParameters.getReceptionHandlerType());
assertEquals("", rHParameters.getReceptionHandlerClassName());
- assertEquals(pssdConfiguration, rHParameters.getPssdConfigurationParametersGroup());
+ assertEquals(CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS,
+ rHParameters.getReceptionHandlerConfigurationName());
assertEquals(pHParameters, rHParameters.getPluginHandlerParameters());
assertFalse(validationResult.isValid());
assertTrue(validationResult.getResult()
- .contains("field \"receptionHandlerClassName\" type \"java.lang.String\" value \"\" INVALID, "
- + "must be a non-blank string containing full class name "
- + "of the reception handler"));
+ .contains("field \"receptionHandlerClassName\" type \"java.lang.String\" value \"\" INVALID, "
+ + "must be a non-blank string containing full class name " + "of the reception handler"));
}
@Test
public void testReceptionHandlerParameters_EmptyPluginHandler() {
final PluginHandlerParameters pHParameters = commonTestData.getPluginHandlerParameters(true);
- final PssdConfigurationParametersGroup pssdConfiguration = commonTestData
- .getPssdConfigurationParametersGroup(false);
final ReceptionHandlerParameters rHParameters = new ReceptionHandlerParameters(
- CommonTestData.RECEPTION_HANDLER_TYPE, CommonTestData.RECEPTION_HANDLER_CLASS_NAME,
- pssdConfiguration, pHParameters);
+ CommonTestData.RECEPTION_HANDLER_TYPE, CommonTestData.RECEPTION_HANDLER_CLASS_NAME,
+ CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS, pHParameters);
GroupValidationResult result = rHParameters.validate();
assertFalse(result.isValid());
assertTrue(result.getResult().endsWith("must have at least one policy forwarder\n"));
@@ -143,16 +136,16 @@ public class TestReceptionHandlerParameters {
@Test
public void testReceptionHandlerParameters_InvalidReceptionHandlerClass() {
final PluginHandlerParameters pHParameters = commonTestData.getPluginHandlerParameters(false);
- final PssdConfigurationParametersGroup pssdConfiguration = commonTestData
- .getPssdConfigurationParametersGroup(false);
+
final ReceptionHandlerParameters rHParameters = new ReceptionHandlerParameters(
- CommonTestData.RECEPTION_HANDLER_TYPE, CommonTestData.RECEPTION_HANDLER_CLASS_NAME + "Invalid",
- pssdConfiguration, pHParameters);
+ CommonTestData.RECEPTION_HANDLER_TYPE, CommonTestData.RECEPTION_HANDLER_CLASS_NAME + "Invalid",
+ CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS, pHParameters);
final GroupValidationResult validationResult = rHParameters.validate();
assertEquals(CommonTestData.RECEPTION_HANDLER_TYPE, rHParameters.getReceptionHandlerType());
assertEquals(CommonTestData.RECEPTION_HANDLER_CLASS_NAME + "Invalid",
- rHParameters.getReceptionHandlerClassName());
- assertEquals(pssdConfiguration, rHParameters.getPssdConfigurationParametersGroup());
+ rHParameters.getReceptionHandlerClassName());
+ assertEquals(CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS,
+ rHParameters.getReceptionHandlerConfigurationName());
assertEquals(pHParameters, rHParameters.getPluginHandlerParameters());
assertFalse(validationResult.isValid());
assertTrue(validationResult.getResult().contains("reception handler class not found in classpath"));
diff --git a/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyReceptionHandlerParameterGroup.java b/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyReceptionHandlerParameterGroup.java
new file mode 100644
index 00000000..d452e96c
--- /dev/null
+++ b/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyReceptionHandlerParameterGroup.java
@@ -0,0 +1,98 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2018 Ericsson. 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.distribution.main.testclasses;
+
+import org.onap.policy.common.parameters.GroupValidationResult;
+import org.onap.policy.distribution.reception.parameters.ReceptionHandlerConfigurationParameterGroup;
+
+public class DummyReceptionHandlerParameterGroup extends ReceptionHandlerConfigurationParameterGroup {
+
+ private String myStringParameter;
+ private int myIntegerParameter;
+ private boolean myBooleanParameter;
+
+ /**
+ * Inner static class is to used as a Builder.
+ *
+ */
+ public static class DummyReceptionHandlerParameterGroupBuilder {
+ private String myStringParameter;
+ private int myIntegerParameter;
+ private boolean myBooleanParameter;
+
+ public DummyReceptionHandlerParameterGroupBuilder setMyStringParameter(final String val) {
+ myStringParameter = val;
+ return this;
+ }
+
+ public DummyReceptionHandlerParameterGroupBuilder setMyIntegerParameter(final int val) {
+ myIntegerParameter = val;
+ return this;
+ }
+
+ public DummyReceptionHandlerParameterGroupBuilder setMyBooleanParameter(final boolean val) {
+ myBooleanParameter = val;
+ return this;
+ }
+
+ /**
+ * Creates a new DummyReceptionHandlerConfigurationParameterGroup instance.
+ */
+ public DummyReceptionHandlerParameterGroup build() {
+ return new DummyReceptionHandlerParameterGroup(this);
+ }
+ }
+
+ /**
+ * The constructor for instantiating PssdConfigurationParameterGroup. It is kept private so that
+ * it could only be called by PssdConfigurationBuilder.
+ *
+ * @param builder stores all the values used by PssdConfigurationParametersGroup
+ */
+ private DummyReceptionHandlerParameterGroup(final DummyReceptionHandlerParameterGroupBuilder builder) {
+ myStringParameter = builder.myStringParameter;
+ myIntegerParameter = builder.myIntegerParameter;
+ myBooleanParameter = builder.myBooleanParameter;
+ }
+
+ public String getMyStringParameter() {
+ return myStringParameter;
+ }
+
+ public int getMyIntegerParameter() {
+ return myIntegerParameter;
+ }
+
+ public boolean getMyBooleanParameter() {
+ return myBooleanParameter;
+ }
+
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Override
+ public GroupValidationResult validate() {
+ return new GroupValidationResult(this);
+ }
+
+}
+
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters.json b/main/src/test/resources/parameters/DistributionConfigParameters.json
index 7a557624..acf56764 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -51,6 +28,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json
index d11ac9ea..e22af281 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
},
@@ -47,6 +24,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json
index c534154c..4d271308 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -46,6 +23,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json
index b8010f8d..c25b2e35 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json
@@ -8,6 +8,16 @@
},
"receptionHandlerParameters":{
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidDecoderAndForwarderParameters.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidDecoderAndForwarderParameters.json
index 0c9caa6c..bd52e186 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidDecoderAndForwarderParameters.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidDecoderAndForwarderParameters.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -70,6 +47,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidForwarderConfigurationClassName.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidForwarderConfigurationClassName.json
index ba895a67..60c28e08 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidForwarderConfigurationClassName.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidForwarderConfigurationClassName.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -51,6 +28,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json
index 7cafc266..46207204 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -51,6 +28,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerParameters.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerParameters.json
index 793702fb..123ff203 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerParameters.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerParameters.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.InvalidSdcReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -51,6 +28,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerParameters.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerParameters.json
index 0d650331..47528ce0 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerParameters.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerParameters.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -51,6 +28,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json b/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json
index f9392db5..f78bb65f 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyForwarders":{
"DummyForwarder":{
@@ -45,6 +22,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json b/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json
index 7d9a8af4..3ac54f73 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -43,5 +20,15 @@
}
}
}
+ },
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
}
}
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json b/main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json
index b91e95d8..7a9ecd15 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json
@@ -5,5 +5,15 @@
"port":6969,
"userName":"healthcheck",
"password":"zb!XztG34"
+ },
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
}
} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_UnknownForwarderConfigurationClassName.json b/main/src/test/resources/parameters/DistributionConfigParameters_UnknownForwarderConfigurationClassName.json
index c189671d..3118631b 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_UnknownForwarderConfigurationClassName.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_UnknownForwarderConfigurationClassName.json
@@ -51,6 +51,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.Unknown",
diff --git a/main/src/test/resources/parameters/MinimumParameters.json b/main/src/test/resources/parameters/MinimumParameters.json
index 1b797def..fc6b16aa 100644
--- a/main/src/test/resources/parameters/MinimumParameters.json
+++ b/main/src/test/resources/parameters/MinimumParameters.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -51,6 +28,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcConfiguration.java b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcConfiguration.java
index 945670b9..99529759 100644
--- a/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcConfiguration.java
+++ b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcConfiguration.java
@@ -21,8 +21,6 @@
package org.onap.policy.distribution.reception.handling.sdc;
import java.util.List;
-
-import org.onap.policy.distribution.reception.parameters.PssdConfigurationParametersGroup;
import org.onap.sdc.api.consumer.IConfiguration;
/**
@@ -31,14 +29,14 @@ import org.onap.sdc.api.consumer.IConfiguration;
*/
public class SdcConfiguration implements IConfiguration {
- private PssdConfigurationParametersGroup configParameters = null;
+ private SdcReceptionHandlerConfigurationParameterGroup configParameters = null;
/**
* Constructor for instantiating {@link SdcConfiguration}.
*
* @param configParameters the SDC Client configuration parameters
*/
- public SdcConfiguration(final PssdConfigurationParametersGroup configParameters) {
+ public SdcConfiguration(final SdcReceptionHandlerConfigurationParameterGroup configParameters) {
this.configParameters = configParameters;
}
diff --git a/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java
index 60c94e2b..f0f9e20d 100644
--- a/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java
+++ b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java
@@ -26,7 +26,6 @@ import org.onap.policy.common.parameters.ParameterService;
import org.onap.policy.distribution.reception.decoding.PluginInitializationException;
import org.onap.policy.distribution.reception.decoding.PluginTerminationException;
import org.onap.policy.distribution.reception.handling.AbstractReceptionHandler;
-import org.onap.policy.distribution.reception.parameters.PssdConfigurationParametersGroup;
import org.onap.sdc.api.IDistributionClient;
import org.onap.sdc.api.results.IDistributionClientResult;
import org.onap.sdc.impl.DistributionClientFactory;
@@ -39,13 +38,13 @@ public class SdcReceptionHandler extends AbstractReceptionHandler {
private static final Logger LOGGER = FlexLogger.getLogger(SdcReceptionHandler.class);
private SdcReceptionHandlerStatus sdcReceptionHandlerStatus = SdcReceptionHandlerStatus.STOPPED;
- private PssdConfigurationParametersGroup handlerParameters;
+ private SdcReceptionHandlerConfigurationParameterGroup handlerParameters;
private IDistributionClient distributionClient;
private volatile int nbOfNotificationsOngoing = 0;
@Override
protected void initializeReception(final String parameterGroupName) throws PluginInitializationException {
- handlerParameters = (PssdConfigurationParametersGroup) ParameterService.get(parameterGroupName);
+ handlerParameters = (SdcReceptionHandlerConfigurationParameterGroup) ParameterService.get(parameterGroupName);
initializeSdcClient();
startSdcClient();
}
diff --git a/reception/src/main/java/org/onap/policy/distribution/reception/parameters/PssdConfigurationParametersGroup.java b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandlerConfigurationParameterGroup.java
index 93e3f628..5c46049f 100644
--- a/reception/src/main/java/org/onap/policy/distribution/reception/parameters/PssdConfigurationParametersGroup.java
+++ b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandlerConfigurationParameterGroup.java
@@ -18,24 +18,21 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.distribution.reception.parameters;
+package org.onap.policy.distribution.reception.handling.sdc;
import java.util.List;
import java.util.UUID;
-
import org.onap.policy.common.parameters.GroupValidationResult;
-import org.onap.policy.common.parameters.ParameterGroup;
import org.onap.policy.common.parameters.ValidationStatus;
import org.onap.policy.common.utils.validation.ParameterValidationUtils;
+import org.onap.policy.distribution.reception.parameters.ReceptionHandlerConfigurationParameterGroup;
/**
- * This class handles reading, parsing and validating of the Policy SDC Service Distribution parameters from Json
- * format, which strictly adheres to the interface:IConfiguration, defined by SDC SDK.
+ * This class handles reading, parsing and validating of the Policy SDC Service Distribution
+ * parameters from Json format, which strictly adheres to the interface:IConfiguration, defined by
+ * SDC SDK.
*/
-public class PssdConfigurationParametersGroup implements ParameterGroup {
-
- // Policy SDC Service Distribution specified field.
- private String name;
+public class SdcReceptionHandlerConfigurationParameterGroup extends ReceptionHandlerConfigurationParameterGroup {
// Interface of IConfiguration item
private String asdcAddress;
@@ -153,18 +150,18 @@ public class PssdConfigurationParametersGroup implements ParameterGroup {
/**
* Creates a new PssdConfigurationParametersGroup instance.
*/
- public PssdConfigurationParametersGroup build() {
- return new PssdConfigurationParametersGroup(this);
+ public SdcReceptionHandlerConfigurationParameterGroup build() {
+ return new SdcReceptionHandlerConfigurationParameterGroup(this);
}
}
/**
- * The constructor for instantiating PssdConfigurationParametersGroup. It is kept private so that it could only be
- * called by PssdConfigurationBuilder.
+ * The constructor for instantiating PssdConfigurationParametersGroup. It is kept private so
+ * that it could only be called by PssdConfigurationBuilder.
*
* @param builder stores all the values used by PssdConfigurationParametersGroup
*/
- private PssdConfigurationParametersGroup(final PssdConfigurationBuilder builder) {
+ private SdcReceptionHandlerConfigurationParameterGroup(final PssdConfigurationBuilder builder) {
asdcAddress = builder.asdcAddress;
messageBusAddress = builder.messageBusAddress;
user = builder.user;
@@ -248,25 +245,18 @@ public class PssdConfigurationParametersGroup implements ParameterGroup {
*/
@Override
public String toString() {
- return "name =" + name + ",TestParameters:[asdcAddress = " + asdcAddress + ", messageBusAddress = "
+ return "name =" + getName() + ",TestParameters:[asdcAddress = " + asdcAddress + ", messageBusAddress = "
+ messageBusAddress + ", user = " + user + "]";
}
/**
- * {@inheritDoc}
- */
- @Override
- public String getName() {
- return name;
- }
-
- /**
* Set the name of this group.
*
* @param name the name to set.
*/
+ @Override
public void setName(final String name) {
- this.name = name + "_" + UUID.randomUUID().toString();
+ super.setName(name + "_" + UUID.randomUUID().toString());
}
/**
diff --git a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcConfiguration.java b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcConfiguration.java
index e1ba00cf..65d7ca10 100644
--- a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcConfiguration.java
+++ b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcConfiguration.java
@@ -34,7 +34,6 @@ import java.util.Arrays;
import org.junit.Test;
import org.onap.policy.common.parameters.GroupValidationResult;
-import org.onap.policy.distribution.reception.parameters.PssdConfigurationParametersGroup;
/**
* Class to perform unit test of {@link SdcConfiguration}.
@@ -44,11 +43,11 @@ public class TestSdcConfiguration {
@Test
public void testSdcConfiguration() throws IOException {
- PssdConfigurationParametersGroup configParameters = null;
+ SdcReceptionHandlerConfigurationParameterGroup configParameters = null;
try {
final Gson gson = new GsonBuilder().create();
configParameters = gson.fromJson(new FileReader("src/test/resources/handling-sdc.json"),
- PssdConfigurationParametersGroup.class);
+ SdcReceptionHandlerConfigurationParameterGroup.class);
} catch (final Exception e) {
fail("test should not thrown an exception here: " + e.getMessage());
}
@@ -74,11 +73,11 @@ public class TestSdcConfiguration {
@Test
public void testInvalidSdcConfiguration() throws IOException {
- PssdConfigurationParametersGroup configParameters = null;
+ SdcReceptionHandlerConfigurationParameterGroup configParameters = null;
try {
final Gson gson = new GsonBuilder().create();
configParameters = gson.fromJson(new FileReader("src/test/resources/handling-sdcInvalid.json"),
- PssdConfigurationParametersGroup.class);
+ SdcReceptionHandlerConfigurationParameterGroup.class);
} catch (final Exception e) {
fail("test should not thrown an exception here: " + e.getMessage());
}
diff --git a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcReceptionHandler.java b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcReceptionHandler.java
index 02b83849..c876f99c 100644
--- a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcReceptionHandler.java
+++ b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcReceptionHandler.java
@@ -42,7 +42,6 @@ import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.common.parameters.ParameterService;
import org.onap.policy.distribution.reception.decoding.PluginInitializationException;
import org.onap.policy.distribution.reception.decoding.PluginTerminationException;
-import org.onap.policy.distribution.reception.parameters.PssdConfigurationParametersGroup;
import org.onap.sdc.api.results.IDistributionClientResult;
import org.onap.sdc.impl.mock.DistributionClientStubImpl;
import org.onap.sdc.utils.DistributionActionResultEnum;
@@ -64,7 +63,7 @@ public class TestSdcReceptionHandler {
@Mock
private DistributionClientStubImpl distributionClient;
- private PssdConfigurationParametersGroup pssdConfigParameters;
+ private SdcReceptionHandlerConfigurationParameterGroup pssdConfigParameters;
private SdcReceptionHandler sypHandler;
/**
@@ -76,7 +75,7 @@ public class TestSdcReceptionHandler {
public final void init() throws IOException {
final Gson gson = new GsonBuilder().create();
pssdConfigParameters = gson.fromJson(new FileReader("src/test/resources/handling-sdc.json"),
- PssdConfigurationParametersGroup.class);
+ SdcReceptionHandlerConfigurationParameterGroup.class);
ParameterService.register(pssdConfigParameters);
final SdcReceptionHandler sdcHandler = new SdcReceptionHandler();
sypHandler = Mockito.spy(sdcHandler);
diff --git a/reception/pom.xml b/reception/pom.xml
index f8924036..71e4c4ee 100644
--- a/reception/pom.xml
+++ b/reception/pom.xml
@@ -47,5 +47,9 @@
<artifactId>utils</artifactId>
<version>${policy.common.version}</version>
</dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ </dependency>
</dependencies>
</project>
diff --git a/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java b/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java
index a9d76a01..300dae8f 100644
--- a/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java
+++ b/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java
@@ -22,7 +22,6 @@ package org.onap.policy.distribution.reception.handling;
import java.util.ArrayList;
import java.util.Collection;
-
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.common.parameters.ParameterService;
@@ -36,9 +35,10 @@ import org.onap.policy.distribution.reception.decoding.PolicyDecodingException;
import org.onap.policy.distribution.reception.parameters.ReceptionHandlerParameters;
/**
- * Base implementation of {@link ReceptionHandler}. All reception handlers should extend this base class by implementing
- * the {@link #initializeReception(String)} method to perform the specific initialization required to receive inputs and
- * by invoking {@link #inputReceived(PolicyInput)} when the reception handler receives input.
+ * Base implementation of {@link ReceptionHandler}. All reception handlers should extend this base
+ * class by implementing the {@link #initializeReception(String)} method to perform the specific
+ * initialization required to receive inputs and by invoking {@link #inputReceived(PolicyInput)}
+ * when the reception handler receives input.
*/
public abstract class AbstractReceptionHandler implements ReceptionHandler {
@@ -54,12 +54,12 @@ public abstract class AbstractReceptionHandler implements ReceptionHandler {
final ReceptionHandlerParameters receptionHandlerParameters =
(ReceptionHandlerParameters) ParameterService.get(parameterGroupName);
pluginHandler = new PluginHandler(receptionHandlerParameters.getPluginHandlerParameters().getName());
- initializeReception(receptionHandlerParameters.getPssdConfigurationParametersGroup().getName());
+ initializeReception(receptionHandlerParameters.getReceptionHandlerConfigurationName());
}
/**
- * Sub classes must implement this method to perform the specific initialization required to receive inputs, for
- * example setting up subscriptions.
+ * Sub classes must implement this method to perform the specific initialization required to
+ * receive inputs, for example setting up subscriptions.
*
* @param parameterGroupName the parameter group name
* @throws PluginInitializationException if initialization of reception handler fails
@@ -67,12 +67,13 @@ public abstract class AbstractReceptionHandler implements ReceptionHandler {
protected abstract void initializeReception(String parameterGroupName) throws PluginInitializationException;
/**
- * Handle input that has been received. The given input shall be decoded using the {@link PolicyDecoder}s configured
- * for this reception handler and forwarded using the {@link PolicyForwarder}s configured for this reception
- * handler.
+ * Handle input that has been received. The given input shall be decoded using the
+ * {@link PolicyDecoder}s configured for this reception handler and forwarded using the
+ * {@link PolicyForwarder}s configured for this reception handler.
*
* @param policyInput the input that has been received
- * @throws PolicyDecodingException if an error occurs in decoding a policy from the received input
+ * @throws PolicyDecodingException if an error occurs in decoding a policy from the received
+ * input
*/
protected void inputReceived(final PolicyInput policyInput) throws PolicyDecodingException {
diff --git a/reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerConfigurationParameterGroup.java b/reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerConfigurationParameterGroup.java
new file mode 100644
index 00000000..c3163665
--- /dev/null
+++ b/reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerConfigurationParameterGroup.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2018 Ericsson. 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.distribution.reception.parameters;
+
+import org.onap.policy.common.parameters.ParameterGroup;
+import org.onap.policy.distribution.reception.handling.ReceptionHandler;
+
+/**
+ * Base class of all {@link ParameterGroup} classes for configuration parameters for
+ * {@link ReceptionHandler} classes
+ */
+public abstract class ReceptionHandlerConfigurationParameterGroup implements ParameterGroup {
+
+ private String name;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+}
diff --git a/reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerConfigurationParametersJsonAdapter.java b/reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerConfigurationParametersJsonAdapter.java
new file mode 100644
index 00000000..0890a2ab
--- /dev/null
+++ b/reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerConfigurationParametersJsonAdapter.java
@@ -0,0 +1,80 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2018 Ericsson. 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.distribution.reception.parameters;
+
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonPrimitive;
+import java.lang.reflect.Type;
+import org.slf4j.ext.XLogger;
+import org.slf4j.ext.XLoggerFactory;
+
+/**
+ * This class deserialises reception handler parameters from JSON.
+ */
+public class ReceptionHandlerConfigurationParametersJsonAdapter
+ implements JsonDeserializer<ReceptionHandlerConfigurationParameterGroup> {
+ private static final XLogger LOGGER =
+ XLoggerFactory.getXLogger(ReceptionHandlerConfigurationParametersJsonAdapter.class);
+
+ private static final String PARAMETER_CLASS_NAME = "parameterClassName";
+ private static final String RECEPTION_HANDLER_PARAMETERS = "parameters";
+
+ @Override
+ public ReceptionHandlerConfigurationParameterGroup deserialize(final JsonElement json, final Type typeOfT,
+ final JsonDeserializationContext context) {
+ final JsonObject jsonObject = json.getAsJsonObject();
+
+ final String receptionHandlerParameterClassName = getParameterGroupClassName(jsonObject);
+ Class<?> receptionHandlerParameterClass = getParameterGroupClass(receptionHandlerParameterClassName);
+
+ return context.deserialize(jsonObject.get(RECEPTION_HANDLER_PARAMETERS), receptionHandlerParameterClass);
+ }
+
+ private String getParameterGroupClassName(final JsonObject jsonObject) {
+ final JsonPrimitive classNameJsonPrimitive = ((JsonPrimitive) jsonObject.get(PARAMETER_CLASS_NAME));
+
+ if (classNameJsonPrimitive == null || classNameJsonPrimitive.getAsString().length() == 0) {
+ final String errorMessage = "parameter \"" + PARAMETER_CLASS_NAME + "\" value \""
+ + (classNameJsonPrimitive != null ? classNameJsonPrimitive.getAsString() : "null")
+ + "\" invalid in JSON file";
+ LOGGER.warn(errorMessage);
+ throw new IllegalArgumentException(errorMessage);
+ }
+ return classNameJsonPrimitive.getAsString().replaceAll("\\s+", "");
+ }
+
+ private Class<?> getParameterGroupClass(final String receptionHAndlerParameterClassName) {
+ Class<?> receptionHandlerParameterClass = null;
+ try {
+ receptionHandlerParameterClass = Class.forName(receptionHAndlerParameterClassName);
+ } catch (final ClassNotFoundException e) {
+ final String errorMessage = "parameter \"" + PARAMETER_CLASS_NAME + "\" value \""
+ + receptionHAndlerParameterClassName + "\", could not find class";
+ LOGGER.warn(errorMessage, e);
+ throw new IllegalArgumentException(errorMessage, e);
+ }
+ return receptionHandlerParameterClass;
+ }
+
+}
diff --git a/reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerParameters.java b/reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerParameters.java
index 6464eeb6..3839c449 100644
--- a/reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerParameters.java
+++ b/reception/src/main/java/org/onap/policy/distribution/reception/parameters/ReceptionHandlerParameters.java
@@ -38,7 +38,7 @@ public class ReceptionHandlerParameters implements ParameterGroup {
private String name;
private String receptionHandlerType;
private String receptionHandlerClassName;
- private PssdConfigurationParametersGroup pssdConfiguration;
+ private String receptionHandlerConfigurationName;
private PluginHandlerParameters pluginHandlerParameters;
/**
@@ -46,14 +46,15 @@ public class ReceptionHandlerParameters implements ParameterGroup {
*
* @param receptionHandlerType the reception handler type
* @param receptionHandlerClassName the reception handler class name
+ * @param receptionHandlerConfigurationName the name of the configuration for the reception
+ * handler
* @param pluginHandlerParameters the plugin handler parameters
*/
- public ReceptionHandlerParameters(final String receptionHandlerType, final String receptionHandlerClassName,
- final PssdConfigurationParametersGroup pssdConfiguration,
- final PluginHandlerParameters pluginHandlerParameters) {
+ public ReceptionHandlerParameters(final String receptionHandlerType, final String receptionHandlerClassName,
+ final String receptionHandlerConfigurationName, final PluginHandlerParameters pluginHandlerParameters) {
this.receptionHandlerType = receptionHandlerType;
this.receptionHandlerClassName = receptionHandlerClassName;
- this.pssdConfiguration = pssdConfiguration;
+ this.receptionHandlerConfigurationName = receptionHandlerConfigurationName;
this.pluginHandlerParameters = pluginHandlerParameters;
}
@@ -76,12 +77,13 @@ public class ReceptionHandlerParameters implements ParameterGroup {
}
/**
- * Return the PssdConfigurationParametersGroup of this ReceptionHandlerParameters instance.
+ * Return the name of the reception handler configuration for this ReceptionHandlerParameters
+ * instance.
*
* @return the PssdConfigurationParametersGroup
*/
- public PssdConfigurationParametersGroup getPssdConfigurationParametersGroup() {
- return pssdConfiguration;
+ public String getReceptionHandlerConfigurationName() {
+ return receptionHandlerConfigurationName;
}
/**
@@ -138,6 +140,7 @@ public class ReceptionHandlerParameters implements ParameterGroup {
*
* @param name the name to set
*/
+ @Override
public void setName(final String name) {
this.name = name;
}