Fixed vnfapi install issue 17/18617/2
authorDan Timoney <dtimoney@att.com>
Thu, 12 Oct 2017 20:01:06 +0000 (16:01 -0400)
committerDan Timoney <dtimoney@att.com>
Thu, 12 Oct 2017 20:08:50 +0000 (16:08 -0400)
Fixed issues with vnfapi install:
 - Resolved issue installing vnftools by converting to blueprint
 - Resolved issue not finding RPC implementation of vnfapi by fixing
   dependency feature vnftools, and by converting vnfapi to blueprint.

The root cause in both cases was probably something wrong with the
provider configuration, but it was simpler (not to mention more
maintainable) to just convert from config to blueprint.

Change-Id: I7010a845687673c932457774f3103834d328ab84
Issue-ID: SDNC-119
Signed-off-by: Dan Timoney <dtimoney@att.com>
14 files changed:
vnfapi/features/pom.xml
vnfapi/features/src/main/resources/features.xml
vnfapi/installer/src/assembly/assemble_mvnrepo_zip.xml
vnfapi/provider/pom.xml
vnfapi/provider/src/main/java/org/onap/sdnc/vnfapi/VNFSDNSvcLogicServiceClient.java
vnfapi/provider/src/main/java/org/onap/sdnc/vnfapi/vnfapiProvider.java
vnfapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/sdnc/vnfapi/provider/impl/rev140523/VnfapiProviderModule.java [deleted file]
vnfapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/sdnc/vnfapi/provider/impl/rev140523/VnfapiProviderModuleFactory.java [deleted file]
vnfapi/provider/src/main/resources/initial/vnfapi-provider.xml [deleted file]
vnfapi/provider/src/main/resources/org/opendaylight/blueprint/vnfapi-blueprint.xml [new file with mode: 0644]
vnfapi/provider/src/main/yang/vnfapi-provider-impl.yang [deleted file]
vnftools/provider/pom.xml
vnftools/provider/src/main/java/org/onap/sdnc/vnftools/VnfToolsActivator.java
vnftools/provider/src/main/resources/org/opendaylight/blueprint/vnftools-blueprint.xml [new file with mode: 0644]

index f9a80f0..781328f 100644 (file)
             <artifactId>vnfapi-model</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>org.onap.sdnc.northbound</groupId>
-            <artifactId>vnfapi-provider</artifactId>
-            <classifier>config</classifier>
-            <type>xml</type>
-        </dependency>
+
         <dependency>
             <groupId>org.onap.sdnc.northbound</groupId>
             <artifactId>vnfapi-provider</artifactId>
index 3da86e0..2301d5a 100644 (file)
@@ -9,9 +9,9 @@
   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.
@@ -33,7 +33,6 @@
         <feature>sdnc-sli</feature>
         <bundle>mvn:org.onap.sdnc.northbound/vnfapi-model/${project.version}</bundle>
         <bundle>mvn:org.onap.sdnc.northbound/vnfapi-provider/${project.version}</bundle>
-        <configfile finalname="etc/opendaylight/karaf/200-vnfapi-provider.xml">mvn:org.openecomp.sdnc.northbound/vnfapi-provider/${project.version}/xml/config</configfile>
     </feature>
 
 </features>
index 162ce10..0612e6e 100644 (file)
     </fileSets>
 
     <files>
-        <file>
-            <source>../provider/src/main/resources/initial/${feature-name}-provider.xml</source>
-            <destName>./etc/opendaylight/karaf/200-${feature-name}-provider.xml</destName>
-        </file>
     <file>
         <source>../model/target/vnfapi.properties</source>
         <destName>./configuration/vnfapi.properties</destName>
index c603b4d..50ceb45 100644 (file)
                     </instructions>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.opendaylight.yangtools</groupId>
