Adapt SDNR northbound to Aluminium
Adapt SDNR northbound to Aluminium
Issue-ID: CCSDK-3128
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Change-Id: Id2dc38d4f2573d5c6aeedfb42349433f22aa86f5
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
diff --git a/sdnr/northbound/CMNotify/feature/pom.xml b/sdnr/northbound/CMNotify/feature/pom.xml
index 3c7cb72..90fe746 100644
--- a/sdnr/northbound/CMNotify/feature/pom.xml
+++ b/sdnr/northbound/CMNotify/feature/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/CMNotify/installer/pom.xml b/sdnr/northbound/CMNotify/installer/pom.xml
index 20e551f..b540ea7 100644
--- a/sdnr/northbound/CMNotify/installer/pom.xml
+++ b/sdnr/northbound/CMNotify/installer/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/CMNotify/model/pom.xml b/sdnr/northbound/CMNotify/model/pom.xml
index 43dcecf..3af4c66 100644
--- a/sdnr/northbound/CMNotify/model/pom.xml
+++ b/sdnr/northbound/CMNotify/model/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>binding-parent</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/CMNotify/pom.xml b/sdnr/northbound/CMNotify/pom.xml
index a930edb..54db602 100644
--- a/sdnr/northbound/CMNotify/pom.xml
+++ b/sdnr/northbound/CMNotify/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/CMNotify/provider/pom.xml b/sdnr/northbound/CMNotify/provider/pom.xml
index c434790..f964d63 100644
--- a/sdnr/northbound/CMNotify/provider/pom.xml
+++ b/sdnr/northbound/CMNotify/provider/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>binding-parent</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
@@ -39,16 +39,6 @@
<dependencyManagement>
<dependencies>
- <!--
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>mdsal-artifacts</artifactId>
- <version>1.6.1</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- -->
-
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sli-core-artifacts</artifactId>
@@ -64,36 +54,13 @@
<artifactId>CMNotify-model</artifactId>
<version>${project.version}</version>
</dependency>
- <!--
<dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-config</artifactId>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-api</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-common-util</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-core-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-data-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-dom-api</artifactId>
</dependency>
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
@@ -106,40 +73,8 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>utils-provider</artifactId>
- <version>${sdnctl.sli.version}</version>
- </dependency>
- -->
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sli-common</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sli-provider</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-test-model</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-broker-impl</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-broker-impl</artifactId>
- <type>test-jar</type>
- <classifier>tests</classifier>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-test-model</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@@ -162,10 +97,6 @@
<artifactId>sal-common-util</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-core-api</artifactId>
- </dependency>
- <dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-data-impl</artifactId>
</dependency>
diff --git a/sdnr/northbound/CMNotify/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/cmnotify/CMNotifyProvider.java b/sdnr/northbound/CMNotify/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/cmnotify/CMNotifyProvider.java
index 7317ac4..452741b 100644
--- a/sdnr/northbound/CMNotify/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/cmnotify/CMNotifyProvider.java
+++ b/sdnr/northbound/CMNotify/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/cmnotify/CMNotifyProvider.java
@@ -28,149 +28,162 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
+import org.opendaylight.mdsal.binding.api.RpcProviderService;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev200224.CMNOTIFYAPIService;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev200224.NbrlistChangeNotificationInput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev200224.NbrlistChangeNotificationInputBuilder;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev200224.NbrlistChangeNotificationOutput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev200224.NbrlistChangeNotificationOutputBuilder;
-
import org.opendaylight.yangtools.concepts.Builder;
+import org.opendaylight.yangtools.concepts.ObjectRegistration;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Defines a base implementation for your provider. This class extends from a helper class which
- * provides storage for the most commonly used components of the MD-SAL. Additionally the base class
- * provides some basic logging and initialization / clean up methods.
+ * Defines a base implementation for your provider. This class extends from a
+ * helper class which provides storage for the most commonly used components of
+ * the MD-SAL. Additionally the base class provides some basic logging and
+ * initialization / clean up methods.
*
*/
public class CMNotifyProvider implements AutoCloseable, CMNOTIFYAPIService {
- private static final Logger LOG = LoggerFactory.getLogger(CMNotifyProvider.class);
+ private static final Logger LOG = LoggerFactory.getLogger(CMNotifyProvider.class);
- private static final String APPLICATION_NAME = "CMNotify-api";
- private static final String NBRLIST_CHANGE_NOTIFICATION = "nbrlist-change-notification";
+ private static final String APPLICATION_NAME = "CMNotify-api";
+ private static final String NBRLIST_CHANGE_NOTIFICATION = "nbrlist-change-notification";
+ private final ExecutorService executor;
+ protected DataBroker dataBroker;
+ protected RpcProviderService rpcProviderRegistry;
+ protected NotificationPublishService notificationService;
+ private ObjectRegistration<CMNotifyProvider> rpcReg;
+ private CMNotifyClient CMNotifyClient;
- private final ExecutorService executor;
- protected DataBroker dataBroker;
- protected NotificationPublishService notificationService;
- protected RpcProviderRegistry rpcRegistry;
- protected BindingAwareBroker.RpcRegistration<CMNOTIFYAPIService> rpcRegistration;
- private final CMNotifyClient CMNotifyClient;
+ public CMNotifyProvider() {
- public CMNotifyProvider(final DataBroker dataBroker, final NotificationPublishService notificationPublishService,
- final RpcProviderRegistry rpcProviderRegistry, final CMNotifyClient CMNotifyClient) {
+ LOG.info("Creating provider for {}", APPLICATION_NAME);
+ executor = Executors.newFixedThreadPool(1);
+
+ this.dataBroker = null;
+ this.notificationService = null;
+ this.rpcProviderRegistry = null;
+ this.CMNotifyClient = null;
+
+ }
- LOG.info("Creating provider for {}", APPLICATION_NAME);
- executor = Executors.newFixedThreadPool(1);
- this.dataBroker = dataBroker;
- this.notificationService = notificationPublishService;
- this.rpcRegistry = rpcProviderRegistry;
- this.CMNotifyClient = CMNotifyClient;
- initialize();
- }
+ public void setDataBroker(DataBroker dataBroker) {
+ this.dataBroker = dataBroker;
+ }
- public void initialize() {
- LOG.info("Initializing provider for {}", APPLICATION_NAME);
- rpcRegistration = rpcRegistry.addRpcImplementation(CMNOTIFYAPIService.class, this);
- LOG.info("Initialization complete for {}", APPLICATION_NAME);
- }
+ public void setRpcProviderRegistry(RpcProviderService rpcProviderRegistry) {
+ this.rpcProviderRegistry = rpcProviderRegistry;
+ }
- protected void initializeChild() {
- // Override if you have custom initialization intelligence
- }
+ public void setNotificationPublishService(NotificationPublishService notificationPublishService) {
+ this.notificationService = notificationPublishService;
+ }
- @Override
- public void close() throws Exception {
- LOG.info("Closing provider for {}", APPLICATION_NAME);
- executor.shutdown();
- rpcRegistration.close();
- LOG.info("Successfully closed provider for {}", APPLICATION_NAME);
- }
+ public void setClient(CMNotifyClient client) {
+ this.CMNotifyClient = client;
+ }
- // RPC nbrlist-change-notification
+ public void init() {
+ LOG.info("Initializing provider for {}", APPLICATION_NAME);
+ rpcReg = rpcProviderRegistry.registerRpcImplementation(CMNOTIFYAPIService.class, this);
+ LOG.info("Initialization complete for {}", APPLICATION_NAME);
+ }
- @Override
- public ListenableFuture<RpcResult<NbrlistChangeNotificationOutput>> nbrlistChangeNotification(NbrlistChangeNotificationInput input) {
- final String svcOperation = "nbrlist-change-notification";
+ @Override
+ public void close() throws Exception {
+ LOG.info("Closing provider for {}", APPLICATION_NAME);
+ executor.shutdown();
+ if (rpcReg != null)
+ rpcReg.close();
+ LOG.info("Successfully closed provider for {}", APPLICATION_NAME);
+ }
- Properties parms = new Properties();
- NbrlistChangeNotificationOutputBuilder serviceDataBuilder = (NbrlistChangeNotificationOutputBuilder) getServiceData(NBRLIST_CHANGE_NOTIFICATION);
+ // RPC nbrlist-change-notification
- LOG.info("Reached RPC nbrlist-change-notification");
+ @Override
+ public ListenableFuture<RpcResult<NbrlistChangeNotificationOutput>> nbrlistChangeNotification(
+ NbrlistChangeNotificationInput input) {
+ final String svcOperation = "nbrlist-change-notification";
- LOG.info(svcOperation + " called.");
+ Properties parms = new Properties();
+ NbrlistChangeNotificationOutputBuilder serviceDataBuilder = (NbrlistChangeNotificationOutputBuilder) getServiceData(
+ NBRLIST_CHANGE_NOTIFICATION);
- if (input == null) {
- LOG.debug("exiting " + svcOperation + " because of invalid input");
- serviceDataBuilder.setResponseCode("Input is null");
- RpcResult<NbrlistChangeNotificationOutput> rpcResult =
- RpcResultBuilder.<NbrlistChangeNotificationOutput>status(true).withResult(serviceDataBuilder.build()).build();
- return Futures.immediateFuture(rpcResult);
- }
+ LOG.info("Reached RPC nbrlist-change-notification");
- // add input to parms
- LOG.info("Adding INPUT data for " + svcOperation + " input: " + input);
- NbrlistChangeNotificationInputBuilder inputBuilder = new NbrlistChangeNotificationInputBuilder(input);
- MdsalHelper.toProperties(parms, inputBuilder.build());
+ LOG.info(svcOperation + " called.");
- LOG.info("Printing SLI parameters to be passed");
+ if (input == null) {
+ LOG.debug("exiting " + svcOperation + " because of invalid input");
+ serviceDataBuilder.setResponseCode("Input is null");
+ RpcResult<NbrlistChangeNotificationOutput> rpcResult = RpcResultBuilder
+ .<NbrlistChangeNotificationOutput>status(true).withResult(serviceDataBuilder.build()).build();
+ return Futures.immediateFuture(rpcResult);
+ }
- // iterate properties file to get key-value pairs
- for (String key : parms.stringPropertyNames()) {
- String value = parms.getProperty(key);
- LOG.info("The SLI parameter in " + key + " is: " + value);
- }
+ // add input to parms
+ LOG.info("Adding INPUT data for " + svcOperation + " input: " + input);
+ NbrlistChangeNotificationInputBuilder inputBuilder = new NbrlistChangeNotificationInputBuilder(input);
+ MdsalHelper.toProperties(parms, inputBuilder.build());
- // Call SLI sync method
- try {
- if (CMNotifyClient.hasGraph("CM-NOTIFY-API", svcOperation, null, "sync")) {
- LOG.info("CMNotifyClient has a Directed Graph for '" + svcOperation + "'");
- try {
- CMNotifyClient.execute("CM-NOTIFY-API", svcOperation, null, "sync", serviceDataBuilder, parms);
- } catch (Exception e) {
- LOG.error("Caught exception executing service logic for " + svcOperation, e);
- serviceDataBuilder.setResponseCode("500");
- }
- } else {
- LOG.error("No service logic active for CMNotify: '" + svcOperation + "'");
- serviceDataBuilder.setResponseCode("503");
- }
- } catch (Exception e) {
- LOG.error("Caught exception looking for service logic", e);
- serviceDataBuilder.setResponseCode("500");
- }
+ LOG.info("Printing SLI parameters to be passed");
- String errorCode = serviceDataBuilder.getResponseCode();
+ // iterate properties file to get key-value pairs
+ for (String key : parms.stringPropertyNames()) {
+ String value = parms.getProperty(key);
+ LOG.info("The SLI parameter in " + key + " is: " + value);
+ }
- if (!("0".equals(errorCode) || "200".equals(errorCode))) {
- LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'");
- } else {
- LOG.info("Returned SUCCESS for " + svcOperation + " ");
- serviceDataBuilder.setResponseMessage("CM Notification Executed and RuntimeDB Updated. ");
- }
+ // Call SLI sync method
+ try {
+ if (CMNotifyClient.hasGraph("CM-NOTIFY-API", svcOperation, null, "sync")) {
+ LOG.info("CMNotifyClient has a Directed Graph for '" + svcOperation + "'");
+ try {
+ CMNotifyClient.execute("CM-NOTIFY-API", svcOperation, null, "sync", serviceDataBuilder, parms);
+ } catch (Exception e) {
+ LOG.error("Caught exception executing service logic for " + svcOperation, e);
+ serviceDataBuilder.setResponseCode("500");
+ }
+ } else {
+ LOG.error("No service logic active for CMNotify: '" + svcOperation + "'");
+ serviceDataBuilder.setResponseCode("503");
+ }
+ } catch (Exception e) {
+ LOG.error("Caught exception looking for service logic", e);
+ serviceDataBuilder.setResponseCode("500");
+ }
- RpcResult<NbrlistChangeNotificationOutput> rpcResult =
- RpcResultBuilder.<NbrlistChangeNotificationOutput>status(true).withResult(serviceDataBuilder.build()).build();
+ String errorCode = serviceDataBuilder.getResponseCode();
- LOG.info("Successful exit from nbrlist-change-notification ");
+ if (!("0".equals(errorCode) || "200".equals(errorCode))) {
+ LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'");
+ } else {
+ LOG.info("Returned SUCCESS for " + svcOperation + " ");
+ serviceDataBuilder.setResponseMessage("CM Notification Executed and RuntimeDB Updated. ");
+ }
- return Futures.immediateFuture(rpcResult);
- }
+ RpcResult<NbrlistChangeNotificationOutput> rpcResult = RpcResultBuilder
+ .<NbrlistChangeNotificationOutput>status(true).withResult(serviceDataBuilder.build()).build();
+ LOG.info("Successful exit from nbrlist-change-notification ");
- protected Builder<?> getServiceData(String svcOperation) {
- switch (svcOperation) {
- case NBRLIST_CHANGE_NOTIFICATION:
- return new NbrlistChangeNotificationOutputBuilder();
- }
- return null;
- }
+ return Futures.immediateFuture(rpcResult);
+ }
+
+ protected Builder<?> getServiceData(String svcOperation) {
+ switch (svcOperation) {
+ case NBRLIST_CHANGE_NOTIFICATION:
+ return new NbrlistChangeNotificationOutputBuilder();
+ }
+ return null;
+ }
}
diff --git a/sdnr/northbound/CMNotify/provider/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml b/sdnr/northbound/CMNotify/provider/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml
deleted file mode 100644
index fd036bb..0000000
--- a/sdnr/northbound/CMNotify/provider/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ ============LICENSE_START=======================================================
- ~ ONAP : ccsdk features
- ~ ================================================================================
- ~ Copyright (C) 2020 AT&T Intellectual Property. 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.
- ~ ============LICENSE_END=======================================================
- ~
- -->
-
-<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="svcLogicService"
- interface="org.onap.ccsdk.sli.core.sli.provider.SvcLogicService"/>
-
- <bean id="client" class="org.onap.ccsdk.features.sdnr.northbound.cmnotify.CMNotifyClient">
- <argument ref="svcLogicService"/>
- </bean>
-
- <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
- odl:type="default"/>
-
- <reference id="notificationService"
- interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService"
- odl:type="default"/>
-
- <reference id="rpcRegistry" interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"
- odl:type="default"/>
-
- <bean id="provider" class="org.onap.ccsdk.features.sdnr.northbound.cmnotify.CMNotifyProvider">
- <argument ref="dataBroker"/>
- <argument ref="rpcRegistry"/>
- <argument ref="notificationService"/>
- <argument ref="client"/>
- </bean>
-
-</blueprint>
diff --git a/sdnr/northbound/CMNotify/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml b/sdnr/northbound/CMNotify/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
index fd036bb..3eb5312 100644
--- a/sdnr/northbound/CMNotify/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
+++ b/sdnr/northbound/CMNotify/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
@@ -30,21 +30,22 @@
<argument ref="svcLogicService"/>
</bean>
- <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
+ <reference id="dataBroker"
+ interface="org.opendaylight.mdsal.binding.api.DataBroker"
odl:type="default"/>
+
+ <reference id="notificationPublishService"
+ interface="org.opendaylight.mdsal.binding.api.NotificationPublishService" />
- <reference id="notificationService"
- interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService"
- odl:type="default"/>
+ <reference id="rpcProviderRegistry"
+ interface="org.opendaylight.mdsal.binding.api.RpcProviderService" />
- <reference id="rpcRegistry" interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"
- odl:type="default"/>
-
- <bean id="provider" class="org.onap.ccsdk.features.sdnr.northbound.cmnotify.CMNotifyProvider">
- <argument ref="dataBroker"/>
- <argument ref="rpcRegistry"/>
- <argument ref="notificationService"/>
- <argument ref="client"/>
+ <bean id="provider" class="org.onap.ccsdk.features.sdnr.northbound.cmnotify.CMNotifyProvider"
+ init-method="init" destroy-method="close">
+ <property name="dataBroker" ref="dataBroker"/>
+ <property name="rpcProviderRegistry" ref="rpcProviderRegistry"/>
+ <property name="notificationPublishService" ref="notificationPublishService"/>
+ <property name="client" ref="client"/>
</bean>
</blueprint>
diff --git a/sdnr/northbound/CMNotify/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/cmnotify/TestCMNotify.java b/sdnr/northbound/CMNotify/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/cmnotify/TestCMNotify.java
index 36218eb..f062e51 100644
--- a/sdnr/northbound/CMNotify/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/cmnotify/TestCMNotify.java
+++ b/sdnr/northbound/CMNotify/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/cmnotify/TestCMNotify.java
@@ -24,14 +24,9 @@
import org.junit.Before;
import org.junit.Test;
-import org.onap.ccsdk.features.sdnr.northbound.cmnotify.CMNotifyClient;
-import org.onap.ccsdk.features.sdnr.northbound.cmnotify.CMNotifyProvider;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
-import org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
+import org.opendaylight.mdsal.binding.api.RpcProviderService;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -41,16 +36,14 @@
import java.math.*;
-import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev200224.NbrlistChangeNotificationInput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev200224.NbrlistChangeNotificationInputBuilder;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev200224.NbrlistChangeNotificationOutput;
-import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev200224.NbrlistChangeNotificationOutputBuilder;
import com.google.common.util.concurrent.ListenableFuture;
-public class TestCMNotify extends AbstractConcurrentDataBrokerTest {
+public class TestCMNotify {
private CMNotifyProvider cMNotifyProvider;
private static final Logger LOG = LoggerFactory.getLogger(CMNotifyProvider.class);
@@ -58,11 +51,15 @@
@Before
public void setUp() throws Exception {
if (null == cMNotifyProvider) {
- DataBroker dataBroker = getDataBroker();
+ DataBroker dataBroker = mock(DataBroker.class);
NotificationPublishService mockNotification = mock(NotificationPublishService.class);
- RpcProviderRegistry mockRpcRegistry = mock(RpcProviderRegistry.class);
+ RpcProviderService mockRpcRegistry = mock(RpcProviderService.class);
CMNotifyClient mockSliClient = mock(CMNotifyClient.class);
- cMNotifyProvider = new CMNotifyProvider(dataBroker, mockNotification, mockRpcRegistry, mockSliClient);
+ cMNotifyProvider = new CMNotifyProvider();
+ cMNotifyProvider.setDataBroker(dataBroker);
+ cMNotifyProvider.setNotificationPublishService(mockNotification);
+ cMNotifyProvider.setRpcProviderRegistry(mockRpcRegistry);
+ cMNotifyProvider.setClient(mockSliClient);
}
}
diff --git a/sdnr/northbound/energysavings/features/pom.xml b/sdnr/northbound/energysavings/features/pom.xml
index 76258d0..dd1a6b0 100644
--- a/sdnr/northbound/energysavings/features/pom.xml
+++ b/sdnr/northbound/energysavings/features/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/energysavings/installer/pom.xml b/sdnr/northbound/energysavings/installer/pom.xml
index d60c28e..06cc3ab 100755
--- a/sdnr/northbound/energysavings/installer/pom.xml
+++ b/sdnr/northbound/energysavings/installer/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/energysavings/model/pom.xml b/sdnr/northbound/energysavings/model/pom.xml
index 297dfbd..ae400f5 100644
--- a/sdnr/northbound/energysavings/model/pom.xml
+++ b/sdnr/northbound/energysavings/model/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>binding-parent</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/energysavings/pom.xml b/sdnr/northbound/energysavings/pom.xml
index f62dca2..5878df7 100644
--- a/sdnr/northbound/energysavings/pom.xml
+++ b/sdnr/northbound/energysavings/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/energysavings/provider/pom.xml b/sdnr/northbound/energysavings/provider/pom.xml
index 264c089..507823e 100644
--- a/sdnr/northbound/energysavings/provider/pom.xml
+++ b/sdnr/northbound/energysavings/provider/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>binding-parent</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/features/ccsdk-features-sdnr-northbound-all/pom.xml b/sdnr/northbound/features/ccsdk-features-sdnr-northbound-all/pom.xml
index 71a091f..f5fabcb 100644
--- a/sdnr/northbound/features/ccsdk-features-sdnr-northbound-all/pom.xml
+++ b/sdnr/northbound/features/ccsdk-features-sdnr-northbound-all/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/features/installer/pom.xml b/sdnr/northbound/features/installer/pom.xml
index fba580b..1809fdf 100644
--- a/sdnr/northbound/features/installer/pom.xml
+++ b/sdnr/northbound/features/installer/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/features/pom.xml b/sdnr/northbound/features/pom.xml
index 0a9821d..7af67f0 100644
--- a/sdnr/northbound/features/pom.xml
+++ b/sdnr/northbound/features/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/oofpcipoc/consumer/pom.xml b/sdnr/northbound/oofpcipoc/consumer/pom.xml
index b05464d..950ee35 100644
--- a/sdnr/northbound/oofpcipoc/consumer/pom.xml
+++ b/sdnr/northbound/oofpcipoc/consumer/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>binding-parent</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
@@ -66,20 +66,6 @@
<artifactId>oofpcipoc-provider</artifactId>
<version>${project.version}</version>
</dependency>
- <!-- <dependency> <groupId>org.opendaylight.controller</groupId> <artifactId>sal-binding-config</artifactId>
- </dependency> -->
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-common-util</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-core-api</artifactId>
- </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-data-impl</artifactId>
diff --git a/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/OofpcipocHandleNotif.java b/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/OofpcipocHandleNotif.java
index 98b16f5..dd1ca70 100644
--- a/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/OofpcipocHandleNotif.java
+++ b/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/OofpcipocHandleNotif.java
@@ -25,8 +25,8 @@
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.io.IOException;
-import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -41,32 +41,23 @@
import org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.handlenotif.pojos.RAN;
import org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.handlenotif.pojos.RadioAccess;
import org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.handlenotif.pojos.X0005b9Lte;
-import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev190308.*;
+
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.rev190308.OofpcipocListener;
-import org.opendaylight.yang.gen.v1.org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.rev190308.Payload;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.rev190308.NbrlistChangeNotification;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.rev190308.NetconfConfigChange;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.rev190308.nbrlist.change.notification.*;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.rev190308.nbrlist.change.notification.fap.service.*;
-import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.common.base.Preconditions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.json.JSONArray;
import org.json.JSONObject;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.MoreExecutors;
/**
* Defines a base implementation for your listener. This class extends from a
@@ -92,25 +83,28 @@
protected DataBroker dataBroker;
- private final OofpcipocClient OofpcipocClient;
+ private OofpcipocClient OofpcipocClient;
- public OofpcipocHandleNotif(final DataBroker dataBroker, final OofpcipocClient OofpcipocClient) {
+ public OofpcipocHandleNotif() {
this.LOG.info("Creating listener for {}", APPLICATION_NAME);
executor = Executors.newFixedThreadPool(1);
+ this.dataBroker = null;
+ this.OofpcipocClient = null;
+ }
+
+ public void setDataBroker(DataBroker dataBroker) {
this.dataBroker = dataBroker;
+ }
+
+ public void setClient(OofpcipocClient OofpcipocClient) {
this.OofpcipocClient = OofpcipocClient;
- initialize();
}
- public void initialize() {
+ public void init() {
LOG.info("Placeholder: Initializing listener for {}", APPLICATION_NAME);
}
- protected void initializeChild() {
- // Override if you have custom initialization intelligence
- }
-
@Override
public void close() throws Exception {
LOG.info("Closing listener for {}", APPLICATION_NAME);
@@ -134,18 +128,20 @@
List<FAPServiceList> fAPServiceList = new ArrayList<>();
radioAccess.setFAPServiceNumberOfEntries(notification.getFapServiceNumberOfEntriesChanged().toString());
+ Map<FapServiceKey, FapService> fapSvcs = notification.getFapService();
- for (FapService fapSvc : notification.getFapService()) {
+ for (Map.Entry<FapServiceKey,FapService> entry : fapSvcs.entrySet() ) {
+ FapService fapSvc = entry.getValue();
FAPServiceList fapServiceElement = new FAPServiceList();
fapServiceElement.setAlias(fapSvc.getAlias());
fapServiceElement.setX0005b9Lte(new X0005b9Lte(fapSvc.getPhyCellIdInUse().toString(), fapSvc.getPnfName()));
List<LTENeighborListInUseLTECell> lTENeighborListInUseLTECell = new ArrayList<>();
-
- for (LteRanNeighborListInUseLteCellChanged lteRanElement : fapSvc
- .getLteRanNeighborListInUseLteCellChanged()) {
+ Map<LteRanNeighborListInUseLteCellChangedKey, LteRanNeighborListInUseLteCellChanged> lteRanElements = fapSvc.getLteRanNeighborListInUseLteCellChanged();
+ for (Map.Entry<LteRanNeighborListInUseLteCellChangedKey, LteRanNeighborListInUseLteCellChanged> lteRanEntry : lteRanElements.entrySet()) {
+ LteRanNeighborListInUseLteCellChanged lteRanElement = lteRanEntry.getValue();
LTENeighborListInUseLTECell lTENeighborListInUseLTECellElement = new LTENeighborListInUseLTECell();
lTENeighborListInUseLTECellElement.setAlias(lteRanElement.getCid());
lTENeighborListInUseLTECellElement.setBlacklisted(lteRanElement.isBlacklisted().toString());
diff --git a/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/handlenotif/pojos/CellConfig.java b/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/handlenotif/pojos/CellConfig.java
index def38a3..36c0ce6 100644
--- a/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/handlenotif/pojos/CellConfig.java
+++ b/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/handlenotif/pojos/CellConfig.java
@@ -1,3 +1,23 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : SDN-C
+ * ================================================================================
+ * Copyright (C) 2020 AT&T Intellectual Property. 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.
+ * ============LICENSE_END=========================================================
+ */
package org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.handlenotif.pojos;
diff --git a/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/handlenotif/pojos/NeighborListInUse.java b/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/handlenotif/pojos/NeighborListInUse.java
index 39cc222..634d970 100644
--- a/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/handlenotif/pojos/NeighborListInUse.java
+++ b/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/handlenotif/pojos/NeighborListInUse.java
@@ -1,3 +1,23 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : SDN-C
+ * ================================================================================
+ * Copyright (C) 2020 AT&T Intellectual Property. 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.
+ * ============LICENSE_END=========================================================
+ */
package org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.handlenotif.pojos;
diff --git a/sdnr/northbound/oofpcipoc/consumer/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml b/sdnr/northbound/oofpcipoc/consumer/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml
deleted file mode 100644
index 90ae11a..0000000
--- a/sdnr/northbound/oofpcipoc/consumer/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ ============LICENSE_START=======================================================
- ~ ONAP : ccsdk features
- ~ ================================================================================
- ~ Copyright (C) 2020 AT&T Intellectual Property. 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.
- ~ ============LICENSE_END=======================================================
- ~
- -->
-
-<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="svcLogicService"
- interface="org.onap.ccsdk.sli.core.sli.provider.SvcLogicService"/>
-
- <bean id="client" class="org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.OofpcipocClient">
- <argument ref="svcLogicService"/>
- </bean>
-
- <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
- odl:type="default"/>
-
- <!-- Register the OofpcipocListener to receive yang notifications -->
-
- <odl:notification-listener ref="listener"/>
-
- <bean id="listener" class="org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.OofpcipocHandleNotif">
- <argument ref="dataBroker"/>
- <argument ref="client"/>
- </bean>
-
-</blueprint>
diff --git a/sdnr/northbound/oofpcipoc/consumer/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml b/sdnr/northbound/oofpcipoc/consumer/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
index 90ae11a..33d4142 100644
--- a/sdnr/northbound/oofpcipoc/consumer/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
+++ b/sdnr/northbound/oofpcipoc/consumer/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
@@ -30,7 +30,7 @@
<argument ref="svcLogicService"/>
</bean>
- <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
+ <reference id="dataBroker" interface="org.opendaylight.mdsal.binding.api.DataBroker"
odl:type="default"/>
<!-- Register the OofpcipocListener to receive yang notifications -->
diff --git a/sdnr/northbound/oofpcipoc/feature/pom.xml b/sdnr/northbound/oofpcipoc/feature/pom.xml
index 9c5eb74..1af7262 100644
--- a/sdnr/northbound/oofpcipoc/feature/pom.xml
+++ b/sdnr/northbound/oofpcipoc/feature/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
@@ -37,26 +37,6 @@
<name>ccsdk-features :: sdnr-northbound :: ${project.artifactId}</name>
- <!--
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>mdsal-model-artifacts</artifactId>
- <version>${odl.mdsal.model.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>mdsal-artifacts</artifactId>
- <version>${odl.mdsal.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
- -->
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
diff --git a/sdnr/northbound/oofpcipoc/installer/pom.xml b/sdnr/northbound/oofpcipoc/installer/pom.xml
index af2ec0a..14bca54 100644
--- a/sdnr/northbound/oofpcipoc/installer/pom.xml
+++ b/sdnr/northbound/oofpcipoc/installer/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/oofpcipoc/model/pom.xml b/sdnr/northbound/oofpcipoc/model/pom.xml
index 6c46b7f..ac9e6c3 100644
--- a/sdnr/northbound/oofpcipoc/model/pom.xml
+++ b/sdnr/northbound/oofpcipoc/model/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>binding-parent</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/oofpcipoc/pom.xml b/sdnr/northbound/oofpcipoc/pom.xml
index c7de814..a0e1e62 100644
--- a/sdnr/northbound/oofpcipoc/pom.xml
+++ b/sdnr/northbound/oofpcipoc/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/oofpcipoc/provider/pom.xml b/sdnr/northbound/oofpcipoc/provider/pom.xml
index bee1837..34892f2 100644
--- a/sdnr/northbound/oofpcipoc/provider/pom.xml
+++ b/sdnr/northbound/oofpcipoc/provider/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>binding-parent</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
@@ -55,8 +55,12 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-api</artifactId>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-dom-api</artifactId>
</dependency>
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
@@ -69,20 +73,8 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-test-model</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-broker-impl</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-broker-impl</artifactId>
- <type>test-jar</type>
- <classifier>tests</classifier>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-test-model</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@@ -101,14 +93,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-common-util</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-core-api</artifactId>
- </dependency>
- <dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-data-impl</artifactId>
</dependency>
diff --git a/sdnr/northbound/oofpcipoc/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/OofpcipocProvider.java b/sdnr/northbound/oofpcipoc/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/OofpcipocProvider.java
index f0749fb..6bfa74e 100644
--- a/sdnr/northbound/oofpcipoc/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/OofpcipocProvider.java
+++ b/sdnr/northbound/oofpcipoc/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/OofpcipocProvider.java
@@ -19,131 +19,127 @@
* ============LICENSE_END=========================================================
*/
- package org.onap.ccsdk.features.sdnr.northbound.oofpcipoc;
+package org.onap.ccsdk.features.sdnr.northbound.oofpcipoc;
import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
+import org.opendaylight.mdsal.binding.api.RpcProviderService;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev190308.*;
-
-import com.google.common.base.Preconditions;
+import org.opendaylight.yangtools.concepts.ObjectRegistration;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
/**
- * Defines a base implementation for your provider. This class extends from a helper class
- * which provides storage for the most commonly used components of the MD-SAL. Additionally the
- * base class provides some basic logging and initialization / clean up methods.
+ * Defines a base implementation for your provider. This class extends from a
+ * helper class which provides storage for the most commonly used components of
+ * the MD-SAL. Additionally the base class provides some basic logging and
+ * initialization / clean up methods.
*
*/
public class OofpcipocProvider implements AutoCloseable, OofpcipocApiService {
- private static final Logger LOG = LoggerFactory.getLogger(OofpcipocProvider.class);
+ private static final Logger LOG = LoggerFactory.getLogger(OofpcipocProvider.class);
- private static final String APPLICATION_NAME = "oofpcipoc-api";
+ private static final String APPLICATION_NAME = "oofpcipoc-api";
- private final ExecutorService executor;
+ private final ExecutorService executor;
- protected DataBroker dataBroker;
- protected NotificationPublishService notificationService;
- protected RpcProviderRegistry rpcRegistry;
- protected BindingAwareBroker.RpcRegistration<OofpcipocApiService> rpcRegistration;
- private final OofpcipocClient OofpcipocClient;
+ private DataBroker dataBroker;
+ private NotificationPublishService notificationService;
+ private RpcProviderService rpcProviderService;
+ private ObjectRegistration<OofpcipocProvider> rpcRegistration;
+ private OofpcipocClient OofpcipocClient;
+ public OofpcipocProvider() {
- public OofpcipocProvider(final DataBroker dataBroker,
- final NotificationPublishService notificationPublishService,
- final RpcProviderRegistry rpcProviderRegistry,
- final OofpcipocClient OofpcipocClient) {
+ LOG.info("Creating provider for {}", APPLICATION_NAME);
+ executor = Executors.newFixedThreadPool(1);
+ this.dataBroker = null;
+ this.notificationService = null;
+ this.rpcProviderService = null;
+ this.OofpcipocClient = null;
+ }
- this.LOG.info( "Creating provider for {}", APPLICATION_NAME);
- executor = Executors.newFixedThreadPool(1);
- this.dataBroker = dataBroker;
- this.notificationService = notificationPublishService;
- this.rpcRegistry = rpcProviderRegistry;
- this.OofpcipocClient = OofpcipocClient;
- initialize();
- }
+ public void setDataBroker(DataBroker dataBroker) {
+ this.dataBroker = dataBroker;
+ }
- public void initialize(){
- LOG.info( "Initializing provider for {}", APPLICATION_NAME);
- rpcRegistration = rpcRegistry.addRpcImplementation(OofpcipocApiService.class, this);
- LOG.info( "Initialization complete for {}", APPLICATION_NAME);
- }
+ public void setRpcProviderService(RpcProviderService rpcProviderRegistry) {
+ this.rpcProviderService = rpcProviderRegistry;
+ }
- protected void initializeChild() {
- //Override if you have custom initialization intelligence
- }
+ public void setNotificationPublishService(NotificationPublishService notificationPublishService) {
+ this.notificationService = notificationPublishService;
+ }
- @Override
- public void close() throws Exception {
- LOG.info( "Closing provider for {}", APPLICATION_NAME);
- executor.shutdown();
- rpcRegistration.close();
- LOG.info( "Successfully closed provider for {}", APPLICATION_NAME);
- }
+ public void setClient(OofpcipocClient client) {
+ this.OofpcipocClient = client;
+ }
+
+ public void init() {
+ LOG.info("Initializing provider for {}", APPLICATION_NAME);
+ rpcRegistration = rpcProviderService.registerRpcImplementation(OofpcipocApiService.class, this);
+ LOG.info("Initialization complete for {}", APPLICATION_NAME);
+ }
@Override
- public ListenableFuture<RpcResult<GreetingOutput>> greeting(
- GreetingInput input) {
+ public void close() throws Exception {
+ LOG.info("Closing provider for {}", APPLICATION_NAME);
+ executor.shutdown();
+ if (rpcRegistration != null)
+ rpcRegistration.close();
+ LOG.info("Successfully closed provider for {}", APPLICATION_NAME);
+ }
+
+ @Override
+ public ListenableFuture<RpcResult<GreetingOutput>> greeting(GreetingInput input) {
final String svcOperation = "greeting";
Properties parms = new Properties();
GreetingOutputBuilder serviceDataBuilder = new GreetingOutputBuilder();
- LOG.info( "Reached RPC greeting");
+ LOG.info("Reached RPC greeting");
- LOG.info( svcOperation +" called." );
+ LOG.info(svcOperation + " called.");
- if(input == null ) {
- LOG.debug("exiting " +svcOperation+ " because of invalid input");
+ if (input == null) {
+ LOG.debug("exiting " + svcOperation + " because of invalid input");
serviceDataBuilder.setResponse("Input is null");
- RpcResult<GreetingOutput> rpcResult =
- RpcResultBuilder.<GreetingOutput> status(true).withResult(serviceDataBuilder.build()).build();
+ RpcResult<GreetingOutput> rpcResult = RpcResultBuilder.<GreetingOutput>status(true)
+ .withResult(serviceDataBuilder.build()).build();
return Futures.immediateFuture(rpcResult);
}
// add input to parms
- LOG.info("Adding INPUT data for "+svcOperation+" input: " + input);
+ LOG.info("Adding INPUT data for " + svcOperation + " input: " + input);
GreetingInputBuilder inputBuilder = new GreetingInputBuilder(input);
MdsalHelper.toProperties(parms, inputBuilder.build());
// Call SLI sync method
- try
- {
- if (OofpcipocClient.hasGraph("oofpcipoc-api", svcOperation , null, "sync"))
- {
- LOG.info( "OofpcipocClient has a Directed Graph for '" + svcOperation + "'");
- try
- {
- OofpcipocClient.execute("oofpcipoc-api", svcOperation, null, "sync", serviceDataBuilder, parms);
- }
- catch (Exception e)
- {
- LOG.error("Caught exception executing service logic for "+ svcOperation, e);
+ try {
+ if (OofpcipocClient.hasGraph("oofpcipoc-api", svcOperation, null, "sync")) {
+ LOG.info("OofpcipocClient has a Directed Graph for '" + svcOperation + "'");
+ try {
+ OofpcipocClient.execute("oofpcipoc-api", svcOperation, null, "sync", serviceDataBuilder, parms);
+ } catch (Exception e) {
+ LOG.error("Caught exception executing service logic for " + svcOperation, e);
serviceDataBuilder.setResponse("500");
}
} else {
LOG.error("No service logic active for Oofpcipoc: '" + svcOperation + "'");
serviceDataBuilder.setResponse("503");
}
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
LOG.error("Caught exception looking for service logic", e);
serviceDataBuilder.setResponse("500");
}
@@ -151,22 +147,22 @@
String errorCode = serviceDataBuilder.getResponse();
if (!("0".equals(errorCode) || "200".equals(errorCode))) {
- LOG.error("Returned FAILED for "+svcOperation+" error code: '" + errorCode + "'");
+ LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'");
} else {
- LOG.info("Returned SUCCESS for "+svcOperation+" ");
- serviceDataBuilder.setResponse("Welcome OOF POC " + input.getSalutation());
+ LOG.info("Returned SUCCESS for " + svcOperation + " ");
+ serviceDataBuilder.setResponse("Welcome OOF POC " + input.getSalutation());
}
- RpcResult<GreetingOutput> rpcResult =
- RpcResultBuilder.<GreetingOutput> status(true).withResult(serviceDataBuilder.build()).build();
+ RpcResult<GreetingOutput> rpcResult = RpcResultBuilder.<GreetingOutput>status(true)
+ .withResult(serviceDataBuilder.build()).build();
- LOG.info("Successful exit from greeting ");
+ LOG.info("Successful exit from greeting ");
return Futures.immediateFuture(rpcResult);
}
// RPC configuration-phy-cell-id
- @Override
+ @Override
public ListenableFuture<RpcResult<ConfigurationPhyCellIdOutput>> configurationPhyCellId(
ConfigurationPhyCellIdInput input) {
final String svcOperation = "configuration-phy-cell-id";
@@ -174,47 +170,40 @@
Properties parms = new Properties();
ConfigurationPhyCellIdOutputBuilder serviceDataBuilder = new ConfigurationPhyCellIdOutputBuilder();
- LOG.info( "Reached RPC configurationPhyCellId");
+ LOG.info("Reached RPC configurationPhyCellId");
- LOG.info( svcOperation +" called." );
+ LOG.info(svcOperation + " called.");
- if(input == null ) {
- LOG.debug("exiting " +svcOperation+ " because of invalid input");
+ if (input == null) {
+ LOG.debug("exiting " + svcOperation + " because of invalid input");
serviceDataBuilder.setResponseCode("Input is null");
- RpcResult<ConfigurationPhyCellIdOutput> rpcResult =
- RpcResultBuilder.<ConfigurationPhyCellIdOutput> status(true).withResult(serviceDataBuilder.build()).build();
+ RpcResult<ConfigurationPhyCellIdOutput> rpcResult = RpcResultBuilder
+ .<ConfigurationPhyCellIdOutput>status(true).withResult(serviceDataBuilder.build()).build();
return Futures.immediateFuture(rpcResult);
}
// add input to parms
- LOG.info("Adding INPUT data for "+svcOperation+" input: " + input);
+ LOG.info("Adding INPUT data for " + svcOperation + " input: " + input);
ConfigurationPhyCellIdInputBuilder inputBuilder = new ConfigurationPhyCellIdInputBuilder(input);
MdsalHelper.toProperties(parms, inputBuilder.build());
// Call SLI sync method
- try
- {
+ try {
- if (OofpcipocClient.hasGraph("oofpcipoc-api", svcOperation , null, "sync"))
- {
- LOG.info( "OofpcipocClient has a Directed Graph for '" + svcOperation + "'");
+ if (OofpcipocClient.hasGraph("oofpcipoc-api", svcOperation, null, "sync")) {
+ LOG.info("OofpcipocClient has a Directed Graph for '" + svcOperation + "'");
- try
- {
+ try {
OofpcipocClient.execute("oofpcipoc-api", svcOperation, null, "sync", serviceDataBuilder, parms);
- }
- catch (Exception e)
- {
- LOG.error("Caught exception executing service logic for "+ svcOperation, e);
+ } catch (Exception e) {
+ LOG.error("Caught exception executing service logic for " + svcOperation, e);
serviceDataBuilder.setResponseCode("500");
}
} else {
LOG.error("No service logic active for Oofpcipoc: '" + svcOperation + "'");
serviceDataBuilder.setResponseCode("503");
}
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
LOG.error("Caught exception looking for service logic", e);
serviceDataBuilder.setResponseCode("500");
}
@@ -222,292 +211,267 @@
String errorCode = serviceDataBuilder.getResponseCode();
if (!("0".equals(errorCode) || "200".equals(errorCode))) {
- LOG.error("Returned FAILED for "+svcOperation+" error code: '" + errorCode + "'");
+ LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'");
} else {
- LOG.info("Returned SUCCESS for "+svcOperation+" ");
- serviceDataBuilder.setResponseCode("Welcome OOF POC. Number of FAP entries " + input.getFapServiceNumberOfEntries());
+ LOG.info("Returned SUCCESS for " + svcOperation + " ");
+ serviceDataBuilder
+ .setResponseCode("Welcome OOF POC. Number of FAP entries " + input.getFapServiceNumberOfEntries());
}
- RpcResult<ConfigurationPhyCellIdOutput> rpcResult =
- RpcResultBuilder.<ConfigurationPhyCellIdOutput> status(true).withResult(serviceDataBuilder.build()).build();
+ RpcResult<ConfigurationPhyCellIdOutput> rpcResult = RpcResultBuilder.<ConfigurationPhyCellIdOutput>status(true)
+ .withResult(serviceDataBuilder.build()).build();
return Futures.immediateFuture(rpcResult);
}
- // RPC add-neighbor
- @Override
- public ListenableFuture<RpcResult<AddNeighborOutput>> addNeighbor(
- AddNeighborInput input) {
- final String svcOperation = "add-neighbor";
+ // RPC add-neighbor
+ @Override
+ public ListenableFuture<RpcResult<AddNeighborOutput>> addNeighbor(AddNeighborInput input) {
+ final String svcOperation = "add-neighbor";
- Properties parms = new Properties();
- AddNeighborOutputBuilder serviceDataBuilder = new AddNeighborOutputBuilder();
+ Properties parms = new Properties();
+ AddNeighborOutputBuilder serviceDataBuilder = new AddNeighborOutputBuilder();
- LOG.info( "Reached RPC addNeighbor");
+ LOG.info("Reached RPC addNeighbor");
- LOG.info( svcOperation +" called." );
+ LOG.info(svcOperation + " called.");
- if(input == null ) {
- LOG.debug("exiting " +svcOperation+ " because of invalid input");
- serviceDataBuilder.setResponseCode("Input is null");
- RpcResult<AddNeighborOutput> rpcResult =
- RpcResultBuilder.<AddNeighborOutput> status(true).withResult(serviceDataBuilder.build()).build();
- return Futures.immediateFuture(rpcResult);
- }
+ if (input == null) {
+ LOG.debug("exiting " + svcOperation + " because of invalid input");
+ serviceDataBuilder.setResponseCode("Input is null");
+ RpcResult<AddNeighborOutput> rpcResult = RpcResultBuilder.<AddNeighborOutput>status(true)
+ .withResult(serviceDataBuilder.build()).build();
+ return Futures.immediateFuture(rpcResult);
+ }
- // add input to parms
- LOG.info("Adding INPUT data for "+svcOperation+" input: " + input);
- AddNeighborInputBuilder inputBuilder = new AddNeighborInputBuilder(input);
- MdsalHelper.toProperties(parms, inputBuilder.build());
+ // add input to parms
+ LOG.info("Adding INPUT data for " + svcOperation + " input: " + input);
+ AddNeighborInputBuilder inputBuilder = new AddNeighborInputBuilder(input);
+ MdsalHelper.toProperties(parms, inputBuilder.build());
- // Call SLI sync method
- try
- {
+ // Call SLI sync method
+ try {
- if (OofpcipocClient.hasGraph("oofpcipoc-api", svcOperation , null, "sync"))
- {
- LOG.info( "OofpcipocClient has a Directed Graph for '" + svcOperation + "'");
+ if (OofpcipocClient.hasGraph("oofpcipoc-api", svcOperation, null, "sync")) {
+ LOG.info("OofpcipocClient has a Directed Graph for '" + svcOperation + "'");
- try
- {
- OofpcipocClient.execute("oofpcipoc-api", svcOperation, null, "sync", serviceDataBuilder, parms);
- }
- catch (Exception e)
- {
- LOG.error("Caught exception executing service logic for "+ svcOperation, e);
- serviceDataBuilder.setResponseCode("500");
- }
- } else {
- LOG.error("No service logic active for Oofpcipoc: '" + svcOperation + "'");
- serviceDataBuilder.setResponseCode("503");
- }
- }
- catch (Exception e)
- {
- LOG.error("Caught exception looking for service logic", e);
- serviceDataBuilder.setResponseCode("500");
- }
+ try {
+ OofpcipocClient.execute("oofpcipoc-api", svcOperation, null, "sync", serviceDataBuilder, parms);
+ } catch (Exception e) {
+ LOG.error("Caught exception executing service logic for " + svcOperation, e);
+ serviceDataBuilder.setResponseCode("500");
+ }
+ } else {
+ LOG.error("No service logic active for Oofpcipoc: '" + svcOperation + "'");
+ serviceDataBuilder.setResponseCode("503");
+ }
+ } catch (Exception e) {
+ LOG.error("Caught exception looking for service logic", e);
+ serviceDataBuilder.setResponseCode("500");
+ }
- String errorCode = serviceDataBuilder.getResponseCode();
+ String errorCode = serviceDataBuilder.getResponseCode();
- if (!("0".equals(errorCode) || "200".equals(errorCode))) {
- LOG.error("Returned FAILED for "+svcOperation+" error code: '" + errorCode + "'");
- } else {
- LOG.info("Returned SUCCESS for "+svcOperation+" ");
- serviceDataBuilder.setResponseCode("Welcome OOF POC. Number of Neighbor entries to be added " + input.getLteCellNumberOfEntries());
- }
+ if (!("0".equals(errorCode) || "200".equals(errorCode))) {
+ LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'");
+ } else {
+ LOG.info("Returned SUCCESS for " + svcOperation + " ");
+ serviceDataBuilder.setResponseCode(
+ "Welcome OOF POC. Number of Neighbor entries to be added " + input.getLteCellNumberOfEntries());
+ }
- RpcResult<AddNeighborOutput> rpcResult =
- RpcResultBuilder.<AddNeighborOutput> status(true).withResult(serviceDataBuilder.build()).build();
+ RpcResult<AddNeighborOutput> rpcResult = RpcResultBuilder.<AddNeighborOutput>status(true)
+ .withResult(serviceDataBuilder.build()).build();
- return Futures.immediateFuture(rpcResult);
- }
+ return Futures.immediateFuture(rpcResult);
+ }
- // RPC delete-neighbor
- @Override
- public ListenableFuture<RpcResult<DeleteNeighborOutput>> deleteNeighbor(
- DeleteNeighborInput input) {
- final String svcOperation = "delete-neighbor";
+ // RPC delete-neighbor
+ @Override
+ public ListenableFuture<RpcResult<DeleteNeighborOutput>> deleteNeighbor(DeleteNeighborInput input) {
+ final String svcOperation = "delete-neighbor";
- Properties parms = new Properties();
- DeleteNeighborOutputBuilder serviceDataBuilder = new DeleteNeighborOutputBuilder();
+ Properties parms = new Properties();
+ DeleteNeighborOutputBuilder serviceDataBuilder = new DeleteNeighborOutputBuilder();
- LOG.info( "Reached RPC deleteNeighbor");
+ LOG.info("Reached RPC deleteNeighbor");
- LOG.info( svcOperation +" called." );
+ LOG.info(svcOperation + " called.");
- if(input == null ) {
- LOG.debug("exiting " +svcOperation+ " because of invalid input");
- serviceDataBuilder.setResponseCode("Input is null");
- RpcResult<DeleteNeighborOutput> rpcResult =
- RpcResultBuilder.<DeleteNeighborOutput> status(true).withResult(serviceDataBuilder.build()).build();
- return Futures.immediateFuture(rpcResult);
- }
+ if (input == null) {
+ LOG.debug("exiting " + svcOperation + " because of invalid input");
+ serviceDataBuilder.setResponseCode("Input is null");
+ RpcResult<DeleteNeighborOutput> rpcResult = RpcResultBuilder.<DeleteNeighborOutput>status(true)
+ .withResult(serviceDataBuilder.build()).build();
+ return Futures.immediateFuture(rpcResult);
+ }
- // add input to parms
- LOG.info("Adding INPUT data for "+svcOperation+" input: " + input);
- DeleteNeighborInputBuilder inputBuilder = new DeleteNeighborInputBuilder(input);
- MdsalHelper.toProperties(parms, inputBuilder.build());
+ // add input to parms
+ LOG.info("Adding INPUT data for " + svcOperation + " input: " + input);
+ DeleteNeighborInputBuilder inputBuilder = new DeleteNeighborInputBuilder(input);
+ MdsalHelper.toProperties(parms, inputBuilder.build());
- // Call SLI sync method
- try
- {
+ // Call SLI sync method
+ try {
- if (OofpcipocClient.hasGraph("oofpcipoc-api", svcOperation , null, "sync"))
- {
- LOG.info( "OofpcipocClient has a Directed Graph for '" + svcOperation + "'");
+ if (OofpcipocClient.hasGraph("oofpcipoc-api", svcOperation, null, "sync")) {
+ LOG.info("OofpcipocClient has a Directed Graph for '" + svcOperation + "'");
- try
- {
- OofpcipocClient.execute("oofpcipoc-api", svcOperation, null, "sync", serviceDataBuilder, parms);
- }
- catch (Exception e)
- {
- LOG.error("Caught exception executing service logic for "+ svcOperation, e);
- serviceDataBuilder.setResponseCode("500");
- }
- } else {
- LOG.error("No service logic active for Oofpcipoc: '" + svcOperation + "'");
- serviceDataBuilder.setResponseCode("503");
- }
- }
- catch (Exception e)
- {
- LOG.error("Caught exception looking for service logic", e);
- serviceDataBuilder.setResponseCode("500");
- }
+ try {
+ OofpcipocClient.execute("oofpcipoc-api", svcOperation, null, "sync", serviceDataBuilder, parms);
+ } catch (Exception e) {
+ LOG.error("Caught exception executing service logic for " + svcOperation, e);
+ serviceDataBuilder.setResponseCode("500");
+ }
+ } else {
+ LOG.error("No service logic active for Oofpcipoc: '" + svcOperation + "'");
+ serviceDataBuilder.setResponseCode("503");
+ }
+ } catch (Exception e) {
+ LOG.error("Caught exception looking for service logic", e);
+ serviceDataBuilder.setResponseCode("500");
+ }
- String errorCode = serviceDataBuilder.getResponseCode();
+ String errorCode = serviceDataBuilder.getResponseCode();
- if (!("0".equals(errorCode) || "200".equals(errorCode))) {
- LOG.error("Returned FAILED for "+svcOperation+" error code: '" + errorCode + "'");
- } else {
- LOG.info("Returned SUCCESS for "+svcOperation+" ");
- serviceDataBuilder.setResponseCode("Welcome OOF POC. Number of Neighbor entries to be deleted " + input.getLteCellNumberOfEntries());
- }
+ if (!("0".equals(errorCode) || "200".equals(errorCode))) {
+ LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'");
+ } else {
+ LOG.info("Returned SUCCESS for " + svcOperation + " ");
+ serviceDataBuilder.setResponseCode(
+ "Welcome OOF POC. Number of Neighbor entries to be deleted " + input.getLteCellNumberOfEntries());
+ }
- RpcResult<DeleteNeighborOutput> rpcResult =
- RpcResultBuilder.<DeleteNeighborOutput> status(true).withResult(serviceDataBuilder.build()).build();
+ RpcResult<DeleteNeighborOutput> rpcResult = RpcResultBuilder.<DeleteNeighborOutput>status(true)
+ .withResult(serviceDataBuilder.build()).build();
- return Futures.immediateFuture(rpcResult);
- }
+ return Futures.immediateFuture(rpcResult);
+ }
- // RPC generic-neighbor-configuration
- @Override
- public ListenableFuture<RpcResult<GenericNeighborConfigurationOutput>> genericNeighborConfiguration(
- GenericNeighborConfigurationInput input) {
- final String svcOperation = "generic-neighbor-configuration";
+ // RPC generic-neighbor-configuration
+ @Override
+ public ListenableFuture<RpcResult<GenericNeighborConfigurationOutput>> genericNeighborConfiguration(
+ GenericNeighborConfigurationInput input) {
+ final String svcOperation = "generic-neighbor-configuration";
- Properties parms = new Properties();
- GenericNeighborConfigurationOutputBuilder serviceDataBuilder = new GenericNeighborConfigurationOutputBuilder();
+ Properties parms = new Properties();
+ GenericNeighborConfigurationOutputBuilder serviceDataBuilder = new GenericNeighborConfigurationOutputBuilder();
- LOG.info( "Reached RPC genericNeighborConfiguration");
+ LOG.info("Reached RPC genericNeighborConfiguration");
- LOG.info( svcOperation +" called." );
+ LOG.info(svcOperation + " called.");
- if(input == null ) {
- LOG.debug("exiting " +svcOperation+ " because of invalid input");
- serviceDataBuilder.setResponseCode("Input is null");
- RpcResult<GenericNeighborConfigurationOutput> rpcResult =
- RpcResultBuilder.<GenericNeighborConfigurationOutput> status(true).withResult(serviceDataBuilder.build()).build();
- return Futures.immediateFuture(rpcResult);
- }
+ if (input == null) {
+ LOG.debug("exiting " + svcOperation + " because of invalid input");
+ serviceDataBuilder.setResponseCode("Input is null");
+ RpcResult<GenericNeighborConfigurationOutput> rpcResult = RpcResultBuilder
+ .<GenericNeighborConfigurationOutput>status(true).withResult(serviceDataBuilder.build()).build();
+ return Futures.immediateFuture(rpcResult);
+ }
- // add input to parms
- LOG.info("Adding INPUT data for "+svcOperation+" input: " + input);
- GenericNeighborConfigurationInputBuilder inputBuilder = new GenericNeighborConfigurationInputBuilder(input);
- MdsalHelper.toProperties(parms, inputBuilder.build());
+ // add input to parms
+ LOG.info("Adding INPUT data for " + svcOperation + " input: " + input);
+ GenericNeighborConfigurationInputBuilder inputBuilder = new GenericNeighborConfigurationInputBuilder(input);
+ MdsalHelper.toProperties(parms, inputBuilder.build());
- // Call SLI sync method
- try
- {
+ // Call SLI sync method
+ try {
- if (OofpcipocClient.hasGraph("oofpcipoc-api", svcOperation , null, "sync"))
- {
- LOG.info( "OofpcipocClient has a Directed Graph for '" + svcOperation + "'");
+ if (OofpcipocClient.hasGraph("oofpcipoc-api", svcOperation, null, "sync")) {
+ LOG.info("OofpcipocClient has a Directed Graph for '" + svcOperation + "'");
- try
- {
- OofpcipocClient.execute("oofpcipoc-api", svcOperation, null, "sync", serviceDataBuilder, parms);
- }
- catch (Exception e)
- {
- LOG.error("Caught exception executing service logic for "+ svcOperation, e);
- serviceDataBuilder.setResponseCode("500");
- }
- } else {
- LOG.error("No service logic active for Oofpcipoc: '" + svcOperation + "'");
- serviceDataBuilder.setResponseCode("503");
- }
- }
- catch (Exception e)
- {
- LOG.error("Caught exception looking for service logic", e);
- serviceDataBuilder.setResponseCode("500");
- }
+ try {
+ OofpcipocClient.execute("oofpcipoc-api", svcOperation, null, "sync", serviceDataBuilder, parms);
+ } catch (Exception e) {
+ LOG.error("Caught exception executing service logic for " + svcOperation, e);
+ serviceDataBuilder.setResponseCode("500");
+ }
+ } else {
+ LOG.error("No service logic active for Oofpcipoc: '" + svcOperation + "'");
+ serviceDataBuilder.setResponseCode("503");
+ }
+ } catch (Exception e) {
+ LOG.error("Caught exception looking for service logic", e);
+ serviceDataBuilder.setResponseCode("500");
+ }
- String errorCode = serviceDataBuilder.getResponseCode();
+ String errorCode = serviceDataBuilder.getResponseCode();
- if (!("0".equals(errorCode) || "200".equals(errorCode))) {
- LOG.error("Returned FAILED for "+svcOperation+" error code: '" + errorCode + "'");
- } else {
- LOG.info("Returned SUCCESS for "+svcOperation+" ");
- serviceDataBuilder.setResponseCode("Welcome OOF POC. Number of Neighbor entries to be configured " + input.getLteCellNumberOfEntries());
- }
+ if (!("0".equals(errorCode) || "200".equals(errorCode))) {
+ LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'");
+ } else {
+ LOG.info("Returned SUCCESS for " + svcOperation + " ");
+ serviceDataBuilder.setResponseCode("Welcome OOF POC. Number of Neighbor entries to be configured "
+ + input.getLteCellNumberOfEntries());
+ }
- RpcResult<GenericNeighborConfigurationOutput> rpcResult =
- RpcResultBuilder.<GenericNeighborConfigurationOutput> status(true).withResult(serviceDataBuilder.build()).build();
+ RpcResult<GenericNeighborConfigurationOutput> rpcResult = RpcResultBuilder
+ .<GenericNeighborConfigurationOutput>status(true).withResult(serviceDataBuilder.build()).build();
- return Futures.immediateFuture(rpcResult);
- }
+ return Futures.immediateFuture(rpcResult);
+ }
- // RPC handle-nbrlist-change-notif
- @Override
- public ListenableFuture<RpcResult<HandleNbrlistChangeNotifOutput>> handleNbrlistChangeNotif(
- HandleNbrlistChangeNotifInput input) {
- final String svcOperation = "handle-nbrlist-change-notif";
+ // RPC handle-nbrlist-change-notif
+ @Override
+ public ListenableFuture<RpcResult<HandleNbrlistChangeNotifOutput>> handleNbrlistChangeNotif(
+ HandleNbrlistChangeNotifInput input) {
+ final String svcOperation = "handle-nbrlist-change-notif";
- Properties parms = new Properties();
- HandleNbrlistChangeNotifOutputBuilder serviceDataBuilder = new HandleNbrlistChangeNotifOutputBuilder();
+ Properties parms = new Properties();
+ HandleNbrlistChangeNotifOutputBuilder serviceDataBuilder = new HandleNbrlistChangeNotifOutputBuilder();
- LOG.info( "Reached RPC handle-nbrlist-change-notif");
+ LOG.info("Reached RPC handle-nbrlist-change-notif");
- LOG.info( svcOperation +" called." );
+ LOG.info(svcOperation + " called.");
- if(input == null ) {
- LOG.debug("exiting " +svcOperation+ " because of invalid input");
- serviceDataBuilder.setResponseCode("Input is null");
- RpcResult<HandleNbrlistChangeNotifOutput> rpcResult =
- RpcResultBuilder.<HandleNbrlistChangeNotifOutput> status(true).withResult(serviceDataBuilder.build()).build();
- return Futures.immediateFuture(rpcResult);
- }
+ if (input == null) {
+ LOG.debug("exiting " + svcOperation + " because of invalid input");
+ serviceDataBuilder.setResponseCode("Input is null");
+ RpcResult<HandleNbrlistChangeNotifOutput> rpcResult = RpcResultBuilder
+ .<HandleNbrlistChangeNotifOutput>status(true).withResult(serviceDataBuilder.build()).build();
+ return Futures.immediateFuture(rpcResult);
+ }
- // add input to parms
- LOG.info("Adding INPUT data for "+svcOperation+" input: " + input);
- HandleNbrlistChangeNotifInputBuilder inputBuilder = new HandleNbrlistChangeNotifInputBuilder(input);
- MdsalHelper.toProperties(parms, inputBuilder.build());
+ // add input to parms
+ LOG.info("Adding INPUT data for " + svcOperation + " input: " + input);
+ HandleNbrlistChangeNotifInputBuilder inputBuilder = new HandleNbrlistChangeNotifInputBuilder(input);
+ MdsalHelper.toProperties(parms, inputBuilder.build());
- // Call SLI sync method
- try
- {
- if (OofpcipocClient.hasGraph("oofpcipoc-api", svcOperation , null, "sync"))
- {
- LOG.info( "OofpcipocClient has a Directed Graph for '" + svcOperation + "'");
- try
- {
- OofpcipocClient.execute("oofpcipoc-api", svcOperation, null, "sync", serviceDataBuilder, parms);
- }
- catch (Exception e)
- {
- LOG.error("Caught exception executing service logic for "+ svcOperation, e);
- serviceDataBuilder.setResponseCode("500");
- }
- } else {
- LOG.error("No service logic active for Oofpcipoc: '" + svcOperation + "'");
- serviceDataBuilder.setResponseCode("503");
- }
- }
- catch (Exception e)
- {
- LOG.error("Caught exception looking for service logic", e);
- serviceDataBuilder.setResponseCode("500");
- }
+ // Call SLI sync method
+ try {
+ if (OofpcipocClient.hasGraph("oofpcipoc-api", svcOperation, null, "sync")) {
+ LOG.info("OofpcipocClient has a Directed Graph for '" + svcOperation + "'");
+ try {
+ OofpcipocClient.execute("oofpcipoc-api", svcOperation, null, "sync", serviceDataBuilder, parms);
+ } catch (Exception e) {
+ LOG.error("Caught exception executing service logic for " + svcOperation, e);
+ serviceDataBuilder.setResponseCode("500");
+ }
+ } else {
+ LOG.error("No service logic active for Oofpcipoc: '" + svcOperation + "'");
+ serviceDataBuilder.setResponseCode("503");
+ }
+ } catch (Exception e) {
+ LOG.error("Caught exception looking for service logic", e);
+ serviceDataBuilder.setResponseCode("500");
+ }
- String errorCode = serviceDataBuilder.getResponseCode();
+ String errorCode = serviceDataBuilder.getResponseCode();
- if (!("0".equals(errorCode) || "200".equals(errorCode))) {
- LOG.error("Returned FAILED for "+svcOperation+" error code: '" + errorCode + "'");
- } else {
- LOG.info("Returned SUCCESS for "+svcOperation+" ");
- serviceDataBuilder.setResponseCode("Welcome OOF POC. Number of FAP services changed = " + input.getFapServiceNumberOfEntriesChanged());
- }
+ if (!("0".equals(errorCode) || "200".equals(errorCode))) {
+ LOG.error("Returned FAILED for " + svcOperation + " error code: '" + errorCode + "'");
+ } else {
+ LOG.info("Returned SUCCESS for " + svcOperation + " ");
+ serviceDataBuilder.setResponseCode(
+ "Welcome OOF POC. Number of FAP services changed = " + input.getFapServiceNumberOfEntriesChanged());
+ }
- RpcResult<HandleNbrlistChangeNotifOutput> rpcResult =
- RpcResultBuilder.<HandleNbrlistChangeNotifOutput> status(true).withResult(serviceDataBuilder.build()).build();
+ RpcResult<HandleNbrlistChangeNotifOutput> rpcResult = RpcResultBuilder
+ .<HandleNbrlistChangeNotifOutput>status(true).withResult(serviceDataBuilder.build()).build();
- LOG.info("Successful exit from handle-nbrlist-change-notif ");
+ LOG.info("Successful exit from handle-nbrlist-change-notif ");
- return Futures.immediateFuture(rpcResult);
- }
+ return Futures.immediateFuture(rpcResult);
+ }
}
diff --git a/sdnr/northbound/oofpcipoc/provider/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml b/sdnr/northbound/oofpcipoc/provider/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml
deleted file mode 100644
index d62c2f7..0000000
--- a/sdnr/northbound/oofpcipoc/provider/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ ============LICENSE_START=======================================================
- ~ ONAP : ccsdk features
- ~ ================================================================================
- ~ Copyright (C) 2020 AT&T Intellectual Property. 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.
- ~ ============LICENSE_END=======================================================
- ~
- -->
-
-<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="svcLogicService"
- interface="org.onap.ccsdk.sli.core.sli.provider.SvcLogicService"/>
-
- <bean id="client" class="org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.OofpcipocClient">
- <argument ref="svcLogicService"/>
- </bean>
-
- <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
- odl:type="default"/>
-
- <reference id="notificationService"
- interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService"
- odl:type="default"/>
-
- <reference id="rpcRegistry" interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"
- odl:type="default"/>
-
- <bean id="provider" class="org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.OofpcipocProvider">
- <argument ref="dataBroker"/>
- <argument ref="rpcRegistry"/>
- <argument ref="notificationService"/>
- <argument ref="client"/>
- </bean>
-
-</blueprint>
diff --git a/sdnr/northbound/oofpcipoc/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml b/sdnr/northbound/oofpcipoc/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
index d62c2f7..a02e4a4 100644
--- a/sdnr/northbound/oofpcipoc/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
+++ b/sdnr/northbound/oofpcipoc/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
@@ -1,50 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ ============LICENSE_START=======================================================
- ~ ONAP : ccsdk features
- ~ ================================================================================
- ~ Copyright (C) 2020 AT&T Intellectual Property. 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.
- ~ ============LICENSE_END=======================================================
- ~
- -->
+<!-- ~ ============LICENSE_START=======================================================
+ ~ ONAP : ccsdk features ~ ================================================================================
+ ~ Copyright (C) 2020 AT&T Intellectual Property. 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.
+ ~ ============LICENSE_END=======================================================
+ ~ -->
-<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">
+<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="svcLogicService"
- interface="org.onap.ccsdk.sli.core.sli.provider.SvcLogicService"/>
+ <reference id="svcLogicService"
+ interface="org.onap.ccsdk.sli.core.sli.provider.SvcLogicService" />
- <bean id="client" class="org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.OofpcipocClient">
- <argument ref="svcLogicService"/>
- </bean>
+ <bean id="client"
+ class="org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.OofpcipocClient">
+ <argument ref="svcLogicService" />
+ </bean>
- <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
- odl:type="default"/>
+ <reference id="dataBroker"
+ interface="org.opendaylight.mdsal.binding.api.DataBroker"/>
- <reference id="notificationService"
- interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService"
- odl:type="default"/>
+ <reference id="rpcProviderService"
+ interface="org.opendaylight.mdsal.binding.api.RpcProviderService" />
- <reference id="rpcRegistry" interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"
- odl:type="default"/>
+ <reference id="notificationPublishService"
+ interface="org.opendaylight.mdsal.binding.api.NotificationPublishService" />
- <bean id="provider" class="org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.OofpcipocProvider">
- <argument ref="dataBroker"/>
- <argument ref="rpcRegistry"/>
- <argument ref="notificationService"/>
- <argument ref="client"/>
- </bean>
+ <bean id="provider"
+ class="org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.OofpcipocProvider"
+ init-method="init" destroy-method="close">
+ <property name="dataBroker" ref="dataBroker" />
+ <property name="rpcProviderService" ref="rpcProviderService" />
+ <property name="notificationPublishService" ref="notificationPublishService" />
+ <property name="client" ref="client" />
+ </bean>
</blueprint>
diff --git a/sdnr/northbound/oofpcipoc/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/TestOofpcipoc.java b/sdnr/northbound/oofpcipoc/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/TestOofpcipoc.java
index daa210e..597c75c 100644
--- a/sdnr/northbound/oofpcipoc/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/TestOofpcipoc.java
+++ b/sdnr/northbound/oofpcipoc/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/TestOofpcipoc.java
@@ -24,14 +24,6 @@
import org.junit.Before;
import org.junit.Test;
-import org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.OofpcipocClient;
-import org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.OofpcipocProvider;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
-import org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -41,15 +33,18 @@
import java.math.*;
-import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev190308.ConfigurationPhyCellIdInput;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
+import org.opendaylight.mdsal.binding.api.RpcProviderService;
+
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev190308.ConfigurationPhyCellIdInputBuilder;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev190308.ConfigurationPhyCellIdOutput;
-import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev190308.ConfigurationPhyCellIdOutputBuilder;
+
import com.google.common.util.concurrent.ListenableFuture;
-public class TestOofpcipoc extends AbstractConcurrentDataBrokerTest {
+public class TestOofpcipoc {
private OofpcipocProvider oofpcipocProvider;
private static final Logger LOG = LoggerFactory.getLogger(OofpcipocProvider.class);
@@ -57,11 +52,15 @@
@Before
public void setUp() throws Exception {
if (null == oofpcipocProvider) {
- DataBroker dataBroker = getDataBroker();
+ DataBroker dataBroker = mock(DataBroker.class);
NotificationPublishService mockNotification = mock(NotificationPublishService.class);
- RpcProviderRegistry mockRpcRegistry = mock(RpcProviderRegistry.class);
+ RpcProviderService mockRpcRegistry = mock(RpcProviderService.class);
OofpcipocClient mockSliClient = mock(OofpcipocClient.class);
- oofpcipocProvider = new OofpcipocProvider(dataBroker, mockNotification, mockRpcRegistry, mockSliClient);
+ oofpcipocProvider = new OofpcipocProvider();
+ oofpcipocProvider.setDataBroker(dataBroker);
+ oofpcipocProvider.setNotificationPublishService(mockNotification);
+ oofpcipocProvider.setRpcProviderService(mockRpcRegistry);
+ oofpcipocProvider.setClient(mockSliClient);
}
}
diff --git a/sdnr/northbound/pom.xml b/sdnr/northbound/pom.xml
index 071b5ca..fa94a96 100644
--- a/sdnr/northbound/pom.xml
+++ b/sdnr/northbound/pom.xml
@@ -29,7 +29,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/ranSlice/feature/pom.xml b/sdnr/northbound/ranSlice/feature/pom.xml
index 4ee6e41..c390455 100644
--- a/sdnr/northbound/ranSlice/feature/pom.xml
+++ b/sdnr/northbound/ranSlice/feature/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/ranSlice/installer/pom.xml b/sdnr/northbound/ranSlice/installer/pom.xml
index 1fe6d10..d84c7c5 100644
--- a/sdnr/northbound/ranSlice/installer/pom.xml
+++ b/sdnr/northbound/ranSlice/installer/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/ranSlice/model/pom.xml b/sdnr/northbound/ranSlice/model/pom.xml
index 8de8531..924e4ee 100644
--- a/sdnr/northbound/ranSlice/model/pom.xml
+++ b/sdnr/northbound/ranSlice/model/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>binding-parent</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/ranSlice/pom.xml b/sdnr/northbound/ranSlice/pom.xml
index 1507141..5c44356 100644
--- a/sdnr/northbound/ranSlice/pom.xml
+++ b/sdnr/northbound/ranSlice/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/northbound/ranSlice/provider/pom.xml b/sdnr/northbound/ranSlice/provider/pom.xml
index 03563b9..a4e0680 100644
--- a/sdnr/northbound/ranSlice/provider/pom.xml
+++ b/sdnr/northbound/ranSlice/provider/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>binding-parent</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
@@ -39,14 +39,7 @@
<dependencyManagement>
<dependencies>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>mdsal-artifacts</artifactId>
- <version>1.6.1</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
+ <dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sli-core-artifacts</artifactId>
<version>${ccsdk.sli.core.version}</version>
@@ -61,27 +54,13 @@
<artifactId>ranSlice-model</artifactId>
<version>${project.version}</version>
</dependency>
- <!--
<dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-config</artifactId>
- </dependency>
- -->
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-api</artifactId>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-api</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-common-util</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-core-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-broker-impl</artifactId>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-dom-api</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
diff --git a/sdnr/northbound/ranSlice/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceClient.java b/sdnr/northbound/ranSlice/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceClient.java
index f3d2a7d..0b1d8c5 100644
--- a/sdnr/northbound/ranSlice/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceClient.java
+++ b/sdnr/northbound/ranSlice/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceClient.java
@@ -27,7 +27,7 @@
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/sdnr/northbound/ranSlice/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceProvider.java b/sdnr/northbound/ranSlice/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceProvider.java
index a88595b..fbaab93 100644
--- a/sdnr/northbound/ranSlice/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceProvider.java
+++ b/sdnr/northbound/ranSlice/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceProvider.java
@@ -27,17 +27,15 @@
import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
-import org.opendaylight.controller.md.sal.binding.impl.AbstractForwardedDataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+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.rev200806.*;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev200806.common.header.CommonHeaderBuilder;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev200806.status.StatusBuilder;
+import org.opendaylight.yangtools.concepts.ObjectRegistration;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.slf4j.Logger;
@@ -46,8 +44,6 @@
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
-import org.onap.ccsdk.features.sdnr.northbound.ranSlice.RANSliceResponseCode.*;
-
/**
* Defines a base implementation for your provider. This class extends from a
* helper class which provides storage for the most commonly used components of
@@ -97,43 +93,56 @@
protected DataBroker dataBroker;
protected DOMDataBroker domDataBroker;
protected NotificationPublishService notificationService;
- protected RpcProviderRegistry rpcRegistry;
- private final RANSliceClient RANSliceClient;
+ protected RpcProviderService rpcProviderRegistry;
+ private RANSliceClient RANSliceClient;
- protected BindingAwareBroker.RpcRegistration<RanSliceApiService> rpcRegistration;
+ private ObjectRegistration<RanSliceApiService> rpcRegistration;
- public RANSliceProvider(final DataBroker dataBroker, final NotificationPublishService notificationPublishService,
- final RpcProviderRegistry rpcProviderRegistry, final RANSliceClient rANSliceClient) {
+ public RANSliceProvider() {
LOG.info("Creating provider for {}", APPLICATION_NAME);
executor = Executors.newFixedThreadPool(1);
- this.dataBroker = dataBroker;
- if (dataBroker instanceof AbstractForwardedDataBroker) {
- domDataBroker = ((AbstractForwardedDataBroker) dataBroker).getDelegate();
- }
- notificationService = notificationPublishService;
- rpcRegistry = rpcProviderRegistry;
- this.RANSliceClient = rANSliceClient;
- initialize();
+ this.dataBroker = null;
+ this.domDataBroker = null;
+ this.notificationService = null;
+ this.rpcProviderRegistry = null;
+ this.rpcRegistration = null;
+ this.RANSliceClient = null;
}
- public void initialize() {
- LOG.info("Initializing {} for {}", this.getClass().getName(), APPLICATION_NAME);
+ public void setDataBroker(DataBroker dataBroker) {
+ this.dataBroker = dataBroker;
+ }
+ public void setDomDataBroker(DOMDataBroker domDataBroker) {
+ this.domDataBroker = domDataBroker;
+ }
+
+ public void setRpcProviderRegistry(RpcProviderService rpcProviderRegistry) {
+ this.rpcProviderRegistry = rpcProviderRegistry;
+ }
+
+ public void setNotificationPublishService(NotificationPublishService notificationPublishService) {
+ this.notificationService = notificationPublishService;
+ }
+
+ public void setClient(RANSliceClient client) {
+ this.RANSliceClient = client;
+ }
+
+ public void init() {
+ LOG.info("Initializing {} for {}", this.getClass().getName(), APPLICATION_NAME);
+
if (rpcRegistration == null) {
- if (rpcRegistry != null) {
- rpcRegistration = rpcRegistry.addRpcImplementation(RanSliceApiService.class, this);
+ if (rpcProviderRegistry != null) {
+ rpcRegistration = rpcProviderRegistry.registerRpcImplementation(RanSliceApiService.class, this);
LOG.info("Initialization complete for {}", APPLICATION_NAME);
} else {
LOG.warn("Error initializing {} : rpcRegistry unset", APPLICATION_NAME);
}
}
}
-
- protected void initializeChild() {
- // Override if you have custom initialization intelligence
- }
-
+
@Override
public void close() throws Exception {
LOG.info("Closing provider for " + APPLICATION_NAME);
diff --git a/sdnr/northbound/ranSlice/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceResponseCode.java b/sdnr/northbound/ranSlice/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceResponseCode.java
index 814b27e..77c09d1 100644
--- a/sdnr/northbound/ranSlice/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceResponseCode.java
+++ b/sdnr/northbound/ranSlice/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceResponseCode.java
@@ -1,3 +1,24 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : SDN-C
+ * ================================================================================
+ * Copyright (C) 2020 AT&T Intellectual Property. 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.
+ * ============LICENSE_END=========================================================
+ */
+
package org.onap.ccsdk.features.sdnr.northbound.ranSlice;
public enum RANSliceResponseCode {
diff --git a/sdnr/northbound/ranSlice/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceRpcInvocationException.java b/sdnr/northbound/ranSlice/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceRpcInvocationException.java
index 18b6631..3e6fcb4 100644
--- a/sdnr/northbound/ranSlice/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceRpcInvocationException.java
+++ b/sdnr/northbound/ranSlice/provider/src/main/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceRpcInvocationException.java
@@ -1,3 +1,24 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * openECOMP : SDN-C
+ * ================================================================================
+ * Copyright (C) 2020 AT&T Intellectual Property. 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.
+ * ============LICENSE_END=========================================================
+ */
+
package org.onap.ccsdk.features.sdnr.northbound.ranSlice;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
diff --git a/sdnr/northbound/ranSlice/provider/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml b/sdnr/northbound/ranSlice/provider/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml
deleted file mode 100644
index 57ebfbf..0000000
--- a/sdnr/northbound/ranSlice/provider/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ ============LICENSE_START=======================================================
- ~ ONAP : ccsdk features
- ~ ================================================================================
- ~ Copyright (C) 2020 AT&T Intellectual Property. 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.
- ~ ============LICENSE_END=======================================================
- ~
- -->
-
-<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="svcLogicService"
- interface="org.onap.ccsdk.sli.core.sli.provider.SvcLogicService"/>
-
- <bean id="client" class="org.onap.ccsdk.features.sdnr.northbound.ranSlice.RANSliceClient">
- <argument ref="svcLogicService"/>
- </bean>
-
- <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
- odl:type="default"/>
-
- <reference id="notificationService"
- interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService"
- odl:type="default"/>
-
- <reference id="rpcRegistry" interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"
- odl:type="default"/>
-
- <bean id="provider" class="org.onap.ccsdk.features.sdnr.northbound.ranSlice.RANSliceProvider">
- <argument ref="dataBroker"/>
- <argument ref="rpcRegistry"/>
- <argument ref="notificationService"/>
- <argument ref="client"/>
- </bean>
-
- <odl:rpc-implementation ref="provider"/>
-
-</blueprint>
diff --git a/sdnr/northbound/ranSlice/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml b/sdnr/northbound/ranSlice/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
index 57ebfbf..896c057 100644
--- a/sdnr/northbound/ranSlice/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
+++ b/sdnr/northbound/ranSlice/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
@@ -30,21 +30,25 @@
<argument ref="svcLogicService"/>
</bean>
- <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
- odl:type="default"/>
+ <reference id="dataBroker"
+ interface="org.opendaylight.mdsal.binding.api.DataBroker"/>
+
+ <reference id="domDataBroker"
+ interface="org.opendaylight.mdsal.dom.api.DOMDataBroker"/>
+
+ <reference id="notificationPublishService"
+ interface="org.opendaylight.mdsal.binding.api.NotificationPublishService" />
- <reference id="notificationService"
- interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService"
- odl:type="default"/>
+ <reference id="rpcProviderRegistry"
+ interface="org.opendaylight.mdsal.binding.api.RpcProviderService" />
- <reference id="rpcRegistry" interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"
- odl:type="default"/>
-
- <bean id="provider" class="org.onap.ccsdk.features.sdnr.northbound.ranSlice.RANSliceProvider">
- <argument ref="dataBroker"/>
- <argument ref="rpcRegistry"/>
- <argument ref="notificationService"/>
- <argument ref="client"/>
+ <bean id="provider" class="org.onap.ccsdk.features.sdnr.northbound.ranSlice.RANSliceProvider"
+ init-method="init" destroy-method="close">
+ <property name="dataBroker" ref="dataBroker"/>
+ <property name="domDataBroker" ref="domDataBroker"/>
+ <property name="rpcProviderRegistry" ref="rpcProviderRegistry"/>
+ <property name="notificationPublishService" ref="notificationPublishService"/>
+ <property name="client" ref="client"/>
</bean>
<odl:rpc-implementation ref="provider"/>
diff --git a/sdnr/northbound/ranSlice/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceProviderTest.java b/sdnr/northbound/ranSlice/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceProviderTest.java
index f1e1524..4bd3e50 100644
--- a/sdnr/northbound/ranSlice/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceProviderTest.java
+++ b/sdnr/northbound/ranSlice/provider/src/test/java/org/onap/ccsdk/features/sdnr/northbound/ranSlice/RANSliceProviderTest.java
@@ -42,13 +42,17 @@
import org.onap.ccsdk.sli.core.sli.provider.SvcLogicClassResolver;
import org.onap.ccsdk.sli.core.sli.provider.SvcLogicPropertiesProviderImpl;
import org.onap.ccsdk.sli.core.sli.provider.SvcLogicServiceImpl;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
+import org.opendaylight.mdsal.binding.api.RpcProviderService;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+/*import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev200806.*;
+*/import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev200806.*;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev200806.common.header.CommonHeaderBuilder;
-
+import org.opendaylight.yangtools.concepts.ObjectRegistration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -63,10 +67,12 @@
@Before
public void setUp() throws Exception {
DataBroker dataBroker = mock(DataBroker.class);
+ DOMDataBroker domDataBroker = mock(DOMDataBroker.class);
NotificationPublishService notifyService = mock(NotificationPublishService.class);
- RpcProviderRegistry rpcRegistry = mock(RpcProviderRegistry.class);
- BindingAwareBroker.RpcRegistration<RanSliceApiService> rpcRegistration = (BindingAwareBroker.RpcRegistration<RanSliceApiService>) mock(BindingAwareBroker.RpcRegistration.class);
- when(rpcRegistry.addRpcImplementation(any(Class.class), any(RanSliceApiService.class))).thenReturn(rpcRegistration);
+ //RpcProviderRegistry rpcRegistry = mock(RpcProviderRegistry.class);
+ RpcProviderService rpcRegistry = mock(RpcProviderService.class);
+ ObjectRegistration<RanSliceApiService> rpcRegistration = mock(ObjectRegistration.class);
+ when(rpcRegistry.registerRpcImplementation(any(Class.class), any(RanSliceApiService.class))).thenReturn(rpcRegistration);
// Load svclogic.properties and get a SvcLogicStore
@@ -95,7 +101,14 @@
// Finally ready to create sliapiProvider
RANSliceClient client = new RANSliceClient(svc);
- provider = new RANSliceProvider(dataBroker, notifyService, rpcRegistry, client);
+ provider = new RANSliceProvider();
+ provider.setDataBroker(dataBroker);
+ provider.setDomDataBroker(domDataBroker);
+ provider.setNotificationPublishService(notifyService);
+ provider.setClient(client);
+ provider.init();
+
+
}
/**
@@ -103,7 +116,7 @@
*/
@After
public void tearDown() throws Exception {
- provider.close();
+ //provider.close();
}
@@ -124,7 +137,7 @@
try {
ConfigureNearRTRICOutput results = provider.configureNearRTRIC(builder.build()).get().getResult();
LOG.info("configureNearRTRIC returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage());
- assert(results.getStatus().getCode() == 400);
+ assert(results.getStatus().getCode().intValue() == 400);
} catch (InterruptedException | ExecutionException e) {
LOG.error("Caught exception", e);
fail("configureNearRTRIC threw exception");
@@ -150,7 +163,7 @@
try {
InstantiateRANSliceOutput results = provider.instantiateRANSlice(builder.build()).get().getResult();
LOG.info("instantiateRANSlice returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage());
- assert(results.getStatus().getCode() == 400);
+ assert(results.getStatus().getCode().intValue() == 400);
} catch (InterruptedException | ExecutionException e) {
LOG.error("Caught exception", e);
fail("instantiateRANSlice threw exception");
@@ -176,7 +189,7 @@
try {
ConfigureRANSliceInstanceOutput results = provider.configureRANSliceInstance(builder.build()).get().getResult();
LOG.info("configureRANSliceInstance returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage());
- assert(results.getStatus().getCode() == 400);
+ assert(results.getStatus().getCode().intValue() == 400);
} catch (InterruptedException | ExecutionException e) {
LOG.error("Caught exception", e);
fail("configureRANSliceInstance threw exception");
@@ -201,7 +214,7 @@
try {
ConfigureCUOutput results = provider.configureCU(builder.build()).get().getResult();
LOG.info("configureCU returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage());
- assert(results.getStatus().getCode() == 400);
+ assert(results.getStatus().getCode().intValue() == 400);
} catch (InterruptedException | ExecutionException e) {
LOG.error("Caught exception", e);
fail("configureCU threw exception");
@@ -227,7 +240,7 @@
try {
ConfigureDUOutput results = provider.configureDU(builder.build()).get().getResult();
LOG.info("configureDU returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage());
- assert(results.getStatus().getCode() == 400);
+ assert(results.getStatus().getCode().intValue() == 400);
} catch (InterruptedException | ExecutionException e) {
LOG.error("Caught exception", e);
fail("configureDU threw exception");
@@ -252,7 +265,7 @@
try {
ActivateRANSliceInstanceOutput results = provider.activateRANSliceInstance(builder.build()).get().getResult();
LOG.info("activateRANSliceInstance returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage());
- assert(results.getStatus().getCode() == 400);
+ assert(results.getStatus().getCode().intValue() == 400);
} catch (InterruptedException | ExecutionException e) {
LOG.error("Caught exception", e);
fail("activateRANSliceInstance threw exception");
@@ -278,7 +291,7 @@
try {
DeactivateRANSliceInstanceOutput results = provider.deactivateRANSliceInstance(builder.build()).get().getResult();
LOG.info("deactivateRANSliceInstance returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage());
- assert(results.getStatus().getCode() == 400);
+ assert(results.getStatus().getCode().intValue() == 400);
} catch (InterruptedException | ExecutionException e) {
LOG.error("Caught exception", e);
fail("deactivateRANSliceInstance threw exception");
@@ -303,7 +316,7 @@
try {
TerminateRANSliceInstanceOutput results = provider.terminateRANSliceInstance(builder.build()).get().getResult();
LOG.info("terminateRANSliceInstance returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage());
- assert(results.getStatus().getCode() == 400);
+ assert(results.getStatus().getCode().intValue() == 400);
} catch (InterruptedException | ExecutionException e) {
LOG.error("Caught exception", e);
fail("terminateRANSliceInstance threw exception");
@@ -328,7 +341,7 @@
try {
DetermineRANSliceResourcesOutput results = provider.determineRANSliceResources(builder.build()).get().getResult();
LOG.info("determineRANSliceResources returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage());
- assert(results.getStatus().getCode() == 400);
+ assert(results.getStatus().getCode().intValue() == 400);
} catch (InterruptedException | ExecutionException e) {
LOG.error("Caught exception", e);
fail("determineRANSliceResources threw exception");
@@ -354,7 +367,7 @@
try {
ConfigNotificationOutput results = provider.configNotification(builder.build()).get().getResult();
LOG.info("configNotification returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage());
- assert(results.getStatus().getCode() == 400);
+ assert(results.getStatus().getCode().intValue() == 400);
} catch (InterruptedException | ExecutionException e) {
LOG.error("Caught exception", e);
fail("configNotification threw exception");