From 2a93b9ddf308b6bdd135be182c1b3fa779891840 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 18 Jul 2017 19:40:01 -0400 Subject: Populate seed code Add seed code for sli/core repository Issue: CCSDK-6 Change-Id: Iaeb54c6135a94a6ffec0c7fd96505d72d18aeb00 Signed-off-by: Dan Timoney --- filters/README | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 filters/README (limited to 'filters/README') diff --git a/filters/README b/filters/README new file mode 100755 index 000000000..9d69d638d --- /dev/null +++ b/filters/README @@ -0,0 +1,14 @@ + +/restconf filters are enabled by specifying filter chain in + /opt/opendaylight/current/etc/org.opendaylight.aaa.filterchain.cfg +and enabling bundle class loading + >bundle:dynamic-import org.openecomp.sdnc.filters-provider + +loggers: + org.openecomp.sdnc.filters.audit + org.openecomp.sdnc.filters.metric + org.openecomp.sdnc.filters.request.response + + + + -- cgit 1.2.3-korg From 68eeb041f3bec6548e94978dce2e6795c8a399e7 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Fri, 11 Aug 2017 15:57:21 -0400 Subject: Remove remaining references to openecomp Remove remaining references to openecomp from properties and sample files Change-Id: I985bae5e80ae130ffb512c9574f13172252bf6f8 Issue-ID: CCSDK-11 Signed-off-by: Dan Timoney --- README.md | 2 +- filters/README | 8 +- filters/pom.xml | 2 +- .../org/onap/ccsdk/sli/core/filters/LogFilter.java | 6 +- .../core/filters/RequestResponseLoggingFilter.java | 6 +- pom.xml | 2 +- .../ccsdk/sli/core/sli/SvcLogicDblibStore.java | 7 +- .../onap/ccsdk/sli/core/sli/SvcLogicJdbcStore.java | 312 ++++++++++----------- .../onap/ccsdk/sli/core/sli/SvcLogicParser.java | 6 +- .../ccsdk/sli/core/sli/SvcLogicStoreFactory.java | 18 +- sli/common/src/main/resources/svclogic.xsd | 2 +- .../test/resources/EvcActivateSvcLogic_v100.xml | 8 +- .../src/test/resources/EvcPortSvcLogic_v100.xml | 26 +- .../test/resources/ReleasePortSvcLogic_v101.xml | 12 +- .../src/test/resources/bad_neutron_logic_v11.xml | 4 +- sli/common/src/test/resources/mergetest.xml | 2 +- .../src/test/resources/neutron_logic_v10.xml | 4 +- .../src/test/resources/simplelogger.properties | 6 +- sli/common/src/test/resources/svclogic.properties | 14 +- sli/common/src/test/resources/svclogic.sh | 6 +- sli/common/src/test/resources/svclogic.xsd | 2 +- sli/provider/pom.xml | 8 +- .../sli/core/sli/provider/SvcLogicService.java | 24 +- .../src/test/resources/l3sdn_logic_v10.xml | 4 +- .../src/test/resources/svclogic.properties | 14 +- .../src/main/resources/svclogic.properties | 14 +- sliapi/model/src/main/yang/sliapi.yang | 2 +- .../onap/ccsdk/sli/core/sliapi/sliapiProvider.java | 6 +- .../src/main/resources/initial/sliapi-provider.xml | 2 +- 29 files changed, 262 insertions(+), 267 deletions(-) (limited to 'filters/README') diff --git a/README.md b/README.md index 50134aea4..262339dde 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ This source repository contains the code for the core SDN Controller components. To compile this code: -1. Make sure your local Maven settings file ($HOME/.m2/settings.xml) contains references to the OpenECOMP repositories and OpenDaylight repositories. See example-settings.xml for an example. +1. Make sure your local Maven settings file ($HOME/.m2/settings.xml) contains references to the ONAP repositories and OpenDaylight repositories. 2. To compile, run "mvn clean install". diff --git a/filters/README b/filters/README index 9d69d638d..5c1b3d627 100755 --- a/filters/README +++ b/filters/README @@ -2,12 +2,12 @@ /restconf filters are enabled by specifying filter chain in /opt/opendaylight/current/etc/org.opendaylight.aaa.filterchain.cfg and enabling bundle class loading - >bundle:dynamic-import org.openecomp.sdnc.filters-provider + >bundle:dynamic-import org.onap.ccsdk.sli.core.filters-provider loggers: - org.openecomp.sdnc.filters.audit - org.openecomp.sdnc.filters.metric - org.openecomp.sdnc.filters.request.response + org.onap.ccsdk.sli.core.filters.audit + org.onap.ccsdk.sli.core.filters.metric + org.onap.ccsdk.sli.core.filters.request.response diff --git a/filters/pom.xml b/filters/pom.xml index cbc8f5873..4c5c6826e 100644 --- a/filters/pom.xml +++ b/filters/pom.xml @@ -71,7 +71,7 @@ - OpenECOMP + ONAP provider diff --git a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/LogFilter.java b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/LogFilter.java index 9df74c35a..553a7cdd7 100644 --- a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/LogFilter.java +++ b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/LogFilter.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -80,7 +80,7 @@ public class LogFilter implements Filter { private static final Logger log = LoggerFactory.getLogger(LogFilter.class); - private static final Logger AUDIT = LoggerFactory.getLogger("org.openecomp.sdnc.filters.audit"); + private static final Logger AUDIT = LoggerFactory.getLogger("org.onap.ccsdk.sli.core.filters.audit"); @Override public void destroy() { } diff --git a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/RequestResponseLoggingFilter.java b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/RequestResponseLoggingFilter.java index e4b0b7d1f..eb7937086 100644 --- a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/RequestResponseLoggingFilter.java +++ b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/RequestResponseLoggingFilter.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -45,7 +45,7 @@ import javax.servlet.http.HttpServletResponseWrapper; public class RequestResponseLoggingFilter implements Filter { - private static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger("org.openecomp.sdnc.filters.request.response"); + private static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger("org.onap.ccsdk.sli.core.filters.request.response"); private static class ByteArrayServletStream extends ServletOutputStream { diff --git a/pom.xml b/pom.xml index 4a1a25010..0674b6dac 100755 --- a/pom.xml +++ b/pom.xml @@ -184,7 +184,7 @@ sliapi - OpenECOMP + ONAP 0.0.1-SNAPSHOT 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 ac656ffa8..4673f9689 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 @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -54,8 +54,7 @@ public class SvcLogicDblibStore implements SvcLogicStore { .getLogger(SvcLogicDblibStore.class); private static final String DBLIB_SERVICE = - // "org.openecomp.sdnc.sli.resource.dblib.DBLibService"; - "org.openecomp.sdnc.sli.resource.dblib.DBResourceManager"; + "org.onap.ccsdk.sli.core.dblib.DBResourceManager"; Properties props = null; diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicJdbcStore.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicJdbcStore.java index 9aa0ddfb5..1b9c62748 100644 --- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicJdbcStore.java +++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicJdbcStore.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -49,7 +49,7 @@ public class SvcLogicJdbcStore implements SvcLogicStore { private String dbUser = null; private String dbPasswd = null; private String dbDriver = null; - + private Connection dbConn; private PreparedStatement hasActiveGraphStmt = null; private PreparedStatement hasVersionGraphStmt = null; @@ -57,22 +57,22 @@ public class SvcLogicJdbcStore implements SvcLogicStore { private PreparedStatement fetchVersionGraphStmt = null; private PreparedStatement storeGraphStmt = null; private PreparedStatement deleteGraphStmt = null; - + private PreparedStatement deactivateStmt = null; private PreparedStatement activateStmt = null; - + private PreparedStatement registerNodeStmt = null; private PreparedStatement unregisterNodeStmt = null; private PreparedStatement validateNodeStmt = null; - + private void getConnection() throws ConfigurationException { Properties jdbcProps = new Properties(); - + jdbcProps.setProperty("user", dbUser); jdbcProps.setProperty("password", dbPasswd); - + try { Driver dvr = new com.mysql.jdbc.Driver(); if (dvr.acceptsURL(dbUrl)) @@ -88,8 +88,8 @@ public class SvcLogicJdbcStore implements SvcLogicStore { } - - + + try { this.dbConn = DriverManager.getConnection(dbUrl, jdbcProps); @@ -97,17 +97,17 @@ public class SvcLogicJdbcStore implements SvcLogicStore { catch (Exception e) { throw new ConfigurationException("failed to get database connection ["+dbUrl+"]", e); - } - + } + } - + private void createTable() throws ConfigurationException { DatabaseMetaData dbm = null; - - + + try { dbm = dbConn.getMetaData(); } catch (SQLException e) { @@ -164,9 +164,9 @@ public class SvcLogicJdbcStore implements SvcLogicStore { { throw new ConfigurationException("could not create SVC_LOGIC table", e); } - + // See if NODE_TYPES table exists and, if not, create it - + try { @@ -211,14 +211,14 @@ public class SvcLogicJdbcStore implements SvcLogicStore { throw new ConfigurationException("could not create SVC_LOGIC table", e); } } - + private void prepStatements() throws ConfigurationException { // Prepare statements String hasVersionGraphSql = "SELECT count(*) FROM "+dbName+".SVC_LOGIC" + " WHERE module = ? AND rpc = ? AND mode = ? AND version = ?"; - + try { hasVersionGraphStmt = dbConn.prepareStatement(hasVersionGraphSql); @@ -226,12 +226,12 @@ public class SvcLogicJdbcStore implements SvcLogicStore { catch (Exception e) { throw new ConfigurationException("could not prepare statement "+hasVersionGraphSql, e); - + } - + String hasActiveGraphSql = "SELECT count(*) FROM "+dbName+".SVC_LOGIC" + " WHERE module = ? AND rpc = ? AND mode = ? AND active = 'Y'"; - + try { hasActiveGraphStmt = dbConn.prepareStatement(hasActiveGraphSql); @@ -239,12 +239,12 @@ public class SvcLogicJdbcStore implements SvcLogicStore { catch (Exception e) { throw new ConfigurationException("could not prepare statement "+hasVersionGraphSql, e); - + } - + String fetchVersionGraphSql = "SELECT graph FROM "+dbName+".SVC_LOGIC" + " WHERE module = ? AND rpc = ? AND mode = ? AND version = ?"; - + try { fetchVersionGraphStmt = dbConn.prepareStatement(fetchVersionGraphSql); @@ -252,12 +252,12 @@ public class SvcLogicJdbcStore implements SvcLogicStore { catch (Exception e) { throw new ConfigurationException("could not prepare statement "+fetchVersionGraphSql, e); - + } - + String fetchActiveGraphSql = "SELECT graph FROM "+dbName+".SVC_LOGIC" + " WHERE module = ? AND rpc = ? AND mode = ? AND active = 'Y'"; - + try { fetchActiveGraphStmt = dbConn.prepareStatement(fetchActiveGraphSql); @@ -265,12 +265,12 @@ public class SvcLogicJdbcStore implements SvcLogicStore { catch (Exception e) { throw new ConfigurationException("could not prepare statement "+fetchVersionGraphSql, e); - + } - + String storeGraphSql = "INSERT INTO "+dbName+".SVC_LOGIC (module, rpc, version, mode, active, graph)" + " VALUES(?, ?, ?, ?, ?, ?)"; - + try { storeGraphStmt = dbConn.prepareStatement(storeGraphSql); @@ -279,9 +279,9 @@ public class SvcLogicJdbcStore implements SvcLogicStore { { throw new ConfigurationException("could not prepare statement "+storeGraphSql, e); } - + String deleteGraphSql = "DELETE FROM "+dbName+".SVC_LOGIC WHERE module = ? AND rpc = ? AND version = ? AND mode = ?"; - + try { deleteGraphStmt = dbConn.prepareStatement(deleteGraphSql); @@ -290,9 +290,9 @@ public class SvcLogicJdbcStore implements SvcLogicStore { { throw new ConfigurationException("could not prepare statement "+deleteGraphSql, e); } - + String deactivateSql = "UPDATE "+dbName+".SVC_LOGIC SET active = 'N' WHERE module = ? AND rpc = ? AND mode = ?"; - + try { deactivateStmt = dbConn.prepareStatement(deactivateSql); @@ -301,9 +301,9 @@ public class SvcLogicJdbcStore implements SvcLogicStore { { throw new ConfigurationException("could not prepare statement "+deactivateSql, e); } - + String activateSql = "UPDATE "+dbName+".SVC_LOGIC SET active = 'Y' WHERE module = ? AND rpc = ? AND version = ? AND mode = ?"; - + try { activateStmt = dbConn.prepareStatement(activateSql); @@ -312,7 +312,7 @@ public class SvcLogicJdbcStore implements SvcLogicStore { { throw new ConfigurationException("could not prepare statement "+activateSql, e); } - + String registerNodeSql = "INSERT INTO "+dbName+".NODE_TYPES (nodetype) VALUES(?)"; try { @@ -322,7 +322,7 @@ public class SvcLogicJdbcStore implements SvcLogicStore { { throw new ConfigurationException("could not prepare statement "+registerNodeSql, e); } - + String unregisterNodeSql = "DELETE FROM "+dbName+".NODE_TYPES WHERE nodetype = ?"; try { @@ -332,7 +332,7 @@ public class SvcLogicJdbcStore implements SvcLogicStore { { throw new ConfigurationException("could not prepare statement "+unregisterNodeSql, e); } - + String validateNodeSql = "SELECT count(*) FROM "+dbName+".NODE_TYPES WHERE nodetype = ?"; try { @@ -343,12 +343,12 @@ public class SvcLogicJdbcStore implements SvcLogicStore { throw new ConfigurationException("could not prepare statement "+validateNodeSql, e); } } - + private void initDbResources() throws ConfigurationException { if ((dbDriver != null) && (dbDriver.length() > 0)) { - + try { Class.forName(dbDriver); @@ -362,48 +362,48 @@ public class SvcLogicJdbcStore implements SvcLogicStore { createTable(); prepStatements(); } - + public void init(Properties props) throws ConfigurationException { - - - dbUrl = props.getProperty("org.openecomp.sdnc.sli.jdbc.url"); + + + dbUrl = props.getProperty("org.onap.ccsdk.sli.jdbc.url"); if ((dbUrl == null) || (dbUrl.length() == 0)) { - throw new ConfigurationException("property org.openecomp.sdnc.sli.jdbc.url unset"); + throw new ConfigurationException("property org.onap.ccsdk.sli.jdbc.url unset"); } - - dbName = props.getProperty("org.openecomp.sdnc.sli.jdbc.database"); + + dbName = props.getProperty("org.onap.ccsdk.sli.jdbc.database"); if ((dbName == null) || (dbName.length() == 0)) { - throw new ConfigurationException("property org.openecomp.sdnc.sli.jdbc.database unset"); + throw new ConfigurationException("property org.onap.ccsdk.sli.jdbc.database unset"); } - - dbUser = props.getProperty("org.openecomp.sdnc.sli.jdbc.user"); + + dbUser = props.getProperty("org.onap.ccsdk.sli.jdbc.user"); if ((dbUser == null) || (dbUser.length() == 0)) { - throw new ConfigurationException("property org.openecomp.sdnc.sli.jdbc.user unset"); + throw new ConfigurationException("property org.onap.ccsdk.sli.jdbc.user unset"); } - - dbPasswd = props.getProperty("org.openecomp.sdnc.sli.jdbc.password"); + + dbPasswd = props.getProperty("org.onap.ccsdk.sli.jdbc.password"); if ((dbPasswd == null) || (dbPasswd.length() == 0)) { - throw new ConfigurationException("property org.openecomp.sdnc.sli.jdbc.password unset"); + throw new ConfigurationException("property org.onap.ccsdk.sli.jdbc.password unset"); } - - dbDriver = props.getProperty("org.openecomp.sdnc.sli.jdbc.driver"); - + dbDriver = props.getProperty("org.onap.ccsdk.sli.jdbc.driver"); + + initDbResources(); - + } - + private boolean isDbConnValid() { boolean isValid = false; - + try { if (dbConn != null) @@ -413,31 +413,31 @@ public class SvcLogicJdbcStore implements SvcLogicStore { } catch (SQLException e) {} - + return(isValid); } public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException { - - + + if (!isDbConnValid()) { - + // Try reinitializing initDbResources(); - + if (!isDbConnValid()) { throw new ConfigurationException("no jdbc connection"); } } - - + + boolean retval = false; ResultSet results = null; - + PreparedStatement hasGraphStmt = null; if (version == null) { @@ -447,16 +447,16 @@ public boolean hasGraph(String module, String rpc, String version, String mode) { hasGraphStmt = hasVersionGraphStmt; } - - + + try { hasGraphStmt.setString(1, module); hasGraphStmt.setString(2, rpc); hasGraphStmt.setString(3, mode); - + if (version != null) { hasGraphStmt.setString(4, version); @@ -466,11 +466,11 @@ public boolean hasGraph(String module, String rpc, String version, String mode) results = hasGraphStmt.executeQuery(); dbConn.commit(); dbConn.setAutoCommit(oldAutoCommit); - + if (results.next()) { int cnt = results.getInt(1); - + if (cnt > 0) { retval = true; @@ -488,43 +488,43 @@ public boolean hasGraph(String module, String rpc, String version, String mode) { try { - + results.close(); } catch (SQLException x) {} } - + } - - + + return(retval); - - + + } public SvcLogicGraph fetch(String module, String rpc, String version, String mode) throws SvcLogicException { - - + + if (!isDbConnValid()) { - + // Try reinitializing initDbResources(); - + if (!isDbConnValid()) { throw new ConfigurationException("no jdbc connection"); } } - - + + SvcLogicGraph retval = null; ResultSet results = null; - + PreparedStatement fetchGraphStmt = null; if (version == null) { @@ -540,7 +540,7 @@ public boolean hasGraph(String module, String rpc, String version, String mode) fetchGraphStmt.setString(2, rpc); fetchGraphStmt.setString(3, mode); - + if (version != null) { fetchGraphStmt.setString(4, version); @@ -550,16 +550,16 @@ public boolean hasGraph(String module, String rpc, String version, String mode) results = fetchGraphStmt.executeQuery(); dbConn.commit(); dbConn.setAutoCommit(oldAutoCommit); - + if (results.next()) { Blob graphBlob = results.getBlob("graph"); - + ObjectInputStream gStream = new ObjectInputStream(graphBlob.getBinaryStream()); - + Object graphObj = gStream.readObject(); gStream.close(); - + if (graphObj instanceof SvcLogicGraph) { retval = (SvcLogicGraph) graphObj; @@ -567,9 +567,9 @@ public boolean hasGraph(String module, String rpc, String version, String mode) else { throw new ConfigurationException("invalid type for graph ("+graphObj.getClass().getName()); - + } - + } else { @@ -591,24 +591,24 @@ public boolean hasGraph(String module, String rpc, String version, String mode) catch (SQLException x) {} } - + } - - + + return(retval); - - + + } public void store(SvcLogicGraph graph) throws SvcLogicException { - - + + if (!isDbConnValid()) { - + // Try reinitializing initDbResources(); - + if (!isDbConnValid()) { throw new ConfigurationException("no jdbc connection"); @@ -619,20 +619,20 @@ public boolean hasGraph(String module, String rpc, String version, String mode) { throw new SvcLogicException("graph cannot be null"); } - + byte[] graphBytes = null; - + ByteArrayOutputStream byteStr = null; ObjectOutputStream goutStr = null; - + try { byteStr = new ByteArrayOutputStream(); goutStr = new ObjectOutputStream(byteStr); goutStr.writeObject(graph); - + graphBytes = byteStr.toByteArray(); - + } catch (Exception e) { @@ -640,33 +640,33 @@ public boolean hasGraph(String module, String rpc, String version, String mode) } finally { - + if (goutStr != null) { try { goutStr.close(); } catch (IOException e) { - + } } - + if (byteStr != null) { try { byteStr.close(); } catch (IOException e) { - + } } } - - + + // If object already stored in database, delete it if (hasGraph(graph.getModule(), graph.getRpc(), graph.getVersion(), graph.getMode())) { delete(graph.getModule(), graph.getRpc(), graph.getVersion(), graph.getMode()); } - + try { boolean oldAutoCommit = dbConn.getAutoCommit(); @@ -677,26 +677,26 @@ public boolean hasGraph(String module, String rpc, String version, String mode) storeGraphStmt.setString(4, graph.getMode()); storeGraphStmt.setString(5, "N"); storeGraphStmt.setBlob(6, new ByteArrayInputStream(graphBytes)); - + storeGraphStmt.executeUpdate(); dbConn.commit(); - + dbConn.setAutoCommit(oldAutoCommit); } catch (Exception e) { throw new SvcLogicException("Could not write object to database", e); - } + } } - + public void delete(String module, String rpc, String version, String mode) throws SvcLogicException - { + { if (!isDbConnValid()) { - + // Try reinitializing initDbResources(); - + if (!isDbConnValid()) { throw new ConfigurationException("no jdbc connection"); @@ -712,7 +712,7 @@ public boolean hasGraph(String module, String rpc, String version, String mode) deleteGraphStmt.setString(3, version); deleteGraphStmt.setString(4, mode); - + deleteGraphStmt.executeUpdate(); dbConn.commit(); dbConn.setAutoCommit(oldAutoCommit); @@ -720,7 +720,7 @@ public boolean hasGraph(String module, String rpc, String version, String mode) catch (Exception e) { throw new SvcLogicException("Could not delete object from database", e); - } + } } public void activate(SvcLogicGraph graph) throws SvcLogicException @@ -728,26 +728,26 @@ public boolean hasGraph(String module, String rpc, String version, String mode) try { boolean oldAutoCommit = dbConn.getAutoCommit(); - + dbConn.setAutoCommit(false); - + // Deactivate any current active version deactivateStmt.setString(1, graph.getModule()); deactivateStmt.setString(2, graph.getRpc()); deactivateStmt.setString(3, graph.getMode()); deactivateStmt.executeUpdate(); - + // Activate this version activateStmt.setString(1, graph.getModule()); activateStmt.setString(2, graph.getRpc()); activateStmt.setString(3, graph.getVersion()); activateStmt.setString(4, graph.getMode()); activateStmt.executeUpdate(); - + dbConn.commit(); - + dbConn.setAutoCommit(oldAutoCommit); - + } catch (Exception e) { @@ -757,24 +757,24 @@ public boolean hasGraph(String module, String rpc, String version, String mode) @Override public void registerNodeType(String nodeType) throws SvcLogicException { - + if (isValidNodeType(nodeType)) { return; } - + if (!isDbConnValid()) { - + // Try reinitializing initDbResources(); - + if (!isDbConnValid()) { throw new ConfigurationException("no jdbc connection"); } } - + try { boolean oldAutoCommit = dbConn.getAutoCommit(); @@ -788,29 +788,29 @@ public boolean hasGraph(String module, String rpc, String version, String mode) { throw new SvcLogicException("Could not add node type to database", e); } - + } @Override public void unregisterNodeType(String nodeType) throws SvcLogicException { - + if (!isValidNodeType(nodeType)) { return; } - + if (!isDbConnValid()) { - + // Try reinitializing initDbResources(); - + if (!isDbConnValid()) { throw new ConfigurationException("no jdbc connection"); } } - + try { boolean oldAutoCommit = dbConn.getAutoCommit(); @@ -824,50 +824,50 @@ public boolean hasGraph(String module, String rpc, String version, String mode) { throw new SvcLogicException("Could not delete node type from database", e); } - + } @Override public boolean isValidNodeType(String nodeType) throws SvcLogicException { - + boolean isValid = false; - + if (!isDbConnValid()) { - + // Try reinitializing initDbResources(); - + if (!isDbConnValid()) { throw new ConfigurationException("no jdbc connection"); } } - + ResultSet results = null; try { validateNodeStmt.setString(1, nodeType); - + boolean oldAutoCommit = dbConn.getAutoCommit(); dbConn.setAutoCommit(false); results = validateNodeStmt.executeQuery(); dbConn.commit(); dbConn.setAutoCommit(oldAutoCommit); - + if (results != null) { if (results.next()) { int cnt = results.getInt(1); - + if (cnt > 0) { isValid = true; } } } - + } catch (Exception e) { @@ -884,11 +884,11 @@ public boolean hasGraph(String module, String rpc, String version, String mode) catch (SQLException x) {} } - + } - + return(isValid); } - - + + } diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicParser.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicParser.java index 9ba502666..3a60001fa 100644 --- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicParser.java +++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicParser.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -60,7 +60,7 @@ public class SvcLogicParser { private static final String SVC_LOGIC_STORE_ERROR = "Could not get service logic store"; private static final Logger LOGGER = LoggerFactory.getLogger(SvcLogicParser.class); - private static final String SLI_VALIDATING_PARSER = "org.openecomp.sdnc.sli.parser.validate"; + private static final String SLI_VALIDATING_PARSER = "org.onap.ccsdk.sli.parser.validate"; private static final String SVCLOGIC_XSD = "/svclogic.xsd"; private class SvcLogicHandler extends DefaultHandler { diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicStoreFactory.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicStoreFactory.java index 38b5b69d6..22e27735f 100644 --- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicStoreFactory.java +++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicStoreFactory.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory; public class SvcLogicStoreFactory { private static final Logger LOG = LoggerFactory.getLogger(SvcLogicStoreFactory.class); - + public static SvcLogicStore getSvcLogicStore(String propfile) throws SvcLogicException { File propFile = new File(propfile); @@ -54,27 +54,27 @@ public class SvcLogicStoreFactory { public static SvcLogicStore getSvcLogicStore(InputStream inStr) throws SvcLogicException { Properties props = new Properties(); - + try { props.load(inStr); } catch (Exception e) { throw new ConfigurationException("Could not get load properties from input stream", e); } - + return(getSvcLogicStore(props)); } public static SvcLogicStore getSvcLogicStore(Properties props) throws SvcLogicException { - String storeType = props.getProperty("org.openecomp.sdnc.sli.dbtype"); + String storeType = props.getProperty("org.onap.ccsdk.sli.dbtype"); if ((storeType == null) || (storeType.length() == 0)) { throw new ConfigurationException( - "property org.openecomp.sdnc.sli.dbtype unset"); + "property org.onap.ccsdk.sli.dbtype unset"); } SvcLogicStore retval = null; - LOG.debug(String.format("Using org.openecomp.sdnc.sli.dbtype=%s", storeType)); + LOG.debug(String.format("Using org.onap.ccsdk.sli.dbtype=%s", storeType)); if ("jdbc".equalsIgnoreCase(storeType)) { retval = new SvcLogicJdbcStore(); @@ -87,7 +87,7 @@ public class SvcLogicStoreFactory { } - + retval.init(props); return (retval); } diff --git a/sli/common/src/main/resources/svclogic.xsd b/sli/common/src/main/resources/svclogic.xsd index f74bd5dcd..2704de88e 100755 --- a/sli/common/src/main/resources/svclogic.xsd +++ b/sli/common/src/main/resources/svclogic.xsd @@ -1,5 +1,5 @@ - + diff --git a/sli/common/src/test/resources/EvcActivateSvcLogic_v100.xml b/sli/common/src/test/resources/EvcActivateSvcLogic_v100.xml index 308bda1e9..de1f316e9 100644 --- a/sli/common/src/test/resources/EvcActivateSvcLogic_v100.xml +++ b/sli/common/src/test/resources/EvcActivateSvcLogic_v100.xml @@ -18,14 +18,14 @@ --> - - @@ -50,7 +50,7 @@ - diff --git a/sli/common/src/test/resources/EvcPortSvcLogic_v100.xml b/sli/common/src/test/resources/EvcPortSvcLogic_v100.xml index 8a9578bbe..268fc3126 100644 --- a/sli/common/src/test/resources/EvcPortSvcLogic_v100.xml +++ b/sli/common/src/test/resources/EvcPortSvcLogic_v100.xml @@ -18,16 +18,16 @@ --> - - @@ -35,7 +35,7 @@ - + @@ -66,7 +66,7 @@ - @@ -74,7 +74,7 @@ - + @@ -115,11 +115,11 @@ then configures it on device --> - - @@ -134,7 +134,7 @@ - + @@ -183,7 +183,7 @@ - @@ -214,7 +214,7 @@ - @@ -225,11 +225,11 @@ - - + diff --git a/sli/common/src/test/resources/ReleasePortSvcLogic_v101.xml b/sli/common/src/test/resources/ReleasePortSvcLogic_v101.xml index 1cc6274de..863b7f8d3 100644 --- a/sli/common/src/test/resources/ReleasePortSvcLogic_v101.xml +++ b/sli/common/src/test/resources/ReleasePortSvcLogic_v101.xml @@ -18,14 +18,14 @@ --> - - @@ -36,15 +36,15 @@ - - - + diff --git a/sli/common/src/test/resources/bad_neutron_logic_v11.xml b/sli/common/src/test/resources/bad_neutron_logic_v11.xml index f3455388e..3219310bb 100644 --- a/sli/common/src/test/resources/bad_neutron_logic_v11.xml +++ b/sli/common/src/test/resources/bad_neutron_logic_v11.xml @@ -18,9 +18,9 @@ --> - diff --git a/sli/common/src/test/resources/mergetest.xml b/sli/common/src/test/resources/mergetest.xml index 378744135..91164beee 100644 --- a/sli/common/src/test/resources/mergetest.xml +++ b/sli/common/src/test/resources/mergetest.xml @@ -16,7 +16,7 @@ ============LICENSE_END========================================================= --> - + Y Y diff --git a/sli/common/src/test/resources/neutron_logic_v10.xml b/sli/common/src/test/resources/neutron_logic_v10.xml index 730ebc21d..73d142019 100644 --- a/sli/common/src/test/resources/neutron_logic_v10.xml +++ b/sli/common/src/test/resources/neutron_logic_v10.xml @@ -18,9 +18,9 @@ --> - diff --git a/sli/common/src/test/resources/simplelogger.properties b/sli/common/src/test/resources/simplelogger.properties index d88e59ebe..05f72cd72 100644 --- a/sli/common/src/test/resources/simplelogger.properties +++ b/sli/common/src/test/resources/simplelogger.properties @@ -7,9 +7,9 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -19,5 +19,5 @@ ### org.slf4j.simpleLogger.defaultLogLevel=info -org.slf4j.simplelogger.log.org.openecomp.sdnc.sli.SvcLogicContext=debug +org.slf4j.simplelogger.log.org.onap.ccsdk.sli.core.sli.SvcLogicContext=debug org.slf4j.simplelogger.log.SvcLogicContext=debug diff --git a/sli/common/src/test/resources/svclogic.properties b/sli/common/src/test/resources/svclogic.properties index fa7a20417..df814e01b 100644 --- a/sli/common/src/test/resources/svclogic.properties +++ b/sli/common/src/test/resources/svclogic.properties @@ -7,9 +7,9 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -18,8 +18,8 @@ # ============LICENSE_END========================================================= ### -org.openecomp.sdnc.sli.dbtype = jdbc -org.openecomp.sdnc.sli.jdbc.url = jdbc:mysql://localhost:3306/sdnctl -org.openecomp.sdnc.sli.jdbc.database = sdnctl -org.openecomp.sdnc.sli.jdbc.user = sdnctl -org.openecomp.sdnc.sli.jdbc.password = gamma +org.onap.ccsdk.sli.dbtype = jdbc +org.onap.ccsdk.sli.jdbc.url = jdbc:mysql://localhost:3306/sdnctl +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/common/src/test/resources/svclogic.sh b/sli/common/src/test/resources/svclogic.sh index f6c6f4b67..601e94f69 100644 --- a/sli/common/src/test/resources/svclogic.sh +++ b/sli/common/src/test/resources/svclogic.sh @@ -9,9 +9,9 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,4 +28,4 @@ SLI_COMMON_JAR=${SLI_COMMON_JAR:=${SLI_COMMON_TARGETDIR}/sli-common-${SLI_VERSIO echo SLI_COMMON_JAR is $SLI_COMMON_JAR -java -cp ${CLASSPATH}:${MYSQL_JDBC_DRIVER}:${SLI_COMMON_JAR} org.openecomp.sdnc.sli.SvcLogicParser $* +java -cp ${CLASSPATH}:${MYSQL_JDBC_DRIVER}:${SLI_COMMON_JAR} org.onap.ccsdk.sli.core.sli.SvcLogicParser $* diff --git a/sli/common/src/test/resources/svclogic.xsd b/sli/common/src/test/resources/svclogic.xsd index 074308915..a63758f7c 100755 --- a/sli/common/src/test/resources/svclogic.xsd +++ b/sli/common/src/test/resources/svclogic.xsd @@ -1,5 +1,5 @@ - + diff --git a/sli/provider/pom.xml b/sli/provider/pom.xml index df6c7bcdf..25632f154 100755 --- a/sli/provider/pom.xml +++ b/sli/provider/pom.xml @@ -73,14 +73,10 @@ org.onap.ccsdk.sli.core.sli.provider;version=${project.version} * - + org.onap.ccsdk.sli.core.sli;version="${project.version}",* - + *;scope=compile;artifactId=commons-lang|commons-lang3 true diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicService.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicService.java index cfba5866e..22c475d88 100644 --- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicService.java +++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicService.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -26,9 +26,9 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; public interface SvcLogicService { - - public static final String NAME = "org.openecomp.sdnc.sli.provider.SvcLogicService"; - + + public static final String NAME = "org.onap.ccsdk.sli.core.sli.provider.SvcLogicService"; + // public SvcLogicContext execute(SvcLogicGraph graph, SvcLogicContext ctx) throws SvcLogicException; /** * Check for existence of a directed graph @@ -40,10 +40,10 @@ public interface SvcLogicService { * @throws SvcLogicException */ public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException; - + /** * Execute a directed graph - * + * * @param module - module name * @param rpc - rpc name * @param version - version. If null, use active version @@ -51,16 +51,16 @@ public interface SvcLogicService { * @param parms - parameters, used to set SvcLogicContext attributes * @return final values of attributes from SvcLogicContext, as Properties * @throws SvcLogicException - * - * + * + * * @deprecated use execute(String module, String rpc, String version, String mode, DOMDataBroker dataBroker) instead */ @Deprecated public Properties execute(String module, String rpc, String version, String mode, Properties parms) throws SvcLogicException; - + /** * Execute a directed graph - * + * * @param module - module name * @param rpc - rpc name * @param version - version. If null, use active version @@ -71,5 +71,5 @@ public interface SvcLogicService { * @throws SvcLogicException */ public Properties execute(String module, String rpc, String version, String mode, Properties parms, DOMDataBroker domDataBroker) throws SvcLogicException; - + } diff --git a/sli/provider/src/test/resources/l3sdn_logic_v10.xml b/sli/provider/src/test/resources/l3sdn_logic_v10.xml index 56e1a81ef..3bf8ef682 100644 --- a/sli/provider/src/test/resources/l3sdn_logic_v10.xml +++ b/sli/provider/src/test/resources/l3sdn_logic_v10.xml @@ -18,9 +18,9 @@ --> - diff --git a/sli/provider/src/test/resources/svclogic.properties b/sli/provider/src/test/resources/svclogic.properties index fa7a20417..df814e01b 100644 --- a/sli/provider/src/test/resources/svclogic.properties +++ b/sli/provider/src/test/resources/svclogic.properties @@ -7,9 +7,9 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -18,8 +18,8 @@ # ============LICENSE_END========================================================= ### -org.openecomp.sdnc.sli.dbtype = jdbc -org.openecomp.sdnc.sli.jdbc.url = jdbc:mysql://localhost:3306/sdnctl -org.openecomp.sdnc.sli.jdbc.database = sdnctl -org.openecomp.sdnc.sli.jdbc.user = sdnctl -org.openecomp.sdnc.sli.jdbc.password = gamma +org.onap.ccsdk.sli.dbtype = jdbc +org.onap.ccsdk.sli.jdbc.url = jdbc:mysql://localhost:3306/sdnctl +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/src/main/resources/svclogic.properties b/sli/recording/src/main/resources/svclogic.properties index 723aed8c3..8c301d47c 100644 --- a/sli/recording/src/main/resources/svclogic.properties +++ b/sli/recording/src/main/resources/svclogic.properties @@ -7,9 +7,9 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -18,8 +18,8 @@ # ============LICENSE_END========================================================= ### -org.openecomp.sdnc.sli.dbtype = jdbc -org.openecomp.sdnc.sli.jdbc.url = jdbc:mysql://dbhost:3306/sdnctl -org.openecomp.sdnc.sli.jdbc.database = sdnctl -org.openecomp.sdnc.sli.jdbc.user = sdnctl -org.openecomp.sdnc.sli.jdbc.password = gamma +org.onap.ccsdk.sli.dbtype = jdbc +org.onap.ccsdk.sli.jdbc.url = jdbc:mysql://dbhost:3306/sdnctl +org.onap.ccsdk.sli.jdbc.database = sdnctl +org.onap.ccsdk.sli.jdbc.user = sdnctl +org.onap.ccsdk.sli.jdbc.password = gamma diff --git a/sliapi/model/src/main/yang/sliapi.yang b/sliapi/model/src/main/yang/sliapi.yang index a8fe33b7d..8deb8a10f 100755 --- a/sliapi/model/src/main/yang/sliapi.yang +++ b/sliapi/model/src/main/yang/sliapi.yang @@ -8,7 +8,7 @@ module SLI-API { import ietf-inet-types { prefix "inet"; revision-date 2010-09-24; } - organization "openECOMP"; + organization "ONAP"; contact "Dan Timoney"; diff --git a/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/sliapiProvider.java b/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/sliapiProvider.java index 9ec5b6614..36e401144 100644 --- a/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/sliapiProvider.java +++ b/sliapi/provider/src/main/java/org/onap/ccsdk/sli/core/sliapi/sliapiProvider.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -117,7 +117,7 @@ public class sliapiProvider implements AutoCloseable, SLIAPIService{ protected BindingAwareBroker.RpcRegistration rpcRegistration; - private static String SLIAPI_NAMESPACE = "org:openecomp:sdnc:sliapi"; + private static String SLIAPI_NAMESPACE = "org:onap:ccsdk:sli:core:sliapi"; private static String SLIAPI_REVISION = "2016-11-10"; private static QName TEST_RESULTS_QNAME = null; diff --git a/sliapi/provider/src/main/resources/initial/sliapi-provider.xml b/sliapi/provider/src/main/resources/initial/sliapi-provider.xml index 038d209d8..780be2785 100644 --- a/sliapi/provider/src/main/resources/initial/sliapi-provider.xml +++ b/sliapi/provider/src/main/resources/initial/sliapi-provider.xml @@ -26,7 +26,7 @@ - + prefix:sliapi-provider-impl sliapi-provider-impl -- cgit 1.2.3-korg