aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2018-02-01 16:57:00 -0500
committerDan Timoney <dtimoney@att.com>2018-02-09 17:08:35 -0500
commit131cb46f6109a6099a445cb8e1b12ff5b68ae6de (patch)
tree783f96f27c1bc9292fdd836c488c4dd8a86aeb2d
parente36be89362fe80a7cd3da69a886c6c1f1c99a65c (diff)
Upgrade sli/core to Nitrogen
Use Apache derby for dblib SingleFeatureTest Change-Id: I6b41f7ede1a98b33824fceea9100e75c1ce8dda4 Issue-ID: CCSDK-175 Signed-off-by: Dan Timoney <dtimoney@att.com> Generalization of CCSDK core/utils framework Changes made: * Created generalized version of core/utils/dblib as core/utils/common * Deprecated core/utils/dblib package Change-Id: I0992c43910278fbe254674d1e39d7e4fcad0a592 Issue-ID: CCSDK-168 Signed-off-by: Rich Tabedzki <richard.tabedzki@att.com> Use Apache derby for dblib test Use Apache derby for dblib SingleFeatureTest Change-Id: Ie497557f162e203fa5c5c82c17ddc55ba0c11b38 Issue-ID: CCSDK-175 Signed-off-by: Dan Timoney <dtimoney@att.com>
-rw-r--r--dblib/features/ccsdk-dblib/pom.xml96
-rw-r--r--dblib/features/ccsdk-dblib/src/main/feature/feature.xml14
-rw-r--r--dblib/features/features-dblib/pom.xml29
-rwxr-xr-xdblib/features/pom.xml143
-rwxr-xr-xdblib/features/src/main/resources/features.xml18
-rwxr-xr-xdblib/installer/pom.xml268
-rwxr-xr-xdblib/pom.xml87
-rwxr-xr-xdblib/provider/pom.xml90
-rwxr-xr-xdblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java1008
-rwxr-xr-xdblib/provider/src/main/resources/dblib.properties7
-rw-r--r--filters/features/ccsdk-filters/pom.xml61
-rw-r--r--filters/features/features-filters/pom.xml29
-rwxr-xr-xfilters/features/pom.xml105
-rw-r--r--filters/features/src/main/resources/features.xml32
-rwxr-xr-xfilters/installer/pom.xml23
-rw-r--r--filters/pom.xml87
-rwxr-xr-xfilters/provider/pom.xml126
-rwxr-xr-xpom.xml92
-rwxr-xr-xsli/common/pom.xml289
-rw-r--r--sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicDblibStore.java42
-rw-r--r--sli/features/features-sli/pom.xml29
-rw-r--r--sli/features/odl-sli/pom.xml86
-rw-r--r--[-rwxr-xr-x]sli/features/pom.xml161
-rw-r--r--sli/features/src/main/resources/features.xml39
-rwxr-xr-xsli/installer/pom.xml25
-rwxr-xr-xsli/model/pom.xml89
-rwxr-xr-xsli/pom.xml61
-rwxr-xr-xsli/provider/pom.xml186
-rw-r--r--sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/CallNodeExecutor.java38
-rw-r--r--sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicActivator.java181
-rw-r--r--sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicNodeExecutor.java21
-rw-r--r--sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicPropertiesProvider.java188
-rw-r--r--sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java55
-rwxr-xr-xsli/provider/src/main/resources/org/opendaylight/blueprint/sli-blueprint.xml21
-rw-r--r--sli/provider/src/main/resources/svclogic.properties25
-rw-r--r--sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ExecuteNodeExecutorTest.java7
-rw-r--r--sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ITCaseSvcLogicGraphExecutor.java7
-rw-r--r--sli/provider/src/test/resources/svclogic.properties11
-rwxr-xr-xsli/recording/pom.xml71
-rw-r--r--sliPluginUtils/features/ccsdk-sliPluginUtils/pom.xml65
-rw-r--r--sliPluginUtils/features/features-sliPluginUtils/pom.xml29
-rwxr-xr-xsliPluginUtils/features/pom.xml130
-rw-r--r--sliPluginUtils/features/src/main/resources/features.xml38
-rwxr-xr-xsliPluginUtils/installer/pom.xml23
-rwxr-xr-xsliPluginUtils/pom.xml38
-rwxr-xr-xsliPluginUtils/provider/pom.xml47
-rw-r--r--sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2PropertiesProvider.java421
-rw-r--r--sliPluginUtils/provider/src/main/resources/dme2.properties7
-rw-r--r--sliapi/features/ccsdk-sliapi/pom.xml60
-rw-r--r--sliapi/features/features-sliapi/pom.xml29
-rwxr-xr-xsliapi/features/pom.xml139
-rw-r--r--sliapi/features/src/main/resources/features.xml39
-rwxr-xr-xsliapi/installer/pom.xml24
-rw-r--r--sliapi/installer/src/assembly/assemble_mvnrepo_zip.xml10
-rwxr-xr-xsliapi/model/pom.xml78
-rwxr-xr-xsliapi/pom.xml56
-rwxr-xr-xsliapi/provider/pom.xml116
-rw-r--r--sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/sliapiProvider.java17
-rw-r--r--sliapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/core/sliapi/provider/impl/rev140523/SliapiProviderModule.java64
-rw-r--r--sliapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/core/sliapi/provider/impl/rev140523/SliapiProviderModuleFactory.java34
-rw-r--r--sliapi/provider/src/main/resources/initial/sliapi-provider.xml70
-rw-r--r--sliapi/provider/src/main/resources/org/opendaylight/blueprint/sliapi-blueprint.xml28
-rw-r--r--utils/features/features-util/pom.xml29
-rwxr-xr-xutils/features/features3-util/pom.xml141
-rwxr-xr-xutils/features/features3-util/src/main/resources/features.xml (renamed from utils/features/src/main/resources/features.xml)0
-rwxr-xr-xutils/features/pom.xml146
-rw-r--r--utils/features/sdnc-slicore-utils/pom.xml52
-rwxr-xr-xutils/installer/pom.xml25
-rwxr-xr-xutils/pom.xml87
-rw-r--r--utils/provider/pom.xml35
-rwxr-xr-xutils/provider/src/main/java/org/onap/ccsdk/sli/core/utils/JREFileResolver.java7
71 files changed, 2712 insertions, 3319 deletions
diff --git a/dblib/features/ccsdk-dblib/pom.xml b/dblib/features/ccsdk-dblib/pom.xml
new file mode 100644
index 00000000..8cf1c93f
--- /dev/null
+++ b/dblib/features/ccsdk-dblib/pom.xml
@@ -0,0 +1,96 @@
+<?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.ccsdk.parent</groupId>
+ <artifactId>single-feature-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath />
+ </parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>ccsdk-dblib</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>feature</packaging>
+
+ <name>ccsdk-sli-core :: dblib :: ${project.artifactId}</name>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>mdsal-model-artifacts</artifactId>
+ <version>0.11.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>1.6.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>odl-mdsal-broker</artifactId>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>dblib-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mariadb.jdbc</groupId>
+ <artifactId>mariadb-java-client</artifactId>
+ <version>${mariadb.connector.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-jdbc</artifactId>
+ <version>${tomcat-jdbc.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>utils-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>equinoxSDK381</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ <version>${equinox.osgi.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.11.1.1</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.karaf.tooling</groupId>
+ <artifactId>karaf-maven-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <excludedArtifactIds>
+ <excludedArtifactId>slf4j-api</excludedArtifactId>
+ <excludedArtifactId>tomcat-jdbc</excludedArtifactId>
+ <excludedArtifactId>tomcat-juli</excludedArtifactId>
+ </excludedArtifactIds>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/dblib/features/ccsdk-dblib/src/main/feature/feature.xml b/dblib/features/ccsdk-dblib/src/main/feature/feature.xml
new file mode 100644
index 00000000..514ce8de
--- /dev/null
+++ b/dblib/features/ccsdk-dblib/src/main/feature/feature.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="ccsdk-dblib">
+ <repository>mvn:org.opendaylight.controller/odl-mdsal-broker/1.6.1/xml/features</repository>
+ <feature name="ccsdk-dblib" description="ccsdk-sli-core :: dblib :: ccsdk-dblib" version="${project.version}">
+ <details>Root POM to be used in place of odlparent for CCSDK based projects</details>
+ <feature version="1.6.1" prerequisite="false" dependency="false">odl-mdsal-broker</feature>
+ <feature prerequisite="true" dependency="false">wrap</feature>
+ <bundle>mvn:org.onap.ccsdk.sli.core/dblib-provider/${project.version}</bundle>
+ <bundle>mvn:org.mariadb.jdbc/mariadb-java-client/2.1.1</bundle>
+ <bundle>wrap:mvn:org.apache.tomcat/tomcat-jdbc/8.5.14/$DynamicImport-Package=org.mariadb.*,org.apache.derby.*&amp;overwrite=merge</bundle>
+ <bundle>wrap:mvn:org.apache.tomcat/tomcat-juli/8.5.14/$DynamicImport-Package=org.mariadb.*,org.apache.derby.*&amp;overwrite=merge</bundle>
+ <bundle>mvn:org.onap.ccsdk.sli.core/utils-provider/${project.version}</bundle>
+ </feature>
+</features>
diff --git a/dblib/features/features-dblib/pom.xml b/dblib/features/features-dblib/pom.xml
new file mode 100644
index 00000000..b7c2150d
--- /dev/null
+++ b/dblib/features/features-dblib/pom.xml
@@ -0,0 +1,29 @@
+<?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.ccsdk.parent</groupId>
+ <artifactId>feature-repo-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>features-dblib</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>feature</packaging>
+
+ <name>ccsdk-sli-core :: dblib :: ${project.artifactId}</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>ccsdk-dblib</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/dblib/features/pom.xml b/dblib/features/pom.xml
index e9cb6dd0..18f08739 100755
--- a/dblib/features/pom.xml
+++ b/dblib/features/pom.xml
@@ -1,138 +1,23 @@
<?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>
- <artifactId>dblib</artifactId>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
- <artifactId>dblib-features</artifactId>
- <name>DBLIB Adaptor - Features</name>
-
- <packaging>jar</packaging>
-
- <dependencies>
-
-
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>dblib-provider</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>${commons.lang.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>features-mdsal</artifactId>
- <version>${odl.mdsal.features.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
-
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>tomcat-jdbc</artifactId>
- <version>${tomcat-jdbc.version}</version>
- </dependency>
-
- <!-- dependency for opendaylight-karaf-empty for use by testing -->
- <dependency>
- <groupId>org.opendaylight.odlparent</groupId>
- <artifactId>opendaylight-karaf-empty</artifactId>
- <version>${odl.karaf.empty.distro.version}</version>
- <type>zip</type>
- </dependency>
-
- <dependency>
- <!-- Required for launching the feature tests -->
- <groupId>org.opendaylight.odlparent</groupId>
- <artifactId>features-test</artifactId>
- <version>${odl.commons.opendaylight.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>features-yangtools</artifactId>
- <version>${odl.yangtools.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>dblib-feature-aggregator</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
- <build>
- <resources>
- <resource>
- <filtering>true</filtering>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <id>filter</id>
- <goals>
- <goal>resources</goal>
- </goals>
- <phase>generate-resources</phase>
- </execution>
- </executions>
- </plugin>
- <!-- launches the feature test, which validates that your karaf feature
- can be installed inside of a karaf container. It doesn't validate that your
- functionality works correctly, just that you have all of the dependent bundles
- defined correctly.
- <plugin>
+ <name>ccsdk-sli-core :: dblib :: ${project.artifactId}</name>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version>
- <configuration>
- <systemPropertyVariables>
- <karaf.distro.groupId>org.opendaylight.odlparent</karaf.distro.groupId>
- <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
- <karaf.distro.version>${odl.karaf.empty.distro.version}</karaf.distro.version>
- </systemPropertyVariables>
- <dependenciesToScan>
- <dependency>org.opendaylight.yangtools:features-test</dependency>
- </dependenciesToScan>
- </configuration>
- </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/${features.file}</file>
- <type>xml</type>
- <classifier>features</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <modules>
+ <module>features-dblib</module>
+ <module>ccsdk-dblib</module>
+ </modules>
</project>
diff --git a/dblib/features/src/main/resources/features.xml b/dblib/features/src/main/resources/features.xml
deleted file mode 100755
index aa31db75..00000000
--- a/dblib/features/src/main/resources/features.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<features name="sdnc-dblib-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
-
- <repository>mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features</repository>
-
-
- <feature name='sdnc-dblib' description="sdnc-dblib" version='${project.version}'>
- <!-- Most applications will have a dependency on the ODL MD-SAL Broker -->
- <feature version="${odl.mdsal.version}">odl-mdsal-broker</feature>
- <bundle>wrap:mvn:org.apache.tomcat/tomcat-jdbc/${tomcat-jdbc.version}/$DynamicImport-Package=org.mariadb.*&amp;overwrite=merge</bundle>
- <bundle>mvn:org.onap.ccsdk.sli.core/dblib-provider/${project.version}</bundle>
- <bundle>mvn:org.mariadb.jdbc/mariadb-java-client/${mariadb.connector.version}</bundle>
- </feature>
-
-</features>
diff --git a/dblib/installer/pom.xml b/dblib/installer/pom.xml
index bff15801..8d6147b7 100755
--- a/dblib/installer/pom.xml
+++ b/dblib/installer/pom.xml
@@ -1,143 +1,149 @@
<?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>
- <artifactId>dblib</artifactId>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <version>0.2.0-SNAPSHOT</version>
- </parent>
- <artifactId>dblib-installer</artifactId>
- <name>DBLIB Adaptor - Karaf Installer</name>
- <packaging>pom</packaging>
+<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>
- <properties>
- <application.name>sdnc-dblib</application.name>
- <features.boot>sdnc-dblib</features.boot>
- <features.repositories>mvn:org.onap.ccsdk.sli.core/dblib-features/${project.version}/xml/features</features.repositories>
- <include.transitive.dependencies>false</include.transitive.dependencies>
- </properties>
+ <parent>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath />
+ </parent>
- <dependencies>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>dblib-installer</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>dblib-features</artifactId>
- <version>${project.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- <exclusions>
- <exclusion>
- <groupId>*</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
+ <name>ccsdk-sli-core :: dblib :: ${project.artifactId}</name>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>dblib-provider</artifactId>
- <version>${project.version}</version>
- </dependency>
+ <properties>
+ <application.name>ccsdk-dblib</application.name>
+ <features.boot>${application.name}</features.boot>
+ <features.repositories>mvn:org.onap.ccsdk.sli.core/${features.boot}/${project.version}/xml/features</features.repositories>
+ <include.transitive.dependencies>false</include.transitive.dependencies>
+ </properties>
+ <dependencies>
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>tomcat-jdbc</artifactId>
- <version>${tomcat-jdbc.version}</version>
- </dependency>
- </dependencies>
+ <dependency>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>${application.name}</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>maven-repo-zip</id>
- <goals>
- <goal>single</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <attach>false</attach>
- <finalName>stage/${application.name}-${project.version}</finalName>
- <descriptors>
- <descriptor>src/assembly/assemble_mvnrepo_zip.xml</descriptor>
- </descriptors>
- <appendAssemblyId>false</appendAssemblyId>
- </configuration>
- </execution>
- <execution>
- <id>installer-zip</id>
- <goals>
- <goal>single</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <attach>true</attach>
- <finalName>${application.name}-${project.version}-installer</finalName>
- <descriptors>
- <descriptor>src/assembly/assemble_installer_zip.xml</descriptor>
- </descriptors>
- <appendAssemblyId>false</appendAssemblyId>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-dependencies</id>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <phase>prepare-package</phase>
- <configuration>
- <transitive>false</transitive>
- <outputDirectory>${project.build.directory}/assembly/system</outputDirectory>
- <overWriteReleases>false</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
- <overWriteIfNewer>true</overWriteIfNewer>
- <useRepositoryLayout>true</useRepositoryLayout>
- <addParentPoms>false</addParentPoms>
- <copyPom>false</copyPom>
- <includeGroupIds>org.onap.ccsdk.sli,org.apache.tomcat</includeGroupIds>
- <excludeArtifactIds>sli-common,sli-provider</excludeArtifactIds>
- <scope>provided</scope>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.6</version>
- <executions>
- <execution>
- <id>copy-version</id>
- <goals>
- <goal>copy-resources</goal>
- </goals><!-- here the phase you need -->
- <phase>validate</phase>
- <configuration>
- <outputDirectory>${basedir}/target/stage</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources/scripts</directory>
- <includes>
- <include>install-feature.sh</include>
- </includes>
- <filtering>true</filtering>
- </resource>
- </resources>
- </configuration>
- </execution>
+ <dependency>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>dblib-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-jdbc</artifactId>
+ <version>${tomcat-jdbc.version}</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>maven-repo-zip</id>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <attach>false</attach>
+ <finalName>stage/${application.name}-${project.version}</finalName>
+ <descriptors>
+ <descriptor>src/assembly/assemble_mvnrepo_zip.xml</descriptor>
+ </descriptors>
+ <appendAssemblyId>false</appendAssemblyId>
+ </configuration>
+ </execution>
+ <execution>
+ <id>installer-zip</id>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <attach>true</attach>
+ <finalName>${application.name}-${project.version}-installer</finalName>
+ <descriptors>
+ <descriptor>src/assembly/assemble_installer_zip.xml</descriptor>
+ </descriptors>
+ <appendAssemblyId>false</appendAssemblyId>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <phase>prepare-package</phase>
+ <configuration>
+ <transitive>false</transitive>
+ <outputDirectory>${project.build.directory}/assembly/system</outputDirectory>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ <overWriteIfNewer>true</overWriteIfNewer>
+ <useRepositoryLayout>true</useRepositoryLayout>
+ <addParentPoms>false</addParentPoms>
+ <copyPom>false</copyPom>
+ <includeGroupIds>org.onap.ccsdk.sli,org.apache.tomcat</includeGroupIds>
+ <excludeArtifactIds>sli-common,sli-provider</excludeArtifactIds>
+ <scope>provided</scope>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.6</version>
+ <executions>
+ <execution>
+ <id>copy-version</id>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals><!-- here the phase you need -->
+ <phase>validate</phase>
+ <configuration>
+ <outputDirectory>${basedir}/target/stage</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources/scripts</directory>
+ <includes>
+ <include>install-feature.sh</include>
+ </includes>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
</project>
diff --git a/dblib/pom.xml b/dblib/pom.xml
index e7743d81..58f40ff6 100755
--- a/dblib/pom.xml
+++ b/dblib/pom.xml
@@ -1,77 +1,26 @@
<?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/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>ccsdk-sli-core</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+<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.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>dblib</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
- <modelVersion>4.0.0</modelVersion>
- <packaging>pom</packaging>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>dblib</artifactId>
-
-
- <name>DBLIB Adaptor</name>
- <description>The DBLIB adaptor allows service logic to access persistent data in a local sql database</description>
-
- <version>0.2.0-SNAPSHOT</version>
-
- <build>
-
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>${maven.compile.plugin.version}</version>
- <configuration>
- <source>${java.version.source}</source>
- <target>${java.version.target}</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.10</version>
-
- <executions>
- <execution>
- <id>aggregate</id>
- <goals>
- <goal>aggregate</goal>
- </goals>
- <phase>site</phase>
-
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.1.1</version>
- <executions>
- <execution>
- <id>bundle-sources</id>
- <phase>package</phase>
- <goals>
- <!-- produce source artifact for main project sources -->
- <goal>jar-no-fork</goal>
-
- <!-- produce source artifact for project test sources -->
- <goal>test-jar-no-fork</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
- </pluginManagement>
- </build>
- <organization>
- <name>AT&amp;T</name>
+ <name>ccsdk-sli-core :: dblib</name>
+ <description>The DBLIB adaptor allows service logic to access persistent data in a local sql database</description>
+ <organization>
+ <name>ONAP</name>
</organization>
- <modules>
+
+ <modules>
<module>provider</module>
<module>features</module>
<module>installer</module>
diff --git a/dblib/provider/pom.xml b/dblib/provider/pom.xml
index 3bdd7e67..e6fd1bcb 100755
--- a/dblib/provider/pom.xml
+++ b/dblib/provider/pom.xml
@@ -1,19 +1,27 @@
<?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">
+<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.ccsdk.sli.core</groupId>
- <artifactId>dblib</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath />
</parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>dblib-provider</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.2.1-SNAPSHOT</version>
<packaging>bundle</packaging>
- <name>DBLIB Adaptor - Provider</name>
+
+ <name>ccsdk-sli-core :: dblib :: ${project.artifactId}</name>
<url>http://maven.apache.org</url>
+
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
+
<dependencies>
<dependency>
<groupId>junit</groupId>
@@ -21,12 +29,12 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>ch.vorburger.mariaDB4j</groupId>
- <artifactId>mariaDB4j</artifactId>
- <version>2.2.3</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>ch.vorburger.mariaDB4j</groupId>
+ <artifactId>mariaDB4j</artifactId>
+ <version>2.2.3</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>equinoxSDK381</groupId>
<artifactId>org.eclipse.osgi</artifactId>
@@ -48,53 +56,31 @@
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.mariadb.jdbc</groupId>
- <artifactId>mariadb-java-client</artifactId>
- <version>${mariadb.connector.version}</version>
- </dependency>
<dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>tomcat-jdbc</artifactId>
- <version>${tomcat-jdbc.version}</version>
+ <groupId>org.mariadb.jdbc</groupId>
+ <artifactId>mariadb-java-client</artifactId>
+ <version>${mariadb.connector.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-jdbc</artifactId>
+ <version>${tomcat-jdbc.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
</dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>utils-provider</artifactId>
<version>${project.version}</version>
</dependency>
- <!-- Testing related dependencies -->
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
+ <!-- Testing related dependencies -->
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
-
- <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.ccsdk.sli.core.dblib</Bundle-SymbolicName>
- <Export-Package>org.onap.ccsdk.sli.core.dblib;version=${project.version}</Export-Package>
- <Import-Package>*,org.mariadb.jdbc</Import-Package>
- <Embed-Transitive>true</Embed-Transitive>
- </instructions>
- </configuration>
-
- </plugin>
-
-
- </plugins>
- </build>
</project>
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java
index d2331786..8dac3361 100755
--- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java
+++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java
@@ -56,500 +56,516 @@ import org.slf4j.LoggerFactory;
public abstract class CachedDataSource implements DataSource, SQLExecutionMonitorObserver {
- private static final Logger LOGGER = LoggerFactory.getLogger(CachedDataSource.class);
-
- private static final String SQL_FAILURE = "SQL FAILURE. time(ms): ";
- private static final String FAILED_TO_EXECUTE = "> Failed to execute: ";
- private static final String WITH_ARGUMENTS = " with arguments: ";
- private static final String WITH_NO_ARGUMENTS = " with no arguments. ";
- private static final String SQL_DATA_SOURCE = "SQL DataSource <";
-
-
- protected long connReqTimeout = 30L;
- protected long dataReqTimeout = 100L;
-
- private final SQLExecutionMonitor monitor;
- protected DataSource ds = null;
- protected String connectionName = null;
- protected boolean initialized = false;
-
- private long interval = 1000;
- private long initialDelay = 5000;
- private long expectedCompletionTime = 50L;
- private boolean canTakeOffLine = true;
- private long unprocessedFailoverThreshold = 3L;
-
- private long nextErrorReportTime = 0L;
-
- private String globalHostName = null;
-
-
- public CachedDataSource(BaseDBConfiguration jdbcElem) throws DBConfigException {
- configure(jdbcElem);
- monitor = new SQLExecutionMonitor(this);
- }
-
- protected abstract void configure(BaseDBConfiguration jdbcElem) throws DBConfigException;
-
- /* (non-Javadoc)
- * @see javax.sql.DataSource#getConnection()
- */
- @Override
- public Connection getConnection() throws SQLException {
- return ds.getConnection();
- }
-
- public CachedRowSet getData(String statement, List<Object> arguments)
- throws SQLException {
- TestObject testObject = monitor.registerRequest();
-
- try (Connection connection = this.getConnection()) {
- if (connection == null) {
- throw new SQLException("Connection invalid");
- }
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug("Obtained connection <{}>: {}", connectionName, connection);
- }
- return executePreparedStatement(connection, statement, arguments, true);
- } finally {
- monitor.deregisterRequest(testObject);
- }
- }
-
- public boolean writeData(String statement, List<Object> arguments)
- throws SQLException {
- TestObject testObject = monitor.registerRequest();
-
- try (Connection connection = this.getConnection()) {
- if (connection == null) {
- throw new SQLException("Connection invalid");
- }
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug("Obtained connection <{}>: {}", connectionName, connection);
- }
- return executeUpdatePreparedStatement(connection, statement, arguments, true);
- } finally {
- monitor.deregisterRequest(testObject);
- }
- }
-
- CachedRowSet executePreparedStatement(Connection conn, String statement,
- List<Object> arguments, boolean close) throws SQLException {
- long time = System.currentTimeMillis();
-
- CachedRowSet data = null;
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug("SQL Statement: {}", statement);
- if (arguments != null && !arguments.isEmpty()) {
- LOGGER.debug("Argunments: {}", arguments);
- }
- }
-
- ResultSet rs = null;
- try (PreparedStatement ps = conn.prepareStatement(statement)) {
- data = RowSetProvider.newFactory().createCachedRowSet();
- if (arguments != null) {
- for (int i = 0, max = arguments.size(); i < max; i++) {
- ps.setObject(i + 1, arguments.get(i));
- }
- }
- rs = ps.executeQuery();
- data.populate(rs);
- // Point the rowset Cursor to the start
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug("SQL SUCCESS. rows returned: {}, time(ms): {}", data.size(), (System.currentTimeMillis()
- - time));
- }
- } catch (SQLException exc) {
- handleSqlExceptionForExecuteStatement(conn, statement, arguments, exc, time);
- } finally {
- handleFinallyBlockForExecutePreparedStatement(rs, conn, close);
- }
-
- return data;
- }
-
- private void handleSqlExceptionForExecuteStatement(Connection conn, String statement,
- List<Object> arguments, SQLException exc, long time) throws SQLException {
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug(SQL_FAILURE + (System.currentTimeMillis() - time));
- }
- try {
- conn.rollback();
- } catch (Exception thr) {
- LOGGER.error(thr.getLocalizedMessage(), thr);
- }
- if (arguments != null && !arguments.isEmpty()) {
- LOGGER.error(String.format("<%s%s%s%s%s", connectionName, FAILED_TO_EXECUTE, statement, WITH_ARGUMENTS,
- arguments), exc);
- } else {
- LOGGER.error(String.format("<%s%s%s%s", connectionName, FAILED_TO_EXECUTE, statement, WITH_NO_ARGUMENTS),
- exc);
- }
- throw exc;
- }
-
- private void handleFinallyBlockForExecutePreparedStatement(ResultSet rs, Connection conn, boolean close) {
- try {
- if (rs != null) {
- rs.close();
- }
- } catch (Exception exc) {
- LOGGER.error(exc.getLocalizedMessage(), exc);
- }
- try {
- if (conn != null && close) {
- conn.close();
- }
- } catch (Exception exc) {
- LOGGER.error(exc.getLocalizedMessage(), exc);
- }
- }
-
- boolean executeUpdatePreparedStatement(Connection conn, String statement, List<Object> arguments,
- boolean close) throws SQLException {
- long time = System.currentTimeMillis();
-
- CachedRowSet data;
-
- try (PreparedStatement ps = conn.prepareStatement(statement)) {
- data = RowSetProvider.newFactory().createCachedRowSet();
- if (arguments != null) {
- prepareStatementForExecuteUpdate(arguments, ps);
- }
- ps.executeUpdate();
- // Point the rowset Cursor to the start
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug("SQL SUCCESS. rows returned: {}, time(ms): {}", data.size(), (System.currentTimeMillis()
- - time));
- }
- ps.close();
- } catch (SQLException exc) {
- handleSqlExceptionForExecuteStatement(conn, statement, arguments, exc, time);
- } finally {
- try {
- if (close) {
- conn.close();
- }
- } catch (Exception exc) {
- LOGGER.error(exc.getLocalizedMessage(), exc);
- }
- }
-
- return true;
- }
-
- private void prepareStatementForExecuteUpdate(List<Object> arguments, PreparedStatement ps)
- throws SQLException {
- for (int i = 0, max = arguments.size(); i < max; i++) {
- Object value = arguments.get(i);
- if (value instanceof Blob) {
- ps.setBlob(i + 1, (Blob) value);
- } else if (value instanceof Timestamp) {
- ps.setTimestamp(i + 1, (Timestamp) value);
- } else if (value instanceof Integer) {
- ps.setInt(i + 1, (Integer) value);
- } else if (value instanceof Long) {
- ps.setLong(i + 1, (Long) value);
- } else if (value instanceof Date) {
- ps.setDate(i + 1, (Date) value);
- } else {
- ps.setObject(i + 1, value);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see javax.sql.DataSource#getConnection(java.lang.String, java.lang.String)
- */
- @Override
- public Connection getConnection(String username, String password)
- throws SQLException {
- return ds.getConnection(username, password);
- }
-
- /* (non-Javadoc)
- * @see javax.sql.DataSource#getLogWriter()
- */
- @Override
- public PrintWriter getLogWriter() throws SQLException {
- return ds.getLogWriter();
- }
-
- /* (non-Javadoc)
- * @see javax.sql.DataSource#getLoginTimeout()
- */
- @Override
- public int getLoginTimeout() throws SQLException {
- return ds.getLoginTimeout();
- }
-
- /* (non-Javadoc)
- * @see javax.sql.DataSource#setLogWriter(java.io.PrintWriter)
- */
- @Override
- public void setLogWriter(PrintWriter out) throws SQLException {
- ds.setLogWriter(out);
- }
-
- /* (non-Javadoc)
- * @see javax.sql.DataSource#setLoginTimeout(int)
- */
- @Override
- public void setLoginTimeout(int seconds) throws SQLException {
- ds.setLoginTimeout(seconds);
- }
-
-
- @Override
- public final String getDbConnectionName() {
- return connectionName;
- }
-
- protected final void setDbConnectionName(String name) {
- this.connectionName = name;
- }
-
- public void cleanUp() {
- if (ds != null && ds instanceof Closeable) {
- try {
- ((Closeable) ds).close();
- } catch (IOException e) {
- LOGGER.warn(e.getMessage());
- }
- }
- ds = null;
- monitor.deleteObservers();
- monitor.cleanup();
- }
-
- public boolean isInitialized() {
- return initialized;
- }
-
- protected boolean testConnection() {
- return testConnection(false);
- }
-
- protected boolean testConnection(boolean errorLevel) {
- ResultSet rs = null;
- try (Connection conn = this.getConnection(); Statement stmt = conn.createStatement()) {
- Boolean readOnly;
- String hostname;
- rs = stmt.executeQuery(
- "SELECT @@global.read_only, @@global.hostname"); //("SELECT 1 FROM DUAL"); //"select BANNER from SYS.V_$VERSION"
- while (rs.next()) {
- readOnly = rs.getBoolean(1);
- hostname = rs.getString(2);
-
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug(
- SQL_DATA_SOURCE + getDbConnectionName() + "> connected to " + hostname + ", read-only is "
- + readOnly + ", tested successfully ");
- }
- }
- } catch (Exception exc) {
- if (errorLevel) {
- LOGGER.error(
- SQL_DATA_SOURCE + this.getDbConnectionName() + "> test failed. Cause : " + exc.getMessage());
- } else {
- LOGGER.info(
- SQL_DATA_SOURCE + this.getDbConnectionName() + "> test failed. Cause : " + exc.getMessage());
- }
- return false;
- } finally {
- if (rs != null) {
- try {
- rs.close();
- } catch (SQLException e) {
- LOGGER.error(e.getLocalizedMessage(), e);
- }
- }
- }
- return true;
- }
-
- @Override
- public boolean isWrapperFor(Class<?> iface) throws SQLException {
- return false;
- }
-
- @Override
- public <T> T unwrap(Class<T> iface) throws SQLException {
- return null;
- }
-
- @SuppressWarnings("deprecation")
- public void setConnectionCachingEnabled(boolean state) {
-// if(ds != null && ds instanceof OracleDataSource)
-// try {
-// ((OracleDataSource)ds).setConnectionCachingEnabled(true);
-// } catch (SQLException exc) {
-// LOGGER.warn("", exc);
-// }
- }
-
- public void addObserver(Observer observer) {
- monitor.addObserver(observer);
- }
-
- public void deleteObserver(Observer observer) {
- monitor.deleteObserver(observer);
- }
-
- @Override
- public long getInterval() {
- return interval;
- }
-
- @Override
- public long getInitialDelay() {
- return initialDelay;
- }
-
- @Override
- public void setInterval(long value) {
- interval = value;
- }
-
- @Override
- public void setInitialDelay(long value) {
- initialDelay = value;
- }
-
- @Override
- public long getExpectedCompletionTime() {
- return expectedCompletionTime;
- }
-
- @Override
- public void setExpectedCompletionTime(long value) {
- expectedCompletionTime = value;
- }
-
- @Override
- public long getUnprocessedFailoverThreshold() {
- return unprocessedFailoverThreshold;
- }
-
- @Override
- public void setUnprocessedFailoverThreshold(long value) {
- this.unprocessedFailoverThreshold = value;
- }
-
- public boolean canTakeOffLine() {
- return canTakeOffLine;
- }
-
- public void blockImmediateOffLine() {
- canTakeOffLine = false;
- final Thread offLineTimer = new Thread(() -> {
- try {
- Thread.sleep(30000L);
- } catch (Exception exc) {
- LOGGER.error(exc.getLocalizedMessage(), exc);
- } finally {
- canTakeOffLine = true;
- }
- });
- offLineTimer.setDaemon(true);
- offLineTimer.start();
- }
-
- /**
- * @return the monitor
- */
- final SQLExecutionMonitor getMonitor() {
- return monitor;
- }
-
- protected boolean isSlave() throws PoolExhaustedException {
- CachedRowSet rs;
- boolean isSlave;
- String hostname = "UNDETERMINED";
- try {
- boolean localSlave = true;
- rs = this.getData("SELECT @@global.read_only, @@global.hostname", new ArrayList<>());
- while (rs.next()) {
- localSlave = rs.getBoolean(1);
- hostname = rs.getString(2);
- }
- isSlave = localSlave;
- } catch (PoolExhaustedException peexc) {
- throw peexc;
- } catch (Exception e) {
- LOGGER.error("", e);
- isSlave = true;
- }
- if (isSlave) {
- LOGGER.debug("SQL SLAVE : {} on server {}", connectionName, hostname);
- } else {
- LOGGER.debug("SQL MASTER : {} on server {}", connectionName, hostname);
- }
- return isSlave;
- }
-
- public boolean isFabric() {
- return false;
- }
-
- protected boolean lockTable(Connection conn, String tableName) {
- boolean retValue = false;
- String query = "LOCK TABLES " + tableName + " WRITE";
- try (Statement preStmt = conn.createStatement(); Statement lock = conn.prepareStatement(query);
- ResultSet rs = preStmt.executeQuery("GETDATE()")) {
- if (tableName != null) {
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug("Executing 'LOCK TABLES " + tableName + " WRITE' on connection " + conn.toString());
- if ("SVC_LOGIC".equals(tableName)) {
- Exception e = new Exception();
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
- e.printStackTrace(pw);
- LOGGER.debug(sw.toString());
- }
- }
- lock.execute(query);
- retValue = true;
- }
- } catch (Exception exc) {
- LOGGER.error("", exc);
- retValue = false;
- }
- return retValue;
- }
-
- protected boolean unlockTable(Connection conn) {
- boolean retValue;
- try (Statement lock = conn.createStatement()) {
- if (LOGGER.isDebugEnabled()) {
- LOGGER.debug("Executing 'UNLOCK TABLES' on connection {}", conn);
- }
- retValue = lock.execute("UNLOCK TABLES");
- } catch (Exception exc) {
- LOGGER.error("", exc);
- retValue = false;
- }
- return retValue;
- }
-
- public void getPoolInfo(boolean allocation) {
-
- }
-
- public long getNextErrorReportTime() {
- return nextErrorReportTime;
- }
-
- public void setNextErrorReportTime(long nextTime) {
- this.nextErrorReportTime = nextTime;
- }
-
- public void setGlobalHostName(String hostname) {
- this.globalHostName = hostname;
- }
-
- public String getGlobalHostName() {
- return globalHostName;
- }
+ private static final Logger LOGGER = LoggerFactory.getLogger(CachedDataSource.class);
+
+ private static final String SQL_FAILURE = "SQL FAILURE. time(ms): ";
+ private static final String FAILED_TO_EXECUTE = "> Failed to execute: ";
+ private static final String WITH_ARGUMENTS = " with arguments: ";
+ private static final String WITH_NO_ARGUMENTS = " with no arguments. ";
+ private static final String SQL_DATA_SOURCE = "SQL DataSource <";
+
+ protected long connReqTimeout = 30L;
+ protected long dataReqTimeout = 100L;
+
+ private final SQLExecutionMonitor monitor;
+ protected DataSource ds = null;
+ protected String connectionName = null;
+ protected boolean initialized = false;
+
+ private long interval = 1000;
+ private long initialDelay = 5000;
+ private long expectedCompletionTime = 50L;
+ private boolean canTakeOffLine = true;
+ private long unprocessedFailoverThreshold = 3L;
+
+ private long nextErrorReportTime = 0L;
+
+ private String globalHostName = null;
+
+ private boolean isDerby = false;
+
+ public CachedDataSource(BaseDBConfiguration jdbcElem) throws DBConfigException {
+ configure(jdbcElem);
+
+ if ("org.apache.derby.jdbc.EmbeddedDriver".equals(jdbcElem.getDriverName())) {
+ isDerby = true;
+ }
+ monitor = new SQLExecutionMonitor(this);
+ }
+
+ protected abstract void configure(BaseDBConfiguration jdbcElem) throws DBConfigException;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.sql.DataSource#getConnection()
+ */
+ @Override
+ public Connection getConnection() throws SQLException {
+ return ds.getConnection();
+ }
+
+ public CachedRowSet getData(String statement, List<Object> arguments) throws SQLException {
+ TestObject testObject = monitor.registerRequest();
+
+ try (Connection connection = this.getConnection()) {
+ if (connection == null) {
+ throw new SQLException("Connection invalid");
+ }
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug("Obtained connection <{}>: {}", connectionName, connection);
+ }
+ return executePreparedStatement(connection, statement, arguments, true);
+ } finally {
+ monitor.deregisterRequest(testObject);
+ }
+ }
+
+ public boolean writeData(String statement, List<Object> arguments) throws SQLException {
+ TestObject testObject = monitor.registerRequest();
+
+ try (Connection connection = this.getConnection()) {
+ if (connection == null) {
+ throw new SQLException("Connection invalid");
+ }
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug("Obtained connection <{}>: {}", connectionName, connection);
+ }
+ return executeUpdatePreparedStatement(connection, statement, arguments, true);
+ } finally {
+ monitor.deregisterRequest(testObject);
+ }
+ }
+
+ CachedRowSet executePreparedStatement(Connection conn, String statement, List<Object> arguments, boolean close)
+ throws SQLException {
+ long time = System.currentTimeMillis();
+
+ CachedRowSet data = null;
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug("SQL Statement: {}", statement);
+ if (arguments != null && !arguments.isEmpty()) {
+ LOGGER.debug("Argunments: {}", arguments);
+ }
+ }
+
+ ResultSet rs = null;
+ try (PreparedStatement ps = conn.prepareStatement(statement)) {
+ data = RowSetProvider.newFactory().createCachedRowSet();
+ if (arguments != null) {
+ for (int i = 0, max = arguments.size(); i < max; i++) {
+ ps.setObject(i + 1, arguments.get(i));
+ }
+ }
+ rs = ps.executeQuery();
+ data.populate(rs);
+ // Point the rowset Cursor to the start
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug("SQL SUCCESS. rows returned: {}, time(ms): {}", data.size(),
+ (System.currentTimeMillis() - time));
+ }
+ } catch (SQLException exc) {
+ handleSqlExceptionForExecuteStatement(conn, statement, arguments, exc, time);
+ } finally {
+ handleFinallyBlockForExecutePreparedStatement(rs, conn, close);
+ }
+
+ return data;
+ }
+
+ private void handleSqlExceptionForExecuteStatement(Connection conn, String statement, List<Object> arguments,
+ SQLException exc, long time) throws SQLException {
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug(SQL_FAILURE + (System.currentTimeMillis() - time));
+ }
+ try {
+ conn.rollback();
+ } catch (Exception thr) {
+ LOGGER.error(thr.getLocalizedMessage(), thr);
+ }
+ if (arguments != null && !arguments.isEmpty()) {
+ LOGGER.error(String.format("<%s%s%s%s%s", connectionName, FAILED_TO_EXECUTE, statement, WITH_ARGUMENTS,
+ arguments), exc);
+ } else {
+ LOGGER.error(String.format("<%s%s%s%s", connectionName, FAILED_TO_EXECUTE, statement, WITH_NO_ARGUMENTS),
+ exc);
+ }
+ throw exc;
+ }
+
+ private void handleFinallyBlockForExecutePreparedStatement(ResultSet rs, Connection conn, boolean close) {
+ try {
+ if (rs != null) {
+ rs.close();
+ }
+ } catch (Exception exc) {
+ LOGGER.error(exc.getLocalizedMessage(), exc);
+ }
+ try {
+ if (conn != null && close) {
+ conn.close();
+ }
+ } catch (Exception exc) {
+ LOGGER.error(exc.getLocalizedMessage(), exc);
+ }
+ }
+
+ boolean executeUpdatePreparedStatement(Connection conn, String statement, List<Object> arguments, boolean close)
+ throws SQLException {
+ long time = System.currentTimeMillis();
+
+ CachedRowSet data;
+
+ try (PreparedStatement ps = conn.prepareStatement(statement)) {
+ data = RowSetProvider.newFactory().createCachedRowSet();
+ if (arguments != null) {
+ prepareStatementForExecuteUpdate(arguments, ps);
+ }
+ ps.executeUpdate();
+ // Point the rowset Cursor to the start
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug("SQL SUCCESS. rows returned: {}, time(ms): {}", data.size(),
+ (System.currentTimeMillis() - time));
+ }
+ ps.close();
+ } catch (SQLException exc) {
+ handleSqlExceptionForExecuteStatement(conn, statement, arguments, exc, time);
+ } finally {
+ try {
+ if (close) {
+ conn.close();
+ }
+ } catch (Exception exc) {
+ LOGGER.error(exc.getLocalizedMessage(), exc);
+ }
+ }
+
+ return true;
+ }
+
+ private void prepareStatementForExecuteUpdate(List<Object> arguments, PreparedStatement ps) throws SQLException {
+ for (int i = 0, max = arguments.size(); i < max; i++) {
+ Object value = arguments.get(i);
+ if (value instanceof Blob) {
+ ps.setBlob(i + 1, (Blob) value);
+ } else if (value instanceof Timestamp) {
+ ps.setTimestamp(i + 1, (Timestamp) value);
+ } else if (value instanceof Integer) {
+ ps.setInt(i + 1, (Integer) value);
+ } else if (value instanceof Long) {
+ ps.setLong(i + 1, (Long) value);
+ } else if (value instanceof Date) {
+ ps.setDate(i + 1, (Date) value);
+ } else {
+ ps.setObject(i + 1, value);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.sql.DataSource#getConnection(java.lang.String, java.lang.String)
+ */
+ @Override
+ public Connection getConnection(String username, String password) throws SQLException {
+ return ds.getConnection(username, password);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.sql.DataSource#getLogWriter()
+ */
+ @Override
+ public PrintWriter getLogWriter() throws SQLException {
+ return ds.getLogWriter();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.sql.DataSource#getLoginTimeout()
+ */
+ @Override
+ public int getLoginTimeout() throws SQLException {
+ return ds.getLoginTimeout();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.sql.DataSource#setLogWriter(java.io.PrintWriter)
+ */
+ @Override
+ public void setLogWriter(PrintWriter out) throws SQLException {
+ ds.setLogWriter(out);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.sql.DataSource#setLoginTimeout(int)
+ */
+ @Override
+ public void setLoginTimeout(int seconds) throws SQLException {
+ ds.setLoginTimeout(seconds);
+ }
+
+ @Override
+ public final String getDbConnectionName() {
+ return connectionName;
+ }
+
+ protected final void setDbConnectionName(String name) {
+ this.connectionName = name;
+ }
+
+ public void cleanUp() {
+ if (ds != null && ds instanceof Closeable) {
+ try {
+ ((Closeable) ds).close();
+ } catch (IOException e) {
+ LOGGER.warn(e.getMessage());
+ }
+ }
+ ds = null;
+ monitor.deleteObservers();
+ monitor.cleanup();
+ }
+
+ public boolean isInitialized() {
+ return initialized;
+ }
+
+ protected boolean testConnection() {
+ return testConnection(false);
+ }
+
+ protected boolean testConnection(boolean errorLevel) {
+ ResultSet rs = null;
+ try (Connection conn = this.getConnection(); Statement stmt = conn.createStatement()) {
+ Boolean readOnly;
+ String hostname;
+ rs = stmt.executeQuery("SELECT @@global.read_only, @@global.hostname"); // ("SELECT 1 FROM DUAL"); //"select
+ // BANNER from SYS.V_$VERSION"
+ while (rs.next()) {
+ readOnly = rs.getBoolean(1);
+ hostname = rs.getString(2);
+
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug(SQL_DATA_SOURCE + getDbConnectionName() + "> connected to " + hostname
+ + ", read-only is " + readOnly + ", tested successfully ");
+ }
+ }
+ } catch (Exception exc) {
+ if (errorLevel) {
+ LOGGER.error(
+ SQL_DATA_SOURCE + this.getDbConnectionName() + "> test failed. Cause : " + exc.getMessage());
+ } else {
+ LOGGER.info(
+ SQL_DATA_SOURCE + this.getDbConnectionName() + "> test failed. Cause : " + exc.getMessage());
+ }
+ return false;
+ } finally {
+ if (rs != null) {
+ try {
+ rs.close();
+ } catch (SQLException e) {
+ LOGGER.error(e.getLocalizedMessage(), e);
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public boolean isWrapperFor(Class<?> iface) throws SQLException {
+ return false;
+ }
+
+ @Override
+ public <T> T unwrap(Class<T> iface) throws SQLException {
+ return null;
+ }
+
+ @SuppressWarnings("deprecation")
+ public void setConnectionCachingEnabled(boolean state) {
+ // if(ds != null && ds instanceof OracleDataSource)
+ // try {
+ // ((OracleDataSource)ds).setConnectionCachingEnabled(true);
+ // } catch (SQLException exc) {
+ // LOGGER.warn("", exc);
+ // }
+ }
+
+ public void addObserver(Observer observer) {
+ monitor.addObserver(observer);
+ }
+
+ public void deleteObserver(Observer observer) {
+ monitor.deleteObserver(observer);
+ }
+
+ @Override
+ public long getInterval() {
+ return interval;
+ }
+
+ @Override
+ public long getInitialDelay() {
+ return initialDelay;
+ }
+
+ @Override
+ public void setInterval(long value) {
+ interval = value;
+ }
+
+ @Override
+ public void setInitialDelay(long value) {
+ initialDelay = value;
+ }
+
+ @Override
+ public long getExpectedCompletionTime() {
+ return expectedCompletionTime;
+ }
+
+ @Override
+ public void setExpectedCompletionTime(long value) {
+ expectedCompletionTime = value;
+ }
+
+ @Override
+ public long getUnprocessedFailoverThreshold() {
+ return unprocessedFailoverThreshold;
+ }
+
+ @Override
+ public void setUnprocessedFailoverThreshold(long value) {
+ this.unprocessedFailoverThreshold = value;
+ }
+
+ public boolean canTakeOffLine() {
+ return canTakeOffLine;
+ }
+
+ public void blockImmediateOffLine() {
+ canTakeOffLine = false;
+ final Thread offLineTimer = new Thread(() -> {
+ try {
+ Thread.sleep(30000L);
+ } catch (Exception exc) {
+ LOGGER.error(exc.getLocalizedMessage(), exc);
+ } finally {
+ canTakeOffLine = true;
+ }
+ });
+ offLineTimer.setDaemon(true);
+ offLineTimer.start();
+ }
+
+ /**
+ * @return the monitor
+ */
+ final SQLExecutionMonitor getMonitor() {
+ return monitor;
+ }
+
+ protected boolean isSlave() throws PoolExhaustedException {
+
+ // If using Apache derby, just return false
+ if (isDerby) {
+ return false;
+ }
+ CachedRowSet rs;
+ boolean isSlave;
+ String hostname = "UNDETERMINED";
+ try {
+ boolean localSlave = true;
+ rs = this.getData("SELECT @@global.read_only, @@global.hostname", new ArrayList<>());
+ while (rs.next()) {
+ localSlave = rs.getBoolean(1);
+ hostname = rs.getString(2);
+ }
+ isSlave = localSlave;
+ } catch (PoolExhaustedException peexc) {
+ throw peexc;
+ } catch (Exception e) {
+ LOGGER.error("", e);
+ isSlave = true;
+ }
+ if (isSlave) {
+ LOGGER.debug("SQL SLAVE : {} on server {}", connectionName, hostname);
+ } else {
+ LOGGER.debug("SQL MASTER : {} on server {}", connectionName, hostname);
+ }
+ return isSlave;
+ }
+
+ public boolean isFabric() {
+ return false;
+ }
+
+ protected boolean lockTable(Connection conn, String tableName) {
+ boolean retValue = false;
+ String query = "LOCK TABLES " + tableName + " WRITE";
+ try (Statement preStmt = conn.createStatement();
+ Statement lock = conn.prepareStatement(query);
+ ResultSet rs = preStmt.executeQuery("GETDATE()")) {
+ if (tableName != null) {
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug("Executing 'LOCK TABLES " + tableName + " WRITE' on connection " + conn.toString());
+ if ("SVC_LOGIC".equals(tableName)) {
+ Exception e = new Exception();
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ e.printStackTrace(pw);
+ LOGGER.debug(sw.toString());
+ }
+ }
+ lock.execute(query);
+ retValue = true;
+ }
+ } catch (Exception exc) {
+ LOGGER.error("", exc);
+ retValue = false;
+ }
+ return retValue;
+ }
+
+ protected boolean unlockTable(Connection conn) {
+ boolean retValue;
+ try (Statement lock = conn.createStatement()) {
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug("Executing 'UNLOCK TABLES' on connection {}", conn);
+ }
+ retValue = lock.execute("UNLOCK TABLES");
+ } catch (Exception exc) {
+ LOGGER.error("", exc);
+ retValue = false;
+ }
+ return retValue;
+ }
+
+ public void getPoolInfo(boolean allocation) {
+
+ }
+
+ public long getNextErrorReportTime() {
+ return nextErrorReportTime;
+ }
+
+ public void setNextErrorReportTime(long nextTime) {
+ this.nextErrorReportTime = nextTime;
+ }
+
+ public void setGlobalHostName(String hostname) {
+ this.globalHostName = hostname;
+ }
+
+ public String getGlobalHostName() {
+ return globalHostName;
+ }
}
diff --git a/dblib/provider/src/main/resources/dblib.properties b/dblib/provider/src/main/resources/dblib.properties
index 3e62308f..e0399cc3 100755
--- a/dblib/provider/src/main/resources/dblib.properties
+++ b/dblib/provider/src/main/resources/dblib.properties
@@ -1,9 +1,10 @@
org.onap.ccsdk.sli.dbtype=jdbc
org.onap.ccsdk.sli.jdbc.hosts=sdnctldb01,sdnctldb02
-org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://DBHOST:3306/sdnctl
+org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true
+org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
org.onap.ccsdk.sli.jdbc.database=sdnctl
-org.onap.ccsdk.sli.jdbc.user={user for sdnctl}
-org.onap.ccsdk.sli.jdbc.password={password for sdnctl}
+org.onap.ccsdk.sli.jdbc.user=test
+org.onap.ccsdk.sli.jdbc.password=test
org.onap.ccsdk.sli.jdbc.connection.name=sdnctldb01
org.onap.ccsdk.sli.jdbc.connection.timeout=50
diff --git a/filters/features/ccsdk-filters/pom.xml b/filters/features/ccsdk-filters/pom.xml
new file mode 100644
index 00000000..9b5c73ba
--- /dev/null
+++ b/filters/features/ccsdk-filters/pom.xml
@@ -0,0 +1,61 @@
+<?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.ccsdk.parent</groupId>
+ <artifactId>single-feature-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath />
+ </parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>ccsdk-filters</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>feature</packaging>
+
+ <name>ccsdk-sli-core :: filters :: ${project.artifactId}</name>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>mdsal-model-artifacts</artifactId>
+ <version>0.11.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>1.6.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>odl-mdsal-broker</artifactId>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>ccsdk-sli</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>filters-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/filters/features/features-filters/pom.xml b/filters/features/features-filters/pom.xml
new file mode 100644
index 00000000..5072971a
--- /dev/null
+++ b/filters/features/features-filters/pom.xml
@@ -0,0 +1,29 @@
+<?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.ccsdk.parent</groupId>
+ <artifactId>feature-repo-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>features-filters</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>feature</packaging>
+
+ <name>ccsdk-sli-core :: filters :: ${project.artifactId}</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>ccsdk-filters</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/filters/features/pom.xml b/filters/features/pom.xml
index 3662f336..bf986840 100755
--- a/filters/features/pom.xml
+++ b/filters/features/pom.xml
@@ -1,101 +1,22 @@
<?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>
- <artifactId>filters</artifactId>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
- <artifactId>filters-features</artifactId>
- <name>Filters - Features</name>
-
- <packaging>jar</packaging>
-
- <dependencies>
-
-
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>filters-provider</artifactId>
- <version>${project.version}</version>
- </dependency>
-<!--
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>features-mdsal</artifactId>
- <version>${odl.mdsal.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
--->
- </dependencies>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>filters-features-aggregator</artifactId>
+ <packaging>pom</packaging>
- <build>
- <resources>
- <resource>
- <filtering>true</filtering>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <id>filter</id>
- <goals>
- <goal>resources</goal>
- </goals>
- <phase>generate-resources</phase>
- </execution>
- </executions>
- </plugin>
- <!-- launches the feature test, which validates that your karaf feature
- can be installed inside of a karaf container. It doesn't validate that your
- functionality works correctly, just that you have all of the dependent bundles
- defined correctly.
- <plugin>
+ <name>ccsdk-sli-core :: filters :: ${project.artifactId}</name>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version>
- <configuration>
- <systemPropertyVariables>
- <karaf.distro.groupId>org.opendaylight.odlparent</karaf.distro.groupId>
- <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
- <karaf.distro.version>${odl.karaf.empty.distro.version}</karaf.distro.version>
- </systemPropertyVariables>
- <dependenciesToScan>
- <dependency>org.opendaylight.yangtools:features-test</dependency>
- </dependenciesToScan>
- </configuration>
- </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/${features.file}</file>
- <type>xml</type>
- <classifier>features</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <modules>
+ <module>features-filters</module>
+ <module>ccsdk-filters</module>
+ </modules>
</project>
diff --git a/filters/features/src/main/resources/features.xml b/filters/features/src/main/resources/features.xml
deleted file mode 100644
index 7ede2083..00000000
--- a/filters/features/src/main/resources/features.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ============LICENSE_START=======================================================
- ONAP : CCSDK
- ================================================================================
- 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=========================================================
- -->
-
-
-<features name="sdnc-filters-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
-
- <feature name='sdnc-filters' description="servlet filters" version='${project.version}'>
- <bundle>mvn:org.onap.ccsdk.sli.core/filters-provider/${project.version}</bundle>
- </feature>
-
-</features>
diff --git a/filters/installer/pom.xml b/filters/installer/pom.xml
index a22e9ab7..a16b6a60 100755
--- a/filters/installer/pom.xml
+++ b/filters/installer/pom.xml
@@ -1,18 +1,24 @@
<?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.ccsdk.sli.core</groupId>
- <artifactId>filters</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>filters-installer</artifactId>
- <name>Filters - Karaf Installer</name>
+ <version>0.2.1-SNAPSHOT</version>
<packaging>pom</packaging>
+ <name>ccsdk-sli-core :: filters :: ${project.artifactId}</name>
+
<properties>
- <application.name>sdnc-filters</application.name>
- <features.boot>sdnc-filters</features.boot>
+ <application.name>ccsdk-filters</application.name>
+ <features.boot>${application.name}</features.boot>
<features.repositories>mvn:org.onap.ccsdk.sli.core/filters-features/${project.version}/xml/features</features.repositories>
<include.transitive.dependencies>false</include.transitive.dependencies>
</properties>
@@ -21,10 +27,10 @@
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>filters-features</artifactId>
+ <artifactId>${application.name}</artifactId>
<version>${project.version}</version>
- <classifier>features</classifier>
<type>xml</type>
+ <classifier>features</classifier>
<exclusions>
<exclusion>
<groupId>*</groupId>
@@ -134,5 +140,4 @@
</plugins>
</build>
-
</project>
diff --git a/filters/pom.xml b/filters/pom.xml
index 7780dcec..b40d0d31 100644
--- a/filters/pom.xml
+++ b/filters/pom.xml
@@ -1,79 +1,26 @@
<?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/maven-v4_0_0.xsd">
-
- <parent>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>ccsdk-sli-core</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+<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.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
- <modelVersion>4.0.0</modelVersion>
- <packaging>pom</packaging>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>filters</artifactId>
-
-
- <name>Filters</name>
- <description>Servlet filter to implement ECOMP logging spec</description>
-
- <version>0.2.0-SNAPSHOT</version>
-
-
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>filters</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>${maven.compile.plugin.version}</version>
- <configuration>
- <source>${java.version.source}</source>
- <target>${java.version.target}</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.10</version>
-
- <executions>
- <execution>
- <id>aggregate</id>
- <goals>
- <goal>aggregate</goal>
- </goals>
- <phase>site</phase>
-
- </execution>
-
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.1.1</version>
- <executions>
- <execution>
- <id>bundle-sources</id>
- <phase>package</phase>
- <goals>
- <!-- produce source artifact for main project sources -->
- <goal>jar-no-fork</goal>
-
- <!-- produce source artifact for project test sources -->
- <goal>test-jar-no-fork</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
- </pluginManagement>
- </build>
- <organization>
+ <name>ccsdk-sli-core :: filters</name>
+ <description>Servlet filter to implement ONAP logging spec</description>
+ <organization>
<name>ONAP</name>
</organization>
- <modules>
+
+ <modules>
<module>provider</module>
<module>features</module>
<module>installer</module>
diff --git a/filters/provider/pom.xml b/filters/provider/pom.xml
index 51d0c63a..4fdd8328 100755
--- a/filters/provider/pom.xml
+++ b/filters/provider/pom.xml
@@ -1,82 +1,66 @@
<?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.ccsdk.sli.core</groupId>
- <artifactId>filters</artifactId>
- <version>0.2.0-SNAPSHOT</version>
- </parent>
- <artifactId>filters-provider</artifactId>
- <packaging>bundle</packaging>
- <name>Filters - 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>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <version>3.0.1</version>
- <scope>provided</scope>
- </dependency>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
- <dependency>
- <groupId>equinoxSDK381</groupId>
- <artifactId>org.eclipse.osgi</artifactId>
- <version>${equinox.osgi.version}</version>
- </dependency>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>filters-provider</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>bundle</packaging>
- <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>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>${commons.codec.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sli-common</artifactId>
- <version>${project.version}</version>
- </dependency>
+ <name>ccsdk-sli-core :: filters :: ${project.artifactId}</name>
+ <url>http://maven.apache.org</url>
- </dependencies>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
- <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.ccsdk.sli.core.filters</Bundle-SymbolicName>
- <Export-Package>org.onap.ccsdk.sli.core.filters</Export-Package>
- <DynamicImport-Package>org.onap.ccsdk.sli.core.filters</DynamicImport-Package>
- <Import-Package>javax.servlet.*,java.io.*,org.osgi.framework.*,org.slf4j.*,org.apache.commons.codec.binary.*</Import-Package>
- <Embed-Transitive>true</Embed-Transitive>
- </instructions>
- </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ </dependency>
- </plugin>
+ <dependency>
+ <groupId>equinoxSDK381</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ <version>${equinox.osgi.version}</version>
+ <scope>provided</scope>
+ </dependency>
- </plugins>
- </build>
+ <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>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>${commons.codec.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>sli-common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ </dependencies>
</project>
diff --git a/pom.xml b/pom.xml
index c7885a9b..7ab4d463 100755
--- a/pom.xml
+++ b/pom.xml
@@ -1,20 +1,34 @@
<?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/maven-v4_0_0.xsd">
-
+<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>
- <packaging>pom</packaging>
+
+ <parent>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
<groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>ccsdk-sli-core</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
<name>ccsdk-sli-core</name>
- <url>https://wiki.onap.org</url>
<description>CCSDK core components contains the SLI, dblib</description>
+ <url>https://wiki.onap.org</url>
+ <organization>
+ <name>ONAP</name>
+ </organization>
- <parent>
- <groupId>org.onap.ccsdk.parent</groupId>
- <artifactId>odlparent-carbon-sr1</artifactId>
- <version>0.2.0-SNAPSHOT</version>
- </parent>
+ <modules>
+ <module>utils</module>
+ <module>dblib</module>
+ <module>sli</module>
+ <module>filters</module>
+ <module>sliPluginUtils</module>
+ <module>sliapi</module>
+ </modules>
<scm>
<connection>scm:git:ssh://git@${onap.git.host}/sdnc-code.git</connection>
@@ -24,25 +38,6 @@
</scm>
-<!--
- <distributionManagement>
- <repository>
- <id>ecomp-releases</id>
- <name>onap-repository-releases</name>
- <url>${onap.nexus.release-url}</url>
- </repository>
- <snapshotRepository>
- <id>ecomp-snapshots</id>
- <name>onap-repository-snapshots</name>
- <url>${onap.nexus.snapshot-url}</url>
- </snapshotRepository>
- <site>
- <id>ecomp-site</id>
- <url>dav:https://${onap.nexus.host}/content/sites/site/org/onap/sdnc/core/${project.artifactId}/${project.version}</url>
- </site>
- </distributionManagement>
--->
-
<profiles>
<profile>
<id>blackduck</id>
@@ -81,45 +76,4 @@
</profile>
</profiles>
-
- <build>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.17</version>
- <configuration>
- <skipTests>false</skipTests>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.sonatype.plugins</groupId>
- <artifactId>nexus-staging-maven-plugin</artifactId>
- <version>1.6.7</version>
- <extensions>true</extensions>
- <configuration>
- <nexusUrl>https://${onap.nexus.host}</nexusUrl>
- <stagingProfileId>${onap.nexus.staging.profile-id}</stagingProfileId>
- <serverId>${onap.nexus.staging.server-id}</serverId>
- </configuration>
- </plugin>
-
- </plugins>
-
- </build>
- <modules>
- <module>utils</module>
- <module>dblib</module>
- <module>sli</module>
- <module>filters</module>
- <module>sliPluginUtils</module>
- <module>sliapi</module>
- </modules>
- <organization>
- <name>ONAP</name>
- </organization>
- <version>0.2.0-SNAPSHOT</version>
-
-
</project>
diff --git a/sli/common/pom.xml b/sli/common/pom.xml
index 4c7daa39..167a776e 100755
--- a/sli/common/pom.xml
+++ b/sli/common/pom.xml
@@ -1,163 +1,136 @@
-<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>
- <artifactId>sli</artifactId>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <version>0.2.0-SNAPSHOT</version>
- </parent>
- <artifactId>sli-common</artifactId>
- <packaging>bundle</packaging>
+<?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>
- <name>SLI - Common Classes</name>
- <description>The SLI Common package includes common classes used by the various SLI subcomponents, as well as classes used by clients to interface with the service logic interpreter</description>
+ <parent>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>ch.vorburger.mariaDB4j</groupId>
- <artifactId>mariaDB4j</artifactId>
- <version>2.2.3</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.antlr</groupId>
- <artifactId>antlr4</artifactId>
- <version>${antlr.version}</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.7.5</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>${commons.lang3.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>yang-binding</artifactId>
- <version>${odl.mdsal.yang.binding.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-common</artifactId>
- <version>${odl.yangtools.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types</artifactId>
- <version>${odl.ietf-inet-types.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-yang-types</artifactId>
- <version>${odl.ietf-yang-types.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-core-api</artifactId>
- <version>${odl.mdsal.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-data-impl</artifactId>
- <version>${odl.yangtools.version}</version>
- </dependency>
- <dependency>
- <groupId>equinoxSDK381</groupId>
- <artifactId>org.eclipse.osgi</artifactId>
- <version>${equinox.osgi.version}</version>
- </dependency>
- <dependency>
- <groupId>org.mariadb.jdbc</groupId>
- <artifactId>mariadb-java-client</artifactId>
- <version>${mariadb.connector.version}</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>dblib-provider</artifactId>
- <version>${sdnctl.dblib.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sliapi-model</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>sli-common</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>bundle</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.7</source>
- <target>1.7</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.4</version>
- <configuration>
- <includes>**/*.xsd</includes>
- <archive>
- <manifest>
- <mainClass>org.onap.ccsdk.sli.core.sli.SvcLogicParser</mainClass>
- <packageName>org.onap.ccsdk.sli.core.sli</packageName>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Export-Package>org.onap.ccsdk.sli.core.sli;version=${project.version}</Export-Package>
- <Import-Package>*</Import-Package>
- <Embed-Dependency>*;scope=compile;artifactId=commons-lang|commons-lang3</Embed-Dependency>
- <Embed-Transitive>true</Embed-Transitive>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.antlr</groupId>
- <artifactId>antlr4-maven-plugin</artifactId>
- <version>${antlr.version}</version>
- <executions>
- <execution>
- <configuration>
- <outputDirectory>${project.basedir}/src/main/java/</outputDirectory>
- </configuration>
- <id>antlr</id>
- <goals>
- <goal>antlr4</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <name>ccsdk-sli-core :: sli :: ${project.artifactId}</name>
+ <description>The SLI Common package includes common classes used by the various SLI subcomponents, as well as classes used by clients to interface with the service logic interpreter</description>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>1.6.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>ch.vorburger.mariaDB4j</groupId>
+ <artifactId>mariaDB4j</artifactId>
+ <version>2.2.3</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr4</artifactId>
+ <version>${antlr.version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.7.5</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>${commons.lang3.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>equinoxSDK381</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ <version>${equinox.osgi.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mariadb.jdbc</groupId>
+ <artifactId>mariadb-java-client</artifactId>
+ <version>${mariadb.connector.version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>dblib-provider</artifactId>
+ <version>${sdnctl.dblib.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>sli-model</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-inet-types</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-yang-types</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-core-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-api</artifactId>
+ </dependency>
+
+ <!-- Testing Dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr4-maven-plugin</artifactId>
+ <version>${antlr.version}</version>
+ <executions>
+ <execution>
+ <configuration>
+ <outputDirectory>${project.basedir}/src/main/java/</outputDirectory>
+ </configuration>
+ <id>antlr</id>
+ <goals>
+ <goal>antlr4</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicDblibStore.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicDblibStore.java
index 74fa1dd6..ee3bcca5 100644
--- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicDblibStore.java
+++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicDblibStore.java
@@ -54,10 +54,22 @@ public class SvcLogicDblibStore implements SvcLogicStore {
private static final String DBLIB_SERVICE = "org.onap.ccsdk.sli.core.dblib.DbLibService";
+ private DbLibService dbSvc;
+
+ public SvcLogicDblibStore()
+ {
+ // Does nothing, but needed so that argumentless constructor
+ // still works.
+ }
+
+ public SvcLogicDblibStore(DbLibService dbsvc) {
+ this.dbSvc = dbsvc;
+ }
+
@Override
public void init(Properties props) throws ConfigurationException {
- DbLibService dbSvc = getDbLibService();
+ dbSvc = getDbLibService();
if(dbSvc == null) {
LOG.error("SvcLogic cannot acquire DBLIB_SERVICE");
return;
@@ -74,7 +86,7 @@ public class SvcLogicDblibStore implements SvcLogicStore {
public boolean hasGraph(String module, String rpc, String version,
String mode) throws SvcLogicException {
- DbLibService dbSvc = getDbLibService();
+
boolean retval = false;
CachedRowSet results = null;
@@ -124,7 +136,6 @@ public class SvcLogicDblibStore implements SvcLogicStore {
public SvcLogicGraph fetch(String module, String rpc, String version,
String mode) throws SvcLogicException {
- DbLibService dbSvc = getDbLibService();
PreparedStatement fetchGraphStmt = null;
Connection dbConn = null;
SvcLogicGraph retval = null;
@@ -210,7 +221,7 @@ public class SvcLogicDblibStore implements SvcLogicStore {
public void store(SvcLogicGraph graph) throws SvcLogicException {
- DbLibService dbSvc = getDbLibService();
+
String storeGraphSql = "INSERT INTO SVC_LOGIC (module, rpc, version, mode, active, graph)"
+ " VALUES(?, ?, ?, ?, ?, ?)";
@@ -283,7 +294,7 @@ public class SvcLogicDblibStore implements SvcLogicStore {
public void delete(String module, String rpc, String version, String mode)
throws SvcLogicException {
- DbLibService dbSvc = getDbLibService();
+
String deleteGraphSql = "DELETE FROM SVC_LOGIC WHERE module = ? AND rpc = ? AND version = ? AND mode = ?";
@@ -302,7 +313,7 @@ public class SvcLogicDblibStore implements SvcLogicStore {
}
public void activate(SvcLogicGraph graph) throws SvcLogicException {
- DbLibService dbSvc = getDbLibService();
+
String deactivateSql = "UPDATE SVC_LOGIC SET active = 'N' WHERE module = ? AND rpc = ? AND mode = ?";
@@ -328,8 +339,11 @@ public class SvcLogicDblibStore implements SvcLogicStore {
private DbLibService getDbLibService() {
+ if (dbSvc != null) {
+ return dbSvc;
+ }
+
// Get DbLibService interface object.
- DbLibService dblibSvc = null;
ServiceReference sref = null;
BundleContext bctx = null;
@@ -345,8 +359,8 @@ public class SvcLogicDblibStore implements SvcLogicStore {
if (sref == null) {
LOG.warn("Could not find service reference for DBLIB service ({})", DBLIB_SERVICE);
} else {
- dblibSvc = (DbLibService) bctx.getService(sref);
- if (dblibSvc == null) {
+ dbSvc = (DbLibService) bctx.getService(sref);
+ if (dbSvc == null) {
LOG.warn("Could not find service reference for DBLIB service ({})", DBLIB_SERVICE);
}
@@ -385,16 +399,16 @@ public class SvcLogicDblibStore implements SvcLogicStore {
}
try {
- dblibSvc = new DBResourceManager(dblibProps);
- JavaSingleton.setInstance(dblibSvc);
+ dbSvc = new DBResourceManager(dblibProps);
+ JavaSingleton.setInstance(dbSvc);
} catch (Exception e) {
LOG.warn("Caught exception trying to create DBResourceManager", e);
}
} else {
- dblibSvc = JavaSingleton.getInstance();
+ dbSvc = JavaSingleton.getInstance();
}
}
- return dblibSvc;
+ return dbSvc;
}
@@ -419,7 +433,7 @@ public class SvcLogicDblibStore implements SvcLogicStore {
@Override
public void activate(String module, String rpc, String version, String mode) throws SvcLogicException {
- DbLibService dbSvc = getDbLibService();
+
String deactivateSql = "UPDATE SVC_LOGIC SET active = 'N' WHERE module = ? AND rpc = ? AND mode = ?";
diff --git a/sli/features/features-sli/pom.xml b/sli/features/features-sli/pom.xml
new file mode 100644
index 00000000..de617baa
--- /dev/null
+++ b/sli/features/features-sli/pom.xml
@@ -0,0 +1,29 @@
+<?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.ccsdk.parent</groupId>
+ <artifactId>feature-repo-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>features-sli</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>feature</packaging>
+
+ <name>ccsdk-sli-core :: sli :: ${project.artifactId}</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>ccsdk-sli</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/sli/features/odl-sli/pom.xml b/sli/features/odl-sli/pom.xml
new file mode 100644
index 00000000..907cef6a
--- /dev/null
+++ b/sli/features/odl-sli/pom.xml
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright © 2017 APL and others. All rights reserved. This program and
+ the accompanying materials are made available under the terms of the Eclipse
+ Public License v1.0 which accompanies this distribution, and is available
+ at http://www.eclipse.org/legal/epl-v10.html INTERNAL -->
+<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.ccsdk.parent</groupId>
+ <artifactId>single-feature-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath />
+ </parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>ccsdk-sli</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>feature</packaging>
+
+ <name>ccsdk-sli-core :: sli :: ${project.artifactId}</name>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>mdsal-model-artifacts</artifactId>
+ <version>0.11.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>1.6.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>sli-common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>sli-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>sli-recording</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mariadb.jdbc</groupId>
+ <artifactId>mariadb-java-client</artifactId>
+ <version>${mariadb.connector.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>ccsdk-dblib</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>odl-mdsal-broker</artifactId>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+ <dependency>
+ <groupId>equinoxSDK381</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ <version>${equinox.osgi.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/sli/features/pom.xml b/sli/features/pom.xml
index 4630b783..fbb864ef 100755..100644
--- a/sli/features/pom.xml
+++ b/sli/features/pom.xml
@@ -1,137 +1,30 @@
<?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>
- <artifactId>sli</artifactId>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <version>0.2.0-SNAPSHOT</version>
- </parent>
- <artifactId>sli-features</artifactId>
- <name>SLI - Features</name>
-
- <packaging>jar</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sli-common</artifactId>
- <version>${project.version}</version>
- </dependency>
-
-
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sli-recording</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>${commons.lang.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>features-mdsal</artifactId>
- <version>${odl.mdsal.features.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
-
- <scope>runtime</scope>
- </dependency>
-
+<!--
+Copyright © 2017 APL and others. All rights reserved.
- <!-- dependency for opendaylight-karaf-empty for use by testing
- <dependency>
- <groupId>org.opendaylight.odlparent</groupId>
- <artifactId>opendaylight-karaf-empty</artifactId>
- <version>${odl.karaf.empty.version}</version>
- <type>zip</type>
- </dependency>
- -->
-
-
- <dependency>
- <!-- Required for launching the feature tests -->
- <groupId>org.opendaylight.odlparent</groupId>
- <artifactId>features-test</artifactId>
- <version>${odl.commons.opendaylight.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>features-yangtools</artifactId>
- <version>${odl.yangtools.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-
- <build>
- <resources>
- <resource>
- <filtering>true</filtering>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <id>filter</id>
- <goals>
- <goal>resources</goal>
- </goals>
- <phase>generate-resources</phase>
- </execution>
- </executions>
- </plugin>
-
- <!-- Comment out feature test, since it fails in Jenkins due to env issues
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version>
- <configuration>
- <systemPropertyVariables>
- <karaf.distro.groupId>org.opendaylight.odlparent</karaf.distro.groupId>
- <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
- <karaf.distro.version>${odl.karaf.empty.distro.version}</karaf.distro.version>
- </systemPropertyVariables>
- <dependenciesToScan>
- <dependency>org.opendaylight.yangtools:features-test</dependency>
- </dependenciesToScan>
- </configuration>
- </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/${features.file}</file>
- <type>xml</type>
- <classifier>features</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
+-->
+<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.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>sli-feature-aggregator</artifactId>
+ <version>0.1.0</version>
+ <packaging>pom</packaging>
+
+ <name>ccsdk-sli-core :: sli :: ${project.artifactId}</name>
+
+ <modules>
+ <module>features-sli</module>
+ <module>odl-sli</module>
+ </modules>
</project>
diff --git a/sli/features/src/main/resources/features.xml b/sli/features/src/main/resources/features.xml
deleted file mode 100644
index 1f17c1a9..00000000
--- a/sli/features/src/main/resources/features.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ============LICENSE_START=======================================================
- ONAP : CCSDK
- ================================================================================
- 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=========================================================
- -->
-
-
-<features name="sdnc-sli-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
-
- <repository>mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features</repository>
-
-
- <feature name='sdnc-sli' description="sdnc-sli" version='${project.version}'>
-
- <feature version="${odl.mdsal.version}">odl-mdsal-broker</feature>
- <bundle>mvn:org.onap.ccsdk.sli.core/sli-common/${project.version}</bundle>
- <bundle>mvn:org.onap.ccsdk.sli.core/sli-provider/${project.version}</bundle>
- <bundle>mvn:org.onap.ccsdk.sli.core/sli-recording/${project.version}</bundle>
- <feature>sdnc-dblib</feature>
- <bundle>mvn:org.mariadb.jdbc/mariadb-java-client/${mariadb.connector.version}</bundle>
- </feature>
-
-</features>
diff --git a/sli/installer/pom.xml b/sli/installer/pom.xml
index 23b74713..ec2b43cf 100755
--- a/sli/installer/pom.xml
+++ b/sli/installer/pom.xml
@@ -1,19 +1,25 @@
<?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>
- <artifactId>sli</artifactId>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sli-installer</artifactId>
- <name>SLI - Karaf Installer</name>
+ <version>0.2.1-SNAPSHOT</version>
<packaging>pom</packaging>
+ <name>ccsdk-sli-core :: sli :: ${project.artifactId}</name>
+
<properties>
- <application.name>sdnc-sli</application.name>
- <features.boot>sdnc-sli</features.boot>
- <features.repositories>mvn:org.onap.ccsdk.sli.core/sli-features/${project.version}/xml/features</features.repositories>
+ <application.name>ccsdk-sli</application.name>
+ <features.boot>${application.name}</features.boot>
+ <features.repositories>mvn:org.onap.ccsdk.sli.core/${features.boot}/${project.version}/xml/features</features.repositories>
<include.transitive.dependencies>false</include.transitive.dependencies>
</properties>
@@ -21,10 +27,10 @@
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sli-features</artifactId>
+ <artifactId>${application.name}</artifactId>
<version>${project.version}</version>
- <classifier>features</classifier>
<type>xml</type>
+ <classifier>features</classifier>
<exclusions>
<exclusion>
<groupId>*</groupId>
@@ -145,5 +151,4 @@
</plugins>
</build>
-
</project>
diff --git a/sli/model/pom.xml b/sli/model/pom.xml
index 59658a3e..3a78c478 100755
--- a/sli/model/pom.xml
+++ b/sli/model/pom.xml
@@ -1,82 +1,29 @@
<?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>
- <artifactId>sli</artifactId>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sli-model</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
<packaging>bundle</packaging>
- <name>SLI - Model</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Import-Package>*</Import-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-maven-plugin</artifactId>
- <version>${odl.yangtools.yang.maven.plugin.version}</version>
- <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>
- </dependencies>
- <executions>
- <execution>
- <goals>
- <goal>generate-sources</goal>
- </goals>
- <configuration>
- <yangFilesRootDir>${yang.file.directory}</yangFilesRootDir>
- <codeGenerators>
- <generator>
- <!--
- <codeGeneratorClass>org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
- -->
- <codeGeneratorClass>org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
- <outputBaseDir>${salGeneratorPath}</outputBaseDir>
- </generator>
- </codeGenerators>
- <inspectDependencies>true</inspectDependencies>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <name>ccsdk-sli-core :: sli :: ${project.artifactId}</name>
+
<dependencies>
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>yang-binding</artifactId>
- <version>${odl.mdsal.yang.binding.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-common</artifactId>
- <version>${odl.yangtools.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types</artifactId>
- <version>${odl.ietf-inet-types.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-yang-types</artifactId>
- <version>${odl.ietf-yang-types.version}</version>
- </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-inet-types</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-yang-types</artifactId>
+ </dependency>
</dependencies>
</project>
diff --git a/sli/pom.xml b/sli/pom.xml
index 95417c3c..985fa1d3 100755
--- a/sli/pom.xml
+++ b/sli/pom.xml
@@ -1,53 +1,24 @@
<?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/maven-v4_0_0.xsd">
-
+<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.ccsdk.sli.core</groupId>
- <artifactId>ccsdk-sli-core</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
- <modelVersion>4.0.0</modelVersion>
- <packaging>pom</packaging>
+
<groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sli</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
- <dependencyManagement>
-
- <dependencies>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sli-features</artifactId>
- <classifier>features</classifier>
- <type>xml</type>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sli-common</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sli-provider</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sli-recording</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- </dependencies>
-
- </dependencyManagement>
-
-
- <name>Service Logic Interpreter</name>
+ <name>ccsdk-sli-core :: sli</name>
<description>The Service Logic Interpreter (SLI) allows service planners to design the flow of logic within the SDN controller in an XML format, without a need for custom Java code. </description>
+ <organization>
+ <name>ONAP</name>
+ </organization>
<modules>
<module>model</module>
@@ -57,10 +28,4 @@
<module>features</module>
<module>installer</module>
</modules>
- <organization>
- <name>ONAP</name>
- </organization>
- <version>0.2.0-SNAPSHOT</version>
-
-
</project>
diff --git a/sli/provider/pom.xml b/sli/provider/pom.xml
index 4f410ab0..4a90ae00 100755
--- a/sli/provider/pom.xml
+++ b/sli/provider/pom.xml
@@ -1,25 +1,38 @@
<?xml version="1.0"?>
-<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.ccsdk.sli.core</groupId>
- <artifactId>sli</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+<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.ccsdk.parent</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
- <artifactId>sli-provider</artifactId>
- <packaging>bundle</packaging>
- <name>SLI - Provider</name>
- <properties>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>sli-provider</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <name>ccsdk-sli-core :: sli :: ${project.artifactId}</name>
+ <description>SLI Provider is the OSGi bundle that exposes the service logic interpreter as a service.</description>
+
+ <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>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>1.6.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
<dependency>
<groupId>ch.vorburger.mariaDB4j</groupId>
<artifactId>mariaDB4j</artifactId>
@@ -60,129 +73,24 @@
<scope>compile</scope>
</dependency>
- <!--
- <dependency>
- <groupId>org.antlr</groupId>
- <artifactId>antlr4</artifactId>
- <version>${antlr.version}</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>
- -->
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>${bundle.plugin.version}</version>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Activator>org.onap.ccsdk.sli.core.sli.provider.SvcLogicActivator</Bundle-Activator>
- <Export-Package>org.onap.ccsdk.sli.core.sli.provider;version=${project.version}</Export-Package>
-
- <DynamicImport-Package>*</DynamicImport-Package>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-api</artifactId>
+ </dependency>
- <Import-Package>org.onap.ccsdk.sli.core.sli;version="${project.version}",*</Import-Package>
+ <!-- Testing Dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
- <Embed-Dependency>*;scope=compile;artifactId=commons-lang|commons-lang3</Embed-Dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
- <Embed-Transitive>true</Embed-Transitive>
- </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>
- <yangFilesRootDir>src/test/resources</yangFilesRootDir>
- <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>
-
- <!--
- Cleans up generated test artifacts which get included as a source
- directory, but which we don't want as part of the bundle.
- -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.8</version>
- <executions>
- <execution>
- <phase>prepare-package</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <target>
- <delete includeemptydirs="true">
- <fileset
- dir="${salGeneratorPath}"
- includes="**/*"/>
- <fileset
- dir="${basedir}"
- includes="${salGeneratorPath}"/>
- <fileset
- dir="${jmxGeneratorPath}"
- includes="**/*"/>
- <fileset
- dir="${basedir}"
- includes="${jmxGeneratorPath}"/>
- </delete>
- </target>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
- <description>SLI Provider is the OSGi bundle that exposes the service logic interpreter as a service.</description>
+ </dependencies>
</project>
diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/CallNodeExecutor.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/CallNodeExecutor.java
index d11a2828..24774af2 100644
--- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/CallNodeExecutor.java
+++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/CallNodeExecutor.java
@@ -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.
@@ -34,15 +34,15 @@ public class CallNodeExecutor extends SvcLogicNodeExecutor {
private static final Logger LOG = LoggerFactory
.getLogger(CallNodeExecutor.class);
-
+
@Override
public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node, SvcLogicContext ctx)
throws SvcLogicException {
String outValue = "not-found";
-
+
SvcLogicGraph myGraph = node.getGraph();
-
+
if (myGraph == null)
{
LOG.debug("execute: getGraph returned null");
@@ -51,17 +51,17 @@ public class CallNodeExecutor extends SvcLogicNodeExecutor {
{
LOG.debug("execute: got SvcLogicGraph");
}
-
+
SvcLogicExpression moduleExpr = null;
-
+
String module = null;
-
+
moduleExpr = node.getAttribute("module");
if (moduleExpr != null)
{
module = SvcLogicExpressionResolver.evaluate(moduleExpr, node, ctx);
}
-
+
if ((module == null) || (module.length() == 0))
{
if (myGraph != null)
@@ -70,7 +70,7 @@ public class CallNodeExecutor extends SvcLogicNodeExecutor {
LOG.debug("myGraph.getModule() returned "+module);
}
}
-
+
SvcLogicExpression rpcExpr = null;
String rpc = null;
rpcExpr = node.getAttribute("rpc");
@@ -78,7 +78,7 @@ public class CallNodeExecutor extends SvcLogicNodeExecutor {
{
rpc = SvcLogicExpressionResolver.evaluate(rpcExpr, node, ctx);
}
-
+
if ((rpc == null) || (rpc.length() == 0))
{
if (myGraph != null)
@@ -87,9 +87,9 @@ public class CallNodeExecutor extends SvcLogicNodeExecutor {
LOG.debug("myGraph.getRpc() returned "+rpc);
}
}
-
+
String mode = null;
-
+
moduleExpr = node.getAttribute("mode");
if (moduleExpr != null)
{
@@ -105,9 +105,9 @@ public class CallNodeExecutor extends SvcLogicNodeExecutor {
LOG.debug("myGraph.getMode() returned "+mode);
}
}
-
+
String version = null;
-
+
moduleExpr = node.getAttribute("version");
if (moduleExpr != null)
{
@@ -116,9 +116,9 @@ public class CallNodeExecutor extends SvcLogicNodeExecutor {
String parentGraph = ctx.getAttribute("currentGraph");
ctx.setAttribute("parentGraph", parentGraph);
-
- SvcLogicStore store = getStore();
-
+
+ SvcLogicStore store = svc.getStore();
+
if (store != null) {
SvcLogicGraph calledGraph = store.fetch(module, rpc, version, mode);
if (calledGraph != null) {
@@ -132,7 +132,7 @@ public class CallNodeExecutor extends SvcLogicNodeExecutor {
} else {
LOG.debug("Could not get SvcLogicStore reference");
}
-
+
SvcLogicNode nextNode = node.getOutcomeValue(outValue);
if (nextNode != null) {
if (LOG.isDebugEnabled()) {
diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicActivator.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicActivator.java
deleted file mode 100644
index 95dfb2b8..00000000
--- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicActivator.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP : CCSDK
- * ================================================================================
- * 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.onap.ccsdk.sli.core.sli.provider;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Properties;
-import org.onap.ccsdk.sli.core.sli.ConfigurationException;
-import org.onap.ccsdk.sli.core.sli.SvcLogicAdaptor;
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-import org.onap.ccsdk.sli.core.sli.SvcLogicStore;
-import org.onap.ccsdk.sli.core.sli.SvcLogicStoreFactory;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-public class SvcLogicActivator implements BundleActivator {
-
- private static final String SVCLOGIC_PROP_VAR = "SDNC_SLI_PROPERTIES";
- private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR";
-
- private static final Map<String, SvcLogicNodeExecutor> BUILTIN_NODES = new HashMap<String, SvcLogicNodeExecutor>() {
- {
- put("block", new BlockNodeExecutor());
- put("call", new CallNodeExecutor());
- put("configure", new ConfigureNodeExecutor());
- put("delete", new DeleteNodeExecutor());
- put("execute", new ExecuteNodeExecutor());
- put("exists", new ExistsNodeExecutor());
- put("for", new ForNodeExecutor());
- put("get-resource", new GetResourceNodeExecutor());
- put("is-available", new IsAvailableNodeExecutor());
- put("notify", new NotifyNodeExecutor());
- put("record", new RecordNodeExecutor());
- put("release", new ReleaseNodeExecutor());
- put("reserve", new ReserveNodeExecutor());
- put("return", new ReturnNodeExecutor());
- put("save", new SaveNodeExecutor());
- put("set", new SetNodeExecutor());
- put("switch", new SwitchNodeExecutor());
- put("update", new UpdateNodeExecutor());
- put("break", new BreakNodeExecutor());
- put("while", new WhileNodeExecutor());
- }
- };
-
- private static final Logger LOG = LoggerFactory.getLogger(SvcLogicActivator.class);
-
- private static LinkedList<ServiceRegistration> registrations = new LinkedList<>();
-
- private static HashMap<String, SvcLogicAdaptor> adaptorMap;
-
- private static Properties props;
-
- private static BundleContext bundleCtx;
-
- private static SvcLogicService svcLogicServiceImpl;
-
- @Override
- public void start(BundleContext ctx) throws Exception {
-
- LOG.info("Activating SLI");
-
- synchronized (SvcLogicActivator.class) {
- bundleCtx = ctx;
- props = new Properties();
- }
-
- // Read properties
- String propPath = System.getenv(SVCLOGIC_PROP_VAR);
-
- if (propPath == null) {
- String propDir = System.getenv(SDNC_CONFIG_DIR);
- if (propDir == null) {
-
- propDir = "/opt/sdnc/data/properties";
- }
- propPath = propDir + "/svclogic.properties";
- LOG.warn("Environment variable {} unset - defaulting to {}", SVCLOGIC_PROP_VAR, propPath);
- }
-
- File propFile = new File(propPath);
-
- if (!propFile.exists()) {
- throw new ConfigurationException("Missing configuration properties file : " + propFile);
- }
-
- try {
- props.load(new FileInputStream(propFile));
- } catch (Exception e) {
- throw new ConfigurationException("Could not load properties file " + propPath, e);
-
- }
-
- synchronized (SvcLogicActivator.class) {
- if (registrations == null) {
- registrations = new LinkedList<>();
- }
- // Advertise SvcLogicService
- svcLogicServiceImpl = new SvcLogicServiceImpl();
- }
-
- LOG.info("SLI: Registering service {} in bundle {}", SvcLogicService.NAME, ctx.getBundle().getSymbolicName());
- ServiceRegistration reg = ctx.registerService(SvcLogicService.NAME, svcLogicServiceImpl, null);
- registrations.add(reg);
-
- // Initialize SvcLogicStore
- try {
- SvcLogicStore store = getStore();
- } catch (ConfigurationException e) {
- LOG.warn("Could not initialize SvcLogicScore", e);
- }
-
- LOG.info("SLI - done registering services");
- }
-
- @Override
- public void stop(BundleContext ctx) throws Exception {
-
- if (registrations != null) {
- for (ServiceRegistration reg : registrations) {
- ServiceReference regRef = reg.getReference();
- reg.unregister();
- }
- synchronized (SvcLogicActivator.class) {
- registrations = null;
- }
- }
- }
-
- public static SvcLogicStore getStore() throws SvcLogicException {
- // Create and initialize SvcLogicStore object - used to access
- // saved service logic.
-
- SvcLogicStore store;
-
- try {
- store = SvcLogicStoreFactory.getSvcLogicStore(props);
- } catch (Exception e) {
- throw new ConfigurationException("Could not get service logic store", e);
-
- }
-
- try {
- store.init(props);
- } catch (Exception e) {
- throw new ConfigurationException("Could not get service logic store", e);
- }
-
- return(store);
- }
-
-
-}
diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicNodeExecutor.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicNodeExecutor.java
index 43296c6c..951536b5 100644
--- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicNodeExecutor.java
+++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicNodeExecutor.java
@@ -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.
@@ -36,7 +36,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public abstract class SvcLogicNodeExecutor {
-
+
public abstract SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node, SvcLogicContext ctx) throws SvcLogicException;
private static final Logger LOG = LoggerFactory.getLogger(SvcLogicNodeExecutor.class);
@@ -51,15 +51,12 @@ public abstract class SvcLogicNodeExecutor {
node, ctx));
}
-
- protected SvcLogicStore getStore() throws SvcLogicException {
- return SvcLogicActivator.getStore();
- }
-
+
+
protected SvcLogicAdaptor getAdaptor(String adaptorName) {
return SvcLogicAdaptorFactory.getInstance(adaptorName);
}
-
+
protected SvcLogicResource getSvcLogicResource(String plugin) {
BundleContext bctx = FrameworkUtil.getBundle(this.getClass())
.getBundleContext();
@@ -75,7 +72,7 @@ public abstract class SvcLogicNodeExecutor {
return null;
}
}
-
+
protected SvcLogicRecorder getSvcLogicRecorder(String plugin) {
BundleContext bctx = FrameworkUtil.getBundle(this.getClass())
.getBundleContext();
@@ -90,7 +87,7 @@ public abstract class SvcLogicNodeExecutor {
return null;
}
}
-
+
protected SvcLogicJavaPlugin getSvcLogicJavaPlugin(String pluginName){
BundleContext bctx = FrameworkUtil.getBundle(this.getClass())
.getBundleContext();
@@ -106,5 +103,5 @@ public abstract class SvcLogicNodeExecutor {
return plugin;
}
}
-
+
}
diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicPropertiesProvider.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicPropertiesProvider.java
new file mode 100644
index 00000000..6e859721
--- /dev/null
+++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicPropertiesProvider.java
@@ -0,0 +1,188 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * onap
+ * ================================================================================
+ * Copyright (C) 2016 - 2017 ONAP
+ * ================================================================================
+ * 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.onap.ccsdk.sli.core.sli.provider;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Optional;
+import java.util.Properties;
+import java.util.Vector;
+
+import org.onap.ccsdk.sli.core.dblib.DblibConfigurationException;
+import org.onap.ccsdk.sli.core.sli.ConfigurationException;
+import org.onap.ccsdk.sli.core.utils.JREFileResolver;
+import org.onap.ccsdk.sli.core.utils.KarafRootFileResolver;
+import org.onap.ccsdk.sli.core.utils.PropertiesFileResolver;
+import org.onap.ccsdk.sli.core.utils.common.CoreDefaultFileResolver;
+import org.onap.ccsdk.sli.core.utils.common.SdncConfigEnvVarFileResolver;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Responsible for determining the properties file to use and instantiating the
+ * <code>DBResourceManager</code> Service. The priority for properties file
+ * resolution is as follows:
+ *
+ * <ol>
+ * <li>A directory identified by the system environment variable
+ * <code>SDNC_CONFIG_DIR</code></li>
+ * <li>The default directory <code>DEFAULT_DBLIB_PROP_DIR</code></li>
+ * <li>A directory identified by the JRE argument
+ * <code>dblib.properties</code></li>
+ * <li>A <code>dblib.properties</code> file located in the karaf root
+ * directory</li>
+ * </ol>
+ */
+public class SvcLogicPropertiesProvider {
+
+ private static final Logger LOG = LoggerFactory.getLogger(SvcLogicPropertiesProvider.class);
+
+ /**
+ * The name of the properties file for database configuration
+ */
+ private static final String SVCLOGIC_PROP_FILE_NAME = "svclogic.properties";
+
+ /**
+ * A prioritized list of strategies for resolving dblib properties files.
+ */
+ private Vector<PropertiesFileResolver> sliPropertiesFileResolvers = new Vector<>();
+
+ /**
+ * The configuration properties for the db connection.
+ */
+ private Properties properties;
+
+ /**
+ * Set up the prioritized list of strategies for resolving dblib properties
+ * files.
+ */
+ public SvcLogicPropertiesProvider() {
+ sliPropertiesFileResolvers
+ .add(new SdncConfigEnvVarFileResolver("Using property file (1) from environment variable"));
+ sliPropertiesFileResolvers.add(new CoreDefaultFileResolver("Using property file (2) from default directory"));
+
+ sliPropertiesFileResolvers.add(
+ new JREFileResolver("Using property file (3) from JRE argument", SvcLogicPropertiesProvider.class));
+ sliPropertiesFileResolvers.add(new KarafRootFileResolver("Using property file (4) from karaf root", this));
+
+ // determines properties file as according to the priority described in the
+ // class header comment
+ final File propertiesFile = determinePropertiesFile(this);
+ if (propertiesFile != null) {
+ try (FileInputStream fileInputStream = new FileInputStream(propertiesFile)) {
+ properties = new Properties();
+ properties.load(fileInputStream);
+ } catch (final IOException e) {
+ LOG.error("Failed to load properties for file: {}", propertiesFile.toString(),
+ new ConfigurationException("Failed to load properties for file: " + propertiesFile.toString(),
+ e));
+ }
+ } else {
+ // Try to read properties as resource
+
+ InputStream propStr = getClass().getResourceAsStream("/" + SVCLOGIC_PROP_FILE_NAME);
+ if (propStr != null) {
+ properties = new Properties();
+ try {
+ properties.load(propStr);
+ propStr.close();
+ } catch (IOException e) {
+ properties = null;
+ }
+ }
+
+ }
+
+ if (properties == null) {
+ reportFailure("Missing configuration properties resource(3)", new ConfigurationException(
+ "Missing configuration properties resource(3): " + SVCLOGIC_PROP_FILE_NAME));
+ }
+ }
+
+ /**
+ * Extract svclogic config properties.
+ *
+ * @return the svclogic config properties
+ */
+ public Properties getProperties() {
+ return properties;
+ }
+
+ /**
+ * Reports the method chosen for properties resolution to the
+ * <code>Logger</code>.
+ *
+ * @param message
+ * Some user friendly message
+ * @param fileOptional
+ * The file location of the chosen properties file
+ * @return the file location of the chosen properties file
+ */
+ private static File reportSuccess(final String message, final Optional<File> fileOptional) {
+ if (fileOptional.isPresent()) {
+ final File file = fileOptional.get();
+ LOG.info("{} {}", message, file.getPath());
+ return file;
+ }
+ return null;
+ }
+
+ /**
+ * Reports fatal errors. This is the case in which no properties file could be
+ * found.
+ *
+ * @param message
+ * An appropriate fatal error message
+ * @param configurationException
+ * An exception describing what went wrong during resolution
+ */
+ private static void reportFailure(final String message, final ConfigurationException configurationException) {
+
+ LOG.error("{}", message, configurationException);
+ }
+
+ /**
+ * Determines the dblib properties file to use based on the following priority:
+ * <ol>
+ * <li>A directory identified by the system environment variable
+ * <code>SDNC_CONFIG_DIR</code></li>
+ * <li>The default directory <code>DEFAULT_DBLIB_PROP_DIR</code></li>
+ * <li>A directory identified by the JRE argument
+ * <code>dblib.properties</code></li>
+ * <li>A <code>dblib.properties</code> file located in the karaf root
+ * directory</li>
+ * </ol>
+ */
+ File determinePropertiesFile(final SvcLogicPropertiesProvider resourceProvider) {
+
+ for (final PropertiesFileResolver sliPropertiesFileResolver : sliPropertiesFileResolvers) {
+ final Optional<File> fileOptional = sliPropertiesFileResolver.resolveFile(SVCLOGIC_PROP_FILE_NAME);
+ if (fileOptional.isPresent()) {
+ return reportSuccess(sliPropertiesFileResolver.getSuccessfulResolutionMessage(), fileOptional);
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java
index 5f4d3653..53875b35 100644
--- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java
+++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java
@@ -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.
@@ -24,12 +24,16 @@ package org.onap.ccsdk.sli.core.sli.provider;
import java.util.HashMap;
import java.util.Properties;
+import org.onap.ccsdk.sli.core.dblib.DbLibService;
+import org.onap.ccsdk.sli.core.sli.ConfigurationException;
import org.onap.ccsdk.sli.core.sli.MetricLogger;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+import org.onap.ccsdk.sli.core.sli.SvcLogicDblibStore;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.ccsdk.sli.core.sli.SvcLogicGraph;
import org.onap.ccsdk.sli.core.sli.SvcLogicNode;
import org.onap.ccsdk.sli.core.sli.SvcLogicStore;
+import org.onap.ccsdk.sli.core.sli.SvcLogicStoreFactory;
import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
@@ -51,6 +55,25 @@ public class SvcLogicServiceImpl implements SvcLogicService {
private BundleContext bctx = null;
+ private Properties properties;
+
+ private SvcLogicStore store;
+
+ public SvcLogicServiceImpl(SvcLogicPropertiesProvider resourceProvider) throws SvcLogicException{
+
+ properties = resourceProvider.getProperties();
+
+ getStore();
+ }
+
+ public SvcLogicServiceImpl(SvcLogicPropertiesProvider resourceProvider, DbLibService dbSvc) throws SvcLogicException{
+
+ properties = resourceProvider.getProperties();
+ store = new SvcLogicDblibStore(dbSvc);
+}
+
+
+
private void registerExecutors() {
LOG.info("Entered register executors");
@@ -210,8 +233,6 @@ public class SvcLogicServiceImpl implements SvcLogicService {
@Override
public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException
{
- SvcLogicStore store = SvcLogicActivator.getStore();
-
return (store.hasGraph(module, rpc, version, mode));
}
@@ -226,8 +247,6 @@ public class SvcLogicServiceImpl implements SvcLogicService {
public Properties execute(String module, String rpc, String version, String mode,
Properties props, DOMDataBroker domDataBroker) throws SvcLogicException {
- // See if there is a service logic defined
- SvcLogicStore store = SvcLogicActivator.getStore();
LOG.info("Fetching service logic from data store");
SvcLogicGraph graph = store.fetch(module, rpc, version, mode);
@@ -249,4 +268,28 @@ public class SvcLogicServiceImpl implements SvcLogicService {
return(ctx.toProperties());
}
+
+ public SvcLogicStore getStore() throws SvcLogicException {
+ // Create and initialize SvcLogicStore object - used to access
+ // saved service logic.
+
+ if (store != null) {
+ return store;
+ }
+
+ try {
+ store = SvcLogicStoreFactory.getSvcLogicStore(properties);
+ } catch (Exception e) {
+ throw new ConfigurationException("Could not get service logic store", e);
+
+ }
+
+ try {
+ store.init(properties);
+ } catch (SvcLogicException e) {
+ throw new ConfigurationException("Could not get service logic store", e);
+ }
+
+ return store;
+ }
}
diff --git a/sli/provider/src/main/resources/org/opendaylight/blueprint/sli-blueprint.xml b/sli/provider/src/main/resources/org/opendaylight/blueprint/sli-blueprint.xml
new file mode 100755
index 00000000..82905742
--- /dev/null
+++ b/sli/provider/src/main/resources/org/opendaylight/blueprint/sli-blueprint.xml
@@ -0,0 +1,21 @@
+<?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="propProvider" class="org.onap.ccsdk.sli.core.sli.provider.SvcLogicPropertiesProvider" />
+ <reference id="dblibService" interface="org.onap.ccsdk.sli.core.dblib.DbLibService" />
+
+ <bean id="svcLogicService" class="org.onap.ccsdk.sli.core.sli.provider.SvcLogicServiceImpl">
+ <argument ref="propProvider" />
+ <argument ref="dblibService"/>
+ </bean>
+
+
+ <service ref="svcLogicService">
+ <interfaces>
+ <value>org.onap.ccsdk.sli.core.sli.provider.SvcLogicService</value>
+ </interfaces>
+ </service>
+
+</blueprint> \ No newline at end of file
diff --git a/sli/provider/src/main/resources/svclogic.properties b/sli/provider/src/main/resources/svclogic.properties
new file mode 100644
index 00000000..49d39ab4
--- /dev/null
+++ b/sli/provider/src/main/resources/svclogic.properties
@@ -0,0 +1,25 @@
+###
+# ============LICENSE_START=======================================================
+# ONAP : CCSDK
+# ================================================================================
+# 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=========================================================
+###
+
+org.onap.ccsdk.sli.dbtype = dblib
+org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true
+org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
+org.onap.ccsdk.sli.jdbc.database = sdnctl
diff --git a/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ExecuteNodeExecutorTest.java b/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ExecuteNodeExecutorTest.java
index 48e49f81..eccbfc9e 100644
--- a/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ExecuteNodeExecutorTest.java
+++ b/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ExecuteNodeExecutorTest.java
@@ -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.
@@ -53,7 +53,8 @@ public class ExecuteNodeExecutorTest extends TestCase {
MockExecuteNodeExecutor execute = new MockExecuteNodeExecutor();
SvcLogicNode node = new SvcLogicNode(0, "", "", new SvcLogicGraph());
node.setAttribute("method", "selectLunch");
- execute.execute(new SvcLogicServiceImpl(), new SvcLogicNode(0, "", "", new SvcLogicGraph()), new SvcLogicContext());
+ SvcLogicPropertiesProvider resourceProvider = new SvcLogicPropertiesProvider();
+ execute.execute(new SvcLogicServiceImpl(resourceProvider), new SvcLogicNode(0, "", "", new SvcLogicGraph()), new SvcLogicContext());
}
}
diff --git a/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ITCaseSvcLogicGraphExecutor.java b/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ITCaseSvcLogicGraphExecutor.java
index 724e946d..18f044b3 100644
--- a/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ITCaseSvcLogicGraphExecutor.java
+++ b/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ITCaseSvcLogicGraphExecutor.java
@@ -102,8 +102,8 @@ public class ITCaseSvcLogicGraphExecutor {
SvcLogicParser parser = new SvcLogicParser();
// Loop through executor tests
-
- SvcLogicServiceImpl svc = new SvcLogicServiceImpl();
+ SvcLogicPropertiesProvider resourceProvider = new SvcLogicPropertiesProvider();
+ SvcLogicServiceImpl svc = new SvcLogicServiceImpl(resourceProvider);
for (String nodeType : BUILTIN_NODES.keySet()) {
LOG.info("SLI - registering node executor for node type " + nodeType);
@@ -156,8 +156,9 @@ public class ITCaseSvcLogicGraphExecutor {
SvcLogicParser parser = new SvcLogicParser();
// Loop through executor tests
+ SvcLogicPropertiesProvider resourceProvider = new SvcLogicPropertiesProvider();
- SvcLogicServiceImpl svc = new SvcLogicServiceImpl();
+ SvcLogicServiceImpl svc = new SvcLogicServiceImpl(resourceProvider);
for (String nodeType : BUILTIN_NODES.keySet()) {
diff --git a/sli/provider/src/test/resources/svclogic.properties b/sli/provider/src/test/resources/svclogic.properties
index 25eb3bd4..49d39ab4 100644
--- a/sli/provider/src/test/resources/svclogic.properties
+++ b/sli/provider/src/test/resources/svclogic.properties
@@ -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.
@@ -19,8 +19,7 @@
# ============LICENSE_END=========================================================
###
-org.onap.ccsdk.sli.dbtype = jdbc
-org.onap.ccsdk.sli.jdbc.url = jdbc:mysql://localhost:3306/sdnctl
+org.onap.ccsdk.sli.dbtype = dblib
+org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true
+org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
org.onap.ccsdk.sli.jdbc.database = sdnctl
-org.onap.ccsdk.sli.jdbc.user = sdnctl
-org.onap.ccsdk.sli.jdbc.password = gamma
diff --git a/sli/recording/pom.xml b/sli/recording/pom.xml
index b571cfbb..e8b136fd 100755
--- a/sli/recording/pom.xml
+++ b/sli/recording/pom.xml
@@ -1,24 +1,38 @@
<?xml version="1.0"?>
<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.ccsdk.sli.core</groupId>
- <artifactId>sli</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sli-recording</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
<packaging>bundle</packaging>
- <name>SLI - Recording</name>
+
+ <name>ccsdk-sli-core :: sli :: ${project.artifactId}</name>
+ <description>SLI Recording is an OSGi bundle that implements recording service for the service logic record node.</description>
+
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>1.6.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
<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>
@@ -48,28 +62,23 @@
<scope>compile</scope>
</dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>${bundle.plugin.version}</version>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Export-Package>org.onap.ccsdk.sli.core.sli.recording;version=${project.version}</Export-Package>
- <Embed-Transitive>true</Embed-Transitive>
- </instructions>
-
-
- </configuration>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-api</artifactId>
+ </dependency>
- </plugin>
+ <!-- Testing Dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
- </plugins>
- </build>
- <description>SLI Recording is an OSGi bundle that implements recording service for the service logic record node.</description>
+ </dependencies>
</project>
diff --git a/sliPluginUtils/features/ccsdk-sliPluginUtils/pom.xml b/sliPluginUtils/features/ccsdk-sliPluginUtils/pom.xml
new file mode 100644
index 00000000..8ea5ca86
--- /dev/null
+++ b/sliPluginUtils/features/ccsdk-sliPluginUtils/pom.xml
@@ -0,0 +1,65 @@
+<?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.ccsdk.parent</groupId>
+ <artifactId>single-feature-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>ccsdk-sliPluginUtils</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>feature</packaging>
+
+ <name>ccsdk-sli-core :: sliPluginUtils :: ${project.artifactId}</name>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>mdsal-model-artifacts</artifactId>
+ <version>0.11.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>1.6.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>odl-mdsal-broker</artifactId>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>ccsdk-sli</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>sliPluginUtils-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>equinoxSDK381</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ <version>${equinox.osgi.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/sliPluginUtils/features/features-sliPluginUtils/pom.xml b/sliPluginUtils/features/features-sliPluginUtils/pom.xml
new file mode 100644
index 00000000..004277dd
--- /dev/null
+++ b/sliPluginUtils/features/features-sliPluginUtils/pom.xml
@@ -0,0 +1,29 @@
+<?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.ccsdk.parent</groupId>
+ <artifactId>feature-repo-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>features-sliPluginUtils</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>feature</packaging>
+
+ <name>ccsdk-sli-core :: sliPluginUtils :: ${project.artifactId}</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>ccsdk-sliPluginUtils</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/sliPluginUtils/features/pom.xml b/sliPluginUtils/features/pom.xml
index 19d32f7a..4a1f8994 100755
--- a/sliPluginUtils/features/pom.xml
+++ b/sliPluginUtils/features/pom.xml
@@ -1,127 +1,23 @@
<?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">
-
- <artifactId>sliPluginUtils-features</artifactId>
- <packaging>jar</packaging>
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>sliPluginUtils</artifactId>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
- <name>SliPluginUtils Plugin - Features</name>
-
- <dependencies>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sliPluginUtils-provider</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>${commons.lang.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>features-mdsal</artifactId>
- <version>${odl.mdsal.features.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <!-- dependency for opendaylight-karaf-empty for use by testing -->
- <dependency>
- <groupId>org.opendaylight.odlparent</groupId>
- <artifactId>opendaylight-karaf-empty</artifactId>
- <version>${odl.karaf.empty.distro.version}</version>
- <type>zip</type>
- </dependency>
- <dependency>
- <!-- Required for launching the feature tests -->
- <groupId>org.opendaylight.odlparent</groupId>
- <artifactId>features-test</artifactId>
- <version>${odl.commons.opendaylight.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>features-yangtools</artifactId>
- <version>${odl.yangtools.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-
- <build>
- <resources>
- <resource>
- <filtering>true</filtering>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <id>filter</id>
- <goals>
- <goal>resources</goal>
- </goals>
- <phase>generate-resources</phase>
- </execution>
- </executions>
- </plugin>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>sliPluginUtils-features</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
- <!-- launches the feature test, which validates that your karaf feature
- can be installed inside of a karaf container. It doesn't validate that your
- functionality works correctly, just that you have all of the dependent bundles
- defined correctly.
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version>
- <configuration>
- <systemPropertyVariables>
- <karaf.distro.groupId>org.opendaylight.odlparent</karaf.distro.groupId>
- <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
- <karaf.distro.version>${odl.karaf.empty.distro.version}</karaf.distro.version>
- </systemPropertyVariables>
- <dependenciesToScan>
- <dependency>org.opendaylight.yangtools:features-test</dependency>
- </dependenciesToScan>
- </configuration>
- </plugin>
- -->
+ <name>ccsdk-sli-core :: sliPluginUtils :: ${project.artifactId}</name>
- <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/${features.file}</file>
- <type>xml</type>
- <classifier>features</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <modules>
+ <module>features-sliPluginUtils</module>
+ <module>ccsdk-sliPluginUtils</module>
+ </modules>
</project>
diff --git a/sliPluginUtils/features/src/main/resources/features.xml b/sliPluginUtils/features/src/main/resources/features.xml
deleted file mode 100644
index f59cea42..00000000
--- a/sliPluginUtils/features/src/main/resources/features.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ============LICENSE_START=======================================================
- ONAP : CCSDK
- ================================================================================
- 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=========================================================
- -->
-
-
-<features name="sdnc-sliPluginUtils-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
-
- <repository>mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features</repository>
-
-
- <feature name='sdnc-sliPluginUtils' description="sdnc-sliPluginUtils" version='${project.version}'>
- <!-- Most applications will have a dependency on the ODL MD-SAL Broker -->
- <feature version="${odl.mdsal.version}">odl-mdsal-broker</feature>
- <feature>sdnc-sli</feature>
- <bundle>mvn:org.onap.ccsdk.sli.core/sliPluginUtils-provider/${project.version}</bundle>
- </feature>
-
-</features>
diff --git a/sliPluginUtils/installer/pom.xml b/sliPluginUtils/installer/pom.xml
index 736d2220..1c0704af 100755
--- a/sliPluginUtils/installer/pom.xml
+++ b/sliPluginUtils/installer/pom.xml
@@ -1,18 +1,24 @@
<?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>
- <artifactId>sliPluginUtils</artifactId>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
+
+ <groupId>org.onap.ccsdl.sli.core</groupId>
<artifactId>sliPluginUtils-installer</artifactId>
- <name>SLI Plugin Utilities - Karaf Installer</name>
+ <version>0.2.1-SNAPSHOT</version>
<packaging>pom</packaging>
+ <name>ccsdk-sli-core :: sliPluginUtils :: ${project.artifactId}</name>
+
<properties>
- <application.name>sdnc-sliPluginUtils</application.name>
- <features.boot>sdnc-sliPluginUtils</features.boot>
+ <application.name>ccsdk-sliPluginUtils</application.name>
+ <features.boot>${application.name}</features.boot>
<features.repositories>mvn:org.onap.ccsdk.sli.core/sliPluginUtils-features/${project.version}/xml/features</features.repositories>
<include.transitive.dependencies>false</include.transitive.dependencies>
</properties>
@@ -21,10 +27,10 @@
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sliPluginUtils-features</artifactId>
+ <artifactId>${application.name}</artifactId>
<version>${project.version}</version>
- <classifier>features</classifier>
<type>xml</type>
+ <classifier>features</classifier>
<exclusions>
<exclusion>
<groupId>*</groupId>
@@ -134,5 +140,4 @@
</plugins>
</build>
-
</project>
diff --git a/sliPluginUtils/pom.xml b/sliPluginUtils/pom.xml
index 21efb170..45be684f 100755
--- a/sliPluginUtils/pom.xml
+++ b/sliPluginUtils/pom.xml
@@ -1,38 +1,22 @@
<?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/maven-v4_0_0.xsd">
+<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.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
<groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sliPluginUtils</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.2.1-SNAPSHOT</version>
<packaging>pom</packaging>
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>ccsdk-sli-core</artifactId>
- <version>0.2.0-SNAPSHOT</version>
- </parent>
- <name>Service Logic Interface Plugin Utilities</name>
+ <name>ccsdk-sli-core :: sliPluginUtils</name>
<description>A package of static utility functions to be used when developing SLI plugins</description>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>SliPluginUtils-features</artifactId>
- <classifier>features</classifier>
- <type>xml</type>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>SliPluginUtils-provider</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
<modules>
<module>provider</module>
<module>features</module>
diff --git a/sliPluginUtils/provider/pom.xml b/sliPluginUtils/provider/pom.xml
index 61b5e958..0a274edd 100755
--- a/sliPluginUtils/provider/pom.xml
+++ b/sliPluginUtils/provider/pom.xml
@@ -1,17 +1,20 @@
<?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">
-
- <artifactId>sliPluginUtils-provider</artifactId>
- <packaging>bundle</packaging>
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sliPluginUtils</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
- <name>SliPluginUtils Plugin - Provider</name>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>sliPluginUtils-provider</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <name>ccsdk-sli-core :: sliPluginUtils :: ${project.artifactId}</name>
<url>http://maven.apache.org</url>
<properties>
@@ -22,11 +25,10 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
+ <groupId>${project.groupId}</groupId>
<artifactId>sli-common</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
@@ -34,22 +36,18 @@
<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.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.1</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
@@ -68,27 +66,4 @@
<version>1.1</version>
</dependency>
</dependencies>
-
- <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.ccsdk.sli.core.slipluginutils</Bundle-SymbolicName>
- <Export-Package>org.onap.ccsdk.sli.core.slipluginutils</Export-Package>
- <Import-Package>org.onap.ccsdk.sli.core.*,org.osgi.framework.*,org.slf4j.*,java.net.*</Import-Package>
- <Embed-Dependency>*;scope=compile|runtime;artifactId=!sli-common|org.eclipse.osgi|mariadb-java-client|slf4j-api|jcl-over-slf4j</Embed-Dependency>
- <Embed-Transitive>true</Embed-Transitive>
- </instructions>
- </configuration>
- </plugin>
-
- </plugins>
-
- </build>
</project>
diff --git a/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2PropertiesProvider.java b/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2PropertiesProvider.java
index 07c84c66..6802c9a8 100644
--- a/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2PropertiesProvider.java
+++ b/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2PropertiesProvider.java
@@ -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.
@@ -31,193 +31,248 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Optional;
import java.util.Properties;
+import java.util.Vector;
+import org.onap.ccsdk.sli.core.utils.JREFileResolver;
+import org.onap.ccsdk.sli.core.utils.KarafRootFileResolver;
+import org.onap.ccsdk.sli.core.utils.PropertiesFileResolver;
+import org.onap.ccsdk.sli.core.utils.common.CoreDefaultFileResolver;
+import org.onap.ccsdk.sli.core.utils.common.SdncConfigEnvVarFileResolver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Immutable properties container for dme2 properties. Since the initial design decision was made to
- * utilize <code>Properties</code> instead of an OSGi <code>ManagedService</code>, it was decided
- * to make these properties immutable.
+ * Immutable properties container for dme2 properties. Since the initial design
+ * decision was made to utilize <code>Properties</code> instead of an OSGi
+ * <code>ManagedService</code>, it was decided to make these properties
+ * immutable.
*/
public final class Dme2PropertiesProvider {
- private static final Logger LOG = LoggerFactory.getLogger(Dme2PropertiesProvider.class);
-
- /**
- * The name of the environment variable to specify the configuration directory.
- */
- private static final String SDNC_ROOT_DIR_ENV_VAR_KEY = "SDNC_CONFIG_DIR";
-
- /**
- * the dme2 properties file name.
- */
- private static final String DME2_PROPERTIES_FILE_NAME = "dme2.properties";
-
- /**
- * the key for <code>proxyUrl</code>, which represents a CSV list of urls
- */
- static final String PROXY_URL_KEY = "proxyUrl";
-
- /**
- * indicates that proxy urls are separated by commas
- */
- private static final String PROXY_URLS_VALUE_SEPARATOR = ",";
-
- /**
- * the key for <code>aafUserName</code>
- */
- static final String AAF_USERNAME_KEY = "aafUserName";
-
- /**
- * the key for <code>aafPassword</code>
- */
- static final String AAF_PASSWORD_KEY = "aafPassword";
-
- /**
- * the key for <code>envContext</code>
- */
- static final String ENV_CONTEXT_KEY = "envContext";
-
- /**
- * the key for <code>routeOffer</code>
- */
- static final String ROUTE_OFFER_KEY = "routeOffer";
-
- /**
- * the key for <code>commonServiceVersion</code>
- */
- static final String COMMON_SERVICE_VERSION_KEY = "commonServiceVersion";
-
- /**
- * the key for <code>partner</code>
- */
- static final String PARTNER_KEY = "partner";
-
- private Optional<String []> proxyUrls = Optional.empty();
-
- private Optional<String> aafUsername = Optional.empty();
-
- private Optional<String> aafPassword = Optional.empty();
-
- private Optional<String> envContext = Optional.empty();
-
- private Optional<String> routeOffer = Optional.empty();
-
- private Optional<String> commonServiceVersion = Optional.empty();
-
- private Optional<String> partner = Optional.empty();
-
-
- /**
- * Instantiates the properties provider, which involves loading the appropriate properties for dme2.
- */
- public Dme2PropertiesProvider() {
- this(getDme2Path(SDNC_ROOT_DIR_ENV_VAR_KEY, DME2_PROPERTIES_FILE_NAME).toString());
- }
-
- /**
- * Instantiates the properties provider, which involves loading the appropriate properties for dme2.
- *
- * @param dme2Path location of the dme2.properties file
- */
- @VisibleForTesting
- Dme2PropertiesProvider(final String dme2Path) {
- final Properties properties;
- try {
- properties = getProperties(dme2Path);
- this.proxyUrls = getProxyUrls(properties);
- this.aafUsername = getAafUsername(properties);
- this.aafPassword = getAafPassword(properties);
- this.envContext = getEnvContext(properties);
- this.routeOffer = getRouteOffer(properties);
- this.commonServiceVersion = getCommonServiceVersion(properties);
- this.partner = getPartner(properties);
- } catch (final FileNotFoundException e) {
- LOG.error("dme2.properties file could not be found at path: {}", dme2Path, e);
- } catch (final IOException e) {
- LOG.error("fatal error reading dme2.properties at path: {}", dme2Path, e);
- }
- }
-
- private static Path getDme2Path(final String sdncRootDirectory, final String dme2Filename) {
- return Paths.get(sdncRootDirectory, dme2Filename);
- }
-
- private static Properties getProperties(final String dme2Path) throws IOException {
- final File dme2File = new File(dme2Path);
- final Properties properties = new Properties();
- properties.load(new FileReader(dme2File));
- return properties;
- }
-
- private String getProxyUrl(final Properties properties) {
- return properties.getProperty(PROXY_URL_KEY);
- }
-
- private Optional<String []> getProxyUrls(final Properties properties) {
- final String proxyUrlsValue = getProxyUrl(properties);
- if (!Strings.isNullOrEmpty(proxyUrlsValue)) {
- return Optional.ofNullable(proxyUrlsValue.split(PROXY_URLS_VALUE_SEPARATOR));
- }
- return Optional.empty();
- }
-
- public Optional<String []> getProxyUrls() {
- return this.proxyUrls;
- }
-
- private Optional<String> getAafUsername(final Properties properties) {
- final String aafUsernameValue = properties.getProperty(AAF_USERNAME_KEY);
- return Optional.ofNullable(aafUsernameValue);
- }
-
- Optional<String> getAafUsername() {
- return this.aafUsername;
- }
-
- private Optional<String> getAafPassword(final Properties properties) {
- final String aafPassword = properties.getProperty(AAF_PASSWORD_KEY);
- return Optional.ofNullable(aafPassword);
- }
-
- Optional<String> getAafPassword() {
- return this.aafPassword;
- }
-
- private Optional<String> getEnvContext(final Properties properties) {
- final String envContext = properties.getProperty(ENV_CONTEXT_KEY);
- return Optional.ofNullable(envContext);
- }
-
- Optional<String> getEnvContext() {
- return this.envContext;
- }
-
- private Optional<String> getRouteOffer(final Properties properties) {
- final String routeOffer = properties.getProperty(ROUTE_OFFER_KEY);
- return Optional.ofNullable(routeOffer);
- }
-
- Optional<String> getRouteOffer() {
- return this.routeOffer;
- }
-
- private Optional<String> getCommonServiceVersion(final Properties properties) {
- final String commonServiceVersion = properties.getProperty(COMMON_SERVICE_VERSION_KEY);
- return Optional.ofNullable(commonServiceVersion);
- }
-
- Optional<String> getCommonServiceVersion() {
- return this.commonServiceVersion;
- }
-
- private Optional<String> getPartner(final Properties properties) {
- final String partner = properties.getProperty(PARTNER_KEY);
- return Optional.ofNullable(partner);
- }
-
- Optional<String> getPartner() {
- return this.partner;
- }
+ private static final Logger LOG = LoggerFactory.getLogger(Dme2PropertiesProvider.class);
+
+ /**
+ * The name of the environment variable to specify the configuration directory.
+ */
+ private static final String SDNC_ROOT_DIR_ENV_VAR_KEY = "SDNC_CONFIG_DIR";
+
+ /**
+ * the dme2 properties file name.
+ */
+ private static final String DME2_PROPERTIES_FILE_NAME = "dme2.properties";
+
+ /**
+ * the key for <code>proxyUrl</code>, which represents a CSV list of urls
+ */
+ static final String PROXY_URL_KEY = "proxyUrl";
+
+ /**
+ * indicates that proxy urls are separated by commas
+ */
+ private static final String PROXY_URLS_VALUE_SEPARATOR = ",";
+
+ /**
+ * the key for <code>aafUserName</code>
+ */
+ static final String AAF_USERNAME_KEY = "aafUserName";
+
+ /**
+ * the key for <code>aafPassword</code>
+ */
+ static final String AAF_PASSWORD_KEY = "aafPassword";
+
+ /**
+ * the key for <code>envContext</code>
+ */
+ static final String ENV_CONTEXT_KEY = "envContext";
+
+ /**
+ * the key for <code>routeOffer</code>
+ */
+ static final String ROUTE_OFFER_KEY = "routeOffer";
+
+ /**
+ * the key for <code>commonServiceVersion</code>
+ */
+ static final String COMMON_SERVICE_VERSION_KEY = "commonServiceVersion";
+
+ /**
+ * the key for <code>partner</code>
+ */
+ static final String PARTNER_KEY = "partner";
+
+ private Optional<String[]> proxyUrls = Optional.empty();
+
+ private Optional<String> aafUsername = Optional.empty();
+
+ private Optional<String> aafPassword = Optional.empty();
+
+ private Optional<String> envContext = Optional.empty();
+
+ private Optional<String> routeOffer = Optional.empty();
+
+ private Optional<String> commonServiceVersion = Optional.empty();
+
+ private Optional<String> partner = Optional.empty();
+
+ /**
+ * A prioritized list of strategies for resolving dme2 properties files.
+ */
+ private Vector<PropertiesFileResolver> dme2PropertiesFileResolvers = new Vector<>();
+
+ /**
+ * Instantiates the properties provider, which involves loading the appropriate
+ * properties for dme2.
+ */
+ public Dme2PropertiesProvider() {
+ this(DME2_PROPERTIES_FILE_NAME);
+ }
+
+ /**
+ * Instantiates the properties provider, which involves loading the appropriate
+ * properties for dme2.
+ *
+ * @param dme2Path
+ * location of the dme2.properties file
+ */
+ @VisibleForTesting
+ Dme2PropertiesProvider(final String dme2FileName) {
+ dme2PropertiesFileResolvers
+ .add(new SdncConfigEnvVarFileResolver("Using property file (1) from environment variable"));
+ dme2PropertiesFileResolvers.add(new CoreDefaultFileResolver("Using property file (2) from default directory"));
+
+ dme2PropertiesFileResolvers
+ .add(new JREFileResolver("Using property file (3) from JRE argument", Dme2PropertiesProvider.class));
+ dme2PropertiesFileResolvers.add(new KarafRootFileResolver("Using property file (4) from karaf root", this));
+
+ File dme2File = getDme2File(dme2FileName);
+
+ init(dme2File);
+ }
+
+ private void init(final File dme2Path) {
+ final Properties properties;
+ try {
+ properties = getProperties(dme2Path);
+ this.proxyUrls = getProxyUrls(properties);
+ this.aafUsername = getAafUsername(properties);
+ this.aafPassword = getAafPassword(properties);
+ this.envContext = getEnvContext(properties);
+ this.routeOffer = getRouteOffer(properties);
+ this.commonServiceVersion = getCommonServiceVersion(properties);
+ this.partner = getPartner(properties);
+ } catch (final FileNotFoundException e) {
+
+ LOG.error("dme2.properties file could not be found at path: {}", dme2Path, e);
+ } catch (final IOException e) {
+ LOG.error("fatal error reading dme2.properties at path: {}", dme2Path, e);
+ }
+ }
+
+ /**
+ * Reports the method chosen for properties resolution to the
+ * <code>Logger</code>.
+ *
+ * @param message
+ * Some user friendly message
+ * @param fileOptional
+ * The file location of the chosen properties file
+ * @return the file location of the chosen properties file
+ */
+ private static File reportSuccess(final String message, final Optional<File> fileOptional) {
+ if (fileOptional.isPresent()) {
+ final File file = fileOptional.get();
+ LOG.info("{} {}", message, file.getPath());
+ return file;
+ }
+ return null;
+ }
+
+ private File getDme2File(final String dme2Filename) {
+
+ for (final PropertiesFileResolver dblibPropertiesFileResolver : dme2PropertiesFileResolvers) {
+ final Optional<File> fileOptional = dblibPropertiesFileResolver.resolveFile(dme2Filename);
+ if (fileOptional.isPresent()) {
+ return reportSuccess(dblibPropertiesFileResolver.getSuccessfulResolutionMessage(), fileOptional);
+ }
+ }
+ return (new File(dme2Filename));
+ }
+
+ private static Properties getProperties(final File dme2File) throws IOException {
+
+ final Properties properties = new Properties();
+ properties.load(new FileReader(dme2File));
+ return properties;
+ }
+
+ private String getProxyUrl(final Properties properties) {
+ return properties.getProperty(PROXY_URL_KEY);
+ }
+
+ private Optional<String[]> getProxyUrls(final Properties properties) {
+ final String proxyUrlsValue = getProxyUrl(properties);
+ if (!Strings.isNullOrEmpty(proxyUrlsValue)) {
+ return Optional.ofNullable(proxyUrlsValue.split(PROXY_URLS_VALUE_SEPARATOR));
+ }
+ return Optional.empty();
+ }
+
+ public Optional<String[]> getProxyUrls() {
+ return this.proxyUrls;
+ }
+
+ private Optional<String> getAafUsername(final Properties properties) {
+ final String aafUsernameValue = properties.getProperty(AAF_USERNAME_KEY);
+ return Optional.ofNullable(aafUsernameValue);
+ }
+
+ Optional<String> getAafUsername() {
+ return this.aafUsername;
+ }
+
+ private Optional<String> getAafPassword(final Properties properties) {
+ final String aafPassword = properties.getProperty(AAF_PASSWORD_KEY);
+ return Optional.ofNullable(aafPassword);
+ }
+
+ Optional<String> getAafPassword() {
+ return this.aafPassword;
+ }
+
+ private Optional<String> getEnvContext(final Properties properties) {
+ final String envContext = properties.getProperty(ENV_CONTEXT_KEY);
+ return Optional.ofNullable(envContext);
+ }
+
+ Optional<String> getEnvContext() {
+ return this.envContext;
+ }
+
+ private Optional<String> getRouteOffer(final Properties properties) {
+ final String routeOffer = properties.getProperty(ROUTE_OFFER_KEY);
+ return Optional.ofNullable(routeOffer);
+ }
+
+ Optional<String> getRouteOffer() {
+ return this.routeOffer;
+ }
+
+ private Optional<String> getCommonServiceVersion(final Properties properties) {
+ final String commonServiceVersion = properties.getProperty(COMMON_SERVICE_VERSION_KEY);
+ return Optional.ofNullable(commonServiceVersion);
+ }
+
+ Optional<String> getCommonServiceVersion() {
+ return this.commonServiceVersion;
+ }
+
+ private Optional<String> getPartner(final Properties properties) {
+ final String partner = properties.getProperty(PARTNER_KEY);
+ return Optional.ofNullable(partner);
+ }
+
+ Optional<String> getPartner() {
+ return this.partner;
+ }
}
diff --git a/sliPluginUtils/provider/src/main/resources/dme2.properties b/sliPluginUtils/provider/src/main/resources/dme2.properties
new file mode 100644
index 00000000..37344844
--- /dev/null
+++ b/sliPluginUtils/provider/src/main/resources/dme2.properties
@@ -0,0 +1,7 @@
+aafUserName=user@sample.com
+aafPassword=fake
+envContext=UAT
+routeOffer=UAT
+proxyUrl=http://sample.com:25055,http://sample.com:25055
+commonServiceVersion=1702.0
+partner= \ No newline at end of file
diff --git a/sliapi/features/ccsdk-sliapi/pom.xml b/sliapi/features/ccsdk-sliapi/pom.xml
new file mode 100644
index 00000000..be4025b4
--- /dev/null
+++ b/sliapi/features/ccsdk-sliapi/pom.xml
@@ -0,0 +1,60 @@
+<?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.ccsdk.parent</groupId>
+ <artifactId>single-feature-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>ccsdk-sliapi</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>feature</packaging>
+
+ <name>ccsdk-sli-core :: sliapi :: ${project.artifactId}</name>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>mdsal-model-artifacts</artifactId>
+ <version>0.11.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>1.6.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>odl-mdsal-broker</artifactId>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>ccsdk-sli</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>sliapi-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/sliapi/features/features-sliapi/pom.xml b/sliapi/features/features-sliapi/pom.xml
new file mode 100644
index 00000000..f3481cba
--- /dev/null
+++ b/sliapi/features/features-sliapi/pom.xml
@@ -0,0 +1,29 @@
+<?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.ccsdk.parent</groupId>
+ <artifactId>feature-repo-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>features-sliapi</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>feature</packaging>
+
+ <name>ccsdk-sli-core :: sliapi :: ${project.artifactId}</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>ccsdk-sliapi</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/sliapi/features/pom.xml b/sliapi/features/pom.xml
index 78bfb89a..17fa8fb4 100755
--- a/sliapi/features/pom.xml
+++ b/sliapi/features/pom.xml
@@ -1,134 +1,23 @@
<?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>
- <artifactId>sliapi</artifactId>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
- <artifactId>sliapi-features</artifactId>
-
- <packaging>jar</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sliapi-model</artifactId>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sliapi-provider</artifactId>
- <classifier>config</classifier>
- <type>xml</type>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sliapi-provider</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>features-mdsal</artifactId>
- <version>${odl.mdsal.features.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
-
- <scope>runtime</scope>
- </dependency>
-
-
-
- <!-- dependency for opendaylight-karaf-empty for use by testing -->
- <dependency>
- <groupId>org.opendaylight.odlparent</groupId>
- <artifactId>opendaylight-karaf-empty</artifactId>
- <version>${odl.karaf.empty.distro.version}</version>
- <type>zip</type>
- </dependency>
-
-
- <dependency>
- <!-- Required for launching the feature tests-->
- <groupId>org.opendaylight.odlparent</groupId>
- <artifactId>features-test</artifactId>
- <scope>test</scope>
- <version>${odl.commons.opendaylight.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>features-yangtools</artifactId>
- <version>${odl.yangtools.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>sliapi-feature-aggregator</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
- <build>
- <resources>
- <resource>
- <filtering>true</filtering>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <id>filter</id>
- <goals>
- <goal>resources</goal>
- </goals>
- <phase>generate-resources</phase>
- </execution>
- </executions>
- </plugin>
- <!-- launches the feature test, which validates that your karaf feature can
- be installed inside of a karaf container. It doesn't validate that your
- functionality works correctly, just that you have all of the dependent
- bundles defined correctly.
- <plugin>
+ <name>ccsdk-sli-core :: sliapi :: ${project.artifactId}</name>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version>
- <configuration>
- <systemPropertyVariables>
- <karaf.distro.groupId>org.opendaylight.odlparent</karaf.distro.groupId>
- <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
- <karaf.distro.version>${odl.karaf.empty.distro.version}</karaf.distro.version>
- </systemPropertyVariables>
- <dependenciesToScan>
- <dependency>org.opendaylight.yangtools:features-test</dependency>
- </dependenciesToScan>
- </configuration>
- </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/${features.file}</file>
- <type>xml</type>
- <classifier>features</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <modules>
+ <module>features-sliapi</module>
+ <module>ccsdk-sliapi</module>
+ </modules>
</project>
diff --git a/sliapi/features/src/main/resources/features.xml b/sliapi/features/src/main/resources/features.xml
deleted file mode 100644
index c5df348f..00000000
--- a/sliapi/features/src/main/resources/features.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ============LICENSE_START=======================================================
- ONAP : CCSDK
- ================================================================================
- 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=========================================================
- -->
-
-
-<features name="sdnc-sliapi-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
-
- <repository>mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features</repository>
-
- <feature name='sdnc-sliapi' description="sdnc-sliapi" version='${project.version}'>
- <!-- Most applications will have a dependency on the ODL MD-SAL Broker -->
- <feature version="${odl.mdsal.version}">odl-mdsal-broker</feature>
- <feature version="${sdnctl.sli.version}">sdnc-sli</feature>
- <bundle>mvn:org.onap.ccsdk.sli.core/sliapi-model/${project.version}</bundle>
- <bundle>mvn:org.onap.ccsdk.sli.core/sliapi-provider/${project.version}</bundle>
- <configfile finalname="etc/opendaylight/karaf/200-sliapiprovider.xml">mvn:org.onap.ccsdk.sli.core/sliapi-provider/${project.version}/xml/config</configfile>
- </feature>
-
-</features>
diff --git a/sliapi/installer/pom.xml b/sliapi/installer/pom.xml
index cddcf6dd..290524e3 100755
--- a/sliapi/installer/pom.xml
+++ b/sliapi/installer/pom.xml
@@ -1,18 +1,25 @@
<?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>
- <artifactId>sliapi</artifactId>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sliapi-installer</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
<packaging>pom</packaging>
+ <name>ccsdk-sli-core :: sliapi :: ${project.artifactId}</name>
+
<properties>
- <application.name>sdnc-sliapi</application.name>
- <features.boot>sdnc-sliapi</features.boot>
- <features.repositories>mvn:org.onap.ccsdk.sli.core/sliapi-features/${project.version}/xml/features</features.repositories>
+ <application.name>ccsdk-sliapi</application.name>
+ <features.boot>${application.name}</features.boot>
+ <features.repositories>mvn:org.onap.ccsdk.sli.core/${features.boot}/${project.version}/xml/features</features.repositories>
<include.transitive.dependencies>false</include.transitive.dependencies>
</properties>
@@ -20,10 +27,10 @@
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sliapi-features</artifactId>
+ <artifactId>${application.name}</artifactId>
<version>${project.version}</version>
- <classifier>features</classifier>
<type>xml</type>
+ <classifier>features</classifier>
<exclusions>
<exclusion>
<groupId>*</groupId>
@@ -133,5 +140,4 @@
</plugins>
</build>
-
</project>
diff --git a/sliapi/installer/src/assembly/assemble_mvnrepo_zip.xml b/sliapi/installer/src/assembly/assemble_mvnrepo_zip.xml
index e22c6f56..5f3e3af3 100644
--- a/sliapi/installer/src/assembly/assemble_mvnrepo_zip.xml
+++ b/sliapi/installer/src/assembly/assemble_mvnrepo_zip.xml
@@ -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.
@@ -44,12 +44,6 @@
</fileSet>
</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>
- </files>
</assembly>
diff --git a/sliapi/model/pom.xml b/sliapi/model/pom.xml
index 4ea88516..bbdcea05 100755
--- a/sliapi/model/pom.xml
+++ b/sliapi/model/pom.xml
@@ -1,89 +1,29 @@
<?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>
- <artifactId>sliapi</artifactId>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sliapi-model</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
<packaging>bundle</packaging>
- <build>
+ <name>ccsdk-sli-core :: sliapi :: ${project.artifactId}</name>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Import-Package>*</Import-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-maven-plugin</artifactId>
- <version>${odl.yangtools.yang.maven.plugin.version}</version>
- <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.netconf</groupId>
- <artifactId>sal-rest-docgen-maven</artifactId>
- <version>${odl.restconf.version}</version>
- <type>jar</type>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <goals>
- <goal>generate-sources</goal>
- </goals>
- <configuration>
- <yangFilesRootDir>${yang.file.directory}</yangFilesRootDir>
- <codeGenerators>
- <generator>
- <codeGeneratorClass>org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
- <outputBaseDir>${salGeneratorPath}</outputBaseDir>
- </generator>
- <generator>
- <codeGeneratorClass>org.opendaylight.netconf.sal.rest.doc.maven.StaticDocGenerator</codeGeneratorClass>
- <outputBaseDir>target/swagger</outputBaseDir>
- </generator>
- </codeGenerators>
- <inspectDependencies>true</inspectDependencies>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
<dependencies>
<dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>yang-binding</artifactId>
- <version>${odl.mdsal.yang.binding.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-common</artifactId>
- <version>${odl.yangtools.version}</version>
- </dependency>
- <dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>ietf-inet-types</artifactId>
- <version>${odl.ietf-inet-types.version}</version>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>ietf-yang-types</artifactId>
- <version>${odl.ietf-yang-types.version}</version>
</dependency>
</dependencies>
</project>
diff --git a/sliapi/pom.xml b/sliapi/pom.xml
index a08d8fcb..46057da0 100755
--- a/sliapi/pom.xml
+++ b/sliapi/pom.xml
@@ -1,56 +1,20 @@
<?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/maven-v4_0_0.xsd">
+<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.ccsdk.sli.core</groupId>
- <artifactId>ccsdk-sli-core</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
- <packaging>pom</packaging>
<groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sliapi</artifactId>
- <version>0.2.0-SNAPSHOT</version>
-
- <properties>
- <feature-name>sliapi</feature-name>
- </properties>
-
- <dependencyManagement>
-
- <dependencies>
-
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sliapi-features</artifactId>
- <classifier>features</classifier>
- <type>xml</type>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sliapi-model</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sliapi-provider</artifactId>
- <version>${project.version}</version>
- <classifier>config</classifier>
- <type>xml</type>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sliapi-provider</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
- </dependencyManagement>
+ <name>ccsdk-sli-core :: sliapi</name>
<modules>
<module>model</module>
@@ -58,4 +22,8 @@
<module>provider</module>
<module>installer</module>
</modules>
+
+ <properties>
+ <feature-name>sliapi</feature-name>
+ </properties>
</project>
diff --git a/sliapi/provider/pom.xml b/sliapi/provider/pom.xml
index 5db9671d..cb4dfc89 100755
--- a/sliapi/provider/pom.xml
+++ b/sliapi/provider/pom.xml
@@ -1,125 +1,53 @@
<?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>
- <artifactId>sliapi</artifactId>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sliapi-provider</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
<packaging>bundle</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Export-Package>org.opendaylight.controller.config.yang.config.sliapi.impl</Export-Package>
- <Import-Package>*</Import-Package>
- </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.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
- -->
- <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/sliapi-provider.xml</file>
- <type>xml</type>
- <classifier>config</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <name>ccsdk-sli-core :: sliapi :: ${project.artifactId}</name>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>1.6.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
<dependencies>
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>sliapi-model</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>config-api</artifactId>
- <version>${odl.controller.config.api.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-binding-config</artifactId>
- <version>${odl.mdsal.version}</version>
</dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-binding-api</artifactId>
- <version>${odl.mdsal.version}</version>
</dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-common-util</artifactId>
- <version>${odl.mdsal.version}</version>
</dependency>
@@ -136,12 +64,10 @@
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-core-api</artifactId>
- <version>${odl.mdsal.version}</version>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-data-impl</artifactId>
- <version>${odl.yangtools.version}</version>
</dependency>
</dependencies>
</project>
diff --git a/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/sliapiProvider.java b/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/sliapiProvider.java
index 82e66008..c3ad4ed6 100644
--- a/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/sliapiProvider.java
+++ b/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/sliapiProvider.java
@@ -31,6 +31,7 @@ import java.util.Properties;
import java.util.concurrent.Future;
import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService;
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.WriteTransaction;
import org.opendaylight.controller.md.sal.binding.impl.AbstractForwardedDataBroker;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -118,7 +119,7 @@ public class sliapiProvider implements AutoCloseable, SLIAPIService{
protected DataBroker dataBroker;
protected DOMDataBroker domDataBroker;
- protected NotificationProviderService notificationService;
+ protected NotificationPublishService notificationService;
protected RpcProviderRegistry rpcRegistry;
protected BindingAwareBroker.RpcRegistration<SLIAPIService> rpcRegistration;
@@ -142,16 +143,24 @@ public class sliapiProvider implements AutoCloseable, SLIAPIService{
}
- public sliapiProvider() {
+ public sliapiProvider(
+ DataBroker dataBroker,
+ NotificationPublishService notificationPublishService,
+ RpcProviderRegistry rpcProviderRegistry) {
this.LOG.info( "Creating provider for " + appName );
+ this.dataBroker = dataBroker;
+ this.notificationService = notificationPublishService;
+ this.rpcRegistry = rpcProviderRegistry;
+ initialize();
}
+
+
public void initialize(){
LOG.info( "Initializing provider for " + appName );
//initialization code goes here.
sdncStatusFile = System.getenv(SDNC_STATUS_FILE);
LOG.info( "SDNC STATUS FILE = " + sdncStatusFile );
- rpcRegistration = rpcRegistry.addRpcImplementation(SLIAPIService.class, this);
LOG.info( "Initialization complete for " + appName );
}
@@ -179,7 +188,7 @@ public class sliapiProvider implements AutoCloseable, SLIAPIService{
}
public void setNotificationService(
- NotificationProviderService notificationService) {
+ NotificationPublishService notificationService) {
this.notificationService = notificationService;
if( LOG.isDebugEnabled() ){
LOG.debug( "Notification Service set to " + (notificationService==null?"null":"non-null") + "." );
diff --git a/sliapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/core/sliapi/provider/impl/rev140523/SliapiProviderModule.java b/sliapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/core/sliapi/provider/impl/rev140523/SliapiProviderModule.java
deleted file mode 100644
index e7444e31..00000000
--- a/sliapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/core/sliapi/provider/impl/rev140523/SliapiProviderModule.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP : CCSDK
- * ================================================================================
- * 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.ccsdk.sli.core.sliapi.provider.impl.rev140523;
-
-import org.onap.ccsdk.sli.core.sliapi.sliapiProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class SliapiProviderModule extends org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.provider.impl.rev140523.AbstractSliapiProviderModule {
- private final Logger LOG = LoggerFactory.getLogger( SliapiProviderModule.class );
-
- public SliapiProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
- super(identifier, dependencyResolver);
- }
-
- public SliapiProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.provider.impl.rev140523.SliapiProviderModule 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() {
-
- LOG.info("Calling SliapiProviderModule.createInstance");
- final sliapiProvider provider = new sliapiProvider();
- provider.setDataBroker( getDataBrokerDependency() );
- provider.setNotificationService( getNotificationServiceDependency() );
- provider.setRpcRegistry( getRpcRegistryDependency() );
- provider.initialize();
- return new AutoCloseable() {
-
- @Override
- public void close() throws Exception {
- //TODO: CLOSE ANY REGISTRATION OBJECTS CREATED USING ABOVE BROKER/NOTIFICATION
- //SERVIE/RPC REGISTRY
- provider.close();
- }
- };
- }
-
-}
diff --git a/sliapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/core/sliapi/provider/impl/rev140523/SliapiProviderModuleFactory.java b/sliapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/core/sliapi/provider/impl/rev140523/SliapiProviderModuleFactory.java
deleted file mode 100644
index 6454d17c..00000000
--- a/sliapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/core/sliapi/provider/impl/rev140523/SliapiProviderModuleFactory.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP : CCSDK
- * ================================================================================
- * 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: sliapi-provider-impl yang module local name: sliapi-provider-impl
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Thu Aug 03 16:10:18 EDT 2017
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.provider.impl.rev140523;
-public class SliapiProviderModuleFactory extends org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.provider.impl.rev140523.AbstractSliapiProviderModuleFactory {
-
-}
diff --git a/sliapi/provider/src/main/resources/initial/sliapi-provider.xml b/sliapi/provider/src/main/resources/initial/sliapi-provider.xml
deleted file mode 100644
index 47d31d0a..00000000
--- a/sliapi/provider/src/main/resources/initial/sliapi-provider.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ============LICENSE_START=======================================================
- ONAP : CCSDK
- ================================================================================
- 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:onap:ccsdk:sli:core:sliapi:provider:impl">
- prefix:sliapi-provider-impl
- </type>
- <name>sliapi-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:ccsdk:sli:core:sliapi:provider:impl?module=sliapi-provider-impl&amp;revision=2014-05-23</capability>
- </required-capabilities>
-
-</snapshot>
diff --git a/sliapi/provider/src/main/resources/org/opendaylight/blueprint/sliapi-blueprint.xml b/sliapi/provider/src/main/resources/org/opendaylight/blueprint/sliapi-blueprint.xml
new file mode 100644
index 00000000..761b014a
--- /dev/null
+++ b/sliapi/provider/src/main/resources/org/opendaylight/blueprint/sliapi-blueprint.xml
@@ -0,0 +1,28 @@
+<?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" />
+
+
+ <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.ccsdk.sli.core.sliapi.sliapiProvider">
+ <argument ref="dataBroker" />
+ <argument ref="notificationService" />
+ <argument ref="rpcRegistry" />
+
+ </bean>
+</blueprint> \ No newline at end of file
diff --git a/utils/features/features-util/pom.xml b/utils/features/features-util/pom.xml
new file mode 100644
index 00000000..9a4cd43c
--- /dev/null
+++ b/utils/features/features-util/pom.xml
@@ -0,0 +1,29 @@
+<?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.ccsdk.parent</groupId>
+ <artifactId>feature-repo-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>features-util</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>feature</packaging>
+
+ <name>ccsdk-sli-core :: utils :: ${project.artifactId}</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>ccsdk-slicore-utils</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/utils/features/features3-util/pom.xml b/utils/features/features3-util/pom.xml
new file mode 100755
index 00000000..5cc0d899
--- /dev/null
+++ b/utils/features/features3-util/pom.xml
@@ -0,0 +1,141 @@
+<?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>
+ <artifactId>utils</artifactId>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <version>0.2.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>utils-features</artifactId>
+ <name>ccsdk-sli-core :: utils :: ${project.artifactId}</name>
+ <name>DBLIB Adaptor - Features</name>
+
+ <packaging>jar</packaging>
+
+ <dependencies>
+
+
+ <dependency>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>utils-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>${commons.lang.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>features-mdsal</artifactId>
+ <version>${odl.mdsal.features.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-jdbc</artifactId>
+ <version>${tomcat-jdbc.version}</version>
+ </dependency>
+
+ <!-- dependency for opendaylight-karaf-empty for use by testing -->
+ <dependency>
+ <groupId>org.opendaylight.odlparent</groupId>
+ <artifactId>opendaylight-karaf-empty</artifactId>
+ <version>${odl.karaf.empty.distro.version}</version>
+ <type>zip</type>
+ </dependency>
+
+ <dependency>
+ <!-- Required for launching the feature tests -->
+ <groupId>org.opendaylight.odlparent</groupId>
+ <artifactId>features-test</artifactId>
+ <version>${odl.commons.opendaylight.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>features-yangtools</artifactId>
+ <version>${odl.yangtools.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <filtering>true</filtering>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>filter</id>
+ <goals>
+ <goal>resources</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- launches the feature test, which validates that your karaf feature
+ can be installed inside of a karaf container. It doesn't validate that your
+ functionality works correctly, just that you have all of the dependent bundles
+ defined correctly.
+ <plugin>
+
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.16</version>
+ <configuration>
+ <systemPropertyVariables>
+ <karaf.distro.groupId>org.opendaylight.odlparent</karaf.distro.groupId>
+ <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
+ <karaf.distro.version>${odl.karaf.empty.distro.version}</karaf.distro.version>
+ </systemPropertyVariables>
+ <dependenciesToScan>
+ <dependency>org.opendaylight.yangtools:features-test</dependency>
+ </dependenciesToScan>
+ </configuration>
+ </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/${features.file}</file>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/utils/features/src/main/resources/features.xml b/utils/features/features3-util/src/main/resources/features.xml
index 547832ba..547832ba 100755
--- a/utils/features/src/main/resources/features.xml
+++ b/utils/features/features3-util/src/main/resources/features.xml
diff --git a/utils/features/pom.xml b/utils/features/pom.xml
index be6227d7..8bc1cd8a 100755
--- a/utils/features/pom.xml
+++ b/utils/features/pom.xml
@@ -1,138 +1,22 @@
<?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>
- <artifactId>utils</artifactId>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <version>0.2.0-SNAPSHOT</version>
- </parent>
- <artifactId>utils-features</artifactId>
- <name>DBLIB Adaptor - Features</name>
+ <modelVersion>4.0.0</modelVersion>
- <packaging>jar</packaging>
+ <parent>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
- <dependencies>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>utils-features-aggregator</artifactId>
+ <packaging>pom</packaging>
+ <name>ccsdk-sli-core :: utils :: ${project.artifactId}</name>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>utils-provider</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>${commons.lang.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>features-mdsal</artifactId>
- <version>${odl.mdsal.features.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
-
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>tomcat-jdbc</artifactId>
- <version>${tomcat-jdbc.version}</version>
- </dependency>
-
- <!-- dependency for opendaylight-karaf-empty for use by testing -->
- <dependency>
- <groupId>org.opendaylight.odlparent</groupId>
- <artifactId>opendaylight-karaf-empty</artifactId>
- <version>${odl.karaf.empty.distro.version}</version>
- <type>zip</type>
- </dependency>
-
- <dependency>
- <!-- Required for launching the feature tests -->
- <groupId>org.opendaylight.odlparent</groupId>
- <artifactId>features-test</artifactId>
- <version>${odl.commons.opendaylight.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>features-yangtools</artifactId>
- <version>${odl.yangtools.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-
- <build>
- <resources>
- <resource>
- <filtering>true</filtering>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <id>filter</id>
- <goals>
- <goal>resources</goal>
- </goals>
- <phase>generate-resources</phase>
- </execution>
- </executions>
- </plugin>
- <!-- launches the feature test, which validates that your karaf feature
- can be installed inside of a karaf container. It doesn't validate that your
- functionality works correctly, just that you have all of the dependent bundles
- defined correctly.
- <plugin>
-
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version>
- <configuration>
- <systemPropertyVariables>
- <karaf.distro.groupId>org.opendaylight.odlparent</karaf.distro.groupId>
- <karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
- <karaf.distro.version>${odl.karaf.empty.distro.version}</karaf.distro.version>
- </systemPropertyVariables>
- <dependenciesToScan>
- <dependency>org.opendaylight.yangtools:features-test</dependency>
- </dependenciesToScan>
- </configuration>
- </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/${features.file}</file>
- <type>xml</type>
- <classifier>features</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <modules>
+ <module>features-util</module>
+ <module>sdnc-slicore-utils</module>
+ </modules>
</project>
diff --git a/utils/features/sdnc-slicore-utils/pom.xml b/utils/features/sdnc-slicore-utils/pom.xml
new file mode 100644
index 00000000..85c81ff6
--- /dev/null
+++ b/utils/features/sdnc-slicore-utils/pom.xml
@@ -0,0 +1,52 @@
+<?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.ccsdk.parent</groupId>
+ <artifactId>single-feature-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>ccsdk-slicore-utils</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>feature</packaging>
+
+ <name>ccsdk-sli-core :: utils :: ${project.artifactId}</name>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>mdsal-model-artifacts</artifactId>
+ <version>0.11.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>1.6.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>odl-mdsal-broker</artifactId>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>utils-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/utils/installer/pom.xml b/utils/installer/pom.xml
index df7fc0de..c19ac8c6 100755
--- a/utils/installer/pom.xml
+++ b/utils/installer/pom.xml
@@ -1,19 +1,25 @@
<?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>
- <artifactId>utils</artifactId>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
+
+ <groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>utils-installer</artifactId>
- <name>SLI core utils - Karaf Installer</name>
+ <version>0.2.1-SNAPSHOT</version>
<packaging>pom</packaging>
+ <name>ccsdk-sli-core :: utils :: ${project.artifactId}</name>
+
<properties>
- <application.name>sdnc-slicore-utils</application.name>
- <features.boot>sdnc-slicore-utils</features.boot>
- <features.repositories>mvn:org.onap.ccsdk.sli.core/utils-features/${project.version}/xml/features</features.repositories>
+ <application.name>ccsdk-slicore-utils</application.name>
+ <features.boot>${application.name}</features.boot>
+ <features.repositories>mvn:org.onap.ccsdk.sli.core/${features.boot}/${project.version}/xml/features</features.repositories>
<include.transitive.dependencies>false</include.transitive.dependencies>
</properties>
@@ -21,10 +27,10 @@
<dependency>
<groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>utils-features</artifactId>
+ <artifactId>${application.name}</artifactId>
<version>${project.version}</version>
- <classifier>features</classifier>
<type>xml</type>
+ <classifier>features</classifier>
<exclusions>
<exclusion>
<groupId>*</groupId>
@@ -134,5 +140,4 @@
</plugins>
</build>
-
</project>
diff --git a/utils/pom.xml b/utils/pom.xml
index 17a0f6b6..cd342f77 100755
--- a/utils/pom.xml
+++ b/utils/pom.xml
@@ -1,77 +1,26 @@
<?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/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>ccsdk-sli-core</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+<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.ccsdk.parent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>utils</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
- <modelVersion>4.0.0</modelVersion>
- <packaging>pom</packaging>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>utils</artifactId>
-
-
- <name>SLI Utils</name>
- <description>Utilities used across sli-core</description>
-
- <version>0.2.0-SNAPSHOT</version>
-
- <build>
-
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>${maven.compile.plugin.version}</version>
- <configuration>
- <source>${java.version.source}</source>
- <target>${java.version.target}</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.10</version>
-
- <executions>
- <execution>
- <id>aggregate</id>
- <goals>
- <goal>aggregate</goal>
- </goals>
- <phase>site</phase>
-
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.1.1</version>
- <executions>
- <execution>
- <id>bundle-sources</id>
- <phase>package</phase>
- <goals>
- <!-- produce source artifact for main project sources -->
- <goal>jar-no-fork</goal>
-
- <!-- produce source artifact for project test sources -->
- <goal>test-jar-no-fork</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
- </pluginManagement>
- </build>
- <organization>
- <name>AT&amp;T</name>
+ <name>ccsdk-sli-core :: utils</name>
+ <description>Utilities used across sli-core</description>
+ <organization>
+ <name>ONAP</name>
</organization>
- <modules>
+
+ <modules>
<module>provider</module>
<module>features</module>
<module>installer</module>
diff --git a/utils/provider/pom.xml b/utils/provider/pom.xml
index b0adc7d4..7a4e8c9e 100644
--- a/utils/provider/pom.xml
+++ b/utils/provider/pom.xml
@@ -1,21 +1,26 @@
<?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">
+<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.ccsdk.sli.core</groupId>
- <artifactId>utils</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
- <modelVersion>4.0.0</modelVersion>
- <packaging>bundle</packaging>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>utils-provider</artifactId>
- <name>SLI Core Utilities Package</name>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+ <name>ccsdk-sli-core :: utils :: ${project.artifactId}</name>
<description>
The SLI Core Utilities Package provides common functionality for setting up SLI connectivity.
</description>
+ <organization>
+ <name>ONAP</name>
+ </organization>
<dependencies>
<dependency>
@@ -26,6 +31,7 @@
<groupId>equinoxSDK381</groupId>
<artifactId>org.eclipse.osgi</artifactId>
<version>${equinox.osgi.version}</version>
+ <scope>provided</scope>
</dependency>
<!-- Testing Dependencies -->
@@ -41,17 +47,4 @@
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>${bundle.plugin.version}</version>
- </plugin>
- </plugins>
- </build>
- <organization>
- <name>Inocybe Technologies and Others</name>
- </organization>
</project>
diff --git a/utils/provider/src/main/java/org/onap/ccsdk/sli/core/utils/JREFileResolver.java b/utils/provider/src/main/java/org/onap/ccsdk/sli/core/utils/JREFileResolver.java
index 8da9b7ef..cc164d04 100755
--- a/utils/provider/src/main/java/org/onap/ccsdk/sli/core/utils/JREFileResolver.java
+++ b/utils/provider/src/main/java/org/onap/ccsdk/sli/core/utils/JREFileResolver.java
@@ -7,9 +7,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.
@@ -54,9 +54,11 @@ public class JREFileResolver implements PropertiesFileResolver {
*/
@Override
public Optional<File> resolveFile(final String filename) {
+
final Bundle bundle = FrameworkUtil.getBundle(this.clazz);
final File dataFile;
+
try {
if (bundle == null) {
return Optional.empty();
@@ -67,6 +69,7 @@ public class JREFileResolver implements PropertiesFileResolver {
return Optional.empty();
}
+
dataFile = bundle.getDataFile(filename);
if(dataFile.exists()) {
dataFile.delete();