diff options
author | 2021-01-18 05:41:16 +0100 | |
---|---|---|
committer | 2021-01-27 15:56:35 -0500 | |
commit | ce4e5f9a00d2677495240ad367b9bfc4b74752d0 (patch) | |
tree | 71292f2ce0a2f8549f1583c712412f43757454f5 /northbound/lcm/provider/src/main | |
parent | 5de81966f5574ae83e85aa7d5aa8865ea5deef24 (diff) |
migrate sli to alu-SR1
migrate ODL interfaces and fix code for changes in alu-SR1
Issue-ID: CCSDK-3089
Signed-off-by: Michael DÜrre <michael.duerre@highstreet-technologies.com>
Change-Id: Iad824627c581c902b639a2f0246e3133d4e38c48
Diffstat (limited to 'northbound/lcm/provider/src/main')
4 files changed, 16 insertions, 64 deletions
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 100496e39..4dd46d597 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,32 +21,26 @@ 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.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.NotificationPublishService; +import org.opendaylight.mdsal.binding.api.RpcProviderService; +import org.opendaylight.mdsal.dom.api.DOMDataBroker; 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 @@ -93,23 +87,19 @@ 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 RpcProviderRegistry rpcRegistry; + protected RpcProviderService rpcRegistry; private final LcmSliClient lcmSliClient; - protected BindingAwareBroker.RpcRegistration<LCMService> rpcRegistration; + protected ObjectRegistration<LCMService> rpcRegistration; - public LcmProvider(final DataBroker dataBroker, final NotificationPublishService notificationPublishService, - final RpcProviderRegistry rpcProviderRegistry, final LcmSliClient lcmSliClient) { + public LcmProvider(final DOMDataBroker dataBroker, final NotificationPublishService notificationPublishService, + final RpcProviderService rpcProviderRegistry, final LcmSliClient lcmSliClient) { LOG.info("Creating provider for {}", APPLICATION_NAME); executor = Executors.newFixedThreadPool(1); - this.dataBroker = dataBroker; - if (dataBroker instanceof AbstractForwardedDataBroker) { - domDataBroker = ((AbstractForwardedDataBroker) dataBroker).getDelegate(); - } + domDataBroker = dataBroker; notificationService = notificationPublishService; rpcRegistry = rpcProviderRegistry; this.lcmSliClient = lcmSliClient; @@ -121,7 +111,7 @@ public class LcmProvider implements AutoCloseable, LCMService { if (rpcRegistration == null) { if (rpcRegistry != null) { - rpcRegistration = rpcRegistry.addRpcImplementation(LCMService.class, this); + rpcRegistration = rpcRegistry.registerRpcImplementation(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 54e53c776..05bb43f82 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,10 +24,9 @@ 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.controller.md.sal.dom.api.DOMDataBroker; +import org.opendaylight.mdsal.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 deleted file mode 100644 index 5597d0801..000000000 --- a/northbound/lcm/provider/src/main/resources/OSGI-INF/blueprint/lcm-blueprint.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" - xmlns:odl="http://opendaylight.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.sli.northbound.LcmSliClient"> - <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.sli.northbound.LcmProvider"> - <argument ref="dataBroker" /> - <argument ref="notificationService" /> - <argument ref="rpcRegistry" /> - <argument ref="client" /> - </bean> - - <odl:rpc-implementation ref="provider"/> - -</blueprint>
\ 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 5597d0801..7550c8b93 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,16 +11,13 @@ </bean> <reference id="dataBroker" - interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" - odl:type="default" /> + interface="org.opendaylight.mdsal.dom.api.DOMDataBroker" /> <reference id="notificationService" - interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService" - odl:type="default" /> + interface="org.opendaylight.mdsal.binding.api.NotificationPublishService" /> <reference id="rpcRegistry" - interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry" - odl:type="default" /> + interface="org.opendaylight.mdsal.binding.api.RpcProviderService" /> <bean id="provider" class="org.onap.ccsdk.sli.northbound.LcmProvider"> <argument ref="dataBroker" /> |