From 131cb46f6109a6099a445cb8e1b12ff5b68ae6de Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Thu, 1 Feb 2018 16:57:00 -0500 Subject: Upgrade sli/core to Nitrogen Use Apache derby for dblib SingleFeatureTest Change-Id: I6b41f7ede1a98b33824fceea9100e75c1ce8dda4 Issue-ID: CCSDK-175 Signed-off-by: Dan Timoney 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 Use Apache derby for dblib test Use Apache derby for dblib SingleFeatureTest Change-Id: Ie497557f162e203fa5c5c82c17ddc55ba0c11b38 Issue-ID: CCSDK-175 Signed-off-by: Dan Timoney --- sli/common/pom.xml | 289 ++++++++++----------- .../ccsdk/sli/core/sli/SvcLogicDblibStore.java | 42 ++- sli/features/features-sli/pom.xml | 29 +++ sli/features/odl-sli/pom.xml | 86 ++++++ sli/features/pom.xml | 161 ++---------- sli/features/src/main/resources/features.xml | 39 --- sli/installer/pom.xml | 25 +- sli/model/pom.xml | 89 ++----- sli/pom.xml | 61 +---- sli/provider/pom.xml | 186 ++++--------- .../sli/core/sli/provider/CallNodeExecutor.java | 38 +-- .../sli/core/sli/provider/SvcLogicActivator.java | 181 ------------- .../core/sli/provider/SvcLogicNodeExecutor.java | 21 +- .../sli/provider/SvcLogicPropertiesProvider.java | 188 ++++++++++++++ .../sli/core/sli/provider/SvcLogicServiceImpl.java | 55 +++- .../org/opendaylight/blueprint/sli-blueprint.xml | 21 ++ .../src/main/resources/svclogic.properties | 25 ++ .../core/sli/provider/ExecuteNodeExecutorTest.java | 7 +- .../sli/provider/ITCaseSvcLogicGraphExecutor.java | 7 +- .../src/test/resources/svclogic.properties | 11 +- sli/recording/pom.xml | 71 ++--- 21 files changed, 758 insertions(+), 874 deletions(-) create mode 100644 sli/features/features-sli/pom.xml create mode 100644 sli/features/odl-sli/pom.xml mode change 100755 => 100644 sli/features/pom.xml delete mode 100644 sli/features/src/main/resources/features.xml delete mode 100644 sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicActivator.java create mode 100644 sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicPropertiesProvider.java create mode 100755 sli/provider/src/main/resources/org/opendaylight/blueprint/sli-blueprint.xml create mode 100644 sli/provider/src/main/resources/svclogic.properties (limited to 'sli') 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 @@ - - 4.0.0 - - sli - org.onap.ccsdk.sli.core - 0.2.0-SNAPSHOT - - sli-common - bundle + + + 4.0.0 - SLI - Common Classes - 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 + + org.onap.ccsdk.parent + binding-parent + 1.0.1-SNAPSHOT + + - - - junit - junit - ${junit.version} - test - - - ch.vorburger.mariaDB4j - mariaDB4j - 2.2.3 - test - - - org.antlr - antlr4 - ${antlr.version} - jar - compile - - - org.slf4j - slf4j-api - ${slf4j.version} - - - org.slf4j - slf4j-simple - 1.7.5 - compile - - - org.apache.commons - commons-lang3 - ${commons.lang3.version} - - - org.opendaylight.mdsal - yang-binding - ${odl.mdsal.yang.binding.version} - - - org.opendaylight.yangtools - yang-common - ${odl.yangtools.version} - - - org.opendaylight.mdsal.model - ietf-inet-types - ${odl.ietf-inet-types.version} - - - org.opendaylight.mdsal.model - ietf-yang-types - ${odl.ietf-yang-types.version} - - - org.opendaylight.controller - sal-core-api - ${odl.mdsal.version} - - - org.opendaylight.yangtools - yang-data-impl - ${odl.yangtools.version} - - - equinoxSDK381 - org.eclipse.osgi - ${equinox.osgi.version} - - - org.mariadb.jdbc - mariadb-java-client - ${mariadb.connector.version} - jar - compile - - - org.onap.ccsdk.sli.core - dblib-provider - ${sdnctl.dblib.version} - - - org.onap.ccsdk.sli.core - sliapi-model - ${project.version} - test - - + org.onap.ccsdk.sli.core + sli-common + 0.2.1-SNAPSHOT + bundle - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-jar-plugin - 2.4 - - **/*.xsd - - - org.onap.ccsdk.sli.core.sli.SvcLogicParser - org.onap.ccsdk.sli.core.sli - true - - - - - - org.apache.felix - maven-bundle-plugin - true - - - org.onap.ccsdk.sli.core.sli;version=${project.version} - * - *;scope=compile;artifactId=commons-lang|commons-lang3 - true - - - - - org.antlr - antlr4-maven-plugin - ${antlr.version} - - - - ${project.basedir}/src/main/java/ - - antlr - - antlr4 - - - - - - + ccsdk-sli-core :: sli :: ${project.artifactId} + 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 + + + + org.opendaylight.controller + mdsal-artifacts + 1.6.1 + pom + import + + + + + + ch.vorburger.mariaDB4j + mariaDB4j + 2.2.3 + test + + + org.antlr + antlr4 + ${antlr.version} + jar + compile + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + slf4j-simple + 1.7.5 + compile + + + org.apache.commons + commons-lang3 + ${commons.lang3.version} + + + equinoxSDK381 + org.eclipse.osgi + ${equinox.osgi.version} + + + org.mariadb.jdbc + mariadb-java-client + ${mariadb.connector.version} + jar + compile + + + org.onap.ccsdk.sli.core + dblib-provider + ${sdnctl.dblib.version} + + + org.onap.ccsdk.sli.core + sli-model + ${project.version} + test + + + org.opendaylight.mdsal.model + ietf-inet-types + + + org.opendaylight.mdsal.model + ietf-yang-types + + + org.opendaylight.controller + sal-core-api + + + + org.opendaylight.controller + sal-binding-api + + + + + junit + junit + test + + + + org.mockito + mockito-core + test + + + + + + + org.antlr + antlr4-maven-plugin + ${antlr.version} + + + + ${project.basedir}/src/main/java/ + + antlr + + antlr4 + + + + + + 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 @@ + + + 4.0.0 + + + org.onap.ccsdk.parent + feature-repo-parent + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.core + features-sli + 0.2.1-SNAPSHOT + feature + + ccsdk-sli-core :: sli :: ${project.artifactId} + + + + ${project.groupId} + ccsdk-sli + ${project.version} + xml + features + + + + 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 @@ + + + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.core + ccsdk-sli + 0.2.1-SNAPSHOT + feature + + ccsdk-sli-core :: sli :: ${project.artifactId} + + + + + org.opendaylight.mdsal.model + mdsal-model-artifacts + 0.11.1 + pom + import + + + org.opendaylight.controller + mdsal-artifacts + 1.6.1 + pom + import + + + + + + org.onap.ccsdk.sli.core + sli-common + ${project.version} + + + + org.onap.ccsdk.sli.core + sli-provider + ${project.version} + + + + org.onap.ccsdk.sli.core + sli-recording + ${project.version} + + + + org.mariadb.jdbc + mariadb-java-client + ${mariadb.connector.version} + + + + org.onap.ccsdk.sli.core + ccsdk-dblib + ${project.version} + xml + features + + + org.opendaylight.controller + odl-mdsal-broker + xml + features + + + equinoxSDK381 + org.eclipse.osgi + ${equinox.osgi.version} + provided + + + diff --git a/sli/features/pom.xml b/sli/features/pom.xml old mode 100755 new mode 100644 index 4630b783..fbb864ef --- a/sli/features/pom.xml +++ b/sli/features/pom.xml @@ -1,137 +1,30 @@ - - 4.0.0 - - sli - org.onap.ccsdk.sli.core - 0.2.0-SNAPSHOT - - sli-features - SLI - Features - - jar - - - - org.onap.ccsdk.sli.core - sli-common - ${project.version} - - - - - org.onap.ccsdk.sli.core - sli-recording - ${project.version} - - - commons-lang - commons-lang - ${commons.lang.version} - compile - - - - org.opendaylight.mdsal - features-mdsal - ${odl.mdsal.features.version} - features - xml - - runtime - - + - - - - - org.opendaylight.odlparent - features-test - ${odl.commons.opendaylight.version} - test - - - - org.opendaylight.yangtools - features-yangtools - ${odl.yangtools.version} - features - xml - runtime - - - - - - - true - src/main/resources - - - - - org.apache.maven.plugins - maven-resources-plugin - - - filter - - resources - - generate-resources - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - - attach-artifact - - package - - - - ${project.build.directory}/classes/${features.file} - xml - features - - - - - - - - +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 +--> + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + + + + org.onap.ccsdk.sli.core + sli-feature-aggregator + 0.1.0 + pom + + ccsdk-sli-core :: sli :: ${project.artifactId} + + + features-sli + odl-sli + 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 @@ - - - - - - - mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features - - - - - odl-mdsal-broker - mvn:org.onap.ccsdk.sli.core/sli-common/${project.version} - mvn:org.onap.ccsdk.sli.core/sli-provider/${project.version} - mvn:org.onap.ccsdk.sli.core/sli-recording/${project.version} - sdnc-dblib - mvn:org.mariadb.jdbc/mariadb-java-client/${mariadb.connector.version} - - - 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 @@ 4.0.0 + - sli - org.onap.ccsdk.sli.core - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + + + org.onap.ccsdk.sli.core sli-installer - SLI - Karaf Installer + 0.2.1-SNAPSHOT pom + ccsdk-sli-core :: sli :: ${project.artifactId} + - sdnc-sli - sdnc-sli - mvn:org.onap.ccsdk.sli.core/sli-features/${project.version}/xml/features + ccsdk-sli + ${application.name} + mvn:org.onap.ccsdk.sli.core/${features.boot}/${project.version}/xml/features false @@ -21,10 +27,10 @@ org.onap.ccsdk.sli.core - sli-features + ${application.name} ${project.version} - features xml + features * @@ -145,5 +151,4 @@ - 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 @@ 4.0.0 + - sli - org.onap.ccsdk.sli.core - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + binding-parent + 1.0.1-SNAPSHOT + + + org.onap.ccsdk.sli.core sli-model + 0.2.1-SNAPSHOT bundle - SLI - Model - - - - org.apache.felix - maven-bundle-plugin - true - - - * - - - - - org.opendaylight.yangtools - yang-maven-plugin - ${odl.yangtools.yang.maven.plugin.version} - - - org.opendaylight.mdsal - maven-sal-api-gen-plugin - ${odl.sal.api.gen.plugin.version} - jar - - - - - - generate-sources - - - ${yang.file.directory} - - - - org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl - ${salGeneratorPath} - - - true - - - - - - + ccsdk-sli-core :: sli :: ${project.artifactId} + - - org.opendaylight.mdsal - yang-binding - ${odl.mdsal.yang.binding.version} - - - org.opendaylight.yangtools - yang-common - ${odl.yangtools.version} - - - org.opendaylight.mdsal.model - ietf-inet-types - ${odl.ietf-inet-types.version} - - - org.opendaylight.mdsal.model - ietf-yang-types - ${odl.ietf-yang-types.version} - + + org.opendaylight.mdsal.model + ietf-inet-types + + + org.opendaylight.mdsal.model + ietf-yang-types + 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 @@ - - + + 4.0.0 - org.onap.ccsdk.sli.core - ccsdk-sli-core - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + odlparent-lite + 1.0.1-SNAPSHOT + - 4.0.0 - pom + org.onap.ccsdk.sli.core sli + 0.2.1-SNAPSHOT + pom - - - - - org.onap.ccsdk.sli.core - sli-features - features - xml - ${project.version} - - - - org.onap.ccsdk.sli.core - sli-common - ${project.version} - - - - org.onap.ccsdk.sli.core - sli-provider - ${project.version} - - - - org.onap.ccsdk.sli.core - sli-recording - ${project.version} - - - - - - - - Service Logic Interpreter + ccsdk-sli-core :: sli 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. + + ONAP + model @@ -57,10 +28,4 @@ features installer - - ONAP - - 0.2.0-SNAPSHOT - - 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 @@ - - 4.0.0 - - org.onap.ccsdk.sli.core - sli - 0.2.0-SNAPSHOT + + 4.0.0 + + + org.onap.ccsdk.parent + binding-parent + 1.0.1-SNAPSHOT + - sli-provider - bundle - SLI - Provider - + + org.onap.ccsdk.sli.core + sli-provider + 0.2.1-SNAPSHOT + bundle + + ccsdk-sli-core :: sli :: ${project.artifactId} + SLI Provider is the OSGi bundle that exposes the service logic interpreter as a service. + + UTF-8 - - - junit - junit - ${junit.version} - test - + + + + + org.opendaylight.controller + mdsal-artifacts + 1.6.1 + pom + import + + + + ch.vorburger.mariaDB4j mariaDB4j @@ -60,129 +73,24 @@ compile - - - - - - - - org.apache.felix - maven-bundle-plugin - ${bundle.plugin.version} - true - - - org.onap.ccsdk.sli.core.sli.provider.SvcLogicActivator - org.onap.ccsdk.sli.core.sli.provider;version=${project.version} - - * + + org.opendaylight.controller + sal-binding-api + - org.onap.ccsdk.sli.core.sli;version="${project.version}",* + + + junit + junit + test + - *;scope=compile;artifactId=commons-lang|commons-lang3 + + org.mockito + mockito-core + test + - true - - - - - - org.opendaylight.yangtools - yang-maven-plugin - ${odl.yangtools.yang.maven.plugin.version} - - - config - - generate-sources - - - src/test/resources - - - - org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator - - ${jmxGeneratorPath} - - - urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang - - - - - - org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl - - ${salGeneratorPath} - - - true - - - - - - org.opendaylight.mdsal - maven-sal-api-gen-plugin - ${odl.sal.api.gen.plugin.version} - jar - - - org.opendaylight.controller - yang-jmx-generator-plugin - ${odl.yang.jmx.generator.version} - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - 1.8 - - - prepare-package - - run - - - - - - - - - - - - - - - - - - SLI Provider is the OSGi bundle that exposes the service logic interpreter as a service. + 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 BUILTIN_NODES = new HashMap() { - { - 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 registrations = new LinkedList<>(); - - private static HashMap 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 + * DBResourceManager Service. The priority for properties file + * resolution is as follows: + * + *
    + *
  1. A directory identified by the system environment variable + * SDNC_CONFIG_DIR
  2. + *
  3. The default directory DEFAULT_DBLIB_PROP_DIR
  4. + *
  5. A directory identified by the JRE argument + * dblib.properties
  6. + *
  7. A dblib.properties file located in the karaf root + * directory
  8. + *
+ */ +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 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 + * Logger. + * + * @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 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: + *
    + *
  1. A directory identified by the system environment variable + * SDNC_CONFIG_DIR
  2. + *
  3. The default directory DEFAULT_DBLIB_PROP_DIR
  4. + *
  5. A directory identified by the JRE argument + * dblib.properties
  6. + *
  7. A dblib.properties file located in the karaf root + * directory
  8. + *
