summaryrefslogtreecommitdiffstats
path: root/northbound/daexim-offsite-backup/provider/src/main
diff options
context:
space:
mode:
authorMichael DÜrre <michael.duerre@highstreet-technologies.com>2021-01-18 05:41:16 +0100
committerDan Timoney <dtimoney@att.com>2021-01-27 15:56:35 -0500
commitce4e5f9a00d2677495240ad367b9bfc4b74752d0 (patch)
tree71292f2ce0a2f8549f1583c712412f43757454f5 /northbound/daexim-offsite-backup/provider/src/main
parent5de81966f5574ae83e85aa7d5aa8865ea5deef24 (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/daexim-offsite-backup/provider/src/main')
-rwxr-xr-xnorthbound/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java34
-rwxr-xr-xnorthbound/daexim-offsite-backup/provider/src/main/resources/OSGI-INF/blueprint/DaeximOffsiteBackup.xml20
-rwxr-xr-xnorthbound/daexim-offsite-backup/provider/src/main/resources/org/opendaylight/blueprint/DaeximOffsiteBackup.xml6
3 files changed, 18 insertions, 42 deletions
diff --git a/northbound/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java b/northbound/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java
index 09c8f92f4..7ee2a91d7 100755
--- a/northbound/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java
+++ b/northbound/daexim-offsite-backup/provider/src/main/java/org/onap/ccsdk/sli/northbound/daeximoffsitebackup/DaeximOffsiteBackupProvider.java
@@ -21,6 +21,9 @@
package org.onap.ccsdk.sli.northbound.daeximoffsitebackup;
+import com.google.common.util.concurrent.FluentFuture;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -44,27 +47,22 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
import javax.annotation.Nonnull;
-
-import com.google.common.util.concurrent.CheckedFuture;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
+import org.opendaylight.mdsal.binding.api.RpcProviderService;
+import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.common.api.CommitInfo;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.BackupDataInput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.BackupDataOutput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.BackupDataOutputBuilder;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.DaeximOffsiteBackupService;
+import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.RetrieveDataInput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.RetrieveDataOutput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.RetrieveDataOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.RetrieveDataInput;
+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;
@@ -86,11 +84,11 @@ public class DaeximOffsiteBackupProvider implements AutoCloseable, DaeximOffsite
private final ExecutorService executor;
private Properties properties;
private DataBroker dataBroker;
- private RpcProviderRegistry rpcRegistry;
- private BindingAwareBroker.RpcRegistration<DaeximOffsiteBackupService> rpcRegistration;
+ private RpcProviderService rpcRegistry;
+ private ObjectRegistration<DaeximOffsiteBackupService> rpcRegistration;
public DaeximOffsiteBackupProvider(DataBroker dataBroker,
- RpcProviderRegistry rpcProviderRegistry) {
+ RpcProviderService rpcProviderRegistry) {
LOG.info("Creating provider for " + appName);
this.executor = Executors.newFixedThreadPool(1);
this.dataBroker = dataBroker;
@@ -107,7 +105,7 @@ public class DaeximOffsiteBackupProvider implements AutoCloseable, DaeximOffsite
} catch (Exception e) {
LOG.error("Caught Exception while trying to load properties file", e);
}
- rpcRegistration = rpcRegistry.addRpcImplementation(DaeximOffsiteBackupService.class, this);
+ rpcRegistration = rpcRegistry.registerRpcImplementation(DaeximOffsiteBackupService.class, this);
LOG.info("Initialization complete for " + appName);
}
@@ -173,7 +171,7 @@ public class DaeximOffsiteBackupProvider implements AutoCloseable, DaeximOffsite
private void createContainers() {
final WriteTransaction t = dataBroker.newReadWriteTransaction();
try {
- CheckedFuture<Void, TransactionCommitFailedException> checkedFuture = t.submit();
+ FluentFuture<? extends @NonNull CommitInfo> checkedFuture = t.commit();
checkedFuture.get();
LOG.info("Create Containers succeeded!: ");
} catch (InterruptedException | ExecutionException e) {
diff --git a/northbound/daexim-offsite-backup/provider/src/main/resources/OSGI-INF/blueprint/DaeximOffsiteBackup.xml b/northbound/daexim-offsite-backup/provider/src/main/resources/OSGI-INF/blueprint/DaeximOffsiteBackup.xml
deleted file mode 100755
index 8e2101ad3..000000000
--- a/northbound/daexim-offsite-backup/provider/src/main/resources/OSGI-INF/blueprint/DaeximOffsiteBackup.xml
+++ /dev/null
@@ -1,20 +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="dataBroker"
- interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
- 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.daeximoffsitebackup.DaeximOffsiteBackupProvider">
- <argument ref="dataBroker" />
- <argument ref="rpcRegistry" />
- </bean>
-
- <odl:rpc-implementation ref="provider"/>
-</blueprint>
diff --git a/northbound/daexim-offsite-backup/provider/src/main/resources/org/opendaylight/blueprint/DaeximOffsiteBackup.xml b/northbound/daexim-offsite-backup/provider/src/main/resources/org/opendaylight/blueprint/DaeximOffsiteBackup.xml
index 8e2101ad3..6118f28c3 100755
--- a/northbound/daexim-offsite-backup/provider/src/main/resources/org/opendaylight/blueprint/DaeximOffsiteBackup.xml
+++ b/northbound/daexim-offsite-backup/provider/src/main/resources/org/opendaylight/blueprint/DaeximOffsiteBackup.xml
@@ -4,12 +4,10 @@
odl:use-default-for-reference-types="true">
<reference id="dataBroker"
- interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
- odl:type="default" />
+ interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" />
<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.daeximoffsitebackup.DaeximOffsiteBackupProvider">
<argument ref="dataBroker" />