Fix for artifact handler rpc error 67/65567/2
authorPatrick Brady <pb071s@att.com>
Mon, 10 Sep 2018 15:39:45 +0000 (08:39 -0700)
committerPatrick Brady <pb071s@att.com>
Mon, 10 Sep 2018 15:49:16 +0000 (15:49 +0000)
Change over to using blueprint for rpc registration

Change-Id: Ie647472eb3e42eb7e878c526b13acbfffd1bc18f
Signed-off-by: Patrick Brady <pb071s@att.com>
Issue-ID: APPC-1185

appc-inbound/appc-artifact-handler/features/onap-appc-artifact-handler/src/main/feature/feature.xml [deleted file]
appc-inbound/appc-artifact-handler/installer/pom.xml
appc-inbound/appc-artifact-handler/provider/pom.xml
appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/ArtifactHandlerProvider.java
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]
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]
appc-inbound/appc-artifact-handler/provider/src/main/resources/initial/appc-artifact-handler-provider.xml [deleted file]
appc-inbound/appc-artifact-handler/provider/src/main/resources/org/opendaylight/blueprint/artifact-handler-blueprint.xml [new file with mode: 0644]
appc-inbound/appc-artifact-handler/provider/src/main/yang/artifact-handler-provider-impl.yang [deleted file]

diff --git a/appc-inbound/appc-artifact-handler/features/onap-appc-artifact-handler/src/main/feature/feature.xml b/appc-inbound/appc-artifact-handler/features/onap-appc-artifact-handler/src/main/feature/feature.xml
deleted file mode 100644 (file)
index 0e5ddcf..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ============LICENSE_START=======================================================
-  ONAP : APPC
-  ================================================================================
-  Copyright (C) 2018 AT&T Intellectual Property. 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=========================================================
-  -->
-<features name="onap-appc-artifact-handler" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0">
-    <feature name="onap-appc-artifact-handler" version="${project.version}">
-       <configfile finalname="etc/opendaylight/karaf/200-artifact-handler-provider.xml">mvn:org.onap.appc/appc-artifact-handler-provider/${project.version}/xml/config</configfile>
-    </feature>
-</features>
\ No newline at end of file
index c1ef464..6a953d4 100755 (executable)
                        <version>${project.version}</version>
                </dependency>
                
-               <dependency>
-                       <groupId>org.onap.appc</groupId>
-                       <artifactId>appc-artifact-handler-provider</artifactId>
-                       <version>${project.version}</version>
-                       <classifier>config</classifier>
-                       <type>xml</type>
-               </dependency>
 
        </dependencies>
 
index c82cf2e..1f94140 100755 (executable)
@@ -50,70 +50,6 @@ limitations under the License.
                                        </instructions>
                                </configuration>
                        </plugin>
-            <plugin>
-                <groupId>org.opendaylight.yangtools</groupId>
-                <artifactId>yang-maven-plugin</artifactId>
-                <version>${odl.yangtools.version}</version>
-                <executions>
-                    <execution>
-                        <id>config</id>
-                        <goals>
-                            <goal>generate-sources</goal>
-                        </goals>
-                        <configuration>
-                            <codeGenerators>
-                                <generator>
-                                    <codeGeneratorClass>org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator</codeGeneratorClass>
-                                    <outputBaseDir>${jmxGeneratorPath}</outputBaseDir>
-                                    <additionalConfiguration>
-                                        <namespaceToPackage1>urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang</namespaceToPackage1>
-                                    </additionalConfiguration>
-                                </generator>
-                                <generator>
-                                    <codeGeneratorClass>org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
-                                    <outputBaseDir>${salGeneratorPath}</outputBaseDir>
-                                </generator>
-                            </codeGenerators>
-                            <inspectDependencies>true</inspectDependencies>
-                        </configuration>
-                    </execution>
-                </executions>
-                <dependencies>
-                    <dependency>
-                        <groupId>org.opendaylight.mdsal</groupId>
-                        <artifactId>maven-sal-api-gen-plugin</artifactId>
-                        <version>${odl.sal.api.gen.plugin.version}</version>
-                        <type>jar</type>
-                    </dependency>
-                    <dependency>
-                        <groupId>org.opendaylight.controller</groupId>
-                        <artifactId>yang-jmx-generator-plugin</artifactId>
-                        <version>${odl.yang.jmx.generator.version}</version>
-                    </dependency>
-                </dependencies>
-            </plugin>
-                       <plugin>
-                               <groupId>org.codehaus.mojo</groupId>
-                               <artifactId>build-helper-maven-plugin</artifactId>
-                               <executions>
-                                       <execution>
-                                               <id>attach-artifacts</id>
-                                               <goals>
-                                                       <goal>attach-artifact</goal>
-                                               </goals>
-                                               <phase>package</phase>
-                                               <configuration>
-                                                       <artifacts>
-                                                               <artifact>
-                                                                       <file>${project.build.directory}/classes/initial/appc-artifact-handler-provider.xml</file>
-                                                                       <type>xml</type>
-                                                                       <classifier>config</classifier>
-                                                               </artifact>
-                                                       </artifacts>
-                                               </configuration>
-                                       </execution>
-                               </executions>
-                       </plugin>
                </plugins>
        </build>
 
