diff options
author | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2020-05-19 16:37:06 +0200 |
---|---|---|
committer | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2020-05-19 16:39:17 +0200 |
commit | 93fa0f8e4d58f4dd9043db8798765e4c15e38434 (patch) | |
tree | 571a168c6144e3ed21f46ab2be0a150dadd03c4c /sdnr/wt/mountpoint-registrar/provider/src/main/java | |
parent | 02c2ad26a25bcc58eb45b70d8d4cf7d2ef035e4e (diff) |
Include secure communication to DMaaP
Include secure communication from mountpoint-registrar to DMaaP for PNF Registration and fault VES messages consumption
Issue-ID: SDNC-1190
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Change-Id: I4f8c74f5179b55d6f3bcedcb02727239e56a7f42
Diffstat (limited to 'sdnr/wt/mountpoint-registrar/provider/src/main/java')
4 files changed, 56 insertions, 39 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); } |