diff options
Diffstat (limited to 'appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java')
2 files changed, 2 insertions, 74 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) { |