index 5873d3e..5bfdf96 100644 (file)
@@ -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<DataChangeListener> dclServices;
 
     protected BindingAwareBroker.RpcRegistration<ArtifactHandlerService> 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 (file)
index c791341..0000000
+++ /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 (file)
index 8b80148..0000000
+++ /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 (file)
index 2099359..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ============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=========================================================
-  -->
-
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<snapshot>
-    <configuration>
-        <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
-            <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
-                <module>
-                
-                    <!-- This xmlns:prefix should match the namespace in the *-provider-impl.yang file
-                         The prefix: inside type should match the prefix of the yang file. -->
-                    <type xmlns:prefix="org:onap:appc:artifact:handler:provider:impl">
-                        prefix:artifact-handler-provider-impl
-                    </type>
-                    <name>artifact-handler-provider-impl</name>
-
-                    <!--  The following sections contain bindings to services defined in the
-                          *-provider-impl yang file. For example the rpc-registry is required
-                          because we have a dependency (or augmentation) named "rpc-registry"
-                          and which binds to the md-sa-binding-registry. If you remove those
-                          dependencies from the yang file then you can remove them from here. -->
-                    <rpc-registry>
-                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
-                        <name>binding-rpc-broker</name>
-                    </rpc-registry>
-                    
-                    <data-broker>
-                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
-                        <name>binding-data-broker</name>
-                    </data-broker>
-                    
-                     <notification-service>
-                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
-                            binding:binding-notification-service
-                        </type>
-                        <name>binding-notification-broker</name>
-                    </notification-service>
-                </module>
-
-            </modules>
-        </data>
-
-    </configuration>
-
-    <!--  Required capabilities are basically a listing of all modules that need to be imported before
-          our service can be resolved. Capabilities for dependencies defined above are implied which is
-          why we do not have define a required capability for the data broker, for example. -->
-    <required-capabilities>
-        <capability>org:onap:appc:artifact:handler:provider:impl?module=artifact-handler-provider-impl&amp;revision=2017-03-21</capability>
-    </required-capabilities>
-
-</snapshot>
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 (file)
index 0000000..d74724c
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  ONAP : APPC
+  ================================================================================
+  Copyright (C) 2018 AT&T Intellectual Property. 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 id="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"
+               odl:type="default" />
+
+    <reference id="rpcRegistry"
+               interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"
+               odl:type="default" />
+
+    <bean id="artifact-handler" class="org.onap.appc.artifact.handler.ArtifactHandlerProvider">
+        <argument ref="dataBroker" />
+        <argument ref="notificationService" />
+        <argument ref="rpcRegistry" />
+    </bean>
+
+    <odl:rpc-implementation ref="artifact-handler"/>
+
+</blueprint>
\ 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 (file)
index 8b792e1..0000000
+++ /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;
-                    }
-                }
-            }
-        }
-    }
-}