From a5498e53ed66e74fcbf2141e969433920b877282 Mon Sep 17 00:00:00 2001 From: Niranjana Date: Thu, 16 Sep 2021 09:05:06 +0000 Subject: Modify cm-handle feature Issue-ID: CCSDK-3342 Signed-off-by: Niranjana Change-Id: Id25c420ee7a0020c634d37f7afc354bed8dfcf6b --- sdnr/northbound/addCMHandle/feature/pom.xml | 92 +---------- sdnr/northbound/addCMHandle/installer/pom.xml | 12 +- .../src/assembly/assemble_mvnrepo_zip.xml | 8 +- sdnr/northbound/addCMHandle/model/pom.xml | 69 ++++---- sdnr/northbound/addCMHandle/pom.xml | 8 +- sdnr/northbound/addCMHandle/provider/pom.xml | 113 +++++++++---- .../addCMHandle/AddCMHandleProvider.java | 176 ++++++++++++++++++--- .../sdnr/northbound/impl/AddCMHandleProvider.java | 91 ----------- .../src/main/resources/cm-handle.properties | 6 +- .../org/opendaylight/blueprint/impl-blueprint.xml | 37 +++-- .../addCMHandle/AddCMHandleProviderTest.java | 10 +- 11 files changed, 323 insertions(+), 299 deletions(-) delete mode 100644 sdnr/northbound/addCMHandle/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/impl/AddCMHandleProvider.java (limited to 'sdnr/northbound') diff --git a/sdnr/northbound/addCMHandle/feature/pom.xml b/sdnr/northbound/addCMHandle/feature/pom.xml index 2bae14acb..1e10acddd 100644 --- a/sdnr/northbound/addCMHandle/feature/pom.xml +++ b/sdnr/northbound/addCMHandle/feature/pom.xml @@ -19,12 +19,13 @@ ~ ============LICENSE_END======================================================= ~ --> - + + 4.0.0 org.onap.ccsdk.parent - feature-repo-parent + single-feature-parent 2.2.1 @@ -36,96 +37,11 @@ ccsdk-features :: sdnr-northbound :: ${project.artifactId} - - - - org.opendaylight.controller - mdsal-artifacts - 1.6.1 - pom - import - - - - - org.onap.ccsdk.features.sdnr.northbound - addCMHandle-model - ${project.version} - - - org.onap.ccsdk.features.sdnr.northbound + ${project.groupId} addCMHandle-provider ${project.version} - - org.onap.ccsdk.sli.core - sli-common - ${ccsdk.sli.version} - compile - - - org.onap.ccsdk.sli.core - sli-provider - ${ccsdk.sli.version} - compile - - - org.onap.ccsdk.sli.core - utils-provider - ${ccsdk.sli.version} - - - org.apache.velocity - velocity-engine-core - - - commons-codec - commons-codec - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.codehaus.mojo - properties-maven-plugin - [1.0.0,) - - set-system-properties - - - - - - - - - org.apache.karaf.tooling - karaf-maven-plugin - [4.0.0,) - - features-generate-descriptor - - - - - - - - - - - - - diff --git a/sdnr/northbound/addCMHandle/installer/pom.xml b/sdnr/northbound/addCMHandle/installer/pom.xml index 4ea1e5e41..41c14d08b 100755 --- a/sdnr/northbound/addCMHandle/installer/pom.xml +++ b/sdnr/northbound/addCMHandle/installer/pom.xml @@ -19,7 +19,8 @@ ~ ============LICENSE_END======================================================= ~ --> - + + 4.0.0 @@ -42,15 +43,10 @@ - - org.opendaylight.controller - sal-binding-broker-impl - 1.11.3 - test - + org.onap.ccsdk.features.sdnr.northbound - addCMHandle-feature + ${application.name}-feature ${project.version} xml features diff --git a/sdnr/northbound/addCMHandle/installer/src/assembly/assemble_mvnrepo_zip.xml b/sdnr/northbound/addCMHandle/installer/src/assembly/assemble_mvnrepo_zip.xml index fcfb7aa8a..c0eacf9a7 100644 --- a/sdnr/northbound/addCMHandle/installer/src/assembly/assemble_mvnrepo_zip.xml +++ b/sdnr/northbound/addCMHandle/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -2,7 +2,7 @@ ~ ============LICENSE_START======================================================= ~ ONAP : ccsdk features ~ ================================================================================ - ~ Copyright (C) 2021 Wipro Limited. + ~ Copyright (C) 2021 Wipro Limited. ~ ================================================================================ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -19,16 +19,20 @@ ~ --> + - bin + repo zip + false diff --git a/sdnr/northbound/addCMHandle/model/pom.xml b/sdnr/northbound/addCMHandle/model/pom.xml index b472dbd99..57a70e36a 100644 --- a/sdnr/northbound/addCMHandle/model/pom.xml +++ b/sdnr/northbound/addCMHandle/model/pom.xml @@ -19,7 +19,8 @@ ~ ============LICENSE_END======================================================= ~ --> - + + 4.0.0 @@ -38,44 +39,40 @@ - org.opendaylight.mdsal.model - ietf-inet-types - 2010.09.24.12.4 + org.opendaylight.mdsal.binding.model.ietf + rfc6991 + + + org.opendaylight.mdsal.binding.model.ietf + rfc6991-ietf-inet-types + + + org.opendaylight.netconf + sal-netconf-connector + provided - org.opendaylight.mdsal.model - ietf-yang-types - 2010.09.24.12.4 + org.opendaylight.mdsal.binding.model.ietf + rfc6991-ietf-yang-types + provided - + + + - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.codehaus.mojo - properties-maven-plugin - [1.0.0,) - - set-system-properties - - - - - - - - - - - - + + + org.jacoco + jacoco-maven-plugin + + + **/gen/** + **/generated-sources/** + **/yang-gen-sal/** + **/pax/** + + + + diff --git a/sdnr/northbound/addCMHandle/pom.xml b/sdnr/northbound/addCMHandle/pom.xml index 9c33e676a..9e25b9155 100644 --- a/sdnr/northbound/addCMHandle/pom.xml +++ b/sdnr/northbound/addCMHandle/pom.xml @@ -19,7 +19,8 @@ ~ ============LICENSE_END======================================================= ~ --> - + + 4.0.0 @@ -34,7 +35,7 @@ 1.0.0-SNAPSHOT pom - ccsdk-features :: sdnr-northbound :: addCMHandle + ccsdk-features :: sdnr-northbound :: ${project.artifactId} model @@ -44,7 +45,6 @@ - addCMHandle-features + addCMHandle - diff --git a/sdnr/northbound/addCMHandle/provider/pom.xml b/sdnr/northbound/addCMHandle/provider/pom.xml index 242aeca63..c0bc47f72 100644 --- a/sdnr/northbound/addCMHandle/provider/pom.xml +++ b/sdnr/northbound/addCMHandle/provider/pom.xml @@ -19,7 +19,8 @@ ~ ============LICENSE_END======================================================= ~ --> - + + 4.0.0 @@ -36,18 +37,6 @@ ccsdk-features :: sdnr-northbound :: ${project.artifactId} - - - - org.opendaylight.controller - mdsal-artifacts - 1.6.1 - pom - import - - - - org.onap.ccsdk.features.sdnr.northbound @@ -55,20 +44,12 @@ ${project.version} - org.opendaylight.controller - sal-binding-config - - - org.opendaylight.controller - sal-binding-api + org.opendaylight.mdsal + mdsal-binding-api - org.opendaylight.controller - sal-common-util - - - org.opendaylight.controller - sal-core-api + org.opendaylight.mdsal + mdsal-dom-api org.opendaylight.yangtools @@ -77,7 +58,11 @@ junit junit - + test + + + org.testng + testng test @@ -86,14 +71,77 @@ test - com.sun.jersey - jersey-client - 1.19.4 + org.apache.derby + derby + test + + + org.onap.ccsdk.sli.core + sli-common + ${ccsdk.sli.version} + provided + + + org.onap.ccsdk.sli.core + sli-provider + ${ccsdk.sli.version} + provided + org.onap.ccsdk.sli.core + utils-provider + ${ccsdk.sli.version} + + + org.osgi + org.osgi.core + test + + + org.onap.ccsdk.sli.core + sli-provider-base + ${ccsdk.sli.version} + provided + + + org.onap.ccsdk.features.sdnr.wt + sdnr-wt-netconfnode-state-service-model + 1.2.0 + + + javax + javaee-web-api + 6.0 + provided + + com.sun.jersey - jersey-core + jersey-bundle 1.19.4 + + + org.opendaylight.mdsal.model + ietf-topology + + + org.opendaylight.netconf + sal-netconf-connector + provided + + + org.opendaylight.mdsal.binding.model.ietf + rfc6991-ietf-yang-types + provided + + + org.opendaylight.mdsal + yang-binding + provided + + + org.opendaylight.mdsal + mdsal-singleton-common-api + provided @@ -123,9 +171,8 @@ - - + + - diff --git a/sdnr/northbound/addCMHandle/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/addCMHandle/AddCMHandleProvider.java b/sdnr/northbound/addCMHandle/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/addCMHandle/AddCMHandleProvider.java index 013e71440..1756615cb 100644 --- a/sdnr/northbound/addCMHandle/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/addCMHandle/AddCMHandleProvider.java +++ b/sdnr/northbound/addCMHandle/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/addCMHandle/AddCMHandleProvider.java @@ -20,49 +20,120 @@ package org.onap.ccsdk.features.sdnr.northbound.addCMHandle; +import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION; + import com.google.common.base.Preconditions; import com.google.common.util.concurrent.ListenableFuture; - -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import com.sun.jersey.api.client.Client; +import com.sun.jersey.api.client.ClientResponse; +import com.sun.jersey.api.client.WebResource; +import com.sun.jersey.api.client.config.ClientConfig; +import com.sun.jersey.api.client.config.DefaultClientConfig; +import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Properties; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import javax.ws.rs.HttpMethod; +import javax.ws.rs.core.MediaType; + +import org.eclipse.jdt.annotation.NonNull; +import org.json.JSONObject; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfNodeStateListener; +import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; +import org.opendaylight.mdsal.binding.api.DataBroker; +import org.opendaylight.mdsal.binding.api.DataObjectModification; +import org.opendaylight.mdsal.binding.api.DataTreeChangeListener; +import org.opendaylight.mdsal.binding.api.DataTreeIdentifier; +import org.opendaylight.mdsal.binding.api.DataTreeModification; +import org.opendaylight.mdsal.binding.api.NotificationPublishService; +import org.opendaylight.mdsal.binding.api.RpcProviderService; +import org.opendaylight.mdsal.dom.api.DOMDataBroker; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev210615.AddCMHandleInput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev210615.AddCMHandleOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev210615.CMHandleAPIService; +import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode; +import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.network.topology.topology.topology.types.TopologyNetconf; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; +import org.opendaylight.yangtools.concepts.ListenerRegistration; +import org.opendaylight.yangtools.concepts.ObjectRegistration; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.common.RpcResultBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class AddCMHandleProvider implements CMHandleAPIService { +public class AddCMHandleProvider implements CMHandleAPIService, NetconfNodeStateListener, AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(AddCMHandleProvider.class); - - private final String appName = "addCMHandle"; - - private final DataBroker dataBroker; - private final RpcProviderRegistry rpcProviderRegistry; - private RpcRegistration serviceRegistration; - + private final String APPLICATION_NAME = "addCMHandle"; private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; private static final String PROPERTIES_FILE_NAME = "cm-handle.properties"; private static final String PARSING_ERROR = "Could not create the request message to send to the server; no message will be sent"; + private final ExecutorService executor; + protected DataBroker dataBroker; + protected DOMDataBroker domDataBroker; + protected NotificationPublishService notificationService; + protected RpcProviderService rpcProviderRegistry; + private ObjectRegistration rpcRegistration; + public static final InstanceIdentifier NETCONF_TOPO_IID = InstanceIdentifier.create(NetworkTopology.class) + .child(Topology.class, new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName()))); + private static HashMap config; + + public AddCMHandleProvider() { + + LOG.info("Creating provider for {}", APPLICATION_NAME); + executor = Executors.newFixedThreadPool(1); + this.dataBroker = null; + this.domDataBroker = null; + this.notificationService = null; + this.rpcProviderRegistry = null; + this.rpcRegistration = null; + } - public AddCMHandleProvider(final DataBroker dataBroker, RpcProviderRegistry rpcProviderRegistry) { + public void setDataBroker(DataBroker dataBroker) { this.dataBroker = dataBroker; - this.rpcProviderRegistry = rpcProviderRegistry; } - /** - * Method called when the blueprint container is created. - */ - public void init() { - serviceRegistration = rpcProviderRegistry.addRpcImplementation(CMHandleAPIService.class, this); + public void setDomDataBroker(DOMDataBroker domDataBroker) { + this.domDataBroker = domDataBroker; + } - LOG.debug("Initializing provider for " + appName); + public void setRpcProviderRegistry(RpcProviderService rpcProviderRegistry) { + this.rpcProviderRegistry = rpcProviderRegistry; + } - Preconditions.checkNotNull(dataBroker, "dataBroker must be set"); + public void setNotificationPublishService(NotificationPublishService notificationPublishService) { + this.notificationService = notificationPublishService; + } + + public void init() { + LOG.info("Initializing {} for {}", this.getClass().getName(), APPLICATION_NAME); + + if (rpcRegistration == null) { + if (rpcProviderRegistry != null) { + rpcRegistration = rpcProviderRegistry.registerRpcImplementation(CMHandleAPIService.class, this); + LOG.info("Initialization complete for {}", APPLICATION_NAME); + } else { + LOG.warn("Error initializing {} : rpcRegistry unset", APPLICATION_NAME); + } + } String propDir = System.getenv(SDNC_CONFIG_DIR); if (propDir == null) { @@ -72,13 +143,74 @@ public class AddCMHandleProvider implements CMHandleAPIService { propDir = propDir + "/"; } - LOG.debug("Initialization complete for " + appName); + // GET configuration from properties file + config = new HashMap(); + + try { + FileInputStream fileInput = new FileInputStream(propDir + PROPERTIES_FILE_NAME); + Properties properties = new Properties(); + properties.load(fileInput); + fileInput.close(); + + for (String param : new String[] {"url", "user", "password", + "authentication, dmi-service-name"}) { + config.put(param, properties.getProperty(param)); + } + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + + LOG.info("addCMHandle Session Initiated"); + } + + @Override + public void onCreated(NodeId nNodeId, NetconfNode netconfNode) { + LOG.info("NetConf device connected ", nNodeId.getValue()); + JSONObject obj = new JSONObject(); + obj.put("cm-handle-id", nNodeId.getValue()); + obj.put("dmi-service-name", config.get("dmi-service-name")); + ClientConfig dmaapClientConfig = new DefaultClientConfig(); + dmaapClientConfig.getProperties().put(ClientConfig.PROPERTY_READ_TIMEOUT, 180000); + dmaapClientConfig.getProperties().put(ClientConfig.PROPERTY_CONNECT_TIMEOUT, 60000); + Client dmaapClient = Client.create(dmaapClientConfig); + String authenticationMethod = config.get("authentication"); + ClientResponse response = null; + try { + if (authenticationMethod.equals("basic")) { + LOG.debug("Sending message to dmaap-message-router: {}", obj.toString()); + dmaapClient.addFilter(new HTTPBasicAuthFilter(config.get("user"), config.get("password"))); + + response = dmaapClient.resource(config.get("url")).type(MediaType.APPLICATION_JSON) + .accept(MediaType.APPLICATION_JSON).post(ClientResponse.class, obj); + } else { + response = dmaapClient.resource(config.get("url")).type(MediaType.APPLICATION_JSON) + .accept(MediaType.APPLICATION_JSON).post(ClientResponse.class, obj); + } + } catch (Exception e) { + LOG.error("Error while posting message to CM_HANDLE topic: {}", e); + } + + LOG.info("Received response from dmaap-message-router: \n {}", response.toString()); + } + + @Override + public void onRemoved(NodeId nNodeId) { + + LOG.info("NetConf device removed - nNodeId = {}", nNodeId); + } + + @Override + public void onStateChange(NodeId nNodeId, NetconfNode netconfNode) { + LOG.info("NetConf device state changed nNodeId = {}}", nNodeId); } /** * Method called when the blueprint container is destroyed. */ public void close() { + rpcRegistration.close(); LOG.debug("AddCMHandleProvider Closed"); } diff --git a/sdnr/northbound/addCMHandle/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/impl/AddCMHandleProvider.java b/sdnr/northbound/addCMHandle/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/impl/AddCMHandleProvider.java deleted file mode 100644 index 6e59e072d..000000000 --- a/sdnr/northbound/addCMHandle/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/impl/AddCMHandleProvider.java +++ /dev/null @@ -1,91 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP : CCSDK - * ================================================================================ - * Copyright (C) 2021 Wipro Limited. - * ================================================================================ - * 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. - * ============LICENSE_END========================================================= - */ - -package org.onap.ccsdk.features.sdnr.northbound.impl; - -import com.google.common.base.Preconditions; -import com.google.common.util.concurrent.ListenableFuture; - -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev210615.AddCMHandleInput; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev210615.AddCMHandleOutput; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev210615.CMHandleAPIService; -import org.opendaylight.yangtools.yang.common.RpcResult; -import org.opendaylight.yangtools.yang.common.RpcResultBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AddCMHandleProvider implements CMHandleAPIService { - - private static final Logger LOG = LoggerFactory.getLogger(AddCMHandleProvider.class); - - private final String appName = "addCMHandle"; - - private final DataBroker dataBroker; - private final RpcProviderRegistry rpcProviderRegistry; - private RpcRegistration serviceRegistration; - - private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; - private static final String PROPERTIES_FILE_NAME = "cm-handle.properties"; - private static final String PARSING_ERROR = - "Could not create the request message to send to the server; no message will be sent"; - - public AddCMHandleProvider(final DataBroker dataBroker, RpcProviderRegistry rpcProviderRegistry) { - this.dataBroker = dataBroker; - this.rpcProviderRegistry = rpcProviderRegistry; - } - - /** - * Method called when the blueprint container is created. - */ - public void init() { - serviceRegistration = rpcProviderRegistry.addRpcImplementation(CMHandleAPIService.class, this); - - LOG.debug("Initializing provider for " + appName); - - Preconditions.checkNotNull(dataBroker, "dataBroker must be set"); - - String propDir = System.getenv(SDNC_CONFIG_DIR); - if (propDir == null) { - LOG.error("Environment variable SDNC_CONFIG_DIR is not set"); - propDir = "/opt/onap/ccsdk/data/properties/"; - } else if (!propDir.endsWith("/")) { - propDir = propDir + "/"; - } - - LOG.debug("Initialization complete for " + appName); - } - - /** - * Method called when the blueprint container is destroyed. - */ - public void close() { - LOG.debug("AddCMHandleProvider Closed"); - } - - @Override - public ListenableFuture> addCMHandle(AddCMHandleInput input) { - - return null; - } - -} diff --git a/sdnr/northbound/addCMHandle/provider/src/main/resources/cm-handle.properties b/sdnr/northbound/addCMHandle/provider/src/main/resources/cm-handle.properties index ed3db009f..f027f5939 100644 --- a/sdnr/northbound/addCMHandle/provider/src/main/resources/cm-handle.properties +++ b/sdnr/northbound/addCMHandle/provider/src/main/resources/cm-handle.properties @@ -20,4 +20,8 @@ # -dmaap.url = https://dmaap-message-router/events +url = https://dmaap-message-router/events/CM_HANDLE +user = user +password = password +authentication = basic +dmi-service-name = dmi-service-name diff --git a/sdnr/northbound/addCMHandle/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml b/sdnr/northbound/addCMHandle/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml index 8e543d458..9cc6c39ca 100644 --- a/sdnr/northbound/addCMHandle/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml +++ b/sdnr/northbound/addCMHandle/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml @@ -20,18 +20,37 @@ ~ --> - + + + + + + + + interface="org.opendaylight.mdsal.binding.api.DataBroker"/> + + - - + + + + + + + + + + + + diff --git a/sdnr/northbound/addCMHandle/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/addCMHandle/AddCMHandleProviderTest.java b/sdnr/northbound/addCMHandle/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/addCMHandle/AddCMHandleProviderTest.java index 37711c630..0dfe88c1f 100644 --- a/sdnr/northbound/addCMHandle/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/addCMHandle/AddCMHandleProviderTest.java +++ b/sdnr/northbound/addCMHandle/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/addCMHandle/AddCMHandleProviderTest.java @@ -11,10 +11,10 @@ import java.util.concurrent.Future; import org.junit.After; import org.junit.Before; import org.junit.Test; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.mdsal.binding.api.DataBroker; +import org.opendaylight.mdsal.binding.api.RpcProviderService; import org.opendaylight.yangtools.yang.common.RpcResult; - +import org.onap.ccsdk.features.sdnr.northbound.addCMHandle.AddCMHandleProvider; public class AddCMHandleProviderTest { private AddCMHandleProvider esProvider; @@ -22,8 +22,8 @@ public class AddCMHandleProviderTest { @Before public void setUp() throws Exception { DataBroker dataBroker = mock(DataBroker.class); - RpcProviderRegistry rpcRegistry = mock(RpcProviderRegistry.class); - esProvider = new AddCMHandleProvider(dataBroker, rpcRegistry); + RpcProviderService rpcRegistry = mock(RpcProviderService.class); + esProvider = new AddCMHandleProvider(); } @After -- cgit 1.2.3-korg