From 237e4d0ffa907fefd203f1e34cba840f4d8eba08 Mon Sep 17 00:00:00 2001 From: Patrick Brady Date: Mon, 10 Sep 2018 08:39:45 -0700 Subject: Fix for artifact handler rpc error Change over to using blueprint for rpc registration Change-Id: Ie647472eb3e42eb7e878c526b13acbfffd1bc18f Signed-off-by: Patrick Brady Issue-ID: APPC-1185 --- .../artifact/handler/ArtifactHandlerProvider.java | 8 +- .../rev170321/ArtifactHandlerProviderModule.java | 58 --------------- .../ArtifactHandlerProviderModuleFactory.java | 36 --------- .../initial/appc-artifact-handler-provider.xml | 74 ------------------- .../blueprint/artifact-handler-blueprint.xml | 47 ++++++++++++ .../main/yang/artifact-handler-provider-impl.yang | 85 ---------------------- 6 files changed, 50 insertions(+), 258 deletions(-) delete mode 100644 appc-inbound/appc-artifact-handler/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/artifact/handler/provider/impl/rev170321/ArtifactHandlerProviderModule.java delete mode 100644 appc-inbound/appc-artifact-handler/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/artifact/handler/provider/impl/rev170321/ArtifactHandlerProviderModuleFactory.java delete mode 100644 appc-inbound/appc-artifact-handler/provider/src/main/resources/initial/appc-artifact-handler-provider.xml create mode 100644 appc-inbound/appc-artifact-handler/provider/src/main/resources/org/opendaylight/blueprint/artifact-handler-blueprint.xml delete mode 100644 appc-inbound/appc-artifact-handler/provider/src/main/yang/artifact-handler-provider-impl.yang (limited to 'appc-inbound/appc-artifact-handler/provider/src') diff --git a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/ArtifactHandlerProvider.java b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/ArtifactHandlerProvider.java index 5873d3e3e..5bfdf96b8 100644 --- a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/ArtifactHandlerProvider.java +++ b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/ArtifactHandlerProvider.java @@ -30,6 +30,7 @@ import java.util.concurrent.Future; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.DataChangeListener; +import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent; import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; @@ -66,14 +67,14 @@ public class ArtifactHandlerProvider implements AutoCloseable, ArtifactHandlerSe private final String appName = "ArtifactsHandler"; private final ExecutorService executor; protected DataBroker dataBroker; - protected NotificationProviderService notificationService; + protected NotificationPublishService notificationService; protected RpcProviderRegistry rpcRegistry; private ListenerRegistration dclServices; protected BindingAwareBroker.RpcRegistration rpcRegistration; public ArtifactHandlerProvider(DataBroker dataBroker2, - NotificationProviderService notificationProviderService, + NotificationPublishService notificationProviderService, RpcProviderRegistry rpcProviderRegistry) { this.log.info("Creating provider for " + appName); executor = Executors.newFixedThreadPool(10); @@ -95,9 +96,6 @@ public class ArtifactHandlerProvider implements AutoCloseable, ArtifactHandlerSe } // Listener for changes to Services tree - rpcRegistration = rpcRegistry.addRpcImplementation( - ArtifactHandlerService.class, this); - log.info("Initialization complete for " + appName); } private void createContainers() { diff --git a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/artifact/handler/provider/impl/rev170321/ArtifactHandlerProviderModule.java b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/artifact/handler/provider/impl/rev170321/ArtifactHandlerProviderModule.java deleted file mode 100644 index c791341af..000000000 --- a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/artifact/handler/provider/impl/rev170321/ArtifactHandlerProviderModule.java +++ /dev/null @@ -1,58 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP : APPC - * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Copyright (C) 2017 Amdocs - * ============================================================================= - * 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========================================================= - */ - -package org.opendaylight.yang.gen.v1.org.onap.appc.artifact.handler.provider.impl.rev170321; - -import org.onap.appc.artifact.handler.ArtifactHandlerProvider; - -public class ArtifactHandlerProviderModule extends org.opendaylight.yang.gen.v1.org.onap.appc.artifact.handler.provider.impl.rev170321.AbstractArtifactHandlerProviderModule { - public ArtifactHandlerProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { - super(identifier, dependencyResolver); - } - - public ArtifactHandlerProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.org.onap.appc.artifact.handler.provider.impl.rev170321.ArtifactHandlerProviderModule oldModule, java.lang.AutoCloseable oldInstance) { - super(identifier, dependencyResolver, oldModule, oldInstance); - } - - @Override - public void customValidation() { - // add custom validation form module attributes here. - } - - @Override - public java.lang.AutoCloseable createInstance() { - final ArtifactHandlerProvider provider = new ArtifactHandlerProvider(getDataBrokerDependency() - , getNotificationServiceDependency() - , getRpcRegistryDependency()); - - return new AutoCloseable() { - - @Override - public void close() throws Exception { - provider.close(); - } - }; - } - - -} diff --git a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/artifact/handler/provider/impl/rev170321/ArtifactHandlerProviderModuleFactory.java b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/artifact/handler/provider/impl/rev170321/ArtifactHandlerProviderModuleFactory.java deleted file mode 100644 index 8b80148a9..000000000 --- a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/artifact/handler/provider/impl/rev170321/ArtifactHandlerProviderModuleFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP : APPC - * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Copyright (C) 2017 Amdocs - * ============================================================================= - * 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========================================================= - */ - -/* -* Generated file -* -* Generated from: yang module name: artifact-handler-provider-impl yang module local name: artifact-handler-provider-impl -* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator -* Generated at: Wed Aug 09 09:36:59 EDT 2017 -* -* Do not modify this file unless it is present under src/main directory -*/ -package org.opendaylight.yang.gen.v1.org.onap.appc.artifact.handler.provider.impl.rev170321; -public class ArtifactHandlerProviderModuleFactory extends org.opendaylight.yang.gen.v1.org.onap.appc.artifact.handler.provider.impl.rev170321.AbstractArtifactHandlerProviderModuleFactory { - -} diff --git a/appc-inbound/appc-artifact-handler/provider/src/main/resources/initial/appc-artifact-handler-provider.xml b/appc-inbound/appc-artifact-handler/provider/src/main/resources/initial/appc-artifact-handler-provider.xml deleted file mode 100644 index 209935962..000000000 --- a/appc-inbound/appc-artifact-handler/provider/src/main/resources/initial/appc-artifact-handler-provider.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - prefix:artifact-handler-provider-impl - - artifact-handler-provider-impl - - - - binding:binding-rpc-registry - binding-rpc-broker - - - - binding:binding-async-data-broker - binding-data-broker - - - - - binding:binding-notification-service - - binding-notification-broker - - - - - - - - - - - org:onap:appc:artifact:handler:provider:impl?module=artifact-handler-provider-impl&revision=2017-03-21 - - - diff --git a/appc-inbound/appc-artifact-handler/provider/src/main/resources/org/opendaylight/blueprint/artifact-handler-blueprint.xml b/appc-inbound/appc-artifact-handler/provider/src/main/resources/org/opendaylight/blueprint/artifact-handler-blueprint.xml new file mode 100644 index 000000000..d74724ce7 --- /dev/null +++ b/appc-inbound/appc-artifact-handler/provider/src/main/resources/org/opendaylight/blueprint/artifact-handler-blueprint.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/appc-inbound/appc-artifact-handler/provider/src/main/yang/artifact-handler-provider-impl.yang b/appc-inbound/appc-artifact-handler/provider/src/main/yang/artifact-handler-provider-impl.yang deleted file mode 100644 index 8b792e14e..000000000 --- a/appc-inbound/appc-artifact-handler/provider/src/main/yang/artifact-handler-provider-impl.yang +++ /dev/null @@ -1,85 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP : APPC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Copyright (C) 2017 Amdocs - * ============================================================================= - * 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. - * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. - * ============LICENSE_END========================================================= - */ - -module artifact-handler-provider-impl { - - yang-version 1; - namespace "org:onap:appc:artifact:handler:provider:impl"; - prefix "artifact-handler-provider-impl"; - - import config { prefix config; revision-date 2013-04-05; } - import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; } - - description - "This module contains the base YANG definitions for - artifact-handler-provider impl implementation."; - - revision "2017-03-21" { - description - "Initial revision."; - } - - // This is the definition of the service implementation as a module identity. - identity artifact-handler-provider-impl { - base config:module-type; - - // Specifies the prefix for generated java classes. - config:java-name-prefix ArtifactHandlerProvider; - } - - // Augments the 'configuration' choice node under modules/module. - // We consume the three main services, RPCs, DataStore, and Notifications - augment "/config:modules/config:module/config:configuration" { - case artifact-handler-provider-impl { - when "/config:modules/config:module/config:type = 'artifact-handler-provider-impl'"; - - container rpc-registry { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity mdsal:binding-rpc-registry; - } - } - } - - container notification-service { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity mdsal:binding-notification-service; - } - } - } - - container data-broker { - uses config:service-ref { - refine type { - mandatory false; - config:required-identity mdsal:binding-async-data-broker; - } - } - } - } - } -} -- cgit 1.2.3-korg