From 8881ebb497e9f35e5ea9d19923fd926db56e8f12 Mon Sep 17 00:00:00 2001 From: Ryan Goulding Date: Thu, 7 Sep 2017 12:10:08 -0400 Subject: Fix SDNC service registration This change converts AsdcApiProvider and AsdcApiSliClient to utilize Aries Blueprint for service instantiation instead of the ODL Config Subsystem. Change-Id: I5eaebe4c6e5b33fc8beb20b2cfe9acb6e8b6d808 Issue-Id: SDNC-54 Signed-off-by: Ryan Goulding --- .../org/opendaylight/blueprint/asdc-blueprint.xml | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml (limited to 'asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml') diff --git a/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml b/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml new file mode 100644 index 000000000..6229db1f6 --- /dev/null +++ b/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit 1.2.3-korg From bf092c7f773e69b1723369f427edb957ccc6f4f1 Mon Sep 17 00:00:00 2001 From: Gaurav Agrawal Date: Mon, 18 Sep 2017 18:37:49 +0530 Subject: Replace deprecated API with newer one Replace following deprecated API 1) NotificationProviderService replaced with NotificationPublishService 2) InstanceIdentifier toInstance() replace with build() Change-Id: I50195bf123052270edf3fd9f74af00262a01e650 Issue-Id: CCSDK-93 Signed-off-by: Gaurav Agrawal --- .../ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java | 19 ++++++++----------- .../org/opendaylight/blueprint/asdc-blueprint.xml | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-) (limited to 'asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml') diff --git a/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java index 13198d623..b9c897ec0 100644 --- a/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java +++ b/asdcApi/provider/src/main/java/org/onap/ccsdk/sli/northbound/asdcapi/AsdcApiProvider.java @@ -28,12 +28,12 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; 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.api.ReadOnlyTransaction; import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; 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.NotificationProviderService; import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; import org.opendaylight.yang.gen.v1.http.xmlns.onap.org.asdc.license.model._1._0.rev160427.vf.license.model.grouping.VfLicenseModel; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.ASDCAPIService; @@ -103,21 +103,21 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { private final ExecutorService executor; protected DataBroker dataBroker; - protected NotificationProviderService notificationService; + protected NotificationPublishService notificationService; protected RpcProviderRegistry rpcRegistry; private final AsdcApiSliClient asdcApiSliClient; protected BindingAwareBroker.RpcRegistration rpcRegistration; public AsdcApiProvider(final DataBroker dataBroker, - final NotificationProviderService notificationProviderService, + final NotificationPublishService notificationPublishService, final RpcProviderRegistry rpcProviderRegistry, final AsdcApiSliClient asdcApiSliClient) { LOG.info("Creating provider for {}", APPLICATION_NAME); executor = Executors.newFixedThreadPool(1); this.dataBroker = dataBroker; - notificationService = notificationProviderService; + notificationService = notificationPublishService; rpcRegistry = rpcProviderRegistry; this.asdcApiSliClient= asdcApiSliClient; initialize(); @@ -179,7 +179,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { protected boolean artifactVersionExists(String aName, String aVersion) { InstanceIdentifier artifactInstanceId = InstanceIdentifier.builder(Artifacts.class) - .child(Artifact.class, new ArtifactKey(aName, aVersion)).toInstance(); + .child(Artifact.class, new ArtifactKey(aName, aVersion)).build(); ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction(); Optional data = null; try { @@ -212,8 +212,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { . builder(Artifacts.class) .child(Artifact.class, artifact.getKey()); - InstanceIdentifier path = aIdBuilder - .toInstance(); + InstanceIdentifier path = aIdBuilder.build(); WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); @@ -248,8 +247,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { . builder(VfLicenseModelVersions.class) .child(VfLicenseModelVersion.class, version.getKey()); - InstanceIdentifier path = versionIdBuilder - .toInstance(); + InstanceIdentifier path = versionIdBuilder.build(); WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); tx.merge(LogicalDatastoreType.CONFIGURATION, path, @@ -275,8 +273,7 @@ public class AsdcApiProvider implements AutoCloseable, ASDCAPIService { . builder(VfLicenseModelVersions.class) .child(VfLicenseModelVersion.class, version.getKey()); - InstanceIdentifier path = versionIdBuilder - .toInstance(); + InstanceIdentifier path = versionIdBuilder.build(); WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); diff --git a/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml b/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml index 6229db1f6..810ce8c5e 100644 --- a/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml +++ b/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml @@ -15,7 +15,7 @@ odl:type="default" /> Date: Fri, 13 Oct 2017 15:51:22 -0400 Subject: Fix sli/northbound blueprint Wrong package name is used for NotificationPublishService in blueprint, resulting in asdcApi and dataChange not being loaded properly. Change-Id: I144f8e4bd48e547e7c7241e9ebaacf744d808022 Issue-ID: CCSDK-119 Signed-off-by: Dan Timoney --- .../src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml | 2 +- .../main/resources/org/opendaylight/blueprint/datachange-blueprint.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml') diff --git a/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml b/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml index 810ce8c5e..9ad08d3db 100644 --- a/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml +++ b/asdcApi/provider/src/main/resources/org/opendaylight/blueprint/asdc-blueprint.xml @@ -15,7 +15,7 @@ odl:type="default" />