summaryrefslogtreecommitdiffstats
path: root/sli
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 /sli
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>
Diffstat (limited to 'sli')
-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
21 files changed, 758 insertions, 874 deletions
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>