-                <artifactId>yang-maven-plugin</artifactId>
-                <version>${odl.yangtools.yang.maven.plugin.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/vnfapi-provider.xml</file>
-                                    <type>xml</type>
-                                    <classifier>config</classifier>
-                                </artifact>
-                            </artifacts>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
+
         </plugins>
     </build>
 
index 9f8696f..a9f051a 100644 (file)
@@ -8,9 +8,9 @@
  * 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.
@@ -43,24 +43,12 @@ public class VNFSDNSvcLogicServiceClient {
     private static final Logger LOG = LoggerFactory
             .getLogger(VNFSDNSvcLogicServiceClient.class);
 
-    private SvcLogicService svcLogic = null;
+    private final SvcLogicService svcLogic;
 
-    public VNFSDNSvcLogicServiceClient()
+    public VNFSDNSvcLogicServiceClient(final SvcLogicService svcLogicService)
     {
-        BundleContext bctx = FrameworkUtil.getBundle(SvcLogicService.class).getBundleContext();
+               this.svcLogic = svcLogicService;
 
-        // Get SvcLogicService reference
-        ServiceReference sref = bctx.getServiceReference(SvcLogicService.NAME);
-        if (sref  != null)
-        {
-            svcLogic =  (SvcLogicService) bctx.getService(sref);
-
-        }
-        else
-        {
-            LOG.warn("Cannot find service reference for "+SvcLogicService.NAME);
-
-        }
     }
 
     public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException
index 9dd1a2a..f64cb0b 100644 (file)
@@ -169,15 +169,18 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL
     protected RpcProviderRegistry rpcRegistry;
     protected BindingAwareBroker.RpcRegistration<VNFAPIService> rpcRegistration;
 
+    private VNFSDNSvcLogicServiceClient svcLogicClient;
+
 
 
     public vnfapiProvider(DataBroker dataBroker2, NotificationPublishService notificationPublishService,
-            RpcProviderRegistry rpcProviderRegistry) {
+            RpcProviderRegistry rpcProviderRegistry, VNFSDNSvcLogicServiceClient client) {
         this.log.info( "Creating provider for " + appName );
         executor = Executors.newFixedThreadPool(1);
         dataBroker = dataBroker2;
         notificationService = notificationPublishService;
         rpcRegistry = rpcProviderRegistry;
+        this.svcLogicClient = client;
         initialize();
 
     }
@@ -191,7 +194,7 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         } catch (Exception e) {
             log.error("Caught Exception while trying to load properties file: ", e);
         }
-        rpcRegistration = rpcRegistry.addRpcImplementation(VNFAPIService.class, this);
+        // rpcRegistration = rpcRegistry.addRpcImplementation(VNFAPIService.class, this);
 
         log.info( "Initialization complete for " + appName );
     }
@@ -1104,7 +1107,6 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // Call SLI sync method
         // Get SvcLogicService reference
 
-        VNFSDNSvcLogicServiceClient svcLogicClient = new VNFSDNSvcLogicServiceClient();
         Properties respProps = null;
 
         String errorCode = "200";
@@ -1357,7 +1359,6 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // Call SLI sync method
         // Get SvcLogicService reference
 
-        VNFSDNSvcLogicServiceClient svcLogicClient = new VNFSDNSvcLogicServiceClient();
         Properties respProps = null;
 
         String errorCode = "200";
@@ -1587,7 +1588,6 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // Call SLI sync method
         // Get SvcLogicService reference
 
-        VNFSDNSvcLogicServiceClient svcLogicClient = new VNFSDNSvcLogicServiceClient();
         Properties respProps = null;
 
         String errorCode = "200";
@@ -1797,7 +1797,6 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // Call SLI sync method
         // Get SvcLogicService reference
 
-        VNFSDNSvcLogicServiceClient svcLogicClient = new VNFSDNSvcLogicServiceClient();
         Properties respProps = null;
 
         String errorCode = "200";
@@ -1973,7 +1972,6 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // Call SLI sync method
         // Get SvcLogicService reference
 
-        VNFSDNSvcLogicServiceClient svcLogicClient = new VNFSDNSvcLogicServiceClient();
         Properties respProps = null;
 
         String errorCode = "200";
@@ -2168,7 +2166,6 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // Call SLI sync method
         // Get SvcLogicService reference
 
-        VNFSDNSvcLogicServiceClient svcLogicClient = new VNFSDNSvcLogicServiceClient();
         Properties respProps = null;
 
         String errorCode = "200";
@@ -2364,7 +2361,7 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // Call SLI sync method
         // Get SvcLogicService reference
 
-        VNFSDNSvcLogicServiceClient svcLogicClient = new VNFSDNSvcLogicServiceClient();
+
         Properties respProps = null;
 
         String errorCode = "200";
