From 5363b2782d906a6c6067eb840392f959ed4dfe4b Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 18 Jul 2017 20:23:07 -0400 Subject: [CCSDK-6] Populate seed code Add seed code for sli/adaptors repository Update code to use org.onap.ccsdk.sli.core Change-Id: I477c7a24f2cc1fed8fb0975fe9f33733411c27f9 Signed-off-by: Dan Timoney --- .../sdnc/sli/resource/sql/SqlResource.java | 516 +++++++++++++++++++++ .../sli/resource/sql/SqlResourceActivator.java | 96 ++++ .../src/main/resources/svclogic.properties | 34 ++ .../sdnc/sli/resource/sql/SqlResourceTest.java | 218 +++++++++ .../provider/src/test/resources/delete.tests | 2 + .../provider/src/test/resources/query.tests | 5 + .../provider/src/test/resources/save.tests | 13 + .../src/test/resources/simplelogger.properties | 22 + .../src/test/resources/svclogic.properties | 34 ++ 9 files changed, 940 insertions(+) create mode 100644 sql-resource/provider/src/main/java/org/openecomp/sdnc/sli/resource/sql/SqlResource.java create mode 100644 sql-resource/provider/src/main/java/org/openecomp/sdnc/sli/resource/sql/SqlResourceActivator.java create mode 100644 sql-resource/provider/src/main/resources/svclogic.properties create mode 100644 sql-resource/provider/src/test/java/org/openecomp/sdnc/sli/resource/sql/SqlResourceTest.java create mode 100755 sql-resource/provider/src/test/resources/delete.tests create mode 100755 sql-resource/provider/src/test/resources/query.tests create mode 100755 sql-resource/provider/src/test/resources/save.tests create mode 100644 sql-resource/provider/src/test/resources/simplelogger.properties create mode 100644 sql-resource/provider/src/test/resources/svclogic.properties (limited to 'sql-resource/provider/src') diff --git a/sql-resource/provider/src/main/java/org/openecomp/sdnc/sli/resource/sql/SqlResource.java b/sql-resource/provider/src/main/java/org/openecomp/sdnc/sli/resource/sql/SqlResource.java new file mode 100644 index 000000000..9c0007ebe --- /dev/null +++ b/sql-resource/provider/src/main/java/org/openecomp/sdnc/sli/resource/sql/SqlResource.java @@ -0,0 +1,516 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.openecomp.sdnc.sli.resource.sql; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Map; +import java.util.Map.Entry; + +import javax.sql.rowset.CachedRowSet; + +import org.apache.commons.lang3.StringUtils; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; +import org.onap.ccsdk.sli.core.dblib.DbLibService; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; +import org.onap.ccsdk.sli.core.sli.SvcLogicResource; +import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; +import org.osgi.framework.ServiceReference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SqlResource implements SvcLogicResource, SvcLogicJavaPlugin { + + private static final Logger LOG = LoggerFactory.getLogger(SqlResource.class); + + private static final String DBLIB_SERVICE = "org.openecomp.sdnc.sli.resource.dblib.DBResourceManager"; + + private static String CRYPT_KEY = ""; + + public SqlResource() { + } + + // For sql-resource, is-available is the same as exists + @Override + public QueryStatus isAvailable(String resource, String key, String prefix, SvcLogicContext ctx) + throws SvcLogicException { + + return (exists(resource, key, prefix, ctx)); + + } + + @Override + public QueryStatus exists(String resource, String key, String prefix, SvcLogicContext ctx) + throws SvcLogicException { + + DbLibService dblibSvc = getDbLibService(); + if (dblibSvc == null) { + return (QueryStatus.FAILURE); + } + + String theStmt = resolveCtxVars(key, ctx); + + try { + CachedRowSet results = dblibSvc.getData(theStmt, null, null); + + if (!results.next()) { + return (QueryStatus.NOT_FOUND); + } + + int numRows = results.getInt(1); + + if (numRows > 0) { + return (QueryStatus.SUCCESS); + } else { + return (QueryStatus.NOT_FOUND); + } + } catch (Exception e) { + LOG.error("Caught SQL exception", e); + return (QueryStatus.FAILURE); + } + } + + // @Override + public QueryStatus query(String resource, boolean localOnly, String select, String key, String prefix, + String orderBy, SvcLogicContext ctx) throws SvcLogicException { + + DbLibService dblibSvc = getDbLibService(); + + if (dblibSvc == null) { + return (QueryStatus.FAILURE); + } + + String sqlQuery = resolveCtxVars(key, ctx); + + try { + + CachedRowSet results = dblibSvc.getData(sqlQuery, null, null); + + QueryStatus retval = QueryStatus.SUCCESS; + + if (!results.next()) { + retval = QueryStatus.NOT_FOUND; + LOG.debug("No data found"); + } else { + saveCachedRowSetToCtx(results, ctx, prefix, dblibSvc); + } + return (retval); + } catch (Exception e) { + LOG.error("Caught SQL exception", e); + return (QueryStatus.FAILURE); + } + } + + public void saveCachedRowSetToCtx(CachedRowSet results, SvcLogicContext ctx, String prefix, DbLibService dblibSvc) + throws SQLException { + if (ctx != null) { + if ((prefix != null) && prefix.endsWith("[]")) { + // Return an array. + String pfx = prefix.substring(0, prefix.length() - 2); + int idx = 0; + do { + ResultSetMetaData rsMeta = results.getMetaData(); + int numCols = rsMeta.getColumnCount(); + + for (int i = 0; i < numCols; i++) { + String colValue = null; + String tableName = rsMeta.getTableName(i + 1); + if (rsMeta.getColumnType(i + 1) == java.sql.Types.VARBINARY) { + colValue = decryptColumn(tableName, rsMeta.getColumnName(i + 1), results.getBytes(i + 1), + dblibSvc); + } else { + colValue = results.getString(i + 1); + } + LOG.debug("Setting " + pfx + "[" + idx + "]." + + rsMeta.getColumnLabel(i + 1).replaceAll("_", "-") + " = " + colValue); + ctx.setAttribute(pfx + "[" + idx + "]." + rsMeta.getColumnLabel(i + 1).replaceAll("_", "-"), + colValue); + } + idx++; + } while (results.next()); + LOG.debug("Setting " + pfx + "_length = " + idx); + ctx.setAttribute(pfx + "_length", "" + idx); + } else { + ResultSetMetaData rsMeta = results.getMetaData(); + int numCols = rsMeta.getColumnCount(); + + for (int i = 0; i < numCols; i++) { + String colValue = null; + String tableName = rsMeta.getTableName(i + 1); + if ("VARBINARY".equalsIgnoreCase(rsMeta.getColumnTypeName(i + 1))) { + colValue = decryptColumn(tableName, rsMeta.getColumnName(i + 1), results.getBytes(i + 1), + dblibSvc); + } else { + colValue = results.getString(i + 1); + } + if (prefix != null) { + LOG.debug("Setting " + prefix + "." + rsMeta.getColumnLabel(i + 1).replaceAll("_", "-") + " = " + + colValue); + ctx.setAttribute(prefix + "." + rsMeta.getColumnLabel(i + 1).replaceAll("_", "-"), colValue); + } else { + LOG.debug("Setting " + rsMeta.getColumnLabel(i + 1).replaceAll("_", "-") + " = " + colValue); + ctx.setAttribute(rsMeta.getColumnLabel(i + 1).replaceAll("_", "-"), colValue); + } + } + } + } + } + + // reserve is no-op + @Override + public QueryStatus reserve(String resource, String select, String key, String prefix, SvcLogicContext ctx) + throws SvcLogicException { + return (QueryStatus.SUCCESS); + } + + // release is no-op + @Override + public QueryStatus release(String resource, String key, SvcLogicContext ctx) throws SvcLogicException { + return (QueryStatus.SUCCESS); + } + + private QueryStatus executeSqlWrite(String key, SvcLogicContext ctx) throws SvcLogicException { + QueryStatus retval = QueryStatus.SUCCESS; + + DbLibService dblibSvc = getDbLibService(); + + if (dblibSvc == null) { + return (QueryStatus.FAILURE); + } + + String sqlStmt = resolveCtxVars(key, ctx); + + LOG.debug("key = [" + key + "]; sqlStmt = [" + sqlStmt + "]"); + try { + + if (!dblibSvc.writeData(sqlStmt, null, null)) { + retval = QueryStatus.FAILURE; + } + } catch (Exception e) { + LOG.error("Caught SQL exception", e); + retval = QueryStatus.FAILURE; + } + + return (retval); + + } + + private String resolveCtxVars(String key, SvcLogicContext ctx) { + if (key == null) { + return (null); + } + + if (key.startsWith("'") && key.endsWith("'")) { + key = key.substring(1, key.length() - 1); + LOG.debug("Stripped outer single quotes - key is now [" + key + "]"); + } + + String[] keyTerms = key.split("\\s+"); + + StringBuffer sqlBuffer = new StringBuffer(); + + for (int i = 0; i < keyTerms.length; i++) { + sqlBuffer.append(resolveTerm(keyTerms[i], ctx)); + sqlBuffer.append(" "); + } + + return (sqlBuffer.toString()); + } + + private String resolveTerm(String term, SvcLogicContext ctx) { + if (term == null) { + return (null); + } + + LOG.trace("resolveTerm: term is " + term); + + if (term.startsWith("$") && (ctx != null)) { + // Resolve any index variables. + term = resolveCtxVariable(term.substring(1), ctx); + // Escape single quote + if (term != null) { + term = term.replaceAll("'", "''"); + } + return ("'" + term + "'"); + } else { + return (term); + } + + } + + private String resolveCtxVariable(String ctxVarName, SvcLogicContext ctx) { + + if (ctxVarName.indexOf('[') == -1) { + // Ctx variable contains no arrays + if ("CRYPT_KEY".equals(ctxVarName)) { + // Handle crypt key as special case. If it's set as a context + // variable, use it. Otherwise, use + // configured crypt key. + String cryptKey = ctx.getAttribute(ctxVarName); + if ((cryptKey != null) && (cryptKey.length() > 0)) { + return (cryptKey); + } else { + return (CRYPT_KEY); + } + } + return (ctx.getAttribute(ctxVarName)); + } + + // Resolve any array references + StringBuffer sbuff = new StringBuffer(); + String[] ctxVarParts = ctxVarName.split("\\["); + sbuff.append(ctxVarParts[0]); + for (int i = 1; i < ctxVarParts.length; i++) { + if (ctxVarParts[i].startsWith("$")) { + int endBracketLoc = ctxVarParts[i].indexOf("]"); + if (endBracketLoc == -1) { + // Missing end bracket ... give up parsing + LOG.warn("Variable reference " + ctxVarName + " seems to be missing a ']'"); + return (ctx.getAttribute(ctxVarName)); + } + + String idxVarName = ctxVarParts[i].substring(1, endBracketLoc); + String remainder = ctxVarParts[i].substring(endBracketLoc); + + sbuff.append("["); + sbuff.append(ctx.getAttribute(idxVarName)); + sbuff.append(remainder); + + } else { + // Index is not a variable reference + sbuff.append("["); + sbuff.append(ctxVarParts[i]); + } + } + + return (ctx.getAttribute(sbuff.toString())); + } + + @Override + public QueryStatus save(String resource, boolean force, boolean localOnly, String key, Map parms, + String prefix, SvcLogicContext ctx) throws SvcLogicException { + return (executeSqlWrite(key, ctx)); + } + + private DbLibService getDbLibService() { + // Try to get dblib as an OSGI service + DbLibService dblibSvc = null; + BundleContext bctx = null; + ServiceReference sref = null; + + Bundle bundle = FrameworkUtil.getBundle(SqlResource.class); + + if (bundle != null) { + bctx = bundle.getBundleContext(); + } + + if (bctx != null) { + sref = bctx.getServiceReference(DBLIB_SERVICE); + } + + if (sref == null) { + LOG.warn("Could not find service reference for DBLIB service (" + DBLIB_SERVICE + ")"); + } else { + dblibSvc = (DbLibService) bctx.getService(sref); + if (dblibSvc == null) { + LOG.warn("Could not find service reference for DBLIB service (" + DBLIB_SERVICE + ")"); + } + } + + if (dblibSvc == null) { + // Must not be running in an OSGI container. See if you can load it + // as a + // a POJO then. + try { + dblibSvc = DBResourceManager.create(System.getProperties()); + } catch (Exception e) { + LOG.error("Caught exception trying to create dblib service", e); + } + + if (dblibSvc == null) { + LOG.warn("Could not create new DBResourceManager"); + } + } + + return (dblibSvc); + } + + @Override + public QueryStatus notify(String resource, String action, String key, SvcLogicContext ctx) + throws SvcLogicException { + if (LOG.isDebugEnabled()) { + LOG.debug("SqlResource.notify called with resource=" + resource + ", action=" + action); + } + return QueryStatus.SUCCESS; + } + + @Override + public QueryStatus delete(String resource, String key, SvcLogicContext ctx) throws SvcLogicException { + return (executeSqlWrite(key, ctx)); + } + + public QueryStatus update(String resource, String key, Map parms, String prefix, + SvcLogicContext ctx) throws SvcLogicException { + return (executeSqlWrite(key, ctx)); + } + + private String decryptColumn(String tableName, String colName, byte[] colValue, DbLibService dblibSvc) { + String strValue = new String(colValue); + + if (StringUtils.isAsciiPrintable(strValue)) { + + // If printable, not encrypted + return (strValue); + } else { + PreparedStatement stmt = null; + Connection conn = null; + ResultSet results = null; + try { + // CachedRowSet results = + // dblibSvc.getData("SELECT + // CAST(AES_DECRYPT('"+strValue+"','"+CRYPT_KEY+"') AS CHAR(50)) + // FROM DUAL", + // null, null); + conn = ((DBResourceManager) dblibSvc).getConnection(); + + stmt = conn.prepareStatement("SELECT CAST(AES_DECRYPT(?, ?) AS CHAR(50)) FROM DUAL"); + + stmt.setBytes(1, colValue); + stmt.setString(2, getCryptKey()); + + results = stmt.executeQuery(); + + if ((results != null) && results.next()) { + strValue = results.getString(1); + LOG.debug("Decrypted value is " + strValue); + } else { + LOG.warn("Cannot decrypt " + tableName + "." + colName); + } + } catch (Exception e) { + LOG.error("Caught exception trying to decrypt " + tableName + "." + colName, e); + } finally { + try { + if (results != null) { + results.close(); + results = null; + } + } catch (Exception exc) { + + } + + try { + if (stmt != null) { + stmt.close(); + stmt = null; + } + } catch (Exception exc) { + + } + + try { + if (conn != null) { + conn.close(); + conn = null; + } + } catch (Exception exc) { + + } + + } + } + return (strValue); + } + + public static String getCryptKey() { + return (CRYPT_KEY); + } + + public static String setCryptKey(String key) { + CRYPT_KEY = key; + return (CRYPT_KEY); + } + + public String parameterizedQuery(Map parameters, SvcLogicContext ctx) throws SvcLogicException { + DbLibService dblibSvc = getDbLibService(); + String prefix = parameters.get("prefix"); + String query = parameters.get("query"); + + ArrayList arguments = new ArrayList(); + for (Entry a : parameters.entrySet()) { + if (a.getKey().startsWith("param")) { + arguments.add(a.getValue()); + } + } + + try { + if (dblibSvc == null) { + return mapQueryStatus(QueryStatus.FAILURE); + } + if (query.contains("count") || query.contains("COUNT")) { + CachedRowSet results = dblibSvc.getData(query, arguments, null); + + if (!results.next()) { + return mapQueryStatus(QueryStatus.FAILURE); + } + + int numRows = results.getInt(1); + ctx.setAttribute(prefix + ".count", String.valueOf(numRows)); + if (numRows > 0) { + return "true"; + } else { + return "false"; + } + } else if (query.startsWith("select") || query.startsWith("SELECT")) { + CachedRowSet results = dblibSvc.getData(query, arguments, null); + if (!results.next()) { + return mapQueryStatus(QueryStatus.NOT_FOUND); + } else { + saveCachedRowSetToCtx(results, ctx, prefix, dblibSvc); + } + } else { + if (!dblibSvc.writeData(query, arguments, null)) { + return mapQueryStatus(QueryStatus.FAILURE); + } + } + return mapQueryStatus(QueryStatus.SUCCESS); + } catch (SQLException e) { + LOG.error("Caught SQL exception", e); + return mapQueryStatus(QueryStatus.FAILURE); + } + } + + protected String mapQueryStatus(QueryStatus status) { + String str = status.toString(); + str = str.toLowerCase(); + str = str.replaceAll("_", "-"); + return str; + } +} diff --git a/sql-resource/provider/src/main/java/org/openecomp/sdnc/sli/resource/sql/SqlResourceActivator.java b/sql-resource/provider/src/main/java/org/openecomp/sdnc/sli/resource/sql/SqlResourceActivator.java new file mode 100644 index 000000000..e1994b2e3 --- /dev/null +++ b/sql-resource/provider/src/main/java/org/openecomp/sdnc/sli/resource/sql/SqlResourceActivator.java @@ -0,0 +1,96 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.openecomp.sdnc.sli.resource.sql; + +import java.io.File; +import java.io.FileInputStream; +import java.util.Properties; + +import org.onap.ccsdk.sli.core.sli.SvcLogicResource; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceRegistration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SqlResourceActivator implements BundleActivator { + + private static final String SQLRESOURCE_PROP_PATH = "/sql-resource.properties"; + + private ServiceRegistration registration = null; + + private static final Logger LOG = LoggerFactory + .getLogger(SqlResourceActivator.class); + + @Override + public void start(BundleContext ctx) throws Exception { + + String cfgDir = System.getenv("SDNC_CONFIG_DIR"); + + if ((cfgDir == null) || (cfgDir.length() == 0)) { + cfgDir = "/opt/sdnc/data/properties"; + LOG.warn("SDNC_CONFIG_DIR unset - defaulting to "+cfgDir); + } + + String cryptKey = ""; + + File sqlResourcePropFile = new File(cfgDir+SQLRESOURCE_PROP_PATH); + Properties sqlResourceProps = new Properties(); + if (sqlResourcePropFile.exists()) { + try { + + sqlResourceProps.load(new FileInputStream(sqlResourcePropFile)); + + cryptKey = sqlResourceProps.getProperty("org.openecomp.sdnc.resource.sql.cryptkey"); + } catch (Exception e) { + LOG.warn( + "Could not load properties file " + sqlResourcePropFile.getAbsolutePath(), e); + } + } else { + LOG.warn("Cannot read "+sqlResourcePropFile.getAbsolutePath()+" to find encryption key - using default"); + } + + SqlResource.setCryptKey(cryptKey); + + // Advertise Sql resource adaptor + SvcLogicResource impl = new SqlResource(); + String regName = impl.getClass().getName(); + + if (registration == null) + { + LOG.debug("Registering SqlResource service "+regName); + registration =ctx.registerService(regName, impl, null); + } + + } + + @Override + public void stop(BundleContext ctx) throws Exception { + + if (registration != null) + { + registration.unregister(); + registration = null; + } + } + +} diff --git a/sql-resource/provider/src/main/resources/svclogic.properties b/sql-resource/provider/src/main/resources/svclogic.properties new file mode 100644 index 000000000..a7948fc55 --- /dev/null +++ b/sql-resource/provider/src/main/resources/svclogic.properties @@ -0,0 +1,34 @@ +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 ONAP 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.openecomp.sdnc.sli.dbtype=jdbc +org.openecomp.sdnc.sli.jdbc.hosts=sdnctldb01,sdnctldb02 +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.openecomp.sdnc.sli.jdbc.connection.name=sdnctldb01 + +org.openecomp.sdnc.sli.jdbc.connection.timeout=50 +org.openecomp.sdnc.sli.jdbc.request.timeout=100 +org.openecomp.sdnc.sli.jdbc.limit.init=10 +org.openecomp.sdnc.sli.jdbc.limit.min=10 +org.openecomp.sdnc.sli.jdbc.limit.max=20 diff --git a/sql-resource/provider/src/test/java/org/openecomp/sdnc/sli/resource/sql/SqlResourceTest.java b/sql-resource/provider/src/test/java/org/openecomp/sdnc/sli/resource/sql/SqlResourceTest.java new file mode 100644 index 000000000..5b35f5aa7 --- /dev/null +++ b/sql-resource/provider/src/test/java/org/openecomp/sdnc/sli/resource/sql/SqlResourceTest.java @@ -0,0 +1,218 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.openecomp.sdnc.sli.resource.sql; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.Enumeration; +import java.util.Properties; + +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import junit.framework.TestCase; + +public class SqlResourceTest extends TestCase { + + private static final Logger LOG = LoggerFactory + .getLogger(SqlResourceTest.class); + + + public void testExists() { + + + Properties props = new Properties(); + InputStream propStr = getClass().getResourceAsStream("/svclogic.properties"); + if (propStr == null) { + fail("src/test/resources/svclogic.properties missing"); + } + + try { + props.load(propStr); + propStr.close(); + } catch (Exception e) { + e.printStackTrace(); + fail("Could not initialize properties"); + } + + // Add properties to global properties + + Enumeration propNames = props.keys(); + + while (propNames.hasMoreElements()) { + String propName = (String) propNames.nextElement(); + + System.setProperty(propName, props.getProperty(propName)); + } + + SqlResource sqlResource = new SqlResource(); + + + + InputStream testStr = getClass().getResourceAsStream("/save.tests"); + BufferedReader testsReader = new BufferedReader(new InputStreamReader(testStr)); + SvcLogicContext ctx = new SvcLogicContext(); + + try { + String testExpr = null; + + int testNum = 0; + while ((testExpr = testsReader.readLine()) != null) { + testExpr = testExpr.trim(); + + if (testExpr.startsWith("#")) { + testExpr = testExpr.substring(1).trim(); + String[] nameValue = testExpr.split("="); + String name = nameValue[0].trim(); + String value = nameValue[1].trim(); + + LOG.info("Setting context attribute " + name + " = " + + value); + ctx.setAttribute(name, value); + + } else { + + testNum++; + String sqlStmt = testExpr; + QueryStatus status = sqlResource.save("SQL", true, false, sqlStmt, null, "savetest"+testNum, ctx); + + switch (status) { + case SUCCESS: + LOG.info("Found data for query [" + sqlStmt + "]"); + break; + case NOT_FOUND: + LOG.info("Did not data for query [" + sqlStmt + "]"); + break; + default: + fail("Failure executing query [" + sqlStmt + "]"); + + } + } + } + + } catch (Exception e) { + e.printStackTrace(); + fail("Caught exception running tests"); + } + + + testStr = getClass().getResourceAsStream("/query.tests"); + testsReader = new BufferedReader(new InputStreamReader(testStr)); + + try { + String testExpr = null; + + int testNum = 0; + while ((testExpr = testsReader.readLine()) != null) { + testExpr = testExpr.trim(); + if (testExpr.startsWith("#")) { + testExpr = testExpr.substring(1).trim(); + String[] nameValue = testExpr.split("="); + String name = nameValue[0].trim(); + String value = nameValue[1].trim(); + + LOG.info("Setting context attribute " + name + " = " + + value); + ctx.setAttribute(name, value); + + } else { + + testNum++; + + String sqlStmt = testExpr; + QueryStatus status = sqlResource.query("SQL", false, null, + sqlStmt, "querytest" + testNum, null, ctx); + + switch (status) { + case SUCCESS: + LOG.info("Found data for query [" + sqlStmt + "]"); + break; + case NOT_FOUND: + LOG.info("Did not data for query [" + sqlStmt + "]"); + break; + default: + fail("Failure executing query [" + sqlStmt + "]"); + + } + } + } + + } catch (Exception e) { + e.printStackTrace(); + fail("Caught exception running tests"); + } + + + testStr = getClass().getResourceAsStream("/delete.tests"); + testsReader = new BufferedReader(new InputStreamReader(testStr)); + + try { + String testExpr = null; + + int testNum = 0; + while ((testExpr = testsReader.readLine()) != null) { + testExpr = testExpr.trim(); + if (testExpr.startsWith("#")) { + testExpr = testExpr.substring(1).trim(); + String[] nameValue = testExpr.split("="); + String name = nameValue[0].trim(); + String value = nameValue[1].trim(); + + LOG.info("Setting context attribute " + name + " = " + + value); + ctx.setAttribute(name, value); + + } else { + + testNum++; + + String sqlStmt = testExpr; + QueryStatus status = sqlResource.delete("SQL", sqlStmt, ctx); + + switch (status) { + case SUCCESS: + LOG.info("Found data for query [" + sqlStmt + "]"); + break; + case NOT_FOUND: + LOG.info("Did not data for query [" + sqlStmt + "]"); + break; + default: + fail("Failure executing query [" + sqlStmt + "]"); + + } + } + } + + } catch (Exception e) { + e.printStackTrace(); + fail("Caught exception running tests"); + } + + for (String attrName : ctx.getAttributeKeySet()) { + LOG.info("ctx.getAttribute("+attrName+") = "+ctx.getAttribute(attrName)); + } + } + +} diff --git a/sql-resource/provider/src/test/resources/delete.tests b/sql-resource/provider/src/test/resources/delete.tests new file mode 100755 index 000000000..a60a3bc73 --- /dev/null +++ b/sql-resource/provider/src/test/resources/delete.tests @@ -0,0 +1,2 @@ +DROP TABLE SQLRESOURCE_ORDER; +DROP TABLE SQLRESOURCE_ORDER_ITEM; diff --git a/sql-resource/provider/src/test/resources/query.tests b/sql-resource/provider/src/test/resources/query.tests new file mode 100755 index 000000000..ec05c22e3 --- /dev/null +++ b/sql-resource/provider/src/test/resources/query.tests @@ -0,0 +1,5 @@ +# max-price = 100 +SELECT * FROM SQLRESOURCE_ORDER where placed_on < now(); +SELECT SQLRESOURCE_ORDER.order_number, clli, service, price FROM SQLRESOURCE_ORDER, SQLRESOURCE_ORDER_ITEM where SQLRESOURCE_ORDER.order_number = SQLRESOURCE_ORDER_ITEM.order_number and price > $max-price ; +SELECT SQLRESOURCE_ORDER.order_number, clli, service, price FROM SQLRESOURCE_ORDER, SQLRESOURCE_ORDER_ITEM where SQLRESOURCE_ORDER.order_number = SQLRESOURCE_ORDER_ITEM.order_number and price < $max-price ; +SELECT SQLRESOURCE_ORDER.order_number AS ordernum, clli, service, price FROM SQLRESOURCE_ORDER, SQLRESOURCE_ORDER_ITEM where SQLRESOURCE_ORDER.order_number = SQLRESOURCE_ORDER_ITEM.order_number and price < $max-price ; diff --git a/sql-resource/provider/src/test/resources/save.tests b/sql-resource/provider/src/test/resources/save.tests new file mode 100755 index 000000000..e2c42217d --- /dev/null +++ b/sql-resource/provider/src/test/resources/save.tests @@ -0,0 +1,13 @@ +# order-number = 1234 +# zero = 0 +# item[0].clli = MTJNJA14 +# item[0].service = NoD +# item[0].price = 1000000 +# item[1].clli = MTJNJA14 +# item[1].service = Pizza +# item[1].price = 10 +CREATE TABLE IF NOT EXISTS SQLRESOURCE_ORDER (order_number VARCHAR(40), placed_on TIMESTAMP); +CREATE TABLE IF NOT EXISTS SQLRESOURCE_ORDER_ITEM (order_number VARCHAR(40), clli VARCHAR(40), service VARCHAR(40), price INTEGER(4)); +INSERT INTO SQLRESOURCE_ORDER VALUES ( $order-number , now()); +INSERT INTO SQLRESOURCE_ORDER_ITEM VALUES( $order-number , $item[$zero].clli , $item[0].service , $item[0].price ); +INSERT INTO SQLRESOURCE_ORDER_ITEM VALUES( $order-number , $item[1].clli , $item[1].service , $item[1].price ); diff --git a/sql-resource/provider/src/test/resources/simplelogger.properties b/sql-resource/provider/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..b28e45781 --- /dev/null +++ b/sql-resource/provider/src/test/resources/simplelogger.properties @@ -0,0 +1,22 @@ +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 ONAP 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.slf4j.simpleLogger.defaultLogLevel=debug diff --git a/sql-resource/provider/src/test/resources/svclogic.properties b/sql-resource/provider/src/test/resources/svclogic.properties new file mode 100644 index 000000000..16ac91c93 --- /dev/null +++ b/sql-resource/provider/src/test/resources/svclogic.properties @@ -0,0 +1,34 @@ +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 ONAP 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.openecomp.sdnc.sli.dbtype=jdbc +org.openecomp.sdnc.sli.jdbc.hosts=localhost +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.openecomp.sdnc.sli.jdbc.connection.name=sdnctldb01 + +org.openecomp.sdnc.sli.jdbc.connection.timeout=50 +org.openecomp.sdnc.sli.jdbc.request.timeout=100 +org.openecomp.sdnc.sli.jdbc.limit.init=10 +org.openecomp.sdnc.sli.jdbc.limit.min=10 +org.openecomp.sdnc.sli.jdbc.limit.max=20 -- cgit 1.2.3-korg From df8f780fdad167fda692e846641c4fe966b240cb Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 15 Aug 2017 10:04:19 -0400 Subject: Fix license headers Licence headers were accidentally updated incorrectly by previous update. This commit restores the license headers for seed code to the wording from the original seed code Change-Id: If4623dd02a37660a7d7e746363dd83cf9cdb718a Issue-ID: CCSDK-31 Signed-off-by: Dan Timoney --- aai-service/features/src/main/resources/features.xml | 6 +++--- aai-service/installer/src/assembly/assemble_installer_zip.xml | 4 ++-- aai-service/installer/src/assembly/assemble_mvnrepo_zip.xml | 4 ++-- aai-service/installer/src/main/resources/scripts/install-feature.sh | 4 ++-- .../src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/AAIExecutorInterface.java | 4 ++-- .../src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java | 4 ++-- .../src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceActivator.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceException.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceUtils.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/AAITrinityService.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/CloudRegionRequest.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/CustomQueryRequest.java | 4 ++-- .../src/main/java/org/onap/ccsdk/sli/adaptors/aai/EchoRequest.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/GenericQueryRequest.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/adaptors/aai/GenericRequest.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfRequest.java | 4 ++-- .../ccsdk/sli/adaptors/aai/L3InterfaceIpv4AddressListRequest.java | 4 ++-- .../ccsdk/sli/adaptors/aai/L3InterfaceIpv6AddressListRequest.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/LInterfaceRequest.java | 4 ++-- .../org/onap/ccsdk/sli/adaptors/aai/LagInterfacePnfRequest.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/NamedQueryRequest.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/NodesQueryRequest.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/PInterfacePnfRequest.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/PInterfaceRequest.java | 4 ++-- .../src/main/java/org/onap/ccsdk/sli/adaptors/aai/PathRequest.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/PhysicalLinkRequest.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/RelationshipRequest.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/adaptors/aai/SelfLinkRequest.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/SubInterfaceRequest.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/adaptors/aai/UpdateRequest.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/adaptors/aai/data/AAIDatum.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/data/EchoResponse.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/data/ErrorResponse.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/data/RequestError.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/data/ResourceVersion.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/data/ResponseMessage.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/data/ResponseMessages.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/data/ServiceException.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/data/SubInterface.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/adaptors/aai/data/Variables.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/data/notify/KeyDatum.java | 4 ++-- .../org/onap/ccsdk/sli/adaptors/aai/data/notify/NotifyEvent.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Flavor.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Host.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Image.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/IpAddress.java | 4 ++-- .../org/onap/ccsdk/sli/adaptors/aai/data/v1507/Relationship.java | 4 ++-- .../onap/ccsdk/sli/adaptors/aai/data/v1507/RelationshipDatum.java | 4 ++-- .../onap/ccsdk/sli/adaptors/aai/data/v1507/RelationshipList.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/VServer.java | 4 ++-- .../ccsdk/sli/adaptors/aai/query/FormattedQueryRequestData.java | 4 ++-- .../onap/ccsdk/sli/adaptors/aai/query/FormattedQueryResultList.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/query/InstanceFilter.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/query/InstanceFilters.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/adaptors/aai/query/NamedQuery.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/query/NamedQueryData.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/query/QueryParameters.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/adaptors/aai/query/Results.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/adaptors/aai/update/Action.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/update/ActionDatum.java | 4 ++-- .../main/java/org/onap/ccsdk/sli/adaptors/aai/update/Update.java | 4 ++-- .../java/org/onap/ccsdk/sli/adaptors/aai/update/UpdateNodeKey.java | 4 ++-- aai-service/provider/src/main/resources/aai-path.properties | 4 ++-- .../onap/ccsdk/sli/adaptors/aai/r1607/R1607AutoGeneratedTest.java | 4 ++-- aai-service/provider/src/test/resources/aaiclient.properties | 4 ++-- mdsal-resource/features/src/main/resources/features.xml | 4 ++-- mdsal-resource/installer/src/assembly/assemble_installer_zip.xml | 4 ++-- mdsal-resource/installer/src/assembly/assemble_mvnrepo_zip.xml | 4 ++-- .../installer/src/main/resources/scripts/install-feature.sh | 4 ++-- .../java/org/openecomp/sdnc/sli/resource/mdsal/ConfigResource.java | 4 ++-- .../openecomp/sdnc/sli/resource/mdsal/MdsalResourceActivator.java | 4 ++-- .../org/openecomp/sdnc/sli/resource/mdsal/OperationalResource.java | 4 ++-- .../java/org/openecomp/sdnc/sli/resource/mdsal/RestService.java | 4 ++-- mdsal-resource/provider/src/main/resources/crtables.sql | 4 ++-- mdsal-resource/provider/src/main/resources/svclogic.properties | 4 ++-- resource-assignment/features/src/main/resources/features.xml | 4 ++-- .../installer/src/assembly/assemble_installer_zip.xml | 4 ++-- resource-assignment/installer/src/assembly/assemble_mvnrepo_zip.xml | 4 ++-- .../installer/src/main/resources/scripts/install-feature.sh | 4 ++-- .../src/main/java/org/openecomp/sdnc/lock/comp/LockHelper.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/lock/comp/LockHelperImpl.java | 4 ++-- .../java/org/openecomp/sdnc/lock/comp/ResourceLockedException.java | 4 ++-- .../java/org/openecomp/sdnc/lock/comp/SynchronizedFunction.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/lock/dao/ResourceLockDao.java | 4 ++-- .../main/java/org/openecomp/sdnc/lock/dao/ResourceLockDaoImpl.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/lock/data/ResourceLock.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/ReleaseRequestType.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/ReserveRequestType.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/ResourceAllocator.java | 4 ++-- .../java/org/openecomp/sdnc/ra/alloc/AffinityAllocationRule.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/alloc/DbAllocationRule.java | 4 ++-- .../java/org/openecomp/sdnc/ra/alloc/ServingSiteAllocationRule.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/alloc/VrfAllocationRule.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/check/AnyVrfPresentCheck.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/check/ExcludeVpeCheck.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/check/HubWithRgCheck.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/check/OneMVrfCheck.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/check/ProvStatusCheck.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/check/VlanSpeedCheck.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/check/VpeLockCheck.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/comp/AllocationRule.java | 4 ++-- .../org/openecomp/sdnc/ra/comp/EndPointAllocationDefinition.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/comp/EndPointAllocator.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/comp/EndPointAllocatorImpl.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/comp/EndPointData.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/comp/EquipmentCheck.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/comp/PreferenceRule.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/comp/ServiceData.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/equip/comp/EquipmentReader.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/equip/dao/ServerDao.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/equip/dao/ServerDaoImpl.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/equip/dao/VpePortDao.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/equip/dao/VpePortDaoImpl.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/equip/dao/VplspePortDao.java | 4 ++-- .../java/org/openecomp/sdnc/ra/equip/dao/VplspePortDaoImpl.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/equip/data/EquipmentData.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/equip/data/EquipmentLevel.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/pref/AffinityLinkPref.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/pref/EvcExistingVrfPref.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/reader/AicSiteReader.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/reader/UplinkCircuitReader.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/reader/VnfReader.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/reader/VpePortReader.java | 4 ++-- .../org/openecomp/sdnc/ra/rule/comp/AllocationRequestBuilder.java | 4 ++-- .../openecomp/sdnc/ra/rule/comp/AllocationRequestBuilderImpl.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/rule/dao/MaxPortSpeedDao.java | 4 ++-- .../java/org/openecomp/sdnc/ra/rule/dao/MaxPortSpeedDaoImpl.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/rule/dao/MaxServerSpeedDao.java | 4 ++-- .../java/org/openecomp/sdnc/ra/rule/dao/MaxServerSpeedDaoImpl.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/rule/dao/ParameterDao.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/rule/dao/ParameterDaoImpl.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/rule/dao/RangeRuleDao.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/rule/dao/RangeRuleDaoImpl.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/rule/dao/ResourceRuleDao.java | 4 ++-- .../java/org/openecomp/sdnc/ra/rule/dao/ResourceRuleDaoImpl.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/rule/dao/VpeLockDao.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/rule/dao/VpeLockDaoImpl.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/rule/data/RangeRule.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/ra/rule/data/ResourceRule.java | 4 ++-- .../java/org/openecomp/sdnc/ra/rule/data/ResourceThreshold.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/rule/data/ThresholdStatus.java | 4 ++-- .../java/org/openecomp/sdnc/ra/service/dao/ServiceResourceDao.java | 4 ++-- .../org/openecomp/sdnc/ra/service/dao/ServiceResourceDaoImpl.java | 4 ++-- .../java/org/openecomp/sdnc/ra/service/data/ServiceResource.java | 4 ++-- .../main/java/org/openecomp/sdnc/ra/service/data/ServiceStatus.java | 4 ++-- .../main/java/org/openecomp/sdnc/rm/comp/AllocationFunction.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/comp/ReleaseFunction.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/comp/ResourceLoader.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/comp/ResourceManager.java | 4 ++-- .../main/java/org/openecomp/sdnc/rm/comp/ResourceManagerImpl.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/dao/ResourceDao.java | 4 ++-- .../main/java/org/openecomp/sdnc/rm/dao/jdbc/AllocationItem.java | 4 ++-- .../java/org/openecomp/sdnc/rm/dao/jdbc/AllocationItemJdbcDao.java | 4 ++-- .../org/openecomp/sdnc/rm/dao/jdbc/AllocationItemJdbcDaoImpl.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/dao/jdbc/Resource.java | 4 ++-- .../main/java/org/openecomp/sdnc/rm/dao/jdbc/ResourceDaoImpl.java | 4 ++-- .../main/java/org/openecomp/sdnc/rm/dao/jdbc/ResourceJdbcDao.java | 4 ++-- .../java/org/openecomp/sdnc/rm/dao/jdbc/ResourceJdbcDaoImpl.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/dao/jdbc/ResourceLoad.java | 4 ++-- .../java/org/openecomp/sdnc/rm/dao/jdbc/ResourceLoadJdbcDao.java | 4 ++-- .../org/openecomp/sdnc/rm/dao/jdbc/ResourceLoadJdbcDaoImpl.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/data/AllocationAction.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/data/AllocationItem.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/data/AllocationOutcome.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/data/AllocationRequest.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/data/AllocationStatus.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/data/InitAction.java | 4 ++-- .../main/java/org/openecomp/sdnc/rm/data/LabelAllocationItem.java | 4 ++-- .../java/org/openecomp/sdnc/rm/data/LabelAllocationOutcome.java | 4 ++-- .../java/org/openecomp/sdnc/rm/data/LabelAllocationRequest.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/data/LabelResource.java | 4 ++-- .../main/java/org/openecomp/sdnc/rm/data/LimitAllocationItem.java | 4 ++-- .../java/org/openecomp/sdnc/rm/data/LimitAllocationOutcome.java | 4 ++-- .../java/org/openecomp/sdnc/rm/data/LimitAllocationRequest.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/data/LimitResource.java | 4 ++-- .../org/openecomp/sdnc/rm/data/MultiAssetAllocationOutcome.java | 4 ++-- .../org/openecomp/sdnc/rm/data/MultiAssetAllocationRequest.java | 4 ++-- .../org/openecomp/sdnc/rm/data/MultiResourceAllocationOutcome.java | 4 ++-- .../org/openecomp/sdnc/rm/data/MultiResourceAllocationRequest.java | 4 ++-- .../main/java/org/openecomp/sdnc/rm/data/RangeAllocationItem.java | 4 ++-- .../java/org/openecomp/sdnc/rm/data/RangeAllocationOutcome.java | 4 ++-- .../java/org/openecomp/sdnc/rm/data/RangeAllocationRequest.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/data/RangeResource.java | 4 ++-- .../provider/src/main/java/org/openecomp/sdnc/rm/data/Resource.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/data/ResourceKey.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/data/ResourceLoad.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/data/ResourceType.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/util/LabelUtil.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/util/LimitUtil.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/util/RangeUtil.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/rm/util/ResourceUtil.java | 4 ++-- .../main/java/org/openecomp/sdnc/util/db/CachedDataSourceWrap.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/util/db/ConnectionWrap.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/util/db/DataSourceWrap.java | 4 ++-- .../main/java/org/openecomp/sdnc/util/expr/ExpressionEvaluator.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/util/speed/SpeedUtil.java | 4 ++-- .../provider/src/main/java/org/openecomp/sdnc/util/str/StrUtil.java | 4 ++-- .../src/main/java/org/openecomp/sdnc/util/vrf/VpnParam.java | 4 ++-- .../provider/src/main/java/org/openecomp/sdnc/util/vrf/VrfUtil.java | 4 ++-- .../main/resources/META-INF/spring/resource-assignment-context.xml | 4 ++-- .../resources/META-INF/spring/resource-assignment-osgi-context.xml | 4 ++-- .../provider/src/main/resources/resource-allocator.properties | 4 ++-- .../provider/src/main/resources/sql/001_resource_rule_ddl.sql | 4 ++-- .../provider/src/main/resources/sql/002_max_port_speed_ddl.sql | 4 ++-- .../provider/src/main/resources/sql/003_max_server_speed_ddl.sql | 4 ++-- .../src/test/java/jtest/org/openecomp/sdnc/ra/DataSetup.java | 4 ++-- .../src/test/java/jtest/org/openecomp/sdnc/ra/TestIsAvailable.java | 4 ++-- .../src/test/java/jtest/org/openecomp/sdnc/ra/TestQuery.java | 4 ++-- .../src/test/java/jtest/org/openecomp/sdnc/ra/TestRelease.java | 4 ++-- .../src/test/java/jtest/org/openecomp/sdnc/ra/TestReserve.java | 4 ++-- .../src/test/java/jtest/org/openecomp/sdnc/ra/TestReserve2.java | 4 ++-- .../src/test/java/jtest/org/openecomp/sdnc/rm/DataSetup.java | 4 ++-- .../src/test/java/jtest/util/org/openecomp/sdnc/ra/TestDb.java | 4 ++-- .../src/test/java/jtest/util/org/openecomp/sdnc/ra/TestTable.java | 4 ++-- resource-assignment/provider/src/test/resources/log4j.properties | 4 ++-- resource-assignment/provider/src/test/resources/sql/data.sql | 4 ++-- resource-assignment/provider/src/test/resources/sql/schema.sql | 4 ++-- resource-assignment/provider/src/test/resources/test-context.xml | 4 ++-- sql-resource/features/src/main/resources/features.xml | 4 ++-- sql-resource/installer/src/assembly/assemble_installer_zip.xml | 4 ++-- sql-resource/installer/src/assembly/assemble_mvnrepo_zip.xml | 4 ++-- .../installer/src/main/resources/scripts/install-feature.sh | 4 ++-- .../main/java/org/openecomp/sdnc/sli/resource/sql/SqlResource.java | 4 ++-- .../org/openecomp/sdnc/sli/resource/sql/SqlResourceActivator.java | 4 ++-- sql-resource/provider/src/main/resources/svclogic.properties | 4 ++-- .../java/org/openecomp/sdnc/sli/resource/sql/SqlResourceTest.java | 4 ++-- sql-resource/provider/src/test/resources/simplelogger.properties | 4 ++-- sql-resource/provider/src/test/resources/svclogic.properties | 4 ++-- 231 files changed, 463 insertions(+), 463 deletions(-) (limited to 'sql-resource/provider/src') diff --git a/aai-service/features/src/main/resources/features.xml b/aai-service/features/src/main/resources/features.xml index c992710a0..bd3d0bc1d 100644 --- a/aai-service/features/src/main/resources/features.xml +++ b/aai-service/features/src/main/resources/features.xml @@ -1,10 +1,10 @@ + + + + + + + + + + + + + + org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource + + + + diff --git a/sql-resource/provider/src/main/resources/sql-resource.properties b/sql-resource/provider/src/main/resources/sql-resource.properties new file mode 100755 index 000000000..ac32f7734 --- /dev/null +++ b/sql-resource/provider/src/main/resources/sql-resource.properties @@ -0,0 +1,23 @@ +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +org.openecomp.sdnc.resource.sql.cryptkey=QtfJMKggVk + diff --git a/sql-resource/provider/src/main/resources/svclogic.properties b/sql-resource/provider/src/main/resources/svclogic.properties index b7e8928e7..18718b869 100644 --- a/sql-resource/provider/src/main/resources/svclogic.properties +++ b/sql-resource/provider/src/main/resources/svclogic.properties @@ -3,7 +3,7 @@ # openECOMP : SDN-C # ================================================================================ # Copyright (C) 2017 AT&T Intellectual Property. All rights -# reserved. +# reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/ITCaseSqlResource.java b/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/ITCaseSqlResource.java old mode 100644 new mode 100755 index e66034ba8..2863c6c96 --- a/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/ITCaseSqlResource.java +++ b/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/ITCaseSqlResource.java @@ -80,7 +80,7 @@ public class ITCaseSqlResource extends TestCase { System.setProperty(propName, props.getProperty(propName)); } - SqlResource sqlResource = new SqlResource(); + SqlResource sqlResource = new SqlResource(new SqlResourcePropertiesProviderImpl()); diff --git a/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java b/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java new file mode 100755 index 000000000..404783d0f --- /dev/null +++ b/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java @@ -0,0 +1,25 @@ +package org.onap.ccsdk.sli.adaptors.resource.sql; + +import static org.junit.Assert.assertNotNull; + +import java.util.Properties; + +import org.junit.Test; + +public class SqlResourceProviderTest { + + private static SqlResourcePropertiesProvider provider; + + @Test + public void testSqlResourceProvider() { + provider = new SqlResourcePropertiesProviderImpl(); + assertNotNull(provider); + } + + @Test + public void testGetProperties() { + Properties properties = provider.getProperties(); + assertNotNull(properties); + } + +} diff --git a/sql-resource/provider/src/test/resources/sql-resource.properties b/sql-resource/provider/src/test/resources/sql-resource.properties new file mode 100755 index 000000000..ac32f7734 --- /dev/null +++ b/sql-resource/provider/src/test/resources/sql-resource.properties @@ -0,0 +1,23 @@ +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +org.openecomp.sdnc.resource.sql.cryptkey=QtfJMKggVk + -- cgit 1.2.3-korg From ef9d1e2475a2184ff1b245648e1f0f93ae341c6b Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 21 Mar 2018 17:34:27 -0400 Subject: Add default SqlResource constructor Add default constructor for SqlResource class. Change-Id: Id23dc1c391fac66fae7c2bb2b6170f049efe5940 Issue-ID: CCSDK-220 Signed-off-by: Timoney, Dan (dt5972) --- .../java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sql-resource/provider/src') diff --git a/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java b/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java index 869b8980a..dc6f76639 100755 --- a/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java +++ b/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java @@ -55,10 +55,14 @@ public class SqlResource implements SvcLogicResource, SvcLogicJavaPlugin { private static final String DBLIB_SERVICE = "org.onap.ccsdk.sli.core.dblib.DbLibService"; - private static String CRYPT_KEY = ""; + private static String CRYPT_KEY = "QtfJMKggVk"; DbLibService dblibSvc = null; + public SqlResource() { + this(new SqlResourcePropertiesProviderImpl(), null); + } + public SqlResource(SqlResourcePropertiesProvider propProvider) { this(propProvider, null); } -- cgit 1.2.3-korg From f3a007533b141852f1c6b5acc5d8bfb2b07ed502 Mon Sep 17 00:00:00 2001 From: "prakash.e" Date: Wed, 28 Mar 2018 16:31:50 +0530 Subject: coverage SqlResourcePropertiesProviderImpl Coverage improvement for SqlResourcePropertiesProviderImpl https://jira.onap.org/browse/CCSDK-213?jql=project%20%3D%20CCSDK%20AND%20text%20~%20coverage Issue-ID: CCSDK-213 Change-Id: I5e9fe5a223918d4111c937463078d5b69609f6c4 Signed-off-by: prakash.e --- .../adaptors/resource/sql/SqlResourceProviderTest.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'sql-resource/provider/src') diff --git a/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java b/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java index 404783d0f..b261b9f7d 100755 --- a/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java +++ b/sql-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResourceProviderTest.java @@ -1,7 +1,8 @@ package org.onap.ccsdk.sli.adaptors.resource.sql; import static org.junit.Assert.assertNotNull; - +import java.lang.reflect.Field; +import java.util.Map; import java.util.Properties; import org.junit.Test; @@ -9,9 +10,21 @@ import org.junit.Test; public class SqlResourceProviderTest { private static SqlResourcePropertiesProvider provider; + private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; @Test public void testSqlResourceProvider() { + try{ + Map env = System.getenv(); + Class cl = env.getClass(); + Field field = cl.getDeclaredField("m"); + field.setAccessible(true); + Map writableEnv = (Map) field.get(env); + writableEnv.put(SDNC_CONFIG_DIR, "./src/test/resources"); + } catch (Exception e) { + throw new IllegalStateException("Failed to set environment variable", e); + } + provider = new SqlResourcePropertiesProviderImpl(); assertNotNull(provider); } -- cgit 1.2.3-korg From 64ee66e381069375dc84f49d42114bb0c0c7b877 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 17 Apr 2018 13:10:15 -0400 Subject: Remove unnecessary cast Remove case in decryptColumn(), which (a) is no longer necessary and (b) throws a ClassNotFoundException when loaded via Aries Blueprint Change-Id: Ie5e748e0d53875bd9f912572e24763bdeb9cb82f Issue-ID: CCSDK-244 Signed-off-by: Timoney, Dan (dt5972) --- .../main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java | 2 +- version.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sql-resource/provider/src') diff --git a/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java b/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java index dc6f76639..1c0a00877 100755 --- a/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java +++ b/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java @@ -441,7 +441,7 @@ public class SqlResource implements SvcLogicResource, SvcLogicJavaPlugin { return (strValue); } else { ResultSet results = null; - try (Connection conn = ((DBResourceManager) dblibSvc).getConnection(); + try (Connection conn = dblibSvc.getConnection(); PreparedStatement stmt = conn.prepareStatement("SELECT CAST(AES_DECRYPT(?, ?) AS CHAR(50)) FROM DUAL")) { stmt.setBytes(1, colValue); diff --git a/version.properties b/version.properties index efb7e63bc..ebb19b8f6 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ release_name=0 sprint_number=2 -feature_revision=0 +feature_revision=1 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From b84ab092b638b5babc0c9c4c3a11d39deb03c695 Mon Sep 17 00:00:00 2001 From: Parshad Patel Date: Mon, 16 Jul 2018 11:11:04 +0900 Subject: Fix sonar issue in SqlResource.java Add finally clause to close ResultSet Issue-ID: CCSDK-332 Change-Id: I1b856123caf56fad08064c63013cfe0859c2ae53 Signed-off-by: Parshad Patel --- .../org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sql-resource/provider/src') diff --git a/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java b/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java index 1c0a00877..767fdac79 100755 --- a/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java +++ b/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java @@ -455,14 +455,15 @@ public class SqlResource implements SvcLogicResource, SvcLogicJavaPlugin { LOG.warn("Cannot decrypt " + tableName + "." + colName); } } catch (Exception e) { - if (results != null) { + LOG.error("Caught exception trying to decrypt " + tableName + "." + colName, e); + }finally { + if (results != null) { try { results.close(); - } catch (SQLException ignored) { - + } catch (SQLException se) { + LOG.error("Caught exception trying to close ResultSet",se); } } - LOG.error("Caught exception trying to decrypt " + tableName + "." + colName, e); } } return (strValue); -- cgit 1.2.3-korg From dbbd392fdc622c85958598213b2f423848666af6 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Wed, 3 Jul 2019 14:30:56 -0400 Subject: Code changes for OpenDaylight Neon Updated code for OpenDaylight Neon, using conversion script in ccsdk/parent/tools. Change-Id: Ic91cff9ee50102b8af1a73f829908de82995b2ef Issue-ID: CCSDK-1389 Signed-off-by: Timoney, Dan (dt5972) --- aai-service/features/ccsdk-aai-service/pom.xml | 4 +- aai-service/features/features-aai-service/pom.xml | 4 +- aai-service/features/pom.xml | 4 +- aai-service/installer/pom.xml | 4 +- aai-service/pom.xml | 4 +- aai-service/provider/pom.xml | 10 +- .../OSGI-INF/blueprint/aaiservice-blueprint.xml | 39 +++++++ ansible-adapter/ansible-adapter-bundle/pom.xml | 27 ++++- .../blueprint/ansible-adapter-blueprint.xml | 39 +++++++ .../ccsdk-ansible-adapter/pom.xml | 5 +- .../features-ansible-adapter/pom.xml | 4 +- ansible-adapter/ansible-adapter-features/pom.xml | 4 +- ansible-adapter/ansible-adapter-installer/pom.xml | 4 +- ansible-adapter/pom.xml | 4 +- artifacts/pom.xml | 21 +--- base/http/features/ccsdk-base-http/pom.xml | 2 +- base/http/features/features-base-http/pom.xml | 2 +- base/http/features/pom.xml | 2 +- base/http/installer/pom.xml | 2 +- base/http/pom.xml | 2 +- base/http/provider/pom.xml | 2 +- base/pom.xml | 2 +- features/ccsdk-sli-adaptors-all/pom.xml | 11 +- features/features-sli-adaptors/pom.xml | 4 +- features/installer/pom.xml | 4 +- features/pom.xml | 4 +- .../features/ccsdk-mdsal-resource/pom.xml | 6 +- .../features/features-mdsal-resource/pom.xml | 4 +- mdsal-resource/features/pom.xml | 4 +- mdsal-resource/installer/pom.xml | 4 +- mdsal-resource/pom.xml | 4 +- mdsal-resource/provider/pom.xml | 4 +- .../blueprint/mdsal-resource-blueprint.xml | 49 ++++++++ message-router/consumer/api/pom.xml | 2 +- .../features/ccsdk-messagerouter-consumer/pom.xml | 4 +- .../features-messagerouter-consumer/pom.xml | 4 +- message-router/consumer/features/pom.xml | 4 +- message-router/consumer/installer/pom.xml | 4 +- message-router/consumer/pom.xml | 2 +- message-router/consumer/provider/pom.xml | 2 +- message-router/pom.xml | 4 +- message-router/publisher/api/pom.xml | 2 +- .../features/ccsdk-messagerouter-publisher/pom.xml | 4 +- .../features-messagerouter-publisher/pom.xml | 4 +- message-router/publisher/features/pom.xml | 4 +- message-router/publisher/installer/pom.xml | 4 +- message-router/publisher/pom.xml | 2 +- message-router/publisher/provider/pom.xml | 2 +- message-router/publisher/sample.client/pom.xml | 2 +- netbox-client/features/ccsdk-netbox-client/pom.xml | 17 ++- .../features/features-netbox-client/pom.xml | 4 +- netbox-client/features/pom.xml | 4 +- netbox-client/installer/pom.xml | 4 +- netbox-client/pom.xml | 4 +- netbox-client/provider/pom.xml | 11 +- .../resources/OSGI-INF/blueprint/netbox-client.xml | 37 ++++++ pom.xml | 7 +- .../features/ccsdk-resource-assignment/pom.xml | 4 +- .../features/features-resource-assignment/pom.xml | 4 +- resource-assignment/features/pom.xml | 4 +- resource-assignment/installer/pom.xml | 4 +- resource-assignment/pom.xml | 4 +- resource-assignment/provider/pom.xml | 4 +- .../blueprint/resource-assignment-blueprint.xml | 33 ++++++ .../OSGI-INF/blueprint/resource-assignment.xml | 129 +++++++++++++++++++++ saltstack-adapter/pom.xml | 4 +- .../ccsdk-saltstack-adapter/pom.xml | 4 +- .../features-saltstack-adapter/pom.xml | 4 +- .../saltstack-adapter-features/pom.xml | 4 +- .../saltstack-adapter-installer/pom.xml | 4 +- .../saltstack-adapter-provider/pom.xml | 12 +- .../blueprint/saltstack-adapter-blueprint.xml | 42 +++++++ sql-resource/features/ccsdk-sql-resource/pom.xml | 4 +- .../features/features-sql-resource/pom.xml | 4 +- sql-resource/features/pom.xml | 4 +- sql-resource/installer/pom.xml | 4 +- sql-resource/pom.xml | 4 +- sql-resource/provider/pom.xml | 4 +- .../OSGI-INF/blueprint/sql-resource-blueprint.xml | 41 +++++++ version.properties | 4 +- 80 files changed, 584 insertions(+), 172 deletions(-) create mode 100755 aai-service/provider/src/main/resources/OSGI-INF/blueprint/aaiservice-blueprint.xml create mode 100755 ansible-adapter/ansible-adapter-bundle/src/main/resources/OSGI-INF/blueprint/ansible-adapter-blueprint.xml create mode 100755 mdsal-resource/provider/src/main/resources/OSGI-INF/blueprint/mdsal-resource-blueprint.xml create mode 100644 netbox-client/provider/src/main/resources/OSGI-INF/blueprint/netbox-client.xml create mode 100755 resource-assignment/provider/src/main/resources/OSGI-INF/blueprint/resource-assignment-blueprint.xml create mode 100755 resource-assignment/provider/src/main/resources/OSGI-INF/blueprint/resource-assignment.xml create mode 100755 saltstack-adapter/saltstack-adapter-provider/src/main/resources/OSGI-INF/blueprint/saltstack-adapter-blueprint.xml create mode 100755 sql-resource/provider/src/main/resources/OSGI-INF/blueprint/sql-resource-blueprint.xml (limited to 'sql-resource/provider/src') diff --git a/aai-service/features/ccsdk-aai-service/pom.xml b/aai-service/features/ccsdk-aai-service/pom.xml index 1c5b5e3f8..d9a956a49 100644 --- a/aai-service/features/ccsdk-aai-service/pom.xml +++ b/aai-service/features/ccsdk-aai-service/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors ccsdk-aai-service - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: aai-service :: ${project.artifactId} diff --git a/aai-service/features/features-aai-service/pom.xml b/aai-service/features/features-aai-service/pom.xml index 6af177d8b..20b366ddb 100755 --- a/aai-service/features/features-aai-service/pom.xml +++ b/aai-service/features/features-aai-service/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors features-aai-service - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: aai-service :: ${project.artifactId} diff --git a/aai-service/features/pom.xml b/aai-service/features/pom.xml index 434687b55..10f643256 100755 --- a/aai-service/features/pom.xml +++ b/aai-service/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors aai-service-features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: aai-service :: ${project.artifactId} diff --git a/aai-service/installer/pom.xml b/aai-service/installer/pom.xml index 9205617b5..1e5cacfef 100755 --- a/aai-service/installer/pom.xml +++ b/aai-service/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors aai-service-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: aai-service :: ${project.artifactId} diff --git a/aai-service/pom.xml b/aai-service/pom.xml index cbebfb182..8fe15434d 100755 --- a/aai-service/pom.xml +++ b/aai-service/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors aai-service - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: aai-service diff --git a/aai-service/provider/pom.xml b/aai-service/provider/pom.xml index e07c3ecf5..fa345562e 100755 --- a/aai-service/provider/pom.xml +++ b/aai-service/provider/pom.xml @@ -5,16 +5,17 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors aai-service-provider - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle ccsdk-sli-adaptors :: aai-service :: ${project.artifactId} + http://maven.apache.org UTF-8 @@ -47,18 +48,17 @@ org.onap.ccsdk.sli.core sli-common - provided + compile org.onap.ccsdk.sli.core sli-provider - provided + compile org.onap.ccsdk.sli.core utils-provider ${ccsdk.sli.core.version} - provided org.osgi diff --git a/aai-service/provider/src/main/resources/OSGI-INF/blueprint/aaiservice-blueprint.xml b/aai-service/provider/src/main/resources/OSGI-INF/blueprint/aaiservice-blueprint.xml new file mode 100755 index 000000000..970936610 --- /dev/null +++ b/aai-service/provider/src/main/resources/OSGI-INF/blueprint/aaiservice-blueprint.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + org.onap.ccsdk.sli.adaptors.aai.AAIService + org.onap.ccsdk.sli.adaptors.aai.AAIClient + + + + diff --git a/ansible-adapter/ansible-adapter-bundle/pom.xml b/ansible-adapter/ansible-adapter-bundle/pom.xml index 00f92b5e7..da8a41f2f 100644 --- a/ansible-adapter/ansible-adapter-bundle/pom.xml +++ b/ansible-adapter/ansible-adapter-bundle/pom.xml @@ -17,13 +17,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors ansible-adapter-bundle - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle ccsdk-sli-adaptors :: ansible-adapter :: ${project.artifactId} @@ -57,21 +57,26 @@ commons-logging commons-logging + org.apache.httpcomponents httpclient + + org.glassfish.jersey.core jersey-common test + org.codehaus.jackson jackson-jaxrs test + junit junit @@ -85,13 +90,13 @@ org.onap.ccsdk.sli.core sli-common - provided + org.onap.ccsdk.sli.core sli-provider - provided + org.osgi org.osgi.core @@ -101,10 +106,24 @@ org.slf4j slf4j-api + + + org.slf4j + jcl-over-slf4j + + org.json json + + + + com.google.guava + guava + + + diff --git a/ansible-adapter/ansible-adapter-bundle/src/main/resources/OSGI-INF/blueprint/ansible-adapter-blueprint.xml b/ansible-adapter/ansible-adapter-bundle/src/main/resources/OSGI-INF/blueprint/ansible-adapter-blueprint.xml new file mode 100755 index 000000000..d7be01e9d --- /dev/null +++ b/ansible-adapter/ansible-adapter-bundle/src/main/resources/OSGI-INF/blueprint/ansible-adapter-blueprint.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + org.onap.ccsdk.sli.adaptors.ansible.AnsibleAdapter + + + + diff --git a/ansible-adapter/ansible-adapter-features/ccsdk-ansible-adapter/pom.xml b/ansible-adapter/ansible-adapter-features/ccsdk-ansible-adapter/pom.xml index ef2757c0a..cc35a73c7 100644 --- a/ansible-adapter/ansible-adapter-features/ccsdk-ansible-adapter/pom.xml +++ b/ansible-adapter/ansible-adapter-features/ccsdk-ansible-adapter/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors ccsdk-ansible-adapter - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: ansible-adapter:: ${project.artifactId} @@ -28,7 +28,6 @@ ${ccsdk.sli.core.version} xml features - provided diff --git a/ansible-adapter/ansible-adapter-features/features-ansible-adapter/pom.xml b/ansible-adapter/ansible-adapter-features/features-ansible-adapter/pom.xml index 415597f99..0d6fa20f1 100755 --- a/ansible-adapter/ansible-adapter-features/features-ansible-adapter/pom.xml +++ b/ansible-adapter/ansible-adapter-features/features-ansible-adapter/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors features-ansible-adapter - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: ansible-adapter :: ${project.artifactId} diff --git a/ansible-adapter/ansible-adapter-features/pom.xml b/ansible-adapter/ansible-adapter-features/pom.xml index 705bd09b0..6863e06be 100644 --- a/ansible-adapter/ansible-adapter-features/pom.xml +++ b/ansible-adapter/ansible-adapter-features/pom.xml @@ -16,12 +16,12 @@ odlparent-lite org.onap.ccsdk.parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors ansible-adapter-features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT ccsdk-sli-adaptors :: ansible-adapter :: ${project.artifactId} pom diff --git a/ansible-adapter/ansible-adapter-installer/pom.xml b/ansible-adapter/ansible-adapter-installer/pom.xml index 263480b04..f2ab5bd49 100644 --- a/ansible-adapter/ansible-adapter-installer/pom.xml +++ b/ansible-adapter/ansible-adapter-installer/pom.xml @@ -27,12 +27,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors ansible-adapter-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT ccsdk-sli-adaptors :: ansible-adapter :: ${project.artifactId} pom diff --git a/ansible-adapter/pom.xml b/ansible-adapter/pom.xml index 02804a982..d09afdd97 100644 --- a/ansible-adapter/pom.xml +++ b/ansible-adapter/pom.xml @@ -27,13 +27,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors ansible-adaptor - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT ccsdk-sli-adaptors :: ansible-adapter Abstractions to interact with Ansible server via REST pom diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 0c3c4a287..f2528003a 100755 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.sli.adaptors sli-adaptors-artifacts - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: sli-adaptors-artifacts @@ -17,7 +17,7 @@ org.onap.ccsdk.parent parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT @@ -71,13 +71,6 @@ xml feature - - org.onap.ccsdk.sli.adaptors - ccsdk-base-http - ${project.version} - xml - feature - org.onap.ccsdk.sli.adaptors aai-service-provider @@ -148,16 +141,6 @@ sql-resource-installer ${project.version} - - org.onap.ccsdk.sli.adaptors - base-http-provider - ${project.version} - - - org.onap.ccsdk.sli.adaptors - base-http-installer - ${project.version} - diff --git a/base/http/features/ccsdk-base-http/pom.xml b/base/http/features/ccsdk-base-http/pom.xml index 38181b683..c417382a4 100644 --- a/base/http/features/ccsdk-base-http/pom.xml +++ b/base/http/features/ccsdk-base-http/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT diff --git a/base/http/features/features-base-http/pom.xml b/base/http/features/features-base-http/pom.xml index 3b7766fd9..4b51ccccc 100644 --- a/base/http/features/features-base-http/pom.xml +++ b/base/http/features/features-base-http/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT diff --git a/base/http/features/pom.xml b/base/http/features/pom.xml index 960a71952..6e3cea56b 100644 --- a/base/http/features/pom.xml +++ b/base/http/features/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT diff --git a/base/http/installer/pom.xml b/base/http/installer/pom.xml index 4ba0614e1..443d8c4b6 100644 --- a/base/http/installer/pom.xml +++ b/base/http/installer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT diff --git a/base/http/pom.xml b/base/http/pom.xml index 65571050a..e556b94c6 100644 --- a/base/http/pom.xml +++ b/base/http/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT diff --git a/base/http/provider/pom.xml b/base/http/provider/pom.xml index 083a7fc7f..17ff73984 100644 --- a/base/http/provider/pom.xml +++ b/base/http/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT diff --git a/base/pom.xml b/base/pom.xml index 12a2f779c..f46dda7c5 100644 --- a/base/pom.xml +++ b/base/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT diff --git a/features/ccsdk-sli-adaptors-all/pom.xml b/features/ccsdk-sli-adaptors-all/pom.xml index 47a431464..e48b58e46 100644 --- a/features/ccsdk-sli-adaptors-all/pom.xml +++ b/features/ccsdk-sli-adaptors-all/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors ccsdk-sli-adaptors-all - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: features :: ${project.artifactId} @@ -80,12 +80,5 @@ xml features - - ${project.groupId} - ccsdk-base-http - ${project.version} - xml - features - diff --git a/features/features-sli-adaptors/pom.xml b/features/features-sli-adaptors/pom.xml index ed6835793..bbdbb6ee1 100644 --- a/features/features-sli-adaptors/pom.xml +++ b/features/features-sli-adaptors/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors features-sli-adaptors - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: features :: ${project.artifactId} diff --git a/features/installer/pom.xml b/features/installer/pom.xml index ffb577af1..76643efda 100755 --- a/features/installer/pom.xml +++ b/features/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors sliadaptors-features-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: features :: ${project.artifactId} diff --git a/features/pom.xml b/features/pom.xml index 3677957b7..73ad702dd 100755 --- a/features/pom.xml +++ b/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors sliadaptors-feature-aggregator - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: features diff --git a/mdsal-resource/features/ccsdk-mdsal-resource/pom.xml b/mdsal-resource/features/ccsdk-mdsal-resource/pom.xml index cbaee2570..cb73db08e 100644 --- a/mdsal-resource/features/ccsdk-mdsal-resource/pom.xml +++ b/mdsal-resource/features/ccsdk-mdsal-resource/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors ccsdk-mdsal-resource - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: mdsal-resource :: ${project.artifactId} @@ -29,8 +29,8 @@ ${ccsdk.sli.core.version} xml features - provided + ${project.groupId} mdsal-resource-provider diff --git a/mdsal-resource/features/features-mdsal-resource/pom.xml b/mdsal-resource/features/features-mdsal-resource/pom.xml index c99fe813f..7314197cb 100755 --- a/mdsal-resource/features/features-mdsal-resource/pom.xml +++ b/mdsal-resource/features/features-mdsal-resource/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors features-mdsal-resource - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: mdsal-resource :: ${project.artifactId} diff --git a/mdsal-resource/features/pom.xml b/mdsal-resource/features/pom.xml index cdc1304cf..c597abd5c 100755 --- a/mdsal-resource/features/pom.xml +++ b/mdsal-resource/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors mdsal-resource-features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: mdsal-resource :: ${project.artifactId} diff --git a/mdsal-resource/installer/pom.xml b/mdsal-resource/installer/pom.xml index 3fa53e1ce..649b66104 100755 --- a/mdsal-resource/installer/pom.xml +++ b/mdsal-resource/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors mdsal-resource-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: mdsal-resource :: ${project.artifactId} diff --git a/mdsal-resource/pom.xml b/mdsal-resource/pom.xml index accb8cb3d..364850f79 100755 --- a/mdsal-resource/pom.xml +++ b/mdsal-resource/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors mdsal-resource - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: mdsal-resource diff --git a/mdsal-resource/provider/pom.xml b/mdsal-resource/provider/pom.xml index 2c69e4aa7..91534cb39 100755 --- a/mdsal-resource/provider/pom.xml +++ b/mdsal-resource/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors mdsal-resource-provider - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle ccsdk-sli-adaptors :: mdsal-resource :: ${project.artifactId} diff --git a/mdsal-resource/provider/src/main/resources/OSGI-INF/blueprint/mdsal-resource-blueprint.xml b/mdsal-resource/provider/src/main/resources/OSGI-INF/blueprint/mdsal-resource-blueprint.xml new file mode 100755 index 000000000..9c691263c --- /dev/null +++ b/mdsal-resource/provider/src/main/resources/OSGI-INF/blueprint/mdsal-resource-blueprint.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource + + + + + + org.onap.ccsdk.sli.adaptors.resource.mdsal.OperationalResource + + + diff --git a/message-router/consumer/api/pom.xml b/message-router/consumer/api/pom.xml index 2b55169b3..43c314811 100755 --- a/message-router/consumer/api/pom.xml +++ b/message-router/consumer/api/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.sli.adaptors.messagerouter consumer.aggregate - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT consumer.api diff --git a/message-router/consumer/features/ccsdk-messagerouter-consumer/pom.xml b/message-router/consumer/features/ccsdk-messagerouter-consumer/pom.xml index f3fc352c4..f6dda2240 100755 --- a/message-router/consumer/features/ccsdk-messagerouter-consumer/pom.xml +++ b/message-router/consumer/features/ccsdk-messagerouter-consumer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors.messagerouter ccsdk-messagerouter-consumer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature diff --git a/message-router/consumer/features/features-messagerouter-consumer/pom.xml b/message-router/consumer/features/features-messagerouter-consumer/pom.xml index a1e12a4b8..dac4461a9 100755 --- a/message-router/consumer/features/features-messagerouter-consumer/pom.xml +++ b/message-router/consumer/features/features-messagerouter-consumer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors.messagerouter features-messagerouter-consumer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: messagerouter :: ${project.artifactId} diff --git a/message-router/consumer/features/pom.xml b/message-router/consumer/features/pom.xml index 2651a5013..54193f953 100755 --- a/message-router/consumer/features/pom.xml +++ b/message-router/consumer/features/pom.xml @@ -16,12 +16,12 @@ odlparent-lite org.onap.ccsdk.parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors.messagerouter consumer.features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT ccsdk-sli-adaptors :: messagerouter :: ${project.artifactId} pom diff --git a/message-router/consumer/installer/pom.xml b/message-router/consumer/installer/pom.xml index 1e6cc380a..304b639de 100755 --- a/message-router/consumer/installer/pom.xml +++ b/message-router/consumer/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.sli.adaptors.messagerouter consumer.aggregate - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT org.onap.ccsdk.sli.adaptors.messagerouter consumer.installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom diff --git a/message-router/consumer/pom.xml b/message-router/consumer/pom.xml index 6476c407a..585b378c9 100755 --- a/message-router/consumer/pom.xml +++ b/message-router/consumer/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.sli.adaptors.messagerouter messagerouter-root - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT consumer.aggregate diff --git a/message-router/consumer/provider/pom.xml b/message-router/consumer/provider/pom.xml index 3b1373edf..bc107db07 100755 --- a/message-router/consumer/provider/pom.xml +++ b/message-router/consumer/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.sli.adaptors.messagerouter consumer.aggregate - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT consumer.provider diff --git a/message-router/pom.xml b/message-router/pom.xml index 1e0590247..9f5c88cb7 100755 --- a/message-router/pom.xml +++ b/message-router/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors.messagerouter messagerouter-root - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom diff --git a/message-router/publisher/api/pom.xml b/message-router/publisher/api/pom.xml index 1bdc3a269..7a48fb4f8 100755 --- a/message-router/publisher/api/pom.xml +++ b/message-router/publisher/api/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.sli.adaptors.messagerouter publisher.aggregate - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT publisher.api diff --git a/message-router/publisher/features/ccsdk-messagerouter-publisher/pom.xml b/message-router/publisher/features/ccsdk-messagerouter-publisher/pom.xml index 81423b45b..0acfb5e21 100755 --- a/message-router/publisher/features/ccsdk-messagerouter-publisher/pom.xml +++ b/message-router/publisher/features/ccsdk-messagerouter-publisher/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors.messagerouter ccsdk-messagerouter-publisher - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature diff --git a/message-router/publisher/features/features-messagerouter-publisher/pom.xml b/message-router/publisher/features/features-messagerouter-publisher/pom.xml index 3460d8a88..2fc8c1450 100755 --- a/message-router/publisher/features/features-messagerouter-publisher/pom.xml +++ b/message-router/publisher/features/features-messagerouter-publisher/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors.messagerouter features-messagerouter-publisher - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: messagerouter :: ${project.artifactId} diff --git a/message-router/publisher/features/pom.xml b/message-router/publisher/features/pom.xml index bf7d8b2f6..1c0825e75 100644 --- a/message-router/publisher/features/pom.xml +++ b/message-router/publisher/features/pom.xml @@ -16,12 +16,12 @@ odlparent-lite org.onap.ccsdk.parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors.messagerouter publisher.features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT ccsdk-sli-adaptors :: messagerouter :: ${project.artifactId} pom diff --git a/message-router/publisher/installer/pom.xml b/message-router/publisher/installer/pom.xml index de3b51250..e34a66555 100644 --- a/message-router/publisher/installer/pom.xml +++ b/message-router/publisher/installer/pom.xml @@ -5,12 +5,12 @@ org.onap.ccsdk.sli.adaptors.messagerouter publisher.aggregate - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT org.onap.ccsdk.sli.adaptors.messagerouter publisher.installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom diff --git a/message-router/publisher/pom.xml b/message-router/publisher/pom.xml index 989254d0b..f7232fb50 100755 --- a/message-router/publisher/pom.xml +++ b/message-router/publisher/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.sli.adaptors.messagerouter messagerouter-root - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT publisher.aggregate diff --git a/message-router/publisher/provider/pom.xml b/message-router/publisher/provider/pom.xml index 347e6a455..2ecbfd1ad 100755 --- a/message-router/publisher/provider/pom.xml +++ b/message-router/publisher/provider/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.sli.adaptors.messagerouter publisher.aggregate - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT publisher.provider diff --git a/message-router/publisher/sample.client/pom.xml b/message-router/publisher/sample.client/pom.xml index d7ddce522..81fbebadb 100755 --- a/message-router/publisher/sample.client/pom.xml +++ b/message-router/publisher/sample.client/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.sli.adaptors.messagerouter publisher.aggregate - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT sample.client diff --git a/netbox-client/features/ccsdk-netbox-client/pom.xml b/netbox-client/features/ccsdk-netbox-client/pom.xml index c9d105b9e..eee799198 100644 --- a/netbox-client/features/ccsdk-netbox-client/pom.xml +++ b/netbox-client/features/ccsdk-netbox-client/pom.xml @@ -20,38 +20,47 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors ccsdk-netbox-client - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: netbox-client :: ${project.artifactId} + ${project.version} + + + org.opendaylight.controller + odl-mdsal-broker + xml + features + + org.onap.ccsdk.sli.core ccsdk-sli ${ccsdk.sli.core.version} xml features - provided + org.onap.ccsdk.sli.core ccsdk-dblib ${ccsdk.sli.core.version} xml features - provided + ${project.groupId} netbox-client-provider diff --git a/netbox-client/features/features-netbox-client/pom.xml b/netbox-client/features/features-netbox-client/pom.xml index 556a8579f..b1195eba2 100755 --- a/netbox-client/features/features-netbox-client/pom.xml +++ b/netbox-client/features/features-netbox-client/pom.xml @@ -20,13 +20,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors features-netbox-client - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: netbox-client :: ${project.artifactId} diff --git a/netbox-client/features/pom.xml b/netbox-client/features/pom.xml index b3740b3c3..3556a4c5e 100755 --- a/netbox-client/features/pom.xml +++ b/netbox-client/features/pom.xml @@ -20,13 +20,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors netbox-client-features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: netbox-client :: ${project.artifactId} diff --git a/netbox-client/installer/pom.xml b/netbox-client/installer/pom.xml index aab9b076a..ac85879b9 100755 --- a/netbox-client/installer/pom.xml +++ b/netbox-client/installer/pom.xml @@ -20,13 +20,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors netbox-client-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: netbox-client :: ${project.artifactId} diff --git a/netbox-client/pom.xml b/netbox-client/pom.xml index c22560a0d..c1b4e3e71 100644 --- a/netbox-client/pom.xml +++ b/netbox-client/pom.xml @@ -20,13 +20,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors netbox-client - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: netbox-client diff --git a/netbox-client/provider/pom.xml b/netbox-client/provider/pom.xml index c6237d38b..cbc698b6a 100644 --- a/netbox-client/provider/pom.xml +++ b/netbox-client/provider/pom.xml @@ -19,13 +19,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors netbox-client-provider - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle 4.0.0 @@ -71,13 +71,13 @@ org.onap.ccsdk.sli.core sli-common - provided + compile org.onap.ccsdk.sli.core sliPluginUtils-provider ${project.version} - provided + compile org.osgi @@ -101,13 +101,12 @@ com.github.tomakehurst wiremock + 2.23.2 test - org.eclipse.jetty jetty-server - 9.3.1.v20150714 test diff --git a/netbox-client/provider/src/main/resources/OSGI-INF/blueprint/netbox-client.xml b/netbox-client/provider/src/main/resources/OSGI-INF/blueprint/netbox-client.xml new file mode 100644 index 000000000..b667dcba5 --- /dev/null +++ b/netbox-client/provider/src/main/resources/OSGI-INF/blueprint/netbox-client.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml index 61c05c14f..26bf386e4 100755 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT 4.0.0 @@ -103,15 +103,14 @@ mdsal-resource resource-assignment sql-resource - base - message-router features artifacts + message-router ONAP - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT diff --git a/resource-assignment/features/ccsdk-resource-assignment/pom.xml b/resource-assignment/features/ccsdk-resource-assignment/pom.xml index 61fdf4459..d89cda04a 100644 --- a/resource-assignment/features/ccsdk-resource-assignment/pom.xml +++ b/resource-assignment/features/ccsdk-resource-assignment/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors ccsdk-resource-assignment - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: resource-assignment :: ${project.artifactId} diff --git a/resource-assignment/features/features-resource-assignment/pom.xml b/resource-assignment/features/features-resource-assignment/pom.xml index 2a852f2cd..09e7a0626 100755 --- a/resource-assignment/features/features-resource-assignment/pom.xml +++ b/resource-assignment/features/features-resource-assignment/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors features-resource-assignment - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: resource-assignment :: ${project.artifactId} diff --git a/resource-assignment/features/pom.xml b/resource-assignment/features/pom.xml index 6c1dcda86..d7e77bab3 100755 --- a/resource-assignment/features/pom.xml +++ b/resource-assignment/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors resource-assignment-features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: resource-assignment :: ${project.artifactId} diff --git a/resource-assignment/installer/pom.xml b/resource-assignment/installer/pom.xml index 5501cf69d..900ad9f01 100755 --- a/resource-assignment/installer/pom.xml +++ b/resource-assignment/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors resource-assignment-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: resource-assignment :: ${project.artifactId} diff --git a/resource-assignment/pom.xml b/resource-assignment/pom.xml index 425af0283..b17b31aa6 100755 --- a/resource-assignment/pom.xml +++ b/resource-assignment/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors resource-assignment - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: resource-assignment diff --git a/resource-assignment/provider/pom.xml b/resource-assignment/provider/pom.xml index bb498e64e..a73949efc 100755 --- a/resource-assignment/provider/pom.xml +++ b/resource-assignment/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors resource-assignment-provider - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle ccsdk-sli-adaptors :: resource-assignment :: ${project.artifactId} diff --git a/resource-assignment/provider/src/main/resources/OSGI-INF/blueprint/resource-assignment-blueprint.xml b/resource-assignment/provider/src/main/resources/OSGI-INF/blueprint/resource-assignment-blueprint.xml new file mode 100755 index 000000000..77c316d2a --- /dev/null +++ b/resource-assignment/provider/src/main/resources/OSGI-INF/blueprint/resource-assignment-blueprint.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + diff --git a/resource-assignment/provider/src/main/resources/OSGI-INF/blueprint/resource-assignment.xml b/resource-assignment/provider/src/main/resources/OSGI-INF/blueprint/resource-assignment.xml new file mode 100755 index 000000000..7fcc70c54 --- /dev/null +++ b/resource-assignment/provider/src/main/resources/OSGI-INF/blueprint/resource-assignment.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/saltstack-adapter/pom.xml b/saltstack-adapter/pom.xml index e9fbc14d4..1d618319f 100644 --- a/saltstack-adapter/pom.xml +++ b/saltstack-adapter/pom.xml @@ -27,13 +27,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors saltstack-adaptor - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT ccsdk-sli-adaptors :: saltstack-adapter Abstractions to interact with Saltstack server via REST diff --git a/saltstack-adapter/saltstack-adapter-features/ccsdk-saltstack-adapter/pom.xml b/saltstack-adapter/saltstack-adapter-features/ccsdk-saltstack-adapter/pom.xml index 28ddc6dcb..3d9ec2079 100644 --- a/saltstack-adapter/saltstack-adapter-features/ccsdk-saltstack-adapter/pom.xml +++ b/saltstack-adapter/saltstack-adapter-features/ccsdk-saltstack-adapter/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors ccsdk-saltstack-adapter - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: saltstack-adapter:: ${project.artifactId} diff --git a/saltstack-adapter/saltstack-adapter-features/features-saltstack-adapter/pom.xml b/saltstack-adapter/saltstack-adapter-features/features-saltstack-adapter/pom.xml index 2f6ad9f09..a3e21d9d3 100755 --- a/saltstack-adapter/saltstack-adapter-features/features-saltstack-adapter/pom.xml +++ b/saltstack-adapter/saltstack-adapter-features/features-saltstack-adapter/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors features-saltstack-adapter - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: saltstack-adapter :: ${project.artifactId} diff --git a/saltstack-adapter/saltstack-adapter-features/pom.xml b/saltstack-adapter/saltstack-adapter-features/pom.xml index c7e1d42d1..57875e823 100644 --- a/saltstack-adapter/saltstack-adapter-features/pom.xml +++ b/saltstack-adapter/saltstack-adapter-features/pom.xml @@ -15,12 +15,12 @@ odlparent-lite org.onap.ccsdk.parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors saltstack-adapter-features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT ccsdk-sli-adaptors :: saltstack-adapter :: ${project.artifactId} diff --git a/saltstack-adapter/saltstack-adapter-installer/pom.xml b/saltstack-adapter/saltstack-adapter-installer/pom.xml index d3643517a..639e308aa 100644 --- a/saltstack-adapter/saltstack-adapter-installer/pom.xml +++ b/saltstack-adapter/saltstack-adapter-installer/pom.xml @@ -27,12 +27,12 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors saltstack-adapter-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT ccsdk-sli-adaptors :: saltstack-adapter :: ${project.artifactId} pom diff --git a/saltstack-adapter/saltstack-adapter-provider/pom.xml b/saltstack-adapter/saltstack-adapter-provider/pom.xml index d863ca08f..fb875e471 100644 --- a/saltstack-adapter/saltstack-adapter-provider/pom.xml +++ b/saltstack-adapter/saltstack-adapter-provider/pom.xml @@ -16,13 +16,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors saltstack-adapter-provider - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle ccsdk-sli-adaptors :: saltstack-adapter :: ${project.artifactId} @@ -66,6 +66,10 @@ org.slf4j slf4j-api + + org.slf4j + jcl-over-slf4j + @@ -98,13 +102,11 @@ org.onap.ccsdk.sli.core sli-common - provided - + org.onap.ccsdk.sli.core sli-provider - provided diff --git a/saltstack-adapter/saltstack-adapter-provider/src/main/resources/OSGI-INF/blueprint/saltstack-adapter-blueprint.xml b/saltstack-adapter/saltstack-adapter-provider/src/main/resources/OSGI-INF/blueprint/saltstack-adapter-blueprint.xml new file mode 100755 index 000000000..e360f8184 --- /dev/null +++ b/saltstack-adapter/saltstack-adapter-provider/src/main/resources/OSGI-INF/blueprint/saltstack-adapter-blueprint.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + org.onap.ccsdk.sli.adaptors.saltstack.SaltstackAdapter + + + + + diff --git a/sql-resource/features/ccsdk-sql-resource/pom.xml b/sql-resource/features/ccsdk-sql-resource/pom.xml index 69defc4e7..4ca6c9fc4 100644 --- a/sql-resource/features/ccsdk-sql-resource/pom.xml +++ b/sql-resource/features/ccsdk-sql-resource/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent single-feature-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors ccsdk-sql-resource - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: sql-resource :: ${project.artifactId} diff --git a/sql-resource/features/features-sql-resource/pom.xml b/sql-resource/features/features-sql-resource/pom.xml index c68504e86..75ee45d87 100755 --- a/sql-resource/features/features-sql-resource/pom.xml +++ b/sql-resource/features/features-sql-resource/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent feature-repo-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors features-sql-resource - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT feature ccsdk-sli-adaptors :: sql-resource :: ${project.artifactId} diff --git a/sql-resource/features/pom.xml b/sql-resource/features/pom.xml index 48a896bef..e603e0a6f 100755 --- a/sql-resource/features/pom.xml +++ b/sql-resource/features/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors sql-resource-features - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: sql-resource :: ${project.artifactId} diff --git a/sql-resource/installer/pom.xml b/sql-resource/installer/pom.xml index 071f084c7..7f157d0fd 100755 --- a/sql-resource/installer/pom.xml +++ b/sql-resource/installer/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors sql-resource-installer - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: sql-resource :: ${project.artifactId} diff --git a/sql-resource/pom.xml b/sql-resource/pom.xml index 8304259a6..645576e18 100755 --- a/sql-resource/pom.xml +++ b/sql-resource/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent odlparent-lite - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors sql-resource - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT pom ccsdk-sli-adaptors :: sql-resource diff --git a/sql-resource/provider/pom.xml b/sql-resource/provider/pom.xml index 5197a1d6a..d49d01877 100755 --- a/sql-resource/provider/pom.xml +++ b/sql-resource/provider/pom.xml @@ -5,13 +5,13 @@ org.onap.ccsdk.parent binding-parent - 1.3.3-SNAPSHOT + 1.4.0-SNAPSHOT org.onap.ccsdk.sli.adaptors sql-resource-provider - 0.5.2-SNAPSHOT + 0.6.0-SNAPSHOT bundle ccsdk-sli-adaptors :: sql-resource :: ${project.artifactId} diff --git a/sql-resource/provider/src/main/resources/OSGI-INF/blueprint/sql-resource-blueprint.xml b/sql-resource/provider/src/main/resources/OSGI-INF/blueprint/sql-resource-blueprint.xml new file mode 100755 index 000000000..5e8d33946 --- /dev/null +++ b/sql-resource/provider/src/main/resources/OSGI-INF/blueprint/sql-resource-blueprint.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource + + + + diff --git a/version.properties b/version.properties index 74fd99918..54c44bc24 100644 --- a/version.properties +++ b/version.properties @@ -4,8 +4,8 @@ # because they are used in Jenkins, whose plug-in doesn't support release_name=0 -sprint_number=5 -feature_revision=2 +sprint_number=6 +feature_revision=0 base_version=${release_name}.${sprint_number}.${feature_revision} -- cgit 1.2.3-korg From 83559ddc77a0217391212f2abcdcba2c3ff56937 Mon Sep 17 00:00:00 2001 From: "Agarwal, Ruchira (ra1926)" Date: Tue, 5 Nov 2019 18:16:50 +0000 Subject: minor updates to clean up code clean up code to sync with internal Issue-ID: CCSDK-1873 Signed-off-by: Agarwal, Ruchira (ra1926) Change-Id: Idcc7186d5aaa783c527de3986e7a1ecd9bfcf651 --- aai-service/provider/pom.xml | 8 ++---- .../org/onap/ccsdk/sli/adaptors/aai/AAIClient.java | 5 +++- .../ccsdk/sli/adaptors/aai/AAIDeclarations.java | 1 + .../ccsdk/sli/adaptors/aai/GenericRequest.java | 10 +++++--- .../ccsdk/sli/adaptors/aai/EchoRequestTest.java | 22 ++++++++++++++++ ansible-adapter/ansible-adapter-bundle/pom.xml | 2 ++ .../ccsdk-ansible-adapter/pom.xml | 1 + base/http/provider/pom.xml | 1 - .../sli/adaptors/base/http/BasicAuthFilter.java | 6 ++--- .../adaptors/base/http/BasicAuthFilterTest.java | 2 +- .../features/ccsdk-mdsal-resource/pom.xml | 1 + .../sli/adaptors/resource/mdsal/RestService.java | 5 +++- netbox-client/features/ccsdk-netbox-client/pom.xml | 8 ++---- netbox-client/provider/pom.xml | 8 +++--- .../sli/adaptors/resource/sql/SqlResource.java | 29 +++++++++++++--------- 15 files changed, 70 insertions(+), 39 deletions(-) (limited to 'sql-resource/provider/src') diff --git a/aai-service/provider/pom.xml b/aai-service/provider/pom.xml index 9650087e5..f63bc424e 100755 --- a/aai-service/provider/pom.xml +++ b/aai-service/provider/pom.xml @@ -96,10 +96,6 @@ org.springframework spring-core test - - - org.apache.httpcomponents - httpcore org.apache.httpcomponents @@ -112,7 +108,7 @@ org.jvnet.jaxb2.maven2 maven-jaxb2-plugin - 0.13.1 + 0.14.0 gen-xjc @@ -139,7 +135,7 @@ org.jvnet.jaxb2_commons jaxb2-basics-annotate - 0.6.4 + 0.6.5 diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java index 4b4c439a9..28b4955a4 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java @@ -37,6 +37,9 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; import org.onap.ccsdk.sli.core.sli.SvcLogicResource; import org.onap.ccsdk.sli.adaptors.aai.data.notify.NotifyEvent; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; + public interface AAIClient extends SvcLogicResource, SvcLogicJavaPlugin { public SearchResults requestServiceInstanceURL(String svcInstanceId) throws AAIServiceException; @@ -76,7 +79,7 @@ public interface AAIClient extends SvcLogicResource, SvcLogicJavaPlugin { public void logKeyError(String keys); - public QueryStatus processResponseData(String rv, String resource, AAIRequest request, String prefix, SvcLogicContext ctx, Map nameValues, String modifier) throws IOException, AAIServiceException ; + public QueryStatus processResponseData(String rv, String resource, AAIRequest request, String prefix, SvcLogicContext ctx, Map nameValues, String modifier) throws JsonParseException, JsonMappingException, IOException, AAIServiceException ; public String getPathTemplateForResource(String resoourceName, String join, SvcLogicContext ctx) throws MalformedURLException; public boolean isDeprecatedFormat(String resource, Map nameValues); diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java index c57b3a45d..8b8aaaab6 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java @@ -1636,6 +1636,7 @@ public abstract class AAIDeclarations implements AAIClient { try { obj = getMetadataMethod.invoke(instance); } catch (InvocationTargetException x) { + Throwable cause = x.getCause(); } } if(obj != null && obj instanceof Metadata){ diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericRequest.java index 7c6234e5c..7f15c03f5 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericRequest.java @@ -189,9 +189,13 @@ public class GenericRequest extends AAIRequest { queryParams.put(splitKey[1], encodeQuery(value)); } else { - String token = String.format("%s/{%s}", splitKey[0], splitKey[1]); - String encoded_vnf = encodeQuery(value); - request_url = request_url.replace(token, String.format("%s/%s", splitKey[0], encoded_vnf)); + String encoded_vnf = encodeQuery(value); + if(!resourceName.equals(splitKey[0]) && resourceName.contains(splitKey[0])) { + queryParams.put(splitKey[1], encoded_vnf); + } else { + String token = String.format("%s/{%s}", splitKey[0], splitKey[1]); + request_url = request_url.replace(token, String.format("%s/%s", splitKey[0], encoded_vnf)); + } } } diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/EchoRequestTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/EchoRequestTest.java index 69541301b..3e0a72f3a 100755 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/EchoRequestTest.java +++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/EchoRequestTest.java @@ -34,6 +34,8 @@ import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -111,4 +113,24 @@ public class EchoRequestTest { } } + +// @Test + public void EchoTest() { + LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------"); + try + { + SvcLogicContext ctx = new SvcLogicContext(); + + QueryStatus resp = null; + +// (String resource, boolean localOnly, String select, String key, String prefix, String orderBy, SvcLogicContext ctx) + resp = aaiService.query("echo", false, null, "", "aaidata", null, ctx); + assert(resp == QueryStatus.SUCCESS); + } + catch (Throwable e) + { + LOG.error("Caught exception", e); +// fail("Caught exception"); + } + } } diff --git a/ansible-adapter/ansible-adapter-bundle/pom.xml b/ansible-adapter/ansible-adapter-bundle/pom.xml index c73018b28..614fe6d57 100644 --- a/ansible-adapter/ansible-adapter-bundle/pom.xml +++ b/ansible-adapter/ansible-adapter-bundle/pom.xml @@ -90,11 +90,13 @@ org.onap.ccsdk.sli.core sli-common + provided org.onap.ccsdk.sli.core sli-provider + provided diff --git a/ansible-adapter/ansible-adapter-features/ccsdk-ansible-adapter/pom.xml b/ansible-adapter/ansible-adapter-features/ccsdk-ansible-adapter/pom.xml index bf0b5b543..523d45069 100644 --- a/ansible-adapter/ansible-adapter-features/ccsdk-ansible-adapter/pom.xml +++ b/ansible-adapter/ansible-adapter-features/ccsdk-ansible-adapter/pom.xml @@ -28,6 +28,7 @@ ${ccsdk.sli.core.version} xml features + provided diff --git a/base/http/provider/pom.xml b/base/http/provider/pom.xml index aabeca268..642238cd2 100644 --- a/base/http/provider/pom.xml +++ b/base/http/provider/pom.xml @@ -28,7 +28,6 @@ org.glassfish.jersey.core jersey-client - ${jersey.version} test diff --git a/base/http/provider/src/main/java/org/onap/ccsdk/sli/adaptors/base/http/BasicAuthFilter.java b/base/http/provider/src/main/java/org/onap/ccsdk/sli/adaptors/base/http/BasicAuthFilter.java index 48d996ef3..5d3d463c9 100644 --- a/base/http/provider/src/main/java/org/onap/ccsdk/sli/adaptors/base/http/BasicAuthFilter.java +++ b/base/http/provider/src/main/java/org/onap/ccsdk/sli/adaptors/base/http/BasicAuthFilter.java @@ -6,13 +6,9 @@ import javax.ws.rs.client.ClientRequestContext; import javax.ws.rs.client.ClientRequestFilter; import javax.ws.rs.core.MultivaluedMap; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class BasicAuthFilter implements ClientRequestFilter { private final String basicAuthValue; - public BasicAuthFilter(String basicAuthValue) { this.basicAuthValue = basicAuthValue; } @@ -21,4 +17,6 @@ public class BasicAuthFilter implements ClientRequestFilter { MultivaluedMap headers = requestContext.getHeaders(); headers.add("Authorization", basicAuthValue); } + + } diff --git a/base/http/provider/src/test/java/org/onap/ccsdk/sli/adaptors/base/http/BasicAuthFilterTest.java b/base/http/provider/src/test/java/org/onap/ccsdk/sli/adaptors/base/http/BasicAuthFilterTest.java index b9565ba67..d9d552dac 100644 --- a/base/http/provider/src/test/java/org/onap/ccsdk/sli/adaptors/base/http/BasicAuthFilterTest.java +++ b/base/http/provider/src/test/java/org/onap/ccsdk/sli/adaptors/base/http/BasicAuthFilterTest.java @@ -8,7 +8,7 @@ public class BasicAuthFilterTest { @Test public void notNullParameters() throws Exception { - BasicAuthFilter myFilter = new BasicAuthFilter("helloworld"); + BasicAuthFilter myFilter = new BasicAuthFilter("hello"); assertNotNull(myFilter); } diff --git a/mdsal-resource/features/ccsdk-mdsal-resource/pom.xml b/mdsal-resource/features/ccsdk-mdsal-resource/pom.xml index 41b0ef326..ab512ed63 100644 --- a/mdsal-resource/features/ccsdk-mdsal-resource/pom.xml +++ b/mdsal-resource/features/ccsdk-mdsal-resource/pom.xml @@ -29,6 +29,7 @@ ${ccsdk.sli.core.version} xml features + provided diff --git a/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/RestService.java b/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/RestService.java index 2991e6bef..30859a492 100644 --- a/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/RestService.java +++ b/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/RestService.java @@ -34,6 +34,7 @@ import java.net.URL; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSession; +import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -180,9 +181,11 @@ public class RestService { LOG.info("Response body :\n"+respString); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + dbf.setFeature("http://xml.org/sax/features/external-general-entities", false); + dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false); DocumentBuilder db = dbf.newDocumentBuilder(); - response = db.parse(new ByteArrayInputStream(respString.getBytes())); } catch (Exception e) { diff --git a/netbox-client/features/ccsdk-netbox-client/pom.xml b/netbox-client/features/ccsdk-netbox-client/pom.xml index e006b1976..13dc8bf97 100644 --- a/netbox-client/features/ccsdk-netbox-client/pom.xml +++ b/netbox-client/features/ccsdk-netbox-client/pom.xml @@ -38,12 +38,6 @@ - - org.opendaylight.controller - odl-mdsal-broker - xml - features - org.onap.ccsdk.sli.core @@ -51,6 +45,7 @@ ${ccsdk.sli.core.version} xml features + provided @@ -59,6 +54,7 @@ ${ccsdk.sli.core.version} xml features + provided diff --git a/netbox-client/provider/pom.xml b/netbox-client/provider/pom.xml index 475eeb593..b8fa494ad 100644 --- a/netbox-client/provider/pom.xml +++ b/netbox-client/provider/pom.xml @@ -71,13 +71,13 @@ org.onap.ccsdk.sli.core sli-common - compile + provided org.onap.ccsdk.sli.core sliPluginUtils-provider - ${project.version} - compile + ${ccsdk.sli.core.version} + provided org.osgi @@ -101,7 +101,7 @@ com.github.tomakehurst wiremock - 2.23.2 + 2.23.2 test diff --git a/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java b/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java index 767fdac79..69965d101 100755 --- a/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java +++ b/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java @@ -100,7 +100,7 @@ public class SqlResource implements SvcLogicResource, SvcLogicJavaPlugin { return (QueryStatus.FAILURE); } - String theStmt = resolveCtxVars(key, ctx); + String theStmt = resolveCtxVars(key, ctx, resource); try { CachedRowSet results = dblibSvc.getData(theStmt, null, null); @@ -131,8 +131,9 @@ public class SqlResource implements SvcLogicResource, SvcLogicJavaPlugin { if (dblibSvc == null) { return (QueryStatus.FAILURE); } + + String sqlQuery = resolveCtxVars(key, ctx, resource); - String sqlQuery = resolveCtxVars(key, ctx); try { @@ -230,7 +231,7 @@ public class SqlResource implements SvcLogicResource, SvcLogicJavaPlugin { return (QueryStatus.FAILURE); } - String sqlStmt = resolveCtxVars(key, ctx); + String sqlStmt = resolveCtxVars(key, ctx, ""); LOG.debug("key = [" + key + "]; sqlStmt = [" + sqlStmt + "]"); try { @@ -247,7 +248,7 @@ public class SqlResource implements SvcLogicResource, SvcLogicJavaPlugin { } - private String resolveCtxVars(String key, SvcLogicContext ctx) { + private String resolveCtxVars(String key, SvcLogicContext ctx, String resource) { if (key == null) { return (null); } @@ -257,16 +258,20 @@ public class SqlResource implements SvcLogicResource, SvcLogicJavaPlugin { LOG.debug("Stripped outer single quotes - key is now [" + key + "]"); } - String[] keyTerms = key.split("\\s+"); + //"SQL-TRUE" allows for the key to be used as is. + if (!resource.equals("SQL-TRUE")) { + String[] keyTerms = key.split("\\s+"); - StringBuffer sqlBuffer = new StringBuffer(); + StringBuffer sqlBuffer = new StringBuffer(); - for (int i = 0; i < keyTerms.length; i++) { - sqlBuffer.append(resolveTerm(keyTerms[i], ctx)); - sqlBuffer.append(" "); - } + for (int i = 0; i < keyTerms.length; i++) { + sqlBuffer.append(resolveTerm(keyTerms[i], ctx)); + sqlBuffer.append(" "); + } + key = sqlBuffer.toString(); + } - return (sqlBuffer.toString()); + return (key); } private String resolveTerm(String term, SvcLogicContext ctx) { @@ -441,7 +446,7 @@ public class SqlResource implements SvcLogicResource, SvcLogicJavaPlugin { return (strValue); } else { ResultSet results = null; - try (Connection conn = dblibSvc.getConnection(); + try (Connection conn = dblibSvc.getConnection(); PreparedStatement stmt = conn.prepareStatement("SELECT CAST(AES_DECRYPT(?, ?) AS CHAR(50)) FROM DUAL")) { stmt.setBytes(1, colValue); -- cgit 1.2.3-korg From 3960d5fe8a04c505334714516c3144c327bb98c1 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Thu, 30 Jul 2020 13:44:53 -0400 Subject: Add error handling for OSGi classes not found Added error handling to correctly handle case where SqlResource is used outside an OSGi container. Change-Id: I0b5a526b01c151c4a7924f474bf7d21e783ac260 Issue-ID: CCSDK-2625 Signed-off-by: Dan Timoney --- .gitignore | 1 + .../sli/adaptors/resource/sql/SqlResource.java | 48 +++++++++++++--------- 2 files changed, 30 insertions(+), 19 deletions(-) (limited to 'sql-resource/provider/src') diff --git a/.gitignore b/.gitignore index 34a96c158..cc576b7b2 100755 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ org.eclipse.core.resources.prefs maven-eclipse.xml workspace .checkstyle +.vscode ## Compilation Files ## *.class diff --git a/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java b/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java index 69965d101..435bc5bb1 100755 --- a/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java +++ b/sql-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/sql/SqlResource.java @@ -355,28 +355,36 @@ public class SqlResource implements SvcLogicResource, SvcLogicJavaPlugin { return(dblibSvc); } // Try to get dblib as an OSGI service - BundleContext bctx = null; - ServiceReference sref = null; - Bundle bundle = FrameworkUtil.getBundle(SqlResource.class); - - if (bundle != null) { - bctx = bundle.getBundleContext(); - } - - if (bctx != null) { - sref = bctx.getServiceReference(DBLIB_SERVICE); - } - - if (sref == null) { - LOG.warn("Could not find service reference for DBLIB service (" + DBLIB_SERVICE + ")"); - } else { - dblibSvc = (DbLibService) bctx.getService(sref); - if (dblibSvc == null) { + try { + BundleContext bctx = null; + ServiceReference sref = null; + + + + Bundle bundle = FrameworkUtil.getBundle(SqlResource.class); + + if (bundle != null) { + bctx = bundle.getBundleContext(); + } + + if (bctx != null) { + sref = bctx.getServiceReference(DBLIB_SERVICE); + } + + if (sref == null) { LOG.warn("Could not find service reference for DBLIB service (" + DBLIB_SERVICE + ")"); + } else { + dblibSvc = (DbLibService) bctx.getService(sref); + if (dblibSvc == null) { + LOG.warn("Could not find service reference for DBLIB service (" + DBLIB_SERVICE + ")"); + } } + } catch (NoClassDefFoundError ex) { + LOG.info("OSGI classes not found - must be running outside an OSGi container"); } + if (dblibSvc == null) { // Must not be running in an OSGI container. See if you can load it // as a @@ -386,7 +394,8 @@ public class SqlResource implements SvcLogicResource, SvcLogicJavaPlugin { // be the properties passed to DBResourceManager constructor. // If not, as default just use system properties. Properties dblibProps = System.getProperties(); - String cfgDir = System.getenv("SDNC_CONFIG_DIR"); + + String cfgDir = dblibProps.getProperty("sdnc.config.dir", System.getenv("SDNC_CONFIG_DIR")); if ((cfgDir == null) || (cfgDir.length() == 0)) { cfgDir = "/opt/sdnc/data/properties"; @@ -395,10 +404,11 @@ public class SqlResource implements SvcLogicResource, SvcLogicJavaPlugin { File dblibPropFile = new File(cfgDir + "/dblib.properties"); if (dblibPropFile.exists()) { try { + LOG.debug("Loading dblib properties from {}", dblibPropFile.getAbsolutePath()); dblibProps = new Properties(); dblibProps.load(new FileInputStream(dblibPropFile)); } catch (Exception e) { - LOG.warn("Could not load properties file " + dblibPropFile.getAbsolutePath(), e); + LOG.warn("Could not load properties file {}", dblibPropFile.getAbsolutePath(), e); dblibProps = System.getProperties(); } -- cgit 1.2.3-korg