diff options
Diffstat (limited to 'sdnr/wt/mountpoint-registrar/provider/src/main')
5 files changed, 56 insertions, 61 deletions
diff --git a/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPVESMsgConsumerMain.java b/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPVESMsgConsumerMain.java index 10bffe44c..6d608bf05 100644 --- a/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPVESMsgConsumerMain.java +++ b/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPVESMsgConsumerMain.java @@ -18,8 +18,6 @@ package org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl; -import java.io.File; -import java.io.FileInputStream; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -62,6 +60,9 @@ public class DMaaPVESMsgConsumerMain implements Runnable { consumerProperties.put(PNFRegistrationConfig.PROPERTY_KEY_CONSUMER_TIMEOUT, pnfRegistrationConfig.getTimeout()); consumerProperties.put(PNFRegistrationConfig.PROPERTY_KEY_CONSUMER_LIMIT, pnfRegistrationConfig.getLimit()); consumerProperties.put(PNFRegistrationConfig.PROPERTY_KEY_CONSUMER_FETCHPAUSE, pnfRegistrationConfig.getFetchPause()); + consumerProperties.put(PNFRegistrationConfig.PROPERTY_KEY_CONSUMER_PROTOCOL, pnfRegistrationConfig.getProtocol()); + consumerProperties.put(PNFRegistrationConfig.PROPERTY_KEY_CONSUMER_USERNAME, pnfRegistrationConfig.getUsername()); + consumerProperties.put(PNFRegistrationConfig.PROPERTY_KEY_CONSUMER_PASSWORD, pnfRegistrationConfig.getPassword()); } else if (domain.equalsIgnoreCase("fault")) { this.faultConfig = (FaultConfig) domainConfig; consumerClass = faultConfig.getConsumerClass(); @@ -75,6 +76,9 @@ public class DMaaPVESMsgConsumerMain implements Runnable { consumerProperties.put(FaultConfig.PROPERTY_KEY_CONSUMER_TIMEOUT, faultConfig.getTimeout()); consumerProperties.put(FaultConfig.PROPERTY_KEY_CONSUMER_LIMIT, faultConfig.getLimit()); consumerProperties.put(FaultConfig.PROPERTY_KEY_CONSUMER_FETCHPAUSE, faultConfig.getFetchPause()); + consumerProperties.put(FaultConfig.PROPERTY_KEY_CONSUMER_PROTOCOL, faultConfig.getProtocol()); + consumerProperties.put(FaultConfig.PROPERTY_KEY_CONSUMER_USERNAME, faultConfig.getUsername()); + consumerProperties.put(FaultConfig.PROPERTY_KEY_CONSUMER_PASSWORD, faultConfig.getPassword()); } if (consumerClass != null) { diff --git a/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/FaultConfig.java b/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/FaultConfig.java index b04ba315b..90757e6d5 100644 --- a/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/FaultConfig.java +++ b/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/FaultConfig.java @@ -28,9 +28,18 @@ public class FaultConfig implements Configuration { public static final String PROPERTY_KEY_CONSUMER_TRANSPORTTYPE = "TransportType"; private static final String DEFAULT_VALUE_CONSUMER_TRANSPORTTYPE = "HTTPNOAUTH"; + + public static final String PROPERTY_KEY_CONSUMER_PROTOCOL = "Protocol"; + private static final String DEFAULT_VALUE_CONSUMER_PROTOCOL = "http"; + + public static final String PROPERTY_KEY_CONSUMER_USERNAME = "username"; + private static final String DEFAULT_VALUE_CONSUMER_USERNAME = "username"; + + public static final String PROPERTY_KEY_CONSUMER_PASSWORD = "password"; + private static final String DEFAULT_VALUE_CONSUMER_PASSWORD = "password"; public static final String PROPERTY_KEY_CONSUMER_HOST_PORT = "host"; - private static final String DEFAULT_VALUE_CONSUMER_HOST_PORT = "onap-dmap:3904"; + private static final String DEFAULT_VALUE_CONSUMER_HOST_PORT = "onap-dmaap:3904"; public static final String PROPERTY_KEY_CONSUMER_TOPIC = "topic"; private static final String DEFAULT_VALUE_CONSUMER_TOPIC = "unauthenticated.SEC_FAULT_OUTPUT"; @@ -71,6 +80,9 @@ public class FaultConfig implements Configuration { configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_CONSUMER_CLASS, DEFAULT_VALUE_CONSUMER_CLASS); configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_CONSUMER_TRANSPORTTYPE, DEFAULT_VALUE_CONSUMER_TRANSPORTTYPE); + configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_CONSUMER_PROTOCOL, DEFAULT_VALUE_CONSUMER_PROTOCOL); + configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_CONSUMER_USERNAME, DEFAULT_VALUE_CONSUMER_USERNAME); + configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_CONSUMER_PASSWORD, DEFAULT_VALUE_CONSUMER_PASSWORD); configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_CONSUMER_HOST_PORT, DEFAULT_VALUE_CONSUMER_HOST_PORT); configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_CONSUMER_TOPIC, DEFAULT_VALUE_CONSUMER_TOPIC); configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_CONSUMER_CONTENTTYPE, DEFAULT_VALUE_CONSUMER_CONTENTTYPE); @@ -94,6 +106,18 @@ public class FaultConfig implements Configuration { return configuration.getProperty(SECTION_MARKER, PROPERTY_KEY_CONSUMER_TRANSPORTTYPE); } + public String getProtocol() { + return configuration.getProperty(SECTION_MARKER, PROPERTY_KEY_CONSUMER_PROTOCOL); + } + + public String getUsername() { + return configuration.getProperty(SECTION_MARKER, PROPERTY_KEY_CONSUMER_USERNAME); + } + + public String getPassword() { + return configuration.getProperty(SECTION_MARKER, PROPERTY_KEY_CONSUMER_PASSWORD); + } + public String getTopic() { return configuration.getProperty(SECTION_MARKER, PROPERTY_KEY_CONSUMER_TOPIC); } diff --git a/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/MountpointRegistrarImpl.java b/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/MountpointRegistrarImpl.java index f10cb1af7..1155462c4 100644 --- a/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/MountpointRegistrarImpl.java +++ b/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/MountpointRegistrarImpl.java @@ -25,15 +25,10 @@ import java.util.Map; import org.onap.ccsdk.features.sdnr.wt.common.configuration.Configuration; import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation; import org.onap.ccsdk.features.sdnr.wt.common.configuration.filechange.IConfigChangedListener; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.md.sal.binding.api.MountPointService; -import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -@SuppressWarnings("deprecation") public class MountpointRegistrarImpl implements AutoCloseable, IConfigChangedListener { private static final Logger LOG = LoggerFactory.getLogger(MountpointRegistrarImpl.class); @@ -41,16 +36,6 @@ public class MountpointRegistrarImpl implements AutoCloseable, IConfigChangedLis private static final String CONFIGURATIONFILE = "etc/mountpoint-registrar.properties"; private Thread dmaapVESMsgConsumerMain = null; - @SuppressWarnings("unused") - private DataBroker dataBroker = null; - @SuppressWarnings("unused") - private MountPointService mountPointService = null; - @SuppressWarnings("unused") - private RpcProviderRegistry rpcProviderRegistry = null; - @SuppressWarnings("unused") - private NotificationPublishService notificationPublishService = null; - @SuppressWarnings("unused") - private ClusterSingletonServiceProvider clusterSingletonServiceProvider; private GeneralConfig generalConfig; private boolean dmaapEnabled = false; @@ -61,26 +46,6 @@ public class MountpointRegistrarImpl implements AutoCloseable, IConfigChangedLis LOG.info("Creating provider class for {}", APPLICATION_NAME); } - public void setDataBroker(DataBroker dataBroker) { - this.dataBroker = dataBroker; - } - - public void setRpcProviderRegistry(RpcProviderRegistry rpcProviderRegistry) { - this.rpcProviderRegistry = rpcProviderRegistry; - } - - public void setNotificationPublishService(NotificationPublishService notificationPublishService) { - this.notificationPublishService = notificationPublishService; - } - - public void setMountPointService(MountPointService mountPointService) { - this.mountPointService = mountPointService; - } - - public void setClusterSingletonService(ClusterSingletonServiceProvider clusterSingletonService) { - this.clusterSingletonServiceProvider = clusterSingletonService; - } - public void init() { LOG.info("Init call for {}", APPLICATION_NAME); diff --git a/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/PNFRegistrationConfig.java b/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/PNFRegistrationConfig.java index 8a3ded50d..26ece6b6d 100644 --- a/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/PNFRegistrationConfig.java +++ b/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/PNFRegistrationConfig.java @@ -29,9 +29,18 @@ public class PNFRegistrationConfig implements Configuration { public static final String PROPERTY_KEY_CONSUMER_TRANSPORTTYPE = "TransportType"; private static final String DEFAULT_VALUE_CONSUMER_TRANSPORTTYPE = "HTTPNOAUTH"; + + public static final String PROPERTY_KEY_CONSUMER_PROTOCOL = "Protocol"; + private static final String DEFAULT_VALUE_CONSUMER_PROTOCOL = "http"; + + public static final String PROPERTY_KEY_CONSUMER_USERNAME = "username"; + private static final String DEFAULT_VALUE_CONSUMER_USERNAME = "username"; + + public static final String PROPERTY_KEY_CONSUMER_PASSWORD = "password"; + private static final String DEFAULT_VALUE_CONSUMER_PASSWORD = "password"; public static final String PROPERTY_KEY_CONSUMER_HOST_PORT = "host"; - private static final String DEFAULT_VALUE_CONSUMER_HOST_PORT = "onap-dmap:3904"; + private static final String DEFAULT_VALUE_CONSUMER_HOST_PORT = "onap-dmaap:3904"; public static final String PROPERTY_KEY_CONSUMER_TOPIC = "topic"; private static final String DEFAULT_VALUE_CONSUMER_TOPIC = "unauthenticated.VES_PNFREG_OUTPUT"; @@ -71,6 +80,9 @@ public class PNFRegistrationConfig implements Configuration { configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_CONSUMER_CLASS, DEFAULT_VALUE_CONSUMER_CLASS); configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_CONSUMER_TRANSPORTTYPE, DEFAULT_VALUE_CONSUMER_TRANSPORTTYPE); + configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_CONSUMER_PROTOCOL, DEFAULT_VALUE_CONSUMER_PROTOCOL); + configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_CONSUMER_USERNAME, DEFAULT_VALUE_CONSUMER_USERNAME); + configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_CONSUMER_PASSWORD, DEFAULT_VALUE_CONSUMER_PASSWORD); configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_CONSUMER_HOST_PORT, DEFAULT_VALUE_CONSUMER_HOST_PORT); configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_CONSUMER_TOPIC, DEFAULT_VALUE_CONSUMER_TOPIC); configuration.setPropertyIfNotAvailable(SECTION_MARKER, PROPERTY_KEY_CONSUMER_CONTENTTYPE, DEFAULT_VALUE_CONSUMER_CONTENTTYPE); @@ -94,6 +106,18 @@ public class PNFRegistrationConfig implements Configuration { return configuration.getProperty(SECTION_MARKER, PROPERTY_KEY_CONSUMER_TRANSPORTTYPE); } + public String getProtocol() { + return configuration.getProperty(SECTION_MARKER, PROPERTY_KEY_CONSUMER_PROTOCOL); + } + + public String getUsername() { + return configuration.getProperty(SECTION_MARKER, PROPERTY_KEY_CONSUMER_USERNAME); + } + + public String getPassword() { + return configuration.getProperty(SECTION_MARKER, PROPERTY_KEY_CONSUMER_PASSWORD); + } + public String getTopic() { return configuration.getProperty(SECTION_MARKER, PROPERTY_KEY_CONSUMER_TOPIC); } diff --git a/sdnr/wt/mountpoint-registrar/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml b/sdnr/wt/mountpoint-registrar/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml index a286d43d8..ba4b2542a 100644 --- a/sdnr/wt/mountpoint-registrar/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml +++ b/sdnr/wt/mountpoint-registrar/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml @@ -26,29 +26,7 @@ <blueprint xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0" xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" odl:use-default-for-reference-types="true"> - <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" - odl:type="default"/> - - <reference id="notificationPublishService" - interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService" - odl:type="default"/> - - <reference id="mountPointService" - interface="org.opendaylight.controller.md.sal.binding.api.MountPointService" - odl:type="default"/> - - <reference id="rpcProviderRegistry" interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry" - odl:type="default"/> - - <reference id="clusterSingletonService" - interface="org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider"/> - <bean id="provider" class="org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.MountpointRegistrarImpl" init-method="init" destroy-method="close"> - <property name="dataBroker" ref="dataBroker"/> - <property name="rpcProviderRegistry" ref="rpcProviderRegistry"/> - <property name="notificationPublishService" ref="notificationPublishService"/> - <property name="mountPointService" ref="mountPointService"/> - <property name="clusterSingletonService" ref="clusterSingletonService"/> </bean> </blueprint> |