@@ -2554,7 +2551,6 @@ public class vnfapiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // Call SLI sync method
         // Get SvcLogicService reference
 
-        VNFSDNSvcLogicServiceClient svcLogicClient = new VNFSDNSvcLogicServiceClient();
         Properties respProps = null;
 
         String errorCode = "200";
diff --git a/vnfapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/sdnc/vnfapi/provider/impl/rev140523/VnfapiProviderModule.java b/vnfapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/sdnc/vnfapi/provider/impl/rev140523/VnfapiProviderModule.java
deleted file mode 100644 (file)
index 5150d08..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 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=========================================================
- */
-
-package org.opendaylight.yang.gen.v1.org.onap.sdnc.vnfapi.provider.impl.rev140523;
-
-import org.onap.sdnc.vnfapi.vnfapiProvider;
-
-public class VnfapiProviderModule extends org.opendaylight.yang.gen.v1.org.onap.sdnc.vnfapi.provider.impl.rev140523.AbstractVnfapiProviderModule {
-    public VnfapiProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public VnfapiProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.org.onap.sdnc.vnfapi.provider.impl.rev140523.VnfapiProviderModule 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 vnfapiProvider provider = new vnfapiProvider(getDataBrokerDependency()
-                , getNotificationPublishAdapterDependency()
-                , getRpcRegistryDependency());
-
-        return new AutoCloseable() {
-
-           @Override
-           public void close() throws Exception {
-               provider.close();
-           }
-       };
-
-    }
-
-}
diff --git a/vnfapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/sdnc/vnfapi/provider/impl/rev140523/VnfapiProviderModuleFactory.java b/vnfapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/sdnc/vnfapi/provider/impl/rev140523/VnfapiProviderModuleFactory.java
deleted file mode 100644 (file)
index bb8eac5..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * openECOMP : SDN-C
- * ================================================================================
- * Copyright (C) 2017 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=========================================================
- */
-
-/*
-* Generated file
-*
-* Generated from: yang module name: vnfapi-provider-impl yang module local name: vnfapi-provider-impl
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Tue Nov 08 09:03:40 EST 2016
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.yang.gen.v1.org.onap.sdnc.vnfapi.provider.impl.rev140523;
-public class VnfapiProviderModuleFactory extends org.opendaylight.yang.gen.v1.org.onap.sdnc.vnfapi.provider.impl.rev140523.AbstractVnfapiProviderModuleFactory {
-
-}
diff --git a/vnfapi/provider/src/main/resources/initial/vnfapi-provider.xml b/vnfapi/provider/src/main/resources/initial/vnfapi-provider.xml
deleted file mode 100644 (file)
index 3883f67..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ============LICENSE_START=======================================================
-  openECOMP : SDN-C
-  ================================================================================
-  Copyright (C) 2017 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=========================================================
-  -->
-
-<!-- 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:openecomp:sdnc:vnfapi:provider:impl">
-                        prefix:vnfapi-provider-impl
-                    </type>
-                    <name>vnfapi-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:impl">
-                             binding:binding-new-notification-publish-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:openecomp:sdnc:vnfapi:provider:impl?module=vnfapi-provider-impl&amp;revision=2014-05-23</capability>
-    </required-capabilities>
-
-</snapshot>
diff --git a/vnfapi/provider/src/main/resources/org/opendaylight/blueprint/vnfapi-blueprint.xml b/vnfapi/provider/src/main/resources/org/opendaylight/blueprint/vnfapi-blueprint.xml
new file mode 100644 (file)
index 0000000..8741a09
--- /dev/null
@@ -0,0 +1,34 @@
+<?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">
+
+    <reference id="svcLogicService"
+               interface="org.onap.ccsdk.sli.core.sli.provider.SvcLogicService" />
+
+    <bean id="client" class="org.onap.sdnc.vnfapi.VNFSDNSvcLogicServiceClient">
+        <argument ref="svcLogicService" />
+    </bean>
+
+    <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="provider" class="org.onap.sdnc.vnfapi.vnfapiProvider">
+        <argument ref="dataBroker" />
+        <argument ref="notificationService" />
+        <argument ref="rpcRegistry" />
+        <argument ref="client" />
+    </bean>
+
+    <odl:rpc-implementation ref="provider"/>
+
+</blueprint>
\ No newline at end of file
diff --git a/vnfapi/provider/src/main/yang/vnfapi-provider-impl.yang b/vnfapi/provider/src/main/yang/vnfapi-provider-impl.yang
deleted file mode 100644 (file)
index 183fa90..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-module vnfapi-provider-impl {
-
-    yang-version 1;
-    namespace "org:onap:sdnc:vnfapi:provider:impl";
-    prefix "vnfapi-provider-impl";
-
-    import config { prefix config; revision-date 2013-04-05; }
-    import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; }
-    import opendaylight-sal-binding-broker-impl {
-        prefix binding-impl;
-        revision-date 2013-10-28;
-    }
-
-     description
-        "This module contains the base YANG definitions for
-        vnfapi-provider impl implementation.";
-
-    revision "2014-05-23" {
-        description
-            "Initial revision.";
-    }
-
-    // This is the definition of the service implementation as a module identity.
-    identity vnfapi-provider-impl {
-            base config:module-type;
-
-            // Specifies the prefix for generated java classes.
-            config:java-name-prefix vnfapiProvider;
-    }
-
-    // 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 vnfapi-provider-impl {
-            when "/config:modules/config:module/config:type = 'vnfapi-provider-impl'";
-
-            container rpc-registry {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity mdsal:binding-rpc-registry;
-                    }
-                }
-            }
-
-            container notification-publish-adapter {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity binding-impl:binding-new-notification-publish-service;
-                    }
-                }
-            }
-
-            container data-broker {
-                uses config:service-ref {
-                    refine type {
-                        mandatory false;
-                        config:required-identity mdsal:binding-async-data-broker;
-                    }
-                }
-            }
-        }
-    }
-}
index 146453e..05ec84a 100644 (file)
@@ -1,83 +1,83 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-       <modelVersion>4.0.0</modelVersion>
-       <parent>
-               <groupId>org.onap.sdnc.northbound</groupId>
-               <artifactId>vnftools</artifactId>
-               <version>1.2.0-SNAPSHOT</version>
-       </parent>
-       <artifactId>vnftools-provider</artifactId>
-       <packaging>bundle</packaging>
-       <name>VNF Tools Plugin - Provider</name>
-       <url>http://maven.apache.org</url>
-       <properties>
-               <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-       </properties>
-       <dependencies>
-               <dependency>
-                       <groupId>junit</groupId>
-                       <artifactId>junit</artifactId>
-                       <version>${junit.version}</version>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.onap.ccsdk.sli.core</groupId>
-                       <artifactId>sli-common</artifactId>
-                       <version>${sdnctl.sli.version}</version>
-                       <scope>compile</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.onap.ccsdk.sli.core</groupId>
-                       <artifactId>sli-provider</artifactId>
-                       <version>${sdnctl.sli.version}</version>
-                       <scope>compile</scope>
-               </dependency>
-               <dependency>
-                       <groupId>equinoxSDK381</groupId>
-                       <artifactId>org.eclipse.osgi</artifactId>
-                       <version>${equinox.osgi.version}</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.slf4j</groupId>
-                       <artifactId>slf4j-api</artifactId>
-                       <version>${slf4j.version}</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.slf4j</groupId>
-                       <artifactId>jcl-over-slf4j</artifactId>
-                       <version>${slf4j.version}</version>
-               </dependency>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.onap.sdnc.northbound</groupId>
+        <artifactId>vnftools</artifactId>
+        <version>1.2.0-SNAPSHOT</version>
+    </parent>
+    <artifactId>vnftools-provider</artifactId>
+    <packaging>bundle</packaging>
+    <name>VNF Tools Plugin - Provider</name>
+    <url>http://maven.apache.org</url>
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>${junit.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.ccsdk.sli.core</groupId>
+            <artifactId>sli-common</artifactId>
+            <version>${sdnctl.sli.version}</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.ccsdk.sli.core</groupId>
+            <artifactId>sli-provider</artifactId>
+            <version>${sdnctl.sli.version}</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>equinoxSDK381</groupId>
+            <artifactId>org.eclipse.osgi</artifactId>
+            <version>${equinox.osgi.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>${slf4j.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+            <version>${slf4j.version}</version>
+        </dependency>
 
-               <dependency>
-                       <groupId>org.onap.ccsdk.sli.core</groupId>
-                       <artifactId>sliPluginUtils-provider</artifactId>
-                       <version>${sdnctl.slipluginutils.version}</version>
-                       <type>jar</type>
-                       <scope>compile</scope>
-               </dependency>
-       </dependencies>
+        <dependency>
+            <groupId>org.onap.ccsdk.sli.core</groupId>
+            <artifactId>sliPluginUtils-provider</artifactId>
+            <version>${sdnctl.slipluginutils.version}</version>
+            <type>jar</type>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
 
-       <build>
-               <plugins>
+    <build>
+        <plugins>
 
 
-                       <plugin>
-                               <groupId>org.apache.felix</groupId>
-                               <artifactId>maven-bundle-plugin</artifactId>
-                               <version>${bundle.plugin.version}</version>
-                               <extensions>true</extensions>
-                               <configuration>
-                                       <instructions>
-                                               <Bundle-SymbolicName>org.onap.sdnc.vnftools</Bundle-SymbolicName>
-                                               <Bundle-Activator>org.onap.sdnc.vnftools.VnfToolsActivator</Bundle-Activator>
-                                               <Export-Package>org.onap.sdnc.vnftools</Export-Package>
-                                               <Import-Package>org.onap.sdnc.*,org.osgi.framework.*,org.slf4j.*,java.net.*,org.apache.commons.*</Import-Package>
-                                               <Embed-Dependency>*;scope=compile|runtime;artifactId=!sli-common|org.eclipse.osgi|mysql-connector-java|slf4j-api|jcl-over-slf4j|xml-apis|InetAddress|commons-lang3</Embed-Dependency>
-                                               <Embed-Transitive>true</Embed-Transitive>
-                                       </instructions>
-                               </configuration>
-                       </plugin>
-               </plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>${bundle.plugin.version}</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>org.onap.sdnc.vnftools</Bundle-SymbolicName>
+                        <Export-Package>org.onap.sdnc.vnftools.*</Export-Package>
+                        <Import-Package>org.onap.sdnc.*,org.osgi.framework.*,org.slf4j.*,java.net.*,org.apache.commons.*</Import-Package>
+                        <Embed-Dependency>*;scope=compile|runtime;artifactId=!sli-common|org.eclipse.osgi|mysql-connector-java|slf4j-api|jcl-over-slf4j|xml-apis|InetAddress|commons-lang3</Embed-Dependency>
+                        <Embed-Transitive>true</Embed-Transitive>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
 
-       </build>
+    </build>
 </project>
index 5a06b07..fe9f9d4 100644 (file)
@@ -8,9 +8,9 @@
  * 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.
@@ -46,29 +46,8 @@ public class VnfToolsActivator implements BundleActivator {
 
        @Override
        public void start(BundleContext ctx) throws Exception {
-               // Read properties
-               Properties props = new Properties();
 
-               String propDir = System.getenv(SDNC_CONFIG_DIR);
-               if (propDir == null) {
-                       propDir = "/opt/sdnc/data/properties";
-               }
-
-               String propPath = propDir + VNFTOOLS_PROP_VAR;
-
-               File propFile = new File(propPath);
-
-               if (!propFile.exists()) {
-                       props = null;
-               } else {
-
-                       try {
-                               props.load(new FileInputStream(propFile));
-                       } catch (Exception e) {
-                               throw new ConfigurationException("Could not load properties file " + propPath, e);
-                       }
-               }
-               VnfTools plugin = new VnfTools(props);
+               VnfTools plugin = new VnfTools(null);
 
                LOG.info("Registering service " + plugin.getClass().getName());
                registrations.add(ctx.registerService(plugin.getClass().getName(), plugin, null));
diff --git a/vnftools/provider/src/main/resources/org/opendaylight/blueprint/vnftools-blueprint.xml b/vnftools/provider/src/main/resources/org/opendaylight/blueprint/vnftools-blueprint.xml
new file mode 100644 (file)
index 0000000..d784db7
--- /dev/null
@@ -0,0 +1,10 @@
+<?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="vnftools" class="org.onap.sdnc.vnftools.VnfTools" />
+    <service ref="vnftools" interface="org.onap.sdnc.vnftools.VnfTools" />
+
+</blueprint>
\ No newline at end of file