summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2021-02-04 16:36:06 -0500
committerDan Timoney <dtimoney@att.com>2021-02-05 12:05:21 -0500
commit02013b33111f0b51d07c80c89f4d5d08b60b2099 (patch)
tree641f4e528f9c5d078b5a9013466158a4fa94f40c
parentfee9955e585a00155b93f6de279a36217a8857bd (diff)
Update for ODL Aluminum
Update A1 adapter to conform to OpenDaylight Aluminum. Issue-ID: CCSDK-3138 Signed-off-by: Dan Timoney <dtimoney@att.com> Change-Id: I1dbda465c93ca8d4da532764b36c9ffb41fc7a9a
-rw-r--r--a1-adapter/a1-adapter-api/provider/pom.xml34
-rw-r--r--a1-adapter/a1-adapter-api/provider/src/main/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProvider.java16
-rw-r--r--a1-adapter/a1-adapter-api/provider/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml46
-rw-r--r--a1-adapter/a1-adapter-api/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml6
-rw-r--r--a1-adapter/a1-adapter-api/provider/src/test/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProviderTest.java8
5 files changed, 35 insertions, 75 deletions
diff --git a/a1-adapter/a1-adapter-api/provider/pom.xml b/a1-adapter/a1-adapter-api/provider/pom.xml
index aa6cbf43..079c2ad1 100644
--- a/a1-adapter/a1-adapter-api/provider/pom.xml
+++ b/a1-adapter/a1-adapter-api/provider/pom.xml
@@ -46,13 +46,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>
<version>${ccsdk.sli.core.version}</version>
@@ -69,16 +62,23 @@
<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.controller</groupId>
- <artifactId>sal-common-util</artifactId>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-test-model</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-core-api</artifactId>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-test-utils</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-dom-adapter</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
@@ -166,5 +166,13 @@
</plugin>
</plugins>
</pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <forceJavacCompilerUse>true</forceJavacCompilerUse>
+ </configuration>
+ </plugin>
+ </plugins>
</build>
</project>
diff --git a/a1-adapter/a1-adapter-api/provider/src/main/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProvider.java b/a1-adapter/a1-adapter-api/provider/src/main/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProvider.java
index 8693f493..40dfcbc5 100644
--- a/a1-adapter/a1-adapter-api/provider/src/main/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProvider.java
+++ b/a1-adapter/a1-adapter-api/provider/src/main/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProvider.java
@@ -30,9 +30,8 @@ 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.NotificationPublishService;
-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.yang.gen.v1.org.onap.a1.adapter.rev200122.A1ADAPTERAPIService;
import org.opendaylight.yang.gen.v1.org.onap.a1.adapter.rev200122.DeleteA1PolicyInput;
import org.opendaylight.yang.gen.v1.org.onap.a1.adapter.rev200122.DeleteA1PolicyInputBuilder;
@@ -55,6 +54,7 @@ import org.opendaylight.yang.gen.v1.org.onap.a1.adapter.rev200122.PutA1PolicyInp
import org.opendaylight.yang.gen.v1.org.onap.a1.adapter.rev200122.PutA1PolicyOutput;
import org.opendaylight.yang.gen.v1.org.onap.a1.adapter.rev200122.PutA1PolicyOutputBuilder;
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;
@@ -82,24 +82,24 @@ public class A1AdapterProvider implements AutoCloseable, A1ADAPTERAPIService {
private final ExecutorService executor;
protected NotificationPublishService notificationService;
- protected RpcProviderRegistry rpcRegistry;
- protected BindingAwareBroker.RpcRegistration<A1ADAPTERAPIService> rpcRegistration;
+ protected RpcProviderService rpcService;
private final A1AdapterClient a1AdapterClient;
+ private ObjectRegistration<A1ADAPTERAPIService> rpcRegistration;
public A1AdapterProvider(final NotificationPublishService notificationPublishService,
- final RpcProviderRegistry rpcProviderRegistry, final A1AdapterClient a1AdapterClient) {
+ final RpcProviderService rpcProviderService, final A1AdapterClient a1AdapterClient) {
log.info("Creating provider for {}", APPLICATION_NAME);
executor = Executors.newFixedThreadPool(1);
this.notificationService = notificationPublishService;
- this.rpcRegistry = rpcProviderRegistry;
+ this.rpcService = rpcProviderService;
this.a1AdapterClient = a1AdapterClient;
initialize();
}
public void initialize() {
log.info("Initializing provider for {}", APPLICATION_NAME);
- rpcRegistration = rpcRegistry.addRpcImplementation(A1ADAPTERAPIService.class, this);
+ rpcRegistration = rpcService.registerRpcImplementation(A1ADAPTERAPIService.class, this);
log.info("Initialization complete for {}", APPLICATION_NAME);
}
diff --git a/a1-adapter/a1-adapter-api/provider/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml b/a1-adapter/a1-adapter-api/provider/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml
deleted file mode 100644
index 28dfb5e4..00000000
--- a/a1-adapter/a1-adapter-api/provider/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ ============LICENSE_START=======================================================
- ~ ONAP : ccsdk oran
- ~ ================================================================================
- ~ Copyright (C) 2020 Nordix Foundation. 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.a1.adapter.A1AdapterClient">
- <argument ref="svcLogicService"/>
- </bean>
-
- <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.a1.adapter.A1AdapterProvider">
- <argument ref="notificationService"/>
- <argument ref="rpcRegistry"/>
- <argument ref="client"/>
- </bean>
-
-</blueprint>
diff --git a/a1-adapter/a1-adapter-api/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml b/a1-adapter/a1-adapter-api/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
index 28dfb5e4..825ecc17 100644
--- a/a1-adapter/a1-adapter-api/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
+++ b/a1-adapter/a1-adapter-api/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
@@ -31,11 +31,9 @@
</bean>
<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"/>
+ <reference id="rpcRegistry" interface="org.opendaylight.mdsal.binding.api.RpcProviderService" />
<bean id="provider" class="org.onap.ccsdk.features.a1.adapter.A1AdapterProvider">
<argument ref="notificationService"/>
diff --git a/a1-adapter/a1-adapter-api/provider/src/test/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProviderTest.java b/a1-adapter/a1-adapter-api/provider/src/test/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProviderTest.java
index 96bad81b..890ff72c 100644
--- a/a1-adapter/a1-adapter-api/provider/src/test/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProviderTest.java
+++ b/a1-adapter/a1-adapter-api/provider/src/test/java/org/onap/ccsdk/features/a1/adapter/A1AdapterProviderTest.java
@@ -33,8 +33,8 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
-import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
-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.yang.gen.v1.org.onap.a1.adapter.rev200122.DeleteA1PolicyInputBuilder;
import org.opendaylight.yang.gen.v1.org.onap.a1.adapter.rev200122.DeleteA1PolicyOutput;
import org.opendaylight.yang.gen.v1.org.onap.a1.adapter.rev200122.GetA1PolicyInputBuilder;
@@ -62,7 +62,7 @@ class A1AdapterProviderTest {
@Mock
private NotificationPublishService mockNotificationPublishService;
@Mock
- private RpcProviderRegistry mockRpcProviderRegistry;
+ private RpcProviderService mockRpcService;
@Mock
private A1AdapterClient a1AdapterClient;
private static String module = "A1-ADAPTER-API";
@@ -71,7 +71,7 @@ class A1AdapterProviderTest {
@BeforeEach
void setUp() {
a1AdapterProviderMock = Mockito.spy(new A1AdapterProvider(mockNotificationPublishService,
- mockRpcProviderRegistry, a1AdapterClient));
+ mockRpcService, a1AdapterClient));
}
@Test