summaryrefslogtreecommitdiffstats
path: root/appc-dispatcher/appc-license-manager/appc-license-manager-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'appc-dispatcher/appc-license-manager/appc-license-manager-core/src')
-rw-r--r--appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseDataAccessServiceImpl.java64
-rw-r--r--appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseManagerImpl.java12
-rw-r--r--appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/openecomp/appc/licmgr/LicenseManagerMock.java12
-rw-r--r--appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/openecomp/appc/licmgr/LicenseServiceMock.java9
4 files changed, 4 insertions, 93 deletions
diff --git a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseDataAccessServiceImpl.java b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseDataAccessServiceImpl.java
index ef252cca6..8e999c4c9 100644
--- a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseDataAccessServiceImpl.java
+++ b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseDataAccessServiceImpl.java
@@ -87,7 +87,7 @@ public class LicenseDataAccessServiceImpl implements LicenseDataAccessService {
result.put(field, data.getString(field));
}
} else {
- String msg = "Missing license model for VNF_TYPE: " + vnfType + " and VNF_VERSION: " + vnfVersion + " in table " + Constants.ASDC_ARTIFACTS_TABLE_NAME;
+ String msg = "Missing license model for VNF_TYPE: " + vnfType + " and VNF_VERSION: " + vnfVersion + " in table " + Constants.ASDC_ARTIFACTS;
logger.info(msg);
}
} catch (SQLException e) {
@@ -99,70 +99,10 @@ public class LicenseDataAccessServiceImpl implements LicenseDataAccessService {
}
private String buildQueryStatement() {
- return "select * " + "from " + Constants.ASDC_ARTIFACTS_TABLE_NAME + " " +
+ return "select * " + "from " + Constants.ASDC_ARTIFACTS + " " +
"where " + ASDC_ARTIFACTS_FIELDS.RESOURCE_NAME.name() + " = ?" +
" AND " + ASDC_ARTIFACTS_FIELDS.RESOURCE_VERSION.name() + " = ?" +
" AND " + ASDC_ARTIFACTS_FIELDS.ARTIFACT_TYPE.name() + " = ?";
}
- /**
- * Implementation of storeArtifactPayload()
- * @see LicenseDataAccessService
- */
- @Override
- public void storeArtifactPayload(Map<String, String> parameters) throws RuntimeException {
-
- if(parameters == null || parameters.isEmpty()) {
- throw new RuntimeException("No parameters for insert are provided");
- }
-
- String insertStr = "INSERT INTO " + Constants.ASDC_ARTIFACTS_TABLE_NAME + "(";
- String valuesStr = "VALUES(";
- String insertStatementStr;
-
- ArrayList<String> params = new ArrayList<>();
- boolean firstTime = true;
- for(Map.Entry<String, String> entry : parameters.entrySet()) {
- if(!firstTime) {
- insertStr += ",";
- valuesStr += ",";
- }
- else {
- firstTime = false;
- }
- insertStr += entry.getKey();
- valuesStr += "?";
-
- params.add(entry.getValue());
- }
-
- insertStr += ")";
- valuesStr += ")";
- insertStatementStr = insertStr + " " + valuesStr;
-
- executeStoreArtifactPayload(insertStatementStr, params);
- }
-
- /**
- * Exexutes insert statement for artifact payload
- * @param insertStatementStr
- * @param params
- * @throws RuntimeException
- */
- private void executeStoreArtifactPayload(String insertStatementStr, ArrayList<String> params) throws RuntimeException {
-
- try {
- logger.info("used schema=" + this.schema);
- logger.info("insert statement=" + insertStatementStr);
-
- dbLibService.writeData(insertStatementStr, params, this.schema);
-
- logger.info("finished to execute insert");
-
- } catch (SQLException e) {
- logger.error("Storing Artifact payload failed - " + insertStatementStr);
- throw new RuntimeException("Storing Artifact payload failed - " + insertStatementStr);
- }
- }
-
}
diff --git a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseManagerImpl.java b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseManagerImpl.java
index 0d7da6766..9f3db5aab 100644
--- a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseManagerImpl.java
+++ b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseManagerImpl.java
@@ -65,18 +65,6 @@ public class LicenseManagerImpl implements LicenseManager {
return licenseModel;
}
- @Override
- public Map<String, String> retrieveLicenseModelData(String vnfType, String vnfVersion, String... fields) throws DataAccessException {
-
- Map<String,String> resultMap = DAService.retrieveLicenseModelData(vnfType, vnfVersion, fields);
- return resultMap;
- }
-
- @Override
- public void storeArtifactPayload(Map<String, String> parameters) throws RuntimeException {
-
- DAService.storeArtifactPayload(parameters);
- }
private static LicenseModel convert(String xml) {
diff --git a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/openecomp/appc/licmgr/LicenseManagerMock.java b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/openecomp/appc/licmgr/LicenseManagerMock.java
index 2dad318c6..92adefe55 100644
--- a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/openecomp/appc/licmgr/LicenseManagerMock.java
+++ b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/openecomp/appc/licmgr/LicenseManagerMock.java
@@ -24,9 +24,6 @@
package org.openecomp.appc.licmgr;
-import java.util.Map;
-
-import org.openecomp.appc.licmgr.LicenseManager;
import org.openecomp.appc.licmgr.exception.DataAccessException;
import org.openecomp.appc.licmgr.objects.LicenseModel;
@@ -44,15 +41,6 @@ public class LicenseManagerMock implements LicenseManager {
}
}
- @Override public Map<String, String> retrieveLicenseModelData(String vnfType, String vnfVersion, String... fields)
- throws DataAccessException {
- return null;
- }
-
- @Override public void storeArtifactPayload(Map<String, String> parameters) throws RuntimeException {
-
- }
-
public void storeLicenseModel(LicenseModel licenseModel){
this.licenseModel = licenseModel;
diff --git a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/openecomp/appc/licmgr/LicenseServiceMock.java b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/openecomp/appc/licmgr/LicenseServiceMock.java
index c930807b2..ec44e7cdf 100644
--- a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/openecomp/appc/licmgr/LicenseServiceMock.java
+++ b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/openecomp/appc/licmgr/LicenseServiceMock.java
@@ -23,12 +23,10 @@
*/
package org.openecomp.appc.licmgr;
-import java.util.HashMap;
-import java.util.Map;
-import org.openecomp.appc.licmgr.LicenseDataAccessService;
import org.openecomp.appc.licmgr.exception.DataAccessException;
-import org.openecomp.sdnc.sli.resource.dblib.DbLibService;
+import java.util.HashMap;
+import java.util.Map;
class LicenseServiceMock implements LicenseDataAccessService {
@@ -52,7 +50,4 @@ class LicenseServiceMock implements LicenseDataAccessService {
return null;
}
- @Override
- public void storeArtifactPayload(Map<String, String> parameters) throws DataAccessException {
- }
}