From 3df3182a7badeef662f743bfc8d67cea805b1ef4 Mon Sep 17 00:00:00 2001 From: mojahidi Date: Tue, 29 Aug 2017 18:20:26 +0530 Subject: [PATCH] Update ASDC References to SDC 1/2 This patch changes ASDC to SDC in APPC code, bundle names and other pertinent places. This change sanitizes SDC for Open Source. It is the first in a two part change, the first updates code mentions and artifacts. The second will update database references. Change-Id: Iffd73480cc325172b5d8969fe839728f1c88ef78 Issue-ID:APPC-179 Signed-off-by: mojahidi --- .../data/services/AppcDataServiceConstant.java | 2 +- .../appc/data/services/db/DGGeneralDBService.java | 4 +- .../data/services/node/ConfigResourceNode.java | 4 +- .../controller/dbervices/FlowControlDBService.java | 18 +- .../controller/utils/FlowControllerConstants.java | 4 +- .../org/openecomp/appc/dg/aai/impl/Constants.java | 4 +- .../appc/dg/TestConfigurationDocumentRequest.java | 8 +- ...d_configuration-document-request_TC1.properties | 6 +- .../java/org/openecomp/appc/licmgr/Constants.java | 4 +- .../licmgr/impl/LicenseDataAccessServiceImpl.java | 14 +- .../appc/licmgr/impl/LicenseManagerImpl.java | 2 +- .../model/src/main/yang/artifact-handler.yang | 2 +- .../appc-artifact-handler/provider/pom.xml | 25 +- .../artifact/handler/ArtifactHandlerProvider.java | 4 +- ...vator.java => SdcArtifactHandlerActivator.java} | 5 +- .../artifact/handler/dbservices/DBService.java | 224 ++++++++-------- .../artifact/handler/node/ArtifactHandlerNode.java | 282 ++++++++++----------- .../handler/utils/ArtifactHandlerProviderUtil.java | 80 +++--- ...tants.java => SdcArtifactHandlerConstants.java} | 4 +- .../model/src/main/yang/appc-design-services.yang | 2 +- .../appc/design/dbervices/DesignDBService.java | 40 +-- .../services/util/ArtifactHandlerClient.java | 2 +- .../services/util/DesignServiceConstants.java | 2 +- .../appc/design/validator/TestDBService.java | 8 +- .../appc-oam-model/src/main/yang/appc-oam.yang | 8 +- .../src/main/yang/appc-provider-lcm.yang | 4 +- .../src/main/yang/appc-provider.yang | 6 +- .../.gitignore | 0 .../appc-sdc-listener-bundle}/.gitignore | 0 .../org.eclipse.wst.common.project.facet.core.xml | 0 .../appc-sdc-listener-bundle}/etc/asdc-client.jks | Bin .../etc/asdcclientstore.jks | Bin .../appc-sdc-listener-bundle}/log4j.properties | 0 .../appc-sdc-listener-bundle}/pom.xml | 29 ++- .../appc/sdc/artifacts/ArtifactProcessor.java | 0 .../artifacts/helper/ArtifactStorageService.java | 162 ++++++------ .../appc/sdc/artifacts/helper/Constants.java | 12 +- .../artifacts/helper/DependencyModelGenerator.java | 0 .../artifacts/impl/AbstractArtifactProcessor.java | 2 +- .../artifacts/impl/ArtifactProcessorFactory.java | 1 - .../artifacts/impl/ConfigArtifactProcessor.java | 2 +- .../artifacts/impl/LicenseArtifactProcessor.java | 4 +- .../artifacts/impl/ToscaCsarArtifactProcessor.java | 8 +- .../appc/sdc/artifacts/object/ArtifactType.java | 0 .../appc/sdc/artifacts/object/Resource.java | 0 .../appc/sdc/artifacts/object/SDCArtifact.java | 0 .../appc/sdc/artifacts/object/SDCReference.java | 0 .../openecomp/appc/sdc/artifacts/object/Vnfc.java | 0 .../appc/sdc/listener/ProviderOperations.java | 0 .../appc/sdc/listener/ProviderResponse.java | 0 .../openecomp/appc/sdc/listener/SdcCallback.java | 19 +- .../org/openecomp/appc/sdc/listener/SdcConfig.java | 30 +-- .../openecomp/appc/sdc/listener/SdcListener.java | 40 +-- .../java/org/openecomp/appc/sdc/listener/Util.java | 6 +- .../org/openecomp/tlv/sdc/security/Passwords.java | 0 .../resources/OSGI-INF/blueprint/blueprint.xml | 6 +- .../main/resources/ci/conf/attsdc-packages.yaml | 0 .../src/main/resources/ci/conf/attsdc.yaml | 0 .../src/main/resources/ci/conf/log4j.properties | 0 .../src/main/resources/ci/conf/titan.properties | 0 .../src/main/resources/ci/scripts/startTest.sh | 0 .../org/openecomp/appc/default.properties | 20 +- .../appc/sdc/listener/SdcCallbackTest.java | 71 +++--- .../appc/sdc/listener/SdcListenerTest.java | 48 ++-- .../org/openecomp/appc/sdc/listener/TestRun.java | 2 +- .../resources/csar/service-ServiceAppc-csar.csar | Bin .../org/openecomp/appc/default.properties | 18 +- .../appc-sdc-listener-features}/.gitignore | 0 .../appc-sdc-listener-features}/pom.xml | 29 ++- .../src/main/resources/features.xml | 6 +- .../appc-sdc-listener-installer}/.gitignore | 0 .../appc-sdc-listener-installer}/pom.xml | 39 ++- .../src/assembly/assemble_installer_zip.xml | 0 .../src/assembly/assemble_mvnrepo_zip.xml | 0 .../src/main/resources/scripts/install-feature.sh | 0 .../appc-yang-generator/pom.xml | 25 +- .../org/openecomp/appc/yang/YANGGenerator.java | 0 .../yang/exception/YANGGenerationException.java | 0 .../appc/yang/impl/YANGGeneratorFactory.java | 0 .../appc/yang/impl/YANGGeneratorImpl.java | 0 .../java/org/openecomp/appc/yang/objects/Leaf.java | 0 .../org/openecomp/appc/yang/type/YangTypes.java | 0 .../src/main/resources/templates/YangTemplate.vm | 0 .../java/org/openecomp/appc/TestYANGGenerator.java | 0 .../src/test/resources/tosca/toscaFile.yml | 0 .../resources/tosca/toscaFileWithSyntaxError.yml | 0 .../tosca/toscaFileWithUnsupportedTypes.yml | 0 .../src/test/resources/yang/expectedYang.yang | 0 {appc-asdc-listener => appc-sdc-listener}/pom.xml | 33 ++- pom.xml | 25 +- 90 files changed, 776 insertions(+), 629 deletions(-) rename appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/{AsdcArtifactHandlerActivator.java => SdcArtifactHandlerActivator.java} (93%) rename appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/utils/{AsdcArtifactHandlerConstants.java => SdcArtifactHandlerConstants.java} (97%) rename {appc-asdc-listener => appc-sdc-listener}/.gitignore (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/.gitignore (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/.settings/org.eclipse.wst.common.project.facet.core.xml (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/etc/asdc-client.jks (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/etc/asdcclientstore.jks (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/log4j.properties (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/pom.xml (83%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/appc/sdc/artifacts/ArtifactProcessor.java (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/appc/sdc/artifacts/helper/ArtifactStorageService.java (67%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/appc/sdc/artifacts/helper/Constants.java (88%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/appc/sdc/artifacts/helper/DependencyModelGenerator.java (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/appc/sdc/artifacts/impl/AbstractArtifactProcessor.java (98%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ArtifactProcessorFactory.java (98%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ConfigArtifactProcessor.java (96%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/appc/sdc/artifacts/impl/LicenseArtifactProcessor.java (95%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ToscaCsarArtifactProcessor.java (97%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/appc/sdc/artifacts/object/ArtifactType.java (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/appc/sdc/artifacts/object/Resource.java (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/appc/sdc/artifacts/object/SDCArtifact.java (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/appc/sdc/artifacts/object/SDCReference.java (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/appc/sdc/artifacts/object/Vnfc.java (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/appc/sdc/listener/ProviderOperations.java (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/appc/sdc/listener/ProviderResponse.java (100%) rename appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/AsdcCallback.java => appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/SdcCallback.java (89%) rename appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/AsdcConfig.java => appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/SdcConfig.java (85%) rename appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/AsdcListener.java => appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/SdcListener.java (84%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/appc/sdc/listener/Util.java (95%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/java/org/openecomp/tlv/sdc/security/Passwords.java (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/resources/OSGI-INF/blueprint/blueprint.xml (77%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/resources/ci/conf/attsdc-packages.yaml (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/resources/ci/conf/attsdc.yaml (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/resources/ci/conf/log4j.properties (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/resources/ci/conf/titan.properties (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/resources/ci/scripts/startTest.sh (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/main/resources/org/openecomp/appc/default.properties (76%) rename appc-asdc-listener/appc-asdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/AsdcCallbackTest.java => appc-sdc-listener/appc-sdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/SdcCallbackTest.java (75%) rename appc-asdc-listener/appc-asdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/AsdcListenerTest.java => appc-sdc-listener/appc-sdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/SdcListenerTest.java (77%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/test/java/org/openecomp/appc/sdc/listener/TestRun.java (95%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/test/resources/csar/service-ServiceAppc-csar.csar (100%) rename {appc-asdc-listener/appc-asdc-listener-bundle => appc-sdc-listener/appc-sdc-listener-bundle}/src/test/resources/org/openecomp/appc/default.properties (78%) rename {appc-asdc-listener/appc-asdc-listener-features => appc-sdc-listener/appc-sdc-listener-features}/.gitignore (100%) rename {appc-asdc-listener/appc-asdc-listener-features => appc-sdc-listener/appc-sdc-listener-features}/pom.xml (63%) rename {appc-asdc-listener/appc-asdc-listener-features => appc-sdc-listener/appc-sdc-listener-features}/src/main/resources/features.xml (86%) rename {appc-asdc-listener/appc-asdc-listener-installer => appc-sdc-listener/appc-sdc-listener-installer}/.gitignore (100%) rename {appc-asdc-listener/appc-asdc-listener-installer => appc-sdc-listener/appc-sdc-listener-installer}/pom.xml (69%) rename {appc-asdc-listener/appc-asdc-listener-installer => appc-sdc-listener/appc-sdc-listener-installer}/src/assembly/assemble_installer_zip.xml (100%) rename {appc-asdc-listener/appc-asdc-listener-installer => appc-sdc-listener/appc-sdc-listener-installer}/src/assembly/assemble_mvnrepo_zip.xml (100%) rename {appc-asdc-listener/appc-asdc-listener-installer => appc-sdc-listener/appc-sdc-listener-installer}/src/main/resources/scripts/install-feature.sh (100%) rename {appc-asdc-listener => appc-sdc-listener}/appc-yang-generator/pom.xml (68%) rename {appc-asdc-listener => appc-sdc-listener}/appc-yang-generator/src/main/java/org/openecomp/appc/yang/YANGGenerator.java (100%) rename {appc-asdc-listener => appc-sdc-listener}/appc-yang-generator/src/main/java/org/openecomp/appc/yang/exception/YANGGenerationException.java (100%) rename {appc-asdc-listener => appc-sdc-listener}/appc-yang-generator/src/main/java/org/openecomp/appc/yang/impl/YANGGeneratorFactory.java (100%) rename {appc-asdc-listener => appc-sdc-listener}/appc-yang-generator/src/main/java/org/openecomp/appc/yang/impl/YANGGeneratorImpl.java (100%) rename {appc-asdc-listener => appc-sdc-listener}/appc-yang-generator/src/main/java/org/openecomp/appc/yang/objects/Leaf.java (100%) rename {appc-asdc-listener => appc-sdc-listener}/appc-yang-generator/src/main/java/org/openecomp/appc/yang/type/YangTypes.java (100%) rename {appc-asdc-listener => appc-sdc-listener}/appc-yang-generator/src/main/resources/templates/YangTemplate.vm (100%) rename {appc-asdc-listener => appc-sdc-listener}/appc-yang-generator/src/test/java/org/openecomp/appc/TestYANGGenerator.java (100%) rename {appc-asdc-listener => appc-sdc-listener}/appc-yang-generator/src/test/resources/tosca/toscaFile.yml (100%) rename {appc-asdc-listener => appc-sdc-listener}/appc-yang-generator/src/test/resources/tosca/toscaFileWithSyntaxError.yml (100%) rename {appc-asdc-listener => appc-sdc-listener}/appc-yang-generator/src/test/resources/tosca/toscaFileWithUnsupportedTypes.yml (100%) rename {appc-asdc-listener => appc-sdc-listener}/appc-yang-generator/src/test/resources/yang/expectedYang.yang (100%) rename {appc-asdc-listener => appc-sdc-listener}/pom.xml (67%) diff --git a/appc-config/appc-data-services/provider/src/main/java/org/openecomp/appc/data/services/AppcDataServiceConstant.java b/appc-config/appc-data-services/provider/src/main/java/org/openecomp/appc/data/services/AppcDataServiceConstant.java index 87e0f2c9b..fed2e7cae 100644 --- a/appc-config/appc-data-services/provider/src/main/java/org/openecomp/appc/data/services/AppcDataServiceConstant.java +++ b/appc-config/appc-data-services/provider/src/main/java/org/openecomp/appc/data/services/AppcDataServiceConstant.java @@ -34,7 +34,7 @@ public class AppcDataServiceConstant { public static String OUTPUT_PARAM_ERROR_MESSAGE = "error-message"; public static final String INPUT_PARAM_FILE_CATEGORY = "fileCategory"; public static final String INPUT_PARAM_VM_INSTANCE = "vmInstance"; - public static final String INPUT_PARAM_ASDC_ARTIFACT_IND = "asdcArtifactInd"; + public static final String INPUT_PARAM_SDC_ARTIFACT_IND = "asdcArtifactInd"; public static final Object INPUT_PARAM_VNF_ID = "vnfId"; public static final Object INPUT_PARAM_VM_NAME = "vmName"; diff --git a/appc-config/appc-data-services/provider/src/main/java/org/openecomp/appc/data/services/db/DGGeneralDBService.java b/appc-config/appc-data-services/provider/src/main/java/org/openecomp/appc/data/services/db/DGGeneralDBService.java index 3ec42f61a..98fd50cc9 100644 --- a/appc-config/appc-data-services/provider/src/main/java/org/openecomp/appc/data/services/db/DGGeneralDBService.java +++ b/appc-config/appc-data-services/provider/src/main/java/org/openecomp/appc/data/services/db/DGGeneralDBService.java @@ -203,7 +203,7 @@ public class DGGeneralDBService { } - public QueryStatus savePrepareRelationship(SvcLogicContext ctx, String prefix, String fileId, String asdcInd) + public QueryStatus savePrepareRelationship(SvcLogicContext ctx, String prefix, String fileId, String sdcInd) throws SvcLogicException { QueryStatus status = null; @@ -211,7 +211,7 @@ public class DGGeneralDBService { if (serviceLogic != null && ctx != null) { - if ("Y".equals(asdcInd)) + if ("Y".equals(sdcInd)) key = "INSERT INTO PREPARE_FILE_RELATIONSHIP " + " SET service_instance_id = $service-instance-id , " + " request_id = $request-id , " + " asdc_artifacts_id = " + fileId + " ;"; diff --git a/appc-config/appc-data-services/provider/src/main/java/org/openecomp/appc/data/services/node/ConfigResourceNode.java b/appc-config/appc-data-services/provider/src/main/java/org/openecomp/appc/data/services/node/ConfigResourceNode.java index 942493905..4676d37cb 100644 --- a/appc-config/appc-data-services/provider/src/main/java/org/openecomp/appc/data/services/node/ConfigResourceNode.java +++ b/appc-config/appc-data-services/provider/src/main/java/org/openecomp/appc/data/services/node/ConfigResourceNode.java @@ -301,14 +301,14 @@ public class ConfigResourceNode implements SvcLogicJavaPlugin { log.info("Received savePrepareRelationship call with params : " + inParams); String responsePrefix = inParams.get(AppcDataServiceConstant.INPUT_PARAM_RESPONSE_PREFIX); - String asdcArtifactInd = inParams.get(AppcDataServiceConstant.INPUT_PARAM_ASDC_ARTIFACT_IND); + String sdcArtifactInd = inParams.get(AppcDataServiceConstant.INPUT_PARAM_SDC_ARTIFACT_IND); String fileId = inParams.get(AppcDataServiceConstant.INPUT_PARAM_FILE_ID); try { responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : ""; DGGeneralDBService db = DGGeneralDBService.initialise(); - QueryStatus status = db.savePrepareRelationship(ctx, "tmp.preparerel", fileId, asdcArtifactInd); + QueryStatus status = db.savePrepareRelationship(ctx, "tmp.preparerel", fileId, sdcArtifactInd); if (status == QueryStatus.FAILURE) throw new Exception("Unable to save prepare_relationship"); diff --git a/appc-config/appc-flow-controller/provider/src/main/java/org/openecomp/appc/flow/controller/dbervices/FlowControlDBService.java b/appc-config/appc-flow-controller/provider/src/main/java/org/openecomp/appc/flow/controller/dbervices/FlowControlDBService.java index c3ea6ede8..528be3263 100644 --- a/appc-config/appc-flow-controller/provider/src/main/java/org/openecomp/appc/flow/controller/dbervices/FlowControlDBService.java +++ b/appc-config/appc-flow-controller/provider/src/main/java/org/openecomp/appc/flow/controller/dbervices/FlowControlDBService.java @@ -82,8 +82,8 @@ public class FlowControlDBService { String fn = "DBService.getDesignTimeFlowModel "; QueryStatus status = null; if (serviceLogic != null && localContext != null) { - String queryString = "select max(internal_version) as maxInternalVersion, artifact_name as artifactName from " + FlowControllerConstants.DB_ASDC_ARTIFACTS - + " where artifact_name in (select artifact_name from " + FlowControllerConstants.DB_ASDC_REFERENCE + + String queryString = "select max(internal_version) as maxInternalVersion, artifact_name as artifactName from " + FlowControllerConstants.DB_SDC_ARTIFACTS + + " where artifact_name in (select artifact_name from " + FlowControllerConstants.DB_SDC_REFERENCE + " where vnf_type= $" + FlowControllerConstants.VNF_TYPE + " and vnfc_type = $" + FlowControllerConstants.VNFC_TYPE + " and action = $" + FlowControllerConstants.REQUEST_ACTION + @@ -96,7 +96,7 @@ public class FlowControlDBService { if(status.toString().equals("FAILURE")) throw new SvcLogicException("Error - while getting FlowReferenceData "); - String queryString1 = "select artifact_content from " + FlowControllerConstants.DB_ASDC_ARTIFACTS + + String queryString1 = "select artifact_content from " + FlowControllerConstants.DB_SDC_ARTIFACTS + " where artifact_name = $artifactName and internal_version = $maxInternalVersion "; log.debug(fn + "Query String : " + queryString1); @@ -168,8 +168,8 @@ public class FlowControlDBService { String fn = "DBService.getDependencyInfo "; QueryStatus status = null; if (serviceLogic != null && localContext != null) { - String queryString = "select max(internal_version) as maxInternalVersion, artifact_name as artifactName from " + FlowControllerConstants.DB_ASDC_ARTIFACTS - + " where artifact_name in (select artifact_name from " + FlowControllerConstants.DB_ASDC_REFERENCE + + String queryString = "select max(internal_version) as maxInternalVersion, artifact_name as artifactName from " + FlowControllerConstants.DB_SDC_ARTIFACTS + + " where artifact_name in (select artifact_name from " + FlowControllerConstants.DB_SDC_REFERENCE + " where vnf_type= $" + FlowControllerConstants.VNF_TYPE + " and file_category = '" + FlowControllerConstants.DEPENDENCYMODEL +"' )" ; @@ -179,7 +179,7 @@ public class FlowControlDBService { if(status.toString().equals("FAILURE")) throw new SvcLogicException("Error - while getting dependencydata "); - String queryString1 = "select artifact_content from " + FlowControllerConstants.DB_ASDC_ARTIFACTS + + String queryString1 = "select artifact_content from " + FlowControllerConstants.DB_SDC_ARTIFACTS + " where artifact_name = $artifactName and internal_version = $maxInternalVersion "; log.debug(fn + "Query String : " + queryString1); @@ -195,8 +195,8 @@ public class FlowControlDBService { String fn = "DBService.getCapabilitiesData "; QueryStatus status = null; if (serviceLogic != null && localContext != null) { - String queryString = "select max(internal_version) as maxInternalVersion, artifact_name as artifactName from " + FlowControllerConstants.DB_ASDC_ARTIFACTS - + " where artifact_name in (select artifact_name from " + FlowControllerConstants.DB_ASDC_REFERENCE + + String queryString = "select max(internal_version) as maxInternalVersion, artifact_name as artifactName from " + FlowControllerConstants.DB_SDC_ARTIFACTS + + " where artifact_name in (select artifact_name from " + FlowControllerConstants.DB_SDC_REFERENCE + " where vnf_type= $" + FlowControllerConstants.VNF_TYPE + " and file_category = '" + FlowControllerConstants.CAPABILITY +"' )" ; @@ -206,7 +206,7 @@ public class FlowControlDBService { if(status.toString().equals("FAILURE")) throw new SvcLogicException("Error - while getting capabilitiesData "); - String queryString1 = "select artifact_content from " + FlowControllerConstants.DB_ASDC_ARTIFACTS + + String queryString1 = "select artifact_content from " + FlowControllerConstants.DB_SDC_ARTIFACTS + " where artifact_name = $artifactName and internal_version = $maxInternalVersion "; log.debug(fn + "Query String : " + queryString1); diff --git a/appc-config/appc-flow-controller/provider/src/main/java/org/openecomp/appc/flow/controller/utils/FlowControllerConstants.java b/appc-config/appc-flow-controller/provider/src/main/java/org/openecomp/appc/flow/controller/utils/FlowControllerConstants.java index 70500c4b1..9adade961 100644 --- a/appc-config/appc-flow-controller/provider/src/main/java/org/openecomp/appc/flow/controller/utils/FlowControllerConstants.java +++ b/appc-config/appc-flow-controller/provider/src/main/java/org/openecomp/appc/flow/controller/utils/FlowControllerConstants.java @@ -81,8 +81,8 @@ public class FlowControllerConstants { public static final String REST = "rest"; - public static final String DB_ASDC_ARTIFACTS = "ASDC_ARTIFACTS"; - public static final String DB_ASDC_REFERENCE = "ASDC_REFERENCE"; + public static final String DB_SDC_ARTIFACTS = "ASDC_ARTIFACTS"; + public static final String DB_SDC_REFERENCE = "ASDC_REFERENCE"; public static final String DB_REQUEST_ARTIFACTS = "REQUEST_ARTIFACTS"; public static final String DB_MULTISTEP_FLOW_REFERENCE = "MULTISTEP_FLOW_REFERENCE"; public static final String DB_PROTOCOL_REFERENCE = "PROTOCOL_REFERENCE"; diff --git a/appc-dg/appc-dg-shared/appc-dg-aai/src/main/java/org/openecomp/appc/dg/aai/impl/Constants.java b/appc-dg/appc-dg-shared/appc-dg-aai/src/main/java/org/openecomp/appc/dg/aai/impl/Constants.java index 1ccd6c47d..7f82ea79f 100644 --- a/appc-dg/appc-dg-shared/appc-dg-aai/src/main/java/org/openecomp/appc/dg/aai/impl/Constants.java +++ b/appc-dg/appc-dg-shared/appc-dg-aai/src/main/java/org/openecomp/appc/dg/aai/impl/Constants.java @@ -58,7 +58,7 @@ public class Constants { public static final String REQUEST_ID_FIELD_NAME = "REQUEST_ID"; public static final String CREATION_DATE_FIELD_NAME = "CREATION_DATE"; public static final String LOG_FIELD_NAME = "LOG"; - public static final String ASDC_ARTIFACTS_TABLE_NAME = "ASDC_ARTIFACTS"; + public static final String SDC_ARTIFACTS_TABLE_NAME = "ASDC_ARTIFACTS"; // input fields names public static final String PAYLOAD = "payload"; @@ -98,7 +98,7 @@ public class Constants { */ public static final String AAI_VNF_MODEL_VERSION_ID ="model-version-id"; - public enum ASDC_ARTIFACTS_FIELDS { + public enum SDC_ARTIFACTS_FIELDS { SERVICE_UUID, DISTRIBUTION_ID, SERVICE_NAME, diff --git a/appc-directed-graph/appc-dgraph/provider/src/test/java/org/openecomp/appc/dg/TestConfigurationDocumentRequest.java b/appc-directed-graph/appc-dgraph/provider/src/test/java/org/openecomp/appc/dg/TestConfigurationDocumentRequest.java index 211c14215..2f90ac959 100644 --- a/appc-directed-graph/appc-dgraph/provider/src/test/java/org/openecomp/appc/dg/TestConfigurationDocumentRequest.java +++ b/appc-directed-graph/appc-dgraph/provider/src/test/java/org/openecomp/appc/dg/TestConfigurationDocumentRequest.java @@ -36,11 +36,11 @@ public class TestConfigurationDocumentRequest /* extends AbstractDGTestCase */ { /* @Test - public void testASDCMessage() { + public void testSDCMessage() { try { - String propertyfileName = "ASDC-MESSAGE_method_configuration-document-request_TC1.properties"; + String propertyfileName = "SDC-MESSAGE_method_configuration-document-request_TC1.properties"; - String configurationDocumentRequestXML = "src/main/resources/xml/ASDC-MESSAGE_method_configuration-document-request_3.0.0.xml"; + String configurationDocumentRequestXML = "src/main/resources/xml/SDC-MESSAGE_method_configuration-document-request_3.0.0.xml"; // Register Call graphs @@ -50,7 +50,7 @@ public class TestConfigurationDocumentRequest /* extends AbstractDGTestCase */ { serviceReferences.put("org.openecomp.sdnc.config.generator.convert.ConvertNode",new org.openecomp.sdnc.config.generator.convert.ConvertNode()); serviceReferences.put("org.openecomp.sdnc.config.generator.merge.MergeNode", new org.openecomp.sdnc.config.generator.merge.MergeNode()); - GraphKey graphKey = new GraphKey("ASDC-MESSAGE", null, "configuration-document-request", null); + GraphKey graphKey = new GraphKey("SDC-MESSAGE", null, "configuration-document-request", null); DGTestCase tc = new DGTestCase(graphKey); tc.setInjectGraphXmls(injectGraphXmls); tc.setServiceReferences(serviceReferences); diff --git a/appc-directed-graph/appc-dgraph/provider/src/test/resources/properties/ASDC-MESSAGE_method_configuration-document-request_TC1.properties b/appc-directed-graph/appc-dgraph/provider/src/test/resources/properties/ASDC-MESSAGE_method_configuration-document-request_TC1.properties index ffbdff81c..225e304b5 100644 --- a/appc-directed-graph/appc-dgraph/provider/src/test/resources/properties/ASDC-MESSAGE_method_configuration-document-request_TC1.properties +++ b/appc-directed-graph/appc-dgraph/provider/src/test/resources/properties/ASDC-MESSAGE_method_configuration-document-request_TC1.properties @@ -18,6 +18,6 @@ # ============LICENSE_END========================================================= ### -asdc-reference.configuration-document-request-input.document-parameters.artifact-contents=tcfile://vdbe_template.xml -asdc-reference.outCome=SUCCESS -tmp.asdc-artifacts.outCome=SUCCESS +sdc-reference.configuration-document-request-input.document-parameters.artifact-contents=tcfile://vdbe_template.xml +sdc-reference.outCome=SUCCESS +tmp.sdc-artifacts.outCome=SUCCESS diff --git a/appc-dispatcher/appc-license-manager/appc-license-manager-api/src/main/java/org/openecomp/appc/licmgr/Constants.java b/appc-dispatcher/appc-license-manager/appc-license-manager-api/src/main/java/org/openecomp/appc/licmgr/Constants.java index dc255cd57..ba39134bf 100644 --- a/appc-dispatcher/appc-license-manager/appc-license-manager-api/src/main/java/org/openecomp/appc/licmgr/Constants.java +++ b/appc-dispatcher/appc-license-manager/appc-license-manager-api/src/main/java/org/openecomp/appc/licmgr/Constants.java @@ -55,7 +55,7 @@ public class Constants { public static final String REQUEST_ID_FIELD_NAME = "REQUEST_ID"; public static final String CREATION_DATE_FIELD_NAME = "CREATION_DATE"; public static final String LOG_FIELD_NAME = "LOG"; - public static final String ASDC_ARTIFACTS = "ASDC_ARTIFACTS"; + public static final String SDC_ARTIFACTS = "ASDC_ARTIFACTS"; // input fields names public static final String PAYLOAD = "payload"; @@ -89,7 +89,7 @@ public class Constants { public static final String IS_ACQUIRE_ENTITLEMENT_REQUIRE ="is.acquire-entitlement.require"; public static final String IS_RELEASE_ENTITLEMENT_REQUIRE ="is.release-entitlement.require"; - public enum ASDC_ARTIFACTS_FIELDS { + public enum SDC_ARTIFACTS_FIELDS { SERVICE_UUID, DISTRIBUTION_ID, SERVICE_NAME, 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 8e999c4c9..557c1a3e5 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 @@ -33,7 +33,7 @@ import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import org.openecomp.sdnc.sli.resource.dblib.DbLibService; -import static org.openecomp.appc.licmgr.Constants.ASDC_ARTIFACTS_FIELDS; +import static org.openecomp.appc.licmgr.Constants.SDC_ARTIFACTS_FIELDS; import java.sql.SQLException; import java.util.ArrayList; @@ -69,7 +69,7 @@ public class LicenseDataAccessServiceImpl implements LicenseDataAccessService { DataAccessException { Map result = new HashMap<>(); - if (null == fields || 0 == fields.length) fields = new String[]{ASDC_ARTIFACTS_FIELDS.ARTIFACT_CONTENT.name()}; + if (null == fields || 0 == fields.length) fields = new String[]{SDC_ARTIFACTS_FIELDS.ARTIFACT_CONTENT.name()}; String queryString = buildQueryStatement(); @@ -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; + String msg = "Missing license model for VNF_TYPE: " + vnfType + " and VNF_VERSION: " + vnfVersion + " in table " + Constants.SDC_ARTIFACTS; logger.info(msg); } } catch (SQLException e) { @@ -99,10 +99,10 @@ public class LicenseDataAccessServiceImpl implements LicenseDataAccessService { } private String buildQueryStatement() { - 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() + " = ?"; + return "select * " + "from " + Constants.SDC_ARTIFACTS + " " + + "where " + SDC_ARTIFACTS_FIELDS.RESOURCE_NAME.name() + " = ?" + + " AND " + SDC_ARTIFACTS_FIELDS.RESOURCE_VERSION.name() + " = ?" + + " AND " + SDC_ARTIFACTS_FIELDS.ARTIFACT_TYPE.name() + " = ?"; } } 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 9f3db5aab..4fc6a9345 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 @@ -24,7 +24,7 @@ package org.openecomp.appc.licmgr.impl; -import static org.openecomp.appc.licmgr.Constants.ASDC_ARTIFACTS_FIELDS.ARTIFACT_CONTENT; +import static org.openecomp.appc.licmgr.Constants.SDC_ARTIFACTS_FIELDS.ARTIFACT_CONTENT; import java.util.Map; diff --git a/appc-inbound/appc-artifact-handler/model/src/main/yang/artifact-handler.yang b/appc-inbound/appc-artifact-handler/model/src/main/yang/artifact-handler.yang index 1839fbd67..e56b9c430 100644 --- a/appc-inbound/appc-artifact-handler/model/src/main/yang/artifact-handler.yang +++ b/appc-inbound/appc-artifact-handler/model/src/main/yang/artifact-handler.yang @@ -51,7 +51,7 @@ module artifact-handler { } leaf request-action { type enumeration { - enum "StoreAsdcDocumentRequest"; + enum "StoreSdcDocumentRequest"; } } leaf request-sub-action { diff --git a/appc-inbound/appc-artifact-handler/provider/pom.xml b/appc-inbound/appc-artifact-handler/provider/pom.xml index 90d34a320..1bb627535 100755 --- a/appc-inbound/appc-artifact-handler/provider/pom.xml +++ b/appc-inbound/appc-artifact-handler/provider/pom.xml @@ -1,4 +1,27 @@ + 4.0.0 @@ -19,7 +42,7 @@ org.openecomp.appc.artifact.handler - org.openecomp.appc.artifact.handler.AsdcArtifactHandlerActivator + org.openecomp.appc.artifact.handler.SdcArtifactHandlerActivator org.openecomp.appc.artifact.handler,org.opendaylight.controller.config.yang.config.artifact-handler_provider.impl * * diff --git a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/ArtifactHandlerProvider.java b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/ArtifactHandlerProvider.java index 233984f55..d94f02a54 100644 --- a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/ArtifactHandlerProvider.java +++ b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/ArtifactHandlerProvider.java @@ -56,7 +56,7 @@ import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.common.RpcResultBuilder; import org.openecomp.appc.artifact.handler.node.ArtifactHandlerNode; import org.openecomp.appc.artifact.handler.utils.ArtifactHandlerProviderUtil; -import org.openecomp.appc.artifact.handler.utils.AsdcArtifactHandlerConstants; +import org.openecomp.appc.artifact.handler.utils.SdcArtifactHandlerConstants; import org.openecomp.sdnc.sli.SvcLogicContext; import com.att.eelf.configuration.EELFLogger; @@ -180,7 +180,7 @@ public class ArtifactHandlerProvider implements AutoCloseable, ArtifactHandlerSe try{ if(input.getRequestInformation().getSource() !=null){ - if(input.getRequestInformation().getSource().equalsIgnoreCase(AsdcArtifactHandlerConstants.DESIGN_TOOL)){ + if(input.getRequestInformation().getSource().equalsIgnoreCase(SdcArtifactHandlerConstants.DESIGN_TOOL)){ designUtil.processTemplate(designUtil.createDummyRequestData()); configResponseBuilder.setStatus(ArtifactHandlerProviderUtil.DistributionStatusEnum.DEPLOY_OK.toString()); } diff --git a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/AsdcArtifactHandlerActivator.java b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/SdcArtifactHandlerActivator.java similarity index 93% rename from appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/AsdcArtifactHandlerActivator.java rename to appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/SdcArtifactHandlerActivator.java index 4c8e1358f..6ce8af993 100644 --- a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/AsdcArtifactHandlerActivator.java +++ b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/SdcArtifactHandlerActivator.java @@ -26,7 +26,6 @@ package org.openecomp.appc.artifact.handler; import java.util.LinkedList; import java.util.List; -import java.util.Properties; import org.openecomp.appc.artifact.handler.node.ArtifactHandlerNode; import org.osgi.framework.BundleActivator; @@ -36,9 +35,9 @@ import org.osgi.framework.ServiceRegistration; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; -public class AsdcArtifactHandlerActivator implements BundleActivator { +public class SdcArtifactHandlerActivator implements BundleActivator { - private static final EELFLogger log = EELFManager.getInstance().getLogger(AsdcArtifactHandlerActivator.class); + private static final EELFLogger log = EELFManager.getInstance().getLogger(SdcArtifactHandlerActivator.class); private List registrations = new LinkedList(); @Override diff --git a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/dbservices/DBService.java b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/dbservices/DBService.java index 4984ebf43..0116bb265 100644 --- a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/dbservices/DBService.java +++ b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/dbservices/DBService.java @@ -27,7 +27,7 @@ package org.openecomp.appc.artifact.handler.dbservices; import java.sql.SQLException; import java.util.HashMap; -import org.openecomp.appc.artifact.handler.utils.AsdcArtifactHandlerConstants; +import org.openecomp.appc.artifact.handler.utils.SdcArtifactHandlerConstants; import org.openecomp.sdnc.sli.SvcLogicContext; import org.openecomp.sdnc.sli.SvcLogicException; import org.openecomp.sdnc.sli.SvcLogicResource; @@ -84,7 +84,7 @@ public class DBService { if(status.toString().equals("FAILURE")) throw new SvcLogicException("Error - getting Artifact ID from database"); artifactID = ctx.getAttribute("id"); - log.info("ASDC_ARTIFACTS_ID received as : " + ctx.getAttribute("id")); + log.info("SDC_ARTIFACTS_ID received as : " + ctx.getAttribute("id")); } return artifactID; } @@ -112,7 +112,7 @@ public class DBService { status = serviceLogic.save("SQL", false, false, key, null, null, ctx); if(status.toString().equals("FAILURE")) - throw new SvcLogicException("Error While processing storing Artifact: " +ctx.getAttribute(AsdcArtifactHandlerConstants.ARTIFACT_NAME)); + throw new SvcLogicException("Error While processing storing Artifact: " +ctx.getAttribute(SdcArtifactHandlerConstants.ARTIFACT_NAME)); } return status; @@ -134,55 +134,55 @@ public class DBService { public void processConfigureActionDg(SvcLogicContext context, boolean isUpdate) { String fn = "DBService.processConfigureActionDg"; - log.info("Update Parameter for ASDC Reference " + isUpdate ); + log.info("Update Parameter for SDC Reference " + isUpdate ); String key = ""; QueryStatus status = null; if(isUpdate); } - public void processAsdcReferences(SvcLogicContext context, boolean isUpdate) throws SvcLogicException { - String fn = "DBService.processAsdcReferences"; + public void processSdcReferences(SvcLogicContext context, boolean isUpdate) throws SvcLogicException { + String fn = "DBService.processSdcReferences"; String key = ""; QueryStatus status = null; - if (isUpdate && AsdcArtifactHandlerConstants.FILE_CATEGORY.equals(AsdcArtifactHandlerConstants.CAPABILITY)) { - key = "update " + AsdcArtifactHandlerConstants.DB_ASDC_REFERENCE + " set ARTIFACT_NAME = $" + AsdcArtifactHandlerConstants.ARTIFACT_NAME + - " where VNFC_TYPE = $" + AsdcArtifactHandlerConstants.VNFC_TYPE + - " and FILE_CATEGORY = $" + AsdcArtifactHandlerConstants.FILE_CATEGORY + + if (isUpdate && SdcArtifactHandlerConstants.FILE_CATEGORY.equals(SdcArtifactHandlerConstants.CAPABILITY)) { + key = "update " + SdcArtifactHandlerConstants.DB_SDC_REFERENCE + " set ARTIFACT_NAME = $" + SdcArtifactHandlerConstants.ARTIFACT_NAME + + " where VNFC_TYPE = $" + SdcArtifactHandlerConstants.VNFC_TYPE + + " and FILE_CATEGORY = $" + SdcArtifactHandlerConstants.FILE_CATEGORY + " and ACTION = null"; } else if(isUpdate) - key = "update " + AsdcArtifactHandlerConstants.DB_ASDC_REFERENCE + " set ARTIFACT_NAME = $" + AsdcArtifactHandlerConstants.ARTIFACT_NAME + - " where VNFC_TYPE = $" + AsdcArtifactHandlerConstants.VNFC_TYPE + - " and FILE_CATEGORY = $" + AsdcArtifactHandlerConstants.FILE_CATEGORY + - " and ACTION = $" + AsdcArtifactHandlerConstants.ACTION ; + key = "update " + SdcArtifactHandlerConstants.DB_SDC_REFERENCE + " set ARTIFACT_NAME = $" + SdcArtifactHandlerConstants.ARTIFACT_NAME + + " where VNFC_TYPE = $" + SdcArtifactHandlerConstants.VNFC_TYPE + + " and FILE_CATEGORY = $" + SdcArtifactHandlerConstants.FILE_CATEGORY + + " and ACTION = $" + SdcArtifactHandlerConstants.ACTION ; else { - if (AsdcArtifactHandlerConstants.FILE_CATEGORY.equals(AsdcArtifactHandlerConstants.CAPABILITY)) { - key = "insert into " + AsdcArtifactHandlerConstants.DB_ASDC_REFERENCE + + if (SdcArtifactHandlerConstants.FILE_CATEGORY.equals(SdcArtifactHandlerConstants.CAPABILITY)) { + key = "insert into " + SdcArtifactHandlerConstants.DB_SDC_REFERENCE + " set VNFC_TYPE = null " + - " , FILE_CATEGORY = $" + AsdcArtifactHandlerConstants.FILE_CATEGORY + - " , VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE + + " , FILE_CATEGORY = $" + SdcArtifactHandlerConstants.FILE_CATEGORY + + " , VNF_TYPE = $" + SdcArtifactHandlerConstants.VNF_TYPE + " , ACTION = null " + " , ARTIFACT_TYPE = null " + - " , ARTIFACT_NAME = $" + AsdcArtifactHandlerConstants.ARTIFACT_NAME ; + " , ARTIFACT_NAME = $" + SdcArtifactHandlerConstants.ARTIFACT_NAME ; } else { - key = "insert into " + AsdcArtifactHandlerConstants.DB_ASDC_REFERENCE + - " set VNFC_TYPE = $" + AsdcArtifactHandlerConstants.VNFC_TYPE + - " , FILE_CATEGORY = $" + AsdcArtifactHandlerConstants.FILE_CATEGORY + - " , VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE + - " , ACTION = $" + AsdcArtifactHandlerConstants.ACTION + - " , ARTIFACT_TYPE = $" + AsdcArtifactHandlerConstants.ARTIFACT_TYPE + - " , ARTIFACT_NAME = $" + AsdcArtifactHandlerConstants.ARTIFACT_NAME ; + key = "insert into " + SdcArtifactHandlerConstants.DB_SDC_REFERENCE + + " set VNFC_TYPE = $" + SdcArtifactHandlerConstants.VNFC_TYPE + + " , FILE_CATEGORY = $" + SdcArtifactHandlerConstants.FILE_CATEGORY + + " , VNF_TYPE = $" + SdcArtifactHandlerConstants.VNF_TYPE + + " , ACTION = $" + SdcArtifactHandlerConstants.ACTION + + " , ARTIFACT_TYPE = $" + SdcArtifactHandlerConstants.ARTIFACT_TYPE + + " , ARTIFACT_NAME = $" + SdcArtifactHandlerConstants.ARTIFACT_NAME ; } } if (serviceLogic != null && context != null) { log.info("Insert Key: " + key); status = serviceLogic.save("SQL", false, false, key, null, null, context); if(status.toString().equals("FAILURE")) - throw new SvcLogicException("Error While processing asdc_reference table "); + throw new SvcLogicException("Error While processing sdc_reference table "); } } @@ -191,50 +191,50 @@ public class DBService { log.info("Checking if Update required for this data" ); log.info("db" + db); - log.info("ACTION=" + context.getAttribute(AsdcArtifactHandlerConstants.ACTION)); - log.info("VNFC_TYPE=" + context.getAttribute(AsdcArtifactHandlerConstants.VNFC_TYPE)); - log.info("VNFC_INSTANCE=" + context.getAttribute(AsdcArtifactHandlerConstants.VNFC_INSTANCE)); - log.info("VM_INSTANCE=" + context.getAttribute(AsdcArtifactHandlerConstants.VM_INSTANCE)); - log.info("VNF_TYPE=" + context.getAttribute(AsdcArtifactHandlerConstants.VNF_TYPE)); + log.info("ACTION=" + context.getAttribute(SdcArtifactHandlerConstants.ACTION)); + log.info("VNFC_TYPE=" + context.getAttribute(SdcArtifactHandlerConstants.VNFC_TYPE)); + log.info("VNFC_INSTANCE=" + context.getAttribute(SdcArtifactHandlerConstants.VNFC_INSTANCE)); + log.info("VM_INSTANCE=" + context.getAttribute(SdcArtifactHandlerConstants.VM_INSTANCE)); + log.info("VNF_TYPE=" + context.getAttribute(SdcArtifactHandlerConstants.VNF_TYPE)); String whereClause = ""; QueryStatus status = null; - /* if(context.getAttribute(AsdcArtifactHandlerConstants.ARTIFACT_NAME) !=null && - context.getAttribute(AsdcArtifactHandlerConstants.ARTIFACT_NAME).toLowerCase().startsWith(AsdcArtifactHandlerConstants.PD)) - whereClause = " where artifact_name = $" + AsdcArtifactHandlerConstants.ARTIFACT_NAME + /* if(context.getAttribute(SdcArtifactHandlerConstants.ARTIFACT_NAME) !=null && + context.getAttribute(SdcArtifactHandlerConstants.ARTIFACT_NAME).toLowerCase().startsWith(SdcArtifactHandlerConstants.PD)) + whereClause = " where artifact_name = $" + SdcArtifactHandlerConstants.ARTIFACT_NAME + " and vnf_type = 'DummyVnf' "; else*/ - whereClause = " where VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE; + whereClause = " where VNF_TYPE = $" + SdcArtifactHandlerConstants.VNF_TYPE; - if (db !=null && db.equals(AsdcArtifactHandlerConstants.DB_ASDC_REFERENCE) && - context.getAttribute(AsdcArtifactHandlerConstants.FILE_CATEGORY).equals(AsdcArtifactHandlerConstants.CAPABILITY) && - context.getAttribute(AsdcArtifactHandlerConstants.ACTION) ==null) { - whereClause = whereClause + " and FILE_CATEGORY = $" + AsdcArtifactHandlerConstants.FILE_CATEGORY ; + if (db !=null && db.equals(SdcArtifactHandlerConstants.DB_SDC_REFERENCE) && + context.getAttribute(SdcArtifactHandlerConstants.FILE_CATEGORY).equals(SdcArtifactHandlerConstants.CAPABILITY) && + context.getAttribute(SdcArtifactHandlerConstants.ACTION) ==null) { + whereClause = whereClause + " and FILE_CATEGORY = $" + SdcArtifactHandlerConstants.FILE_CATEGORY ; } - else if(db !=null && db.equals(AsdcArtifactHandlerConstants.DB_ASDC_REFERENCE)) { - whereClause = whereClause + " and VNFC_TYPE = $" + AsdcArtifactHandlerConstants.VNFC_TYPE - + " and FILE_CATEGORY = $" + AsdcArtifactHandlerConstants.FILE_CATEGORY - + " and ACTION = $" + AsdcArtifactHandlerConstants.ACTION; + else if(db !=null && db.equals(SdcArtifactHandlerConstants.DB_SDC_REFERENCE)) { + whereClause = whereClause + " and VNFC_TYPE = $" + SdcArtifactHandlerConstants.VNFC_TYPE + + " and FILE_CATEGORY = $" + SdcArtifactHandlerConstants.FILE_CATEGORY + + " and ACTION = $" + SdcArtifactHandlerConstants.ACTION; } - else if(db.equals(AsdcArtifactHandlerConstants.DB_DOWNLOAD_DG_REFERENCE)) { - whereClause = " where PROTOCOL = $" + AsdcArtifactHandlerConstants.DEVICE_PROTOCOL; + else if(db.equals(SdcArtifactHandlerConstants.DB_DOWNLOAD_DG_REFERENCE)) { + whereClause = " where PROTOCOL = $" + SdcArtifactHandlerConstants.DEVICE_PROTOCOL; } - else if(db.equals(AsdcArtifactHandlerConstants.DB_CONFIG_ACTION_DG)) { - whereClause = whereClause + " and ACTION = $" + AsdcArtifactHandlerConstants.ACTION; + else if(db.equals(SdcArtifactHandlerConstants.DB_CONFIG_ACTION_DG)) { + whereClause = whereClause + " and ACTION = $" + SdcArtifactHandlerConstants.ACTION; } - else if(db.equals(AsdcArtifactHandlerConstants.DB_VNFC_REFERENCE)){ + else if(db.equals(SdcArtifactHandlerConstants.DB_VNFC_REFERENCE)){ int vm_instance = -1 ; - if(context.getAttribute(AsdcArtifactHandlerConstants.VM_INSTANCE) !=null) - vm_instance = Integer.parseInt(context.getAttribute(AsdcArtifactHandlerConstants.VM_INSTANCE)); + if(context.getAttribute(SdcArtifactHandlerConstants.VM_INSTANCE) !=null) + vm_instance = Integer.parseInt(context.getAttribute(SdcArtifactHandlerConstants.VM_INSTANCE)); int vnfc_instance = -1 ; - if(context.getAttribute(AsdcArtifactHandlerConstants.VNFC_INSTANCE) !=null) - vnfc_instance = Integer.parseInt(context.getAttribute(AsdcArtifactHandlerConstants.VNFC_INSTANCE)); - whereClause = whereClause + " and ACTION = $" + AsdcArtifactHandlerConstants.ACTION - + " and VNFC_TYPE = $" + AsdcArtifactHandlerConstants.VNFC_TYPE - + " and VNFC_INSTANCE = $" + AsdcArtifactHandlerConstants.VNFC_INSTANCE - + " and VM_INSTANCE = $" + AsdcArtifactHandlerConstants.VM_INSTANCE ; + if(context.getAttribute(SdcArtifactHandlerConstants.VNFC_INSTANCE) !=null) + vnfc_instance = Integer.parseInt(context.getAttribute(SdcArtifactHandlerConstants.VNFC_INSTANCE)); + whereClause = whereClause + " and ACTION = $" + SdcArtifactHandlerConstants.ACTION + + " and VNFC_TYPE = $" + SdcArtifactHandlerConstants.VNFC_TYPE + + " and VNFC_INSTANCE = $" + SdcArtifactHandlerConstants.VNFC_INSTANCE + + " and VM_INSTANCE = $" + SdcArtifactHandlerConstants.VM_INSTANCE ; } if (serviceLogic != null && context != null) { @@ -262,15 +262,15 @@ public class DBService { String key = ""; QueryStatus status = null; if(isUpdate) - key = "update " + AsdcArtifactHandlerConstants.DB_DEVICE_INTERFACE_PROTOCOL + - " set PROTOCOL = $" + AsdcArtifactHandlerConstants.DEVICE_PROTOCOL + + key = "update " + SdcArtifactHandlerConstants.DB_DEVICE_INTERFACE_PROTOCOL + + " set PROTOCOL = $" + SdcArtifactHandlerConstants.DEVICE_PROTOCOL + " , DG_RPC = 'getDeviceRunningConfig' " + " , MODULE = 'APPC' " + - " where VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE ; + " where VNF_TYPE = $" + SdcArtifactHandlerConstants.VNF_TYPE ; else - key = "insert into " + AsdcArtifactHandlerConstants.DB_DEVICE_INTERFACE_PROTOCOL+ - " set VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE + - " , PROTOCOL = $" + AsdcArtifactHandlerConstants.DEVICE_PROTOCOL + + key = "insert into " + SdcArtifactHandlerConstants.DB_DEVICE_INTERFACE_PROTOCOL+ + " set VNF_TYPE = $" + SdcArtifactHandlerConstants.VNF_TYPE + + " , PROTOCOL = $" + SdcArtifactHandlerConstants.DEVICE_PROTOCOL + " , DG_RPC = 'getDeviceRunningConfig' " + " , MODULE = 'APPC' " ; @@ -289,17 +289,17 @@ public class DBService { String key = ""; QueryStatus status = null; if(isUpdate) - key = "update " + AsdcArtifactHandlerConstants.DB_DEVICE_AUTHENTICATION + - " set USER_NAME = $" + AsdcArtifactHandlerConstants.USER_NAME + + key = "update " + SdcArtifactHandlerConstants.DB_DEVICE_AUTHENTICATION + + " set USER_NAME = $" + SdcArtifactHandlerConstants.USER_NAME + " , PASSWORD = 'dummy' " + - " , PORT_NUMBER = $" + AsdcArtifactHandlerConstants.PORT_NUMBER + - " where VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE ; + " , PORT_NUMBER = $" + SdcArtifactHandlerConstants.PORT_NUMBER + + " where VNF_TYPE = $" + SdcArtifactHandlerConstants.VNF_TYPE ; else - key = "insert into " + AsdcArtifactHandlerConstants.DB_DEVICE_AUTHENTICATION+ - " set VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE + - " , USER_NAME = $" + AsdcArtifactHandlerConstants.USER_NAME + + key = "insert into " + SdcArtifactHandlerConstants.DB_DEVICE_AUTHENTICATION+ + " set VNF_TYPE = $" + SdcArtifactHandlerConstants.VNF_TYPE + + " , USER_NAME = $" + SdcArtifactHandlerConstants.USER_NAME + " , PASSWORD = 'dummy' " + - " , PORT_NUMBER = $" + AsdcArtifactHandlerConstants.PORT_NUMBER; + " , PORT_NUMBER = $" + SdcArtifactHandlerConstants.PORT_NUMBER; if (serviceLogic != null && context != null) { status = serviceLogic.save("SQL", false, false, key, null, null, context); @@ -313,37 +313,37 @@ public class DBService { log.info(fn + "Starting DB operation for Vnfc Reference " + isUpdate ); String key = ""; int vm_instance = -1 ; - if(context.getAttribute(AsdcArtifactHandlerConstants.VM_INSTANCE) !=null) - vm_instance = Integer.parseInt(context.getAttribute(AsdcArtifactHandlerConstants.VM_INSTANCE)); + if(context.getAttribute(SdcArtifactHandlerConstants.VM_INSTANCE) !=null) + vm_instance = Integer.parseInt(context.getAttribute(SdcArtifactHandlerConstants.VM_INSTANCE)); int vnfc_instance = -1 ; - if(context.getAttribute(AsdcArtifactHandlerConstants.VNFC_INSTANCE) !=null) - vnfc_instance = Integer.parseInt(context.getAttribute(AsdcArtifactHandlerConstants.VNFC_INSTANCE)); + if(context.getAttribute(SdcArtifactHandlerConstants.VNFC_INSTANCE) !=null) + vnfc_instance = Integer.parseInt(context.getAttribute(SdcArtifactHandlerConstants.VNFC_INSTANCE)); QueryStatus status = null; if(isUpdate) - key = "update " + AsdcArtifactHandlerConstants.DB_VNFC_REFERENCE + + key = "update " + SdcArtifactHandlerConstants.DB_VNFC_REFERENCE + " set VM_INSTANCE = " + vm_instance + " , VNFC_INSTANCE = " + vnfc_instance + - " , VNFC_TYPE = $" + AsdcArtifactHandlerConstants.VNFC_TYPE + - " , VNFC_FUNCTION_CODE = $" + AsdcArtifactHandlerConstants.VNFC_FUNCTION_CODE + - " , GROUP_NOTATION_TYPE = $" + AsdcArtifactHandlerConstants.GROUP_NOTATION_TYPE + - " , GROUP_NOTATION_VALUE = $" + AsdcArtifactHandlerConstants.GROUP_NOTATION_VALUE + - " , IPADDRESS_V4_OAM_VIP = $" + AsdcArtifactHandlerConstants.IPADDRESS_V4_OAM_VIP + - " where VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE + - " and ACTION = $" + AsdcArtifactHandlerConstants.ACTION + - " and VNFC_TYPE = $" + AsdcArtifactHandlerConstants.VNFC_TYPE + - " and VNFC_INSTANCE = $" + AsdcArtifactHandlerConstants.VNFC_INSTANCE - + " and VM_INSTANCE = $" + AsdcArtifactHandlerConstants.VM_INSTANCE ; + " , VNFC_TYPE = $" + SdcArtifactHandlerConstants.VNFC_TYPE + + " , VNFC_FUNCTION_CODE = $" + SdcArtifactHandlerConstants.VNFC_FUNCTION_CODE + + " , GROUP_NOTATION_TYPE = $" + SdcArtifactHandlerConstants.GROUP_NOTATION_TYPE + + " , GROUP_NOTATION_VALUE = $" + SdcArtifactHandlerConstants.GROUP_NOTATION_VALUE + + " , IPADDRESS_V4_OAM_VIP = $" + SdcArtifactHandlerConstants.IPADDRESS_V4_OAM_VIP + + " where VNF_TYPE = $" + SdcArtifactHandlerConstants.VNF_TYPE + + " and ACTION = $" + SdcArtifactHandlerConstants.ACTION + + " and VNFC_TYPE = $" + SdcArtifactHandlerConstants.VNFC_TYPE + + " and VNFC_INSTANCE = $" + SdcArtifactHandlerConstants.VNFC_INSTANCE + + " and VM_INSTANCE = $" + SdcArtifactHandlerConstants.VM_INSTANCE ; else - key = "insert into " + AsdcArtifactHandlerConstants.DB_VNFC_REFERENCE+ - " set VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE + - " , ACTION = $" + AsdcArtifactHandlerConstants.ACTION + - " , VM_INSTANCE = $" + AsdcArtifactHandlerConstants.VM_INSTANCE + - " , VNFC_INSTANCE = $" + AsdcArtifactHandlerConstants.VNFC_INSTANCE + - " , VNFC_TYPE = $" + AsdcArtifactHandlerConstants.VNFC_TYPE + - " , VNFC_FUNCTION_CODE = $" + AsdcArtifactHandlerConstants.VNFC_FUNCTION_CODE + - " , GROUP_NOTATION_TYPE = $" + AsdcArtifactHandlerConstants.GROUP_NOTATION_TYPE + - " , IPADDRESS_V4_OAM_VIP = $" + AsdcArtifactHandlerConstants.IPADDRESS_V4_OAM_VIP + - " , GROUP_NOTATION_VALUE = $" + AsdcArtifactHandlerConstants.GROUP_NOTATION_VALUE ; + key = "insert into " + SdcArtifactHandlerConstants.DB_VNFC_REFERENCE+ + " set VNF_TYPE = $" + SdcArtifactHandlerConstants.VNF_TYPE + + " , ACTION = $" + SdcArtifactHandlerConstants.ACTION + + " , VM_INSTANCE = $" + SdcArtifactHandlerConstants.VM_INSTANCE + + " , VNFC_INSTANCE = $" + SdcArtifactHandlerConstants.VNFC_INSTANCE + + " , VNFC_TYPE = $" + SdcArtifactHandlerConstants.VNFC_TYPE + + " , VNFC_FUNCTION_CODE = $" + SdcArtifactHandlerConstants.VNFC_FUNCTION_CODE + + " , GROUP_NOTATION_TYPE = $" + SdcArtifactHandlerConstants.GROUP_NOTATION_TYPE + + " , IPADDRESS_V4_OAM_VIP = $" + SdcArtifactHandlerConstants.IPADDRESS_V4_OAM_VIP + + " , GROUP_NOTATION_VALUE = $" + SdcArtifactHandlerConstants.GROUP_NOTATION_VALUE ; if (serviceLogic != null && context != null) { status = serviceLogic.save("SQL", false, false, key, null, null, context); @@ -359,13 +359,13 @@ public class DBService { QueryStatus status = null; if(isUpdate) - key = "update " + AsdcArtifactHandlerConstants.DB_DOWNLOAD_DG_REFERENCE + - " set DOWNLOAD_CONFIG_DG = $" + AsdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE + - " where PROTOCOL = $" + AsdcArtifactHandlerConstants.DEVICE_PROTOCOL ; + key = "update " + SdcArtifactHandlerConstants.DB_DOWNLOAD_DG_REFERENCE + + " set DOWNLOAD_CONFIG_DG = $" + SdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE + + " where PROTOCOL = $" + SdcArtifactHandlerConstants.DEVICE_PROTOCOL ; else - key = "insert into " + AsdcArtifactHandlerConstants.DB_DOWNLOAD_DG_REFERENCE+ - " set DOWNLOAD_CONFIG_DG = $" + AsdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE + - " , PROTOCOL = $" + AsdcArtifactHandlerConstants.DEVICE_PROTOCOL ; + key = "insert into " + SdcArtifactHandlerConstants.DB_DOWNLOAD_DG_REFERENCE+ + " set DOWNLOAD_CONFIG_DG = $" + SdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE + + " , PROTOCOL = $" + SdcArtifactHandlerConstants.DEVICE_PROTOCOL ; if (serviceLogic != null && context != null) status = serviceLogic.save("SQL", false, false, key, null, null, context); @@ -379,18 +379,18 @@ public class DBService { String key = ""; QueryStatus status = null; - if(context.getAttribute(AsdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE) != null && - context.getAttribute(AsdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE).length() > 0){ + if(context.getAttribute(SdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE) != null && + context.getAttribute(SdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE).length() > 0){ if(isUpdate) - key = "update " + AsdcArtifactHandlerConstants.DB_CONFIG_ACTION_DG + - " set DOWNLOAD_CONFIG_DG = $" + AsdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE + - " where ACTION = $" + AsdcArtifactHandlerConstants.ACTION + - " and VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE ; + key = "update " + SdcArtifactHandlerConstants.DB_CONFIG_ACTION_DG + + " set DOWNLOAD_CONFIG_DG = $" + SdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE + + " where ACTION = $" + SdcArtifactHandlerConstants.ACTION + + " and VNF_TYPE = $" + SdcArtifactHandlerConstants.VNF_TYPE ; else - key = "insert into " + AsdcArtifactHandlerConstants.DB_CONFIG_ACTION_DG+ - " set DOWNLOAD_CONFIG_DG = $" + AsdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE + - " , ACTION = $" + AsdcArtifactHandlerConstants.ACTION + - " , VNF_TYPE = $" + AsdcArtifactHandlerConstants.VNF_TYPE ; + key = "insert into " + SdcArtifactHandlerConstants.DB_CONFIG_ACTION_DG+ + " set DOWNLOAD_CONFIG_DG = $" + SdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE + + " , ACTION = $" + SdcArtifactHandlerConstants.ACTION + + " , VNF_TYPE = $" + SdcArtifactHandlerConstants.VNF_TYPE ; if (serviceLogic != null && context != null) status = serviceLogic.save("SQL", false, false, key, null, null, context); diff --git a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/node/ArtifactHandlerNode.java b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/node/ArtifactHandlerNode.java index e4cefad48..c6d1c1c36 100644 --- a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/node/ArtifactHandlerNode.java +++ b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/openecomp/appc/artifact/handler/node/ArtifactHandlerNode.java @@ -33,7 +33,7 @@ import org.json.JSONArray; import org.json.JSONObject; import org.openecomp.appc.artifact.handler.dbservices.DBService; import org.openecomp.appc.artifact.handler.utils.ArtifactHandlerProviderUtil; -import org.openecomp.appc.artifact.handler.utils.AsdcArtifactHandlerConstants; +import org.openecomp.appc.artifact.handler.utils.SdcArtifactHandlerConstants; import org.openecomp.appc.yang.YANGGenerator; import org.openecomp.appc.yang.impl.YANGGeneratorFactory; import org.openecomp.sdnc.config.params.transformer.tosca.ArtifactProcessorImpl; @@ -58,7 +58,7 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin { String postData = inParams.get("postData"); JSONObject input = new JSONObject(postData).getJSONObject("input"); responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : ""; - storeUpdateAsdcArtifacts(input); + storeUpdateSdcArtifacts(input); } } catch(Exception e){ @@ -67,26 +67,26 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin { } } - private boolean storeUpdateAsdcArtifacts(JSONObject postDataJson) throws Exception { - log.info("Starting processing of ASDC Artifacs into Handler with Data : " + postDataJson.toString()); + private boolean storeUpdateSdcArtifacts(JSONObject postDataJson) throws Exception { + log.info("Starting processing of SDC Artifacs into Handler with Data : " + postDataJson.toString()); try{ - JSONObject request_information = (JSONObject)postDataJson.get(AsdcArtifactHandlerConstants.REQUEST_INFORMATION); - JSONObject document_information =(JSONObject)postDataJson.get(AsdcArtifactHandlerConstants.DOCUMENT_PARAMETERS); - String artifact_name = document_information.getString(AsdcArtifactHandlerConstants.ARTIFACT_NAME); + JSONObject request_information = (JSONObject)postDataJson.get(SdcArtifactHandlerConstants.REQUEST_INFORMATION); + JSONObject document_information =(JSONObject)postDataJson.get(SdcArtifactHandlerConstants.DOCUMENT_PARAMETERS); + String artifact_name = document_information.getString(SdcArtifactHandlerConstants.ARTIFACT_NAME); if(artifact_name !=null){ updateStoreArtifacts(request_information, document_information ); - if(artifact_name.toLowerCase().startsWith(AsdcArtifactHandlerConstants.REFERENCE)) + if(artifact_name.toLowerCase().startsWith(SdcArtifactHandlerConstants.REFERENCE)) return storeReferenceData(request_information, document_information ); - else if (artifact_name.toLowerCase().startsWith(AsdcArtifactHandlerConstants.PD)) + else if (artifact_name.toLowerCase().startsWith(SdcArtifactHandlerConstants.PD)) return createDataForPD(request_information, document_information ); } else - throw new Exception("Missing Artifact Name for Request : " + request_information.getString(AsdcArtifactHandlerConstants.REQUETS_ID)); + throw new Exception("Missing Artifact Name for Request : " + request_information.getString(SdcArtifactHandlerConstants.REQUETS_ID)); } catch(Exception e){ e.printStackTrace(); - throw new Exception("Error while processing Request ID : " + ((JSONObject)postDataJson.get(AsdcArtifactHandlerConstants.REQUEST_INFORMATION)).getString(AsdcArtifactHandlerConstants.REQUETS_ID) + e.getMessage()); + throw new Exception("Error while processing Request ID : " + ((JSONObject)postDataJson.get(SdcArtifactHandlerConstants.REQUEST_INFORMATION)).getString(SdcArtifactHandlerConstants.REQUETS_ID) + e.getMessage()); } return false; @@ -94,11 +94,11 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin { private boolean createDataForPD(JSONObject request_information, JSONObject document_information) throws Exception { String fn = "ArtifactHandlerNode.createReferenceDataForPD"; - String artifact_name = document_information.getString(AsdcArtifactHandlerConstants.ARTIFACT_NAME); - log.info(fn + "Received PD File Name: " + artifact_name + " and suffix lenght " + AsdcArtifactHandlerConstants.PD.length()); + String artifact_name = document_information.getString(SdcArtifactHandlerConstants.ARTIFACT_NAME); + log.info(fn + "Received PD File Name: " + artifact_name + " and suffix lenght " + SdcArtifactHandlerConstants.PD.length()); try { - String suffix = artifact_name.substring(AsdcArtifactHandlerConstants.PD.length()); + String suffix = artifact_name.substring(SdcArtifactHandlerConstants.PD.length()); createArtifactRecords(request_information, document_information, suffix); } catch (Exception e) { e.printStackTrace(); @@ -109,10 +109,10 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin { private void createArtifactRecords(JSONObject request_information, JSONObject document_information, String suffix) throws Exception { - log.info("Creating Tosca Records and storing into ASDC Artifacs"); + log.info("Creating Tosca Records and storing into SDC Artifacs"); String [] docs = {"Tosca", "Yang"}; ArtifactHandlerProviderUtil ahpUtil = new ArtifactHandlerProviderUtil(); - String PDFileContents = document_information.getString(AsdcArtifactHandlerConstants.ARTIFACT_CONTENTS); + String PDFileContents = document_information.getString(SdcArtifactHandlerConstants.ARTIFACT_CONTENTS); //Tosca generation OutputStream toscaStream = new ByteArrayOutputStream(); @@ -130,13 +130,13 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin { String yangName = null; for(String doc : docs){ - document_information.put(AsdcArtifactHandlerConstants.ARTIFACT_TYPE, doc.concat("Type")); - document_information.put(AsdcArtifactHandlerConstants.ARTIFACT_DESRIPTION, doc.concat("Model")); + document_information.put(SdcArtifactHandlerConstants.ARTIFACT_TYPE, doc.concat("Type")); + document_information.put(SdcArtifactHandlerConstants.ARTIFACT_DESRIPTION, doc.concat("Model")); if(doc.equals("Tosca")) - document_information.put(AsdcArtifactHandlerConstants.ARTIFACT_CONTENTS, ahpUtil.escapeSql(toscaContents)); + document_information.put(SdcArtifactHandlerConstants.ARTIFACT_CONTENTS, ahpUtil.escapeSql(toscaContents)); else if (doc.equals("Yang")) - document_information.put(AsdcArtifactHandlerConstants.ARTIFACT_CONTENTS, ahpUtil.escapeSql(yangContents)); - document_information.put(AsdcArtifactHandlerConstants.ARTIFACT_NAME, doc.concat(suffix)); + document_information.put(SdcArtifactHandlerConstants.ARTIFACT_CONTENTS, ahpUtil.escapeSql(yangContents)); + document_information.put(SdcArtifactHandlerConstants.ARTIFACT_NAME, doc.concat(suffix)); yangName = doc.concat(suffix); updateStoreArtifacts(request_information, document_information); } @@ -167,40 +167,40 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin { } private boolean updateStoreArtifacts(JSONObject request_information, JSONObject document_information ) throws Exception { - log.info("UpdateStoreArtifactsStarted storing of ASDC Artifacs "); + log.info("UpdateStoreArtifactsStarted storing of SDC Artifacs "); SvcLogicContext context = new SvcLogicContext(); DBService dbservice = DBService.initialise(); ArtifactHandlerProviderUtil ahpUtil = new ArtifactHandlerProviderUtil(); int intversion = 0; - context.setAttribute("artifact_name",document_information.getString(AsdcArtifactHandlerConstants.ARTIFACT_NAME)); - String internal_version = dbservice.getInternalVersionNumber(context, document_information.getString(AsdcArtifactHandlerConstants.ARTIFACT_NAME), null); + context.setAttribute("artifact_name",document_information.getString(SdcArtifactHandlerConstants.ARTIFACT_NAME)); + String internal_version = dbservice.getInternalVersionNumber(context, document_information.getString(SdcArtifactHandlerConstants.ARTIFACT_NAME), null); log.info("Internal Version number received from Database : " + internal_version); if(internal_version != null){ intversion = Integer.parseInt(internal_version); intversion++ ; } - context.setAttribute(AsdcArtifactHandlerConstants.SERVICE_UUID, document_information.getString(AsdcArtifactHandlerConstants.SERVICE_UUID)); - context.setAttribute(AsdcArtifactHandlerConstants.DISTRIBUTION_ID, document_information.getString(AsdcArtifactHandlerConstants.DISTRIBUTION_ID)); - context.setAttribute(AsdcArtifactHandlerConstants.SERVICE_NAME, document_information.getString(AsdcArtifactHandlerConstants.SERVICE_NAME)); - context.setAttribute(AsdcArtifactHandlerConstants.SERVICE_DESCRIPTION, document_information.getString(AsdcArtifactHandlerConstants.SERVICE_DESCRIPTION)); - context.setAttribute(AsdcArtifactHandlerConstants.RESOURCE_UUID, document_information.getString(AsdcArtifactHandlerConstants.RESOURCE_UUID)); - context.setAttribute(AsdcArtifactHandlerConstants.RESOURCE_INSTANCE_NAME,document_information.getString(AsdcArtifactHandlerConstants.RESOURCE_INSTANCE_NAME)); - context.setAttribute(AsdcArtifactHandlerConstants.RESOURCE_VERSOIN, document_information.getString(AsdcArtifactHandlerConstants.RESOURCE_VERSOIN)); - context.setAttribute(AsdcArtifactHandlerConstants.RESOURCE_TYPE, document_information.getString(AsdcArtifactHandlerConstants.RESOURCE_TYPE)); - context.setAttribute(AsdcArtifactHandlerConstants.ARTIFACT_UUID, document_information.getString(AsdcArtifactHandlerConstants.ARTIFACT_UUID)); - context.setAttribute(AsdcArtifactHandlerConstants.ARTIFACT_TYPE,document_information.getString(AsdcArtifactHandlerConstants.ARTIFACT_TYPE)); - context.setAttribute(AsdcArtifactHandlerConstants.ARTIFACT_VERSOIN,document_information.getString(AsdcArtifactHandlerConstants.ARTIFACT_VERSOIN)); - context.setAttribute(AsdcArtifactHandlerConstants.ARTIFACT_DESRIPTION,document_information.getString(AsdcArtifactHandlerConstants.ARTIFACT_DESRIPTION)); - context.setAttribute(AsdcArtifactHandlerConstants.ARTIFACT_CONTENTS,ahpUtil.escapeSql(document_information.getString(AsdcArtifactHandlerConstants.ARTIFACT_CONTENTS))); - context.setAttribute(AsdcArtifactHandlerConstants.ARTIFACT_NAME,document_information.getString(AsdcArtifactHandlerConstants.ARTIFACT_NAME)); + context.setAttribute(SdcArtifactHandlerConstants.SERVICE_UUID, document_information.getString(SdcArtifactHandlerConstants.SERVICE_UUID)); + context.setAttribute(SdcArtifactHandlerConstants.DISTRIBUTION_ID, document_information.getString(SdcArtifactHandlerConstants.DISTRIBUTION_ID)); + context.setAttribute(SdcArtifactHandlerConstants.SERVICE_NAME, document_information.getString(SdcArtifactHandlerConstants.SERVICE_NAME)); + context.setAttribute(SdcArtifactHandlerConstants.SERVICE_DESCRIPTION, document_information.getString(SdcArtifactHandlerConstants.SERVICE_DESCRIPTION)); + context.setAttribute(SdcArtifactHandlerConstants.RESOURCE_UUID, document_information.getString(SdcArtifactHandlerConstants.RESOURCE_UUID)); + context.setAttribute(SdcArtifactHandlerConstants.RESOURCE_INSTANCE_NAME,document_information.getString(SdcArtifactHandlerConstants.RESOURCE_INSTANCE_NAME)); + context.setAttribute(SdcArtifactHandlerConstants.RESOURCE_VERSOIN, document_information.getString(SdcArtifactHandlerConstants.RESOURCE_VERSOIN)); + context.setAttribute(SdcArtifactHandlerConstants.RESOURCE_TYPE, document_information.getString(SdcArtifactHandlerConstants.RESOURCE_TYPE)); + context.setAttribute(SdcArtifactHandlerConstants.ARTIFACT_UUID, document_information.getString(SdcArtifactHandlerConstants.ARTIFACT_UUID)); + context.setAttribute(SdcArtifactHandlerConstants.ARTIFACT_TYPE,document_information.getString(SdcArtifactHandlerConstants.ARTIFACT_TYPE)); + context.setAttribute(SdcArtifactHandlerConstants.ARTIFACT_VERSOIN,document_information.getString(SdcArtifactHandlerConstants.ARTIFACT_VERSOIN)); + context.setAttribute(SdcArtifactHandlerConstants.ARTIFACT_DESRIPTION,document_information.getString(SdcArtifactHandlerConstants.ARTIFACT_DESRIPTION)); + context.setAttribute(SdcArtifactHandlerConstants.ARTIFACT_CONTENTS,ahpUtil.escapeSql(document_information.getString(SdcArtifactHandlerConstants.ARTIFACT_CONTENTS))); + context.setAttribute(SdcArtifactHandlerConstants.ARTIFACT_NAME,document_information.getString(SdcArtifactHandlerConstants.ARTIFACT_NAME)); dbservice.saveArtifacts(context, intversion); return true; } public boolean storeReferenceData(JSONObject request_information, JSONObject document_information) throws Exception { - log.info("Started storing of ASDC Artifacs into Handler" ); + log.info("Started storing of SDC Artifacs into Handler" ); try{ boolean updateRequired = false; boolean pdFile = false; @@ -208,9 +208,9 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin { String categorySuffix = null; DBService dbservice = DBService.initialise(); ArtifactHandlerProviderUtil ahpUtil = new ArtifactHandlerProviderUtil(); - String contentString = ahpUtil.escapeSql(document_information.getString(AsdcArtifactHandlerConstants.ARTIFACT_CONTENTS)) ; - String artifactName=ahpUtil.escapeSql(document_information.getString(AsdcArtifactHandlerConstants.ARTIFACT_NAME)); - String capabilityArtifactName=StringUtils.replace(artifactName,AsdcArtifactHandlerConstants.ARTIFACT_NAME_REFERENCE,AsdcArtifactHandlerConstants.ARTIFACT_NAME_CAPABILITY); + String contentString = ahpUtil.escapeSql(document_information.getString(SdcArtifactHandlerConstants.ARTIFACT_CONTENTS)) ; + String artifactName=ahpUtil.escapeSql(document_information.getString(SdcArtifactHandlerConstants.ARTIFACT_NAME)); + String capabilityArtifactName=StringUtils.replace(artifactName, SdcArtifactHandlerConstants.ARTIFACT_NAME_REFERENCE, SdcArtifactHandlerConstants.ARTIFACT_NAME_CAPABILITY); JSONObject capabilities = new JSONObject(); JSONArray vnfActionList = new JSONArray(); JSONArray vfModuleActionList = new JSONArray(); @@ -226,105 +226,105 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin { JSONObject scope = content.getJSONObject("scope"); log.info("scope :" + scope); SvcLogicContext context = new SvcLogicContext(); - vnfType=scope.getString(AsdcArtifactHandlerConstants.VNF_TYPE); - context.setAttribute(AsdcArtifactHandlerConstants.VNF_TYPE, scope.getString(AsdcArtifactHandlerConstants.VNF_TYPE)); - context.setAttribute(AsdcArtifactHandlerConstants.ACTION, content.getString(AsdcArtifactHandlerConstants.ACTION)); - String actionLevel=content.getString(AsdcArtifactHandlerConstants.ACTION_LEVEL); - context.setAttribute(AsdcArtifactHandlerConstants.ACTION_LEVEL, content.getString(AsdcArtifactHandlerConstants.ACTION_LEVEL)); - if ((null != actionLevel) && actionLevel.equalsIgnoreCase(AsdcArtifactHandlerConstants.ACTION_LEVEL_VNFC)) { - vnfcActionList.put(content.getString(AsdcArtifactHandlerConstants.ACTION)); + vnfType=scope.getString(SdcArtifactHandlerConstants.VNF_TYPE); + context.setAttribute(SdcArtifactHandlerConstants.VNF_TYPE, scope.getString(SdcArtifactHandlerConstants.VNF_TYPE)); + context.setAttribute(SdcArtifactHandlerConstants.ACTION, content.getString(SdcArtifactHandlerConstants.ACTION)); + String actionLevel=content.getString(SdcArtifactHandlerConstants.ACTION_LEVEL); + context.setAttribute(SdcArtifactHandlerConstants.ACTION_LEVEL, content.getString(SdcArtifactHandlerConstants.ACTION_LEVEL)); + if ((null != actionLevel) && actionLevel.equalsIgnoreCase(SdcArtifactHandlerConstants.ACTION_LEVEL_VNFC)) { + vnfcActionList.put(content.getString(SdcArtifactHandlerConstants.ACTION)); } - if (null != actionLevel && actionLevel.equalsIgnoreCase(AsdcArtifactHandlerConstants.ACTION_LEVEL_VF_MODULE)) { - vfModuleActionList.put(content.getString(AsdcArtifactHandlerConstants.ACTION)); + if (null != actionLevel && actionLevel.equalsIgnoreCase(SdcArtifactHandlerConstants.ACTION_LEVEL_VF_MODULE)) { + vfModuleActionList.put(content.getString(SdcArtifactHandlerConstants.ACTION)); } - if (null != actionLevel && actionLevel.equalsIgnoreCase(AsdcArtifactHandlerConstants.ACTION_LEVEL_VNF)) { - vnfActionList.put(content.getString(AsdcArtifactHandlerConstants.ACTION)); + if (null != actionLevel && actionLevel.equalsIgnoreCase(SdcArtifactHandlerConstants.ACTION_LEVEL_VNF)) { + vnfActionList.put(content.getString(SdcArtifactHandlerConstants.ACTION)); } - if (null != actionLevel && actionLevel.equalsIgnoreCase(AsdcArtifactHandlerConstants.ACTION_LEVEL_VM)) { - vmActionList.put(content.getString(AsdcArtifactHandlerConstants.ACTION)); + if (null != actionLevel && actionLevel.equalsIgnoreCase(SdcArtifactHandlerConstants.ACTION_LEVEL_VM)) { + vmActionList.put(content.getString(SdcArtifactHandlerConstants.ACTION)); } - if(scope.has(AsdcArtifactHandlerConstants.VNFC_TYPE) && !scope.isNull(AsdcArtifactHandlerConstants.VNFC_TYPE) ) - context.setAttribute(AsdcArtifactHandlerConstants.VNFC_TYPE, scope.getString(AsdcArtifactHandlerConstants.VNFC_TYPE)); + if(scope.has(SdcArtifactHandlerConstants.VNFC_TYPE) && !scope.isNull(SdcArtifactHandlerConstants.VNFC_TYPE) ) + context.setAttribute(SdcArtifactHandlerConstants.VNFC_TYPE, scope.getString(SdcArtifactHandlerConstants.VNFC_TYPE)); else - context.setAttribute(AsdcArtifactHandlerConstants.VNFC_TYPE,null); - if (content.has(AsdcArtifactHandlerConstants.DEVICE_PROTOCOL)) - context.setAttribute(AsdcArtifactHandlerConstants.DEVICE_PROTOCOL, content.getString(AsdcArtifactHandlerConstants.DEVICE_PROTOCOL)); - if (content.has(AsdcArtifactHandlerConstants.USER_NAME)) - context.setAttribute(AsdcArtifactHandlerConstants.USER_NAME, content.getString(AsdcArtifactHandlerConstants.USER_NAME)); - if (content.has(AsdcArtifactHandlerConstants.PORT_NUMBER)) - context.setAttribute(AsdcArtifactHandlerConstants.PORT_NUMBER, content.getString(AsdcArtifactHandlerConstants.PORT_NUMBER)); - context.setAttribute(AsdcArtifactHandlerConstants.ARTIFACT_TYPE, ""); + context.setAttribute(SdcArtifactHandlerConstants.VNFC_TYPE,null); + if (content.has(SdcArtifactHandlerConstants.DEVICE_PROTOCOL)) + context.setAttribute(SdcArtifactHandlerConstants.DEVICE_PROTOCOL, content.getString(SdcArtifactHandlerConstants.DEVICE_PROTOCOL)); + if (content.has(SdcArtifactHandlerConstants.USER_NAME)) + context.setAttribute(SdcArtifactHandlerConstants.USER_NAME, content.getString(SdcArtifactHandlerConstants.USER_NAME)); + if (content.has(SdcArtifactHandlerConstants.PORT_NUMBER)) + context.setAttribute(SdcArtifactHandlerConstants.PORT_NUMBER, content.getString(SdcArtifactHandlerConstants.PORT_NUMBER)); + context.setAttribute(SdcArtifactHandlerConstants.ARTIFACT_TYPE, ""); if(content.has("artifact-list") && content.get("artifact-list") instanceof JSONArray){ JSONArray artifactLists = (JSONArray)content.get("artifact-list"); for(int i=0;i 0){ - context.setAttribute(AsdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE, content.getString(AsdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE)); - dbservice.processDownloadDgReference(context, dbservice.isArtifactUpdateRequired(context,AsdcArtifactHandlerConstants.DB_DOWNLOAD_DG_REFERENCE)); + if (content.getString(SdcArtifactHandlerConstants.ACTION).equals("Configure")) { + if(content.has(SdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE) && content.getString(SdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE).length() > 0){ + context.setAttribute(SdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE, content.getString(SdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE)); + dbservice.processDownloadDgReference(context, dbservice.isArtifactUpdateRequired(context, SdcArtifactHandlerConstants.DB_DOWNLOAD_DG_REFERENCE)); } - dbservice.processConfigActionDg(context, dbservice.isArtifactUpdateRequired(context, AsdcArtifactHandlerConstants.DB_CONFIG_ACTION_DG)); - dbservice.processDeviceInterfaceProtocol(context, dbservice.isArtifactUpdateRequired(context, AsdcArtifactHandlerConstants.DB_DEVICE_INTERFACE_PROTOCOL)); - dbservice.processDeviceAuthentication(context, dbservice.isArtifactUpdateRequired(context, AsdcArtifactHandlerConstants.DB_DEVICE_AUTHENTICATION)); + dbservice.processConfigActionDg(context, dbservice.isArtifactUpdateRequired(context, SdcArtifactHandlerConstants.DB_CONFIG_ACTION_DG)); + dbservice.processDeviceInterfaceProtocol(context, dbservice.isArtifactUpdateRequired(context, SdcArtifactHandlerConstants.DB_DEVICE_INTERFACE_PROTOCOL)); + dbservice.processDeviceAuthentication(context, dbservice.isArtifactUpdateRequired(context, SdcArtifactHandlerConstants.DB_DEVICE_AUTHENTICATION)); } populateProtocolReference(dbservice, content); - context.setAttribute(AsdcArtifactHandlerConstants.VNFC_TYPE, null); + context.setAttribute(SdcArtifactHandlerConstants.VNFC_TYPE, null); - if( content.has(AsdcArtifactHandlerConstants.VM) && content.get(AsdcArtifactHandlerConstants.VM) instanceof JSONArray){ - JSONArray vmList = (JSONArray)content.get(AsdcArtifactHandlerConstants.VM); + if( content.has(SdcArtifactHandlerConstants.VM) && content.get(SdcArtifactHandlerConstants.VM) instanceof JSONArray){ + JSONArray vmList = (JSONArray)content.get(SdcArtifactHandlerConstants.VM); for(int i=0;i argList = new ArrayList<>(); - argList.add(String.valueOf(asdc_artifact_id)); - argList.add(String.valueOf(asdc_reference_id)); + argList.add(String.valueOf(sdc_artifact_id)); + argList.add(String.valueOf(sdc_reference_id)); argList.add(payloadObject.get(DesignServiceConstants.VNF_TYPE).textValue()); argList.add(payloadObject.get(DesignServiceConstants.ACTION).textValue()); argList.add(payloadObject.get(DesignServiceConstants.USER_ID).textValue()); @@ -233,7 +233,7 @@ public class DesignDBService { throw new Exception("Error while updating RealtionShip table"); } - private int getASDCReferenceID(String payload) throws Exception { + private int getSDCReferenceID(String payload) throws Exception { String vnfc_type = null; ObjectMapper objectMapper = new ObjectMapper(); @@ -259,12 +259,12 @@ public class DesignDBService { log.info("Query String :" + queryString); ResultSet data = dbservice.getDBData(queryString, argList); - int asdc_reference_id = 0; + int sdc_reference_id = 0; while(data.next()) { - asdc_reference_id = data.getInt("ASDC_REFERENCE_ID"); + sdc_reference_id = data.getInt("ASDC_REFERENCE_ID"); } - log.info("Got asdc_reference_id = " + asdc_reference_id ); - return asdc_reference_id; + log.info("Got sdc_reference_id = " + sdc_reference_id ); + return sdc_reference_id; } @@ -320,14 +320,14 @@ public class DesignDBService { return updateStatus; } - private void createArtifactTrackingRecord(String payload, String requestID, int asdc_artifact_id, int asdc_reference_id) throws Exception { + private void createArtifactTrackingRecord(String payload, String requestID, int sdc_artifact_id, int sdc_reference_id) throws Exception { String vnfc_type = null; ObjectMapper objectMapper = new ObjectMapper(); JsonNode payloadObject = objectMapper.readTree(payload); ArrayList argList = new ArrayList<>(); - argList.add(String.valueOf(asdc_artifact_id)); - argList.add(String.valueOf(asdc_reference_id)); + argList.add(String.valueOf(sdc_artifact_id)); + argList.add(String.valueOf(sdc_reference_id)); argList.add(payloadObject.get(DesignServiceConstants.USER_ID).textValue()); if (payloadObject.get(DesignServiceConstants.TECHNOLOGY) != null &&! payloadObject.get(DesignServiceConstants.TECHNOLOGY).textValue().isEmpty()) argList.add(payloadObject.get(DesignServiceConstants.TECHNOLOGY).textValue()); @@ -350,7 +350,7 @@ public class DesignDBService { } - private int getASDCArtifactIDbyRequestID(String requestID) throws Exception { + private int getSDCArtifactIDbyRequestID(String requestID) throws Exception { log.info("Starting getArtifactIDbyRequestID DB Operation"); int artifact_id = 0; try{ @@ -367,7 +367,7 @@ public class DesignDBService { e.printStackTrace(); throw e; } - log.info("Got ASDC_ARTIFACTS_ID As :" + artifact_id); + log.info("Got SDC_ARTIFACTS_ID As :" + artifact_id); return artifact_id; } @@ -567,8 +567,8 @@ public class DesignDBService { // localContext.setAttribute("userID", UserId); // if (serviceLogic != null && localContext != null) { // String queryString = "SELECT AR.VNF_TYPE, AR.VNFC_TYPE, DAT.PROTOCOL, DAT.IN_CART from " + - // DesignServiceConstants.DB_DT_ARTIFACT_TRACKING + " DAT , " + DesignServiceConstants.DB_ASDC_REFERENCE + - // " AR where DAT.ASDC_REFERENCE_ID= AR.ASDC_REFERENCE_ID and DAT.USER = $userID" ; + // DesignServiceConstants.DB_DT_ARTIFACT_TRACKING + " DAT , " + DesignServiceConstants.DB_SDC_REFERENCE + + // " AR where DAT.SDC_REFERENCE_ID= AR.SDC_REFERENCE_ID and DAT.USER = $userID" ; // // log.info(fn + "Query String : " + queryString); // try { @@ -607,7 +607,7 @@ public class DesignDBService { argList.add(UserID); String queryString = "SELECT AR.VNF_TYPE, AR.VNFC_TYPE, DAT.PROTOCOL, DAT.IN_CART, AR.ACTION, AR.ARTIFACT_NAME, AR.ARTIFACT_TYPE from " + - DesignServiceConstants.DB_DT_ARTIFACT_TRACKING + " DAT , " + DesignServiceConstants.DB_ASDC_REFERENCE + + DesignServiceConstants.DB_DT_ARTIFACT_TRACKING + " DAT , " + DesignServiceConstants.DB_SDC_REFERENCE + " AR where DAT.ASDC_REFERENCE_ID= AR.ASDC_REFERENCE_ID and DAT.USER = ? "; DesignResponse designResponse = new DesignResponse(); diff --git a/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/ArtifactHandlerClient.java b/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/ArtifactHandlerClient.java index 6254728ee..331c48e34 100644 --- a/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/ArtifactHandlerClient.java +++ b/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/ArtifactHandlerClient.java @@ -94,7 +94,7 @@ public class ArtifactHandlerClient { ObjectNode requestInfo = objectMapper.createObjectNode(); requestInfo.put(DesignServiceConstants.REQUETS_ID, requestID); - requestInfo.put(DesignServiceConstants.REQUEST_ACTION, "StoreAsdcDocumentRequest"); + requestInfo.put(DesignServiceConstants.REQUEST_ACTION, "StoreSdcDocumentRequest"); requestInfo.put(DesignServiceConstants.SOURCE, DesignServiceConstants.DESIGN_TOOL); String random = getRandom(); diff --git a/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/DesignServiceConstants.java b/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/DesignServiceConstants.java index 702d1d1fa..73e6ba93f 100644 --- a/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/DesignServiceConstants.java +++ b/appc-inbound/appc-design-services/provider/src/main/java/org/openecomp/appc/design/services/util/DesignServiceConstants.java @@ -83,7 +83,7 @@ public class DesignServiceConstants { public static final String DB_DT_ARTIFACT_TRACKING = "DT_ARTIFACT_TRACKING"; - public static final String DB_ASDC_REFERENCE = "ASDC_REFERENCE"; + public static final String DB_SDC_REFERENCE = "ASDC_REFERENCE"; public static final String SCHEMA_SDNCTL = "SDNCTL"; public static final String GETARTIFACT = "getArtifact"; public static final String USER_ID = "userID"; diff --git a/appc-inbound/appc-design-services/provider/src/test/java/org/openecomp/appc/design/validator/TestDBService.java b/appc-inbound/appc-design-services/provider/src/test/java/org/openecomp/appc/design/validator/TestDBService.java index d14abceb6..d1a899d14 100644 --- a/appc-inbound/appc-design-services/provider/src/test/java/org/openecomp/appc/design/validator/TestDBService.java +++ b/appc-inbound/appc-design-services/provider/src/test/java/org/openecomp/appc/design/validator/TestDBService.java @@ -175,13 +175,13 @@ public class TestDBService { } @Test - public void testGetASDCReferenceID() { + public void testGetSDCReferenceID() { try { String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact")); String payload = " { \"userID\": \"0000\",\"status\":\"Test\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-status\":\"\",\"artifact-contents\": "+ content + " } "; DesignDBService design = DesignDBService.initialise(); - Whitebox.invokeMethod(design, "getASDCReferenceID", payload); + Whitebox.invokeMethod(design, "getSDCReferenceID", payload); } catch (Exception e) { } } @@ -209,12 +209,12 @@ public class TestDBService { } @Test - public void testGetASDCArtifactIDbyRequestID() { + public void testGetSDCArtifactIDbyRequestID() { try { String content = FileUtils.readFileToString(new File("src/test/resources/uploadArtifact")); String payload = " { \"userID\": \"0000\",\"status\":\"Test\", \"vnf-type\" : \"DesigTest-VNF\", \"action\" : \"Configure\", \"artifact-name\":\"DesignRestArtifact_reference\",\"artifact-version\" :\"0.01\",\"artifact-type\" :\"DESIGNTOOL-TEST\",\"artifact-status\":\"\",\"artifact-contents\": "+ content + " } "; DesignDBService design = DesignDBService.initialise(); - Whitebox.invokeMethod(design, "getASDCArtifactIDbyRequestID", "0"); + Whitebox.invokeMethod(design, "getSDCArtifactIDbyRequestID", "0"); } catch (Exception e) { } } diff --git a/appc-oam/appc-oam-model/src/main/yang/appc-oam.yang b/appc-oam/appc-oam-model/src/main/yang/appc-oam.yang index 03675c8f2..0984daeda 100644 --- a/appc-oam/appc-oam-model/src/main/yang/appc-oam.yang +++ b/appc-oam/appc-oam-model/src/main/yang/appc-oam.yang @@ -92,14 +92,14 @@ module appc-oam { } grouping status { - description "The specific response codes are to be aligned with ASDC reference + description "The specific response codes are to be aligned with SDC reference doc (main table removed to avoid duplication and digression from - main table). See ASDC and ECOMP Distribution Consumer Interface + main table). See SDC and ECOMP Distribution Consumer Interface Agreement"; container status { - description "The specific response codes are to be aligned with ASDC reference + description "The specific response codes are to be aligned with SDC reference doc (main table removed to avoid duplication and digression from - main table). See ASDC and ECOMP Distribution Consumer Interface + main table). See SDC and ECOMP Distribution Consumer Interface Agreement"; leaf code { description "Response code"; diff --git a/appc-provider/appc-provider-model/src/main/yang/appc-provider-lcm.yang b/appc-provider/appc-provider-model/src/main/yang/appc-provider-lcm.yang index d46ba8cb4..a53684f68 100644 --- a/appc-provider/appc-provider-model/src/main/yang/appc-provider-lcm.yang +++ b/appc-provider/appc-provider-model/src/main/yang/appc-provider-lcm.yang @@ -295,9 +295,9 @@ module appc-provider-lcm { grouping status { - description "The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement"; + description "The specific response codes are to be aligned with SDC reference doc (main table removed to avoid duplication and digression from main table). See SDC and ECOMP Distribution Consumer Interface Agreement"; container status { - description "The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement"; + description "The specific response codes are to be aligned with SDC reference doc (main table removed to avoid duplication and digression from main table). See SDC and ECOMP Distribution Consumer Interface Agreement"; leaf code { description "Response code"; type uint16; diff --git a/appc-provider/appc-provider-model/src/main/yang/appc-provider.yang b/appc-provider/appc-provider-model/src/main/yang/appc-provider.yang index 70f202de0..b62fabdf9 100644 --- a/appc-provider/appc-provider-model/src/main/yang/appc-provider.yang +++ b/appc-provider/appc-provider-model/src/main/yang/appc-provider.yang @@ -353,9 +353,9 @@ module appc-provider { } grouping status { - description "The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement"; + description "The specific response codes are to be aligned with SDC reference doc (main table removed to avoid duplication and digression from main table). See SDC and ECOMP Distribution Consumer Interface Agreement"; container status { - description "The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement"; + description "The specific response codes are to be aligned with SDC reference doc (main table removed to avoid duplication and digression from main table). See SDC and ECOMP Distribution Consumer Interface Agreement"; leaf code { description "Response code"; type uint16; @@ -504,7 +504,7 @@ module appc-provider { grouping ResponseAttributes { description "The response contains the status of executed functionality"; container Status { - description "The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement"; + description "The specific response codes are to be aligned with SDC reference doc (main table removed to avoid duplication and digression from main table). See SDC and ECOMP Distribution Consumer Interface Agreement"; leaf Code { description "Response code value"; type uint32; diff --git a/appc-asdc-listener/.gitignore b/appc-sdc-listener/.gitignore similarity index 100% rename from appc-asdc-listener/.gitignore rename to appc-sdc-listener/.gitignore diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/.gitignore b/appc-sdc-listener/appc-sdc-listener-bundle/.gitignore similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/.gitignore rename to appc-sdc-listener/appc-sdc-listener-bundle/.gitignore diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/.settings/org.eclipse.wst.common.project.facet.core.xml b/appc-sdc-listener/appc-sdc-listener-bundle/.settings/org.eclipse.wst.common.project.facet.core.xml similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/.settings/org.eclipse.wst.common.project.facet.core.xml rename to appc-sdc-listener/appc-sdc-listener-bundle/.settings/org.eclipse.wst.common.project.facet.core.xml diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/etc/asdc-client.jks b/appc-sdc-listener/appc-sdc-listener-bundle/etc/asdc-client.jks similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/etc/asdc-client.jks rename to appc-sdc-listener/appc-sdc-listener-bundle/etc/asdc-client.jks diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/etc/asdcclientstore.jks b/appc-sdc-listener/appc-sdc-listener-bundle/etc/asdcclientstore.jks similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/etc/asdcclientstore.jks rename to appc-sdc-listener/appc-sdc-listener-bundle/etc/asdcclientstore.jks diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/log4j.properties b/appc-sdc-listener/appc-sdc-listener-bundle/log4j.properties similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/log4j.properties rename to appc-sdc-listener/appc-sdc-listener-bundle/log4j.properties diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/pom.xml b/appc-sdc-listener/appc-sdc-listener-bundle/pom.xml similarity index 83% rename from appc-asdc-listener/appc-asdc-listener-bundle/pom.xml rename to appc-sdc-listener/appc-sdc-listener-bundle/pom.xml index 316cfdda0..22040cb55 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/pom.xml +++ b/appc-sdc-listener/appc-sdc-listener-bundle/pom.xml @@ -1,9 +1,32 @@ + 4.0.0 - appc-asdc-listener + appc-sdc-listener org.openecomp.appc 1.1.0-SNAPSHOT @@ -13,7 +36,7 @@ 1.15 - appc-asdc-listener-bundle + appc-sdc-listener-bundle bundle @@ -220,7 +243,7 @@ org.openecomp.appc.sdc.listener - + org.openecomp.appc.sdc.listener org.openecomp.appc.licmgr, diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/ArtifactProcessor.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/ArtifactProcessor.java similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/ArtifactProcessor.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/ArtifactProcessor.java diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/ArtifactStorageService.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/ArtifactStorageService.java similarity index 67% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/ArtifactStorageService.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/ArtifactStorageService.java index 160ed03d0..7f461c043 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/ArtifactStorageService.java +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/ArtifactStorageService.java @@ -51,62 +51,62 @@ public class ArtifactStorageService { private static final String SCHEMA = "sdnctl"; - private static final String SELECT_QUERY = Constants.SELECT_FROM + Constants.ASDC_ARTIFACTS + - Constants.WHERE + Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_NAME + Constants.QUERY_PLACEHOLDER + - AND + Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_VERSION + Constants.QUERY_PLACEHOLDER + + private static final String SELECT_QUERY = Constants.SELECT_FROM + Constants.SDC_ARTIFACTS + + Constants.WHERE + Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_NAME + Constants.QUERY_PLACEHOLDER + + AND + Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_VERSION + Constants.QUERY_PLACEHOLDER + AND + Constants.ARTIFACT_TYPE + Constants.QUERY_PLACEHOLDER; - private static final String SELECT_QUERY_SDC_REFERENCE = Constants.SELECT_FROM + Constants.ASDC_REFERENCE + - Constants.WHERE + Constants.ASDC_REFERENCE_FIELDS.VNF_TYPE + Constants.QUERY_PLACEHOLDER + - AND + Constants.ASDC_REFERENCE_FIELDS.FILE_CATEGORY + Constants.QUERY_PLACEHOLDER ; + private static final String SELECT_QUERY_SDC_REFERENCE = Constants.SELECT_FROM + Constants.SDC_REFERENCE + + Constants.WHERE + Constants.SDC_REFERENCE_FIELDS.VNF_TYPE + Constants.QUERY_PLACEHOLDER + + AND + Constants.SDC_REFERENCE_FIELDS.FILE_CATEGORY + Constants.QUERY_PLACEHOLDER ; - private static final String INSERT_QUERY = Constants.INSERT + Constants.ASDC_ARTIFACTS + - " ( " + Constants.ASDC_ARTIFACTS_FIELDS.SERVICE_UUID + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.DISTRIBUTION_ID + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.SERVICE_NAME + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.SERVICE_DESCRIPTION + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_UUID + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_INSTANCE_NAME + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_NAME + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_VERSION + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_TYPE + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.ARTIFACT_UUID + COMMA + + private static final String INSERT_QUERY = Constants.INSERT + Constants.SDC_ARTIFACTS + + " ( " + Constants.SDC_ARTIFACTS_FIELDS.SERVICE_UUID + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.DISTRIBUTION_ID + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.SERVICE_NAME + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.SERVICE_DESCRIPTION + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_UUID + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_INSTANCE_NAME + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_NAME + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_VERSION + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_TYPE + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.ARTIFACT_UUID + COMMA + Constants.ARTIFACT_TYPE + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.ARTIFACT_VERSION + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.ARTIFACT_DESCRIPTION + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.CREATION_DATE + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.ARTIFACT_VERSION + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.ARTIFACT_DESCRIPTION + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.CREATION_DATE + COMMA + Constants.ARTIFACT_NAME +COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.ARTIFACT_CONTENT + " ) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + Constants.SDC_ARTIFACTS_FIELDS.ARTIFACT_CONTENT + " ) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; - private static final String INSERT_QUERY_WITH_INT_VER = Constants.INSERT + Constants.ASDC_ARTIFACTS + - " ( " + Constants.ASDC_ARTIFACTS_FIELDS.SERVICE_UUID + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.DISTRIBUTION_ID + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.SERVICE_NAME + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.SERVICE_DESCRIPTION + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_UUID + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_INSTANCE_NAME + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_NAME + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_VERSION + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_TYPE + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.ARTIFACT_UUID + COMMA + + private static final String INSERT_QUERY_WITH_INT_VER = Constants.INSERT + Constants.SDC_ARTIFACTS + + " ( " + Constants.SDC_ARTIFACTS_FIELDS.SERVICE_UUID + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.DISTRIBUTION_ID + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.SERVICE_NAME + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.SERVICE_DESCRIPTION + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_UUID + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_INSTANCE_NAME + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_NAME + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_VERSION + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_TYPE + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.ARTIFACT_UUID + COMMA + Constants.ARTIFACT_TYPE + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.ARTIFACT_VERSION + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.ARTIFACT_DESCRIPTION + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.CREATION_DATE + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.ARTIFACT_VERSION + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.ARTIFACT_DESCRIPTION + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.CREATION_DATE + COMMA + Constants.ARTIFACT_NAME + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.ARTIFACT_CONTENT + COMMA + - Constants.ASDC_ARTIFACTS_FIELDS.INTERNAL_VERSION + " ) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + Constants.SDC_ARTIFACTS_FIELDS.ARTIFACT_CONTENT + COMMA + + Constants.SDC_ARTIFACTS_FIELDS.INTERNAL_VERSION + " ) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; - private static final String ASDC_REF_INSERT_QUERY = Constants.INSERT + Constants.ASDC_REFERENCE + - "( "+ Constants.ASDC_REFERENCE_FIELDS.VNF_TYPE + COMMA + - Constants.ASDC_REFERENCE_FIELDS.VNFC_TYPE+ COMMA + - Constants.ASDC_REFERENCE_FIELDS.FILE_CATEGORY +COMMA + - Constants.ASDC_REFERENCE_FIELDS.ACTION +COMMA + + private static final String SDC_REF_INSERT_QUERY = Constants.INSERT + Constants.SDC_REFERENCE + + "( "+ Constants.SDC_REFERENCE_FIELDS.VNF_TYPE + COMMA + + Constants.SDC_REFERENCE_FIELDS.VNFC_TYPE+ COMMA + + Constants.SDC_REFERENCE_FIELDS.FILE_CATEGORY +COMMA + + Constants.SDC_REFERENCE_FIELDS.ACTION +COMMA + Constants.ARTIFACT_TYPE + COMMA + Constants.ARTIFACT_NAME + " ) values (?,?,?,?,?,?)"; - private static final String SELECT_MAX_INT_VERSION = "SELECT coalesce(max(" + Constants.ASDC_ARTIFACTS_FIELDS.INTERNAL_VERSION + ")+1,1) as " + Constants.ASDC_ARTIFACTS_FIELDS.INTERNAL_VERSION + - " FROM " + Constants.ASDC_ARTIFACTS + Constants.WHERE + Constants.ARTIFACT_NAME + Constants.QUERY_PLACEHOLDER; + private static final String SELECT_MAX_INT_VERSION = "SELECT coalesce(max(" + Constants.SDC_ARTIFACTS_FIELDS.INTERNAL_VERSION + ")+1,1) as " + Constants.SDC_ARTIFACTS_FIELDS.INTERNAL_VERSION + + " FROM " + Constants.SDC_ARTIFACTS + Constants.WHERE + Constants.ARTIFACT_NAME + Constants.QUERY_PLACEHOLDER; private final EELFLogger logger = EELFManager.getInstance().getLogger(ArtifactStorageService.class); @@ -116,9 +116,9 @@ public class ArtifactStorageService { * @param artifact - SDC Artifact object * @throws APPCException */ - public void storeASDCArtifact(SDCArtifact artifact) throws APPCException { + public void storeSDCArtifact(SDCArtifact artifact) throws APPCException { if(logger.isDebugEnabled()){ - logger.debug("Entering storeASDCArtifact with : " + artifact.toString()); + logger.debug("Entering storeSDCArtifact with : " + artifact.toString()); } try { initializeDBLibService(); @@ -129,7 +129,7 @@ public class ArtifactStorageService { throw new APPCException(e.getMessage(),e); } if(logger.isDebugEnabled()){ - logger.debug("Exiting storeASDCArtifact"); + logger.debug("Exiting storeSDCArtifact"); } } @@ -139,9 +139,9 @@ public class ArtifactStorageService { * @param reference - SDC reference object * @throws APPCException */ - public void storeASDCArtifactWithReference(SDCArtifact artifact , SDCReference reference) throws APPCException { + public void storeSDCArtifactWithReference(SDCArtifact artifact , SDCReference reference) throws APPCException { if(logger.isDebugEnabled()){ - logger.debug("Entering storeASDCArtifactWithReference with : " + artifact.toString()); + logger.debug("Entering storeSDCArtifactWithReference with : " + artifact.toString()); } try { initializeDBLibService(); @@ -162,7 +162,7 @@ public class ArtifactStorageService { if(existingReference == null){ logger.debug("Inserting SDC Reference data: " +reference.toString()); ArrayList arguments = prepareReferenceArguments(reference); - dbLibService.writeData(ASDC_REF_INSERT_QUERY,arguments,SCHEMA); + dbLibService.writeData(SDC_REF_INSERT_QUERY,arguments,SCHEMA); }else{ logger.debug("Artifact reference already exists for: " +reference.toString()); } @@ -171,7 +171,7 @@ public class ArtifactStorageService { throw new APPCException(e.getMessage(),e); } if(logger.isDebugEnabled()){ - logger.debug("Exiting storeASDCArtifactWithReference"); + logger.debug("Exiting storeSDCArtifactWithReference"); } } @@ -186,7 +186,7 @@ public class ArtifactStorageService { arguments.add(artifactName); CachedRowSet rowSet = dbLibService.getData(SELECT_MAX_INT_VERSION, arguments, SCHEMA); if (rowSet.first()) { - version = rowSet.getInt(Constants.ASDC_ARTIFACTS_FIELDS.INTERNAL_VERSION .toString()); + version = rowSet.getInt(Constants.SDC_ARTIFACTS_FIELDS.INTERNAL_VERSION .toString()); } }catch (SQLException e) { logger.error("Error getting internal version for artifact name " + artifactName , e); @@ -248,10 +248,10 @@ public class ArtifactStorageService { /** * Reads the SDC artifact from APP-C database - * @param resourceName - resource Name from ASDC Artifact - * @param resourceVersion - resource version from ASDC Artifact - * @param artifactType artifact type from ASDC Artifact - * @return - ASDC_ARTIFACT record if data exists + * @param resourceName - resource Name from SDC Artifact + * @param resourceVersion - resource version from SDC Artifact + * @param artifactType artifact type from SDC Artifact + * @return - SDC_ARTIFACT record if data exists * @throws APPCException */ public SDCArtifact retrieveSDCArtifact(String resourceName, String resourceVersion, String artifactType) throws APPCException { @@ -265,30 +265,30 @@ public class ArtifactStorageService { CachedRowSet rowSet = dbLibService.getData(SELECT_QUERY, arguments, SCHEMA); if (rowSet.first()) { artifact = new SDCArtifact(); - artifact.setArtifactUUID(rowSet.getString(Constants.ASDC_ARTIFACTS_FIELDS.ARTIFACT_UUID.toString())); + artifact.setArtifactUUID(rowSet.getString(Constants.SDC_ARTIFACTS_FIELDS.ARTIFACT_UUID.toString())); artifact.setArtifactName(rowSet.getString(Constants.ARTIFACT_NAME)); artifact.setArtifactType(rowSet.getString(Constants.ARTIFACT_TYPE)); - artifact.setArtifactVersion(rowSet.getString(Constants.ASDC_ARTIFACTS_FIELDS.ARTIFACT_VERSION.toString())); - artifact.setArtifactDescription(rowSet.getString(Constants.ASDC_ARTIFACTS_FIELDS.ARTIFACT_DESCRIPTION.toString())); - artifact.setArtifactContent(rowSet.getString(Constants.ASDC_ARTIFACTS_FIELDS.ARTIFACT_CONTENT.toString())); + artifact.setArtifactVersion(rowSet.getString(Constants.SDC_ARTIFACTS_FIELDS.ARTIFACT_VERSION.toString())); + artifact.setArtifactDescription(rowSet.getString(Constants.SDC_ARTIFACTS_FIELDS.ARTIFACT_DESCRIPTION.toString())); + artifact.setArtifactContent(rowSet.getString(Constants.SDC_ARTIFACTS_FIELDS.ARTIFACT_CONTENT.toString())); - artifact.setResourceUUID(rowSet.getString(Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_UUID.toString())); - artifact.setResourceName(rowSet.getString(Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_NAME.toString())); - artifact.setResourceType(rowSet.getString(Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_TYPE.toString())); - artifact.setResourceVersion(rowSet.getString(Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_VERSION.toString())); - artifact.setResourceInstanceName(rowSet.getString(Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_INSTANCE_NAME.toString())); + artifact.setResourceUUID(rowSet.getString(Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_UUID.toString())); + artifact.setResourceName(rowSet.getString(Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_NAME.toString())); + artifact.setResourceType(rowSet.getString(Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_TYPE.toString())); + artifact.setResourceVersion(rowSet.getString(Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_VERSION.toString())); + artifact.setResourceInstanceName(rowSet.getString(Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_INSTANCE_NAME.toString())); - artifact.setServiceUUID(rowSet.getString(Constants.ASDC_ARTIFACTS_FIELDS.SERVICE_UUID.toString())); - artifact.setServiceName(rowSet.getString(Constants.ASDC_ARTIFACTS_FIELDS.SERVICE_NAME.toString())); - artifact.setServiceDescription(rowSet.getString(Constants.ASDC_ARTIFACTS_FIELDS.SERVICE_DESCRIPTION.toString())); + artifact.setServiceUUID(rowSet.getString(Constants.SDC_ARTIFACTS_FIELDS.SERVICE_UUID.toString())); + artifact.setServiceName(rowSet.getString(Constants.SDC_ARTIFACTS_FIELDS.SERVICE_NAME.toString())); + artifact.setServiceDescription(rowSet.getString(Constants.SDC_ARTIFACTS_FIELDS.SERVICE_DESCRIPTION.toString())); - artifact.setCreationDate(rowSet.getString(Constants.ASDC_ARTIFACTS_FIELDS.CREATION_DATE.toString())); - artifact.setDistributionId(rowSet.getString(Constants.ASDC_ARTIFACTS_FIELDS.DISTRIBUTION_ID.toString())); + artifact.setCreationDate(rowSet.getString(Constants.SDC_ARTIFACTS_FIELDS.CREATION_DATE.toString())); + artifact.setDistributionId(rowSet.getString(Constants.SDC_ARTIFACTS_FIELDS.DISTRIBUTION_ID.toString())); } } catch (SQLException e) { - logger.error("Error query artifact for " + Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_NAME + " = " + resourceName + - Constants.ASDC_ARTIFACTS_FIELDS.RESOURCE_VERSION + " = " + resourceVersion + + logger.error("Error query artifact for " + Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_NAME + " = " + resourceName + + Constants.SDC_ARTIFACTS_FIELDS.RESOURCE_VERSION + " = " + resourceVersion + Constants.ARTIFACT_TYPE + " = " + artifactType, e); throw new APPCException(e); } @@ -297,9 +297,9 @@ public class ArtifactStorageService { /** * Reads the SDC reference from APP-C database - * @param vnfType - vnf Type from ASDC reference - * @param fileCategory - file category from ASDC reference - * @return - ASDC_ARTIFACT record if data exists + * @param vnfType - vnf Type from SDC reference + * @param fileCategory - file category from SDC reference + * @return - SDC_ARTIFACT record if data exists * @throws APPCException */ public SDCReference retrieveSDCReference(String vnfType, String fileCategory) throws APPCException { @@ -312,16 +312,16 @@ public class ArtifactStorageService { CachedRowSet rowSet = dbLibService.getData(SELECT_QUERY_SDC_REFERENCE, arguments, SCHEMA); if (rowSet.first()) { reference = new SDCReference(); - reference.setVnfType(rowSet.getString(Constants.ASDC_REFERENCE_FIELDS.VNF_TYPE.toString())); - reference.setVnfcType(rowSet.getString(Constants.ASDC_REFERENCE_FIELDS.VNFC_TYPE.toString())); - reference.setFileCategory(rowSet.getString(Constants.ASDC_REFERENCE_FIELDS.FILE_CATEGORY.toString())); - reference.setAction(rowSet.getString(Constants.ASDC_REFERENCE_FIELDS.ACTION.toString())); + reference.setVnfType(rowSet.getString(Constants.SDC_REFERENCE_FIELDS.VNF_TYPE.toString())); + reference.setVnfcType(rowSet.getString(Constants.SDC_REFERENCE_FIELDS.VNFC_TYPE.toString())); + reference.setFileCategory(rowSet.getString(Constants.SDC_REFERENCE_FIELDS.FILE_CATEGORY.toString())); + reference.setAction(rowSet.getString(Constants.SDC_REFERENCE_FIELDS.ACTION.toString())); reference.setArtifactType(rowSet.getString(Constants.ARTIFACT_TYPE)); reference.setArtifactName(rowSet.getString(Constants.ARTIFACT_NAME)); } } catch (SQLException e) { - logger.error("Error querying ASDC_REFERENCE for " + Constants.ASDC_REFERENCE_FIELDS.VNF_TYPE + " = " + vnfType + - Constants.ASDC_REFERENCE_FIELDS.FILE_CATEGORY + " = " + fileCategory , e); + logger.error("Error querying SDC_REFERENCE for " + Constants.SDC_REFERENCE_FIELDS.VNF_TYPE + " = " + vnfType + + Constants.SDC_REFERENCE_FIELDS.FILE_CATEGORY + " = " + fileCategory , e); throw new APPCException(e); } return reference; diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/Constants.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/Constants.java similarity index 88% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/Constants.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/Constants.java index 67f8025d2..4970a739e 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/Constants.java +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/Constants.java @@ -25,11 +25,11 @@ package org.openecomp.appc.sdc.artifacts.helper; /** - * Constants required in ASDC listener module + * Constants required in SDC listener module */ public class Constants { - static final String ASDC_ARTIFACTS = "ASDC_ARTIFACTS"; - static final String ASDC_REFERENCE = "ASDC_REFERENCE"; + static final String SDC_ARTIFACTS = "ASDC_ARTIFACTS"; + static final String SDC_REFERENCE = "ASDC_REFERENCE"; static final String AND = " AND "; @@ -38,7 +38,7 @@ public class Constants { static final String VF_LICENSE = "VF_LICENSE"; - public enum ASDC_ARTIFACTS_FIELDS { + public enum SDC_ARTIFACTS_FIELDS { SERVICE_UUID, DISTRIBUTION_ID, SERVICE_NAME, @@ -56,8 +56,8 @@ public class Constants { ARTIFACT_CONTENT } - public enum ASDC_REFERENCE_FIELDS{ - ASDC_REFERENCE_ID, + public enum SDC_REFERENCE_FIELDS{ + SDC_REFERENCE_ID, VNF_TYPE, VNFC_TYPE, FILE_CATEGORY, diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/DependencyModelGenerator.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/DependencyModelGenerator.java similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/DependencyModelGenerator.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/helper/DependencyModelGenerator.java diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/AbstractArtifactProcessor.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/AbstractArtifactProcessor.java similarity index 98% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/AbstractArtifactProcessor.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/AbstractArtifactProcessor.java index 12fd260d0..06bda8b2d 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/AbstractArtifactProcessor.java +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/AbstractArtifactProcessor.java @@ -183,7 +183,7 @@ public abstract class AbstractArtifactProcessor implements ArtifactProcessor { if (null == eventSender){ return; } - String errorDescription = String.format("ASDC distribution of service '%s', version '%s' is failed with reason: '%s'", + String errorDescription = String.format("SDC distribution of service '%s', version '%s' is failed with reason: '%s'", serviceName, serviceVersion, errorMessage); EventMessage eventMessage = new EventMessage( diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ArtifactProcessorFactory.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ArtifactProcessorFactory.java similarity index 98% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ArtifactProcessorFactory.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ArtifactProcessorFactory.java index aa9d0e04b..3ad88b4b9 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ArtifactProcessorFactory.java +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ArtifactProcessorFactory.java @@ -29,7 +29,6 @@ import com.att.eelf.configuration.EELFManager; import org.openecomp.appc.adapter.message.EventSender; import org.openecomp.appc.sdc.artifacts.ArtifactProcessor; import org.openecomp.appc.sdc.artifacts.object.ArtifactType; -import org.openecomp.appc.sdc.listener.AsdcListener; import org.openecomp.sdc.api.IDistributionClient; import org.openecomp.sdc.api.notification.IArtifactInfo; import org.openecomp.sdc.api.notification.INotificationData; diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ConfigArtifactProcessor.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ConfigArtifactProcessor.java similarity index 96% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ConfigArtifactProcessor.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ConfigArtifactProcessor.java index 3667b6b2a..3baca3574 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ConfigArtifactProcessor.java +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ConfigArtifactProcessor.java @@ -62,7 +62,7 @@ public class ConfigArtifactProcessor extends AbstractArtifactProcessor { @Override public void processArtifact(SDCArtifact artifact) throws APPCException { - String postData = Util.toAsdcStoreDocumentInput(notification, resource, super.artifact, artifact.getArtifactContent()); + String postData = Util.toSdcStoreDocumentInput(notification, resource, super.artifact, artifact.getArtifactContent()); try { ProviderResponse result = ProviderOperations.post(storeUri.toURL(), postData, null); if (result.getStatus() == 200) { diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/LicenseArtifactProcessor.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/LicenseArtifactProcessor.java similarity index 95% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/LicenseArtifactProcessor.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/LicenseArtifactProcessor.java index 9cbc56276..21b32dc8e 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/LicenseArtifactProcessor.java +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/LicenseArtifactProcessor.java @@ -68,7 +68,7 @@ public class LicenseArtifactProcessor extends AbstractArtifactProcessor { if (StringUtils.isEmpty(vnfType) || StringUtils.isEmpty(version) || StringUtils.isEmpty(packageArtifactID)) { - String errStr = String.format("Missing information in ASDC request. Details: resource_type='%s', resource_version='%s', artifactID='%s'", vnfType, version, packageArtifactID); + String errStr = String.format("Missing information in SDC request. Details: resource_type='%s', resource_version='%s', artifactID='%s'", vnfType, version, packageArtifactID); logger.error(errStr); throw new APPCException(errStr); } @@ -78,7 +78,7 @@ public class LicenseArtifactProcessor extends AbstractArtifactProcessor { if (existingArtifact ==null) { // new resource logger.debug("Artifact not found from database for vnfType = " + vnfType + " , version = " + version + " , artifactType = " + artifact.getArtifactType()); - artifactStorageService.storeASDCArtifact(artifact); + artifactStorageService.storeSDCArtifact(artifact); } else { // duplicate logger.debug("Artifact retrieved from database = " + existingArtifact); logger.warn(String.format("Artifact of type '%s' already deployed for resource_type='%s' and resource_version='%s'", Constants.VF_LICENSE, vnfType, version)); diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ToscaCsarArtifactProcessor.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ToscaCsarArtifactProcessor.java similarity index 97% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ToscaCsarArtifactProcessor.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ToscaCsarArtifactProcessor.java index 085902187..ff3ee5509 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ToscaCsarArtifactProcessor.java +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/impl/ToscaCsarArtifactProcessor.java @@ -198,16 +198,16 @@ public class ToscaCsarArtifactProcessor extends AbstractArtifactProcessor{ reference.setVnfType(vnfType); reference.setFileCategory("tosca_model"); reference.setArtifactName(artifact.getArtifactName()); - logger.debug("Storing TOSCA to ASDC Artifact"); - artifactStorageService.storeASDCArtifactWithReference(artifact,reference); + logger.debug("Storing TOSCA to SDC Artifact"); + artifactStorageService.storeSDCArtifactWithReference(artifact,reference); SDCArtifact dependencyArtifact = getDependencyArtifact(artifact); SDCReference dependencyReference = new SDCReference(); dependencyReference.setVnfType(vnfType); dependencyReference.setFileCategory("tosca_dependency_model"); dependencyReference.setArtifactName(dependencyArtifact.getArtifactName()); - logger.debug("Storing Dependency to ASDC Artifact"); - artifactStorageService.storeASDCArtifactWithReference(dependencyArtifact,dependencyReference); + logger.debug("Storing Dependency to SDC Artifact"); + artifactStorageService.storeSDCArtifactWithReference(dependencyArtifact,dependencyReference); } catch (Exception e) { logger.error("Error processing artifact : " + artifact.toString() ); throw new APPCException(e.getMessage(),e); diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/ArtifactType.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/ArtifactType.java similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/ArtifactType.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/ArtifactType.java diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/Resource.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/Resource.java similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/Resource.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/Resource.java diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/SDCArtifact.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/SDCArtifact.java similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/SDCArtifact.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/SDCArtifact.java diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/SDCReference.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/SDCReference.java similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/SDCReference.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/SDCReference.java diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/Vnfc.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/Vnfc.java similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/Vnfc.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/artifacts/object/Vnfc.java diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/ProviderOperations.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/ProviderOperations.java similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/ProviderOperations.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/ProviderOperations.java diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/ProviderResponse.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/ProviderResponse.java similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/ProviderResponse.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/ProviderResponse.java diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/AsdcCallback.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/SdcCallback.java similarity index 89% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/AsdcCallback.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/SdcCallback.java index b5307d697..d721e13a0 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/AsdcCallback.java +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/SdcCallback.java @@ -46,9 +46,9 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -public class AsdcCallback implements INotificationCallback { +public class SdcCallback implements INotificationCallback { - private final EELFLogger logger = EELFManager.getInstance().getLogger(AsdcCallback.class); + private final EELFLogger logger = EELFManager.getInstance().getLogger(SdcCallback.class); private URI storeUri; private IDistributionClient client; @@ -61,7 +61,7 @@ public class AsdcCallback implements INotificationCallback { private AtomicBoolean isRunning = new AtomicBoolean(false); - public AsdcCallback(URI storeUri, IDistributionClient client) { + public SdcCallback(URI storeUri, IDistributionClient client) { this.storeUri = storeUri; this.client = client; @@ -83,16 +83,15 @@ public class AsdcCallback implements INotificationCallback { BundleContext bctx = FrameworkUtil.getBundle(EventSender.class).getBundleContext(); ServiceReference sref = bctx.getServiceReference(EventSender.class); eventSender = (EventSender) bctx.getService(sref); - } catch (Exception e) { - logger.error("AsdcCallback failed on initializing EventSender", e); + } catch (Throwable t) { + logger.error("SdcCallback failed on initializing EventSender", t); } } if (isRunning.get()) { for(IArtifactInfo artifact:data.getServiceArtifacts()){ - ArtifactProcessor artifactProcessor = ArtifactProcessorFactory.getArtifactProcessor( - client, eventSender, data, null, artifact, storeUri); + ArtifactProcessor artifactProcessor = ArtifactProcessorFactory.getArtifactProcessor(client, eventSender, data, null, artifact, storeUri); if(artifactProcessor!=null){ executor.submit(artifactProcessor); } @@ -100,7 +99,7 @@ public class AsdcCallback implements INotificationCallback { for (IResourceInstance resource : data.getResources()) { for (IArtifactInfo artifact : resource.getArtifacts()) { - logger.info(Util.toAsdcStoreDocumentInput(data, resource, artifact, "abc")); + logger.info(Util.toSdcStoreDocumentInput(data, resource, artifact, "abc")); if (executor.getQueue().size() >= threadCount) { // log warning about job backlog } @@ -121,7 +120,7 @@ public class AsdcCallback implements INotificationCallback { } } } else { - // TODO - return a failed result so asdc knows we are shut down + // TODO - return a failed result so sdc knows we are shut down } } @@ -131,7 +130,7 @@ public class AsdcCallback implements INotificationCallback { public void stop(int waitSec) { isRunning.set(false); - logger.info(String.format("Stopping the ASDC listener and waiting up to %ds for %d pending jobs", waitSec, + logger.info(String.format("Stopping the SDC listener and waiting up to %ds for %d pending jobs", waitSec, executor.getQueue().size())); boolean cleanShutdown = false; executor.shutdown(); diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/AsdcConfig.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/SdcConfig.java similarity index 85% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/AsdcConfig.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/SdcConfig.java index d0d5319f9..9c14d6756 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/AsdcConfig.java +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/SdcConfig.java @@ -35,7 +35,7 @@ import java.util.List; import java.util.Map; import java.util.Properties; -public class AsdcConfig implements IConfiguration { +public class SdcConfig implements IConfiguration { private String host; private String consumer; @@ -55,9 +55,9 @@ public class AsdcConfig implements IConfiguration { private Properties props; - private final EELFLogger logger = EELFManager.getInstance().getLogger(AsdcConfig.class); + private final EELFLogger logger = EELFManager.getInstance().getLogger(SdcConfig.class); - AsdcConfig(Properties props) throws Exception { + SdcConfig(Properties props) throws Exception { this.props = props; init(); } @@ -69,18 +69,18 @@ public class AsdcConfig implements IConfiguration { } // Keystore for ca cert - keystorePath = props.getProperty("appc.asdc.keystore.path"); - keystorePass = props.getProperty("appc.asdc.keystore.pass"); + keystorePath = props.getProperty("appc.sdc.keystore.path"); + keystorePass = props.getProperty("appc.sdc.keystore.pass"); // ASDC host - host = props.getProperty("appc.asdc.host"); - env = props.getProperty("appc.asdc.env"); - user = props.getProperty("appc.asdc.user"); - pass = props.getProperty("appc.asdc.pass"); + host = props.getProperty("appc.sdc.host"); + env = props.getProperty("appc.sdc.env"); + user = props.getProperty("appc.sdc.user"); + pass = props.getProperty("appc.sdc.pass"); // DMaaP properties - consumer = props.getProperty("appc.asdc.consumer"); - consumerId = props.getProperty("appc.asdc.consumer.id"); + consumer = props.getProperty("appc.sdc.consumer"); + consumerId = props.getProperty("appc.sdc.consumer.id"); pollingInterval = Integer.valueOf(props.getProperty("interval", "60")); @@ -109,7 +109,7 @@ public class AsdcConfig implements IConfiguration { types.add("VF_LICENSE"); types.add("TOSCA_CSAR"); - storeOp = new URI(props.getProperty("appc.asdc.provider.url")); + storeOp = new URI(props.getProperty("appc.sdc.provider.url")); } @Override @@ -185,13 +185,13 @@ public class AsdcConfig implements IConfiguration { */ private void logParams() { Map params = new HashMap<>(); - params.put("ASDC Host", getAsdcAddress()); - params.put("ASDC Environment", getEnvironmentName()); + params.put("SDC Host", getAsdcAddress()); + params.put("SDC Environment", getEnvironmentName()); params.put("Consumer Name", getConsumerGroup()); params.put("Consumer ID", getConsumerID()); params.put("Poll Active Wait", String.valueOf(getPollingInterval())); params.put("Poll Timeout", String.valueOf(getPollingTimeout())); - logger.info(String.format("ASDC Params: %s", params)); + logger.info(String.format("SDC Params: %s", params)); } } diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/AsdcListener.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/SdcListener.java similarity index 84% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/AsdcListener.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/SdcListener.java index a580e4077..dccc95841 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/AsdcListener.java +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/SdcListener.java @@ -45,15 +45,15 @@ import java.util.concurrent.TimeUnit; * Register connection with SDC server based on properties file configuration when start, * and disconnect with SDC server when stop. */ -public class AsdcListener { - private final EELFLogger logger = EELFManager.getInstance().getLogger(AsdcListener.class); +public class SdcListener { + private final EELFLogger logger = EELFManager.getInstance().getLogger(SdcListener.class); /** * The bundle context */ private IDistributionClient client; - private AsdcCallback callback; - private AsdcConfig config; + private SdcCallback callback; + private SdcConfig config; private CountDownLatch latch; private Thread startThread = null; @@ -66,13 +66,13 @@ public class AsdcListener { Configuration configuration = ConfigurationFactory.getConfiguration(); Properties props = configuration.getProperties(); - config = new AsdcConfig(props); + config = new SdcConfig(props); logger.debug(String.format("[%d] created SDC config", timeStamp)); client = DistributionClientFactory.createDistributionClient(); logger.debug(String.format("[%d] created SDC client", timeStamp)); - callback = new AsdcCallback(config.getStoreOpURI(), client); + callback = new SdcCallback(config.getStoreOpURI(), client); logger.debug(String.format("[%d] created SDC callback", timeStamp)); latch = new CountDownLatch(1); @@ -87,28 +87,28 @@ public class AsdcListener { public void stop() throws InterruptedException { // Add timestamp to the log to differentiate the jmeter run testing calls. final long timeStamp = System.currentTimeMillis(); - logger.info(String.format("[%d] Stopping ASDC Listener", timeStamp)); + logger.info(String.format("[%d] Stopping SDC Listener", timeStamp)); stopStartThread(timeStamp); if (latch != null) { - logger.debug(String.format("[%d] waiting ASDC latch count to 0 for 10 seconds", timeStamp)); + logger.debug(String.format("[%d] waiting SDC latch count to 0 for 10 seconds", timeStamp)); latch.await(10, TimeUnit.SECONDS); latch = null; } if (callback != null) { - logger.debug(String.format("[%d] stopping ASDC callback", timeStamp)); + logger.debug(String.format("[%d] stopping SDC callback", timeStamp)); callback.stop(); callback = null; } if (client != null) { - logger.debug(String.format("[%d] stopping ASDC client", timeStamp)); + logger.debug(String.format("[%d] stopping SDC client", timeStamp)); client.stop(); client = null; } - logger.info(String.format("[%d] ASDC Listener stopped successfully", timeStamp)); + logger.info(String.format("[%d] SDC Listener stopped successfully", timeStamp)); } void stopStartThread(long timeStamp) throws InterruptedException { @@ -117,15 +117,15 @@ public class AsdcListener { } if (startThread.getState() == Thread.State.TERMINATED) { - logger.debug(String.format("[%d] ASDC thread(%s) is already terminated.", + logger.debug(String.format("[%d] SDC thread(%s) is already terminated.", timeStamp, startThread.getName())); } else { - logger.debug(String.format("[%d] ASDC thread(%s) is to be interrupted with state(%s)", + logger.debug(String.format("[%d] SDC thread(%s) is to be interrupted with state(%s)", timeStamp, startThread.getName(), startThread.getState().toString())); startThread.interrupt(); - logger.debug(String.format("[%d] ASDC thread(%s) has been interrupted(%s) with state(%s)", + logger.debug(String.format("[%d] SDC thread(%s) has been interrupted(%s) with state(%s)", timeStamp, startThread.getName(), startThread.isInterrupted(), startThread.getState().toString())); } @@ -133,7 +133,7 @@ public class AsdcListener { } /** - * Runnable implementation for actual initialization during ASDC listener start + * Runnable implementation for actual initialization during SDC listener start */ class StartRunnable implements Runnable { private final long timeStamp; @@ -143,14 +143,14 @@ public class AsdcListener { } /** - * This run method calls ASDC client for init and start which are synchronized calls along with stop. + * This run method calls SDC client for init and start which are synchronized calls along with stop. * To interrupt this thread at stop time, we added thread interrupted checking in each step * for earlier interruption. */ @Override public void run() { if (!initialRegistration()) { - logger.warn(String.format("[%d] ASDC thread initial registration failed.", timeStamp)); + logger.warn(String.format("[%d] SDC thread initial registration failed.", timeStamp)); } if (isThreadInterrupted("after initial registration")) { @@ -166,7 +166,7 @@ public class AsdcListener { if (result.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS) { client.start(); } else { - logger.error(String.format("[%d] Could not register ASDC client. %s - %s", + logger.error(String.format("[%d] Could not register SDC client. %s - %s", timeStamp, result.getDistributionActionResult(), result.getDistributionMessageResult())); } @@ -202,7 +202,7 @@ public class AsdcListener { return result.getStatus() == 200; } catch (Exception e) { logger.error( - "Error performing initial registration with ASDC server. User may not be able to connect", + "Error performing initial registration with SDC server. User may not be able to connect", e); return false; } @@ -210,7 +210,7 @@ public class AsdcListener { private boolean isThreadInterrupted(String details) { if (Thread.currentThread().isInterrupted()) { - logger.info(String.format("[%d] ASDC thread interrupted %s.", timeStamp, details)); + logger.info(String.format("[%d] SDC thread interrupted %s.", timeStamp, details)); return true; } return false; diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/Util.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/Util.java similarity index 95% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/Util.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/Util.java index 2729d1dcb..2dbb66e30 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/Util.java +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/appc/sdc/listener/Util.java @@ -38,14 +38,14 @@ import org.openecomp.sdc.utils.DistributionStatusEnum; public class Util { // TODO - Use the yang builder instead - public static String toAsdcStoreDocumentInput(INotificationData notification, IResourceInstance resource, + public static String toSdcStoreDocumentInput(INotificationData notification, IResourceInstance resource, IArtifactInfo artifact, String data) { JSONObject json = new JSONObject(); JSONObject requestInfo = new JSONObject(); requestInfo.put("request-id", notification.getServiceUUID()); - requestInfo.put("request-action", "StoreAsdcDocumentRequest"); - requestInfo.put("source", "ASDC"); + requestInfo.put("request-action", "StoreSdcDocumentRequest"); + requestInfo.put("source", "SDC"); JSONObject docParams = new JSONObject(); docParams.put("service-uuid", notification.getServiceUUID()); diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/tlv/sdc/security/Passwords.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/tlv/sdc/security/Passwords.java similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/java/org/openecomp/tlv/sdc/security/Passwords.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/java/org/openecomp/tlv/sdc/security/Passwords.java diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml similarity index 77% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml index 4dc493c95..3f0eacc88 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml @@ -31,12 +31,12 @@ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"> - + diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/resources/ci/conf/attsdc-packages.yaml b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/resources/ci/conf/attsdc-packages.yaml similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/resources/ci/conf/attsdc-packages.yaml rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/resources/ci/conf/attsdc-packages.yaml diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/resources/ci/conf/attsdc.yaml b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/resources/ci/conf/attsdc.yaml similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/resources/ci/conf/attsdc.yaml rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/resources/ci/conf/attsdc.yaml diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/resources/ci/conf/log4j.properties b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/resources/ci/conf/log4j.properties similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/resources/ci/conf/log4j.properties rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/resources/ci/conf/log4j.properties diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/resources/ci/conf/titan.properties b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/resources/ci/conf/titan.properties similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/resources/ci/conf/titan.properties rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/resources/ci/conf/titan.properties diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/resources/ci/scripts/startTest.sh b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/resources/ci/scripts/startTest.sh similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/resources/ci/scripts/startTest.sh rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/resources/ci/scripts/startTest.sh diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/resources/org/openecomp/appc/default.properties b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/resources/org/openecomp/appc/default.properties similarity index 76% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/main/resources/org/openecomp/appc/default.properties rename to appc-sdc-listener/appc-sdc-listener-bundle/src/main/resources/org/openecomp/appc/default.properties index 55acec1fe..20cbbbcb0 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/main/resources/org/openecomp/appc/default.properties +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/main/resources/org/openecomp/appc/default.properties @@ -25,16 +25,16 @@ org.openecomp.appc.bootstrap.file=appc.properties org.openecomp.appc.bootstrap.path=/opt/openecomp/appc/data/properties,${user.home},. -# These ASDC properties were provided by the ASDC Op-So team -appc.asdc.keystore.path=etc/asdc-client.jks -appc.asdc.keystore.pass=Aa123456 +# These SDC properties were provided by the SDC Op-So team +appc.sdc.keystore.path=etc/sdc-client.jks +appc.sdc.keystore.pass=Aa123456 -appc.asdc.host=192.168.1.2:8443 -appc.asdc.env=TEST -appc.asdc.user=appc -appc.asdc.pass=appc +appc.sdc.host=192.168.1.2:8443 +appc.sdc.env=TEST +appc.sdc.user=appc +appc.sdc.pass=appc -appc.asdc.consumer=TEST -appc.asdc.consumer.id=TEST -appc.asdc.provider.url=http://localhost:8181/restconf/operations/AsdcMessage:configuration-document-request +appc.sdc.consumer=TEST +appc.sdc.consumer.id=TEST +appc.sdc.provider.url=http://localhost:8181/restconf/operations/SdcMessage:configuration-document-request diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/AsdcCallbackTest.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/SdcCallbackTest.java similarity index 75% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/AsdcCallbackTest.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/SdcCallbackTest.java index 3971ec248..9e2a86051 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/AsdcCallbackTest.java +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/SdcCallbackTest.java @@ -25,8 +25,6 @@ package org.openecomp.appc.sdc.listener; import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Matchers; import org.mockito.Mockito; @@ -68,56 +66,52 @@ import java.util.List; ArtifactStorageService.class, ToscaCsarArtifactProcessor.class, ArtifactProcessorFactory.class}) -public class AsdcCallbackTest { +public class SdcCallbackTest { - private IDistributionClient client; + IDistributionClient client; private EventSender eventSender; - private INotificationCallback asdcCallback; + private INotificationCallback sdcCallback; private ArtifactStorageService storageService; private ToscaCsarArtifactProcessor artifactProcessor; + @Before public void setup() throws Exception { client = PowerMockito.mock(IDistributionClient.class); eventSender = PowerMockito.mock(EventSender.class); - asdcCallback = new AsdcCallback(null,client); + sdcCallback = new SdcCallback(null,client); - artifactProcessor = Mockito.spy(new ToscaCsarArtifactProcessor( - client, eventSender, getNotificationData(), getResources().get(0), - getServiceArtifacts().get(0),null)); + artifactProcessor = Mockito.spy(new ToscaCsarArtifactProcessor(client,eventSender,getNotificationData(),getResources().get(0) + ,getServiceArtifacts().get(0),null)); storageService = PowerMockito.mock(ArtifactStorageService.class); Whitebox.setInternalState(artifactProcessor,"artifactStorageService", storageService); - PowerMockito.doCallRealMethod().when(artifactProcessor) - .processArtifact((IDistributionClientDownloadResult) Matchers.anyObject()); + PowerMockito.doCallRealMethod().when(artifactProcessor).processArtifact((IDistributionClientDownloadResult) Matchers.anyObject()); PowerMockito.doCallRealMethod().when(artifactProcessor).run(); + PowerMockito.mockStatic(ArtifactProcessorFactory.class); - PowerMockito.when(ArtifactProcessorFactory.getArtifactProcessor((IDistributionClient)Matchers.anyObject(), - (EventSender)Matchers.anyObject(), + PowerMockito.when(ArtifactProcessorFactory.getArtifactProcessor((IDistributionClient)Matchers.anyObject(), (EventSender)Matchers.anyObject(), (INotificationData)Matchers.anyObject(), (IResourceInstance)Matchers.anyObject(), (IArtifactInfo)Matchers.anyObject(), (URI)Matchers.anyObject())).thenReturn(artifactProcessor); - Whitebox.setInternalState(asdcCallback,"eventSender", eventSender); + Whitebox.setInternalState(sdcCallback,"eventSender", eventSender); PowerMockito.doReturn(readDownloadResult()).when(client).download((IArtifactInfo) Matchers.anyObject()); - PowerMockito.doReturn(null).when(client).sendDownloadStatus( - (IDistributionStatusMessage) Matchers.anyObject()); + PowerMockito.doReturn(null).when(client).sendDownloadStatus((IDistributionStatusMessage) Matchers.anyObject()); - PowerMockito.doReturn(null).when(storageService).retrieveSDCArtifact(Matchers.anyString(), - Matchers.anyString(), Matchers.anyString()); + PowerMockito.doReturn(null).when(storageService).retrieveSDCArtifact(Matchers.anyString(),Matchers.anyString(),Matchers.anyString()); PowerMockito.doAnswer(new Answer() { @Override - public Object answer(InvocationOnMock invocationOnMock) throws Exception { + public Object answer(InvocationOnMock invocationOnMock) throws Throwable { System.out.print(invocationOnMock.getArguments()[0].toString()); return null; } - }).when(storageService).storeASDCArtifact((SDCArtifact)Matchers.anyObject()); + }).when(storageService).storeSDCArtifact((SDCArtifact)Matchers.anyObject()); } private IDistributionClientDownloadResult readDownloadResult() throws IOException, URISyntaxException { - DistributionClientDownloadResultImpl downloadResult = new DistributionClientDownloadResultImpl( - DistributionActionResultEnum.SUCCESS,"Download success"); + DistributionClientDownloadResultImpl downloadResult = new DistributionClientDownloadResultImpl(DistributionActionResultEnum.SUCCESS,"Download success"); File file = new File(this.getClass().getResource("/csar/service-ServiceAppc-csar.csar").toURI()); byte[] bFile = new byte[(int) file.length()]; @@ -129,12 +123,14 @@ public class AsdcCallbackTest { return downloadResult; } - @Ignore - @Test - public void testASDCListener() - throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException { + +// @Test + public void testSDCListener() throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException { + + INotificationData notificationData = getNotificationData(); - asdcCallback.activateCallback(notificationData); + sdcCallback.activateCallback(notificationData); + // pause(); } @@ -146,11 +142,9 @@ public class AsdcCallbackTest { // } // } - private INotificationData getNotificationData() - throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException { + private INotificationData getNotificationData() throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException { - INotificationData notificationData = (INotificationData)getObject( - "org.openecomp.sdc.impl.NotificationDataImpl"); + INotificationData notificationData = (INotificationData)getObject("org.openecomp.sdc.impl.NotificationDataImpl"); List serviceArtifacts = getServiceArtifacts(); @@ -158,11 +152,9 @@ public class AsdcCallbackTest { return notificationData; } - private List getResources() - throws ClassNotFoundException, InvocationTargetException, InstantiationException, IllegalAccessException { + private List getResources() throws ClassNotFoundException, InvocationTargetException, InstantiationException, IllegalAccessException { List resources = new ArrayList<>(); - IResourceInstance resource = (IResourceInstance)getObject( - "org.openecomp.sdc.impl.JsonContainerResourceInstance"); + IResourceInstance resource = (IResourceInstance)getObject("org.openecomp.sdc.impl.JsonContainerResourceInstance"); List serviceArtifacts = getServiceArtifacts(); invokeMethod(resource,"setArtifacts",serviceArtifacts); @@ -173,8 +165,7 @@ public class AsdcCallbackTest { return resources; } - private void invokeMethod(Object object, String methodName,Object... arguments) - throws IllegalAccessException, InvocationTargetException { + private void invokeMethod(Object object, String methodName,Object... arguments) throws IllegalAccessException, InvocationTargetException { Method[] methods = object.getClass().getDeclaredMethods(); for(Method method:methods){ if(methodName.equalsIgnoreCase(method.getName())){ @@ -184,15 +175,13 @@ public class AsdcCallbackTest { } } - private Object getObject(String fqcn) - throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException { + private Object getObject(String fqcn) throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException { Constructor constructor = Class.forName(fqcn).getDeclaredConstructors()[0]; constructor.setAccessible(true); return constructor.newInstance(); } - private List getServiceArtifacts() - throws ClassNotFoundException, InvocationTargetException, InstantiationException, IllegalAccessException { + private List getServiceArtifacts() throws ClassNotFoundException, InvocationTargetException, InstantiationException, IllegalAccessException { List serviceArtifacts = new ArrayList<>(); IArtifactInfo artifactInfo = (IArtifactInfo)getObject("org.openecomp.sdc.impl.ArtifactInfoImpl"); invokeMethod(artifactInfo,"setArtifactType","TOSCA_CSAR"); diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/AsdcListenerTest.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/SdcListenerTest.java similarity index 77% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/AsdcListenerTest.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/SdcListenerTest.java index a821812ff..17e286bc5 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/AsdcListenerTest.java +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/SdcListenerTest.java @@ -44,23 +44,23 @@ import static org.mockito.Mockito.times; @RunWith(PowerMockRunner.class) @PrepareForTest(Thread.class) -public class AsdcListenerTest { - private AsdcListener asdcListener; +public class SdcListenerTest { + private SdcListener sdcListener; private EELFLogger mockLogger = mock(EELFLogger.class); @Before public void setUp() throws Exception { - asdcListener = new AsdcListener(); + sdcListener = new SdcListener(); // to avoid operation on logger fail, mock up the logger - Whitebox.setInternalState(asdcListener, "logger", mockLogger); + Whitebox.setInternalState(sdcListener, "logger", mockLogger); } @Test public void testStart() throws Exception { - asdcListener.start(); + sdcListener.start(); Assert.assertTrue("Should created startThread", - Whitebox.getInternalState(asdcListener, "startThread") != null); + Whitebox.getInternalState(sdcListener, "startThread") != null); } @Test @@ -68,50 +68,50 @@ public class AsdcListenerTest { // test interrupt thread and other null case MockThread mockThread = spy(new MockThread()); mockThread.setNewState(Thread.State.TIMED_WAITING); - Whitebox.setInternalState(asdcListener, "startThread", mockThread); + Whitebox.setInternalState(sdcListener, "startThread", mockThread); - asdcListener.stop(); + sdcListener.stop(); Mockito.verify(mockThread, times(1)).interrupt(); Assert.assertTrue("Should reset startThread", - Whitebox.getInternalState(asdcListener, "startThread") == null); + Whitebox.getInternalState(sdcListener, "startThread") == null); // test other non-null case and thread null case IDistributionClient mockClient = mock(IDistributionClient.class); - Whitebox.setInternalState(asdcListener, "client", mockClient); - AsdcCallback mockCallback = mock(AsdcCallback.class); - Whitebox.setInternalState(asdcListener, "callback", mockCallback); + Whitebox.setInternalState(sdcListener, "client", mockClient); + SdcCallback mockCallback = mock(SdcCallback.class); + Whitebox.setInternalState(sdcListener, "callback", mockCallback); CountDownLatch mockLatch = mock(CountDownLatch.class); - Whitebox.setInternalState(asdcListener, "latch", mockLatch); + Whitebox.setInternalState(sdcListener, "latch", mockLatch); - asdcListener.stop(); + sdcListener.stop(); Mockito.verify(mockLatch, times(1)).await(10, TimeUnit.SECONDS); Mockito.verify(mockCallback, times(1)).stop(); Mockito.verify(mockClient, times(1)).stop(); Assert.assertTrue("Should reset latch", - Whitebox.getInternalState(asdcListener, "latch") == null); + Whitebox.getInternalState(sdcListener, "latch") == null); Assert.assertTrue("Should reset callback", - Whitebox.getInternalState(asdcListener, "callback") == null); + Whitebox.getInternalState(sdcListener, "callback") == null); Assert.assertTrue("Should reset client", - Whitebox.getInternalState(asdcListener, "client") == null); + Whitebox.getInternalState(sdcListener, "client") == null); } @Test public void testStopStartThread() throws Exception { // null case - asdcListener.stopStartThread(123); + sdcListener.stopStartThread(123); Mockito.verify(mockLogger, times(0)).debug(String.valueOf(any())); MockThread mockThread = spy(new MockThread()); // thread terminated case - Whitebox.setInternalState(asdcListener, "startThread", mockThread); + Whitebox.setInternalState(sdcListener, "startThread", mockThread); mockThread.setNewState(Thread.State.TERMINATED); - asdcListener.stopStartThread(123); + sdcListener.stopStartThread(123); Mockito.verify(mockThread, times(0)).interrupt(); Mockito.verify(mockLogger, times(1)).debug(String.valueOf(any())); Assert.assertTrue("Should reset startThread", - Whitebox.getInternalState(asdcListener, "startThread") == null); + Whitebox.getInternalState(sdcListener, "startThread") == null); // thread not termianted case int timesCallThread = 0; @@ -120,13 +120,13 @@ public class AsdcListenerTest { if (state == Thread.State.TERMINATED) { continue; } - Whitebox.setInternalState(asdcListener, "startThread", mockThread); + Whitebox.setInternalState(sdcListener, "startThread", mockThread); mockThread.setNewState(state); - asdcListener.stopStartThread(123); + sdcListener.stopStartThread(123); Mockito.verify(mockThread, times(++ timesCallThread)).interrupt(); Mockito.verify(mockLogger, times(timesCallLogger += 2)).debug(String.valueOf(any())); Assert.assertTrue("Should reset startThread", - Whitebox.getInternalState(asdcListener, "startThread") == null); + Whitebox.getInternalState(sdcListener, "startThread") == null); } } diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/TestRun.java b/appc-sdc-listener/appc-sdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/TestRun.java similarity index 95% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/TestRun.java rename to appc-sdc-listener/appc-sdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/TestRun.java index 9e00ad9ef..84337e471 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/TestRun.java +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/test/java/org/openecomp/appc/sdc/listener/TestRun.java @@ -31,7 +31,7 @@ public class TestRun { @Test public void testRunning() throws Exception { /* - AppcAsdcListenerActivator a = new AppcAsdcListenerActivator(); + AppcSdcListenerActivator a = new AppcSdcListenerActivator(); a.start(null); Thread.sleep(10000); a.stop(null); diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/test/resources/csar/service-ServiceAppc-csar.csar b/appc-sdc-listener/appc-sdc-listener-bundle/src/test/resources/csar/service-ServiceAppc-csar.csar similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/test/resources/csar/service-ServiceAppc-csar.csar rename to appc-sdc-listener/appc-sdc-listener-bundle/src/test/resources/csar/service-ServiceAppc-csar.csar diff --git a/appc-asdc-listener/appc-asdc-listener-bundle/src/test/resources/org/openecomp/appc/default.properties b/appc-sdc-listener/appc-sdc-listener-bundle/src/test/resources/org/openecomp/appc/default.properties similarity index 78% rename from appc-asdc-listener/appc-asdc-listener-bundle/src/test/resources/org/openecomp/appc/default.properties rename to appc-sdc-listener/appc-sdc-listener-bundle/src/test/resources/org/openecomp/appc/default.properties index 291a46f09..522e0ed72 100644 --- a/appc-asdc-listener/appc-asdc-listener-bundle/src/test/resources/org/openecomp/appc/default.properties +++ b/appc-sdc-listener/appc-sdc-listener-bundle/src/test/resources/org/openecomp/appc/default.properties @@ -23,14 +23,14 @@ ### # These ASDC properties were provided by the ASDC Op-So team -appc.asdc.keystore.path=etc/asdc-client.jks -appc.asdc.keystore.pass=Aa123456 +appc.sdc.keystore.path=etc/sdc-client.jks +appc.sdc.keystore.pass=Aa123456 -appc.asdc.host=192.168.1.2:8443 -appc.asdc.env=TEST -appc.asdc.user=appc -appc.asdc.pass=appc +appc.sdc.host=192.168.1.2:8443 +appc.sdc.env=TEST +appc.sdc.user=appc +appc.sdc.pass=appc -appc.asdc.consumer=TEST -appc.asdc.consumer.id=TEST -appc.asdc.provider.url=http://localhost:8181/restconf/operations/AsdcMessage:configuration-document-request +appc.sdc.consumer=TEST +appc.sdc.consumer.id=TEST +appc.sdc.provider.url=http://localhost:8181/restconf/operations/SdcMessage:configuration-document-request diff --git a/appc-asdc-listener/appc-asdc-listener-features/.gitignore b/appc-sdc-listener/appc-sdc-listener-features/.gitignore similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-features/.gitignore rename to appc-sdc-listener/appc-sdc-listener-features/.gitignore diff --git a/appc-asdc-listener/appc-asdc-listener-features/pom.xml b/appc-sdc-listener/appc-sdc-listener-features/pom.xml similarity index 63% rename from appc-asdc-listener/appc-asdc-listener-features/pom.xml rename to appc-sdc-listener/appc-sdc-listener-features/pom.xml index 247d8bd32..ff93b23bf 100644 --- a/appc-asdc-listener/appc-asdc-listener-features/pom.xml +++ b/appc-sdc-listener/appc-sdc-listener-features/pom.xml @@ -1,12 +1,35 @@ + 4.0.0 - appc-asdc-listener + appc-sdc-listener org.openecomp.appc 1.1.0-SNAPSHOT - appc-asdc-listener-features + appc-sdc-listener-features Event Listener - Features jar @@ -14,7 +37,7 @@ org.openecomp.appc - appc-asdc-listener-bundle + appc-sdc-listener-bundle ${project.version} diff --git a/appc-asdc-listener/appc-asdc-listener-features/src/main/resources/features.xml b/appc-sdc-listener/appc-sdc-listener-features/src/main/resources/features.xml similarity index 86% rename from appc-asdc-listener/appc-asdc-listener-features/src/main/resources/features.xml rename to appc-sdc-listener/appc-sdc-listener-features/src/main/resources/features.xml index 5b89ae291..409d31d53 100644 --- a/appc-asdc-listener/appc-asdc-listener-features/src/main/resources/features.xml +++ b/appc-sdc-listener/appc-sdc-listener-features/src/main/resources/features.xml @@ -24,18 +24,18 @@ --> - mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features - + odl-mdsal-broker mvn:org.openecomp.appc/appc-common/${project.version} - mvn:org.openecomp.appc/appc-asdc-listener-bundle/${project.version} + mvn:org.openecomp.appc/appc-sdc-listener-bundle/${project.version} diff --git a/appc-asdc-listener/appc-asdc-listener-installer/.gitignore b/appc-sdc-listener/appc-sdc-listener-installer/.gitignore similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-installer/.gitignore rename to appc-sdc-listener/appc-sdc-listener-installer/.gitignore diff --git a/appc-asdc-listener/appc-asdc-listener-installer/pom.xml b/appc-sdc-listener/appc-sdc-listener-installer/pom.xml similarity index 69% rename from appc-asdc-listener/appc-asdc-listener-installer/pom.xml rename to appc-sdc-listener/appc-sdc-listener-installer/pom.xml index 7535b6d6f..cc15ae14e 100644 --- a/appc-asdc-listener/appc-asdc-listener-installer/pom.xml +++ b/appc-sdc-listener/appc-sdc-listener-installer/pom.xml @@ -1,19 +1,42 @@ + 4.0.0 - appc-asdc-listener + appc-sdc-listener org.openecomp.appc 1.1.0-SNAPSHOT - appc-asdc-listener-installer - ASDC Listener - Karaf Installer + appc-sdc-listener-installer + SDC Listener - Karaf Installer pom - appc-asdc-listener - appc-asdc-listener - mvn:org.openecomp.appc/appc-asdc-listener-features/${project.version}/xml/features + appc-sdc-listener + appc-sdc-listener + mvn:org.openecomp.appc/appc-sdc-listener-features/${project.version}/xml/features false @@ -21,7 +44,7 @@ org.openecomp.appc - appc-asdc-listener-features + appc-sdc-listener-features ${project.version} features xml @@ -35,7 +58,7 @@ org.openecomp.appc - appc-asdc-listener-bundle + appc-sdc-listener-bundle ${project.version} diff --git a/appc-asdc-listener/appc-asdc-listener-installer/src/assembly/assemble_installer_zip.xml b/appc-sdc-listener/appc-sdc-listener-installer/src/assembly/assemble_installer_zip.xml similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-installer/src/assembly/assemble_installer_zip.xml rename to appc-sdc-listener/appc-sdc-listener-installer/src/assembly/assemble_installer_zip.xml diff --git a/appc-asdc-listener/appc-asdc-listener-installer/src/assembly/assemble_mvnrepo_zip.xml b/appc-sdc-listener/appc-sdc-listener-installer/src/assembly/assemble_mvnrepo_zip.xml similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-installer/src/assembly/assemble_mvnrepo_zip.xml rename to appc-sdc-listener/appc-sdc-listener-installer/src/assembly/assemble_mvnrepo_zip.xml diff --git a/appc-asdc-listener/appc-asdc-listener-installer/src/main/resources/scripts/install-feature.sh b/appc-sdc-listener/appc-sdc-listener-installer/src/main/resources/scripts/install-feature.sh similarity index 100% rename from appc-asdc-listener/appc-asdc-listener-installer/src/main/resources/scripts/install-feature.sh rename to appc-sdc-listener/appc-sdc-listener-installer/src/main/resources/scripts/install-feature.sh diff --git a/appc-asdc-listener/appc-yang-generator/pom.xml b/appc-sdc-listener/appc-yang-generator/pom.xml similarity index 68% rename from appc-asdc-listener/appc-yang-generator/pom.xml rename to appc-sdc-listener/appc-yang-generator/pom.xml index 11b5b9d76..abe531e35 100644 --- a/appc-asdc-listener/appc-yang-generator/pom.xml +++ b/appc-sdc-listener/appc-yang-generator/pom.xml @@ -1,10 +1,33 @@ + 4.0.0 - appc-asdc-listener + appc-sdc-listener org.openecomp.appc 1.1.0-SNAPSHOT diff --git a/appc-asdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/YANGGenerator.java b/appc-sdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/YANGGenerator.java similarity index 100% rename from appc-asdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/YANGGenerator.java rename to appc-sdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/YANGGenerator.java diff --git a/appc-asdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/exception/YANGGenerationException.java b/appc-sdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/exception/YANGGenerationException.java similarity index 100% rename from appc-asdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/exception/YANGGenerationException.java rename to appc-sdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/exception/YANGGenerationException.java diff --git a/appc-asdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/impl/YANGGeneratorFactory.java b/appc-sdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/impl/YANGGeneratorFactory.java similarity index 100% rename from appc-asdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/impl/YANGGeneratorFactory.java rename to appc-sdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/impl/YANGGeneratorFactory.java diff --git a/appc-asdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/impl/YANGGeneratorImpl.java b/appc-sdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/impl/YANGGeneratorImpl.java similarity index 100% rename from appc-asdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/impl/YANGGeneratorImpl.java rename to appc-sdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/impl/YANGGeneratorImpl.java diff --git a/appc-asdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/objects/Leaf.java b/appc-sdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/objects/Leaf.java similarity index 100% rename from appc-asdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/objects/Leaf.java rename to appc-sdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/objects/Leaf.java diff --git a/appc-asdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/type/YangTypes.java b/appc-sdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/type/YangTypes.java similarity index 100% rename from appc-asdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/type/YangTypes.java rename to appc-sdc-listener/appc-yang-generator/src/main/java/org/openecomp/appc/yang/type/YangTypes.java diff --git a/appc-asdc-listener/appc-yang-generator/src/main/resources/templates/YangTemplate.vm b/appc-sdc-listener/appc-yang-generator/src/main/resources/templates/YangTemplate.vm similarity index 100% rename from appc-asdc-listener/appc-yang-generator/src/main/resources/templates/YangTemplate.vm rename to appc-sdc-listener/appc-yang-generator/src/main/resources/templates/YangTemplate.vm diff --git a/appc-asdc-listener/appc-yang-generator/src/test/java/org/openecomp/appc/TestYANGGenerator.java b/appc-sdc-listener/appc-yang-generator/src/test/java/org/openecomp/appc/TestYANGGenerator.java similarity index 100% rename from appc-asdc-listener/appc-yang-generator/src/test/java/org/openecomp/appc/TestYANGGenerator.java rename to appc-sdc-listener/appc-yang-generator/src/test/java/org/openecomp/appc/TestYANGGenerator.java diff --git a/appc-asdc-listener/appc-yang-generator/src/test/resources/tosca/toscaFile.yml b/appc-sdc-listener/appc-yang-generator/src/test/resources/tosca/toscaFile.yml similarity index 100% rename from appc-asdc-listener/appc-yang-generator/src/test/resources/tosca/toscaFile.yml rename to appc-sdc-listener/appc-yang-generator/src/test/resources/tosca/toscaFile.yml diff --git a/appc-asdc-listener/appc-yang-generator/src/test/resources/tosca/toscaFileWithSyntaxError.yml b/appc-sdc-listener/appc-yang-generator/src/test/resources/tosca/toscaFileWithSyntaxError.yml similarity index 100% rename from appc-asdc-listener/appc-yang-generator/src/test/resources/tosca/toscaFileWithSyntaxError.yml rename to appc-sdc-listener/appc-yang-generator/src/test/resources/tosca/toscaFileWithSyntaxError.yml diff --git a/appc-asdc-listener/appc-yang-generator/src/test/resources/tosca/toscaFileWithUnsupportedTypes.yml b/appc-sdc-listener/appc-yang-generator/src/test/resources/tosca/toscaFileWithUnsupportedTypes.yml similarity index 100% rename from appc-asdc-listener/appc-yang-generator/src/test/resources/tosca/toscaFileWithUnsupportedTypes.yml rename to appc-sdc-listener/appc-yang-generator/src/test/resources/tosca/toscaFileWithUnsupportedTypes.yml diff --git a/appc-asdc-listener/appc-yang-generator/src/test/resources/yang/expectedYang.yang b/appc-sdc-listener/appc-yang-generator/src/test/resources/yang/expectedYang.yang similarity index 100% rename from appc-asdc-listener/appc-yang-generator/src/test/resources/yang/expectedYang.yang rename to appc-sdc-listener/appc-yang-generator/src/test/resources/yang/expectedYang.yang diff --git a/appc-asdc-listener/pom.xml b/appc-sdc-listener/pom.xml similarity index 67% rename from appc-asdc-listener/pom.xml rename to appc-sdc-listener/pom.xml index 23b6e86f7..6a515faf6 100644 --- a/appc-asdc-listener/pom.xml +++ b/appc-sdc-listener/pom.xml @@ -1,4 +1,27 @@ + 4.0.0 @@ -7,8 +30,8 @@ 1.1.0-SNAPSHOT - appc-asdc-listener - ASDC Event Listener + appc-sdc-listener + SDC Event Listener Listener to read and write events from DMaaP (Cambria) or DMaaP. pom @@ -99,8 +122,8 @@ appc-yang-generator - appc-asdc-listener-bundle - appc-asdc-listener-features - appc-asdc-listener-installer + appc-sdc-listener-bundle + appc-sdc-listener-features + appc-sdc-listener-installer \ No newline at end of file diff --git a/pom.xml b/pom.xml index 2b6abfdaf..11e7de72d 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,27 @@ + @@ -600,7 +623,7 @@ appc-adapters appc-provider appc-event-listener - appc-asdc-listener + appc-sdc-listener appc-lifecycle-management appc-oam appc-config -- 2.16.6