+ */ + File determinePropertiesFile(final SvcLogicPropertiesProvider resourceProvider) { + + for (final PropertiesFileResolver sliPropertiesFileResolver : sliPropertiesFileResolvers) { + final Optional 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 @@ + + + + + + + + + + + + + + + org.onap.ccsdk.sli.core.sli.provider.SvcLogicService + + + + \ 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 @@ 4.0.0 + - org.onap.ccsdk.sli.core - sli - 0.2.0-SNAPSHOT + org.onap.ccsdk.parent + binding-parent + 1.0.1-SNAPSHOT + + + org.onap.ccsdk.sli.core sli-recording + 0.2.1-SNAPSHOT bundle - SLI - Recording + + ccsdk-sli-core :: sli :: ${project.artifactId} + SLI Recording is an OSGi bundle that implements recording service for the service logic record node. + UTF-8 + + + + + org.opendaylight.controller + mdsal-artifacts + 1.6.1 + pom + import + + + - - junit - junit - ${junit.version} - test - org.onap.ccsdk.sli.core sli-common @@ -48,28 +62,23 @@ compile - - - - - - org.apache.felix - maven-bundle-plugin - ${bundle.plugin.version} - true - - - org.onap.ccsdk.sli.core.sli.recording;version=${project.version} - true - - - - + + org.opendaylight.controller + sal-binding-api + - + + + junit + junit + test + + + org.mockito + mockito-core + test + - - - SLI Recording is an OSGi bundle that implements recording service for the service logic record node. + -- cgit 1.2.3-korg