summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/features/ccsdk-restconf-client/pom.xml7
-rwxr-xr-xplugins/grToolkit/provider/pom.xml33
-rwxr-xr-xplugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java34
-rw-r--r--plugins/grToolkit/provider/src/main/resources/org/opendaylight/blueprint/GrToolkit.xml9
-rw-r--r--plugins/grToolkit/provider/src/test/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProviderTest.java68
-rwxr-xr-xplugins/properties-node/provider/src/main/resources/OSGI-INF/blueprint/properties-node-blueprint.xml16
-rwxr-xr-xplugins/restapi-call-node/provider/pom.xml7
-rwxr-xr-xplugins/restapi-call-node/provider/src/main/resources/OSGI-INF/blueprint/restapi-call-node-blueprint.xml16
-rwxr-xr-xplugins/restconf-client/provider/pom.xml13
-rw-r--r--plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java80
-rw-r--r--plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java18
-rw-r--r--plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/DfSerializerUtil.java42
-rw-r--r--plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeSerializer.java26
-rw-r--r--plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeUtils.java37
-rwxr-xr-xplugins/restconf-client/provider/src/main/resources/OSGI-INF/blueprint/restconf-client-blueprint.xml51
-rw-r--r--plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/PropertiesSerializerTest.java14
-rwxr-xr-xplugins/sshapi-call-node/provider/src/main/resources/OSGI-INF/blueprint/sshapi-call-node-blueprint.xml16
17 files changed, 298 insertions, 189 deletions
diff --git a/plugins/features/ccsdk-restconf-client/pom.xml b/plugins/features/ccsdk-restconf-client/pom.xml
index cf1678eb8..bf4994b33 100644
--- a/plugins/features/ccsdk-restconf-client/pom.xml
+++ b/plugins/features/ccsdk-restconf-client/pom.xml
@@ -27,13 +27,6 @@
<groupId>${project.groupId}</groupId>
<artifactId>restconf-client-provider</artifactId>
<version>${project.version}</version>
- <exclusions>
- <!-- let the filter module start and manage the common code -->
- <exclusion>
- <groupId>org.onap.logging-analytics</groupId>
- <artifactId>logging-filter-base</artifactId>
- </exclusion>
- </exclusions>
</dependency>
</dependencies>
</project>
diff --git a/plugins/grToolkit/provider/pom.xml b/plugins/grToolkit/provider/pom.xml
index 5c77331c0..3bdecd54f 100755
--- a/plugins/grToolkit/provider/pom.xml
+++ b/plugins/grToolkit/provider/pom.xml
@@ -23,8 +23,8 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>mdsal-binding-api</artifactId>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-api</artifactId>
</dependency>
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
@@ -49,22 +49,22 @@
<artifactId>annotations</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>mdsal-binding-test-model</artifactId>
+ <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>
<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> -->
-<!-- <scope>test</scope> -->
-<!-- </dependency> -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -100,7 +100,6 @@
<dependency>
<groupId>com.github.stefanbirkner</groupId>
<artifactId>system-rules</artifactId>
- <version>1.19.0</version>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/plugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java b/plugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java
index 5a8730bff..7a8b3deb0 100755
--- a/plugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java
+++ b/plugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java
@@ -21,8 +21,6 @@
package org.onap.ccsdk.sli.plugins.grtoolkit;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
@@ -35,15 +33,18 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import java.util.Properties;
+import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import javax.annotation.Nonnull;
+
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+
import org.apache.commons.lang.StringUtils;
-import org.json.JSONArray;
-import org.json.JSONObject;
+
import org.onap.ccsdk.sli.core.dblib.DbLibService;
import org.onap.ccsdk.sli.plugins.grtoolkit.connection.ConnectionManager;
import org.onap.ccsdk.sli.plugins.grtoolkit.connection.ConnectionResponse;
@@ -59,11 +60,16 @@ import org.onap.ccsdk.sli.plugins.grtoolkit.resolver.HealthResolver;
import org.onap.ccsdk.sli.plugins.grtoolkit.resolver.SingleNodeHealthResolver;
import org.onap.ccsdk.sli.plugins.grtoolkit.resolver.SixNodeHealthResolver;
import org.onap.ccsdk.sli.plugins.grtoolkit.resolver.ThreeNodeHealthResolver;
+
+import org.json.JSONArray;
+import org.json.JSONObject;
+
import org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface;
-import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
-import org.opendaylight.mdsal.binding.api.NotificationPublishService;
-import org.opendaylight.mdsal.binding.api.RpcProviderService;
+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.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.sli.plugins.gr.toolkit.rev180926.AdminHealthInput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.AdminHealthOutput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.AdminHealthOutputBuilder;
@@ -92,9 +98,9 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.SiteIdentifierOutput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.SiteIdentifierOutputBuilder;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.site.health.output.SitesBuilder;
-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;
@@ -127,8 +133,8 @@ public class GrToolkitProvider implements AutoCloseable, GrToolkitService, DataT
private final ExecutorService executor;
protected DataBroker dataBroker;
protected NotificationPublishService notificationService;
- protected RpcProviderService rpcRegistry;
- protected ObjectRegistration<GrToolkitService> rpcRegistration;
+ protected RpcProviderRegistry rpcRegistry;
+ protected BindingAwareBroker.RpcRegistration<GrToolkitService> rpcRegistration;
protected DbLibService dbLib;
private String member;
private ClusterActor self;
@@ -149,7 +155,7 @@ public class GrToolkitProvider implements AutoCloseable, GrToolkitService, DataT
*/
public GrToolkitProvider(DataBroker dataBroker,
NotificationPublishService notificationProviderService,
- RpcProviderService rpcProviderRegistry,
+ RpcProviderRegistry rpcProviderRegistry,
DistributedDataStoreInterface configDatastore,
DbLibService dbLibService) {
log.info("Creating provider for {}", APP_NAME);
@@ -171,7 +177,7 @@ public class GrToolkitProvider implements AutoCloseable, GrToolkitService, DataT
createContainers();
setProperties();
defineMembers();
- rpcRegistration = rpcRegistry.registerRpcImplementation(GrToolkitService.class, this);
+ rpcRegistration = rpcRegistry.addRpcImplementation(GrToolkitService.class, this);
log.info("Initialization complete for {}", APP_NAME);
}
diff --git a/plugins/grToolkit/provider/src/main/resources/org/opendaylight/blueprint/GrToolkit.xml b/plugins/grToolkit/provider/src/main/resources/org/opendaylight/blueprint/GrToolkit.xml
index 300c1cc75..5a4492c56 100644
--- a/plugins/grToolkit/provider/src/main/resources/org/opendaylight/blueprint/GrToolkit.xml
+++ b/plugins/grToolkit/provider/src/main/resources/org/opendaylight/blueprint/GrToolkit.xml
@@ -4,13 +4,16 @@
odl:use-default-for-reference-types="true">
<reference id="dataBroker"
- interface="org.opendaylight.controller.md.sal.binding.api.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" />
+ interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService"
+ odl:type="default" />
<reference id="rpcRegistry"
- interface="org.opendaylight.mdsal.binding.api.RpcProviderService" />
+ interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"
+ odl:type="default" />
<reference id="dbLib"
interface="org.onap.ccsdk.sli.core.dblib.DbLibService" />
diff --git a/plugins/grToolkit/provider/src/test/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProviderTest.java b/plugins/grToolkit/provider/src/test/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProviderTest.java
index 6495c89cf..edd6d1b8d 100644
--- a/plugins/grToolkit/provider/src/test/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProviderTest.java
+++ b/plugins/grToolkit/provider/src/test/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProviderTest.java
@@ -20,42 +20,25 @@
*/
package org.onap.ccsdk.sli.plugins.grtoolkit;
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.when;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
+
import com.google.common.util.concurrent.ListenableFuture;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Properties;
-import java.util.concurrent.ExecutionException;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
+
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.EnvironmentVariables;
+
import org.onap.ccsdk.sli.core.dblib.DBLibConnection;
import org.onap.ccsdk.sli.core.dblib.DbLibService;
import org.onap.ccsdk.sli.plugins.grtoolkit.data.ClusterActor;
+
import org.opendaylight.controller.cluster.access.concepts.MemberName;
import org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface;
import org.opendaylight.controller.cluster.datastore.utils.ActorUtils;
-import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.NotificationPublishService;
-import org.opendaylight.mdsal.binding.api.RpcProviderService;
+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.RpcProviderRegistry;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.AdminHealthOutput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.ClusterHealthOutput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.DatabaseHealthOutput;
@@ -66,15 +49,38 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.ResumeAkkaTrafficOutput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.SiteHealthOutput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.SiteIdentifierOutput;
-import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.resume.akka.traffic.input.NodeInfoBuilder;
import org.opendaylight.yangtools.yang.common.RpcResult;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Properties;
+import java.util.concurrent.ExecutionException;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
public class GrToolkitProviderTest {
GrToolkitProvider provider;
GrToolkitProvider providerSpy;
DataBroker dataBroker;
NotificationPublishService notificationProviderService;
- RpcProviderService rpcProviderRegistry;
+ RpcProviderRegistry rpcProviderRegistry;
DistributedDataStoreInterface configDatastore;
DbLibService dbLibService;
DBLibConnection connection;
@@ -90,7 +96,7 @@ public class GrToolkitProviderTest {
environmentVariables.set("SDNC_CONFIG_DIR","src/test/resources");
dataBroker = mock(DataBroker.class);
notificationProviderService = mock(NotificationPublishService.class);
- rpcProviderRegistry = mock(RpcProviderService.class);
+ rpcProviderRegistry = mock(RpcProviderRegistry.class);
configDatastore = mock(DistributedDataStoreInterface.class);
dbLibService = mock(DbLibService.class);
connection = mock(DBLibConnection.class);
@@ -260,13 +266,11 @@ public class GrToolkitProviderTest {
@Test
public void haltTrafficTest() {
HaltAkkaTrafficInputBuilder builder = new HaltAkkaTrafficInputBuilder();
- builder.setNodeInfo(Arrays.asList(
- new org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.halt.akka.traffic.
- input.NodeInfoBuilder().build()));
+ builder.setNodeInfo(new ArrayList<>());
ListenableFuture<RpcResult<HaltAkkaTrafficOutput>> result = provider.haltAkkaTraffic(builder.build());
try {
assertEquals("200", result.get().getResult().getStatus());
- } catch (InterruptedException | ExecutionException e) {
+ } catch(InterruptedException | ExecutionException e) {
fail();
}
}
@@ -274,7 +278,7 @@ public class GrToolkitProviderTest {
@Test
public void resumeTrafficTest() {
ResumeAkkaTrafficInputBuilder builder = new ResumeAkkaTrafficInputBuilder();
- builder.setNodeInfo(Arrays.asList(new NodeInfoBuilder().build()));
+ builder.setNodeInfo(new ArrayList<>());
ListenableFuture<RpcResult<ResumeAkkaTrafficOutput>> result = provider.resumeAkkaTraffic(builder.build());
try {
assertEquals("200", result.get().getResult().getStatus());
diff --git a/plugins/properties-node/provider/src/main/resources/OSGI-INF/blueprint/properties-node-blueprint.xml b/plugins/properties-node/provider/src/main/resources/OSGI-INF/blueprint/properties-node-blueprint.xml
new file mode 100755
index 000000000..6e1d48efd
--- /dev/null
+++ b/plugins/properties-node/provider/src/main/resources/OSGI-INF/blueprint/properties-node-blueprint.xml
@@ -0,0 +1,16 @@
+<?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">
+
+ <bean id="propNodeProvider" class="org.onap.ccsdk.sli.plugins.prop.PropertiesNode" />
+
+
+
+ <service ref="propNodeProvider">
+ <interfaces>
+ <value>org.onap.ccsdk.sli.plugins.prop.PropertiesNode</value>
+ </interfaces>
+ </service>
+
+</blueprint> \ No newline at end of file
diff --git a/plugins/restapi-call-node/provider/pom.xml b/plugins/restapi-call-node/provider/pom.xml
index 3b06d720f..a2ee45161 100755
--- a/plugins/restapi-call-node/provider/pom.xml
+++ b/plugins/restapi-call-node/provider/pom.xml
@@ -24,13 +24,6 @@
<type>pom</type>
<scope>import</scope>
</dependency>
- <dependency>
- <groupId>org.glassfish.jersey</groupId>
- <artifactId>jersey-bom</artifactId>
- <version>2.27</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
</dependencies>
</dependencyManagement>
<dependencies>
diff --git a/plugins/restapi-call-node/provider/src/main/resources/OSGI-INF/blueprint/restapi-call-node-blueprint.xml b/plugins/restapi-call-node/provider/src/main/resources/OSGI-INF/blueprint/restapi-call-node-blueprint.xml
new file mode 100755
index 000000000..390bb0a35
--- /dev/null
+++ b/plugins/restapi-call-node/provider/src/main/resources/OSGI-INF/blueprint/restapi-call-node-blueprint.xml
@@ -0,0 +1,16 @@
+<?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">
+
+ <bean id="restapiCallNodeProvider" class="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" />
+
+
+
+ <service ref="restapiCallNodeProvider">
+ <interfaces>
+ <value>org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode</value>
+ </interfaces>
+ </service>
+
+</blueprint> \ No newline at end of file
diff --git a/plugins/restconf-client/provider/pom.xml b/plugins/restconf-client/provider/pom.xml
index 58aa4219b..dbe16754f 100755
--- a/plugins/restconf-client/provider/pom.xml
+++ b/plugins/restconf-client/provider/pom.xml
@@ -24,13 +24,6 @@
<type>pom</type>
<scope>import</scope>
</dependency>
- <dependency>
- <groupId>org.glassfish.jersey</groupId>
- <artifactId>jersey-bom</artifactId>
- <version>2.27</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
</dependencies>
</dependencyManagement>
<dependencies>
@@ -38,7 +31,6 @@
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-sse</artifactId>
</dependency>
-
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
@@ -122,11 +114,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.glassfish.jersey.inject</groupId>
- <artifactId>jersey-hk2</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<scope>test</scope>
diff --git a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java
index 679ba57b7..620df282f 100644
--- a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java
+++ b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java
@@ -20,48 +20,23 @@
package org.onap.ccsdk.sli.plugins.restconfapicall;
-import static com.google.common.base.Strings.repeat;
-import static java.lang.String.format;
-import static java.lang.String.valueOf;
-import static org.apache.commons.lang3.StringUtils.join;
-import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.DELETE;
-import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.GET;
-import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.PATCH;
-import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.PUT;
-import static org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode.parseParam;
-import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.COLON;
-import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.COMMA;
-import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.HEADER;
-import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.HTTP_REQ;
-import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.HTTP_RES;
-import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.REQ_ERR;
-import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RES_CODE;
-import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RES_MSG;
-import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RES_PRE;
-import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.getSchemaCtxFromDir;
-import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.getUpdatedXmlReq;
-import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.getYangParameters;
-import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.parseUrl;
-import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfListenerFactory.instance;
-import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.FORMAT_ERR;
-import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.UTF_HEADER;
-import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.XML_TREE_ERR;
-import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.getXmlWriter;
-import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.MdsalPropertiesNodeUtils.getModuleNamespace;
-import static org.osgi.framework.FrameworkUtil.getBundle;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.stream.JsonWriter;
+
+import javax.ws.rs.core.UriBuilder;
import java.io.StringWriter;
import java.io.Writer;
import java.net.SocketException;
import java.net.URI;
+import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
@@ -84,7 +59,6 @@ import org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.Namespace;
import org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.PropertiesNodeSerializer;
import org.opendaylight.restconf.common.context.InstanceIdentifierContext;
import org.opendaylight.restconf.nb.rfc8040.utils.parser.ParserIdentifier;
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.api.SchemaNode;
import org.osgi.framework.BundleContext;
@@ -92,6 +66,44 @@ import org.osgi.framework.ServiceReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.base.Strings.repeat;
+import static java.lang.String.format;
+import static java.lang.String.valueOf;
+import static org.apache.commons.lang3.StringUtils.join;
+import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.DELETE;
+import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.GET;
+import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.PATCH;
+import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.PUT;
+import static org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode.parseParam;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.ATTEMPTS_MSG;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.COLON;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.COMMA;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.COMM_FAIL;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.HEADER;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.HTTP_REQ;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.HTTP_RES;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.MAX_RETRY_ERR;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.NO_MORE_RETRY;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.REQ_ERR;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.REST_API_URL;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RES_CODE;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RES_MSG;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RES_PRE;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RETRY_COUNT;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RETRY_FAIL;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.UPDATED_URL;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.getSchemaCtxFromDir;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.getUpdatedXmlReq;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.getYangParameters;
+import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.parseUrl;
+import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfListenerFactory.instance;
+import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.FORMAT_ERR;
+import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.UTF_HEADER;
+import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.XML_TREE_ERR;
+import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.getXmlWriter;
+import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.MdsalPropertiesNodeUtils.getModuleNamespace;
+import static org.osgi.framework.FrameworkUtil.getBundle;
+
/**
* Representation of a plugin to enable RESTCONF based CRUD operations from DG.
*/
@@ -287,7 +299,7 @@ public class RestconfApiCallNode implements SvcLogicJavaPlugin {
private InstanceIdentifierContext<?> getInsIdCtx(YangParameters params,
String uri)
throws SvcLogicException {
- EffectiveModelContext context = getSchemaContext(params);
+ SchemaContext context = getSchemaContext(params);
return ParserIdentifier.toInstanceIdentifier(uri, context, null);
}
@@ -299,18 +311,18 @@ public class RestconfApiCallNode implements SvcLogicJavaPlugin {
* @return schema context
* @throws SvcLogicException when schema context fetching fails
*/
- private EffectiveModelContext getSchemaContext(YangParameters params)
+ private SchemaContext getSchemaContext(YangParameters params)
throws SvcLogicException {
if (params.dirPath != null) {
return getSchemaCtxFromDir(params.dirPath);
}
BundleContext bc = getBundle(SchemaContext.class).getBundleContext();
- EffectiveModelContext schemaContext = null;
+ SchemaContext schemaContext = null;
if (bc != null) {
ServiceReference reference = bc.getServiceReference(
SchemaContext.class);
if (reference != null) {
- schemaContext = (EffectiveModelContext) bc.getService(reference);
+ schemaContext = (SchemaContext) bc.getService(reference);
}
}
return schemaContext;
diff --git a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java
index d22c3707a..1309102b3 100644
--- a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java
+++ b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java
@@ -22,12 +22,6 @@
package org.onap.ccsdk.sli.plugins.restconfapicall;
-import static org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode.getParameters;
-import static org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode.parseParam;
-import static org.opendaylight.yangtools.yang.model.repo.api.StatementParserMode.DEFAULT_MODE;
-import static org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource.forFile;
-import static org.opendaylight.yangtools.yang.parser.rfc7950.reactor.RFC7950Reactors.defaultReactor;
-import static org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource.create;
import java.io.File;
import java.io.IOException;
import java.net.URI;
@@ -39,15 +33,23 @@ import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.ccsdk.sli.plugins.restapicall.HttpMethod;
import org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.YangParameters;
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
import org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource;
import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor;
+import static org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode.getParameters;
+import static org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode.parseParam;
+import static org.opendaylight.yangtools.yang.model.repo.api.StatementParserMode.DEFAULT_MODE;
+import static org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource.forFile;
+import static org.opendaylight.yangtools.yang.parser.rfc7950.reactor.RFC7950Reactors.defaultReactor;
+import static org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource.create;
+
/**
* Utilities for restconf api call node.
*/
@@ -188,7 +190,7 @@ public final class RestconfApiUtils {
* @return YANG schema context
* @throws SvcLogicException when YANG file reading fails
*/
- static EffectiveModelContext getSchemaCtxFromDir(String di)
+ static SchemaContext getSchemaCtxFromDir(String di)
throws SvcLogicException {
Path d = Paths.get(di);
File dir = d.toFile();
diff --git a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/DfSerializerUtil.java b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/DfSerializerUtil.java
index 14824f51e..707c29444 100644
--- a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/DfSerializerUtil.java
+++ b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/DfSerializerUtil.java
@@ -20,25 +20,6 @@
package org.onap.ccsdk.sli.plugins.yangserializers.dfserializer;
-import static javax.xml.transform.OutputKeys.INDENT;
-import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.XmlNodeType.OBJECT_NODE;
-import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.XmlNodeType.TEXT_NODE;
-import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.MdsalPropertiesNodeUtils.getRevision;
-import java.io.IOException;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Iterator;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
import org.dom4j.Element;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.Namespace;
@@ -50,6 +31,27 @@ import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Iterator;
+
+import static javax.xml.transform.OutputKeys.INDENT;
+import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.XmlNodeType.OBJECT_NODE;
+import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.XmlNodeType.TEXT_NODE;
+import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.MdsalPropertiesNodeUtils.getRevision;
+
/**
* Utilities for data format serializer.
*/
@@ -177,7 +179,7 @@ public final class DfSerializerUtil {
parentNs.revision());
}
- Iterator<? extends Module> it;
+ Iterator<Module> it;
Module mod;
if (mName != null) {
it = ctx.findModules(mName).iterator();
diff --git a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeSerializer.java b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeSerializer.java
index 8fd7a12bc..8a6e75668 100644
--- a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeSerializer.java
+++ b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeSerializer.java
@@ -20,6 +20,18 @@
package org.onap.ccsdk.sli.plugins.yangserializers.pnserializer;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.onap.ccsdk.sli.core.sli.SvcLogicException;
+import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
+import org.opendaylight.yangtools.yang.model.api.Module;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.SchemaNode;
+import org.opendaylight.yangtools.yang.model.util.SchemaContextUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.MdsalPropertiesNodeUtils.DOT_REGEX;
import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.MdsalPropertiesNodeUtils.SLASH;
import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.MdsalPropertiesNodeUtils.getChildSchemaNode;
@@ -37,21 +49,11 @@ import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.NodeType.M
import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.NodeType.MULTI_INSTANCE_NODE;
import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.NodeType.SINGLE_INSTANCE_LEAF_NODE;
import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.NodeType.SINGLE_INSTANCE_NODE;
-import java.util.HashMap;
-import java.util.Map;
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaNode;
-import org.opendaylight.yangtools.yang.model.util.SchemaContextUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* Representation of mdsal based properties node serializer implementation.
*/
-public class MdsalPropertiesNodeSerializer extends PropertiesNodeSerializer<SchemaNode, EffectiveModelContext> {
+public class MdsalPropertiesNodeSerializer extends PropertiesNodeSerializer<SchemaNode, SchemaContext> {
private static final Logger log = LoggerFactory.getLogger(
MdsalPropertiesNodeSerializer.class);
@@ -66,7 +68,7 @@ public class MdsalPropertiesNodeSerializer extends PropertiesNodeSerializer<Sche
* @param uri URL of the request
*/
public MdsalPropertiesNodeSerializer(SchemaNode schemaNode,
- EffectiveModelContext schemaCtx, String uri) {
+ SchemaContext schemaCtx, String uri) {
super(schemaNode, schemaCtx, uri);
}
diff --git a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeUtils.java b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeUtils.java
index 331f01cb7..e6fa064f5 100644
--- a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeUtils.java
+++ b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeUtils.java
@@ -20,14 +20,11 @@
package org.onap.ccsdk.sli.plugins.yangserializers.pnserializer;
-import static com.google.common.base.Preconditions.checkArgument;
-import static java.lang.String.format;
-import static java.util.regex.Pattern.quote;
-import static org.opendaylight.restconf.nb.rfc8040.utils.parser.ParserIdentifier.toInstanceIdentifier;
import java.util.Collection;
import java.util.Deque;
import java.util.Iterator;
import java.util.Optional;
+
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.opendaylight.restconf.common.context.InstanceIdentifierContext;
import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
@@ -36,11 +33,10 @@ import org.opendaylight.yangtools.yang.common.Revision;
import org.opendaylight.yangtools.yang.data.impl.schema.SchemaUtils;
import org.opendaylight.yangtools.yang.data.util.ParserStreamUtils;
import org.opendaylight.yangtools.yang.data.util.codec.IdentityCodecUtil;
-import org.opendaylight.yangtools.yang.model.api.AnyxmlSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.AnyXmlSchemaNode;
import org.opendaylight.yangtools.yang.model.api.AugmentationSchemaNode;
import org.opendaylight.yangtools.yang.model.api.ChoiceSchemaNode;
import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
@@ -48,6 +44,11 @@ import org.opendaylight.yangtools.yang.model.api.SchemaNode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.base.Preconditions.checkArgument;
+import static java.lang.String.format;
+import static java.util.regex.Pattern.quote;
+import static org.opendaylight.restconf.nb.rfc8040.utils.parser.ParserIdentifier.toInstanceIdentifier;
+
/**
* Represents utilities for properties node tree.
*/
@@ -261,12 +262,12 @@ public final class MdsalPropertiesNodeUtils {
* @return schema path holder
*/
public static SchemaPathHolder getProcessedPath(String uri,
- EffectiveModelContext context) {
+ SchemaContext context) {
String uri1 = uri.replaceAll(UNDERSCORE, COLON);
try {
InstanceIdentifierContext<?> id = toInstanceIdentifier(
- uri1, context, Optional.ofNullable(null));
+ uri1, context, null);
return new SchemaPathHolder(id, uri1);
} catch (IllegalArgumentException | RestconfDocumentedException
| NullPointerException e) {
@@ -288,7 +289,7 @@ public final class MdsalPropertiesNodeUtils {
* @return schema and path holder
*/
private static SchemaPathHolder processNodesAndAppendPath(String uri,
- EffectiveModelContext context) {
+ SchemaContext context) {
String actPath = "";
SchemaPathHolder id = new SchemaPathHolder(null, "");
@@ -329,7 +330,9 @@ public final class MdsalPropertiesNodeUtils {
* @param prefix prefix for the node in the path
* @return schema and path holder
*/
- private static SchemaPathHolder processIdentifier(String node, EffectiveModelContext context, String prefix) {
+ private static SchemaPathHolder processIdentifier(String node,
+ SchemaContext context,
+ String prefix) {
String[] values = node.split(UNDERSCORE);
String val = values[0];
@@ -375,7 +378,7 @@ public final class MdsalPropertiesNodeUtils {
* @param curSchema current schema
* @return namespace of the given node
*/
- static Namespace getNamespace(String childName, EffectiveModelContext ctx,
+ static Namespace getNamespace(String childName, SchemaContext ctx,
PropertiesNode parent, SchemaNode curSchema) {
Namespace parentNs = parent.namespace();
@@ -422,8 +425,8 @@ public final class MdsalPropertiesNodeUtils {
* @param ctx schema context
* @return namespace of the given node name
*/
- private static Namespace getNs(String modName, EffectiveModelContext ctx) {
- Iterator<? extends Module> it = ctx.findModules(modName).iterator();
+ private static Namespace getNs(String modName, SchemaContext ctx) {
+ Iterator<Module> it = ctx.findModules(modName).iterator();
if (it.hasNext()) {
Module m = it.next();
return new Namespace(modName, m.getQNameModule().getNamespace(),
@@ -485,7 +488,7 @@ public final class MdsalPropertiesNodeUtils {
public static NodeType getNodeType(int index, int length, String name,
SchemaNode schema) {
if (index == length-1) {
- if (schema instanceof AnyxmlSchemaNode) {
+ if (schema instanceof AnyXmlSchemaNode){
return NodeType.ANY_XML_NODE;
}
return (isListEntry(name) ? NodeType.MULTI_INSTANCE_LEAF_NODE :
@@ -514,7 +517,9 @@ public final class MdsalPropertiesNodeUtils {
* @return value namespace
* @throws SvcLogicException if identity/module could not be found
*/
- static Namespace getValueNamespace(String value, EffectiveModelContext ctx) throws SvcLogicException {
+ static Namespace getValueNamespace(String value,
+ SchemaContext ctx)
+ throws SvcLogicException {
String prefix = getPrefixFromValue(value);
if (prefix == null) {
return null;
@@ -523,7 +528,7 @@ public final class MdsalPropertiesNodeUtils {
IdentitySchemaNode id = IdentityCodecUtil.parseIdentity(value,
ctx,
prefixToModule -> {
- final Iterator<? extends Module> modules = ctx.findModules(prefix).iterator();
+ final Iterator<Module> modules = ctx.findModules(prefix).iterator();
checkArgument(modules.hasNext(), "Could not find " +
"module %s", prefix);
return modules.next().getQNameModule();
diff --git a/plugins/restconf-client/provider/src/main/resources/OSGI-INF/blueprint/restconf-client-blueprint.xml b/plugins/restconf-client/provider/src/main/resources/OSGI-INF/blueprint/restconf-client-blueprint.xml
new file mode 100755
index 000000000..45c335b13
--- /dev/null
+++ b/plugins/restconf-client/provider/src/main/resources/OSGI-INF/blueprint/restconf-client-blueprint.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * ============LICENSE_START=======================================================
+ * ONAP - CCSDK
+ * ================================================================================
+ * Copyright (C) 2018 Huawei Technologies Co., Ltd. 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="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 xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
+ id="restapiCallNodeProvider"
+ interface="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode"
+ ext:proxy-method="classes"/>
+
+ <bean id="restconfapiCallNodeProvider" class="org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode" >
+ <argument ref="restapiCallNodeProvider"/>
+ </bean>
+
+ <bean id="restconfDiscoveryNodeProvider" class="org.onap.ccsdk.sli.plugins.restconfdiscovery.RestconfDiscoveryNode" >
+ <argument ref="restconfapiCallNodeProvider"/>
+ </bean>
+
+ <service ref="restconfapiCallNodeProvider">
+ <interfaces>
+ <value>org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode</value>
+ </interfaces>
+ </service>
+
+ <service ref="restconfDiscoveryNodeProvider">
+ <interfaces>
+ <value>org.onap.ccsdk.sli.plugins.restconfdiscovery.RestconfDiscoveryNode</value>
+ </interfaces>
+ </service>
+
+</blueprint> \ No newline at end of file
diff --git a/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/PropertiesSerializerTest.java b/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/PropertiesSerializerTest.java
index 2bcd45e2b..c3a6b4ea8 100644
--- a/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/PropertiesSerializerTest.java
+++ b/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/PropertiesSerializerTest.java
@@ -19,9 +19,6 @@
*/
package org.onap.ccsdk.sli.plugins.yangserializers.pnserializer;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
@@ -30,16 +27,21 @@ import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+
import org.junit.Before;
import org.junit.Test;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.opendaylight.restconf.common.context.InstanceIdentifierContext;
import org.opendaylight.restconf.nb.rfc8040.utils.parser.ParserIdentifier;
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertTrue;
+
public final class PropertiesSerializerTest {
- private EffectiveModelContext context;
+ private SchemaContext context;
@Before
public void initialization() throws FileNotFoundException {
@@ -1123,7 +1125,7 @@ public final class PropertiesSerializerTest {
assertThat(l.valueNs().moduleNs().toString(), is("identity:list:second:ns:test:json:ser"));
}
- public static EffectiveModelContext compileYangFile() throws FileNotFoundException {
+ public static SchemaContext compileYangFile() throws FileNotFoundException {
String path = PropertiesSerializerTest.class.getResource("/yang").getPath();
File dir = new File(path);
String[] fileList = dir.list();
diff --git a/plugins/sshapi-call-node/provider/src/main/resources/OSGI-INF/blueprint/sshapi-call-node-blueprint.xml b/plugins/sshapi-call-node/provider/src/main/resources/OSGI-INF/blueprint/sshapi-call-node-blueprint.xml
new file mode 100755
index 000000000..7a5424329
--- /dev/null
+++ b/plugins/sshapi-call-node/provider/src/main/resources/OSGI-INF/blueprint/sshapi-call-node-blueprint.xml
@@ -0,0 +1,16 @@
+<?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">
+
+ <bean id="sshapiCallNodeProvider" class="org.onap.ccsdk.sli.plugins.sshapicall.SshApiCallNode" />
+
+
+
+ <service ref="sshapiCallNodeProvider">
+ <interfaces>
+ <value>org.onap.ccsdk.sli.plugins.sshapicall.SshApiCallNode</value>
+ </interfaces>
+ </service>
+
+</blueprint> \ No newline at end of file