From 0e4e58bf061df695341ac250beb97a978cefdaf7 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Fri, 29 Jan 2021 17:42:42 +0000 Subject: Revert "migrate sli to alu-SR1" This reverts commit ce4e5f9a00d2677495240ad367b9bfc4b74752d0. Reason for revert: ODL upgrade changes need to be backed out until issues in ccsdk/features are resolved. Change-Id: I168e2519e37f3eee61609d0da890c14db49ec49e --- .../org/onap/ccsdk/sli/northbound/LcmProvider.java | 34 ++++++++++++++-------- .../onap/ccsdk/sli/northbound/LcmSliClient.java | 3 +- .../resources/OSGI-INF/blueprint/lcm-blueprint.xml | 34 ++++++++++++++++++++++ .../org/opendaylight/blueprint/lcm-blueprint.xml | 9 ++++-- 4 files changed, 64 insertions(+), 16 deletions(-) create mode 100644 northbound/lcm/provider/src/main/resources/OSGI-INF/blueprint/lcm-blueprint.xml (limited to 'northbound/lcm/provider/src/main') diff --git a/northbound/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java b/northbound/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java index 4dd46d597..100496e39 100644 --- a/northbound/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java +++ b/northbound/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java @@ -21,26 +21,32 @@ package org.onap.ccsdk.sli.northbound; * ============LICENSE_END========================================================= */ -import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.ListenableFuture; import java.text.SimpleDateFormat; import java.util.Date; 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.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.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.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.*; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.common.header.CommonHeaderBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.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; import org.slf4j.LoggerFactory; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; + +import org.onap.ccsdk.sli.northbound.LcmResponseCode.*; + /** * Defines a base implementation for your provider. This class extends from a * helper class which provides storage for the most commonly used components of @@ -87,19 +93,23 @@ public class LcmProvider implements AutoCloseable, LCMService { private static final String APPLICATION_NAME = "LCM"; private final ExecutorService executor; + protected DataBroker dataBroker; protected DOMDataBroker domDataBroker; protected NotificationPublishService notificationService; - protected RpcProviderService rpcRegistry; + protected RpcProviderRegistry rpcRegistry; private final LcmSliClient lcmSliClient; - protected ObjectRegistration rpcRegistration; + protected BindingAwareBroker.RpcRegistration rpcRegistration; - public LcmProvider(final DOMDataBroker dataBroker, final NotificationPublishService notificationPublishService, - final RpcProviderService rpcProviderRegistry, final LcmSliClient lcmSliClient) { + public LcmProvider(final DataBroker dataBroker, final NotificationPublishService notificationPublishService, + final RpcProviderRegistry rpcProviderRegistry, final LcmSliClient lcmSliClient) { LOG.info("Creating provider for {}", APPLICATION_NAME); executor = Executors.newFixedThreadPool(1); - domDataBroker = dataBroker; + this.dataBroker = dataBroker; + if (dataBroker instanceof AbstractForwardedDataBroker) { + domDataBroker = ((AbstractForwardedDataBroker) dataBroker).getDelegate(); + } notificationService = notificationPublishService; rpcRegistry = rpcProviderRegistry; this.lcmSliClient = lcmSliClient; @@ -111,7 +121,7 @@ public class LcmProvider implements AutoCloseable, LCMService { if (rpcRegistration == null) { if (rpcRegistry != null) { - rpcRegistration = rpcRegistry.registerRpcImplementation(LCMService.class, this); + rpcRegistration = rpcRegistry.addRpcImplementation(LCMService.class, this); LOG.info("Initialization complete for {}", APPLICATION_NAME); } else { LOG.warn("Error initializing {} : rpcRegistry unset", APPLICATION_NAME); diff --git a/northbound/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmSliClient.java b/northbound/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmSliClient.java index 05bb43f82..54e53c776 100644 --- a/northbound/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmSliClient.java +++ b/northbound/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmSliClient.java @@ -24,9 +24,10 @@ package org.onap.ccsdk.sli.northbound; import java.util.Properties; + import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; -import org.opendaylight.mdsal.dom.api.DOMDataBroker; +import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/northbound/lcm/provider/src/main/resources/OSGI-INF/blueprint/lcm-blueprint.xml b/northbound/lcm/provider/src/main/resources/OSGI-INF/blueprint/lcm-blueprint.xml new file mode 100644 index 000000000..5597d0801 --- /dev/null +++ b/northbound/lcm/provider/src/main/resources/OSGI-INF/blueprint/lcm-blueprint.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/northbound/lcm/provider/src/main/resources/org/opendaylight/blueprint/lcm-blueprint.xml b/northbound/lcm/provider/src/main/resources/org/opendaylight/blueprint/lcm-blueprint.xml index 7550c8b93..5597d0801 100644 --- a/northbound/lcm/provider/src/main/resources/org/opendaylight/blueprint/lcm-blueprint.xml +++ b/northbound/lcm/provider/src/main/resources/org/opendaylight/blueprint/lcm-blueprint.xml @@ -11,13 +11,16 @@ + interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" + odl:type="default" /> + interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService" + odl:type="default" /> + interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry" + odl:type="default" /> -- cgit 1.2.3-korg