diff options
author | Bin Yang <bin.yang@windriver.com> | 2019-04-19 09:04:26 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-19 09:04:26 +0000 |
commit | 388ef1f2943d5fb581cd6533e1fc225a0309df7f (patch) | |
tree | 982357e2cbaa0a3cf8f11e60d4ae7719467458c7 /artifactbroker | |
parent | a9a75449cc0ed5a278dd6df6f7e1950e628f854e (diff) | |
parent | ef9c71ab1efce6e60eb5d8c89cf09c5182c48730 (diff) |
Merge "enable merge sdc client part into Distribution release image"1.3.0
Diffstat (limited to 'artifactbroker')
9 files changed, 171 insertions, 51 deletions
diff --git a/artifactbroker/main/src/main/java/org/onap/policy/distribution/main/startstop/DistributionActivator.java b/artifactbroker/main/src/main/java/org/onap/policy/distribution/main/startstop/DistributionActivator.java index 2a5dd88..f4f3d40 100644 --- a/artifactbroker/main/src/main/java/org/onap/policy/distribution/main/startstop/DistributionActivator.java +++ b/artifactbroker/main/src/main/java/org/onap/policy/distribution/main/startstop/DistributionActivator.java @@ -29,7 +29,12 @@ import org.onap.policy.common.logging.flexlogger.Logger; import org.onap.policy.common.parameters.ParameterService; import org.onap.policy.distribution.main.PolicyDistributionException; import org.onap.policy.distribution.main.parameters.DistributionParameterGroup; +import org.onap.policy.distribution.main.parameters.ArtifactForwarderConfigurationParameterGroup; 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; /** * This class wraps a distributor so that it can be activated as a complete service together with all its distribution @@ -43,6 +48,7 @@ public class DistributionActivator { private final DistributionParameterGroup distributionParameterGroup; // The map of reception handlers initialized by this distribution activator + private final Map<String, AbstractReceptionHandler> receptionHandlersMap = new HashMap<>(); private static boolean alive = false; @@ -67,7 +73,21 @@ public class DistributionActivator { LOGGER.debug("Policy distribution starting as a service . . ."); startDistributionRestServer(); registerToParameterService(distributionParameterGroup); - DistributionActivator.setAlive(true); + for (final ReceptionHandlerParameters receptionHandlerParameters : distributionParameterGroup + .getReceptionHandlerParameters().values()) { + try { + final Class<AbstractReceptionHandler> receptionHandlerClass = (Class<AbstractReceptionHandler>) Class + .forName(receptionHandlerParameters.getReceptionHandlerClassName()); + final AbstractReceptionHandler receptionHandler = receptionHandlerClass.newInstance(); + receptionHandler.initialize(receptionHandlerParameters.getName()); + LOGGER.debug("Policy distribution , name = " + receptionHandlerParameters.getName()); + receptionHandlersMap.put(receptionHandlerParameters.getName(), receptionHandler); + DistributionActivator.setAlive(true); + } catch (final ClassNotFoundException | InstantiationException | IllegalAccessException + | PluginInitializationException exp) { + throw new PolicyDistributionException(exp.getMessage(), exp); + } + } LOGGER.debug("Policy distribution started as a service"); } @@ -92,6 +112,10 @@ public class DistributionActivator { */ public void terminate() throws PolicyDistributionException { try { + for (final AbstractReceptionHandler handler : receptionHandlersMap.values()) { + handler.destroy(); + } + receptionHandlersMap.clear(); deregisterToParameterService(distributionParameterGroup); DistributionActivator.setAlive(false); @@ -119,8 +143,25 @@ public class DistributionActivator { */ public void registerToParameterService(final DistributionParameterGroup distributionParameterGroup) { ParameterService.register(distributionParameterGroup); + for (final ReceptionHandlerParameters params : distributionParameterGroup.getReceptionHandlerParameters() + .values()) { + params.setName(distributionParameterGroup.getName()); + params.getPluginHandlerParameters().setName(distributionParameterGroup.getName()); + ParameterService.register(params); + ParameterService.register(params.getPluginHandlerParameters()); + } + //@formatter:off + for (final Entry<String, ArtifactForwarderConfigurationParameterGroup> forwarderConfiguration + : distributionParameterGroup.getArtifactForwarderConfigurationParameters().entrySet()) { + 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()); + } //@formatter:off - //@formatter:on } /** @@ -130,6 +171,22 @@ public class DistributionActivator { */ public void deregisterToParameterService(final DistributionParameterGroup distributionParameterGroup) { ParameterService.deregister(distributionParameterGroup.getName()); + for (final ReceptionHandlerParameters params : distributionParameterGroup.getReceptionHandlerParameters() + .values()) { + ParameterService.deregister((params.getName())); + ParameterService.deregister((params.getPluginHandlerParameters().getName())); + } + //@formatter:off + for (final Entry<String, ArtifactForwarderConfigurationParameterGroup> forwarderConfiguration + : distributionParameterGroup.getArtifactForwarderConfigurationParameters().entrySet()) { + 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()); + } //@formatter:on } diff --git a/artifactbroker/packages/src/main/resources/etc/defaultConfig.json b/artifactbroker/packages/src/main/resources/etc/defaultConfig.json index cb8e1ea..1e9221a 100644 --- a/artifactbroker/packages/src/main/resources/etc/defaultConfig.json +++ b/artifactbroker/packages/src/main/resources/etc/defaultConfig.json @@ -6,5 +6,65 @@ "userName":"healthcheck", "password":"zb!XztG34", "https":true + }, + "receptionHandlerParameters":{ + "SDCReceptionHandler":{ + "receptionHandlerType":"SDC", + "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandler", + "receptionHandlerConfigurationName":"sdcConfiguration", + "pluginHandlerParameters":{ + "artifactForwarders":{ + "PAPEngineForwarder":{ + "forwarderType":"PAPEngine", + "forwarderClassName":"org.onap.policy.distribution.forwarding.k8s.K8sArtifactForwarder", + "forwarderConfigurationName": "k8sConfiguration" + } + } + } + } + }, + "receptionHandlerConfigurationParameters":{ + "sdcConfiguration":{ + "parameterClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandlerConfigurationParameterGroup", + "parameters":{ + "asdcAddress": "sdc-be.onap:8443", + "messageBusAddress": [ + "message-router.onap" + ], + "user": "policy", + "password": "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U", + "pollingInterval":20, + "pollingTimeout":30, + "consumerId": "policy-id", + "artifactTypes": [ + "TOSCA_CSAR", + "HEAT", + "HEAT_ENV", + "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT" + ], + "consumerGroup": "policy-group", + "environmentName": "AUTO", + "keystorePath": "null", + "keystorePassword": "null", + "activeserverTlsAuth": false, + "isFilterinEmptyResources": true, + "isUseHttpsWithDmaap": false + } + } + }, + "artifactForwarderConfigurationParameters":{ + "k8sConfiguration":{ + "parameterClassName":"org.onap.policy.distribution.forwarding.k8s.K8sArtifactForwarderParameterGroup", + "parameters":{ + "useHttps": true, + "hostname": "pdp", + "port": 8081, + "userName": "testpdp", + "password": "alpha123", + "clientAuth": "cHl0aG9uOnRlc3Q=", + "isManaged": true, + "pdpGroup": "default" + } + } } } diff --git a/artifactbroker/packages/src/main/resources/etc/logback.xml b/artifactbroker/packages/src/main/resources/etc/logback.xml index ebe06a8..e2d4869 100644 --- a/artifactbroker/packages/src/main/resources/etc/logback.xml +++ b/artifactbroker/packages/src/main/resources/etc/logback.xml @@ -21,10 +21,10 @@ <configuration scan="true" scanPeriod="3 seconds" debug="true"> <!--<jmxConfigurator /> --> <!-- directory path for all other type logs --> - <property name="logDir" value="${POLICY_LOGS}" /> + <property name="logDir" value="${ARTIFACT_LOGS}" /> <!-- directory path for debugging type logs --> - <property name="debugDir" value="${POLICY_LOGS}" /> + <property name="debugDir" value="${ARTIFACT_LOGS}" /> <!-- specify the component name <ONAP-component-name>::= "MSO" | "DCAE" | "ASDC " | "AAI" |"Policy" | "SDNC" | "AC" --> diff --git a/artifactbroker/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/xacml/pdp/XacmlPdpArtifactForwarder.java b/artifactbroker/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/k8s/K8sArtifactForwarder.java index 4179fc7..d920907 100644 --- a/artifactbroker/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/xacml/pdp/XacmlPdpArtifactForwarder.java +++ b/artifactbroker/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/k8s/K8sArtifactForwarder.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.distribution.forwarding.xacml.pdp; +package org.onap.policy.distribution.forwarding.k8s; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -61,14 +61,14 @@ import org.onap.sdc.api.notification.IArtifactInfo; /** * Forwards policies to the XACML PDP. */ -public class XacmlPdpArtifactForwarder implements ArtifactForwarder { +public class K8sArtifactForwarder implements ArtifactForwarder { - private static final Logger LOGGER = FlexLogger.getLogger(XacmlPdpArtifactForwarder.class); + private static final Logger LOGGER = FlexLogger.getLogger(K8sArtifactForwarder.class); private static final String BASE_PATH = "http://localhost:8081/v1/rb/definition"; private static final String CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT = "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT"; private Map<String, IArtifactInfo> artifactMap; - private XacmlPdpArtifactForwarderParameterGroup configurationParameters = null; + private K8sArtifactForwarderParameterGroup configurationParameters = null; diff --git a/artifactbroker/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/xacml/pdp/XacmlPdpArtifactForwarderParameterGroup.java b/artifactbroker/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/k8s/K8sArtifactForwarderParameterGroup.java index d04bb3c..42e8d5a 100644 --- a/artifactbroker/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/xacml/pdp/XacmlPdpArtifactForwarderParameterGroup.java +++ b/artifactbroker/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/k8s/K8sArtifactForwarderParameterGroup.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.distribution.forwarding.xacml.pdp; +package org.onap.policy.distribution.forwarding.k8s; import org.onap.policy.common.parameters.GroupValidationResult; import org.onap.policy.common.parameters.ValidationStatus; @@ -26,10 +26,10 @@ import org.onap.policy.common.utils.validation.ParameterValidationUtils; import org.onap.policy.distribution.main.parameters.ArtifactForwarderConfigurationParameterGroup; /** - * Holds the parameters for the{@link XacmlPdpArtifactForwarder}. + * Holds the parameters for the{@link K8sArtifactForwarder}. */ -public class XacmlPdpArtifactForwarderParameterGroup extends ArtifactForwarderConfigurationParameterGroup { - public static final String POLICY_FORWARDER_PLUGIN_CLASS = XacmlPdpArtifactForwarder.class.getCanonicalName(); +public class K8sArtifactForwarderParameterGroup extends ArtifactForwarderConfigurationParameterGroup { + public static final String POLICY_FORWARDER_PLUGIN_CLASS = K8sArtifactForwarder.class.getCanonicalName(); private boolean useHttps; private String hostname; @@ -45,7 +45,7 @@ public class XacmlPdpArtifactForwarderParameterGroup extends ArtifactForwarderCo * * @param builder the builder create the instance from */ - private XacmlPdpArtifactForwarderParameterGroup(final XacmlPdpArtifactForwarderParameterGroupBuilder builder) { + private K8sArtifactForwarderParameterGroup(final K8sArtifactForwarderParameterGroupBuilder builder) { this.useHttps = builder.useHttps; this.hostname = builder.hostname; this.port = builder.port; @@ -89,9 +89,9 @@ public class XacmlPdpArtifactForwarderParameterGroup extends ArtifactForwarderCo } /** - * Builder for XacmlPdpArtifactForwarderParameterGroup. + * Builder for K8sArtifactForwarderParameterGroup. */ - public static class XacmlPdpArtifactForwarderParameterGroupBuilder { + public static class K8sArtifactForwarderParameterGroupBuilder { private boolean useHttps = false; private String hostname; private int port; @@ -101,42 +101,42 @@ public class XacmlPdpArtifactForwarderParameterGroup extends ArtifactForwarderCo private boolean isManaged = true; private String pdpGroup; - public XacmlPdpArtifactForwarderParameterGroupBuilder setUseHttps(final boolean useHttps) { + public K8sArtifactForwarderParameterGroupBuilder setUseHttps(final boolean useHttps) { this.useHttps = useHttps; return this; } - public XacmlPdpArtifactForwarderParameterGroupBuilder setHostname(final String hostname) { + public K8sArtifactForwarderParameterGroupBuilder setHostname(final String hostname) { this.hostname = hostname; return this; } - public XacmlPdpArtifactForwarderParameterGroupBuilder setPort(final int port) { + public K8sArtifactForwarderParameterGroupBuilder setPort(final int port) { this.port = port; return this; } - public XacmlPdpArtifactForwarderParameterGroupBuilder setUserName(final String userName) { + public K8sArtifactForwarderParameterGroupBuilder setUserName(final String userName) { this.userName = userName; return this; } - public XacmlPdpArtifactForwarderParameterGroupBuilder setPassword(final String password) { + public K8sArtifactForwarderParameterGroupBuilder setPassword(final String password) { this.password = password; return this; } - public XacmlPdpArtifactForwarderParameterGroupBuilder setClientAuth(final String clientAuth) { + public K8sArtifactForwarderParameterGroupBuilder setClientAuth(final String clientAuth) { this.clientAuth = clientAuth; return this; } - public XacmlPdpArtifactForwarderParameterGroupBuilder setIsManaged(final boolean isManaged) { + public K8sArtifactForwarderParameterGroupBuilder setIsManaged(final boolean isManaged) { this.isManaged = isManaged; return this; } - public XacmlPdpArtifactForwarderParameterGroupBuilder setPdpGroup(final String pdpGroup) { + public K8sArtifactForwarderParameterGroupBuilder setPdpGroup(final String pdpGroup) { this.pdpGroup = pdpGroup; return this; } @@ -144,8 +144,8 @@ public class XacmlPdpArtifactForwarderParameterGroup extends ArtifactForwarderCo /** * Creates a new XacmlPapServletArtifactForwarderParameterGroup instance. */ - public XacmlPdpArtifactForwarderParameterGroup build() { - return new XacmlPdpArtifactForwarderParameterGroup(this); + public K8sArtifactForwarderParameterGroup build() { + return new K8sArtifactForwarderParameterGroup(this); } } diff --git a/artifactbroker/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/xacml/pdp/engine/XacmlPdpArtifactForwarderParameterGroupTest.java b/artifactbroker/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/k8s/engine/K8sArtifactForwarderParameterGroupTest.java index d10ea62..b3525cc 100644 --- a/artifactbroker/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/xacml/pdp/engine/XacmlPdpArtifactForwarderParameterGroupTest.java +++ b/artifactbroker/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/k8s/engine/K8sArtifactForwarderParameterGroupTest.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.distribution.forwarding.xacml.pdp.engine; +package org.onap.policy.distribution.forwarding.k8s.engine; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -26,16 +26,16 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; import org.onap.policy.common.parameters.ValidationStatus; -import org.onap.policy.distribution.forwarding.xacml.pdp.XacmlPdpArtifactForwarderParameterGroup; -import org.onap.policy.distribution.forwarding.xacml.pdp.XacmlPdpArtifactForwarderParameterGroup.XacmlPdpArtifactForwarderParameterGroupBuilder; +import org.onap.policy.distribution.forwarding.k8s.K8sArtifactForwarderParameterGroup; +import org.onap.policy.distribution.forwarding.k8s.K8sArtifactForwarderParameterGroup.K8sArtifactForwarderParameterGroupBuilder; -public class XacmlPdpArtifactForwarderParameterGroupTest { +public class K8sArtifactForwarderParameterGroupTest { @Test public void testBuilderAndGetters() { - XacmlPdpArtifactForwarderParameterGroupBuilder builder = - new XacmlPdpArtifactForwarderParameterGroupBuilder(); - XacmlPdpArtifactForwarderParameterGroup configurationParameters = + K8sArtifactForwarderParameterGroupBuilder builder = + new K8sArtifactForwarderParameterGroupBuilder(); + K8sArtifactForwarderParameterGroup configurationParameters = builder.setUseHttps(true).setHostname("10.10.10.10").setPort(1234).setUserName("myUser") .setPassword("myPassword").setClientAuth("myClientAuth").setIsManaged(false).build(); @@ -50,9 +50,9 @@ public class XacmlPdpArtifactForwarderParameterGroupTest { @Test public void testInvalidHostName() { - XacmlPdpArtifactForwarderParameterGroupBuilder builder = - new XacmlPdpArtifactForwarderParameterGroupBuilder(); - XacmlPdpArtifactForwarderParameterGroup configurationParameters = builder.setUseHttps(true).setHostname("") + K8sArtifactForwarderParameterGroupBuilder builder = + new K8sArtifactForwarderParameterGroupBuilder(); + K8sArtifactForwarderParameterGroup configurationParameters = builder.setUseHttps(true).setHostname("") .setPort(1234).setUserName("myUser").setPassword("myPassword").setIsManaged(false).build(); configurationParameters.setName("myConfiguration"); @@ -61,9 +61,9 @@ public class XacmlPdpArtifactForwarderParameterGroupTest { @Test public void testInvalidPort() { - XacmlPdpArtifactForwarderParameterGroupBuilder builder = - new XacmlPdpArtifactForwarderParameterGroupBuilder(); - XacmlPdpArtifactForwarderParameterGroup configurationParameters = + K8sArtifactForwarderParameterGroupBuilder builder = + new K8sArtifactForwarderParameterGroupBuilder(); + K8sArtifactForwarderParameterGroup configurationParameters = builder.setUseHttps(true).setHostname("10.10.10.10").setPort(-1234).setUserName("myUser") .setPassword("myPassword").setIsManaged(false).build(); configurationParameters.setName("myConfiguration"); @@ -73,9 +73,9 @@ public class XacmlPdpArtifactForwarderParameterGroupTest { @Test public void testInvalidUserName() { - XacmlPdpArtifactForwarderParameterGroupBuilder builder = - new XacmlPdpArtifactForwarderParameterGroupBuilder(); - XacmlPdpArtifactForwarderParameterGroup configurationParameters = + K8sArtifactForwarderParameterGroupBuilder builder = + new K8sArtifactForwarderParameterGroupBuilder(); + K8sArtifactForwarderParameterGroup configurationParameters = builder.setUseHttps(true).setHostname("10.10.10.10").setPort(1234).setUserName("") .setPassword("myPassword").setIsManaged(false).build(); configurationParameters.setName("myConfiguration"); @@ -85,9 +85,9 @@ public class XacmlPdpArtifactForwarderParameterGroupTest { @Test public void testInvalidPassword() { - XacmlPdpArtifactForwarderParameterGroupBuilder builder = - new XacmlPdpArtifactForwarderParameterGroupBuilder(); - XacmlPdpArtifactForwarderParameterGroup configurationParameters = + K8sArtifactForwarderParameterGroupBuilder builder = + new K8sArtifactForwarderParameterGroupBuilder(); + K8sArtifactForwarderParameterGroup configurationParameters = builder.setUseHttps(true).setHostname("10.10.10.10").setPort(1234).setUserName("myUser").setPassword("") .setIsManaged(false).build(); configurationParameters.setName("myConfiguration"); diff --git a/artifactbroker/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/xacml/pdp/engine/XacmlPdpArtifactForwarderTest.java b/artifactbroker/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/k8s/engine/K8sArtifactForwarderTest.java index bad34c5..58c9c69 100644 --- a/artifactbroker/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/xacml/pdp/engine/XacmlPdpArtifactForwarderTest.java +++ b/artifactbroker/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/k8s/engine/K8sArtifactForwarderTest.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.distribution.forwarding.xacml.pdp.engine; +package org.onap.policy.distribution.forwarding.k8.engine; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -64,8 +64,8 @@ import org.junit.Test; import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams; import org.onap.policy.common.parameters.ParameterGroup; import org.onap.policy.common.parameters.ParameterService; -import org.onap.policy.distribution.forwarding.xacml.pdp.XacmlPdpArtifactForwarder; -import org.onap.policy.distribution.forwarding.xacml.pdp.XacmlPdpArtifactForwarderParameterGroup.XacmlPdpArtifactForwarderParameterGroupBuilder; +import org.onap.policy.distribution.forwarding.k8s.K8sArtifactForwarder; +import org.onap.policy.distribution.forwarding.k8s.K8sArtifactForwarderParameterGroup.K8sArtifactForwarderParameterGroupBuilder; import org.onap.policy.distribution.main.PolicyDistributionException; import org.onap.policy.distribution.model.CloudArtifact; import org.onap.policy.distribution.model.GsonUtil; @@ -74,7 +74,7 @@ import org.onap.policy.distribution.model.VfModuleModel; import org.onap.sdc.api.notification.IArtifactInfo; -public class XacmlPdpArtifactForwarderTest { +public class K8sArtifactForwarderTest { private static final BusTopicParams BUS_TOPIC_PARAMS = BusTopicParams.builder().useHttps(false).hostname("myHost") .port(1234).userName("myUser").password("myPassword").managed(true).build(); @@ -89,7 +89,7 @@ public class XacmlPdpArtifactForwarderTest { */ @BeforeClass public static void setUp() { - ParameterGroup parameterGroup = new XacmlPdpArtifactForwarderParameterGroupBuilder() + ParameterGroup parameterGroup = new K8sArtifactForwarderParameterGroupBuilder() .setUseHttps(BUS_TOPIC_PARAMS.isUseHttps()).setHostname(BUS_TOPIC_PARAMS.getHostname()) .setPort(BUS_TOPIC_PARAMS.getPort()).setUserName(BUS_TOPIC_PARAMS.getUserName()) .setPassword(BUS_TOPIC_PARAMS.getPassword()).setClientAuth(CLIENT_AUTH_VALUE) @@ -117,7 +117,7 @@ public class XacmlPdpArtifactForwarderTest { when(httpClientMock.execute(anyObject())).thenReturn(response); - XacmlPdpArtifactForwarder forwarder = new XacmlPdpArtifactForwarder(); + K8sArtifactForwarder forwarder = new K8sArtifactForwarder(); forwarder.configure("xacmlPdpConfiguration"); diff --git a/artifactbroker/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/xacml/pdp/testclasses/DummyReceptionHandler.java b/artifactbroker/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/k8s/testclasses/DummyReceptionHandler.java index c093481..6996bfd 100644 --- a/artifactbroker/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/xacml/pdp/testclasses/DummyReceptionHandler.java +++ b/artifactbroker/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/k8s/testclasses/DummyReceptionHandler.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.distribution.forwarding.xacml.pdp.testclasses; +package org.onap.policy.distribution.forwarding.k8s.testclasses; import org.onap.policy.distribution.reception.handling.AbstractReceptionHandler; diff --git a/artifactbroker/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java b/artifactbroker/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java index c00bfa1..86680c6 100644 --- a/artifactbroker/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java +++ b/artifactbroker/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java @@ -53,6 +53,9 @@ public abstract class AbstractReceptionHandler implements ReceptionHandler { final ReceptionHandlerParameters receptionHandlerParameters = ParameterService.get(parameterGroupName); pluginHandler = new PluginHandler(receptionHandlerParameters.getPluginHandlerParameters().getName()); initializeReception(receptionHandlerParameters.getReceptionHandlerConfigurationName()); + LOGGER.debug("Policy distribution , parameterGroupName = " + parameterGroupName); + LOGGER.debug("Policy distribution , pluginhandler name = " + receptionHandlerParameters.getPluginHandlerParameters().getName()); + LOGGER.debug("Policy distribution , recetipionhandler name = " + receptionHandlerParameters.getReceptionHandlerConfigurationName()); } /** |