Merge "Rename the default recipe for VFC NS"
authorChuanyu Chen <chenchuanyu@huawei.com>
Mon, 12 Mar 2018 09:56:51 +0000 (09:56 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 12 Mar 2018 09:56:51 +0000 (09:56 +0000)
226 files changed:
LICENSE.txt
adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfigFactory.java
adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudIdentity.java
adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java
adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackException.java
adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentEntry.java
adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResource.java
adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtils.java
adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtilsWithUpdate.java
adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoKeystoneUtils.java
adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoNeutronUtils.java
adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoHeatUtilsTest.java
adapters/mso-adapters-rest-interface/src/test/java/org/openecomp/mso/adapters/BeanTest.java
adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRest.java
adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRestClassTest.java
adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/CatalogDbAdapterRestHttpTest.java
adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/CatalogQueryTest.java
adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomizationTest.java
adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceMarcoHolderTest.java
adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceNetworksTest.java
adapters/mso-catalog-db-adapter/src/test/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryServiceVnfsTest.java
adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/MsoNetworkAdapterImpl.java
adapters/mso-network-adapter/src/test/java/org/openecomp/mso/adapters/network/NetworkBeansTest.java
adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
adapters/mso-sdnc-adapter/src/main/java/org/openecomp/mso/adapters/sdnc/sdncrest/SDNCConnector.java
adapters/mso-tenant-adapter/src/test/java/org/openecomp/mso/adapters/tenant/test/TenantTest.java
adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcAdapterRest.java
adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/exceptions/ApplicationException.java
adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java
adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/ValidateUtil.java
adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/VfcAdapterTest.java
adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterAsyncImpl.java
adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImpl.java
adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/vdu/utils/VduInfo.java
adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/vdu/utils/VduPlugin.java
adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/MsoVnfAdapterAsyncImplTest.java
adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/MsoVnfAdapterImplTest.java
adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/QueryTest.java
adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/VnfCreateTest.java
adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/test/VnfQueryTest.java
adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/vdu/utils/VduBlueprintTest.java
adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/vdu/utils/VduInfoTest.java [new file with mode: 0644]
adapters/pom.xml
aria/aria-rest-java-client/pom.xml
aria/pom.xml
asdc-controller/pom.xml
asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCConfiguration.java
asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCGlobalController.java
asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/VfModuleStructure.java
asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/VfResourceStructure.java
asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java
asdc-controller/src/main/java/org/openecomp/mso/asdc/util/ASDCNotificationLogging.java
asdc-controller/src/main/java/org/openecomp/mso/asdc/util/NotificationLogging.java
asdc-controller/src/main/java/org/openecomp/mso/asdc/util/YamlEditor.java
asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/ASDCControllerTest.java
asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/ASDCGlobalControllerTest.java
asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/YamlTest.java
asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/heat/tests/ToscaResourceInstallerTest.java
asdc-controller/src/test/java/org/openecomp/mso/asdc/installer/heat/tests/VfResourceInstallerTest.java
bpmn/MSOCockpit/pom.xml
bpmn/MSOCommonBPMN/pom.xml
bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/GenericUtils.groovy
bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/SDNCAdapterUtils.groovy
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/adapter/vnf/MsoRequest.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClient.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/util/CryptoUtils.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerSupport.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/DMaaPRestClient.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/RestClient.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/entities/PolicyServiceType.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidator.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilderTest.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/FileUtil.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResource.java
bpmn/MSOCoreBPMN/pom.xml
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/HealthCheckHandler.java
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/PropertyConfiguration.java
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/PropertyConfigurationSetup.java
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/RollbackData.java
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/WorkflowException.java
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/InventoryType.java
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/JsonWrapper.java
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/ServiceDecomposition.java
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/VnfResource.java
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonWrapper.java
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/mybatis/CustomMyBatisSessionFactory.java
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/mybatis/URNMapping.java
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/plugins/LoggingAndURNMappingPlugin.java
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/plugins/WorkflowExceptionPlugin.java
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/xml/XmlTool.java
bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/TestBaseTask.java
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceV2.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceV2.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy [new file with mode: 0644]
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy
bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java
bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java
bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java
bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java
bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java
bpmn/MSOInfrastructureBPMN/src/main/resources/process/UpdateCustomE2EServiceInstance.bpmn [new file with mode: 0644]
bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateGenericALaCarteServiceInstanceTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateNetworkInstanceTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleVolumeInfraV1Test.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVnfInfraTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteGenericALaCarteServiceInstanceTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteNetworkInstanceTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleInfraTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVfModuleVolumeInfraV1Test.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DeleteVnfInfraTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateSIRollbackTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleRollbackTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVfModuleVolumeV2Test.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesRollbackTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfAndModulesTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateVnfTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteServiceInstanceTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleFromVnfTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVfModuleVolumeV2Test.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfAndModulesTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoDeleteVnfTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVfModuleTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoUpdateVnfAndModulesTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/ReplaceVnfInfraTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateNetworkInstanceTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleInfraV2Test.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVfModuleVolumeInfraV1Test.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/UpdateVnfInfraTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DeleteVcpeResCustServiceTest.java
bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/request.json
bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSIName.json
bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSINameNoRollback.json
bpmn/MSORESTClient/pom.xml
bpmn/MSORESTClient/src/main/java/org/openecomp/mso/rest/RESTClient.java
bpmn/pom.xml
common/pom.xml
common/src/main/java/org/openecomp/mso/logger/MsoAlarmLogger.java
common/src/main/java/org/openecomp/mso/logger/MsoLogger.java
common/src/main/java/org/openecomp/mso/properties/MsoJsonProperties.java
common/src/main/java/org/openecomp/mso/properties/MsoPropertiesFactory.java
common/src/main/java/org/openecomp/mso/properties/MsoPropertiesParameters.java
common/src/main/java/org/openecomp/mso/utils/CheckResults.java
common/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoPropertiesFactoryConcurrencyTest.java
common/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoPropertiesFactoryTest.java
mso-api-handlers/mso-api-handler-common/pom.xml
mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaClient.java
mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaTaskClient.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NetworkInfoHandler.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NetworkMsoInfraRequest.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NetworkRequestHandler.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfInfoHandler.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfMsoInfraRequest.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandler.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VolumeInfoHandler.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VolumeMsoInfraRequest.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandler.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/NsParameters.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/networkbeans/NetworkRequests.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/networkbeans/NetworkTypes.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/networkbeans/ObjectFactory.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/serviceinstancebeans/ExceptionType.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/ObjectFactory.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/VfModuleModelNames.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/VnfRequests.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/vnfbeans/VnfTypes.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/volumebeans/ObjectFactory.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeRequests.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/MsoRequestTest.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/NetworkRequestHandlerTest.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/ServiceInstanceTest.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VfModuleModelNamesHandlerTest.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandlerTest.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandlerTest.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandlerTest.java
mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java
mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java
mso-api-handlers/pom.xml
mso-catalog-db/pom.xml
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomization.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ArRecipe.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateArtifactUuidModelUuid.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ModelRecipe.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkRecipe.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResourceCustomization.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolder.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResources.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworks.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/TempNetworkHeatTemplateLookup.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleCustomization.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleToHeatFiles.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfComponentsRecipe.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfRecipe.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResCustomToVfModuleCustom.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResourceCustomization.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/utils/MavenLikeVersioning.java
mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/CatalogDatabaseTest.java
mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/MavenVersioningTest.java
packages/docker/pom.xml
packages/pom.xml
status-control/pom.xml

index bb235ff..2bb9ad2 100644 (file)
-/*
-* ============LICENSE_START==========================================
-* ===================================================================
-* Copyright © 2017 AT&T Intellectual Property. All rights reserved.
-* ===================================================================
-*
-* Unless otherwise specified, all software contained herein is licensed
-* under the Apache License, Version 2.0 (the “License”);
-* you may not use this software except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*             http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*
-*
-* Unless otherwise specified, all documentation contained herein is licensed
-* under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
-* you may not use this documentation except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*             https://creativecommons.org/licenses/by/4.0/
-*
-* Unless required by applicable law or agreed to in writing, documentation
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-* ============LICENSE_END============================================
-*
-* ECOMP is a trademark and service mark of AT&T Intellectual Property.
-*
-*/
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
\ No newline at end of file
index 2d6d027..445c135 100644 (file)
@@ -127,7 +127,7 @@ public class CloudConfigFactory implements Serializable {
      * @return true if Properties have been reloaded, false otherwise
      */
     @Schedule(minute = "*/1", hour = "*", persistent = false)
-    public void reloadCloudConfig () {
+    public static void reloadCloudConfig () {
 
         try {
             if (!rwl.writeLock ().tryLock () && !rwl.writeLock ().tryLock (30L, TimeUnit.SECONDS)) {
index ba9a7d5..3dd4cbf 100644 (file)
@@ -227,29 +227,18 @@ public class CloudIdentity {
        public void setIdentityAuthenticationType(IdentityAuthenticationType identityAuthenticationType) {
                this.identityAuthenticationType = identityAuthenticationType;
        }
-       
+
        @Override
     public String toString () {
-        StringBuilder stringBuilder = new StringBuilder ();
-        stringBuilder.append ("Cloud Identity Service: id=")
-                     .append (id)
-                     .append (", identityUrl=")
-                     .append (this.identityUrl)
-                     .append (", msoId=")
-                     .append (msoId)
-                     .append (", adminTenant=")
-                     .append (adminTenant)
-                     .append (", memberRole=")
-                     .append (memberRole)
-                     .append (", tenantMetadata=")
-                     .append (tenantMetadata)
-                     .append (", identityServerType=")
-                     .append (identityServerType == null ? "null" : identityServerType.toString())
-                     .append (", identityAuthenticationType=")
-                     .append (identityAuthenticationType == null ? "null" : identityAuthenticationType.toString());
-        
-        return stringBuilder.toString ();
-    }
+               return "Cloud Identity Service: id=" + id +
+                       ", identityUrl=" + this.identityUrl +
+                       ", msoId=" + msoId +
+                       ", adminTenant=" + adminTenant +
+                       ", memberRole=" + memberRole +
+                       ", tenantMetadata=" + tenantMetadata +
+                       ", identityServerType=" + (identityServerType == null ? "null" : identityServerType.toString()) +
+                       ", identityAuthenticationType=" + (identityAuthenticationType == null ? "null" : identityAuthenticationType.toString());
+       }
 
     public static String encryptPassword (String msoPass) {
         try {
index 2cda8f9..64460b2 100644 (file)
@@ -139,15 +139,13 @@ public class NetworkInfo {
 
        @Override
        public String toString() {
-               final StringBuilder sb = new StringBuilder("NetworkInfo{");
-               sb.append("name='").append(name).append('\'');
-               sb.append(", id='").append(id).append('\'');
-               sb.append(", status=").append(status);
-               sb.append(", provider='").append(provider).append('\'');
-               sb.append(", vlans=").append(vlans);
-               sb.append(", subnets=").append(subnets);
-               sb.append('}');
-               return sb.toString();
+               return "NetworkInfo{" + "name='" + name + '\'' +
+                       ", id='" + id + '\'' +
+                       ", status=" + status +
+                       ", provider='" + provider + '\'' +
+                       ", vlans=" + vlans +
+                       ", subnets=" + subnets +
+                       '}';
        }
 }
 
index 8aa8d3f..eead843 100644 (file)
@@ -68,16 +68,13 @@ public class MsoOpenstackException extends MsoException
                this.statusMessage = message;
                this.errorDetail = detail;
        }
-       
+
        @Override
-       public String toString () {
-               StringBuilder error = new StringBuilder();
-               error.append("");
-               error.append(statusCode);
-               error.append(" ");
-               error.append(statusMessage);
-               error.append(": ");
-               error.append(errorDetail);
-               return error.toString();
+       public String toString() {
+               return statusCode +
+                       " " +
+                       statusMessage +
+                       ": " +
+                       errorDetail;
        }
 }
index 69da437..04dbf52 100644 (file)
@@ -65,11 +65,9 @@ public class MsoHeatEnvironmentEntry {
 
        @Override
        public String toString() {
-               final StringBuilder sb = new StringBuilder("MsoHeatEnvironmentEntry{");
-               sb.append("parameters=").append(parameters);
-               sb.append(", resourceRegistryEntryRaw='").append(resourceRegistryEntryRaw).append('\'');
-               sb.append('}');
-               return sb.toString();
+               return "MsoHeatEnvironmentEntry{" + "parameters=" + parameters +
+                       ", resourceRegistryEntryRaw='" + resourceRegistryEntryRaw + '\'' +
+                       '}';
        }
 
        public String getRawEntry() {
index a2e605f..a0c9b7a 100644 (file)
@@ -59,12 +59,10 @@ public class MsoHeatEnvironmentResource {
 
        @Override
        public String toString() {
-               StringBuilder str = new StringBuilder();
-               str.append("\"");
-               str.append(this.name);
-               str.append("\": ");
-               str.append(this.value);
-               return str.toString();
+               return "\"" +
+                       this.name +
+                       "\": " +
+                       this.value;
        }
 
        @Override
index 9fe2d4c..6862492 100644 (file)
@@ -143,7 +143,7 @@ public class MsoHeatUtils extends MsoCommonUtils {
                                   String tenantId,
                                   String stackName,
                                   String heatTemplate,
-                                  Map <String, ? extends Object> stackInputs,
+                                  Map <String, ?> stackInputs,
                                   boolean pollForCompletion,
                                   int timeoutMinutes) throws MsoException {
         // Just call the new method with the environment & files variable set to null
@@ -165,7 +165,7 @@ public class MsoHeatUtils extends MsoCommonUtils {
                                   String tenantId,
                                   String stackName,
                                   String heatTemplate,
-                                  Map <String, ? extends Object> stackInputs,
+                                  Map <String, ?> stackInputs,
                                   boolean pollForCompletion,
                                   int timeoutMinutes,
                                   String environment) throws MsoException {
@@ -188,7 +188,7 @@ public class MsoHeatUtils extends MsoCommonUtils {
                                   String tenantId,
                                   String stackName,
                                   String heatTemplate,
-                                  Map <String, ? extends Object> stackInputs,
+                                  Map <String, ?> stackInputs,
                                   boolean pollForCompletion,
                                   int timeoutMinutes,
                                   String environment,
@@ -211,7 +211,7 @@ public class MsoHeatUtils extends MsoCommonUtils {
                                   String tenantId,
                                   String stackName,
                                   String heatTemplate,
-                                  Map <String, ? extends Object> stackInputs,
+                                  Map <String, ?> stackInputs,
                                   boolean pollForCompletion,
                                   int timeoutMinutes,
                                   String environment,
@@ -275,7 +275,7 @@ public class MsoHeatUtils extends MsoCommonUtils {
                                   String tenantId,
                                   String stackName,
                                   String heatTemplate,
-                                  Map <String, ? extends Object> stackInputs,
+                                  Map <String, ?> stackInputs,
                                   boolean pollForCompletion,
                                   int timeoutMinutes,
                                   String environment,
@@ -1106,11 +1106,8 @@ public class MsoHeatUtils extends MsoCommonUtils {
         }
 
         public boolean isExpired () {
-            if (expires == null) {
-                return true;
-            }
+            return expires == null || System.currentTimeMillis() > expires.getTimeInMillis();
 
-            return System.currentTimeMillis() > expires.getTimeInMillis();
         }
     }
 
@@ -1243,8 +1240,6 @@ public class MsoHeatUtils extends MsoCommonUtils {
                        final Object obj = JSON_MAPPER.treeToValue(node, Object.class);
                        final String json = JSON_MAPPER.writeValueAsString(obj);
                        return json;
-               } catch (JsonParseException jpe) {
-                       LOGGER.debug("Error converting json to string " + jpe.getMessage(), jpe);
                } catch (Exception e) {
                        LOGGER.debug("Error converting json to string " + e.getMessage(), e);
                }
@@ -1439,7 +1434,7 @@ public class MsoHeatUtils extends MsoCommonUtils {
                
                if (inputs == null) {
                        LOGGER.debug("convertInputMap - inputs is null - nothing to do here");
-                       return new HashMap<String, Object>();
+                       return new HashMap<>();
                }
                
                LOGGER.debug("convertInputMap in MsoHeatUtils called, with " + inputs.size() + " inputs, and template " + template.getArtifactUuid());
index 0e0b9cb..75bb003 100644 (file)
@@ -230,7 +230,7 @@ public class MsoHeatUtilsWithUpdate extends MsoHeatUtils {
         if (haveFiles && haveHeatFiles) {
             // Let's do this here - not in the bean
             LOGGER.debug ("Found files AND heatFiles - combine and add!");
-            Map <String, Object> combinedFiles = new HashMap <String, Object> ();
+            Map <String, Object> combinedFiles = new HashMap<>();
             for (String keyString : files.keySet ()) {
                 combinedFiles.put (keyString, files.get (keyString));
             }
@@ -358,7 +358,7 @@ public class MsoHeatUtilsWithUpdate extends MsoHeatUtils {
                        sb.append("(outputs is empty)");
                        return sb;
                }
-               Map<String, Object> outputs = new HashMap<String,Object>();
+               Map<String, Object> outputs = new HashMap<>();
                for (Output outputItem : outputList) {
                        outputs.put(outputItem.getOutputKey(), outputItem.getOutputValue());
                }
@@ -428,8 +428,6 @@ public class MsoHeatUtilsWithUpdate extends MsoHeatUtils {
                        final Object obj = JSON_MAPPER.treeToValue(node, Object.class);
                        final String json = JSON_MAPPER.writeValueAsString(obj);
                        return json;
-               } catch (JsonParseException jpe) {
-                       LOGGER.debug("Error converting json to string " + jpe.getMessage(), jpe);
                } catch (Exception e) {
                        LOGGER.debug("Error converting json to string " + e.getMessage(), e);
                }
index be36d67..3b71003 100644 (file)
@@ -209,7 +209,7 @@ public class MsoKeystoneUtils extends MsoTenantUtils {
                 return null;
             }
 
-            Map <String, String> metadata = new HashMap <String, String> ();
+            Map <String, String> metadata = new HashMap<>();
             if (cloudSite.getIdentityService ().hasTenantMetadata ()) {
                 OpenStackRequest <Metadata> request = keystoneAdminClient.tenants ().showMetadata (tenant.getId ());
                 Metadata tenantMetadata = executeAndRecordOpenstackRequest (request, msoProps);
@@ -255,7 +255,7 @@ public class MsoKeystoneUtils extends MsoTenantUtils {
                 return null;
             }
 
-            Map <String, String> metadata = new HashMap <String, String> ();
+            Map <String, String> metadata = new HashMap<>();
             if (cloudSite.getIdentityService ().hasTenantMetadata ()) {
                 OpenStackRequest <Metadata> request = keystoneAdminClient.tenants ().showMetadata (tenant.getId ());
                 Metadata tenantMetadata = executeAndRecordOpenstackRequest (request, msoProps);
@@ -567,11 +567,8 @@ public class MsoKeystoneUtils extends MsoTenantUtils {
         }
 
         public boolean isExpired () {
-            if (expires == null) {
-                return true;
-            }
+            return expires == null || System.currentTimeMillis() > expires.getTimeInMillis();
 
-            return System.currentTimeMillis() > expires.getTimeInMillis();
         }
     }
 
index 50a5946..9eba799 100644 (file)
@@ -63,7 +63,7 @@ public class MsoNeutronUtils extends MsoCommonUtils
        // token will be used until it expires.
        //
        // The cache key is "tenantId:cloudId"
-       private static Map<String,NeutronCacheEntry> neutronClientCache = new HashMap<String,NeutronCacheEntry>();
+       private static Map<String,NeutronCacheEntry> neutronClientCache = new HashMap<>();
 
        // Fetch cloud configuration each time (may be cached in CloudConfig class)
        private CloudConfig cloudConfig;
@@ -129,7 +129,7 @@ public class MsoNeutronUtils extends MsoCommonUtils
                        }
                } else if (type == NetworkType.MULTI_PROVIDER) {
                        if (provider != null && vlans != null && vlans.size() > 0) {
-                               List<Segment> segments = new ArrayList<Segment>(vlans.size());
+                               List<Segment> segments = new ArrayList<>(vlans.size());
                                for (int vlan : vlans) {
                                        Segment segment = new Segment();
                                        segment.setProviderPhysicalNetwork (provider);
@@ -297,7 +297,7 @@ public class MsoNeutronUtils extends MsoCommonUtils
                        }
                } else if (type == NetworkType.MULTI_PROVIDER) {
                        if (provider != null && vlans != null && vlans.size() > 0) {
-                               List<Segment> segments = new ArrayList<Segment>(vlans.size());
+                               List<Segment> segments = new ArrayList<>(vlans.size());
                                for (int vlan : vlans) {
                                        Segment segment = new Segment();
                                        segment.setProviderPhysicalNetwork (provider);
@@ -559,11 +559,7 @@ public class MsoNeutronUtils extends MsoCommonUtils
                }
 
                public boolean isExpired() {
-                       if (expires == null) {
-                return true;
-            }
-
-            return System.currentTimeMillis() > expires.getTimeInMillis();
+                       return expires == null || System.currentTimeMillis() > expires.getTimeInMillis();
                }
        }
 
index 6fd95d5..c2d4f9b 100644 (file)
@@ -60,7 +60,7 @@ public class MsoHeatUtilsTest extends MsoCommonUtils {
        public final void testCreateStackBadCloudConfig()
                        throws MsoStackAlreadyExists, MsoTenantNotFound, MsoException, MsoCloudSiteNotFound {
                try {
-                       msoHeatUtils.createStack("DOESNOTEXIST", "test", "stackName", "test", new HashMap<String, Object>(),
+                       msoHeatUtils.createStack("DOESNOTEXIST", "test", "stackName", "test", new HashMap<>(),
                                        Boolean.TRUE, 10);
                } catch (MsoCloudSiteNotFound e) {
 
@@ -74,7 +74,7 @@ public class MsoHeatUtilsTest extends MsoCommonUtils {
        public final void testCreateStackFailedConnectionHeatClient()
                        throws MsoStackAlreadyExists, MsoTenantNotFound, MsoException, MsoCloudSiteNotFound {
                try {
-                       msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<String, Object>(), Boolean.TRUE,
+                       msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<>(), Boolean.TRUE,
                                        10);
                } catch (MsoIOException e) {
 
@@ -86,7 +86,7 @@ public class MsoHeatUtilsTest extends MsoCommonUtils {
        public final void testCreateStackFailedConnection()
                        throws MsoStackAlreadyExists, MsoTenantNotFound, MsoException, MsoCloudSiteNotFound {
                try {
-                       msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<String, Object>(), Boolean.TRUE,
+                       msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<>(), Boolean.TRUE,
                                        10);
                } catch (MsoIOException e) {
 
@@ -97,7 +97,7 @@ public class MsoHeatUtilsTest extends MsoCommonUtils {
        @Test
        public final void createStackSuccessWithEnvironment() throws MsoException {
                try {
-                       msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<String, Object>(), Boolean.TRUE, 10,
+                       msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<>(), Boolean.TRUE, 10,
                                        "environment");
                } catch (MsoIOException e) {
 
@@ -108,8 +108,8 @@ public class MsoHeatUtilsTest extends MsoCommonUtils {
        @Test
        public final void createStackSuccessWithFiles() throws MsoException {
                try {
-                       msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<String, Object>(), Boolean.TRUE, 10,
-                                       "environment", new HashMap<String, Object>());
+                       msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<>(), Boolean.TRUE, 10,
+                                       "environment", new HashMap<>());
                } catch (MsoIOException e) {
 
                }
@@ -119,8 +119,8 @@ public class MsoHeatUtilsTest extends MsoCommonUtils {
        @Test
        public final void createStackSuccessWithHeatFiles() throws MsoException {
                try {
-                       msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<String, Object>(), Boolean.TRUE, 10,
-                                       "environment", new HashMap<String, Object>(), new HashMap<String, Object>());
+                       msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<>(), Boolean.TRUE, 10,
+                                       "environment", new HashMap<>(), new HashMap<>());
                } catch (MsoIOException e) {
 
                }
@@ -131,7 +131,7 @@ public class MsoHeatUtilsTest extends MsoCommonUtils {
                CreateStackParam param = new CreateStackParam();
                param.setDisableRollback(false);
                param.setEnvironment("environment");
-               param.setFiles(new HashMap<String, Object>());
+               param.setFiles(new HashMap<>());
                param.setParameters(new HashMap<>());
                param.setStackName("stackName");
                param.setTemplate("template");
index 5c3470a..9efaee9 100644 (file)
@@ -433,7 +433,7 @@ public class BeanTest {
                                                m.invoke(obj);
                                        } else if (types.length == 1) {
                                                String type = types[0].getTypeName();
-                                               if (type.indexOf("<") != -1) {
+                                               if (type.contains("<")) {
                                                        type = type.substring(0, type.indexOf("<"));
                                                }
                                                Class paramCls = Class.forName(type);
index bcf2ab3..c1c5aee 100644 (file)
@@ -430,45 +430,46 @@ public class CatalogDbAdapterRest {
                QueryVfModule qryResp;
                int respStatus = HttpStatus.SC_OK;
                List<VfModuleCustomization> ret = null;
-               CatalogDatabase db = CatalogDatabase.getInstance();
-
-               try{
-                       if(vfModuleModelName != null && !"".equals(vfModuleModelName)){
-                               LOGGER.debug ("Query vfModules by vfModuleModuleName: " + vfModuleModelName);
-                               VfModuleCustomization vfModule = db.getVfModuleCustomizationByModelName(vfModuleModelName);
-                               if(vfModule != null){
-                                       ret = new ArrayList<>(1);
-                                       ret.add(vfModule);
-                               }
-                       }else{
-                               throw(new Exception("Incoming parameter is null or blank"));
-                       }
-                       if(ret == null || ret.isEmpty()){
-                               LOGGER.debug ("vfModules not found");
-                               respStatus = HttpStatus.SC_NOT_FOUND;
-                               qryResp = new QueryVfModule();
-                       }else{
-                               LOGGER.debug ("vfModules found");
-                               qryResp = new QueryVfModule(ret);
-                               LOGGER.debug ("vfModules query Results is: "+ qryResp);
-                               LOGGER.debug ("vfModules tojsonstring is: "+ qryResp.JSON2(false, false));
-                       }
-                       LOGGER.debug ("Query vfModules exit");
-                       return Response
-                                       .status(respStatus)
-                                       .entity(qryResp.JSON2(false, false)) 
-                                       .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
-                                       .build();
-               }catch(Exception e){
-                       LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR,  vfModuleModelName, "", "queryVfModules", MsoLogger.ErrorCode.BusinessProcesssError, "Exception during query VfModules by vfModuleModuleName: ", e);
-                       CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
-                       return Response
-                                       .status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
-                                       .entity(new GenericEntity<CatalogQueryException>(excResp) {})
-                                       .build();
-               }finally {
-                       db.close();
-               }
+
+        try (CatalogDatabase db = CatalogDatabase.getInstance()) {
+            if (vfModuleModelName != null && !"".equals(vfModuleModelName)) {
+                LOGGER.debug("Query vfModules by vfModuleModuleName: " + vfModuleModelName);
+                VfModuleCustomization vfModule = db.getVfModuleCustomizationByModelName(vfModuleModelName);
+                if (vfModule != null) {
+                    ret = new ArrayList<>(1);
+                    ret.add(vfModule);
+                }
+            } else {
+                throw (new Exception("Incoming parameter is null or blank"));
+            }
+            if (ret == null || ret.isEmpty()) {
+                LOGGER.debug("vfModules not found");
+                respStatus = HttpStatus.SC_NOT_FOUND;
+                qryResp = new QueryVfModule();
+            } else {
+                LOGGER.debug("vfModules found");
+                qryResp = new QueryVfModule(ret);
+                LOGGER.debug("vfModules query Results is: " + qryResp);
+                LOGGER.debug("vfModules tojsonstring is: " + qryResp.JSON2(false, false));
+            }
+            LOGGER.debug("Query vfModules exit");
+            return Response
+                .status(respStatus)
+                .entity(qryResp.JSON2(false, false))
+                .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+                .build();
+        } catch (Exception e) {
+            LOGGER.error(MessageEnum.RA_QUERY_VNF_ERR, vfModuleModelName, "", "queryVfModules",
+                MsoLogger.ErrorCode.BusinessProcesssError, "Exception during query VfModules by vfModuleModuleName: ",
+                e);
+            CatalogQueryException excResp = new CatalogQueryException(e.getMessage(),
+                CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
+            return Response
+                .status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
+                .entity(new GenericEntity<CatalogQueryException>(excResp) {
+                })
+                .build();
+        }
        }
 
        /**
@@ -484,37 +485,36 @@ public class CatalogDbAdapterRest {
     @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
     public Response serviceToscaCsar(@QueryParam("serviceModelUuid") String smUuid) {
         int respStatus = HttpStatus.SC_OK;
-        CatalogDatabase db = CatalogDatabase.getInstance();
         String entity = "";
-        try{
-            if(smUuid != null && !"".equals(smUuid)){
-                LOGGER.debug ("Query Csar by service model uuid: " + smUuid);
+        try (CatalogDatabase db = CatalogDatabase.getInstance()) {
+            if (smUuid != null && !"".equals(smUuid)) {
+                LOGGER.debug("Query Csar by service model uuid: " + smUuid);
                 ToscaCsar toscaCsar = db.getToscaCsarByServiceModelUUID(smUuid);
-                if(toscaCsar != null){
+                if (toscaCsar != null) {
                     QueryServiceCsar serviceCsar = new QueryServiceCsar(toscaCsar);
                     entity = serviceCsar.JSON2(false, false);
-                }
-                else{
+                } else {
                     respStatus = HttpStatus.SC_NOT_FOUND;
                 }
-            }else{
-                throw(new Exception("Incoming parameter is null or blank"));
-            }           
-            LOGGER.debug ("Query Csar exit");
+            } else {
+                throw (new Exception("Incoming parameter is null or blank"));
+            }
+            LOGGER.debug("Query Csar exit");
             return Response
-                    .status(respStatus)
-                    .entity(entity) 
-                    .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
-                    .build();
-        }catch(Exception e){
-            LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR,  smUuid, "", "ServiceToscaCsar", MsoLogger.ErrorCode.BusinessProcesssError, "Exception during query csar by service model uuid: ", e);
-            CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
+                .status(respStatus)
+                .entity(entity)
+                .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+                .build();
+        } catch (Exception e) {
+            LOGGER.error(MessageEnum.RA_QUERY_VNF_ERR, smUuid, "", "ServiceToscaCsar",
+                MsoLogger.ErrorCode.BusinessProcesssError, "Exception during query csar by service model uuid: ", e);
+            CatalogQueryException excResp = new CatalogQueryException(e.getMessage(),
+                CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
             return Response
-                    .status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
-                    .entity(new GenericEntity<CatalogQueryException>(excResp) {})
-                    .build();
-        }finally {
-            db.close();
+                .status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
+                .entity(new GenericEntity<CatalogQueryException>(excResp) {
+                })
+                .build();
         }
     }
     
@@ -531,44 +531,43 @@ public class CatalogDbAdapterRest {
     @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
     public Response resourceRecipe(@QueryParam("resourceModelUuid") String rmUuid, @QueryParam("action") String action) {
         int respStatus = HttpStatus.SC_OK;
-        CatalogDatabase db = CatalogDatabase.getInstance();
-        String entity = "";
-        try{
-            if(rmUuid != null && !"".equals(rmUuid)){
-                LOGGER.debug ("Query recipe by resource model uuid: " + rmUuid);
-                //check vnf and network and ar, the resource could be any resource.
-                Recipe recipe = db.getVnfRecipeByModuleUuid(rmUuid, action);
-                if(null == recipe){
-                    recipe = db.getNetworkRecipeByModuleUuid(rmUuid, action);
-                }
-                if(null == recipe){
-                    recipe = db.getArRecipeByModuleUuid(rmUuid, action);
-                }
-                if(recipe != null){
-                    QueryResourceRecipe resourceRecipe = new QueryResourceRecipe(recipe);
-                    entity = resourceRecipe.JSON2(false, false);
-                }
-                else{
-                    respStatus = HttpStatus.SC_NOT_FOUND;
-                }
-            }else{
-                throw(new Exception("Incoming parameter is null or blank"));
-            }           
-            LOGGER.debug ("Query recipe exit");
-            return Response
-                    .status(respStatus)
-                    .entity(entity) 
-                    .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
-                    .build();
-        }catch(Exception e){
-            LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR,  rmUuid, "", "resourceRecipe", MsoLogger.ErrorCode.BusinessProcesssError, "Exception during query recipe by resource model uuid: ", e);
-            CatalogQueryException excResp = new CatalogQueryException(e.getMessage(), CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
-            return Response
-                    .status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
-                    .entity(new GenericEntity<CatalogQueryException>(excResp) {})
-                    .build();
-        }finally {
-            db.close();
-        }
+               String entity = "";
+               try (CatalogDatabase db = CatalogDatabase.getInstance()) {
+                       if (rmUuid != null && !"".equals(rmUuid)) {
+                               LOGGER.debug("Query recipe by resource model uuid: " + rmUuid);
+                               //check vnf and network and ar, the resource could be any resource.
+                               Recipe recipe = db.getVnfRecipeByModuleUuid(rmUuid, action);
+                               if (null == recipe) {
+                                       recipe = db.getNetworkRecipeByModuleUuid(rmUuid, action);
+                               }
+                               if (null == recipe) {
+                                       recipe = db.getArRecipeByModuleUuid(rmUuid, action);
+                               }
+                               if (recipe != null) {
+                                       QueryResourceRecipe resourceRecipe = new QueryResourceRecipe(recipe);
+                                       entity = resourceRecipe.JSON2(false, false);
+                               } else {
+                                       respStatus = HttpStatus.SC_NOT_FOUND;
+                               }
+                       } else {
+                               throw (new Exception("Incoming parameter is null or blank"));
+                       }
+                       LOGGER.debug("Query recipe exit");
+                       return Response
+                               .status(respStatus)
+                               .entity(entity)
+                               .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+                               .build();
+               } catch (Exception e) {
+                       LOGGER.error(MessageEnum.RA_QUERY_VNF_ERR, rmUuid, "", "resourceRecipe",
+                               MsoLogger.ErrorCode.BusinessProcesssError, "Exception during query recipe by resource model uuid: ", e);
+                       CatalogQueryException excResp = new CatalogQueryException(e.getMessage(),
+                               CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
+                       return Response
+                               .status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
+                               .entity(new GenericEntity<CatalogQueryException>(excResp) {
+                               })
+                               .build();
+               }
     }
 }
index 31a5832..3159490 100644 (file)
@@ -70,7 +70,7 @@ public class CatalogDbAdapterRestClassTest {
                 * 
                 */
        // set up mock return value
-        paramList = new ArrayList<VnfResourceCustomization>();
+        paramList = new ArrayList<>();
         VnfResourceCustomization d1 = new VnfResourceCustomization();
         d1.setModelCustomizationUuid("16ea3e56-a8ce-4ad7-8edd-4d2eae095391");
         d1.setModelInstanceName("ciVFOnboarded-FNAT-aab06c41 1");
index 33f5553..ae5e663 100644 (file)
@@ -114,7 +114,7 @@ public class CatalogDbAdapterRestHttpTest {
        try {
            List<VnfResourceCustomization> paramList;                   
                // set up mock return value
-            paramList = new ArrayList<VnfResourceCustomization>();
+            paramList = new ArrayList<>();
             VnfResourceCustomization d1 = new VnfResourceCustomization();
             d1.setModelCustomizationUuid("16ea3e56-a8ce-4ad7-8edd-4d2eae095391");
             d1.setModelInstanceName("RG_6-26_mog11 0");
@@ -154,7 +154,7 @@ public class CatalogDbAdapterRestHttpTest {
        try {
            List<VnfResourceCustomization> paramList;                   
                // set up mock return value
-            paramList = new ArrayList<VnfResourceCustomization>();
+            paramList = new ArrayList<>();
             VnfResourceCustomization d1 = new VnfResourceCustomization();
             d1.setVnfResourceModelUuid("16ea3e56-a8ce-4ad7-8edd-4d2eae095391");
             d1.setModelInstanceName("RG_6-26_mog11 0");
@@ -198,7 +198,7 @@ public class CatalogDbAdapterRestHttpTest {
        try {
            List<VnfResourceCustomization> paramList;                   
                // set up mock return value
-            paramList = new ArrayList<VnfResourceCustomization>();
+            paramList = new ArrayList<>();
             VnfResourceCustomization d1 = new VnfResourceCustomization();
             d1.setModelCustomizationUuid("16ea3e56-a8ce-4ad7-8edd-4d2eae095391");
             d1.setModelInstanceName("RG_6-26_mog11 0");
@@ -242,7 +242,7 @@ public class CatalogDbAdapterRestHttpTest {
        try {
            List<NetworkResourceCustomization> paramList;               
                // set up mock return value
-            paramList = new ArrayList<NetworkResourceCustomization>();
+            paramList = new ArrayList<>();
             NetworkResourceCustomization d1 = new NetworkResourceCustomization();
             d1.setNetworkResourceModelUuid("0cb9b26a-9820-48a7-86e5-16c510e993d9");
             paramList.add(d1);
@@ -282,7 +282,7 @@ public class CatalogDbAdapterRestHttpTest {
        try {
            List<NetworkResourceCustomization> paramList;               
                // set up mock return value
-            paramList = new ArrayList<NetworkResourceCustomization>();
+            paramList = new ArrayList<>();
             NetworkResourceCustomization d1 = new NetworkResourceCustomization();
             d1.setNetworkResourceModelUuid("0cb9b26a-9820-48a7-86e5-16c510e993d9");
             paramList.add(d1);
@@ -322,7 +322,7 @@ public class CatalogDbAdapterRestHttpTest {
        try {
            ArrayList<NetworkResourceCustomization> paramList;                  
                // set up mock return value
-            paramList = new ArrayList<NetworkResourceCustomization>();
+            paramList = new ArrayList<>();
             NetworkResourceCustomization d1 = new NetworkResourceCustomization();
             d1.setNetworkResourceModelUuid("0cb9b26a-9820-48a7-86e5-16c510e993d9");
             paramList.add(d1);
@@ -367,7 +367,7 @@ public class CatalogDbAdapterRestHttpTest {
        try {
            List<AllottedResourceCustomization> paramList;              
                // set up mock return value
-            paramList = new ArrayList<AllottedResourceCustomization>();
+            paramList = new ArrayList<>();
             AllottedResourceCustomization d1 = new AllottedResourceCustomization();
             d1.setArModelUuid("0cb9b26a-9820-48a7-86e5-16c510e993d9");
             paramList.add(d1);
@@ -409,7 +409,7 @@ public class CatalogDbAdapterRestHttpTest {
        try {
            List<AllottedResourceCustomization> paramList;              
                // set up mock return value
-            paramList = new ArrayList<AllottedResourceCustomization>();
+            paramList = new ArrayList<>();
             AllottedResourceCustomization d1 = new AllottedResourceCustomization();
             d1.setArModelUuid("0cb9b26a-9820-48a7-86e5-16c510e993d9");
             paramList.add(d1);
index 31e828d..ee2c8db 100644 (file)
@@ -49,7 +49,7 @@ public class CatalogQueryTest {
                CatalogQuery mockCatalogQuery = Mockito.mock(CatalogQuery.class);
                Mockito.doCallRealMethod().when(mockCatalogQuery).setTemplate(Mockito.anyString(), Mockito.anyMapOf(String.class, String.class));
                
-               Map<String,String> valueMap = new HashMap<String,String>();
+               Map<String,String> valueMap = new HashMap<>();
                valueMap.put("somekey", "somevalue");
                
                String ret = mockCatalogQuery.setTemplate("<somekey>", valueMap);
@@ -60,7 +60,7 @@ public class CatalogQueryTest {
        @Test
        public void smartToJson_Test()
        {
-        List<VnfResourceCustomization> paramList = new ArrayList<VnfResourceCustomization>();
+        List<VnfResourceCustomization> paramList = new ArrayList<>();
         VnfResourceCustomization d1 = new VnfResourceCustomization();
         d1.setModelCustomizationUuid("16ea3e56-a8ce-4ad7-8edd-4d2eae095391");
         d1.setModelInstanceName("RG_6-26_mog11 0");
index 71352b5..0d86a6c 100644 (file)
@@ -43,7 +43,7 @@ public class QueryAllottedResourceCustomizationTest {
        public void JSON2_Test()
        {
            List<AllottedResourceCustomization> paramList;              
-        paramList = new ArrayList<AllottedResourceCustomization>();
+        paramList = new ArrayList<>();
         AllottedResourceCustomization d1 = new AllottedResourceCustomization();
         d1.setModelInstanceName("0cb9b26a-9820-48a7-86e5-16c510e993d9");
         d1.setModelCustomizationUuid("16ea3e56-a8ce-4ad7-8edd-4d2eae095391");
index dfbc2dc..3a767a8 100644 (file)
@@ -47,7 +47,7 @@ public class QueryServiceMarcoHolderTest {
                svc.setModelUUID("0cb9b26a-9820-48a7-86e5-16c510e993d9");
                svc.setModelName("Testing Model One");
            ArrayList<NetworkResourceCustomization> paramList;                  
-        paramList = new ArrayList<NetworkResourceCustomization>();
+        paramList = new ArrayList<>();
         NetworkResourceCustomization d1 = new NetworkResourceCustomization();
         d1.setNetworkResourceModelUuid("0cb9b26a-9820-48a7-86e5-16c510e993d9");
         paramList.add(d1);
index b237dbe..1c855ea 100644 (file)
@@ -45,7 +45,7 @@ public class QueryServiceNetworksTest {
        public void JSON2_Test()
        {
            ArrayList<NetworkResourceCustomization> paramList;                  
-        paramList = new ArrayList<NetworkResourceCustomization>();
+        paramList = new ArrayList<>();
         NetworkResourceCustomization d1 = new NetworkResourceCustomization();
         d1.setModelInstanceName("0cb9b26a-9820-48a7-86e5-16c510e993d9");
         paramList.add(d1);
index 262fe06..8c8fc96 100644 (file)
@@ -44,7 +44,7 @@ public class QueryServiceVnfsTest {
        public void JSON2_Test()
        {
            List<VnfResourceCustomization> paramList;                   
-        paramList = new ArrayList<VnfResourceCustomization>();
+        paramList = new ArrayList<>();
         VnfResourceCustomization d1 = new VnfResourceCustomization();
         d1.setModelInstanceName("0cb9b26a-9820-48a7-86e5-16c510e993d9");
         d1.setVnfResourceModelUuid("0cb9b26a-9820-48a7-86e5-16c510e993d9");
index 82684bd..6063956 100644 (file)
@@ -288,39 +288,45 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
         }
 
         // Get a handle to the Catalog Database
-        CatalogDatabase db = getCatalogDB ();
 
         // Make sure DB connection is always closed
-        try {
-            NetworkResource networkResource = networkCheck (db,
-                                                            startTime,
-                                                            networkType,
-                                                            modelCustomizationUuid,
-                                                            networkName,
-                                                            physicalNetworkName,
-                                                            vlans,
-                                                            routeTargets,
-                                                            cloudSiteOpt.get());
-            String mode = networkResource.getOrchestrationMode ();
-            NetworkType neutronNetworkType = NetworkType.valueOf (networkResource.getNeutronNetworkType ());
-
-            if (NEUTRON_MODE.equals (mode)) {
+        try (CatalogDatabase db = getCatalogDB()) {
+            NetworkResource networkResource = networkCheck(db,
+                startTime,
+                networkType,
+                modelCustomizationUuid,
+                networkName,
+                physicalNetworkName,
+                vlans,
+                routeTargets,
+                cloudSiteOpt.get());
+            String mode = networkResource.getOrchestrationMode();
+            NetworkType neutronNetworkType = NetworkType.valueOf(networkResource.getNeutronNetworkType());
+
+            if (NEUTRON_MODE.equals(mode)) {
 
                 // Use an MsoNeutronUtils for all neutron commands
-                MsoNeutronUtils neutron = new MsoNeutronUtils (MSO_PROP_NETWORK_ADAPTER, cloudConfigFactory);
+                MsoNeutronUtils neutron = new MsoNeutronUtils(MSO_PROP_NETWORK_ADAPTER, cloudConfigFactory);
 
                 // See if the Network already exists (by name)
                 NetworkInfo netInfo = null;
-                long queryNetworkStarttime = System.currentTimeMillis ();
+                long queryNetworkStarttime = System.currentTimeMillis();
                 try {
-                    netInfo = neutron.queryNetwork (networkName, tenantId, cloudSiteId);
-                    LOGGER.recordMetricEvent (queryNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Response successfully received from OpenStack", "OpenStack", "QueryNetwork", null);
+                    netInfo = neutron.queryNetwork(networkName, tenantId, cloudSiteId);
+                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Response successfully received from OpenStack", "OpenStack",
+                        "QueryNetwork", null);
                 } catch (MsoException me) {
-                    LOGGER.recordMetricEvent (queryNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while querying network from OpenStack", "OpenStack", "QueryNetwork", null);
-                    LOGGER.error (MessageEnum.RA_QUERY_NETWORK_EXC, networkName, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception while querying network from OpenStack", me);
-                    me.addContext (CREATE_NETWORK_CONTEXT);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while querying network from OpenStack");
-                    throw new NetworkException (me);
+                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, "Exception while querying network from OpenStack",
+                        "OpenStack", "QueryNetwork", null);
+                    LOGGER.error(MessageEnum.RA_QUERY_NETWORK_EXC, networkName, cloudSiteId, tenantId, "OpenStack", "",
+                        MsoLogger.ErrorCode.BusinessProcesssError, "Exception while querying network from OpenStack",
+                        me);
+                    me.addContext(CREATE_NETWORK_CONTEXT);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, "Exception while querying network from OpenStack");
+                    throw new NetworkException(me);
                 }
 
                 if (netInfo != null) {
@@ -328,49 +334,59 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
                     // Otherwise, return an exception.
                     if (failIfExists != null && failIfExists) {
                         String error = "Create Nework: Network " + networkName
-                                       + " already exists in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + " with ID " + netInfo.getId();
-                        LOGGER.error (MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Network already exists");
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
+                            + " already exists in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + " with ID " + netInfo.getId();
+                        LOGGER.error(MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId,
+                            "OpenStack", "", MsoLogger.ErrorCode.DataError, "Network already exists");
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict,
+                            error);
                         throw new NetworkException(error, MsoExceptionCategory.USERDATA);
                     } else {
                         // Populate the outputs from the existing network.
-                        networkId.value = netInfo.getId ();
-                        neutronNetworkId.value = netInfo.getId ();
+                        networkId.value = netInfo.getId();
+                        neutronNetworkId.value = netInfo.getId();
                         rollback.value = networkRollback; // Default rollback - no updates performed
-                        String msg = "Found Existing network, status=" + netInfo.getStatus () + " for Neutron mode";
-                        LOGGER.warn (MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "", "", MsoLogger.ErrorCode.DataError, "Found Existing network, status=" + netInfo.getStatus ());
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, msg);
+                        String msg = "Found Existing network, status=" + netInfo.getStatus() + " for Neutron mode";
+                        LOGGER.warn(MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "", "",
+                            MsoLogger.ErrorCode.DataError, "Found Existing network, status=" + netInfo.getStatus());
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
+                            msg);
                     }
                     return;
                 }
 
-                long createNetworkStarttime = System.currentTimeMillis ();
+                long createNetworkStarttime = System.currentTimeMillis();
                 try {
-                    netInfo = neutron.createNetwork (cloudSiteId,
-                                                     tenantId,
-                                                     neutronNetworkType,
-                                                     networkName,
-                                                     physicalNetworkName,
-                                                     vlans);
-                    LOGGER.recordMetricEvent (createNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Response successfully received from OpenStack", "OpenStack", "CreateNetwork", null);
+                    netInfo = neutron.createNetwork(cloudSiteId,
+                        tenantId,
+                        neutronNetworkType,
+                        networkName,
+                        physicalNetworkName,
+                        vlans);
+                    LOGGER.recordMetricEvent(createNetworkStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Response successfully received from OpenStack", "OpenStack",
+                        "CreateNetwork", null);
                 } catch (MsoException me) {
-                       me.addContext (CREATE_NETWORK_CONTEXT);
-                    LOGGER.recordMetricEvent (createNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with OpenStack", "OpenStack", "CreateNetwork", null);
-                       String error = "Create Network: type " + neutronNetworkType
-                                   + " in "
-                                   + cloudSiteId
-                                   + "/"
-                                   + tenantId
-                                   + ": "
-                                   + me;
-                    LOGGER.error (MessageEnum.RA_CREATE_NETWORK_EXC, networkName, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception while communicate with OpenStack", me);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-
-                    throw new NetworkException (me);
+                    me.addContext(CREATE_NETWORK_CONTEXT);
+                    LOGGER.recordMetricEvent(createNetworkStarttime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with OpenStack",
+                        "OpenStack", "CreateNetwork", null);
+                    String error = "Create Network: type " + neutronNetworkType
+                        + " in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId
+                        + ": "
+                        + me;
+                    LOGGER.error(MessageEnum.RA_CREATE_NETWORK_EXC, networkName, cloudSiteId, tenantId, "OpenStack", "",
+                        MsoLogger.ErrorCode.DataError, "Exception while communicate with OpenStack", me);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
+
+                    throw new NetworkException(me);
                 }
 
                 // Note: ignoring MsoNetworkAlreadyExists because we already checked.
@@ -378,263 +394,287 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
                 // If reach this point, network creation is successful.
                 // Since directly created via Neutron, networkId tracked by MSO is the same
                 // as the neutron network ID.
-                networkId.value = netInfo.getId ();
-                neutronNetworkId.value = netInfo.getId ();
+                networkId.value = netInfo.getId();
+                neutronNetworkId.value = netInfo.getId();
 
-                networkRollback.setNetworkCreated (true);
-                networkRollback.setNetworkId (netInfo.getId ());
-                networkRollback.setNeutronNetworkId (netInfo.getId ());
-                networkRollback.setNetworkType (networkType);
+                networkRollback.setNetworkCreated(true);
+                networkRollback.setNetworkId(netInfo.getId());
+                networkRollback.setNeutronNetworkId(netInfo.getId());
+                networkRollback.setNetworkType(networkType);
 
-                LOGGER.debug ("Network " + networkName + " created, id = " + netInfo.getId ());
-            } else if ("HEAT".equals (mode)) {
+                LOGGER.debug("Network " + networkName + " created, id = " + netInfo.getId());
+            } else if ("HEAT".equals(mode)) {
 
                 // Use an MsoHeatUtils for all Heat commands
-                MsoHeatUtils heat = new MsoHeatUtils (MSO_PROP_NETWORK_ADAPTER, msoPropertiesFactory,cloudConfigFactory);
+                MsoHeatUtils heat = new MsoHeatUtils(MSO_PROP_NETWORK_ADAPTER, msoPropertiesFactory,
+                    cloudConfigFactory);
 
                 //HeatTemplate heatTemplate = db.getHeatTemplate (networkResource.getTemplateId ());
-                HeatTemplate heatTemplate = db.getHeatTemplateByArtifactUuidRegularQuery (networkResource.getHeatTemplateArtifactUUID());
+                HeatTemplate heatTemplate = db
+                    .getHeatTemplateByArtifactUuidRegularQuery(networkResource.getHeatTemplateArtifactUUID());
                 if (heatTemplate == null) {
                     String error = "Network error - undefined Heat Template. Network Type = " + networkType;
-                    LOGGER.error (MessageEnum.RA_PARAM_NOT_FOUND, "Heat Template", "Network Type", networkType, "Openstack", "", MsoLogger.ErrorCode.DataError, "Network error - undefined Heat Template. Network Type = " + networkType);
-                    alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error); // Alarm on this
-                                                                                                     // error,
-                                                                                                     // configuration
-                                                                                                     // must be fixed
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
-                    throw new NetworkException (error, MsoExceptionCategory.INTERNAL);
+                    LOGGER.error(MessageEnum.RA_PARAM_NOT_FOUND, "Heat Template", "Network Type", networkType,
+                        "Openstack", "", MsoLogger.ErrorCode.DataError,
+                        "Network error - undefined Heat Template. Network Type = " + networkType);
+                    alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error); // Alarm on this
+                    // error,
+                    // configuration
+                    // must be fixed
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                        error);
+                    throw new NetworkException(error, MsoExceptionCategory.INTERNAL);
                 }
 
-                LOGGER.debug ("Got HEAT Template from DB: " + heatTemplate.toString ());
+                LOGGER.debug("Got HEAT Template from DB: " + heatTemplate.toString());
 
                 // "Fix" the template if it has CR/LF (getting this from Oracle)
-                String template = heatTemplate.getHeatTemplate ();
-                template = template.replaceAll ("\r\n", "\n");
+                String template = heatTemplate.getHeatTemplate();
+                template = template.replaceAll("\r\n", "\n");
 
-                boolean aic3template=false;
+                boolean aic3template = false;
                 String aic3nw = AIC3_NW;
                 try {
-                       aic3nw = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_NETWORK_ADAPTER).getProperty(AIC3_NW_PROPERTY, AIC3_NW);
-                       } catch (MsoPropertiesException e) {
-                               String error = "Unable to get properties:" + MSO_PROP_NETWORK_ADAPTER;
-                               LOGGER.error (MessageEnum.RA_CONFIG_EXC, error, "", "", MsoLogger.ErrorCode.DataError, "Exception - Unable to get properties", e);
-                       }
+                    aic3nw = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_NETWORK_ADAPTER)
+                        .getProperty(AIC3_NW_PROPERTY, AIC3_NW);
+                } catch (MsoPropertiesException e) {
+                    String error = "Unable to get properties:" + MSO_PROP_NETWORK_ADAPTER;
+                    LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "", "", MsoLogger.ErrorCode.DataError,
+                        "Exception - Unable to get properties", e);
+                }
 
                 if (template.contains(aic3nw))
-                       aic3template = true;
+                    aic3template = true;
 
                 // First, look up to see if the Network already exists (by name).
                 // For HEAT orchestration of networks, the stack name will always match the network name
                 StackInfo heatStack = null;
-                long queryNetworkStarttime = System.currentTimeMillis ();
+                long queryNetworkStarttime = System.currentTimeMillis();
                 try {
-                    heatStack = heat.queryStack (cloudSiteId, tenantId, networkName);
-                    LOGGER.recordMetricEvent (queryNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Response successfully received from OpenStack", "OpenStack", "QueryNetwork", null);
+                    heatStack = heat.queryStack(cloudSiteId, tenantId, networkName);
+                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Response successfully received from OpenStack", "OpenStack",
+                        "QueryNetwork", null);
                 } catch (MsoException me) {
-                    me.addContext (CREATE_NETWORK_CONTEXT);
-                    LOGGER.recordMetricEvent (queryNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while querying stack from OpenStack", "OpenStack", "QueryNetwork", null);
-                       String error = "Create Network (heat): query network " + networkName
-                                   + " in "
-                                   + cloudSiteId
-                                   + "/"
-                                   + tenantId
-                                   + ": "
-                                   + me;
-                    LOGGER.error (MessageEnum.RA_QUERY_NETWORK_EXC, networkName, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception while querying stack from OpenStack", me);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-                    throw new NetworkException (me);
+                    me.addContext(CREATE_NETWORK_CONTEXT);
+                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, "Exception while querying stack from OpenStack",
+                        "OpenStack", "QueryNetwork", null);
+                    String error = "Create Network (heat): query network " + networkName
+                        + " in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId
+                        + ": "
+                        + me;
+                    LOGGER.error(MessageEnum.RA_QUERY_NETWORK_EXC, networkName, cloudSiteId, tenantId, "OpenStack", "",
+                        MsoLogger.ErrorCode.DataError, "Exception while querying stack from OpenStack", me);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
+                    throw new NetworkException(me);
                 }
 
-                if (heatStack != null && (heatStack.getStatus () != HeatStatus.NOTFOUND)) {
+                if (heatStack != null && (heatStack.getStatus() != HeatStatus.NOTFOUND)) {
                     // Stack exists. Return success or error depending on input directive
                     if (failIfExists != null && failIfExists) {
                         String error = "CreateNetwork: Stack " + networkName
-                                       + " already exists in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + " as " + heatStack.getCanonicalName();
-                        LOGGER.error (MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "", "", MsoLogger.ErrorCode.DataError, "Network already exists");
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
+                            + " already exists in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + " as " + heatStack.getCanonicalName();
+                        LOGGER.error(MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "", "",
+                            MsoLogger.ErrorCode.DataError, "Network already exists");
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict,
+                            error);
                         throw new NetworkException(error, MsoExceptionCategory.USERDATA);
                     } else {
                         // Populate the outputs from the existing stack.
-                        networkId.value = heatStack.getCanonicalName ();
-                        neutronNetworkId.value = (String) heatStack.getOutputs ().get (NETWORK_ID);
+                        networkId.value = heatStack.getCanonicalName();
+                        neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID);
                         rollback.value = networkRollback; // Default rollback - no updates performed
-                        if (aic3template)
-                        {
-                               networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
+                        if (aic3template) {
+                            networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
                         }
-                        Map <String, Object> outputs = heatStack.getOutputs ();
-                        Map <String, String> sMap = new HashMap <> ();
+                        Map<String, Object> outputs = heatStack.getOutputs();
+                        Map<String, String> sMap = new HashMap<>();
                         if (outputs != null) {
-                               for (String key : outputs.keySet ()) {
-                                       if (key != null && key.startsWith ("subnet")) {
-                                               if (aic3template) //one subnet_id output
-                                               {
-                                                        Map <String, String> map = getSubnetUUId(key, outputs, subnets);
-                                                        sMap.putAll(map);
-                                               }
-                                               else //multiples subnet_%aaid% outputs
-                                               {
-                                                       String subnetUUId = (String) outputs.get(key);
-                                                       sMap.put (key.substring("subnet_id_".length()), subnetUUId);
-                                               }
-                                       }
-                               }
+                            for (String key : outputs.keySet()) {
+                                if (key != null && key.startsWith("subnet")) {
+                                    if (aic3template) //one subnet_id output
+                                    {
+                                        Map<String, String> map = getSubnetUUId(key, outputs, subnets);
+                                        sMap.putAll(map);
+                                    } else //multiples subnet_%aaid% outputs
+                                    {
+                                        String subnetUUId = (String) outputs.get(key);
+                                        sMap.put(key.substring("subnet_id_".length()), subnetUUId);
+                                    }
+                                }
+                            }
                         }
                         subnetIdMap.value = sMap;
-                        LOGGER.warn (MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "", "", MsoLogger.ErrorCode.DataError, "Found Existing network stack, status=" + heatStack.getStatus ());
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Suc, "Found Existing network stack");
+                        LOGGER.warn(MessageEnum.RA_NETWORK_ALREADY_EXIST, networkName, cloudSiteId, tenantId, "", "",
+                            MsoLogger.ErrorCode.DataError,
+                            "Found Existing network stack, status=" + heatStack.getStatus());
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Suc,
+                            "Found Existing network stack");
                     }
                     return;
                 }
 
                 // Ready to deploy the new Network
                 // Build the common set of HEAT template parameters
-                Map <String, Object> stackParams = populateNetworkParams (neutronNetworkType,
-                                                                          networkName,
-                                                                          physicalNetworkName,
-                                                                          vlans,
-                                                                          routeTargets,
-                                                                          shared,
-                                                                          external,
-                                                                          aic3template);
+                Map<String, Object> stackParams = populateNetworkParams(neutronNetworkType,
+                    networkName,
+                    physicalNetworkName,
+                    vlans,
+                    routeTargets,
+                    shared,
+                    external,
+                    aic3template);
 
                 // Validate (and update) the input parameters against the DB definition
                 // Shouldn't happen unless DB config is wrong, since all networks use same inputs
                 // and inputs were already validated.
                 try {
-                    stackParams = heat.validateStackParams (stackParams, heatTemplate);
+                    stackParams = heat.validateStackParams(stackParams, heatTemplate);
                 } catch (IllegalArgumentException e) {
-                    String error = "Create Network: Configuration Error: " + e.getMessage ();
-                    LOGGER.error (MessageEnum.RA_CONFIG_EXC, e.getMessage(), "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception - Create Network, Configuration Error", e);
-                    alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error); // Alarm on this
-                                                                                                     // error,
-                                                                                                     // configuration
-                                                                                                     // must be fixed
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataError, error);
+                    String error = "Create Network: Configuration Error: " + e.getMessage();
+                    LOGGER.error(MessageEnum.RA_CONFIG_EXC, e.getMessage(), "Openstack", "",
+                        MsoLogger.ErrorCode.DataError, "Exception - Create Network, Configuration Error", e);
+                    alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error); // Alarm on this
+                    // error,
+                    // configuration
+                    // must be fixed
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataError,
+                        error);
                     // Input parameters were not valid
-                    throw new NetworkException (error, MsoExceptionCategory.INTERNAL);
+                    throw new NetworkException(error, MsoExceptionCategory.INTERNAL);
                 }
 
                 if (subnets != null) {
-                       try {
-                               if (aic3template)
-                               {
-                                       template = mergeSubnetsAIC3 (template, subnets, stackParams);
-                               }
-                               else
-                               {
-                                       template = mergeSubnets (template, subnets);
-                               }
-                       } catch (MsoException me) {
-                               me.addContext (CREATE_NETWORK_CONTEXT);
-                               String error = "Create Network (heat): type " + neutronNetworkType
-                                               + " in "
-                                               + cloudSiteId
-                                               + "/"
-                                               + tenantId
-                                               + ": "
-                                               + me;
-                               LOGGER.error (MessageEnum.RA_CREATE_NETWORK_EXC, neutronNetworkType.toString(), cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception Create Network, merging subnets", me);
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
-                               throw new NetworkException (me);
-                       }
+                    try {
+                        if (aic3template) {
+                            template = mergeSubnetsAIC3(template, subnets, stackParams);
+                        } else {
+                            template = mergeSubnets(template, subnets);
+                        }
+                    } catch (MsoException me) {
+                        me.addContext(CREATE_NETWORK_CONTEXT);
+                        String error = "Create Network (heat): type " + neutronNetworkType
+                            + " in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + ": "
+                            + me;
+                        LOGGER.error(MessageEnum.RA_CREATE_NETWORK_EXC, neutronNetworkType.toString(), cloudSiteId,
+                            tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError,
+                            "Exception Create Network, merging subnets", me);
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.InternalError, error);
+                        throw new NetworkException(me);
+                    }
                 }
 
                 if (policyFqdns != null && !policyFqdns.isEmpty() && aic3template) {
                     try {
-                        mergePolicyRefs (policyFqdns, stackParams);
+                        mergePolicyRefs(policyFqdns, stackParams);
                     } catch (MsoException me) {
-                        me.addContext (CREATE_NETWORK_CONTEXT);
-                       String error = "Create Network (heat) mergePolicyRefs type " + neutronNetworkType
-                                       + " in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + ": "
-                                       + me;
-                        LOGGER.error (MessageEnum.RA_CREATE_NETWORK_EXC, neutronNetworkType.toString(), cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception Create Network, merging policyRefs", me);
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
-                        throw new NetworkException (me);
+                        me.addContext(CREATE_NETWORK_CONTEXT);
+                        String error = "Create Network (heat) mergePolicyRefs type " + neutronNetworkType
+                            + " in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + ": "
+                            + me;
+                        LOGGER.error(MessageEnum.RA_CREATE_NETWORK_EXC, neutronNetworkType.toString(), cloudSiteId,
+                            tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError,
+                            "Exception Create Network, merging policyRefs", me);
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.InternalError, error);
+                        throw new NetworkException(me);
                     }
                 }
 
                 if (routeTableFqdns != null && !routeTableFqdns.isEmpty() && aic3template) {
                     try {
-                        mergeRouteTableRefs (routeTableFqdns, stackParams);
+                        mergeRouteTableRefs(routeTableFqdns, stackParams);
                     } catch (MsoException me) {
-                        me.addContext (CREATE_NETWORK_CONTEXT);
-                       String error = "Create Network (heat) mergeRouteTableRefs type " + neutronNetworkType
-                                       + " in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + ": "
-                                       + me;
-                        LOGGER.error (MessageEnum.RA_CREATE_NETWORK_EXC, neutronNetworkType.toString(), cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception Create Network, merging routeTableRefs", me);
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
-                        throw new NetworkException (me);
+                        me.addContext(CREATE_NETWORK_CONTEXT);
+                        String error = "Create Network (heat) mergeRouteTableRefs type " + neutronNetworkType
+                            + " in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + ": "
+                            + me;
+                        LOGGER.error(MessageEnum.RA_CREATE_NETWORK_EXC, neutronNetworkType.toString(), cloudSiteId,
+                            tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError,
+                            "Exception Create Network, merging routeTableRefs", me);
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.InternalError, error);
+                        throw new NetworkException(me);
                     }
                 }
 
                 // Deploy the network stack
                 // Ignore MsoStackAlreadyExists exception because we already checked.
                 try {
-                       if (backout == null)
-                               backout = true;
-                    heatStack = heat.createStack (cloudSiteId,
-                                                  tenantId,
-                                                  networkName,
-                                                  template,
-                                                  stackParams,
-                                                  true,
-                                                  heatTemplate.getTimeoutMinutes (),
-                                                  null,
-                                                  null,
-                                                  null,
-                                                  backout.booleanValue());
+                    if (backout == null)
+                        backout = true;
+                    heatStack = heat.createStack(cloudSiteId,
+                        tenantId,
+                        networkName,
+                        template,
+                        stackParams,
+                        true,
+                        heatTemplate.getTimeoutMinutes(),
+                        null,
+                        null,
+                        null,
+                        backout.booleanValue());
                 } catch (MsoException me) {
-                    me.addContext (CREATE_NETWORK_CONTEXT);
-                       String error = "Create Network (heat): type " + neutronNetworkType
-                                   + " in "
-                                   + cloudSiteId
-                                   + "/"
-                                   + tenantId
-                                   + ": "
-                                   + me;
-                    LOGGER.error (MessageEnum.RA_CREATE_NETWORK_EXC, networkName, cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception creating network", me);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-                    throw new NetworkException (me);
+                    me.addContext(CREATE_NETWORK_CONTEXT);
+                    String error = "Create Network (heat): type " + neutronNetworkType
+                        + " in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId
+                        + ": "
+                        + me;
+                    LOGGER.error(MessageEnum.RA_CREATE_NETWORK_EXC, networkName, cloudSiteId, tenantId, "Openstack", "",
+                        MsoLogger.ErrorCode.DataError, "Exception creating network", me);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
+                    throw new NetworkException(me);
                 }
 
                 // Reach this point if createStack is successful.
 
                 // For Heat-based orchestration, the MSO-tracked network ID is the heat stack,
                 // and the neutronNetworkId is the network UUID returned in stack outputs.
-                networkId.value = heatStack.getCanonicalName ();
-                neutronNetworkId.value = (String) heatStack.getOutputs ().get (NETWORK_ID);
-                if (aic3template)
-                {
-                       networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
+                networkId.value = heatStack.getCanonicalName();
+                neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID);
+                if (aic3template) {
+                    networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
                 }
-                Map <String, Object> outputs = heatStack.getOutputs ();
-                Map <String, String> sMap = new HashMap <> ();
+                Map<String, Object> outputs = heatStack.getOutputs();
+                Map<String, String> sMap = new HashMap<>();
                 if (outputs != null) {
-                    for (String key : outputs.keySet ()) {
-                        if (key != null && key.startsWith ("subnet")) {
-                               if (aic3template) //one subnet output expected
-                                       {
-                                                Map <String, String> map = getSubnetUUId(key, outputs, subnets);
-                                                sMap.putAll(map);
-                                       }
-                                       else //multiples subnet_%aaid% outputs allowed
-                                       {
-                                               String subnetUUId = (String) outputs.get(key);
-                                               sMap.put (key.substring("subnet_id_".length()), subnetUUId);
-                                       }
+                    for (String key : outputs.keySet()) {
+                        if (key != null && key.startsWith("subnet")) {
+                            if (aic3template) //one subnet output expected
+                            {
+                                Map<String, String> map = getSubnetUUId(key, outputs, subnets);
+                                sMap.putAll(map);
+                            } else //multiples subnet_%aaid% outputs allowed
+                            {
+                                String subnetUUId = (String) outputs.get(key);
+                                sMap.put(key.substring("subnet_id_".length()), subnetUUId);
+                            }
                         }
                     }
                 }
@@ -642,15 +682,13 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
 
                 rollback.value = networkRollback;
                 // Populate remaining rollback info and response parameters.
-                networkRollback.setNetworkStackId (heatStack.getCanonicalName ());
-                networkRollback.setNeutronNetworkId ((String) heatStack.getOutputs ().get (NETWORK_ID));
-                networkRollback.setNetworkCreated (true);
-                networkRollback.setNetworkType (networkType);
+                networkRollback.setNetworkStackId(heatStack.getCanonicalName());
+                networkRollback.setNeutronNetworkId((String) heatStack.getOutputs().get(NETWORK_ID));
+                networkRollback.setNetworkCreated(true);
+                networkRollback.setNetworkType(networkType);
 
-                LOGGER.debug ("Network " + networkName + " successfully created via HEAT");
+                LOGGER.debug("Network " + networkName + " successfully created via HEAT");
             }
-        } finally {
-            db.close ();
         }
         LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Suc, "Successfully created network");
         return;
@@ -803,19 +841,18 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
         }
 
         // Get a handle to the Catalog Database
-        CatalogDatabase db = getCatalogDB ();
 
         // Make sure DB connection is always closed
-        try {
+        try (CatalogDatabase db = getCatalogDB()) {
             NetworkResource networkResource = networkCheck(db,
-                    startTime,
-                    networkType,
-                    modelCustomizationUuid,
-                    networkName,
-                    physicalNetworkName,
-                    vlans,
-                    routeTargets,
-                    cloudSiteOpt.get());
+                startTime,
+                networkType,
+                modelCustomizationUuid,
+                networkName,
+                physicalNetworkName,
+                vlans,
+                routeTargets,
+                cloudSiteOpt.get());
             String mode = networkResource.getOrchestrationMode();
             NetworkType neutronNetworkType = NetworkType.valueOf(networkResource.getNeutronNetworkType());
 
@@ -830,54 +867,66 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
                 long queryNetworkStarttime = System.currentTimeMillis();
                 try {
                     netInfo = neutron.queryNetwork(networkId, tenantId, cloudSiteId);
-                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "QueryNetwork", null);
+                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack",
+                        "QueryNetwork", null);
                 } catch (MsoException me) {
                     me.addContext(UPDATE_NETWORK_CONTEXT);
                     String error = "Update Network (neutron): query " + networkId
-                            + " in "
-                            + cloudSiteId
-                            + "/"
-                            + tenantId
-                            + ": "
-                            + me;
-                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryNetwork", null);
-                    LOGGER.error(MessageEnum.RA_QUERY_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack", "QueryNetwork", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - queryNetwork", me);
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                        + " in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId
+                        + ": "
+                        + me;
+                    LOGGER.recordMetricEvent(queryNetworkStarttime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryNetwork", null);
+                    LOGGER.error(MessageEnum.RA_QUERY_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack",
+                        "QueryNetwork", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - queryNetwork", me);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
                     throw new NetworkException(me);
                 }
 
                 if (netInfo == null) {
                     String error = "Update Nework: Network " + networkId
-                            + " does not exist in "
-                            + cloudSiteId
-                            + "/"
-                            + tenantId;
-                    LOGGER.error(MessageEnum.RA_NETWORK_NOT_FOUND, networkId, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Network not found");
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
+                        + " does not exist in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId;
+                    LOGGER.error(MessageEnum.RA_NETWORK_NOT_FOUND, networkId, cloudSiteId, tenantId, "OpenStack", "",
+                        MsoLogger.ErrorCode.BusinessProcesssError, "Network not found");
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest,
+                        error);
                     // Does not exist. Throw an exception (can't update a non-existent network)
                     throw new NetworkException(error, MsoExceptionCategory.USERDATA);
                 }
                 long updateNetworkStarttime = System.currentTimeMillis();
                 try {
                     netInfo = neutron.updateNetwork(cloudSiteId,
-                            tenantId,
-                            networkId,
-                            neutronNetworkType,
-                            physicalNetworkName,
-                            vlans);
-                    LOGGER.recordMetricEvent(updateNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "UpdateNetwork", null);
+                        tenantId,
+                        networkId,
+                        neutronNetworkType,
+                        physicalNetworkName,
+                        vlans);
+                    LOGGER.recordMetricEvent(updateNetworkStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack",
+                        "UpdateNetwork", null);
                 } catch (MsoException me) {
                     me.addContext(UPDATE_NETWORK_CONTEXT);
                     String error = "Update Network (neutron): " + networkId
-                            + " in "
-                            + cloudSiteId
-                            + "/"
-                            + tenantId
-                            + ": "
-                            + me;
-                    LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, networkId, cloudSiteId, tenantId, "Openstack", "updateNetwork", MsoLogger.ErrorCode.DataError, "Exception - updateNetwork", me);
-                    LOGGER.recordMetricEvent(updateNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "UpdateNetwork", null);
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                        + " in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId
+                        + ": "
+                        + me;
+                    LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, networkId, cloudSiteId, tenantId, "Openstack",
+                        "updateNetwork", MsoLogger.ErrorCode.DataError, "Exception - updateNetwork", me);
+                    LOGGER.recordMetricEvent(updateNetworkStarttime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "UpdateNetwork", null);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
                     throw new NetworkException(me);
                 }
 
@@ -894,7 +943,8 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
             } else if ("HEAT".equals(mode)) {
 
                 // Use an MsoHeatUtils for all Heat commands
-                MsoHeatUtilsWithUpdate heat = new MsoHeatUtilsWithUpdate(MSO_PROP_NETWORK_ADAPTER, msoPropertiesFactory, cloudConfigFactory);
+                MsoHeatUtilsWithUpdate heat = new MsoHeatUtilsWithUpdate(MSO_PROP_NETWORK_ADAPTER, msoPropertiesFactory,
+                    cloudConfigFactory);
 
                 // First, look up to see that the Network already exists.
                 // For Heat-based orchestration, the networkId is the network Stack ID.
@@ -902,30 +952,37 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
                 long queryStackStarttime = System.currentTimeMillis();
                 try {
                     heatStack = heat.queryStack(cloudSiteId, tenantId, networkName);
-                    LOGGER.recordMetricEvent(queryStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "QueryStack", null);
+                    LOGGER.recordMetricEvent(queryStackStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack",
+                        "QueryStack", null);
                 } catch (MsoException me) {
                     me.addContext(UPDATE_NETWORK_CONTEXT);
                     String error = "UpdateNetwork (heat): query " + networkName
-                            + " in "
-                            + cloudSiteId
-                            + "/"
-                            + tenantId
-                            + ": "
-                            + me;
-                    LOGGER.recordMetricEvent(queryStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryStack", null);
-                    LOGGER.error(MessageEnum.RA_QUERY_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.DataError, "Exception - QueryStack", me);
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                        + " in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId
+                        + ": "
+                        + me;
+                    LOGGER.recordMetricEvent(queryStackStarttime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryStack", null);
+                    LOGGER.error(MessageEnum.RA_QUERY_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack",
+                        "queryStack", MsoLogger.ErrorCode.DataError, "Exception - QueryStack", me);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
                     throw new NetworkException(me);
                 }
 
                 if (heatStack == null || (heatStack.getStatus() == HeatStatus.NOTFOUND)) {
                     String error = "UpdateNetwork: Stack " + networkName
-                            + " does not exist in "
-                            + cloudSiteId
-                            + "/"
-                            + tenantId;
-                    LOGGER.error(MessageEnum.RA_NETWORK_NOT_FOUND, networkId, cloudSiteId, tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.DataError, "Network not found");
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
+                        + " does not exist in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId;
+                    LOGGER.error(MessageEnum.RA_NETWORK_NOT_FOUND, networkId, cloudSiteId, tenantId, "OpenStack",
+                        "queryStack", MsoLogger.ErrorCode.DataError, "Network not found");
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest,
+                        error);
                     // Network stack does not exist. Return an error
                     throw new NetworkException(error, MsoExceptionCategory.USERDATA);
                 }
@@ -943,7 +1000,8 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
                         try {
                             previousVlans.add(Integer.parseInt(vlan));
                         } catch (NumberFormatException e) {
-                            LOGGER.warn(MessageEnum.RA_VLAN_PARSE, networkId, vlansParam, "", "", MsoLogger.ErrorCode.DataError, "Exception - VLAN parse", e);
+                            LOGGER.warn(MessageEnum.RA_VLAN_PARSE, networkId, vlansParam, "", "",
+                                MsoLogger.ErrorCode.DataError, "Exception - VLAN parse", e);
                         }
                     }
                 }
@@ -952,12 +1010,16 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
                 // Ready to deploy the updated Network via Heat
 
                 //HeatTemplate heatTemplate = db.getHeatTemplate (networkResource.getTemplateId ());
-                HeatTemplate heatTemplate = db.getHeatTemplateByArtifactUuidRegularQuery (networkResource.getHeatTemplateArtifactUUID());
+                HeatTemplate heatTemplate = db
+                    .getHeatTemplateByArtifactUuidRegularQuery(networkResource.getHeatTemplateArtifactUUID());
                 if (heatTemplate == null) {
                     String error = "Network error - undefined Heat Template. Network Type=" + networkType;
-                    LOGGER.error(MessageEnum.RA_PARAM_NOT_FOUND, "Heat Template", "Network Type", networkType, "OpenStack", "getHeatTemplate", MsoLogger.ErrorCode.DataError, "Network error - undefined Heat Template. Network Type=" + networkType);
+                    LOGGER.error(MessageEnum.RA_PARAM_NOT_FOUND, "Heat Template", "Network Type", networkType,
+                        "OpenStack", "getHeatTemplate", MsoLogger.ErrorCode.DataError,
+                        "Network error - undefined Heat Template. Network Type=" + networkType);
                     alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest,
+                        error);
                     throw new NetworkException(error, MsoExceptionCategory.INTERNAL);
                 }
 
@@ -970,23 +1032,25 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
                 boolean aic3template = false;
                 String aic3nw = AIC3_NW;
                 try {
-                    aic3nw = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_NETWORK_ADAPTER).getProperty(AIC3_NW_PROPERTY, AIC3_NW);
+                    aic3nw = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_NETWORK_ADAPTER)
+                        .getProperty(AIC3_NW_PROPERTY, AIC3_NW);
                 } catch (MsoPropertiesException e) {
                     String error = "Unable to get properties:" + MSO_PROP_NETWORK_ADAPTER;
-                    LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - Unable to get properties", e);
+                    LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "", MsoLogger.ErrorCode.DataError,
+                        "Exception - Unable to get properties", e);
                 }
                 if (template.contains(aic3nw))
                     aic3template = true;
 
                 // Build the common set of HEAT template parameters
                 Map<String, Object> stackParams = populateNetworkParams(neutronNetworkType,
-                        networkName,
-                        physicalNetworkName,
-                        vlans,
-                        routeTargets,
-                        shared,
-                        external,
-                        aic3template);
+                    networkName,
+                    physicalNetworkName,
+                    vlans,
+                    routeTargets,
+                    shared,
+                    external,
+                    aic3template);
 
                 // Validate (and update) the input parameters against the DB definition
                 // Shouldn't happen unless DB config is wrong, since all networks use same inputs
@@ -994,9 +1058,11 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
                     stackParams = heat.validateStackParams(stackParams, heatTemplate);
                 } catch (IllegalArgumentException e) {
                     String error = "UpdateNetwork: Configuration Error: Network Type=" + networkType;
-                    LOGGER.error(MessageEnum.RA_CONFIG_EXC, "Network Type=" + networkType, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - UpdateNetwork: Configuration Error");
+                    LOGGER.error(MessageEnum.RA_CONFIG_EXC, "Network Type=" + networkType, "OpenStack", "",
+                        MsoLogger.ErrorCode.DataError, "Exception - UpdateNetwork: Configuration Error");
                     alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError, error);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,
+                        error);
                     throw new NetworkException(error, MsoExceptionCategory.INTERNAL, e);
                 }
 
@@ -1010,14 +1076,17 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
                     } catch (MsoException me) {
                         me.addContext(UPDATE_NETWORK_CONTEXT);
                         String error = "Update Network (heat): type " + neutronNetworkType
-                                + " in "
-                                + cloudSiteId
-                                + "/"
-                                + tenantId
-                                + ": "
-                                + me;
-                        LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, neutronNetworkType.toString(), cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - UpdateNetwork mergeSubnets ", me);
-                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
+                            + " in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + ": "
+                            + me;
+                        LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, neutronNetworkType.toString(), cloudSiteId,
+                            tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError,
+                            "Exception - UpdateNetwork mergeSubnets ", me);
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.InternalError, error);
                         throw new NetworkException(me);
                     }
                 }
@@ -1028,14 +1097,17 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
                     } catch (MsoException me) {
                         me.addContext(UPDATE_NETWORK_CONTEXT);
                         String error = "UpdateNetwork (heat) mergePolicyRefs type " + neutronNetworkType
-                                + " in "
-                                + cloudSiteId
-                                + "/"
-                                + tenantId
-                                + ": "
-                                + me;
-                        LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, neutronNetworkType.toString(), cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - UpdateNetwork mergePolicyRefs", me);
-                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
+                            + " in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + ": "
+                            + me;
+                        LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, neutronNetworkType.toString(), cloudSiteId,
+                            tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError,
+                            "Exception - UpdateNetwork mergePolicyRefs", me);
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.InternalError, error);
                         throw new NetworkException(me);
                     }
                 }
@@ -1046,14 +1118,17 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
                     } catch (MsoException me) {
                         me.addContext(UPDATE_NETWORK_CONTEXT);
                         String error = "UpdateNetwork (heat) mergeRouteTableRefs type " + neutronNetworkType
-                                + " in "
-                                + cloudSiteId
-                                + "/"
-                                + tenantId
-                                + ": "
-                                + me;
-                        LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, neutronNetworkType.toString(), cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Exception - UpdateNetwork mergeRouteTableRefs", me);
-                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
+                            + " in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + ": "
+                            + me;
+                        LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, neutronNetworkType.toString(), cloudSiteId,
+                            tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError,
+                            "Exception - UpdateNetwork mergeRouteTableRefs", me);
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.InternalError, error);
                         throw new NetworkException(me);
                     }
                 }
@@ -1063,19 +1138,24 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
                 long updateStackStarttime = System.currentTimeMillis();
                 try {
                     heatStack = heat.updateStack(cloudSiteId,
-                            tenantId,
-                            networkId,
-                            template,
-                            stackParams,
-                            true,
-                            heatTemplate.getTimeoutMinutes());
-                    LOGGER.recordMetricEvent(updateStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "UpdateStack", null);
+                        tenantId,
+                        networkId,
+                        template,
+                        stackParams,
+                        true,
+                        heatTemplate.getTimeoutMinutes());
+                    LOGGER.recordMetricEvent(updateStackStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack",
+                        "UpdateStack", null);
                 } catch (MsoException me) {
                     me.addContext(UPDATE_NETWORK_CONTEXT);
                     String error = "Update Network: " + networkId + " in " + cloudSiteId + "/" + tenantId + ": " + me;
-                    LOGGER.recordMetricEvent(updateStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "UpdateStack", null);
-                    LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, networkId, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - update network", me);
-                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                    LOGGER.recordMetricEvent(updateStackStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "UpdateStack", null);
+                    LOGGER.error(MessageEnum.RA_UPDATE_NETWORK_ERR, networkId, cloudSiteId, tenantId, "OpenStack", "",
+                        MsoLogger.ErrorCode.DataError, "Exception - update network", me);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
                     throw new NetworkException(me);
                 }
 
@@ -1101,10 +1181,9 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
                 // Reach this point if createStack is successful.
                 // Populate remaining rollback info and response parameters.
                 networkRollback.setNetworkStackId(heatStack.getCanonicalName());
-                if(null != outputs) {
+                if (null != outputs) {
                     networkRollback.setNeutronNetworkId((String) outputs.get(NETWORK_ID));
-                }
-                else {
+                } else {
                     LOGGER.debug("outputs is NULL");
                 }
                 networkRollback.setNetworkType(networkType);
@@ -1117,8 +1196,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
 
                 LOGGER.debug("Network " + networkId + " successfully updated via HEAT");
             }
-        } finally {
-            db.close ();
         }
         LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully updated network");
         return;
@@ -1472,97 +1549,102 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
         long startTime = System.currentTimeMillis ();
 
         // Get a handle to the Catalog Database
-        CatalogDatabase db = getCatalogDB ();
 
         // Make sure DB connection is always closed
-        try {
-            if (isNullOrEmpty (cloudSiteId)
-                            || isNullOrEmpty(tenantId)
-                            || isNullOrEmpty(networkId)) {
+        try (CatalogDatabase db = getCatalogDB()) {
+            if (isNullOrEmpty(cloudSiteId)
+                || isNullOrEmpty(tenantId)
+                || isNullOrEmpty(networkId)) {
                 String error = "Missing mandatory parameter cloudSiteId, tenantId or networkId";
-                LOGGER.error (MessageEnum.RA_MISSING_PARAM, "cloudSiteId or tenantId or networkId", "Openstack", "", MsoLogger.ErrorCode.DataError, "Missing mandatory parameter cloudSiteId, tenantId or networkId");
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
-                throw new NetworkException (error, MsoExceptionCategory.USERDATA);
+                LOGGER.error(MessageEnum.RA_MISSING_PARAM, "cloudSiteId or tenantId or networkId", "Openstack", "",
+                    MsoLogger.ErrorCode.DataError, "Missing mandatory parameter cloudSiteId, tenantId or networkId");
+                LOGGER
+                    .recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
+                throw new NetworkException(error, MsoExceptionCategory.USERDATA);
             }
 
             // Retrieve the Network Resource definition
             NetworkResource networkResource = null;
             if (isNullOrEmpty(modelCustomizationUuid)) {
-                networkResource = db.getNetworkResource (networkType);
-            }
-            else if (!isNullOrEmpty(networkType))
-            {
+                networkResource = db.getNetworkResource(networkType);
+            } else if (!isNullOrEmpty(networkType)) {
                 networkResource = db.getNetworkResourceByModelCustUuid(modelCustomizationUuid);
             }
             String mode = "";
             if (networkResource != null) {
-                LOGGER.debug ("Got Network definition from Catalog: " + networkResource.toString ());
+                LOGGER.debug("Got Network definition from Catalog: " + networkResource.toString());
 
-                mode = networkResource.getOrchestrationMode ();
+                mode = networkResource.getOrchestrationMode();
             }
 
-            if (NEUTRON_MODE.equals (mode)) {
+            if (NEUTRON_MODE.equals(mode)) {
 
                 // Use MsoNeutronUtils for all NEUTRON commands
-                MsoNeutronUtils neutron = new MsoNeutronUtils (MSO_PROP_NETWORK_ADAPTER, cloudConfigFactory);
-                long deleteNetworkStarttime = System.currentTimeMillis ();
+                MsoNeutronUtils neutron = new MsoNeutronUtils(MSO_PROP_NETWORK_ADAPTER, cloudConfigFactory);
+                long deleteNetworkStarttime = System.currentTimeMillis();
                 try {
                     // The deleteNetwork function in MsoNeutronUtils returns success if the network
                     // was not found. So don't bother to query first.
-                    boolean deleted = neutron.deleteNetwork (networkId, tenantId, cloudSiteId);
-                    LOGGER.recordMetricEvent (deleteNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "DeleteNetwork", null);
+                    boolean deleted = neutron.deleteNetwork(networkId, tenantId, cloudSiteId);
+                    LOGGER.recordMetricEvent(deleteNetworkStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack",
+                        "DeleteNetwork", null);
                     networkDeleted.value = deleted;
                 } catch (MsoException me) {
-                    me.addContext ("DeleteNetwork");
-                       String error = "Delete Network (neutron): " + networkId
-                                   + " in "
-                                   + cloudSiteId
-                                   + "/"
-                                   + tenantId
-                                   + ": "
-                                   + me;
-                    LOGGER.recordMetricEvent (deleteNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteNetwork", null);
-                    LOGGER.error (MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Delete Network (neutron)", me);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-                    throw new NetworkException (me);
+                    me.addContext("DeleteNetwork");
+                    String error = "Delete Network (neutron): " + networkId
+                        + " in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId
+                        + ": "
+                        + me;
+                    LOGGER.recordMetricEvent(deleteNetworkStarttime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteNetwork", null);
+                    LOGGER.error(MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "Openstack", "",
+                        MsoLogger.ErrorCode.DataError, "Delete Network (neutron)", me);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
+                    throw new NetworkException(me);
                 }
             } else { // DEFAULT to ("HEAT".equals (mode))
-                long deleteStackStarttime = System.currentTimeMillis ();
+                long deleteStackStarttime = System.currentTimeMillis();
                 // Use MsoHeatUtils for all HEAT commands
-                MsoHeatUtils heat = new MsoHeatUtils (MSO_PROP_NETWORK_ADAPTER, msoPropertiesFactory,cloudConfigFactory);
+                MsoHeatUtils heat = new MsoHeatUtils(MSO_PROP_NETWORK_ADAPTER, msoPropertiesFactory,
+                    cloudConfigFactory);
 
                 try {
                     // The deleteStack function in MsoHeatUtils returns NOTFOUND if the stack was not found or if the stack was deleted.
                     //  So query first to report back if stack WAS deleted or just NOTOFUND
-                       StackInfo heatStack = null;
-                       heatStack = heat.queryStack(cloudSiteId, tenantId, networkId);
-                       if (heatStack != null && heatStack.getStatus() != HeatStatus.NOTFOUND)
-                       {
-                               heat.deleteStack (tenantId, cloudSiteId, networkId, true);
-                               LOGGER.recordMetricEvent (deleteStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "DeleteStack", null);
-                               networkDeleted.value = true;
-                       }
-                       else
-                       {
-                               networkDeleted.value = false;
-                       }
+                    StackInfo heatStack = null;
+                    heatStack = heat.queryStack(cloudSiteId, tenantId, networkId);
+                    if (heatStack != null && heatStack.getStatus() != HeatStatus.NOTFOUND) {
+                        heat.deleteStack(tenantId, cloudSiteId, networkId, true);
+                        LOGGER.recordMetricEvent(deleteStackStarttime, MsoLogger.StatusCode.COMPLETE,
+                            MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack",
+                            "DeleteStack", null);
+                        networkDeleted.value = true;
+                    } else {
+                        networkDeleted.value = false;
+                    }
                 } catch (MsoException me) {
-                    me.addContext ("DeleteNetwork");
-                       String error = "Delete Network (heat): " + networkId
-                                   + " in "
-                                   + cloudSiteId
-                                   + "/"
-                                   + tenantId
-                                   + ": "
-                                   + me;
-                    LOGGER.recordMetricEvent (deleteStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteStack", null);
-                    LOGGER.error (MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "Openstack", "", MsoLogger.ErrorCode.DataError, "Delete Network (heat)", me);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-                    throw new NetworkException (me);
+                    me.addContext("DeleteNetwork");
+                    String error = "Delete Network (heat): " + networkId
+                        + " in "
+                        + cloudSiteId
+                        + "/"
+                        + tenantId
+                        + ": "
+                        + me;
+                    LOGGER.recordMetricEvent(deleteStackStarttime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteStack", null);
+                    LOGGER.error(MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "Openstack", "",
+                        MsoLogger.ErrorCode.DataError, "Delete Network (heat)", me);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                        MsoLogger.ResponseCode.CommunicationError, error);
+                    throw new NetworkException(me);
                 }
             }
-        } finally {
-            db.close ();
         }
 
         // On success, nothing is returned.
@@ -1608,80 +1690,89 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
 
         // rollback may be null (e.g. if network already existed when Create was called)
         // Get a handle to the Catalog Database
-        CatalogDatabase db = getCatalogDB ();
 
         // Make sure DB connection is always closed
-        try {
+        try (CatalogDatabase db = getCatalogDB()) {
 
             // Retrieve the Network Resource definition
             NetworkResource networkResource = null;
             if (isNullOrEmpty(modelCustomizationUuid)) {
-                networkResource = db.getNetworkResource (networkType);
-            }
-            else
-            {
+                networkResource = db.getNetworkResource(networkType);
+            } else {
                 networkResource = db.getNetworkResourceByModelCustUuid(modelCustomizationUuid);
             }
             String mode = "";
             if (networkResource != null) {
 
-                LOGGER.debug ("Got Network definition from Catalog: " + networkResource.toString ());
+                LOGGER.debug("Got Network definition from Catalog: " + networkResource.toString());
 
-                mode = networkResource.getOrchestrationMode ();
+                mode = networkResource.getOrchestrationMode();
             }
 
-            if (rollback.getNetworkCreated ()) {
+            if (rollback.getNetworkCreated()) {
                 // Rolling back a newly created network, so delete it.
-                if (NEUTRON_MODE.equals (mode)) {
+                if (NEUTRON_MODE.equals(mode)) {
                     // Use MsoNeutronUtils for all NEUTRON commands
-                    MsoNeutronUtils neutron = new MsoNeutronUtils (MSO_PROP_NETWORK_ADAPTER, cloudConfigFactory);
-                    long deleteNetworkStarttime = System.currentTimeMillis ();
+                    MsoNeutronUtils neutron = new MsoNeutronUtils(MSO_PROP_NETWORK_ADAPTER, cloudConfigFactory);
+                    long deleteNetworkStarttime = System.currentTimeMillis();
                     try {
                         // The deleteNetwork function in MsoNeutronUtils returns success if the network
                         // was not found. So don't bother to query first.
-                        neutron.deleteNetwork (networkId, tenantId, cloudSiteId);
-                        LOGGER.recordMetricEvent (deleteNetworkStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "DeleteNetwork", null);
+                        neutron.deleteNetwork(networkId, tenantId, cloudSiteId);
+                        LOGGER.recordMetricEvent(deleteNetworkStarttime, MsoLogger.StatusCode.COMPLETE,
+                            MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack",
+                            "DeleteNetwork", null);
                     } catch (MsoException me) {
-                        me.addContext ("RollbackNetwork");
+                        me.addContext("RollbackNetwork");
                         String error = "Rollback Network (neutron): " + networkId
-                                       + " in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + ": "
-                                       + me;
-                        LOGGER.recordMetricEvent (deleteNetworkStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteNetwork", null);
-                        LOGGER.error (MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - Rollback Network (neutron)", me);
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-                        throw new NetworkException (me);
+                            + " in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + ": "
+                            + me;
+                        LOGGER.recordMetricEvent(deleteNetworkStarttime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteNetwork", null);
+                        LOGGER
+                            .error(MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack", "",
+                                MsoLogger.ErrorCode.BusinessProcesssError, "Exception - Rollback Network (neutron)",
+                                me);
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.CommunicationError, error);
+                        throw new NetworkException(me);
                     }
                 } else { // DEFAULT to if ("HEAT".equals (mode))
                     // Use MsoHeatUtils for all HEAT commands
-                    MsoHeatUtils heat = new MsoHeatUtils (MSO_PROP_NETWORK_ADAPTER, msoPropertiesFactory,cloudConfigFactory);
-                    long deleteStackStarttime = System.currentTimeMillis ();
+                    MsoHeatUtils heat = new MsoHeatUtils(MSO_PROP_NETWORK_ADAPTER, msoPropertiesFactory,
+                        cloudConfigFactory);
+                    long deleteStackStarttime = System.currentTimeMillis();
                     try {
                         // The deleteStack function in MsoHeatUtils returns success if the stack
                         // was not found. So don't bother to query first.
-                        heat.deleteStack (tenantId, cloudSiteId, networkId, true);
-                        LOGGER.recordMetricEvent (deleteStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "DeleteStack", null);
+                        heat.deleteStack(tenantId, cloudSiteId, networkId, true);
+                        LOGGER.recordMetricEvent(deleteStackStarttime, MsoLogger.StatusCode.COMPLETE,
+                            MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack",
+                            "DeleteStack", null);
                     } catch (MsoException me) {
-                        me.addContext ("RollbackNetwork");
+                        me.addContext("RollbackNetwork");
                         String error = "Rollback Network (heat): " + networkId
-                                       + " in "
-                                       + cloudSiteId
-                                       + "/"
-                                       + tenantId
-                                       + ": "
-                                       + me;
-                        LOGGER.recordMetricEvent (deleteStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteStack", null);
-                        LOGGER.error (MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - Rollback Network (heat)", me);
-                        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-                        throw new NetworkException (me);
+                            + " in "
+                            + cloudSiteId
+                            + "/"
+                            + tenantId
+                            + ": "
+                            + me;
+                        LOGGER.recordMetricEvent(deleteStackStarttime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteStack", null);
+                        LOGGER
+                            .error(MessageEnum.RA_DELETE_NETWORK_EXC, networkId, cloudSiteId, tenantId, "OpenStack", "",
+                                MsoLogger.ErrorCode.BusinessProcesssError, "Exception - Rollback Network (heat)", me);
+                        LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                            MsoLogger.ResponseCode.CommunicationError, error);
+                        throw new NetworkException(me);
                     }
                 }
             }
-        } finally {
-            db.close ();
         }
         LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully rolled back network");
         return;
index e96e416..ae19814 100644 (file)
@@ -71,7 +71,7 @@ public class NetworkBeansTest {
                        contrailSubnet.setAddrFromStart(true);\r
                        contrailSubnet.setDefaultGateway("defaultGateway");\r
                        contrailSubnet.setEnableDhcp(true);\r
-                       contrailSubnet.setPools(new ArrayList<ContrailSubnetPool>());\r
+                       contrailSubnet.setPools(new ArrayList<>());\r
                        contrailSubnet.setSubnet(new ContrailSubnetIp());\r
                        contrailSubnet.setSubnetName("subnetName");\r
                        contrailSubnet.getAllocationPools();\r
index 0b404d7..99f6e86 100644 (file)
@@ -333,7 +333,7 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
      * 
      * @param serviceId
      * @param operationId
-     * @param resourceUUID
+     * @param resourceTemplateUUID
      * @return
      * @throws MsoRequestsDbException
      * @since   ONAP Amsterdam Release
@@ -350,7 +350,7 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
      * 
      * @param serviceId
      * @param operationId
-     * @param resourceUUID
+     * @param resourceTemplateUUID
      * @param operationType
      * @param resourceInstanceID
      * @param jobId
@@ -363,13 +363,13 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
      */
     @Override
     public void updateResourceOperationStatus(String serviceId, String operationId, String resourceTemplateUUID,
-            String operType, String resourceInstanceID, String jobId, String status, String progress,
+            String operationType, String resourceInstanceID, String jobId, String status, String progress,
             String errorCode, String statusDescription) throws MsoRequestsDbException {
          ResourceOperationStatus resStatus = new ResourceOperationStatus();
          resStatus.setServiceId(serviceId);
          resStatus.setOperationId(operationId);
          resStatus.setResourceTemplateUUID(resourceTemplateUUID);
-         resStatus.setOperType(operType);
+         resStatus.setOperType(operationType);
          resStatus.setResourceInstanceID(resourceInstanceID);
          resStatus.setJobId(jobId);
          resStatus.setStatus(status);
index be0466a..fa25716 100644 (file)
@@ -154,12 +154,7 @@ public abstract class SDNCConnector {
                        LOGGER.info(MessageEnum.RA_RESPONSE_FROM_SDNC, responseContent, "SDNC", "");
                        return createResponseFromContent(statusCode, statusMessage, responseContent, rt);
 
-               } catch (SocketTimeoutException e) {
-                       String errMsg = "Request to SDNC timed out";
-                       logError(errMsg, e);
-                       return createErrorResponse(HttpURLConnection.HTTP_CLIENT_TIMEOUT, errMsg, rt);
-
-               } catch (ConnectTimeoutException e) {
+               } catch (SocketTimeoutException | ConnectTimeoutException e) {
                        String errMsg = "Request to SDNC timed out";
                        logError(errMsg, e);
                        return createErrorResponse(HttpURLConnection.HTTP_CLIENT_TIMEOUT, errMsg, rt);
index 5d0752a..2a33ebc 100644 (file)
@@ -39,11 +39,11 @@ public class TenantTest {
                
                MsoTenantAdapter tenantAdapter = new MsoTenantAdapterImpl();
                
-               Holder<String> tenantId = new Holder<String>();
-               Holder<String> tenantName = new Holder<String>();
-               Holder<Map<String,String>> tenantMetadata = new Holder<Map<String,String>>();
-               Holder<Boolean> tenantDeleted = new Holder<Boolean>();
-               Holder<TenantRollback> rollback = new Holder<TenantRollback>();
+               Holder<String> tenantId = new Holder<>();
+               Holder<String> tenantName = new Holder<>();
+               Holder<Map<String,String>> tenantMetadata = new Holder<>();
+               Holder<Boolean> tenantDeleted = new Holder<>();
+               Holder<TenantRollback> rollback = new Holder<>();
                
                try {
                        tenantAdapter.queryTenant (cloudId, "934a4ac9c4bd4b8d9d8ab3ef900281b0", null, tenantId, tenantName, tenantMetadata);
index 48da1ab..5f779dd 100644 (file)
@@ -60,7 +60,7 @@ public class VfcAdapterRest {
     /**
      * Create a NS <br>
      * 
-     * @param servletReq the http request
+     * @param data the http request
      * @return
      * @since ONAP Amsterdam Release
      */
index 61966d0..039c160 100644 (file)
@@ -20,7 +20,7 @@
 
 package org.openecomp.mso.adapters.vfc.exceptions;
 
-import javax.ws.rs.core.Response;;
+import javax.ws.rs.core.Response;
 
 public class ApplicationException extends Exception {
 
@@ -39,7 +39,7 @@ public class ApplicationException extends Exception {
      * </p>
      * 
      * @param errorCode error status
-     * @param errorDetail error detail
+     * @param errorMsg error detail
      * @since ONAP Amsterdam Release 2017-9-6
      */
     public ApplicationException(int errorCode, String errorMsg) {
index afee1bb..fcbbf85 100644 (file)
@@ -166,12 +166,7 @@ public class RestfulUtil {
             method = null;
             return createResponse(statusCode, responseContent);
 
-        } catch(SocketTimeoutException e) {
-            String errMsg = "Request to VFC timed out";
-            logError(errMsg, e);
-            return createResponse(HttpURLConnection.HTTP_CLIENT_TIMEOUT, errMsg);
-
-        } catch(ConnectTimeoutException e) {
+        } catch(SocketTimeoutException | ConnectTimeoutException e) {
             String errMsg = "Request to VFC timed out";
             logError(errMsg, e);
             return createResponse(HttpURLConnection.HTTP_CLIENT_TIMEOUT, errMsg);
index c79d09e..13727bd 100644 (file)
@@ -47,7 +47,7 @@ public class ValidateUtil {
    * Assert String parameter.<br/>\r
    * \r
    * @param paramValue parameter data\r
-   * @param name of parameter\r
+   * @param paramName parameter name\r
    * @since ONAP Amsterdam Release 2017-9-6\r
    */\r
   public static void assertStringNotNull(String paramValue, String paramName)\r
index 95d3bf6..759ceed 100644 (file)
@@ -60,7 +60,7 @@ public class VfcAdapterTest {
     /**
      * mock get request body <br>
      * 
-     * @param request
+     * @param fileName
      * @return
      * @since ONAP Amsterdam Release
      */
@@ -71,7 +71,6 @@ public class VfcAdapterTest {
     /**
      * Mock the request body form a file <br>
      * 
-     * @param fileName
      * @since ONAP Amsterdam Release
      */
     private void mockRestfulUtil() {
index 4842580..5c65429 100644 (file)
@@ -371,8 +371,9 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
      * @param cloudSiteId CLLI code of the cloud site in which to delete
      * @param tenantId Openstack tenant identifier
      * @param vnfName VNF Name or Openstack ID
+     * @param messageId
      * @param msoRequest Request tracking information for logs
-     * @param notificationURL the target URL for asynchronous response
+     * @param notificationUrl the target URL for asynchronous response
      */
     @Override
     public void deleteVnfA (String cloudSiteId,
index 95e62a0..9022c26 100644 (file)
@@ -295,7 +295,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
             vnfExists.value = Boolean.FALSE;
             status.value = VnfStatus.NOTFOUND;
             vnfId.value = null;
-            outputs.value = new HashMap <String, String> (); // Return as an empty map
+            outputs.value = new HashMap<>(); // Return as an empty map
 
             LOGGER.debug ("VNF " + vnfName + " not found");
         } else {
@@ -536,8 +536,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
             final Object obj = JSON_MAPPER.treeToValue(node, Object.class);
             final String json = JSON_MAPPER.writeValueAsString(obj);
             return json;
-        } catch (JsonParseException jpe) {
-            LOGGER.debug("Error converting json to string " + jpe.getMessage(),jpe);
         } catch (Exception e) {
             LOGGER.debug("Error converting json to string " + e.getMessage(),e);
         }
@@ -548,7 +546,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
         if (objectMap == null) {
             return null;
         }
-        Map<String, String> stringMap = new HashMap<String, String>();
+        Map<String, String> stringMap = new HashMap<>();
         for (String key : objectMap.keySet()) {
             if (!stringMap.containsKey(key)) {
                 Object obj = objectMap.get(key);
@@ -823,9 +821,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
 
         // Ready to deploy the new VNF
 
-        CatalogDatabase db = CatalogDatabase.getInstance();
-
-        try {
+        try (CatalogDatabase db = CatalogDatabase.getInstance()) {
             // Retrieve the VF
             VfModule vf = null;
             VnfResource vnfResource = null;
@@ -839,10 +835,14 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                 //vf = db.getVfModuleByModelCustomizationUuid(mcu);
                 if (vf == null) {
                     LOGGER.debug("Unable to find vfModuleCust with modelCustomizationUuid=" + mcu);
-                    String error = "Create vfModule error: Unable to find vfModuleCust with modelCustomizationUuid=" + mcu;
+                    String error =
+                        "Create vfModule error: Unable to find vfModuleCust with modelCustomizationUuid=" + mcu;
                     LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM,
-                            "VF Module ModelCustomizationUuid", modelCustomizationUuid, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Create VF Module: Unable to find vfModule with modelCustomizationUuid=" + mcu);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                        "VF Module ModelCustomizationUuid", modelCustomizationUuid, "OpenStack", "",
+                        MsoLogger.ErrorCode.DataError,
+                        "Create VF Module: Unable to find vfModule with modelCustomizationUuid=" + mcu);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                        error);
                     throw new VnfException(error, MsoExceptionCategory.USERDATA);
                 } else {
                     LOGGER.debug("Found vfModuleCust entry " + vfmc.toString());
@@ -853,7 +853,8 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                 } else {
                     LOGGER.debug("This is *not* a BASE VF request!");
                     if (!isVolumeRequest && nestedBaseStackId == null) {
-                        LOGGER.debug("DANGER WILL ROBINSON! This is unexpected - no nestedBaseStackId with this non-base request");
+                        LOGGER.debug(
+                            "DANGER WILL ROBINSON! This is unexpected - no nestedBaseStackId with this non-base request");
                     }
                 }
             }
@@ -912,12 +913,13 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                 if (vnfResource == null) {
                     String error = "Create VNF: Unknown VNF Type: " + vnfType;
                     LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "VNF Type",
-                            vnfType, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Create VNF: Unknown VNF Type");
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                        vnfType, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Create VNF: Unknown VNF Type");
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                        error);
                     throw new VnfException(error, MsoExceptionCategory.USERDATA);
                 }
                 LOGGER.debug("Got VNF module definition from Catalog: "
-                        + vnfResource.toString());
+                    + vnfResource.toString());
             }
             // By here - we have either a vf or vnfResource
 
@@ -930,7 +932,8 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                     //vnfResource = db.getVnfResourceById(vnfResourceId);
                     vnfResource = db.getVnfResourceByModelUuid(vnfResourceModelUuid);
                     if (vnfResource == null) {
-                        LOGGER.debug("Unable to find vnfResource at " + vnfResourceModelUuid + " will not error for now...");
+                        LOGGER.debug(
+                            "Unable to find vnfResource at " + vnfResourceModelUuid + " will not error for now...");
                     }
                 }
             }
@@ -941,7 +944,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                     minVersionVnf = vnfResource.getAicVersionMin();
                     maxVersionVnf = vnfResource.getAicVersionMax();
                 } catch (Exception e) {
-                    LOGGER.debug("Unable to pull min/max version for this VNF Resource entry",e);
+                    LOGGER.debug("Unable to pull min/max version for this VNF Resource entry", e);
                     minVersionVnf = null;
                     maxVersionVnf = null;
                 }
@@ -974,17 +977,26 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                             moreThanMax = aicV.isMoreRecentThan(maxVersionVnf);
                             equalToMax = aicV.isTheSameVersion(maxVersionVnf);
                         } catch (Exception e) {
-                            LOGGER.debug("An exception occured while trying to test AIC Version " + e.getMessage() + " - will default to not check",e);
+                            LOGGER.debug("An exception occured while trying to test AIC Version " + e.getMessage()
+                                + " - will default to not check", e);
                             doNotTest = true;
                         }
                         if (!doNotTest) {
                             if ((moreThanMin || equalToMin) // aic >= min
-                                    && (equalToMax || !(moreThanMax))) { //aic <= max
-                                LOGGER.debug("VNF Resource " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUuid() + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf + " supported on Cloud: " + cloudSiteOpt.get().getId() + " with AIC_Version:" + cloudSiteOpt.get().getAic_version());
+                                && (equalToMax || !(moreThanMax))) { //aic <= max
+                                LOGGER.debug("VNF Resource " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource
+                                    .getModelUuid() + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf
+                                    + " supported on Cloud: " + cloudSiteOpt.get().getId() + " with AIC_Version:"
+                                    + cloudSiteOpt.get().getAic_version());
                             } else {
                                 // ERROR
-                                String error = "VNF Resource type: " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUuid() + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf + " NOT supported on Cloud: " + cloudSiteOpt.get().getId() + " with AIC_Version:" + cloudSiteOpt.get().getAic_version();
-                                LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - setVersion");
+                                String error =
+                                    "VNF Resource type: " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource
+                                        .getModelUuid() + " VersionMin=" + minVersionVnf + " VersionMax:"
+                                        + maxVersionVnf + " NOT supported on Cloud: " + cloudSiteOpt.get().getId()
+                                        + " with AIC_Version:" + cloudSiteOpt.get().getAic_version();
+                                LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "",
+                                    MsoLogger.ErrorCode.BusinessProcesssError, "Exception - setVersion");
                                 LOGGER.debug(error);
                                 throw new VnfException(error, MsoExceptionCategory.USERDATA);
                             }
@@ -996,7 +1008,8 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                     LOGGER.debug("cloudConfig is NULL - cannot check cloud site version");
                 }
             } else {
-                LOGGER.debug("AIC Version not set in VNF_Resource - this is expected thru 1607 - do not error here - not checked.");
+                LOGGER.debug(
+                    "AIC Version not set in VNF_Resource - this is expected thru 1607 - do not error here - not checked.");
             }
             // End Version check 1607
 
@@ -1018,7 +1031,8 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                 }
             } else {
                 if (isVolumeRequest) {
-                    LOGGER.debug("DANGER WILL ROBINSON! This should never apply - a VNF Request (gamma only now) *and* a volume request?");
+                    LOGGER.debug(
+                        "DANGER WILL ROBINSON! This should never apply - a VNF Request (gamma only now) *and* a volume request?");
                     /*
                     VnfComponent vnfComponent = null;
                     vnfComponent = db.getVnfComponent(vnfResource.getId(), "VOLUME");
@@ -1040,11 +1054,14 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
             // By the time we get here - heatTemplateId and heatEnvtId should be populated (or null)
             HeatTemplate heatTemplate = null;
             if (heatTemplateArtifactUuid == null || "".equals(heatTemplateArtifactUuid)) {
-                String error = "Create: No Heat Template ID defined in catalog database for " + vnfType + ", reqType=" + requestTypeString;
-                LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Template ID", vnfType, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Create: No Heat Template ID defined in catalog database");
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                String error = "Create: No Heat Template ID defined in catalog database for " + vnfType + ", reqType="
+                    + requestTypeString;
+                LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Template ID", vnfType, "OpenStack", "",
+                    MsoLogger.ErrorCode.DataError, "Create: No Heat Template ID defined in catalog database");
+                LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                    error);
                 alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR,
-                        MsoAlarmLogger.CRITICAL, error);
+                    MsoAlarmLogger.CRITICAL, error);
                 throw new VnfException(error, MsoExceptionCategory.INTERNAL);
             } else {
                 heatTemplate = db.getHeatTemplateByArtifactUuidRegularQuery(heatTemplateArtifactUuid);
@@ -1052,11 +1069,14 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
             if (heatTemplate == null) {
                 String error = "Create VF/VNF: no entry found for heat template ID = " + heatTemplateArtifactUuid;
                 LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM,
-                        "Heat Template ID",
-                        String.valueOf(heatTemplateArtifactUuid), "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Create VF/VNF: no entry found for heat template ID = " + heatTemplateArtifactUuid);
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                    "Heat Template ID",
+                    String.valueOf(heatTemplateArtifactUuid), "OpenStack", "",
+                    MsoLogger.ErrorCode.BusinessProcesssError,
+                    "Create VF/VNF: no entry found for heat template ID = " + heatTemplateArtifactUuid);
+                LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                    error);
                 alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR,
-                        MsoAlarmLogger.CRITICAL, error);
+                    MsoAlarmLogger.CRITICAL, error);
                 throw new VnfException(error, MsoExceptionCategory.INTERNAL);
             }
             LOGGER.debug("Got HEAT Template from DB");
@@ -1065,45 +1085,49 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
             String heatEnvironmentString = null;
 
             if (heatEnvironmentArtifactUuid != null && !"".equals(heatEnvironmentArtifactUuid)) {
-                LOGGER.debug ("about to call getHeatEnvironment with :" + heatEnvironmentArtifactUuid + ":");
+                LOGGER.debug("about to call getHeatEnvironment with :" + heatEnvironmentArtifactUuid + ":");
                 heatEnvironment = db.getHeatEnvironmentByArtifactUuid(heatEnvironmentArtifactUuid);
                 if (heatEnvironment == null) {
                     String error = "Create VFModule: undefined Heat Environment. VFModule=" + vfModuleType
-                                   + ", Environment ID="
-                                   + heatEnvironmentArtifactUuid;
-                    LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Environment ID", String.valueOf(heatEnvironmentArtifactUuid), "OpenStack", "getHeatEnvironment", MsoLogger.ErrorCode.BusinessProcesssError, "Create VFModule: undefined Heat Environment");
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                        + ", Environment ID="
+                        + heatEnvironmentArtifactUuid;
+                    LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Environment ID",
+                        String.valueOf(heatEnvironmentArtifactUuid), "OpenStack", "getHeatEnvironment",
+                        MsoLogger.ErrorCode.BusinessProcesssError, "Create VFModule: undefined Heat Environment");
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                        error);
                     // Alarm on this error, configuration must be fixed
-                    alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
+                    alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
 
-                    throw new VnfException (error, MsoExceptionCategory.INTERNAL);
+                    throw new VnfException(error, MsoExceptionCategory.INTERNAL);
                 } else {
-                    LOGGER.debug ("Got Heat Environment from DB: " + heatEnvironment.toString ());
-                    heatEnvironmentString = heatEnvironment.getEnvironment (); //this.parseEnvironment (heatEnvironment.getEnvironment ());
-                    LOGGER.debug ("after parsing: " + heatEnvironmentString);
+                    LOGGER.debug("Got Heat Environment from DB: " + heatEnvironment.toString());
+                    heatEnvironmentString = heatEnvironment
+                        .getEnvironment(); //this.parseEnvironment (heatEnvironment.getEnvironment ());
+                    LOGGER.debug("after parsing: " + heatEnvironmentString);
                 }
             } else {
-                LOGGER.debug ("no environment parameter found for this Type " + vfModuleType);
+                LOGGER.debug("no environment parameter found for this Type " + vfModuleType);
             }
 
             // 1510 - Add the files: for nested templates *if* there are any
-            LOGGER.debug ("In MsoVnfAdapterImpl, createVfModule about to call db.getNestedTemplates avec templateId="
-                          + heatTemplate.getArtifactUuid());
-            Map <String, Object> nestedTemplates = db.getNestedTemplates (heatTemplate.getArtifactUuid());
-            Map <String, Object> nestedTemplatesChecked = new HashMap <> ();
+            LOGGER.debug("In MsoVnfAdapterImpl, createVfModule about to call db.getNestedTemplates avec templateId="
+                + heatTemplate.getArtifactUuid());
+            Map<String, Object> nestedTemplates = db.getNestedTemplates(heatTemplate.getArtifactUuid());
+            Map<String, Object> nestedTemplatesChecked = new HashMap<>();
             if (nestedTemplates != null) {
                 // for debugging print them out
-                LOGGER.debug ("Contents of nestedTemplates - to be added to files: on stack:");
-                for (Map.Entry<String, Object> entry : nestedTemplates.entrySet ()) {
+                LOGGER.debug("Contents of nestedTemplates - to be added to files: on stack:");
+                for (Map.Entry<String, Object> entry : nestedTemplates.entrySet()) {
                     String providerResourceFile = entry.getKey();
                     Object value = entry.getValue();
                     String providerResourceFileChecked = providerResourceFile; //this.enforceFilePrefix (providerResourceFile);
                     String childTemplateBody = (String) value;
-                    LOGGER.debug (providerResourceFileChecked + " -> " + childTemplateBody);
-                    nestedTemplatesChecked.put (providerResourceFileChecked, childTemplateBody);
+                    LOGGER.debug(providerResourceFileChecked + " -> " + childTemplateBody);
+                    nestedTemplatesChecked.put(providerResourceFileChecked, childTemplateBody);
                 }
             } else {
-                LOGGER.debug ("No nested templates found - nothing to do here");
+                LOGGER.debug("No nested templates found - nothing to do here");
                 nestedTemplatesChecked = null; // just to make sure
             }
 
@@ -1115,25 +1139,29 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
             // Add ability to turn on adding get_files with volume requests (by property).
             boolean addGetFilesOnVolumeReq = false;
             try {
-                String propertyString = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_VNF_ADAPTER).getProperty(MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ, null);
+                String propertyString = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_VNF_ADAPTER)
+                    .getProperty(MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ, null);
                 if ("true".equalsIgnoreCase(propertyString) || "y".equalsIgnoreCase(propertyString)) {
                     addGetFilesOnVolumeReq = true;
                     LOGGER.debug("AddGetFilesOnVolumeReq - setting to true! " + propertyString);
                 }
             } catch (Exception e) {
-                LOGGER.debug("An error occured trying to get property " + MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ + " - default to false", e);
+                LOGGER.debug("An error occured trying to get property " + MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ
+                    + " - default to false", e);
             }
 
             if (!isVolumeRequest || addGetFilesOnVolumeReq) {
                 if (oldWay) {
-                    LOGGER.debug("In MsoVnfAdapterImpl createVfModule, this should not happen - old way is gamma only - no heat files!");
+                    LOGGER.debug(
+                        "In MsoVnfAdapterImpl createVfModule, this should not happen - old way is gamma only - no heat files!");
                     //heatFiles = db.getHeatFiles(vnfResource.getId());
                 } else {
                     // 1607 - now use VF_MODULE_TO_HEAT_FILES table
-                    LOGGER.debug("In MsoVnfAdapterImpl createVfModule, about to call db.getHeatFilesForVfModule avec vfModuleId="
+                    LOGGER.debug(
+                        "In MsoVnfAdapterImpl createVfModule, about to call db.getHeatFilesForVfModule avec vfModuleId="
                             + vf.getModelUUID());
                     heatFiles = db
-                            .getHeatFilesForVfModule(vf.getModelUUID());
+                        .getHeatFilesForVfModule(vf.getModelUUID());
                 }
                 if (heatFiles != null) {
                     // add these to stack - to be done in createStack
@@ -1147,19 +1175,24 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                         HeatFiles value = entry.getValue();
                         if (heatFileName.startsWith("_ERROR|")) {
                             // This means there was an invalid entry in VF_MODULE_TO_HEAT_FILES table - the heat file it pointed to could not be found.
-                            String heatFileId = heatFileName.substring(heatFileName.lastIndexOf("|")+1);
-                            String error = "Create: No HEAT_FILES entry in catalog database for " + vfModuleType + " at HEAT_FILES index=" + heatFileId;
+                            String heatFileId = heatFileName.substring(heatFileName.lastIndexOf("|") + 1);
+                            String error = "Create: No HEAT_FILES entry in catalog database for " + vfModuleType
+                                + " at HEAT_FILES index=" + heatFileId;
                             LOGGER.debug(error);
-                            LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "HEAT_FILES entry not found at " + heatFileId, vfModuleType, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "HEAT_FILES entry not found");
-                            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                            LOGGER
+                                .error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "HEAT_FILES entry not found at " + heatFileId,
+                                    vfModuleType, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError,
+                                    "HEAT_FILES entry not found");
+                            LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                                MsoLogger.ResponseCode.DataNotFound, error);
                             // Alarm on this error, configuration must be fixed
-                            alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
-                            throw new VnfException (error, MsoExceptionCategory.INTERNAL);
+                            alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
+                            throw new VnfException(error, MsoExceptionCategory.INTERNAL);
                         }
                         String heatFileBody = value.getFileBody();
                         String heatFileNameChecked = heatFileName;
                         LOGGER.debug(heatFileNameChecked + " -> "
-                                + heatFileBody);
+                            + heatFileBody);
                         heatFilesObjects.put(heatFileNameChecked, heatFileBody);
                     }
                 } else {
@@ -1167,12 +1200,12 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                     heatFilesObjects = null;
                 }
             } else {
-                    LOGGER.debug("Volume request - DO NOT CHECK for HEAT_FILES");
+                LOGGER.debug("Volume request - DO NOT CHECK for HEAT_FILES");
             }
 
             // Check that required parameters have been supplied
             StringBuilder missingParams = null;
-            List <String> paramList = new ArrayList <> ();
+            List<String> paramList = new ArrayList<>();
 
             // New for 1510 - consult the PARAM_ALIAS field to see if we've been
             // supplied an alias. Only check if we don't find it initially.
@@ -1181,23 +1214,23 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
             // shouldn't
             boolean checkRequiredParameters = true;
             try {
-                String propertyString = msoPropertiesFactory.getMsoJavaProperties (MSO_PROP_VNF_ADAPTER)
-                                                     .getProperty (MsoVnfAdapterImpl.CHECK_REQD_PARAMS,null);
-                if ("false".equalsIgnoreCase (propertyString) || "n".equalsIgnoreCase (propertyString)) {
+                String propertyString = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_VNF_ADAPTER)
+                    .getProperty(MsoVnfAdapterImpl.CHECK_REQD_PARAMS, null);
+                if ("false".equalsIgnoreCase(propertyString) || "n".equalsIgnoreCase(propertyString)) {
                     checkRequiredParameters = false;
-                    LOGGER.debug ("CheckRequiredParameters is FALSE. Will still check but then skip blocking..."
-                                  + MsoVnfAdapterImpl.CHECK_REQD_PARAMS);
+                    LOGGER.debug("CheckRequiredParameters is FALSE. Will still check but then skip blocking..."
+                        + MsoVnfAdapterImpl.CHECK_REQD_PARAMS);
                 }
             } catch (Exception e) {
                 // No problem - default is true
-                LOGGER.debug ("An exception occured trying to get property " + MsoVnfAdapterImpl.CHECK_REQD_PARAMS, e);
+                LOGGER.debug("An exception occured trying to get property " + MsoVnfAdapterImpl.CHECK_REQD_PARAMS, e);
             }
             // 1604 - Add enhanced environment & parameter checking
             // Part 1: parse envt entries to see if reqd parameter is there (before used a simple grep
             // Part 2: only submit to openstack the parameters in the envt that are in the heat template
             // Note this also removes any comments
             MsoHeatEnvironmentEntry mhee = null;
-            if (heatEnvironmentString != null && heatEnvironmentString.contains ("parameters:")) {
+            if (heatEnvironmentString != null && heatEnvironmentString.contains("parameters:")) {
                 //LOGGER.debug ("Have an Environment argument with a parameters: section - will bypass checking for valid params - but will still check for aliases");
                 LOGGER.debug("Enhanced environment checking enabled - 1604");
                 mhee = MsoHeatEnvironmentEntry.create(heatEnvironmentString);
@@ -1235,7 +1268,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                 }
                 LOGGER.debug(sb.toString());
             } catch (Exception e) {
-                LOGGER.debug("??An exception occurred trying to go through Parameter Names " + e.getMessage(),e);
+                LOGGER.debug("??An exception occurred trying to go through Parameter Names " + e.getMessage(), e);
             }
             // Step 1 - convert what we got as inputs (Map<String, String>) to a
             // Map<String, Object> - where the object matches the param type identified in the template
@@ -1249,21 +1282,22 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
             heat.copyBaseOutputsToInputs(goldenInputs, nestedVolumeOutputs, parameterNames, aliasToParam);
             this.sendMapToDebug(goldenInputs, "Final inputs sent to openstack");
 
-            for (HeatTemplateParam parm : heatTemplate.getParameters ()) {
-                LOGGER.debug ("Parameter:'" + parm.getParamName ()
-                              + "', isRequired="
-                              + parm.isRequired ()
-                              + ", alias="
-                              + parm.getParamAlias ());
+            for (HeatTemplateParam parm : heatTemplate.getParameters()) {
+                LOGGER.debug("Parameter:'" + parm.getParamName()
+                    + "', isRequired="
+                    + parm.isRequired()
+                    + ", alias="
+                    + parm.getParamAlias());
 
-                if (parm.isRequired () && (goldenInputs == null || !goldenInputs.containsKey (parm.getParamName ()))) {
+                if (parm.isRequired() && (goldenInputs == null || !goldenInputs.containsKey(parm.getParamName()))) {
                     // The check for an alias was moved to the method in MsoHeatUtils - when we converted the Map<String, String> to Map<String, Object>
-                    LOGGER.debug("**Parameter " + parm.getParamName() + " is required and not in the inputs...check environment");
+                    LOGGER.debug("**Parameter " + parm.getParamName()
+                        + " is required and not in the inputs...check environment");
                     if (mhee != null && mhee.containsParameter(parm.getParamName())) {
-                        LOGGER.debug ("Required parameter " + parm.getParamName ()
-                                      + " appears to be in environment - do not count as missing");
+                        LOGGER.debug("Required parameter " + parm.getParamName()
+                            + " appears to be in environment - do not count as missing");
                     } else {
-                        LOGGER.debug ("adding to missing parameters list: " + parm.getParamName ());
+                        LOGGER.debug("adding to missing parameters list: " + parm.getParamName());
                         if (missingParams == null) {
                             missingParams = new StringBuilder(parm.getParamName());
                         } else {
@@ -1271,20 +1305,22 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                         }
                     }
                 }
-                paramList.add (parm.getParamName ());
+                paramList.add(parm.getParamName());
             }
             if (missingParams != null) {
                 if (checkRequiredParameters) {
                     // Problem - missing one or more required parameters
                     String error = "Create VFModule: Missing Required inputs: " + missingParams;
-                    LOGGER.error (MessageEnum.RA_MISSING_PARAM, missingParams.toString(), "OpenStack", "", MsoLogger.ErrorCode.DataError, "Create VFModule: Missing Required inputs");
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
-                    throw new VnfException (error, MsoExceptionCategory.USERDATA);
+                    LOGGER.error(MessageEnum.RA_MISSING_PARAM, missingParams.toString(), "OpenStack", "",
+                        MsoLogger.ErrorCode.DataError, "Create VFModule: Missing Required inputs");
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest,
+                        error);
+                    throw new VnfException(error, MsoExceptionCategory.USERDATA);
                 } else {
-                    LOGGER.debug ("found missing parameters - but checkRequiredParameters is false - will not block");
+                    LOGGER.debug("found missing parameters - but checkRequiredParameters is false - will not block");
                 }
             } else {
-                LOGGER.debug ("No missing parameters found - ok to proceed");
+                LOGGER.debug("No missing parameters found - ok to proceed");
             }
             // We can now remove the recreating of the ENV with only legit params - that check is done for us,
             // and it causes problems with json that has arrays
@@ -1294,13 +1330,13 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
             }
 
             // "Fix" the template if it has CR/LF (getting this from Oracle)
-            String template = heatTemplate.getHeatTemplate ();
-            template = template.replaceAll ("\r\n", "\n");
+            String template = heatTemplate.getHeatTemplate();
+            template = template.replaceAll("\r\n", "\n");
 
             // Have the tenant. Now deploy the stack itself
             // Ignore MsoTenantNotFound and MsoStackAlreadyExists exceptions
             // because we already checked for those.
-            long createStackStarttime = System.currentTimeMillis ();
+            long createStackStarttime = System.currentTimeMillis();
             try {
                 // heatStack = heat.createStack(cloudSiteId, tenantId, vnfName, template, inputs, true,
                 // heatTemplate.getTimeoutMinutes());
@@ -1310,47 +1346,59 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                 if (heat != null) {
                     LOGGER.debug("heat is not null!!");
                 }
-                    heatStack = heat.createStack (cloudSiteId,
-                                              tenantId,
-                                              vfModuleName,
-                                              template,
-                        goldenInputs,
-                                              true,
-                                              heatTemplate.getTimeoutMinutes (),
-                                              newEnvironmentString,
-                                              nestedTemplatesChecked,
-                                              heatFilesObjects,
-                                              backout.booleanValue());
-                LOGGER.recordMetricEvent (createStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from Open Stack", "OpenStack", "CreateStack", vfModuleName);
+                heatStack = heat.createStack(cloudSiteId,
+                    tenantId,
+                    vfModuleName,
+                    template,
+                    goldenInputs,
+                    true,
+                    heatTemplate.getTimeoutMinutes(),
+                    newEnvironmentString,
+                    nestedTemplatesChecked,
+                    heatFilesObjects,
+                    backout.booleanValue());
+                LOGGER
+                    .recordMetricEvent(createStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
+                        "Successfully received response from Open Stack", "OpenStack", "CreateStack", vfModuleName);
             } catch (MsoException me) {
-                me.addContext ("CreateVFModule");
+                me.addContext("CreateVFModule");
                 String error = "Create VF Module " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + me;
-                LOGGER.recordMetricEvent (createStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "CreateStack", vfModuleName);
-                LOGGER.error (MessageEnum.RA_CREATE_VNF_ERR, vfModuleType, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "MsoException - createStack", me);
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-                throw new VnfException (me);
+                LOGGER.recordMetricEvent(createStackStarttime, MsoLogger.StatusCode.ERROR,
+                    MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "CreateStack", vfModuleName);
+                LOGGER.error(MessageEnum.RA_CREATE_VNF_ERR, vfModuleType, cloudSiteId, tenantId, "OpenStack", "",
+                    MsoLogger.ErrorCode.DataError, "MsoException - createStack", me);
+                LOGGER
+                    .recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
+                        error);
+                throw new VnfException(me);
             } catch (NullPointerException npe) {
                 String error = "Create VFModule " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + npe;
-                LOGGER.recordMetricEvent (createStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "CreateStack", vfModuleName);
-                LOGGER.error (MessageEnum.RA_CREATE_VNF_ERR, vfModuleType, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "NullPointerException - createStack", npe);
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+                LOGGER.recordMetricEvent(createStackStarttime, MsoLogger.StatusCode.ERROR,
+                    MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "CreateStack", vfModuleName);
+                LOGGER.error(MessageEnum.RA_CREATE_VNF_ERR, vfModuleType, cloudSiteId, tenantId, "OpenStack", "",
+                    MsoLogger.ErrorCode.DataError, "NullPointerException - createStack", npe);
+                LOGGER
+                    .recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
+                        error);
                 LOGGER.debug("NULL POINTER EXCEPTION at heat.createStack");
                 //npe.addContext ("CreateVNF");
-                throw new VnfException ("NullPointerException during heat.createStack");
+                throw new VnfException("NullPointerException during heat.createStack");
             } catch (Exception e) {
-                LOGGER.recordMetricEvent (createStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while creating stack with OpenStack", "OpenStack", "CreateStack", vfModuleName);
-                LOGGER.debug("unhandled exception at heat.createStack",e);
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while creating stack with OpenStack");
+                LOGGER.recordMetricEvent(createStackStarttime, MsoLogger.StatusCode.ERROR,
+                    MsoLogger.ResponseCode.CommunicationError, "Exception while creating stack with OpenStack",
+                    "OpenStack", "CreateStack", vfModuleName);
+                LOGGER.debug("unhandled exception at heat.createStack", e);
+                LOGGER
+                    .recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
+                        "Exception while creating stack with OpenStack");
                 throw new VnfException("Exception during heat.createStack! " + e.getMessage());
             }
         } catch (Exception e) {
-            LOGGER.debug("unhandled exception in create VF",e);
+            LOGGER.debug("unhandled exception in create VF", e);
             throw new VnfException("Exception during create VF " + e.getMessage());
 
-        } finally {
-            // Make sure DB session is closed
-            db.close ();
         }
+        // Make sure DB session is closed
 
         // Reach this point if createStack is successful.
         // Populate remaining rollback info and response parameters.
@@ -1442,19 +1490,17 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
         String serviceName = VNF_ADAPTER_SERVICE_NAME + methodName;
         MsoLogger.setServiceName (serviceName);
 
-        StringBuilder sbInit = new StringBuilder();
-        sbInit.append("updateVfModule: \n");
-        sbInit.append("cloudSiteId=").append(cloudSiteId).append("\n");
-        sbInit.append("tenantId=").append(tenantId).append("\n");
-        sbInit.append("vnfType=").append(vnfType).append("\n");
-        sbInit.append("vnfVersion=").append(vnfVersion).append("\n");
-        sbInit.append("vnfName=").append(vnfName).append("\n");
-        sbInit.append("requestType=").append(requestType).append("\n");
-        sbInit.append("volumeGroupHeatStackId=").append(volumeGroupHeatStackId).append("\n");
-        sbInit.append("baseVfHeatStackId=").append(baseVfHeatStackId).append("\n");
-        sbInit.append("vfModuleStackId=").append(vfModuleStackId).append("\n");
-        sbInit.append("modelCustomizationUuid=").append(modelCustomizationUuid).append("\n");
-        LOGGER.debug(sbInit.toString());
+        String strInit = "updateVfModule: cloudSiteId=" + cloudSiteId +
+            ",tenantId=" + tenantId +
+            ",vnfType=" + vnfType +
+            ",vnfVersion=" + vnfVersion +
+            ",vnfName=" + vnfName +
+            ",requestType=" + requestType +
+            ",volumeGroupHeatStackId=" + volumeGroupHeatStackId +
+            ",baseVfHeatStackId=" + baseVfHeatStackId +
+            ",vfModuleStackId=" + vfModuleStackId +
+            ",modelCustomizationUuid=" + modelCustomizationUuid;
+        LOGGER.debug(strInit);
 
         String mcu = modelCustomizationUuid;
         boolean useMCUuid = false;
@@ -1635,10 +1681,9 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
         // Ready to deploy the new VNF
 
         // Get a handle to the Catalog Database
-        CatalogDatabase db = CatalogDatabase.getInstance();
 
         // Make sure DB session is closed
-        try {
+        try (CatalogDatabase db = CatalogDatabase.getInstance()) {
             // Retrieve the VF definition
             VnfResource vnfResource = null;
             VfModule vf = null;
@@ -1653,20 +1698,22 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
             } else {
                 LOGGER.debug("1707 and later - MUST PROVIDE Model Customization UUID!");
             }
-                if (vf == null) {
+            if (vf == null) {
                 String error = "Update VfModule: unable to find vfModule with modelCustomizationUuid=" + mcu;
-                LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "VF Module Type", vfModuleType, "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataError, error);
-                throw new VnfException (error, MsoExceptionCategory.USERDATA);
+                LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "VF Module Type", vfModuleType, "OpenStack", "",
+                    MsoLogger.ErrorCode.DataError, error);
+                LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataError, error);
+                throw new VnfException(error, MsoExceptionCategory.USERDATA);
             }
-            LOGGER.debug ("Got VF module definition from Catalog: " + vf.toString ());
+            LOGGER.debug("Got VF module definition from Catalog: " + vf.toString());
             if (vf.isBase()) {
                 isBaseRequest = true;
                 LOGGER.debug("This a BASE update request");
             } else {
                 LOGGER.debug("This is *not* a BASE VF update request");
                 if (!isVolumeRequest && nestedBaseStackId == null) {
-                    LOGGER.debug("DANGER WILL ROBINSON! This is unexpected - no nestedBaseStackId with this non-base request");
+                    LOGGER.debug(
+                        "DANGER WILL ROBINSON! This is unexpected - no nestedBaseStackId with this non-base request");
                 }
             }
 
@@ -1678,7 +1725,8 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                 //vnfResource = db.getVnfResourceById(vnfResourceId);
                 vnfResource = db.getVnfResourceByModelUuid(vnfResourceModelUuid);
                 if (vnfResource == null) {
-                    LOGGER.debug("Unable to find vnfResource at " + vnfResourceModelUuid + " will not error for now...");
+                    LOGGER
+                        .debug("Unable to find vnfResource at " + vnfResourceModelUuid + " will not error for now...");
                 }
             }
             String minVersionVnf = null;
@@ -1688,35 +1736,42 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                     minVersionVnf = vnfResource.getAicVersionMin();
                     maxVersionVnf = vnfResource.getAicVersionMax();
                 } catch (Exception e) {
-                    LOGGER.debug("Unable to pull min/max version for this VNF Resource entry",e);
+                    LOGGER.debug("Unable to pull min/max version for this VNF Resource entry", e);
                     minVersionVnf = null;
                     maxVersionVnf = null;
-                    }
+                }
                 if (minVersionVnf != null && "".equals(minVersionVnf)) {
                     minVersionVnf = null;
                 }
                 if (maxVersionVnf != null && "".equals(maxVersionVnf)) {
                     maxVersionVnf = null;
-                    }
                 }
+            }
             if (minVersionVnf != null && maxVersionVnf != null) {
                 MavenLikeVersioning aicV = new MavenLikeVersioning();
                 //String aicVersion = "";
                 if (this.cloudConfig == null) {
                     this.cloudConfig = this.cloudConfigFactory.getCloudConfig();
-            }
+                }
                 // double check
                 if (this.cloudConfig != null) {
                     Optional<CloudSite> cloudSiteOpt = this.cloudConfig.getCloudSite(cloudSiteId);
                     if (cloudSiteOpt.isPresent()) {
                         aicV.setVersion(cloudSiteOpt.get().getAic_version());
                         if ((aicV.isMoreRecentThan(minVersionVnf) || aicV.isTheSameVersion(minVersionVnf)) // aic >= min
-                                && (aicV.isTheSameVersion(maxVersionVnf) || !(aicV.isMoreRecentThan(maxVersionVnf)))) { //aic <= max
-                            LOGGER.debug("VNF Resource " + vnfResource.getModelName() + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf + " supported on Cloud: " + cloudSiteOpt.get().getId() + " with AIC_Version:" + cloudSiteOpt.get().getAic_version());
+                            && (aicV.isTheSameVersion(maxVersionVnf) || !(aicV
+                            .isMoreRecentThan(maxVersionVnf)))) { //aic <= max
+                            LOGGER.debug("VNF Resource " + vnfResource.getModelName() + " VersionMin=" + minVersionVnf
+                                + " VersionMax:" + maxVersionVnf + " supported on Cloud: " + cloudSiteOpt.get().getId()
+                                + " with AIC_Version:" + cloudSiteOpt.get().getAic_version());
                         } else {
                             // ERROR
-                            String error = "VNF Resource type: " + vnfResource.getModelName() + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf + " NOT supported on Cloud: " + cloudSiteOpt.get().getId() + " with AIC_Version:" + cloudSiteOpt.get().getAic_version();
-                            LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - setVersion");
+                            String error =
+                                "VNF Resource type: " + vnfResource.getModelName() + " VersionMin=" + minVersionVnf
+                                    + " VersionMax:" + maxVersionVnf + " NOT supported on Cloud: " + cloudSiteOpt.get()
+                                    .getId() + " with AIC_Version:" + cloudSiteOpt.get().getAic_version();
+                            LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "",
+                                MsoLogger.ErrorCode.BusinessProcesssError, "Exception - setVersion");
                             LOGGER.debug(error);
                             throw new VnfException(error, MsoExceptionCategory.USERDATA);
                         }
@@ -1742,11 +1797,15 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                 heatEnvironmentArtifactUuid = vfmc.getHeatEnvironmentArtifactUuid();
             }
             if (heatTemplateArtifactUuid == null) {
-                String error = "UpdateVF: No Heat Template ID defined in catalog database for " + vfModuleType + ", reqType=" + requestTypeString;
-                LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Template ID", vfModuleType, "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                String error =
+                    "UpdateVF: No Heat Template ID defined in catalog database for " + vfModuleType + ", reqType="
+                        + requestTypeString;
+                LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Template ID", vfModuleType, "OpenStack", "",
+                    MsoLogger.ErrorCode.DataError, error);
+                LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                    error);
                 alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR,
-                        MsoAlarmLogger.CRITICAL, error);
+                    MsoAlarmLogger.CRITICAL, error);
                 throw new VnfException(error, MsoExceptionCategory.INTERNAL);
             } else {
                 heatTemplate = db.getHeatTemplateByArtifactUuidRegularQuery(heatTemplateArtifactUuid);
@@ -1754,90 +1813,97 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
 
             if (heatTemplate == null) {
                 String error = "Update VNF: undefined Heat Template. VF="
-                        + vfModuleType + ", heat template id = " + heatTemplateArtifactUuid;
+                    + vfModuleType + ", heat template id = " + heatTemplateArtifactUuid;
                 LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM,
-                        "Heat Template ID",
-                        String.valueOf(heatTemplateArtifactUuid), "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                    "Heat Template ID",
+                    String.valueOf(heatTemplateArtifactUuid), "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
+                LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                    error);
                 // Alarm on this error, configuration must be fixed
                 alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR,
-                        MsoAlarmLogger.CRITICAL, error);
+                    MsoAlarmLogger.CRITICAL, error);
 
                 throw new VnfException(error, MsoExceptionCategory.INTERNAL);
             }
 
-            LOGGER.debug ("Got HEAT Template from DB: " + heatTemplate.toString ());
+            LOGGER.debug("Got HEAT Template from DB: " + heatTemplate.toString());
 
             // Add check for any Environment variable
             HeatEnvironment heatEnvironment = null;
             String heatEnvironmentString = null;
 
             if (heatEnvironmentArtifactUuid != null) {
-                LOGGER.debug ("about to call getHeatEnvironment with :" + heatEnvironmentArtifactUuid + ":");
+                LOGGER.debug("about to call getHeatEnvironment with :" + heatEnvironmentArtifactUuid + ":");
                 heatEnvironment = db.getHeatEnvironmentByArtifactUuid(heatEnvironmentArtifactUuid);
                 if (heatEnvironment == null) {
 
                     String error = "Update VNF: undefined Heat Environment. VF=" + vfModuleType
-                                   + ", Environment ID="
-                                   + heatEnvironmentArtifactUuid;
-                    LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Environment ID", String.valueOf(heatEnvironmentArtifactUuid), "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                        + ", Environment ID="
+                        + heatEnvironmentArtifactUuid;
+                    LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Environment ID",
+                        String.valueOf(heatEnvironmentArtifactUuid), "OpenStack", "", MsoLogger.ErrorCode.DataError,
+                        error);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                        error);
                     // Alarm on this error, configuration must be fixed
-                    alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
+                    alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
 
-                    throw new VnfException (error, MsoExceptionCategory.INTERNAL);
+                    throw new VnfException(error, MsoExceptionCategory.INTERNAL);
                 } else {
-                    LOGGER.debug ("Got Heat Environment from DB: " + heatEnvironment.toString ());
-                    heatEnvironmentString = heatEnvironment.getEnvironment (); //this.parseEnvironment (heatEnvironment.getEnvironment ());
-                    LOGGER.debug ("After parsing: " + heatEnvironmentString);
+                    LOGGER.debug("Got Heat Environment from DB: " + heatEnvironment.toString());
+                    heatEnvironmentString = heatEnvironment
+                        .getEnvironment(); //this.parseEnvironment (heatEnvironment.getEnvironment ());
+                    LOGGER.debug("After parsing: " + heatEnvironmentString);
                 }
             } else {
-                LOGGER.debug ("no environment parameter for this VFModuleType " + vfModuleType);
+                LOGGER.debug("no environment parameter for this VFModuleType " + vfModuleType);
             }
 
-
-            LOGGER.debug ("In MsoVnfAdapterImpl, about to call db.getNestedTemplates avec templateId="
-                          + heatTemplate.getArtifactUuid ());
-            Map <String, Object> nestedTemplates = db.getNestedTemplates (heatTemplate.getArtifactUuid ());
-            Map <String, Object> nestedTemplatesChecked = new HashMap <> ();
+            LOGGER.debug("In MsoVnfAdapterImpl, about to call db.getNestedTemplates avec templateId="
+                + heatTemplate.getArtifactUuid());
+            Map<String, Object> nestedTemplates = db.getNestedTemplates(heatTemplate.getArtifactUuid());
+            Map<String, Object> nestedTemplatesChecked = new HashMap<>();
             if (nestedTemplates != null) {
                 // for debugging print them out
-                LOGGER.debug ("Contents of nestedTemplates - to be added to files: on stack:");
-                for (Map.Entry<String, Object> entry : nestedTemplates.entrySet ()) {
+                LOGGER.debug("Contents of nestedTemplates - to be added to files: on stack:");
+                for (Map.Entry<String, Object> entry : nestedTemplates.entrySet()) {
                     String providerResourceFile = entry.getKey();
                     Object value = entry.getValue();
                     String providerResourceFileChecked = providerResourceFile; //this.enforceFilePrefix (providerResourceFile);
                     String childTemplateBody = (String) value;
-                    nestedTemplatesChecked.put (providerResourceFileChecked, childTemplateBody);
-                    LOGGER.debug (providerResourceFileChecked + " -> " + childTemplateBody);
+                    nestedTemplatesChecked.put(providerResourceFileChecked, childTemplateBody);
+                    LOGGER.debug(providerResourceFileChecked + " -> " + childTemplateBody);
                 }
             } else {
-                LOGGER.debug ("No nested templates found - nothing to do here");
+                LOGGER.debug("No nested templates found - nothing to do here");
                 nestedTemplatesChecked = null;
             }
 
             // Also add the files: for any get_files associated with this VfModule
             // *if* there are any
-            LOGGER.debug ("In MsoVnfAdapterImpl.updateVfModule, about to call db.getHeatFiles avec vfModuleId="
-                          + vf.getModelUUID());
+            LOGGER.debug("In MsoVnfAdapterImpl.updateVfModule, about to call db.getHeatFiles avec vfModuleId="
+                + vf.getModelUUID());
 
-            Map <String, HeatFiles> heatFiles = null;
+            Map<String, HeatFiles> heatFiles = null;
 //            Map <String, HeatFiles> heatFiles = db.getHeatFiles (vnf.getId ());
-            Map <String, Object> heatFilesObjects = new HashMap <> ();
+            Map<String, Object> heatFilesObjects = new HashMap<>();
 
             // Add ability to turn on adding get_files with volume requests (by property).
             boolean addGetFilesOnVolumeReq = false;
             try {
-                String propertyString = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_VNF_ADAPTER).getProperty(MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ, null);
+                String propertyString = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_VNF_ADAPTER)
+                    .getProperty(MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ, null);
                 if ("true".equalsIgnoreCase(propertyString) || "y".equalsIgnoreCase(propertyString)) {
                     addGetFilesOnVolumeReq = true;
                     LOGGER.debug("AddGetFilesOnVolumeReq - setting to true! " + propertyString);
                 }
             } catch (Exception e) {
-                LOGGER.debug("An error occured trying to get property " + MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ + " - default to false", e);
+                LOGGER.debug("An error occured trying to get property " + MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ
+                    + " - default to false", e);
             }
             if (!isVolumeRequest || addGetFilesOnVolumeReq) {
-                LOGGER.debug("In MsoVnfAdapterImpl updateVfModule, about to call db.getHeatFilesForVfModule avec vfModuleId="
+                LOGGER.debug(
+                    "In MsoVnfAdapterImpl updateVfModule, about to call db.getHeatFilesForVfModule avec vfModuleId="
                         + vf.getModelUUID());
 
                 heatFiles = db.getHeatFilesForVfModule(vf.getModelUUID());
@@ -1845,35 +1911,39 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                     // add these to stack - to be done in createStack
                     // here, we will map them to Map<String, Object> from Map<String, HeatFiles>
                     // this will match the nested templates format
-                    LOGGER.debug ("Contents of heatFiles - to be added to files: on stack:");
+                    LOGGER.debug("Contents of heatFiles - to be added to files: on stack:");
 
-                    for (Map.Entry<String, HeatFiles> entry : heatFiles.entrySet ()) {
+                    for (Map.Entry<String, HeatFiles> entry : heatFiles.entrySet()) {
                         String heatFileName = entry.getKey();
                         HeatFiles value = entry.getValue();
                         if (heatFileName.startsWith("_ERROR|")) {
                             // This means there was an invalid entry in VF_MODULE_TO_HEAT_FILES table - the heat file it pointed to could not be found.
-                            String heatFileId = heatFileName.substring(heatFileName.lastIndexOf("|")+1);
-                            String error = "Create: No HEAT_FILES entry in catalog database for " + vfModuleType + " at HEAT_FILES index=" + heatFileId;
+                            String heatFileId = heatFileName.substring(heatFileName.lastIndexOf("|") + 1);
+                            String error = "Create: No HEAT_FILES entry in catalog database for " + vfModuleType
+                                + " at HEAT_FILES index=" + heatFileId;
                             LOGGER.debug(error);
-                            LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "HEAT_FILES entry not found at " + heatFileId, vfModuleType, "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
-                            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+                            LOGGER
+                                .error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "HEAT_FILES entry not found at " + heatFileId,
+                                    vfModuleType, "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
+                            LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                                MsoLogger.ResponseCode.DataNotFound, error);
                             // Alarm on this error, configuration must be fixed
-                            alarmLogger.sendAlarm (MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
-                            throw new VnfException (error, MsoExceptionCategory.INTERNAL);
+                            alarmLogger.sendAlarm(MSO_CONFIGURATION_ERROR, MsoAlarmLogger.CRITICAL, error);
+                            throw new VnfException(error, MsoExceptionCategory.INTERNAL);
                         }
-                        String heatFileBody = value.getFileBody ();
-                        LOGGER.debug (heatFileName + " -> " + heatFileBody);
-                        heatFilesObjects.put (heatFileName, heatFileBody);
+                        String heatFileBody = value.getFileBody();
+                        LOGGER.debug(heatFileName + " -> " + heatFileBody);
+                        heatFilesObjects.put(heatFileName, heatFileBody);
                     }
                 } else {
-                    LOGGER.debug ("No heat files found -nothing to do here");
+                    LOGGER.debug("No heat files found -nothing to do here");
                     heatFilesObjects = null;
                 }
             }
 
             // Check that required parameters have been supplied
             StringBuilder missingParams = null;
-            List <String> paramList = new ArrayList <> ();
+            List<String> paramList = new ArrayList<>();
 
             // New for 1510 - consult the PARAM_ALIAS field to see if we've been
             // supplied an alias. Only check if we don't find it initially.
@@ -1883,23 +1953,23 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
             boolean haveEnvironmentParameters = false;
             boolean checkRequiredParameters = true;
             try {
-                String propertyString = msoPropertiesFactory.getMsoJavaProperties (MSO_PROP_VNF_ADAPTER)
-                                                     .getProperty (MsoVnfAdapterImpl.CHECK_REQD_PARAMS,null);
-                if ("false".equalsIgnoreCase (propertyString) || "n".equalsIgnoreCase (propertyString)) {
+                String propertyString = msoPropertiesFactory.getMsoJavaProperties(MSO_PROP_VNF_ADAPTER)
+                    .getProperty(MsoVnfAdapterImpl.CHECK_REQD_PARAMS, null);
+                if ("false".equalsIgnoreCase(propertyString) || "n".equalsIgnoreCase(propertyString)) {
                     checkRequiredParameters = false;
-                    LOGGER.debug ("CheckRequiredParameters is FALSE. Will still check but then skip blocking..."
-                                  + MsoVnfAdapterImpl.CHECK_REQD_PARAMS);
+                    LOGGER.debug("CheckRequiredParameters is FALSE. Will still check but then skip blocking..."
+                        + MsoVnfAdapterImpl.CHECK_REQD_PARAMS);
                 }
             } catch (Exception e) {
                 // No problem - default is true
-                LOGGER.debug ("An exception occured trying to get property " + MsoVnfAdapterImpl.CHECK_REQD_PARAMS, e);
+                LOGGER.debug("An exception occured trying to get property " + MsoVnfAdapterImpl.CHECK_REQD_PARAMS, e);
             }
             // 1604 - Add enhanced environment & parameter checking
             // Part 1: parse envt entries to see if reqd parameter is there (before used a simple grep
             // Part 2: only submit to openstack the parameters in the envt that are in the heat template
             // Note this also removes any comments
             MsoHeatEnvironmentEntry mhee = null;
-            if (heatEnvironmentString != null && heatEnvironmentString.toLowerCase ().contains ("parameters:")) {
+            if (heatEnvironmentString != null && heatEnvironmentString.toLowerCase().contains("parameters:")) {
                 LOGGER.debug("Enhanced environment checking enabled - 1604");
                 mhee = MsoHeatEnvironmentEntry.create(heatEnvironmentString);
                 StringBuilder sb2 = new StringBuilder("\nHeat Template Parameters:\n");
@@ -1921,12 +1991,12 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
             HashMap<String, JsonNode> jsonParams = new HashMap<>();
             boolean hasJson = false;
 
-            for (HeatTemplateParam parm : heatTemplate.getParameters ()) {
-                LOGGER.debug ("Parameter:'" + parm.getParamName ()
-                              + "', isRequired="
-                              + parm.isRequired ()
-                              + ", alias="
-                              + parm.getParamAlias ());
+            for (HeatTemplateParam parm : heatTemplate.getParameters()) {
+                LOGGER.debug("Parameter:'" + parm.getParamName()
+                    + "', isRequired="
+                    + parm.isRequired()
+                    + ", alias="
+                    + parm.getParamAlias());
                 // handle json
                 String parameterType = parm.getParamType();
                 if (parameterType == null || "".equals(parameterType.trim())) {
@@ -1934,7 +2004,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                 }
                 JsonNode jsonNode = null;
                 if ("json".equalsIgnoreCase(parameterType) && inputs != null) {
-                    if (inputs.containsKey(parm.getParamName()) ) {
+                    if (inputs.containsKey(parm.getParamName())) {
                         hasJson = true;
                         String jsonString = null;
                         try {
@@ -1944,12 +2014,12 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                             //TODO - what to do here?
                             //for now - send the error to debug, but just leave it as a String
                             String errorMessage = jpe.getMessage();
-                            LOGGER.debug("Json Error Converting " + parm.getParamName() + " - " + errorMessage,jpe);
+                            LOGGER.debug("Json Error Converting " + parm.getParamName() + " - " + errorMessage, jpe);
                             hasJson = false;
                             jsonNode = null;
                         } catch (Exception e) {
                             // or here?
-                            LOGGER.debug("Json Error Converting " + parm.getParamName() + " " + e.getMessage(),e);
+                            LOGGER.debug("Json Error Converting " + parm.getParamName() + " " + e.getMessage(), e);
                             hasJson = false;
                             jsonNode = null;
                         }
@@ -1959,56 +2029,55 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                     } else if (inputs.containsKey(parm.getParamAlias())) {
                         hasJson = true;
                         String jsonString = null;
-                           try {
+                        try {
                             jsonString = inputs.get(parm.getParamAlias());
                             jsonNode = new ObjectMapper().readTree(jsonString);
                         } catch (JsonParseException jpe) {
                             //TODO - what to do here?
                             //for now - send the error to debug, but just leave it as a String
                             String errorMessage = jpe.getMessage();
-                            LOGGER.debug("Json Error Converting " + parm.getParamName() + " - " + errorMessage,jpe);
+                            LOGGER.debug("Json Error Converting " + parm.getParamName() + " - " + errorMessage, jpe);
                             hasJson = false;
                             jsonNode = null;
                         } catch (Exception e) {
                             // or here?
-                            LOGGER.debug("Json Error Converting " + parm.getParamName() + " " + e.getMessage(),e);
+                            LOGGER.debug("Json Error Converting " + parm.getParamName() + " " + e.getMessage(), e);
                             hasJson = false;
                             jsonNode = null;
                         }
-                           if (jsonNode != null) {
-                               // Notice here - we add it to the jsonParams hashMap with the actual name -
-                               // then manipulate the inputs so when we check for aliases below - it will not
-                               // get flagged.
-                               jsonParams.put(parm.getParamName(), jsonNode);
-                               inputs.remove(parm.getParamAlias());
-                               inputs.put(parm.getParamName(), jsonString);
-                           }
+                        if (jsonNode != null) {
+                            // Notice here - we add it to the jsonParams hashMap with the actual name -
+                            // then manipulate the inputs so when we check for aliases below - it will not
+                            // get flagged.
+                            jsonParams.put(parm.getParamName(), jsonNode);
+                            inputs.remove(parm.getParamAlias());
+                            inputs.put(parm.getParamName(), jsonString);
+                        }
                     } //TODO add a check for the parameter in the env file
                 }
 
-                if (parm.isRequired () && (inputs == null || !inputs.containsKey (parm.getParamName ()))) {
-                    if (inputs.containsKey (parm.getParamAlias ())) {
+                if (parm.isRequired() && (inputs == null || !inputs.containsKey(parm.getParamName()))) {
+                    if (inputs.containsKey(parm.getParamAlias())) {
                         // They've submitted using an alias name. Remove that from inputs, and add back using real name.
-                        String realParamName = parm.getParamName ();
-                        String alias = parm.getParamAlias ();
-                        String value = inputs.get (alias);
-                        LOGGER.debug ("*Found an Alias: paramName=" + realParamName
-                                      + ",alias="
-                                      + alias
-                                      + ",value="
-                                      + value);
-                        inputs.remove (alias);
-                        inputs.put (realParamName, value);
-                        LOGGER.debug (alias + " entry removed from inputs, added back using " + realParamName);
+                        String realParamName = parm.getParamName();
+                        String alias = parm.getParamAlias();
+                        String value = inputs.get(alias);
+                        LOGGER.debug("*Found an Alias: paramName=" + realParamName
+                            + ",alias="
+                            + alias
+                            + ",value="
+                            + value);
+                        inputs.remove(alias);
+                        inputs.put(realParamName, value);
+                        LOGGER.debug(alias + " entry removed from inputs, added back using " + realParamName);
                     }
                     // enhanced - check if it's in the Environment (note: that method
                     else if (mhee != null && mhee.containsParameter(parm.getParamName())) {
 
-                        LOGGER.debug ("Required parameter " + parm.getParamName ()
-                                      + " appears to be in environment - do not count as missing");
-                    }
-                    else {
-                        LOGGER.debug ("adding to missing parameters list: " + parm.getParamName ());
+                        LOGGER.debug("Required parameter " + parm.getParamName()
+                            + " appears to be in environment - do not count as missing");
+                    } else {
+                        LOGGER.debug("adding to missing parameters list: " + parm.getParamName());
                         if (missingParams == null) {
                             missingParams = new StringBuilder(parm.getParamName());
                         } else {
@@ -2016,20 +2085,22 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
                         }
                     }
                 }
-                paramList.add (parm.getParamName ());
+                paramList.add(parm.getParamName());
             }
             if (missingParams != null) {
                 // Problem - missing one or more required parameters
                 if (checkRequiredParameters) {
-                String error = "Update VNF: Missing Required inputs: " + missingParams;
-                LOGGER.error (MessageEnum.RA_MISSING_PARAM, missingParams.toString(), "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
-                    LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
-                throw new VnfException (error, MsoExceptionCategory.USERDATA);
+                    String error = "Update VNF: Missing Required inputs: " + missingParams;
+                    LOGGER.error(MessageEnum.RA_MISSING_PARAM, missingParams.toString(), "OpenStack", "",
+                        MsoLogger.ErrorCode.DataError, error);
+                    LOGGER.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest,
+                        error);
+                    throw new VnfException(error, MsoExceptionCategory.USERDATA);
                 } else {
-                    LOGGER.debug ("found missing parameters - but checkRequiredParameters is false - will not block");
+                    LOGGER.debug("found missing parameters - but checkRequiredParameters is false - will not block");
                 }
             } else {
-                LOGGER.debug ("No missing parameters found - ok to proceed");
+                LOGGER.debug("No missing parameters found - ok to proceed");
             }
 
             // Just submit the envt entry as received from the database
@@ -2040,13 +2111,14 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
 
             // Remove any extraneous parameters (don't throw an error)
             if (inputs != null) {
-                List <String> extraParams = new ArrayList <> ();
-                extraParams.addAll (inputs.keySet ());
+                List<String> extraParams = new ArrayList<>();
+                extraParams.addAll(inputs.keySet());
                 // This is not a valid parameter for this template
-                extraParams.removeAll (paramList);
-                if (!extraParams.isEmpty ()) {
-                    LOGGER.warn (MessageEnum.RA_VNF_EXTRA_PARAM, vnfType, extraParams.toString(), "OpenStack", "", MsoLogger.ErrorCode.DataError, "Extra params");
-                    inputs.keySet ().removeAll (extraParams);
+                extraParams.removeAll(paramList);
+                if (!extraParams.isEmpty()) {
+                    LOGGER.warn(MessageEnum.RA_VNF_EXTRA_PARAM, vnfType, extraParams.toString(), "OpenStack", "",
+                        MsoLogger.ErrorCode.DataError, "Extra params");
+                    inputs.keySet().removeAll(extraParams);
                 }
             }
             // 1607 - when we get here - we have clean inputs. Create inputsTwo in case we have json
@@ -2065,54 +2137,60 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
             }
 
             // "Fix" the template if it has CR/LF (getting this from Oracle)
-            String template = heatTemplate.getHeatTemplate ();
-            template = template.replaceAll ("\r\n", "\n");
+            String template = heatTemplate.getHeatTemplate();
+            template = template.replaceAll("\r\n", "\n");
 
             // Have the tenant. Now deploy the stack itself
             // Ignore MsoTenantNotFound and MsoStackAlreadyExists exceptions
             // because we already checked for those.
-            long updateStackStarttime = System.currentTimeMillis ();
+            long updateStackStarttime = System.currentTimeMillis();
             try {
                 if (!hasJson) {
-                    heatStack = heatU.updateStack (cloudSiteId,
-                                               tenantId,
-                                               vfModuleName,
-                                               template,
-                                               copyStringInputs (inputs),
-                                               true,
-                                               heatTemplate.getTimeoutMinutes (),
-                                               newEnvironmentString,
-                                               //heatEnvironmentString,
-                                               nestedTemplatesChecked,
-                                               heatFilesObjects);
-                    LOGGER.recordMetricEvent (updateStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully receive response from Open Stack", "OpenStack", "UpdateStack", null);
+                    heatStack = heatU.updateStack(cloudSiteId,
+                        tenantId,
+                        vfModuleName,
+                        template,
+                        copyStringInputs(inputs),
+                        true,
+                        heatTemplate.getTimeoutMinutes(),
+                        newEnvironmentString,
+                        //heatEnvironmentString,
+                        nestedTemplatesChecked,
+                        heatFilesObjects);
+                    LOGGER.recordMetricEvent(updateStackStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Successfully receive response from Open Stack", "OpenStack",
+                        "UpdateStack", null);
                 } else {
-                    heatStack = heatU.updateStack (cloudSiteId,
-                                               tenantId,
-                                               vfModuleName,
-                                               template,
-                                               inputsTwo,
-                                               true,
-                                               heatTemplate.getTimeoutMinutes (),
-                                               newEnvironmentString,
-                                               //heatEnvironmentString,
-                                               nestedTemplatesChecked,
-                                               heatFilesObjects);
-                    LOGGER.recordMetricEvent (updateStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully receive response from Open Stack", "OpenStack", "UpdateStack", null);
+                    heatStack = heatU.updateStack(cloudSiteId,
+                        tenantId,
+                        vfModuleName,
+                        template,
+                        inputsTwo,
+                        true,
+                        heatTemplate.getTimeoutMinutes(),
+                        newEnvironmentString,
+                        //heatEnvironmentString,
+                        nestedTemplatesChecked,
+                        heatFilesObjects);
+                    LOGGER.recordMetricEvent(updateStackStarttime, MsoLogger.StatusCode.COMPLETE,
+                        MsoLogger.ResponseCode.Suc, "Successfully receive response from Open Stack", "OpenStack",
+                        "UpdateStack", null);
 
                 }
             } catch (MsoException me) {
-                me.addContext ("UpdateVFModule");
+                me.addContext("UpdateVFModule");
                 String error = "Update VFModule " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + me;
-                LOGGER.recordMetricEvent (updateStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "UpdateStack", null);
-                LOGGER.error (MessageEnum.RA_UPDATE_VNF_ERR, vfModuleType, cloudSiteId, tenantId, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Exception - " + error, me);
-                LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-                throw new VnfException (me);
+                LOGGER.recordMetricEvent(updateStackStarttime, MsoLogger.StatusCode.ERROR,
+                    MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "UpdateStack", null);
+                LOGGER.error(MessageEnum.RA_UPDATE_VNF_ERR, vfModuleType, cloudSiteId, tenantId, "OpenStack", "",
+                    MsoLogger.ErrorCode.DataError, "Exception - " + error, me);
+                LOGGER
+                    .recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
+                        error);
+                throw new VnfException(me);
             }
-        } finally {
-            // Make sure DB session is closed
-            db.close ();
         }
+        // Make sure DB session is closed
 
         // Reach this point if updateStack is successful.
         // Populate remaining rollback info and response parameters.
index 53300c9..3646b29 100755 (executable)
@@ -35,8 +35,8 @@ public class VduInfo {
        private String vduInstanceId = "";
        private String vduInstanceName = "";
        private VduStatus status = VduStatus.NOTFOUND;
-       private Map<String,Object> outputs = new HashMap<String,Object>();
-       private Map<String,Object> inputs = new HashMap<String,Object>();
+       private Map<String,Object> outputs = new HashMap<>();
+       private Map<String,Object> inputs = new HashMap<>();
        private String lastAction;
        private String actionStatus;
        private String errorMessage;
index 3452a10..2118eec 100755 (executable)
@@ -88,7 +88,7 @@ public interface VduPlugin {
                                String tenantId,
                                String vduInstanceName,
                                VduBlueprint vduBlueprint,
-                               Map <String, ? extends Object> inputs,
+                               Map <String, ?> inputs,
                                String environmentFile,
                                int timeoutMinutes,
                                boolean suppressBackout)
@@ -145,7 +145,7 @@ public interface VduPlugin {
      * @param tenantId The cloud tenant in which to delete the VDU.
      * @param vduInstanceId The unique id of the deployment to delete.
      * @param timeoutMinutes Timeout after which the delete action will be cancelled
-     * @param deleteBlueprint Flag to also delete the blueprint
+     * @param keepBlueprintLoaded Flag to also delete the blueprint
      * 
      * @return A VduInfo object, representing the state of the instance just prior to deletion.
      * 
@@ -198,7 +198,7 @@ public interface VduPlugin {
                                String tenantId,
                                String vduInstanceId,
                                VduBlueprint vduBlueprint,
-                               Map <String, ? extends Object> inputs,
+                               Map <String, ?> inputs,
                                String environmentFile,
                                int timeoutMinutes)
                        throws MsoException;
index a045b00..acde315 100644 (file)
@@ -44,7 +44,7 @@ public class MsoVnfAdapterAsyncImplTest {
                try {\r
 \r
                        instance.createVnfA("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",\r
-                                       "volumeGroupHeatStackId|1", new HashMap<String, String>(), Boolean.FALSE, Boolean.TRUE, "messageId",\r
+                                       "volumeGroupHeatStackId|1", new HashMap<>(), Boolean.FALSE, Boolean.TRUE, "messageId",\r
                                        null, "http://org.openecomp.mso/notify/adapterNotify/updateVnfNotificationRequest");\r
                } catch (Exception e) {\r
 \r
index 6f01954..eec2257 100644 (file)
@@ -48,8 +48,8 @@ public class MsoVnfAdapterImplTest {
                try {\r
                        instance.createVfModule("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",\r
                                        "volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,\r
-                                       Boolean.FALSE, Boolean.TRUE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),\r
-                                       new Holder<VnfRollback>());\r
+                                       Boolean.FALSE, Boolean.TRUE, msoRequest, new Holder<>(), new Holder<>(),\r
+                new Holder<>());\r
                } catch (Exception e) {\r
 \r
                }\r
@@ -67,8 +67,8 @@ public class MsoVnfAdapterImplTest {
                try {\r
                        instance.updateVfModule("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",\r
                                        "volumeGroupHeatStackId|1", "baseVfHeatStackId", "vfModuleStackId",\r
-                                       "88a6ca3ee0394ade9403f075db23167e", map, msoRequest, new Holder<Map<String, String>>(),\r
-                                       new Holder<VnfRollback>());\r
+                                       "88a6ca3ee0394ade9403f075db23167e", map, msoRequest, new Holder<>(),\r
+                new Holder<>());\r
                } catch (Exception e) {\r
 \r
                }\r
@@ -82,7 +82,7 @@ public class MsoVnfAdapterImplTest {
                msoRequest.setServiceInstanceId("12345");\r
                try {\r
                        instance.deleteVfModule("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", msoRequest,\r
-                                       new Holder<Map<String, String>>());\r
+                new Holder<>());\r
                } catch (Exception e) {\r
 \r
                }\r
index f6e79e1..d898a65 100644 (file)
@@ -55,10 +55,10 @@ public class QueryTest {
             String cloudId = "MT";
             String tenantId = "MSO_Test";
             String vnfName = "VNF_TEST1";
-            Holder<Boolean> vnfExists = new Holder<Boolean>();
-            Holder<String> vnfId = new Holder<String>();
-            Holder<VnfStatus> status = new Holder<VnfStatus>();
-            Holder<Map<String, String>> outputs = new Holder<Map<String, String>>();
+            Holder<Boolean> vnfExists = new Holder<>();
+            Holder<String> vnfId = new Holder<>();
+            Holder<VnfStatus> status = new Holder<>();
+            Holder<Map<String, String>> outputs = new Holder<>();
 
             vnfAdapter.queryVnf(cloudId, tenantId, vnfName, null,
                     vnfExists, vnfId, status, outputs);
@@ -82,10 +82,10 @@ public class QueryTest {
             String cloudId = "MT";
             String tenantId = "MSO_Test";
             String vnfName = "VNF_TEST1";
-            Holder<Boolean> vnfExists = new Holder<Boolean>();
-            Holder<String> vnfId = new Holder<String>();
-            Holder<VnfStatus> status = new Holder<VnfStatus>();
-            Holder<Map<String, String>> outputs = new Holder<Map<String, String>>();
+            Holder<Boolean> vnfExists = new Holder<>();
+            Holder<String> vnfId = new Holder<>();
+            Holder<VnfStatus> status = new Holder<>();
+            Holder<Map<String, String>> outputs = new Holder<>();
 
             vnfAdapter.queryVnf(cloudId, tenantId, vnfName, null,
                     vnfExists, vnfId, status, outputs);
@@ -101,10 +101,10 @@ public class QueryTest {
             String cloudId = "MT";
             String tenantId = "MSO_Test";
             String vnfName = "VNF_TEST1";
-            Holder<Boolean> vnfExists = new Holder<Boolean>();
-            Holder<String> vnfId = new Holder<String>();
-            Holder<VnfStatus> status = new Holder<VnfStatus>();
-            Holder<Map<String, String>> outputs = new Holder<Map<String, String>>();
+            Holder<Boolean> vnfExists = new Holder<>();
+            Holder<String> vnfId = new Holder<>();
+            Holder<VnfStatus> status = new Holder<>();
+            Holder<Map<String, String>> outputs = new Holder<>();
 
             vnfAdapter.queryVnf(cloudId, tenantId, vnfName, null,
                     vnfExists, vnfId, status, outputs);
index 52e1797..000ed8a 100644 (file)
@@ -42,16 +42,16 @@ public class VnfCreateTest {
                String tenantName = "John_Test";
                String vnfType = "ApacheDemo";
                String vnfName = "AdapterTest";
-               Map<String,String> inputs = new HashMap<String,String>();
+               Map<String,String> inputs = new HashMap<>();
                inputs.put("vnf_id", "abc");
                inputs.put("extra", "whocares");
                inputs.put("private_subnet_gateway", "10.4.1.1");
                inputs.put("private_subnet_cidr", "10.4.1.0/29");
                
                // Web Service Outputs
-               Holder<String> vnfId = new Holder<String>();
-               Holder<Map<String,String>> outputs = new Holder<Map<String,String>>();
-               Holder<VnfRollback> vnfRollback = new Holder<VnfRollback>();
+               Holder<String> vnfId = new Holder<>();
+               Holder<Map<String,String>> outputs = new Holder<>();
+               Holder<VnfRollback> vnfRollback = new Holder<>();
 
                try {
                        vnfAdapter.createVnf(cloudId, tenantName, vnfType,null, vnfName, null, null, inputs, false, true, null,
index 84f2f2f..bbffddf 100644 (file)
@@ -39,10 +39,10 @@ public class VnfQueryTest {
                String cloudId = "MT";
                String tenantId = "MSO_Test";
                String vnfName = "VNF_TEST1";
-               Holder<Boolean> vnfExists = new Holder<Boolean>();
-               Holder<String> vnfId = new Holder<String>();
-               Holder<VnfStatus> status = new Holder<VnfStatus>();
-               Holder<Map<String,String>> outputs = new Holder<Map<String,String>>();
+               Holder<Boolean> vnfExists = new Holder<>();
+               Holder<String> vnfId = new Holder<>();
+               Holder<VnfStatus> status = new Holder<>();
+               Holder<Map<String,String>> outputs = new Holder<>();
                
                try {
                        vnfAdapter.queryVnf(cloudId, tenantId, vnfName, null,
index 21a71cc..019ae1e 100644 (file)
@@ -60,7 +60,7 @@ public class VduBlueprintTest {
     @Test
     public void testGetTemplateFiles() {
         byte[] templateFileData = "some template file data".getBytes();
-        templateFiles = new HashMap<String, byte[]>();
+        templateFiles = new HashMap<>();
         templateFiles.put("templateKey1", templateFileData);
         vduBlueprint.setTemplateFiles(templateFiles);
         Assert.assertNotNull(vduBlueprint.getTemplateFiles());
@@ -71,7 +71,7 @@ public class VduBlueprintTest {
     @Test
     public void testGetAttachedFiles() {
         byte[] attachedFileData = "some file data".getBytes();
-        attachedFiles = new HashMap<String, byte[]>();
+        attachedFiles = new HashMap<>();
         attachedFiles.put("attachedKey1", attachedFileData);
         vduBlueprint.setAttachedFiles(attachedFiles);
         Assert.assertNotNull(vduBlueprint.getAttachedFiles());
diff --git a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/vdu/utils/VduInfoTest.java b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/vdu/utils/VduInfoTest.java
new file mode 100644 (file)
index 0000000..98a0003
--- /dev/null
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 TechMahindra
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.vdu.utils;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class VduInfoTest {
+
+    private VduInfo vduInfo;
+    private VduStatus status = VduStatus.NOTFOUND;
+    private Map<String, Object> outputs;
+    private Map<String, Object> inputs;
+
+    @Before
+    public void setUp() {
+        vduInfo = new VduInfo();
+    }
+
+    @Test
+    public void testGetVnfInstanceId() {
+        String vnfInstanceId = "vnfInstanceId";
+        vduInfo.setVnfInstanceId(vnfInstanceId);
+        Assert.assertNotNull(vduInfo.getVnfInstanceId());
+        Assert.assertEquals(vduInfo.getVnfInstanceId(), "vnfInstanceId");
+    }
+
+    @Test
+    public void testGetVnfInstanceName() {
+        String vnfInstanceName = "vnfInstanceName";
+        vduInfo.setVnfInstanceName(vnfInstanceName);
+        Assert.assertNotNull(vduInfo.getVnfInstanceName());
+        Assert.assertEquals(vduInfo.getVnfInstanceName(), "vnfInstanceName");
+    }
+
+    @Test
+    public void testGetStatus() {
+        vduInfo.setStatus(status);
+        Assert.assertNotNull(vduInfo.getStatus());
+        Assert.assertEquals(status, vduInfo.getStatus());
+    }
+
+    @Test
+    public void testGetOutputs() {
+        Object obj = new Object();
+        String str = "some text";
+        outputs = new HashMap<>();
+        outputs.put(str, obj);
+        vduInfo.setOutputs(outputs);
+        Assert.assertNotNull(vduInfo.getOutputs());
+        Assert.assertTrue(vduInfo.getOutputs().containsKey(str));
+        Assert.assertTrue(vduInfo.getOutputs().containsValue(obj));
+    }
+
+    @Test
+    public void testGetInputs() {
+        Object obj = new Object();
+        String str = "some text";
+        inputs = new HashMap<>();
+        inputs.put(str, obj);
+        vduInfo.setInputs(inputs);
+        Assert.assertNotNull(vduInfo.getInputs());
+        Assert.assertTrue(vduInfo.getInputs().containsKey(str));
+        Assert.assertTrue(vduInfo.getInputs().containsValue(obj));
+    }
+
+}
index 6877d76..2534658 100644 (file)
@@ -7,7 +7,6 @@
                <version>1.2.0-SNAPSHOT</version>
        </parent>
 
-       <groupId>org.onap.so</groupId>
        <artifactId>adapters</artifactId>
        <name>MSO Adapters</name>
        <description>Adapters for MSO</description>
index f35403c..0af9923 100755 (executable)
 
     <groupId>aria-client</groupId>
     <artifactId>aria-client</artifactId>
-    <version>1.1.0-SNAPSHOT</version>
+    <version>1.2.0-SNAPSHOT</version>
+
+    <parent>
+        <groupId>org.onap.so</groupId>
+       <artifactId>aria</artifactId>
+       <version>1.2.0-SNAPSHOT</version>
+       <relativePath>../pom.xml</relativePath>
+    </parent>
 
     <dependencies>
         <dependency>
index a754d78..95ef93b 100644 (file)
@@ -5,10 +5,12 @@
                <groupId>org.onap.so</groupId>
                <artifactId>so</artifactId>
                <version>1.2.0-SNAPSHOT</version>
+               <relativePath>../pom.xml</relativePath>
        </parent>
 
-       <groupId>org.onap.so</groupId>
        <artifactId>aria</artifactId>
+       <version>1.2.0-SNAPSHOT</version>
+
        <name>ARIA related artifacts</name>
        <description>ARIA related artifacts</description>
        <packaging>pom</packaging>
index c3add03..027e470 100644 (file)
@@ -7,7 +7,6 @@
                <version>1.2.0-SNAPSHOT</version>
        </parent>
 
-       <groupId>org.onap.so</groupId>
        <artifactId>asdc-controller</artifactId>
        <name>asdc-controller</name>
        <description>ASDC CLient and Controller</description>
index 6cfe90b..e069989 100644 (file)
@@ -399,7 +399,7 @@ public class ASDCConfiguration implements IConfiguration {
 
         MsoJsonProperties msoProp;
         try {
-            List <String> result = new ArrayList <String> ();
+            List <String> result = new ArrayList<>();
             msoProp = new MsoPropertiesFactory ().getMsoJsonProperties (MSO_PROP_ASDC);
 
             if (msoProp.getJsonRootNode ().get (PARAMETER_PATTERN) != null) {
index 251888e..430bd10 100644 (file)
@@ -41,7 +41,7 @@ import org.openecomp.mso.properties.MsoPropertiesFactory;
 public class ASDCGlobalController {
 
     private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.ASDC);
-    private Map <String,ASDCController> controllers = new HashMap <String,ASDCController> ();
+    private Map <String,ASDCController> controllers = new HashMap<>();
         
     private MsoJsonProperties msoProp= null;
     
@@ -78,7 +78,7 @@ public class ASDCGlobalController {
     
     /**
      * Check that controllers list needs to be updated or not.
-     * @param return true if the list has been updated
+     * return true if the list has been updated
      */
     private boolean updateControllersListIfNeeded ()  {
        boolean updateNeeded=false;
@@ -149,7 +149,7 @@ public class ASDCGlobalController {
     }
 
     public void closeASDC () {
-       List<String> controllerToRemove = new LinkedList<String>();
+       List<String> controllerToRemove = new LinkedList<>();
        
         for (ASDCController controller : controllers.values()) {
             try {
index be86574..c9bde98 100644 (file)
@@ -47,7 +47,7 @@ public final class VfModuleStructure {
                vfModuleMetadata = vfmoduleMetadata;
                parentVfResource = vfParentResource;
 
-               artifactsMap = new HashMap<String, List<VfModuleArtifact>>();
+               artifactsMap = new HashMap<>();
 
                for (String artifactUUID:this.vfModuleMetadata.getArtifacts()) {
                        if (vfParentResource.getArtifactsMapByUUID().containsKey(artifactUUID)) {
@@ -64,7 +64,7 @@ public final class VfModuleStructure {
                        artifactsMap.get(vfModuleArtifact.getArtifactInfo().getArtifactType()).add(vfModuleArtifact);
 
                } else {
-                       List<VfModuleArtifact> nestedList = new LinkedList<VfModuleArtifact>();
+                       List<VfModuleArtifact> nestedList = new LinkedList<>();
                        nestedList.add(vfModuleArtifact);
 
                        artifactsMap.put(vfModuleArtifact.getArtifactInfo().getArtifactType(), nestedList);
@@ -73,7 +73,7 @@ public final class VfModuleStructure {
 
        public List<VfModuleArtifact> getOrderedArtifactList() {
 
-               List <VfModuleArtifact> artifactsList = new LinkedList <VfModuleArtifact>();
+               List <VfModuleArtifact> artifactsList = new LinkedList<>();
 
                artifactsList.addAll(artifactsMap.get(ASDCConfiguration.HEAT));
                artifactsList.addAll(artifactsMap.get(ASDCConfiguration.HEAT_ENV));
index c2879a4..e9e39d7 100644 (file)
@@ -101,8 +101,8 @@ public final class VfResourceStructure {
                resourceInstance=resourceinstance;
 
 
-               vfModulesStructureList = new LinkedList<VfModuleStructure>();
-               artifactsMapByUUID =  new HashMap<String, VfModuleArtifact>();
+               vfModulesStructureList = new LinkedList<>();
+               artifactsMapByUUID = new HashMap<>();
        }
 
        //@Override
index f22debc..8c08d3e 100644 (file)
@@ -419,39 +419,34 @@ public class ToscaResourceInstaller {// implements IVfResourceInstaller {
                                 toscaResourceStruct.getSdcCsarHelper().getVfModulesByVf(vfCustomizationUUID);\r
                         logger.debug("vfGroups:" + vfGroups.toString());\r
 \r
-                        Collections.sort(vfGroups, new Comparator<org.openecomp.sdc.toscaparser.api.Group>() {\r
-\r
-                            @Override\r
-                            public int compare(org.openecomp.sdc.toscaparser.api.Group group1,\r
-                                    org.openecomp.sdc.toscaparser.api.Group group2) {\r
-\r
-                                // Field name1Field = group1.class.getDeclaredField("name");\r
-                                // name1Field.setAccessible(true);\r
-                                String thisName = group1.getName(); // (String)\r
-                                                                    // name1Field.get(group1);\r
-                                String thatName = group2.getName(); // (String)\r
-                                                                    // name1Field.get(group2);\r
-\r
-                                Matcher m = lastDigit.matcher(thisName);\r
-                                Matcher m2 = lastDigit.matcher(thatName);\r
-\r
-                                String thisDigit = "0";\r
-                                String thatDigit = "0";\r
-                                if(m.find()) {\r
-                                    thisDigit = m.group();\r
-                                } else {\r
-                                    return -1;\r
-                                }\r
-                                if(m2.find()) {\r
-                                    thatDigit = m2.group();\r
-                                } else {\r
-                                    return 1;\r
-                                }\r
+                                               vfGroups.sort((group1, group2) -> {\r
+\r
+                                                       // Field name1Field = group1.class.getDeclaredField("name");\r
+                                                       // name1Field.setAccessible(true);\r
+                                                       String thisName = group1.getName(); // (String)\r
+                                                       // name1Field.get(group1);\r
+                                                       String thatName = group2.getName(); // (String)\r
+                                                       // name1Field.get(group2);\r
+\r
+                                                       Matcher m = lastDigit.matcher(thisName);\r
+                                                       Matcher m2 = lastDigit.matcher(thatName);\r
+\r
+                                                       String thisDigit = "0";\r
+                                                       String thatDigit = "0";\r
+                                                       if (m.find()) {\r
+                                                               thisDigit = m.group();\r
+                                                       } else {\r
+                                                               return -1;\r
+                                                       }\r
+                                                       if (m2.find()) {\r
+                                                               thatDigit = m2.group();\r
+                                                       } else {\r
+                                                               return 1;\r
+                                                       }\r
 \r
-                                return new Integer(thisDigit).compareTo(new Integer(thatDigit));\r
+                                                       return new Integer(thisDigit).compareTo(new Integer(thatDigit));\r
 \r
-                            }\r
-                        });\r
+                                               });\r
 \r
                         logger.debug("vfGroupsAfter:" + vfGroups.toString());\r
 \r
@@ -878,7 +873,7 @@ public class ToscaResourceInstaller {// implements IVfResourceInstaller {
                String vfModuleModelUUID = vfModuleData.getVfModuleModelUUID();\r
                \r
                \r
-               if(vfModuleModelUUID != null && vfModuleModelUUID.indexOf(".") > -1){\r
+               if(vfModuleModelUUID != null && vfModuleModelUUID.contains(".")){\r
                        vfModuleModelUUID = vfModuleModelUUID.substring(0, vfModuleModelUUID.indexOf("."));\r
                }\r
                                        \r
index 2080be1..396784a 100644 (file)
@@ -42,51 +42,15 @@ public class ASDCNotificationLogging {
                if (asdcNotification == null) {
                        return "NULL";
                }
-               StringBuilder buffer = new StringBuilder("ASDC Notification:");
-               buffer.append(System.lineSeparator());
-
-               buffer.append("DistributionID:");
-               buffer.append(testNull(asdcNotification.getDistributionID()));
-               buffer.append(System.lineSeparator());
-
-
-               buffer.append("ServiceName:");
-               buffer.append(testNull(asdcNotification.getServiceName()));
-               buffer.append(System.lineSeparator());
-
-
-               buffer.append("ServiceVersion:");
-               buffer.append(testNull(asdcNotification.getServiceVersion()));
-               buffer.append(System.lineSeparator());
-
-
-               buffer.append("ServiceUUID:");
-               buffer.append(testNull(asdcNotification.getServiceUUID()));
-               buffer.append(System.lineSeparator());
-
-
-               buffer.append("ServiceInvariantUUID:");
-               buffer.append(testNull(asdcNotification.getServiceInvariantUUID()));
-               buffer.append(System.lineSeparator());
-
-
-               buffer.append("ServiceDescription:");
-               buffer.append(testNull(asdcNotification.getServiceDescription()));
-               buffer.append(System.lineSeparator());
-
-
-               buffer.append("Service Artifacts List:");
-               buffer.append(System.lineSeparator());
-               buffer.append(testNull(dumpArtifactInfoList(asdcNotification.getServiceArtifacts())));
-               buffer.append(System.lineSeparator());
-
-               buffer.append("Resource Instances List:");
-               buffer.append(System.lineSeparator());
-               buffer.append(testNull(dumpASDCResourcesList(asdcNotification)));
-               buffer.append(System.lineSeparator());
-
-
-               return buffer.toString();
+        return "ASDC Notification:" + System.lineSeparator() +
+            "DistributionID:" + testNull(asdcNotification.getDistributionID()) + System.lineSeparator() +
+            "ServiceName:" + testNull(asdcNotification.getServiceName()) + System.lineSeparator() +
+            "ServiceVersion:" + testNull(asdcNotification.getServiceVersion()) + System.lineSeparator() +
+            "ServiceUUID:" + testNull(asdcNotification.getServiceUUID()) + System.lineSeparator() +
+            "ServiceInvariantUUID:" + testNull(asdcNotification.getServiceInvariantUUID()) + System.lineSeparator() +
+            "ServiceDescription:" + testNull(asdcNotification.getServiceDescription()) + System.lineSeparator() +
+            "Service Artifacts List:" + System.lineSeparator() + testNull(dumpArtifactInfoList(asdcNotification.getServiceArtifacts())) + System.lineSeparator() +
+            "Resource Instances List:" + System.lineSeparator() + testNull(dumpASDCResourcesList(asdcNotification)) + System.lineSeparator();
        }
 
        public static String dumpCSARNotification(INotificationData asdcNotification, ToscaResourceStructure toscaResourceStructure) {
@@ -418,52 +382,17 @@ public class ASDCNotificationLogging {
                        return null;
                }
 
-               StringBuilder buffer = new StringBuilder("Resource Instance Info:");
-               buffer.append(System.lineSeparator());
-
-               buffer.append("ResourceInstanceName:");
-               buffer.append(testNull(resourceInstance.getResourceInstanceName()));
-               buffer.append(System.lineSeparator());
-
-               buffer.append("ResourceCustomizationUUID:");
-               buffer.append(testNull(resourceInstance.getResourceCustomizationUUID()));
-               buffer.append(System.lineSeparator());
-
-               buffer.append("ResourceInvariantUUID:");
-               buffer.append(testNull(resourceInstance.getResourceInvariantUUID()));
-               buffer.append(System.lineSeparator());
-
-               buffer.append("ResourceName:");
-               buffer.append(testNull(resourceInstance.getResourceName()));
-               buffer.append(System.lineSeparator());
-
-               buffer.append("ResourceType:");
-               buffer.append(testNull(resourceInstance.getResourceType()));
-               buffer.append(System.lineSeparator());
-
-               buffer.append("ResourceUUID:");
-               buffer.append(testNull(resourceInstance.getResourceUUID()));
-               buffer.append(System.lineSeparator());
-
-               buffer.append("ResourceVersion:");
-               buffer.append(testNull(resourceInstance.getResourceVersion()));
-               buffer.append(System.lineSeparator());
-
-               buffer.append("Category:");
-               buffer.append(testNull(resourceInstance.getCategory()));
-               buffer.append(System.lineSeparator());
-
-               buffer.append("SubCategory:");
-               buffer.append(testNull(resourceInstance.getSubcategory()));
-               buffer.append(System.lineSeparator());
-
-               buffer.append("Resource Artifacts List:");
-               buffer.append(System.lineSeparator());
-               buffer.append(testNull(dumpArtifactInfoList(resourceInstance.getArtifacts())));
-               buffer.append(System.lineSeparator());
-
-               return buffer.toString();
-
+        return "Resource Instance Info:" + System.lineSeparator() +
+            "ResourceInstanceName:" + testNull(resourceInstance.getResourceInstanceName()) + System.lineSeparator() +
+            "ResourceCustomizationUUID:" + testNull(resourceInstance.getResourceCustomizationUUID()) + System.lineSeparator() +
+            "ResourceInvariantUUID:" + testNull(resourceInstance.getResourceInvariantUUID()) + System.lineSeparator() +
+            "ResourceName:" + testNull(resourceInstance.getResourceName()) + System.lineSeparator() +
+            "ResourceType:" + testNull(resourceInstance.getResourceType()) + System.lineSeparator() +
+            "ResourceUUID:" + testNull(resourceInstance.getResourceUUID()) + System.lineSeparator() +
+            "ResourceVersion:" + testNull(resourceInstance.getResourceVersion()) + System.lineSeparator() +
+            "Category:" + testNull(resourceInstance.getCategory()) + System.lineSeparator() +
+            "SubCategory:" + testNull(resourceInstance.getSubcategory()) + System.lineSeparator() +
+            "Resource Artifacts List:" + System.lineSeparator() + testNull(dumpArtifactInfoList(resourceInstance.getArtifacts())) + System.lineSeparator();
        }
 
 
index 126114d..f9871b7 100644 (file)
@@ -43,19 +43,15 @@ public class NotificationLogging implements InvocationHandler {
        private static Map<Object, List<Method>> objectMethodsToLog = new HashMap<>();
 
        protected static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.ASDC);
-       
-       private static InvocationHandler handler = new InvocationHandler() {
-               @Override
-               public Object invoke(Object arg0, Method arg1, Object[] arg2)
-                               throws Throwable {
-                       List<Method> methods = objectMethodsToLog.get(arg0);
-                       if ((methods == null) || (methods.isEmpty())) {
-                               // Do nothing for now...
-                               return null;
-                       }
-                       methods.add(arg1);
-                       return arg1.invoke(arg0, arg2);
+
+       private static InvocationHandler handler = (arg0, arg1, arg2) -> {
+               List<Method> methods = objectMethodsToLog.get(arg0);
+               if ((methods == null) || (methods.isEmpty())) {
+                       // Do nothing for now...
+                       return null;
                }
+               methods.add(arg1);
+               return arg1.invoke(arg0, arg2);
        };
        
        public static InvocationHandler getHandler() {
@@ -107,7 +103,7 @@ public class NotificationLogging implements InvocationHandler {
                return buffer.toString();
        }
        
-       private static final boolean isGetter(Method method) {
+       private static boolean isGetter(Method method) {
 
                // Must start with a valid (and known) prefix
                boolean prefixFound = false;
@@ -156,7 +152,7 @@ public class NotificationLogging implements InvocationHandler {
                                INotificationData.class.getClassLoader(),
                                new Class[] { INotificationData.class },
                                NotificationLogging.getHandler());
-               objectMethodsToLog.put(proxy, new ArrayList<Method>());
+               objectMethodsToLog.put(proxy, new ArrayList<>());
        }
        
        private static <T> void methodToLog(T methodCall) {
index a90fdeb..f6f1af5 100644 (file)
@@ -58,7 +58,7 @@ public class YamlEditor {
     }
 
     public synchronized List <String> getYamlNestedFileResourceTypeList () {
-        List <String> typeList = new ArrayList <String> ();
+        List <String> typeList = new ArrayList<>();
 
         @SuppressWarnings("unchecked")
         Map <String, Object> resourceMap = (Map <String, Object>) yml.get ("resources");
@@ -78,7 +78,7 @@ public class YamlEditor {
     }
     
     public synchronized List <String> getYamlResourceTypeList () {
-        List <String> typeList = new ArrayList <String> ();
+        List <String> typeList = new ArrayList<>();
 
         @SuppressWarnings("unchecked")
         Map <String, Object> resourceMap = (Map <String, Object>) yml.get ("resources");
@@ -95,7 +95,7 @@ public class YamlEditor {
     // Within Heat Template, under parameters catalog, it might indicate the default value of the parameter
     // If default value exist, the parameter is not mandatory, otherwise its value should be set
     public synchronized Set <HeatTemplateParam> getParameterList (String artifactUUID) {
-        Set <HeatTemplateParam> paramSet = new HashSet <HeatTemplateParam> ();
+        Set <HeatTemplateParam> paramSet = new HashSet<>();
         @SuppressWarnings("unchecked")
         Map <String, Object> resourceMap = (Map <String, Object>) yml.get ("parameters");
 
@@ -130,11 +130,11 @@ public class YamlEditor {
         @SuppressWarnings("unchecked")
         Map <String, Object> resourceMap = (Map <String, Object>) yml.get ("parameters");
         if (resourceMap == null) {
-            resourceMap = new LinkedHashMap <String, Object> ();
+            resourceMap = new LinkedHashMap<>();
             this.yml.put ("parameters", resourceMap);
         }
         for (HeatTemplateParam heatParam : heatSet) {
-            Map <String, Object> paramInfo = new HashMap <String, Object> ();
+            Map <String, Object> paramInfo = new HashMap<>();
             paramInfo.put ("type", heatParam.getParamType ());
 
             resourceMap.put (heatParam.getParamName (), paramInfo);
index 45bd7cf..5026b51 100644 (file)
@@ -117,7 +117,7 @@ public class ASDCControllerTest {
                Mockito.when(artifactInfo1.getArtifactDescription()).thenReturn("testos artifact1");
 
                // Now provision the NotificationData mock
-               List<IArtifactInfo> listArtifact = new ArrayList<IArtifactInfo>();
+               List<IArtifactInfo> listArtifact = new ArrayList<>();
                listArtifact.add(artifactInfo1);
 
                // Create fake resource Instance
index b752cfb..73c5456 100644 (file)
@@ -109,7 +109,7 @@ public class ASDCGlobalControllerTest {
                Mockito.when(artifactInfo1.getArtifactDescription()).thenReturn("testos artifact1");
 
                // Now provision the NotificationData mock
-               List<IArtifactInfo> listArtifact = new ArrayList<IArtifactInfo>();
+               List<IArtifactInfo> listArtifact = new ArrayList<>();
                listArtifact.add(artifactInfo1);
 
                // Create fake resource Instance
index d7c8315..589968e 100644 (file)
@@ -76,7 +76,7 @@ public class YamlTest {
                        InputStream input = new FileInputStream(new File("src/test/resources/resource-examples/simpleTestWithoutParam.yaml"));
                        YamlEditor decoder = new YamlEditor (IOUtils.toByteArray(input));
                        
-                       Set <HeatTemplateParam> newParamSet = new HashSet <HeatTemplateParam> (); 
+                       Set <HeatTemplateParam> newParamSet = new HashSet<>();
                        
                        HeatTemplateParam heatParam1 = new HeatTemplateParam();
                        heatParam1.setHeatTemplateArtifactUuid("1");
@@ -108,7 +108,7 @@ public class YamlTest {
                        InputStream input = new FileInputStream(new File("src/test/resources/resource-examples/simpleTest.yaml"));
                        YamlEditor decoder = new YamlEditor (IOUtils.toByteArray(input));
                        
-                       Set <HeatTemplateParam> newParamSet = new HashSet <HeatTemplateParam> (); 
+                       Set <HeatTemplateParam> newParamSet = new HashSet<>();
                        
                        HeatTemplateParam heatParam1 = new HeatTemplateParam();
                        heatParam1.setHeatTemplateArtifactUuid("1");
index a4563c6..9c20a08 100644 (file)
@@ -143,7 +143,7 @@ public class ToscaResourceInstallerTest {
                distributionClient = Mockito.mock(IDistributionClient.class);\r
 \r
                // Now provision the NotificationData mock\r
-               List<IArtifactInfo> listArtifact = new ArrayList<IArtifactInfo>();\r
+               List<IArtifactInfo> listArtifact = new ArrayList<>();\r
                listArtifact.add(artifactInfo1);\r
 \r
                // Create fake resource Instance\r
index c4ada74..e2239dc 100644 (file)
@@ -121,7 +121,7 @@ public class VfResourceInstallerTest {
                distributionClient = Mockito.mock(IDistributionClient.class);\r
 \r
                // Now provision the NotificationData mock\r
-               List<IArtifactInfo> listArtifact = new ArrayList<IArtifactInfo>();\r
+               List<IArtifactInfo> listArtifact = new ArrayList<>();\r
                listArtifact.add(artifactInfo1);\r
 \r
                // Create fake resource Instance\r
index e64f68b..950e878 100644 (file)
@@ -7,7 +7,6 @@
        </parent>\r
 \r
        <modelVersion>4.0.0</modelVersion>\r
-       <groupId>org.onap.so</groupId>\r
        <artifactId>MSOCockpit</artifactId>\r
        <packaging>pom</packaging>\r
        <name>MSOCockpit</name>\r
index 71626f5..e4e1fd6 100644 (file)
                        <artifactId>spring-test</artifactId>
                        <version>${spring.version}</version>
                </dependency>
+               <dependency>
+                       <groupId>org.openecomp.sdc.sdc-tosca</groupId>
+                       <artifactId>sdc-tosca</artifactId>
+                       <version>1.1.32</version>
+               </dependency>
                <dependency>
                        <groupId>com.github.tomakehurst</groupId>
                        <artifactId>wiremock</artifactId>
index 3397aa9..baebf79 100644 (file)
@@ -11,7 +11,7 @@ class GenericUtils extends StringUtils{
                        return true;\r
                }\r
                for (int i = 0; i < strLen; i++) {\r
-                       if (Character.isWhitespace(cs.charAt(i)) == false) {\r
+                       if (!Character.isWhitespace(cs.charAt(i))) {\r
                                return false;\r
                        }\r
                }\r
index 437d592..9de1708 100644 (file)
@@ -725,7 +725,7 @@ class SDNCAdapterUtils {
                        execution.setVariable(prefix+'sdncResponseSuccess', false)\r
                        taskProcessor.utils.log("DEBUG", "Response" + ' = ' + (response == null ? "" : System.lineSeparator()) + response, isDebugLogEnabled)\r
 \r
-                       if (successIndicator == true){\r
+                       if (successIndicator){\r
                                if (response == null || response.trim().equals("")) {\r
                                        taskProcessor.utils.log("DEBUG", response + ' is empty');\r
                                        exceptionUtil.buildAndThrowWorkflowException(execution, 500, "SDNCAdapter Workflow Response is Empty")\r
@@ -842,7 +842,7 @@ class SDNCAdapterUtils {
                                        execution.setVariable(prefix+'sdncResponseSuccess', false)\r
 \r
                                        taskProcessor.utils.log("sdncAdapter Success Indicator is: " + success, isDebugLogEnabled)\r
-                                       if (success == true) {\r
+                                       if (success) {\r
 \r
                                                // we need to look inside the request data for error\r
                                                def String callbackRequestData = taskProcessor.utils.getNodeXml(response, 'RequestData', false)\r
@@ -974,4 +974,4 @@ class SDNCAdapterUtils {
        \r
        \r
 \r
-}
+}\r
index 8a9cb95..eabd465 100644 (file)
@@ -105,11 +105,8 @@ public class MsoRequest {
 
     @Override
     public String toString() {
-        StringBuilder request = new StringBuilder();
-        request.append("<requestId>").append(requestId).append("</requestId>");
-        request.append('\n');
-        request.append("<serviceInstanceId>").append(serviceInstanceId).append("</serviceInstanceId>");
-        return request.toString();
+        return "<requestId>" + requestId + "</requestId>" + '\n' + "<serviceInstanceId>" + serviceInstanceId
+            + "</serviceInstanceId>";
     }
 
 }
index 446de10..e43af18 100644 (file)
@@ -129,7 +129,7 @@ public class BpmnRestClient {
             if(encryptedCredentials != null) {\r
                 String userCredentials = getEncryptedPropValue(encryptedCredentials, DEFAULT_BPEL_AUTH, ENCRYPTION_KEY);\r
                 if(userCredentials != null) {\r
-                    post.addHeader("Authorization", "Basic " + new String(DatatypeConverter.printBase64Binary(userCredentials.getBytes())));\r
+                    post.addHeader("Authorization", "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes()));\r
                 }\r
             }\r
         }\r
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java
new file mode 100644 (file)
index 0000000..33f64c8
--- /dev/null
@@ -0,0 +1,131 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.bpmn.common.resource;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import org.jboss.resteasy.client.jaxrs.ResteasyClient;
+import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
+import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;
+import org.openecomp.mso.logger.MsoLogger;
+import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory;
+import org.openecomp.sdc.toscaparser.api.NodeTemplate;
+import org.openecomp.sdc.toscaparser.api.Property;
+import org.openecomp.sdc.toscaparser.api.functions.GetInput;
+import org.openecomp.sdc.toscaparser.api.parameters.Input;
+
+import javax.ws.rs.core.Response;
+import java.io.File;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+public class ResourceRequestBuilder {
+
+    public static String CUSTOMIZATION_UUID = "customizationUUID";
+    public static String SERVICE_URL_TOSCA_CSAR = "http://localhost:3099/serviceToscaCsar?serviceModelUuid=";
+
+    private static MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
+
+    public static Map<String, Object> buildResouceRequest(String serviceUuid,
+                                              String resourceCustomizationUuid,
+                                              Map<String, Object> serviceInputs) throws SdcToscaParserException {
+
+        Map<String, Object> resouceRequest = new HashMap<>();
+
+        String csarpath = null;
+        try {
+            csarpath = getCsarFromUuid(serviceUuid);
+        } catch (Exception e) {
+            LOGGER.debug("csar file is not available for service uuid:" + serviceUuid, e);
+            return resouceRequest;
+        }
+
+        SdcToscaParserFactory toscaParser = SdcToscaParserFactory.getInstance();
+        ISdcCsarHelper iSdcCsarHelper = toscaParser.getSdcCsarHelper(csarpath);
+
+        List<Input> serInput = iSdcCsarHelper.getServiceInputs();
+        Optional<NodeTemplate> nodeTemplateOpt = iSdcCsarHelper.getServiceNodeTemplates().stream()
+                .filter(e -> e.getMetaData().getValue(CUSTOMIZATION_UUID).equals(resourceCustomizationUuid))
+                .findFirst();
+
+        if (nodeTemplateOpt.isPresent()) {
+            NodeTemplate nodeTemplate = nodeTemplateOpt.get();
+            LinkedHashMap<String, Property> resourceProperties = nodeTemplate.getProperties();
+
+            for (String key: resourceProperties.keySet()) {
+                Property property = resourceProperties.get(key);
+
+                Object value = getValue(property.getValue(), serviceInputs, serInput);
+                resouceRequest.put(key, value);
+            }
+        }
+        return resouceRequest;
+    }
+
+    private static Object getValue(Object value, Map<String, Object> serviceInputs,
+                                   List<Input> servInputs) {
+        if (value instanceof Map) {
+            Map<String, Object> valueMap = new HashMap<>();
+
+            Map<String, Object> propertyMap = (Map<String, Object>) value;
+
+            for (String key: propertyMap.keySet()) {
+                valueMap.put(key, getValue(propertyMap.get(key), serviceInputs, servInputs));
+            }
+            return valueMap; // return if the value is nested hashmap
+        } else if (value instanceof GetInput) {
+            String inputName = ((GetInput) value).getInputName();
+
+            if (serviceInputs.get(inputName) != null) {
+                value = serviceInputs.get(inputName);
+            } else {
+                for (Input input: servInputs) {
+                    if (input.getName().equals(inputName)) {
+                        return input.getDefault();  // return default value
+                    }
+                }
+            }
+        }
+        return value; // return property value
+    }
+
+    private static String getCsarFromUuid(String uuid) throws Exception {
+
+        ResteasyClient client = new ResteasyClientBuilder().build();
+        ResteasyWebTarget target = client.target(SERVICE_URL_TOSCA_CSAR + uuid + "\"");
+        Response response = target.request().get();
+        String value = response.readEntity(String.class);
+
+        HashMap<String,String> map = new Gson().fromJson(value, new TypeToken<HashMap<String, String>>(){}.getType());
+
+        File csarFile = new File(System.getProperty("mso.config.path") + "ASDC/" + map.get("NAME"));
+
+        if (!csarFile.exists()) {
+            throw new Exception("csar file does not exist.");
+        }
+
+        return csarFile.getAbsolutePath();
+    }
+}
index 5972c76..846b87a 100644 (file)
@@ -38,11 +38,10 @@ public class CryptoUtils {
     public static final String AES = "AES";\r
 \r
     /**\r
-    * encrypt a value and generate a keyfile\r
+     * encrypt a value and generate a keyfile\r
      * if the keyfile is not found then a new one is created\r
-    * @throws GeneralSecurityException\r
-     * @throws IOException\r
-     */\r
+     * @throws GeneralSecurityException\r
+     * */\r
     public static String encrypt(String value, String keyString) throws GeneralSecurityException\r
     {\r
         SecretKeySpec sks = getSecretKeySpec(keyString);\r
@@ -53,9 +52,8 @@ public class CryptoUtils {
     }\r
 \r
     /**\r
-    * decrypt a value\r
+     * decrypt a value\r
      * @throws GeneralSecurityException\r
-     * @throws IOException\r
      */\r
     public static String decrypt(String message, String keyString) throws GeneralSecurityException\r
     {\r
@@ -96,23 +94,5 @@ public class CryptoUtils {
         return b;\r
     }\r
 \r
-    /**\r
-     * Not Used...\r
-     *\r
-    * Call Rttp utility jar to encrypt pwd\r
-    * @param clearPassword\r
-    * @return\r
-    * @throws GeneralSecurityException\r
-     * @throws Exception\r
-    *\r
-    public static String encryptRttpPwd(String clearPassword) throws GeneralSecurityException {\r
-        try {\r
-            return RttpBasicAuth.encrypt(clearPassword);\r
-        } catch (Exception e) {\r
-            // wrap generic exception\r
-            throw new GeneralSecurityException(e);\r
-        }\r
-    }\r
-    */\r
 }\r
 \r
index 765bf61..f7db52b 100644 (file)
@@ -71,7 +71,7 @@ public class ApplicationControllerSupport {
        }
 
        /**
-        * @param inputClass
+        * @param action
         * @return
         * @throws ClassNotFoundException
         * @throws InstantiationException
index 124e2c3..f54eba4 100644 (file)
@@ -42,7 +42,7 @@ public class DMaaPRestClient  extends RestClient {
 
        @Override
        protected void initializeHeaderMap(Map<String, String> headerMap) {
-               headerMap.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(new String(username + ":" + password).getBytes()));
+               headerMap.put("Authorization", "Basic " + Base64.getEncoder().encodeToString((username + ":" + password).getBytes()));
        }
 
        @Override
index 74b1c3f..1436d83 100644 (file)
@@ -157,14 +157,9 @@ public abstract class RestClient {
                }
                client.register(this.getMapper());
                Optional<ClientResponseFilter> responseFilter = this.addResponseFilter();
-               if (responseFilter.isPresent()) {
-                       client.register(responseFilter.get());
-               }
-               if (!path.isPresent()) {
-                       webTarget = client.target(host.toString());
-               } else {
-                       webTarget = client.target(UriBuilder.fromUri(host + path.get().toString()));
-               }
+               responseFilter.ifPresent(clientResponseFilter -> client.register(clientResponseFilter));
+               webTarget = path.<WebTarget>map(uri -> client.target(UriBuilder.fromUri(host + uri.toString())))
+                       .orElseGet(() -> client.target(host.toString()));
                this.accept = MediaType.APPLICATION_JSON;
                this.contentType = MediaType.APPLICATION_JSON;
        }
index b5ab63c..01f6738 100644 (file)
@@ -36,7 +36,7 @@ public enum PolicyServiceType {
        
        private final String name;
        
-       private PolicyServiceType(String name) {
+       PolicyServiceType(String name) {
                this.name = name;
        }
        
index c746c0d..df30e43 100644 (file)
@@ -27,8 +27,8 @@ public interface SDNOValidator {
        /**
         * Issues a health diagnostic request for a given vnf to SDN-O
         * 
-        * @param vnfName
-        * @param uuid
+        * @param vnfId
+        * @param requestingUserId
         * @throws IOException
         * @throws Exception
         */
index 9fcde31..0bb5186 100644 (file)
@@ -68,7 +68,7 @@ public class BPMNUtil {
        }\r
 \r
        @SuppressWarnings("unchecked")\r
-       public static <T extends Object> T getRawVariable(ProcessEngineServices processEngineServices, String processDefinitionID, String name) {\r
+       public static <T> T getRawVariable(ProcessEngineServices processEngineServices, String processDefinitionID, String name) {\r
                String pID = getProcessInstanceId(processEngineServices,\r
                                processDefinitionID);\r
                assertProcessInstanceFinished(processEngineServices, pID);\r
index b71f708..6f0095f 100644 (file)
@@ -1829,7 +1829,7 @@ public class WorkflowTest {
                /**\r
                 * Constructor\r
                 * @param contentType the HTTP content type (optional)\r
-                * @param type the callback message type (optional)\r
+                * @param messageType the callback message type (optional)\r
                 * @param content the content\r
                 */\r
                public CallbackData(String contentType, String messageType, String content) {\r
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilderTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilderTest.java
new file mode 100644 (file)
index 0000000..262c12e
--- /dev/null
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.bpmn.common.resource;
+
+import org.junit.Test;
+
+import java.util.HashMap;
+
+public class ResourceRequestBuilderTest {
+
+    @Test
+    public void buildResouceRequestTest() throws Exception {
+
+        ResourceRequestBuilder.buildResouceRequest("aa4535",
+                "a1074969-944f-4ddc-b687-9550b0c8cd57", new HashMap<>());
+    }
+
+}
\ No newline at end of file
index 2ebb44a..38d0584 100644 (file)
@@ -35,11 +35,6 @@ public class FileUtil {
 
     private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
     
-    private FileUtil() {
-        /**
-         * Constructor.
-         */
-    }
        /**
         * Read the specified resource file and return the contents as a String.
         * 
index 74f50ba..9ead882 100644 (file)
@@ -108,7 +108,7 @@ public class MockResource {
        @Produces("application/json")
        public Response start(@PathParam("portNumber") Integer portNumber) {
                if (portNumber == null) portNumber = defaultPort;
-               return startMockServer(portNumber.intValue());
+               return startMockServer(portNumber);
        }
 
 
index 960a553..27d1c97 100644 (file)
@@ -7,7 +7,6 @@
         <version>1.2.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-    <groupId>org.onap.so</groupId>
     <artifactId>MSOCoreBPMN</artifactId>
     <packaging>jar</packaging>
 
index 9c79df8..1e55586 100644 (file)
@@ -245,7 +245,7 @@ public class HealthCheckHandler  {
         payload.append("<soapenv:Header/>\n");
         payload.append("<soapenv:Body>\n");
         payload.append("<req:getSiteStatus>\n");
-        payload.append("<siteName>" + site + "</siteName>\n");
+        payload.append("<siteName>").append(site).append("</siteName>\n");
         payload.append("</req:getSiteStatus>\n");
         payload.append("</soapenv:Body>\n");
         payload.append("</soapenv:Envelope>\n");
index 6059a35..b627205 100644 (file)
@@ -238,7 +238,6 @@ public class PropertyConfiguration {
         * Reads properties from the specified file, updates the property file cache, and
         * returns the properties in a map.
         * @param file the file to read
-        * @param reload true if this is a reload event
         * @return a map of properties
         */
        private Map<String, String> readProperties(File file) throws IOException {
index ce171b5..a1719a9 100644 (file)
@@ -156,7 +156,7 @@ public class PropertyConfigurationSetup {
         * Create a map to hold properties to be added to mso.bpmn.properties.
         */
        public static Map<String, String> createBpmnProperties() {
-               Map<String, String> properties = new HashMap<String, String>();
+               Map<String, String> properties = new HashMap<>();
                properties.put("PROPERTIES-TYPE", PropertyConfiguration.MSO_BPMN_PROPERTIES);
                return properties;
        }
@@ -165,7 +165,7 @@ public class PropertyConfigurationSetup {
         * Create a map to hold properties to be added to mso.bpmn.urn.properties.
         */
        public static Map<String, String> createBpmnUrnProperties() {
-               Map<String, String> properties = new HashMap<String, String>();
+               Map<String, String> properties = new HashMap<>();
                properties.put("PROPERTIES-TYPE", PropertyConfiguration.MSO_BPMN_URN_PROPERTIES);
                return properties;
        }
@@ -176,7 +176,7 @@ public class PropertyConfigurationSetup {
         * PropertyConfiguration, just like they do when a property file is updated on
         * a real MSO system. This method will optionally wait for the new properties
         * to be loaded.  Timeout results in an IOException.
-        * @param values new properties
+        * @param properties new properties
         * @param wait maximum amount of time to wait for new properties to be loaded,
         *             in milliseconds.  A value of zero means, "Do not wait."
         * @throws IOException
index 64068d2..f49712e 100644 (file)
@@ -35,7 +35,7 @@ public class RollbackData implements Serializable {
     private static final long serialVersionUID = 1L;
 
     private Map<String, Map<String, Serializable>> dictionary =
-            new HashMap<String, Map<String, Serializable>>();
+        new HashMap<>();
 
     /**
      * Returns true if the specified type is stored in this object.
@@ -54,12 +54,8 @@ public class RollbackData implements Serializable {
      * @param value the value
      */
     public void put(String type, String key, String value) {
-        Map<String, Serializable> mapForType = dictionary.get(type);
-
-        if (mapForType == null) {
-            mapForType = new HashMap<String, Serializable>();
-            dictionary.put(type, mapForType);
-        }
+        Map<String, Serializable> mapForType = dictionary
+            .computeIfAbsent(type, k -> new HashMap<>());
 
         mapForType.put(key, value);
     }
index 21653e2..b555563 100644 (file)
@@ -31,7 +31,7 @@ public class WorkflowException implements Serializable {
        private final String processKey;
        private final int errorCode;
        private final String errorMessage;
-       
+
        /**
         * Constructor
         * @param processKey the process key for the process that generated the exception
@@ -44,42 +44,34 @@ public class WorkflowException implements Serializable {
                this.errorCode = errorCode;
                this.errorMessage = errorMessage;
        }
-                       
+
        /**
         * Returns the process key.
         */
        public String getProcessKey() {
                return processKey;
        }
-       
+
        /**
         * Returns the error code.
         */
        public int getErrorCode() {
                return errorCode;
        }
-       
+
        /**
         * Returns the error message.
         */
        public String getErrorMessage() {
                return errorMessage;
        }
-       
+
        /**
         * Returns a string representation of this object.
         */
     @Override
        public String toString() {
-               StringBuilder out = new StringBuilder();
-               out.append(getClass().getSimpleName());
-               out.append("[processKey=");
-               out.append(getProcessKey());
-               out.append(",errorCode=");
-               out.append(getErrorCode());
-               out.append(",errorMessage=");
-               out.append(getErrorMessage());
-               out.append("]");
-               return out.toString();
+               return getClass().getSimpleName() + "[processKey=" + getProcessKey() + ",errorCode=" + getErrorCode()
+                       + ",errorMessage=" + getErrorMessage() + "]";
        }
 }
index 653f75c..fbc312e 100644 (file)
@@ -27,7 +27,7 @@ public enum InventoryType{
 \r
        private String type;\r
 \r
-       private InventoryType(String type){\r
+       InventoryType(String type){\r
                this.type = type;\r
        }\r
 \r
index 4d895f3..f37db4a 100644 (file)
@@ -92,16 +92,10 @@ public abstract class JsonWrapper implements Serializable  {
         JSONObject json = new JSONObject();\r
          try {\r
                        json = new JSONObject(mapper.writeValueAsString(this));\r
-               } catch (JsonGenerationException e) {\r
-                       LOGGER.debug("Exception :",e);\r
-               } catch (JsonMappingException e) {\r
-                       LOGGER.debug("Exception :",e);\r
-               } catch (JSONException e) {\r
-                       LOGGER.debug("Exception :",e);\r
-               } catch (IOException e) {\r
+               } catch (JSONException | IOException e) {\r
                        LOGGER.debug("Exception :",e);\r
                }\r
-         return json; \r
+        return json;\r
        }\r
        \r
        public String listToJson(List list) {\r
@@ -111,10 +105,6 @@ public abstract class JsonWrapper implements Serializable  {
                String jsonString = "";\r
                try {\r
                        jsonString = mapper.writeValueAsString(list);\r
-               } catch (JsonGenerationException e) {\r
-                       LOGGER.debug("Exception :",e);\r
-               } catch (JsonMappingException e) {\r
-                       LOGGER.debug("Exception :",e);\r
                } catch (IOException e) {\r
                        LOGGER.debug("Exception :",e);\r
                }\r
index c81e96d..8581eee 100644 (file)
@@ -146,15 +146,12 @@ public class ServiceDecomposition extends JsonWrapper implements Serializable {
 \r
        /**\r
         * This method returns String representation of one combined list of Resources of All Types\r
-        * @return\r
         */\r
        @JsonIgnore\r
-       public String getServiceResourcesJsonString(){\r
-               StringBuilder serviceResourcesJsonStringBuffer = new StringBuilder();\r
-               serviceResourcesJsonStringBuffer.append(listToJson((this.getServiceNetworks())));\r
-               serviceResourcesJsonStringBuffer.append(listToJson((this.getServiceVnfs())));\r
-               serviceResourcesJsonStringBuffer.append(listToJson((this.getServiceAllottedResources())));\r
-               return serviceResourcesJsonStringBuffer.toString();\r
+       public String getServiceResourcesJsonString() {\r
+               return listToJson((this.getServiceNetworks())) +\r
+                       listToJson((this.getServiceVnfs())) +\r
+                       listToJson((this.getServiceAllottedResources()));\r
        }\r
 \r
        /**\r
@@ -203,7 +200,7 @@ public class ServiceDecomposition extends JsonWrapper implements Serializable {
         */\r
        public void addVnfResource(Resource vnfResource) {\r
                if (vnfResources == null){\r
-                       vnfResources = new ArrayList<VnfResource>();\r
+                       vnfResources = new ArrayList<>();\r
                }\r
                this.vnfResources.add((VnfResource)vnfResource);\r
        }\r
@@ -213,7 +210,7 @@ public class ServiceDecomposition extends JsonWrapper implements Serializable {
         */\r
        public void addNetworkResource(Resource networkResource) {\r
                if (networkResources == null){\r
-                       networkResources = new ArrayList<NetworkResource>();\r
+                       networkResources = new ArrayList<>();\r
                }\r
                this.networkResources.add((NetworkResource)networkResource);\r
        }\r
@@ -223,7 +220,7 @@ public class ServiceDecomposition extends JsonWrapper implements Serializable {
         */\r
        public void addAllottedResource(Resource allottedResource) {\r
                if (allottedResources == null){\r
-                       allottedResources = new ArrayList<AllottedResource>();\r
+                       allottedResources = new ArrayList<>();\r
                }\r
                this.allottedResources.add((AllottedResource)allottedResource);\r
        }\r
index 0d8721b..20903c0 100644 (file)
@@ -134,7 +134,7 @@ public class VnfResource extends Resource {
        // methods to add to the list\r
        public void addVfModule(ModuleResource moduleResource) {\r
                if (vfModules == null){\r
-                       vfModules = new ArrayList<ModuleResource>();\r
+                       vfModules = new ArrayList<>();\r
                }\r
                this.vfModules.add(moduleResource);\r
        }\r
@@ -146,7 +146,6 @@ public class VnfResource extends Resource {
         * \r
         * default setter for this field deprecated\r
         * @param modelName << serviceResources.modelInfo.modelName\r
-        * @param modelInstanceName\r
         */\r
        public void constructVnfType(String modelName) {\r
                this.vnfType = modelName.concat("/").concat(this.modelInfo.getModelInstanceName());\r
index 2612c38..b0152a1 100644 (file)
@@ -117,7 +117,7 @@ public class JsonUtils {
         * to convert a JSONObject to an XML Doc. The intent of this is to\r
         * correctly generate XML from JSON including TAGs for JSONArrays\r
         *\r
-        * @param  jsonObj      org.json.JSON object to be converted to XML\r
+        * @param  obj object to be converted to XML\r
         * @param  tagName      optional XML tagname supplied primarily during recursive calls\r
         * @return String containing the XML translation\r
         */\r
@@ -913,7 +913,7 @@ public class JsonUtils {
         * and puts it in a Java List<String>.\r
         *\r
         * @param execution\r
-        * @param stringArray - the getJsonValue of a json array of strings\r
+        * @param jsonArrayOfStrings - the getJsonValue of a json array of strings\r
         *\r
         * @return List - a java list containing the strings\r
         *\r
index 967b1df..2fe6258 100644 (file)
@@ -85,16 +85,10 @@ public abstract class JsonWrapper implements Serializable  {
         JSONObject json = new JSONObject();\r
          try {\r
                        json = new JSONObject(mapper.writeValueAsString(this));\r
-               } catch (JsonGenerationException e) {\r
+               } catch (JSONException | IOException e) {\r
                        LOGGER.debug("Exception :",e);\r
-               } catch (JsonMappingException e) {\r
-                       LOGGER.debug("Exception :",e);\r
-               } catch (JSONException e) {\r
-                       LOGGER.debug("Exception :",e);\r
-               } catch (IOException e) {\r
-                       LOGGER.debug("Exception :",e);\r
-               }               \r
-         return json; \r
+               }\r
+        return json;\r
        }\r
        \r
        public String listToJson(List list)  {\r
@@ -104,10 +98,6 @@ public abstract class JsonWrapper implements Serializable  {
                String jsonString = "";\r
                try {\r
                        jsonString = mapper.writeValueAsString(list);\r
-               } catch (JsonGenerationException e) {\r
-                       LOGGER.debug("Exception :",e);\r
-               } catch (JsonMappingException e) {\r
-                       LOGGER.debug("Exception :",e);\r
                } catch (IOException e) {\r
                        LOGGER.debug("Exception :",e);\r
                }\r
index ad4a1a5..4dde5ae 100644 (file)
@@ -88,7 +88,7 @@ public class CustomMyBatisSessionFactory extends
        @Override
        protected Collection<? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequired() {
                List<CommandInterceptor> defaultCommandInterceptorsTxRequired =
-                               new ArrayList<CommandInterceptor>();
+            new ArrayList<>();
                defaultCommandInterceptorsTxRequired.add(new LogInterceptor());
                defaultCommandInterceptorsTxRequired.add(new CommandContextInterceptor(
                                commandContextFactory, this, true));
index 177fafc..c48b671 100644 (file)
@@ -93,7 +93,7 @@ public class URNMapping {
         * aai:endpoint becomes URN_aai_endpoint <br/>
         * ae:internal-reporting becomes URN_ae_internal_reporting <br/>
         * 
-        * @param name the URN
+        * @param urn the URN
         * @return a normalized identifier
         */
        public static String createIdentifierFromURN(String urn) {
index c346308..730c145 100644 (file)
@@ -321,14 +321,8 @@ public class LoggingAndURNMappingPlugin extends AbstractProcessEnginePlugin {
                }
 
                private void loadFromDB(DelegateExecution execution, ProcessEngineConfigurationImpl processEngineConfiguration) {
-                       Command<List<URNMapping>> command = new Command<List<URNMapping>>() {
-                               @SuppressWarnings("unchecked")
-                               @Override
-                               public List<URNMapping> execute(CommandContext commandContext) {
-                                       return (List<URNMapping>) commandContext.getDbSqlSession().selectList(
-                                               "mso.urnMapping.selectAll", null);
-                               }
-                       };
+                       Command<List<URNMapping>> command = commandContext -> (List<URNMapping>) commandContext.getDbSqlSession()
+                               .selectList("mso.urnMapping.selectAll", null);
 
                        CustomMyBatisSessionFactory sessionFactory = new CustomMyBatisSessionFactory();
                        sessionFactory.initFromProcessEngineConfiguration(processEngineConfiguration,
index 18113fa..d25dcb6 100644 (file)
@@ -65,7 +65,7 @@ public class WorkflowExceptionPlugin extends AbstractProcessEnginePlugin {
                        processEngineConfiguration.getCustomPreBPMNParseListeners();
 
                if (preParseListeners == null) {
-                       preParseListeners = new ArrayList<BpmnParseListener>();
+                       preParseListeners = new ArrayList<>();
                        processEngineConfiguration.setCustomPreBPMNParseListeners(preParseListeners);
                }
 
@@ -76,7 +76,7 @@ public class WorkflowExceptionPlugin extends AbstractProcessEnginePlugin {
                @Override
                public void parseProcess(Element processElement, ProcessDefinitionEntity processDefinition) {
                        AtomicInteger triggerTaskIndex = new AtomicInteger(1);
-                       List<ActivityImpl> activities = new ArrayList<ActivityImpl>(processDefinition.getActivities());
+                       List<ActivityImpl> activities = new ArrayList<>(processDefinition.getActivities());
                        recurse(activities, triggerTaskIndex);
                }
 
@@ -103,7 +103,7 @@ public class WorkflowExceptionPlugin extends AbstractProcessEnginePlugin {
                                        // cause the process to die.
 
                                        List<PvmTransition> outTransitions =
-                                               new ArrayList<PvmTransition>(activity.getOutgoingTransitions());
+                        new ArrayList<>(activity.getOutgoingTransitions());
 
                                        for (PvmTransition transition : outTransitions) {
                                                String triggerTaskId = "WorkflowExceptionTriggerTask_" + triggerTaskIndex;
@@ -112,7 +112,7 @@ public class WorkflowExceptionPlugin extends AbstractProcessEnginePlugin {
 
                                                ClassDelegateActivityBehavior behavior = new  ClassDelegateActivityBehavior(
                                                                WorkflowExceptionTriggerTask.class.getName(),
-                                                               new ArrayList<FieldDeclaration>(0));
+                            new ArrayList<>(0));
 
                                                triggerTask.setActivityBehavior(behavior);
                                                triggerTask.setName("Workflow Exception Trigger Task " + triggerTaskIndex);
@@ -124,7 +124,7 @@ public class WorkflowExceptionPlugin extends AbstractProcessEnginePlugin {
                                                transitionImpl.setDestination(triggerTask);
                                        }
                                } else if ("subProcess".equals(type)) {
-                                       recurse(new ArrayList<ActivityImpl>(activity.getActivities()), triggerTaskIndex);
+                                       recurse(new ArrayList<>(activity.getActivities()), triggerTaskIndex);
                                }
                        }
                }
index f5b9f8d..1fc43ba 100644 (file)
@@ -130,7 +130,7 @@ public final class XmlTool {
 
        /**
         * Encodes a value so it can be used inside an XML text element.
-        * @param s the string to encode
+        * @param value the string to encode
         * @return the encoded string
         */
        public static String encode(Object value) {
@@ -171,7 +171,7 @@ public final class XmlTool {
        
        /**
         * Encodes a value so it can be used inside an XML attribute.
-        * @param s the string to encode
+        * @param value the string to encode
         * @return the encoded string
         */
        public static String encodeAttr(Object value) {
index 9730b12..2d204c3 100644 (file)
@@ -55,7 +55,7 @@ public class TestBaseTask {
        @Test
        @Deployment(resources={"BaseTaskTest.bpmn"})
        public void shouldInvokeService() {
-               Map<String, Object> variables = new HashMap<String, Object>();
+               Map<String, Object> variables = new HashMap<>();
                variables.put("firstName", "Jane");
                variables.put("lastName", "Doe");
                variables.put("age", (Integer)25);
index 2b2d622..fd9b6d4 100644 (file)
@@ -233,7 +233,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
                try {
                        String serviceInstanceName = execution.getVariable("serviceInstanceName")
                        boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
-                       if(succInAAI != true){
+                       if(!succInAAI){
                                utils.log("INFO","Error getting Service-instance from AAI", + serviceInstanceName, isDebugEnabled)
                                WorkflowException workflowException = execution.getVariable("WorkflowException")
                                utils.logAudit("workflowException: " + workflowException)
@@ -250,7 +250,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
                        else
                        {
                                boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
-                               if(foundInAAI == true){
+                               if(foundInAAI){
                                        utils.log("INFO","Found Service-instance in AAI", isDebugEnabled)
                                        msg = "ServiceInstance already exists in AAI:" + serviceInstanceName
                                        utils.log("INFO", msg, isDebugEnabled)
@@ -274,7 +274,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
                try {
                        String serviceInstanceId = execution.getVariable("serviceInstanceId")
                        boolean succInAAI = execution.getVariable("GENPS_SuccessIndicator")
-                       if(succInAAI != true){
+                       if(!succInAAI){
                                utils.log("INFO","Error putting Service-instance in AAI", + serviceInstanceId, isDebugEnabled)
                                WorkflowException workflowException = execution.getVariable("WorkflowException")
                                utils.logAudit("workflowException: " + workflowException)
@@ -313,7 +313,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
                try {
                        String serviceInstanceName = execution.getVariable("serviceInstanceName")
                        boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
-                       if(succInAAI != true){
+                       if(!succInAAI){
                                utils.log("INFO","Error getting Service-instance from AAI in postProcessAAIGET2", + serviceInstanceName, isDebugEnabled)
                                WorkflowException workflowException = execution.getVariable("WorkflowException")
                                utils.logAudit("workflowException: " + workflowException)
@@ -330,7 +330,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
                        else
                        {
                                boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
-                               if(foundInAAI == true){
+                               if(foundInAAI){
                                        String aaiService = execution.getVariable("GENGS_service")
                                        if (!isBlank(aaiService) && (utils.nodeExists(aaiService, "service-instance-name"))) {
                                                execution.setVariable("serviceInstanceName",  utils.getNodeText1(aaiService, "service-instance-name"))
index dfe210c..743eb1a 100644 (file)
@@ -178,14 +178,14 @@ public class DoCreateE2EServiceInstanceRollback extends AbstractServiceTaskProce
                        String serviceInstanceId = execution.getVariable("serviceInstanceId")\r
                        boolean rollbackAAI = execution.getVariable("rollbackAAI")\r
                        boolean rollbackSDNC = execution.getVariable("rollbackSDNC")\r
-                       if (rollbackAAI == true || rollbackSDNC == true)\r
+                       if (rollbackAAI || rollbackSDNC)\r
                        {\r
                                execution.setVariable("rolledBack", true)\r
                        }\r
-                       if (rollbackAAI == true)\r
+                       if (rollbackAAI)\r
                        {\r
                                boolean succInAAI = execution.getVariable("GENDS_SuccessIndicator")\r
-                               if(succInAAI != true){\r
+                               if(!succInAAI){\r
                                        execution.setVariable("rolledBack", false) //both sdnc and aai must be successful to declare rollback Succesful\r
                                        execution.setVariable("rollbackError", "Error deleting service-instance in AAI for rollback")\r
                                        utils.log("DEBUG","Error deleting service-instance in AAI for rollback", + serviceInstanceId, isDebugEnabled)\r
index cc34b03..ea29de9 100644 (file)
@@ -227,7 +227,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
                try {\r
                        String serviceInstanceName = execution.getVariable("serviceInstanceName")\r
                        boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")\r
-                       if(succInAAI != true){\r
+                       if(!succInAAI){\r
                                utils.log("INFO","Error getting Service-instance from AAI", + serviceInstanceName, isDebugEnabled)\r
                                WorkflowException workflowException = execution.getVariable("WorkflowException")\r
                                utils.logAudit("workflowException: " + workflowException)\r
@@ -244,7 +244,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
                        else\r
                        {\r
                                boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")\r
-                               if(foundInAAI == true){\r
+                               if(foundInAAI){\r
                                        utils.log("INFO","Found Service-instance in AAI", isDebugEnabled)\r
                                        msg = "ServiceInstance already exists in AAI:" + serviceInstanceName\r
                                        utils.log("INFO", msg, isDebugEnabled)\r
@@ -270,7 +270,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
                try {\r
                        String serviceInstanceId = execution.getVariable("serviceInstanceId")\r
                        boolean succInAAI = execution.getVariable("GENPS_SuccessIndicator")\r
-                       if(succInAAI != true){\r
+                       if(!succInAAI){\r
                                utils.log("INFO","Error putting Service-instance in AAI", + serviceInstanceId, isDebugEnabled)\r
                                WorkflowException workflowException = execution.getVariable("WorkflowException")\r
                                utils.logAudit("workflowException: " + workflowException)\r
@@ -311,7 +311,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
                try {\r
                        String serviceInstanceName = execution.getVariable("serviceInstanceName")\r
                        boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")\r
-                       if(succInAAI != true){\r
+                       if(!succInAAI){\r
                                utils.log("INFO","Error getting Service-instance from AAI in postProcessAAIGET2", + serviceInstanceName, isDebugEnabled)\r
                                WorkflowException workflowException = execution.getVariable("WorkflowException")\r
                                utils.logAudit("workflowException: " + workflowException)\r
@@ -328,7 +328,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
                        else\r
                        {\r
                                boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")\r
-                               if(foundInAAI == true){\r
+                               if(foundInAAI){\r
                                        String aaiService = execution.getVariable("GENGS_service")\r
                                        if (!isBlank(aaiService) && (utils.nodeExists(aaiService, "service-instance-name"))) {\r
                                                execution.setVariable("serviceInstanceName",  utils.getNodeText1(aaiService, "service-instance-name"))\r
index affb932..91ecabc 100644 (file)
@@ -368,7 +368,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
                try {
                        String serviceInstanceName = execution.getVariable("serviceInstanceName")
                        boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
-                       if(succInAAI != true){
+                       if(!succInAAI){
                                utils.log("DEBUG","Error getting Service-instance from AAI", + serviceInstanceName, isDebugEnabled)
                                WorkflowException workflowException = execution.getVariable("WorkflowException")
                                utils.logAudit("workflowException: " + workflowException)
@@ -385,7 +385,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
                        else
                        {
                                boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
-                               if(foundInAAI == true){
+                               if(foundInAAI){
                                        utils.log("DEBUG","Found Service-instance in AAI", isDebugEnabled)
                                        msg = "ServiceInstance already exists in AAI:" + serviceInstanceName
                                        utils.log("DEBUG", msg, isDebugEnabled)
@@ -409,7 +409,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
                try {
                        String serviceInstanceId = execution.getVariable("serviceInstanceId")
                        boolean succInAAI = execution.getVariable("GENPS_SuccessIndicator")
-                       if(succInAAI != true){
+                       if(!succInAAI){
                                utils.log("DEBUG","Error putting Service-instance in AAI", + serviceInstanceId, isDebugEnabled)
                                WorkflowException workflowException = execution.getVariable("WorkflowException")
                                utils.logAudit("workflowException: " + workflowException)
@@ -576,7 +576,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
                try {
                        String serviceInstanceName = execution.getVariable("serviceInstanceName")
                        boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
-                       if(succInAAI != true){
+                       if(!succInAAI){
                                utils.log("DEBUG","Error getting Service-instance from AAI in postProcessAAIGET2", + serviceInstanceName, isDebugEnabled)
                                WorkflowException workflowException = execution.getVariable("WorkflowException")
                                utils.logAudit("workflowException: " + workflowException)
@@ -593,7 +593,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
                        else
                        {
                                boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
-                               if(foundInAAI == true){
+                               if(foundInAAI){
                                        String aaiService = execution.getVariable("GENGS_service")
                                        if (!isBlank(aaiService) && (utils.nodeExists(aaiService, "service-instance-name"))) {
                                                execution.setVariable("serviceInstanceName",  utils.getNodeText1(aaiService, "service-instance-name"))
index 3c12c0b..9a84c6b 100644 (file)
@@ -177,14 +177,14 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
                        String serviceInstanceId = execution.getVariable("serviceInstanceId")\r
                        boolean rollbackAAI = execution.getVariable("rollbackAAI")\r
                        boolean rollbackSDNC = execution.getVariable("rollbackSDNC")\r
-                       if (rollbackAAI == true || rollbackSDNC == true)\r
+                       if (rollbackAAI || rollbackSDNC)\r
                        {\r
                                execution.setVariable("rolledBack", true)\r
                        }\r
-                       if (rollbackAAI == true)\r
+                       if (rollbackAAI)\r
                        {\r
                                boolean succInAAI = execution.getVariable("GENDS_SuccessIndicator")\r
-                               if(succInAAI != true){\r
+                               if(!succInAAI){\r
                                        execution.setVariable("rolledBack", false) //both sdnc and aai must be successful to declare rollback Succesful\r
                                        execution.setVariable("rollbackError", "Error deleting service-instance in AAI for rollback")\r
                                        utils.log("DEBUG","Error deleting service-instance in AAI for rollback", + serviceInstanceId, isDebugEnabled)\r
index 82eea43..c5d87d8 100644 (file)
@@ -181,7 +181,7 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
                        utils.log("ERROR", "Exception Occured Processing postProcessCreateVfModuleRollback. Exception is:\n" + e, isDebugLogEnabled)\r
                        exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during postProcessCreateVfModuleRollback Method:\n" + e.getMessage())\r
                }\r
-               if (rolledBack == false) {\r
+               if (!rolledBack) {\r
                        logDebug("Failure on DoCreateVfModuleRollback", isDebugLogEnabled)\r
                        utils.log("ERROR", "Unsuccessful rollback of DoCreateVfModule")\r
                        exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during rollback of DoCreateVfModule")\r
index bf61013..40e2baa 100644 (file)
@@ -317,7 +317,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
                        boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
                        String serviceType = ""
 
-                       if(foundInAAI == true){
+                       if(foundInAAI){
                                utils.log("INFO","Found Service-instance in AAI", isDebugEnabled)
 
                                String siData = execution.getVariable("GENGS_service")
@@ -412,7 +412,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
                                }
                        }else{
                                boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
-                               if(succInAAI != true){
+                               if(!succInAAI){
                                        utils.log("INFO","Error getting Service-instance from AAI", + serviceInstanceId, isDebugEnabled)
                                        WorkflowException workflowException = execution.getVariable("WorkflowException")
                                        utils.logAudit("workflowException: " + workflowException)
@@ -446,7 +446,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
                try {
                        String serviceInstanceId = execution.getVariable("serviceInstanceId")
                        boolean succInAAI = execution.getVariable("GENDS_SuccessIndicator")
-                       if(succInAAI != true){
+                       if(!succInAAI){
                                msg = "Error deleting Service-instance in AAI" + serviceInstanceId
                                utils.log("INFO", msg, isDebugEnabled)
                                WorkflowException workflowException = execution.getVariable("WorkflowException")
index 7de0ed0..4c3f6bc 100644 (file)
@@ -180,7 +180,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
                        String serviceType = ""\r
                        \r
 \r
-                       if(foundInAAI == true){\r
+                       if(foundInAAI){\r
                                utils.log("INFO","Found Service-instance in AAI", isDebugEnabled)\r
 \r
                                String siData = execution.getVariable("GENGS_service")\r
@@ -194,7 +194,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
                                \r
                        }else{\r
                                boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")\r
-                               if(succInAAI != true){\r
+                               if(!succInAAI){\r
                                        utils.log("INFO","Error getting Service-instance from AAI", + serviceInstanceId, isDebugEnabled)\r
                                        WorkflowException workflowException = execution.getVariable("WorkflowException")\r
                                        utils.logAudit("workflowException: " + workflowException)\r
@@ -964,7 +964,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
                try {\r
                        String serviceInstanceId = execution.getVariable("serviceInstanceId")\r
                        boolean succInAAI = execution.getVariable("GENDS_SuccessIndicator")\r
-                       if(succInAAI != true){\r
+                       if(!succInAAI){\r
                                msg = "Error deleting Service-instance in AAI" + serviceInstanceId\r
                                utils.log("INFO", msg, isDebugEnabled)\r
                                WorkflowException workflowException = execution.getVariable("WorkflowException")\r
index edebc3d..a340755 100644 (file)
@@ -273,7 +273,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
                                        NetworkUtils networkUtils = new NetworkUtils()
                                isVfRelationshipExist = networkUtils.isVfRelationshipExist(aaiResponseAsString)
                                        execution.setVariable(Prefix + "isVfRelationshipExist", isVfRelationshipExist)
-                                       if (isVfRelationshipExist == true) {
+                                       if (isVfRelationshipExist) {
                                                String relationshipMessage = "AAI Query Success Response but 'vf-module' relationship exist, not allowed to delete: network Id: " + networkId
                                                exceptionUtil.buildWorkflowException(execution, 2500, relationshipMessage)
 
index 1c9b80a..fd4162f 100644 (file)
@@ -308,7 +308,7 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
                        boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
                        String serviceType = ""
 
-                       if(foundInAAI == true){
+                       if(foundInAAI){
                                utils.log("DEBUG","Found Service-instance in AAI", isDebugEnabled)
 
                                //Extract GlobalSubscriberId
@@ -409,7 +409,7 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
                                }
                        }else{
                                boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
-                               if(succInAAI != true){
+                               if(!succInAAI){
                                        utils.log("DEBUG","Error getting Service-instance from AAI", + serviceInstanceId, isDebugEnabled)
                                        WorkflowException workflowException = execution.getVariable("WorkflowException")
                                        utils.logAudit("workflowException: " + workflowException)
@@ -443,7 +443,7 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
                try {
                        String serviceInstanceId = execution.getVariable("serviceInstanceId")
                        boolean succInAAI = execution.getVariable("GENDS_SuccessIndicator")
-                       if(succInAAI != true){
+                       if(!succInAAI){
                                msg = "Error deleting Service-instance in AAI" + serviceInstanceId
                                utils.log("DEBUG", msg, isDebugEnabled)
                                WorkflowException workflowException = execution.getVariable("WorkflowException")
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy
new file mode 100644 (file)
index 0000000..c91f353
--- /dev/null
@@ -0,0 +1,260 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. 
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.bpmn.infrastructure.scripts;
+
+import static org.apache.commons.lang3.StringUtils.*;
+import groovy.xml.XmlUtil
+import groovy.json.*
+import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
+import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
+
+import org.openecomp.mso.bpmn.core.WorkflowException
+import org.openecomp.mso.bpmn.core.json.JsonUtils
+import org.openecomp.mso.rest.APIResponse
+
+import java.util.List;
+import java.util.UUID;
+
+import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.runtime.Execution
+import org.apache.commons.lang3.*
+import org.apache.commons.codec.binary.Base64;
+import org.springframework.web.util.UriUtils
+
+/**
+ * This groovy class supports the <class>UpdateCustomE2EServiceInstance.bpmn</class> process.
+ * AlaCarte flow for 1702 ServiceInstance Update
+ *
+ */
+public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor {
+       String Prefix="UPDSI_"
+       ExceptionUtil exceptionUtil = new ExceptionUtil()
+       JsonUtils jsonUtil = new JsonUtils()
+
+
+       public void preProcessRequest (Execution execution) {
+               def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+               execution.setVariable("prefix",Prefix)
+               String msg = ""
+               utils.log("INFO", " *** preProcessRequest() *** ", isDebugEnabled)
+
+               try {
+
+                       String siRequest = execution.getVariable("bpmnRequest")
+                       utils.logAudit(siRequest)
+
+                       String requestId = execution.getVariable("mso-request-id")
+                       execution.setVariable("msoRequestId", requestId)
+                       utils.log("INFO", "Input Request:" + siRequest + " reqId:" + requestId, isDebugEnabled)
+
+                       String serviceInstanceId = execution.getVariable("serviceInstanceId")
+                       if (isBlank(serviceInstanceId)) {
+                               msg = "Input serviceInstanceId' is null"
+                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                       }
+                                               
+                       //subscriberInfo
+                       String globalSubscriberId = jsonUtil.getJsonValue(siRequest, "requestDetails.subscriberInfo.globalSubscriberId")
+                       if (isBlank(globalSubscriberId)) {
+                               msg = "Input globalSubscriberId' is null"
+                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                       } else {
+                               execution.setVariable("globalSubscriberId", globalSubscriberId)
+                       }
+
+                       //requestInfo
+                       execution.setVariable("source", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.source"))
+                       execution.setVariable("serviceInstanceName", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.instanceName"))
+                       execution.setVariable("disableRollback", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.suppressRollback"))
+                       String productFamilyId = jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.productFamilyId")
+                       if (isBlank(productFamilyId))
+                       {
+                               msg = "Input productFamilyId is null"
+                               utils.log("INFO", msg, isDebugEnabled)
+                               //exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                       } else {
+                               execution.setVariable("productFamilyId", productFamilyId)
+                       }
+                String userParams = jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.userParams")      
+             utils.log("INFO", "userParams:" + userParams, isDebugEnabled)
+                List<String> paramList = jsonUtil.StringArrayToList(execution, userParams)
+                String uuiRequest = jsonUtil.getJsonValue(paramList.get(0), "UUIRequest")
+                       //modelInfo
+                       if (isBlank(uuiRequest)) {
+                               msg = "Input uuiRequest is null"
+                               utils.log("INFO", msg, isDebugEnabled)
+                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                       } else
+                       {
+                               execution.setVariable("uuiRequest", uuiRequest)
+                       }
+
+                       utils.log("INFO", "uuiRequest:\n" + uuiRequest,  isDebugEnabled)
+
+                       //requestParameters
+                       String serviceType = jsonUtil.getJsonValue(uuiRequest, "service.parameters.serviceType")
+                       if (isBlank(serviceType)) {
+                               msg = "Input serviceType is null"
+                               utils.log("INFO", msg, isDebugEnabled)
+                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                       } else {
+                               execution.setVariable("serviceType", serviceType)
+                       }
+                       execution.setVariable("URN_mso_adapters_openecomp_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")
+
+               } catch (BpmnError e) {
+                       throw e;
+               } catch (Exception ex){
+                       msg = "Exception in preProcessRequest " + ex.getMessage()
+                       utils.log("INFO", msg, isDebugEnabled)
+                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+               }
+               utils.log("INFO"," ***** Exit preProcessRequest *****",  isDebugEnabled)
+       }
+
+       public void sendSyncResponse (Execution execution) {
+               def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+               utils.log("INFO", " *** sendSyncResponse *** ", isDebugEnabled)
+
+               try {
+                       String operationId = execution.getVariable("operationId")
+                       String serviceInstanceId = execution.getVariable("serviceInstanceId")
+                       // RESTResponse for API Handler (APIH) Reply Task
+                       String updateServiceRestRequest = """{"service":{"serviceId":"${serviceInstanceId}","operationId":"${operationId}"}}""".trim()
+                       utils.log("INFO", " sendSyncResponse to APIH:" + "\n" + updateServiceRestRequest, isDebugEnabled)
+                       sendWorkflowResponse(execution, 202, updateServiceRestRequest)
+                       execution.setVariable("sentSyncResponse", true)
+
+               } catch (Exception ex) {
+                       String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
+                       utils.log("INFO", msg, isDebugEnabled)
+                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+               }
+               utils.log("INFO"," ***** Exit sendSyncResopnse *****",  isDebugEnabled)
+       }
+
+
+       public void sendSyncError (Execution execution) {
+               def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+               utils.log("INFO", " *** sendSyncError *** ", isDebugEnabled)
+
+               try {
+                       String errorMessage = ""
+                       if (execution.getVariable("WorkflowException") instanceof WorkflowException) {
+                               WorkflowException wfe = execution.getVariable("WorkflowException")
+                               errorMessage = wfe.getErrorMessage()
+                       } else {
+                               errorMessage = "Sending Sync Error."
+                       }
+
+                       String buildworkflowException =
+                                       """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">\r
+                                       <aetgt:ErrorMessage>${errorMessage}</aetgt:ErrorMessage>
+                                       <aetgt:ErrorCode>7000</aetgt:ErrorCode>
+                                  </aetgt:WorkflowException>"""
+
+                       utils.logAudit(buildworkflowException)
+                       sendWorkflowResponse(execution, 500, buildworkflowException)
+
+               } catch (Exception ex) {
+                       utils.log("INFO", " Sending Sync Error Activity Failed. " + "\n" + ex.getMessage(), isDebugEnabled)
+               }
+
+       }
+
+       public void prepareCompletionRequest (Execution execution) {
+               def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+               utils.log("INFO", " *** prepareCompletion *** ", isDebugEnabled)
+
+               try {
+                       String requestId = execution.getVariable("msoRequestId")
+                       String serviceInstanceId = execution.getVariable("serviceInstanceId")
+                       String source = execution.getVariable("source")
+                       
+                       String msoCompletionRequest =
+                                       """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"\r
+                                                               xmlns:ns="http://org.openecomp/mso/request/types/v1">\r
+                                               <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">\r
+                                                       <request-id>${requestId}</request-id>
+                                                       <action>UPDATE</action>
+                                                       <source>${source}</source>
+                                               </request-info>
+                                               <status-message>Service Instance was updated successfully.</status-message>
+                                               <serviceInstanceId>${serviceInstanceId}</serviceInstanceId>
+                                               <mso-bpel-name>UpdateGenericALaCarteServiceInstance</mso-bpel-name>
+                                       </aetgt:MsoCompletionRequest>"""
+
+                       // Format Response
+                       String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
+
+                       execution.setVariable("completionRequest", xmlMsoCompletionRequest)
+                       utils.log("INFO", " Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest, isDebugEnabled)
+
+               } catch (Exception ex) {
+                       String msg = " Exception in prepareCompletion:" + ex.getMessage()
+                       utils.log("INFO", msg, isDebugEnabled)
+                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+               }
+               utils.log("INFO", "*** Exit prepareCompletionRequest ***", isDebugEnabled)
+       }
+
+       public void prepareFalloutRequest(Execution execution){
+               def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+               utils.log("INFO", " *** prepareFalloutRequest *** ", isDebugEnabled)
+
+               try {
+                       WorkflowException wfex = execution.getVariable("WorkflowException")
+                       utils.log("INFO", " Input Workflow Exception: " + wfex.toString(), isDebugEnabled)
+                       String requestId = execution.getVariable("msoRequestId")
+                       String source = execution.getVariable("source")
+                       String requestInfo =
+                                       """<request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">\r
+                                       <request-id>${requestId}</request-id>
+                                       <action>UPDATE</action>
+                                       <source>${source}</source>
+                                  </request-info>"""
+
+                       String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
+                       execution.setVariable("falloutRequest", falloutRequest)
+               } catch (Exception ex) {
+                       utils.log("INFO", "Exception prepareFalloutRequest:" + ex.getMessage(), isDebugEnabled)
+                       String errorException = "  Bpmn error encountered in UpdateGenericALaCarteServiceInstance flow. FalloutHandlerRequest,  buildErrorResponse() - " + ex.getMessage()
+                       String requestId = execution.getVariable("msoRequestId")
+                       String falloutRequest =
+                                       """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"\r
+                                                                    xmlns:ns="http://org.openecomp/mso/request/types/v1"\r
+                                                                    xmlns:wfsch="http://org.openecomp/mso/workflow/schema/v1">\r
+                                          <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">\r
+                                             <request-id>${requestId}</request-id>
+                                             <action>UPDATE</action>
+                                             <source>UUI</source>
+                                          </request-info>
+                                               <aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">\r
+                                                       <aetgt:ErrorMessage>${errorException}</aetgt:ErrorMessage>
+                                                       <aetgt:ErrorCode>7000</aetgt:ErrorCode>
+                                               </aetgt:WorkflowException>
+                                       </aetgt:FalloutHandlerRequest>"""
+
+                       execution.setVariable("falloutRequest", falloutRequest)
+               }
+               utils.log("INFO", "*** Exit prepareFalloutRequest ***", isDebugEnabled)
+       }       
+}
index dd6d451..e1cae80 100644 (file)
-/*\r
- * ============LICENSE_START=======================================================\r
- * ONAP - SO\r
- * ================================================================================\r
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
- * ================================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ============LICENSE_END=========================================================\r
- */\r
-package org.openecomp.mso.bpmn.vcpe.scripts;\r
-\r
-import groovy.xml.XmlUtil\r
-import groovy.json.*\r
-\r
-import org.openecomp.mso.bpmn.core.json.JsonUtils\r
-import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor\r
-import org.openecomp.mso.bpmn.common.scripts.CatalogDbUtils\r
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil\r
-import org.openecomp.mso.bpmn.common.scripts.VidUtils\r
-import org.openecomp.mso.bpmn.core.RollbackData\r
-import org.openecomp.mso.bpmn.core.WorkflowException\r
-import org.openecomp.mso.bpmn.core.domain.*\r
-\r
-import java.util.UUID;\r
-\r
-import org.camunda.bpm.engine.delegate.BpmnError\r
-import org.camunda.bpm.engine.runtime.Execution\r
-import org.json.JSONObject;\r
-import org.json.JSONArray;\r
-import org.apache.commons.lang3.*\r
-import org.apache.commons.codec.binary.Base64;\r
-import org.springframework.web.util.UriUtils;\r
-import static org.apache.commons.lang3.StringUtils.*\r
-\r
-/**\r
- * This groovy class supports the <class>CreateVcpeResCustService.bpmn</class> process.\r
- *\r
- * @author ek1439\r
- *\r
- */\r
-public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {\r
-\r
-       private static final String DebugFlag = "isDebugLogEnabled"\r
-\r
-       String Prefix="CVRCS_"\r
-       ExceptionUtil exceptionUtil = new ExceptionUtil()\r
-       JsonUtils jsonUtil = new JsonUtils()\r
-       VidUtils vidUtils = new VidUtils()\r
-       CatalogDbUtils catalogDbUtils = new CatalogDbUtils()\r
-\r
-       /**\r
-        * This method is executed during the preProcessRequest task of the <class>CreateServiceInstance.bpmn</class> process.\r
-        * @param execution\r
-        */\r
-       public InitializeProcessVariables(Execution execution){\r
-               /* Initialize all the process variables in this block */\r
-\r
-               execution.setVariable("createVcpeServiceRequest", "")\r
-               execution.setVariable("globalSubscriberId", "")\r
-               execution.setVariable("serviceInstanceName", "")\r
-               execution.setVariable("msoRequestId", "")\r
-               execution.setVariable(Prefix+"VnfsCreatedCount", 0)\r
-               execution.setVariable("productFamilyId", "")\r
-               execution.setVariable("brgWanMacAddress", "")\r
-\r
-               //TODO\r
-               execution.setVariable("sdncVersion", "1707")\r
-       }\r
-\r
-       // **************************************************\r
-       //     Pre or Prepare Request Section\r
-       // **************************************************\r
-       /**\r
-        * This method is executed during the preProcessRequest task of the <class>CreateServiceInstance.bpmn</class> process.\r
-        * @param execution\r
-        */\r
-       public void preProcessRequest (Execution execution) {\r
-               def isDebugEnabled=execution.getVariable(DebugFlag)\r
-               execution.setVariable("prefix",Prefix)\r
-\r
-               utils.log("DEBUG", " ***** Inside preProcessRequest CreateVcpeResCustService Request ***** ", isDebugEnabled)\r
-\r
-               try {\r
-                       // initialize flow variables\r
-                       InitializeProcessVariables(execution)\r
-\r
-                       //Config Inputs\r
-                       String aaiDistDelay = execution.getVariable('URN_mso_workflow_aai_distribution_delay')\r
-                       if (isBlank(aaiDistDelay)) {\r
-                               msg = "URN_mso_workflow_aai_distribution_delay is null"\r
-                               utils.log("DEBUG", msg, isDebugEnabled)\r
-                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)\r
-                       }\r
-                       execution.setVariable("aaiDistDelay", aaiDistDelay)\r
-                       utils.log("DEBUG","AAI distribution delay: " + aaiDistDelay, isDebugEnabled)\r
-\r
-                       // check for incoming json message/input\r
-                       String createVcpeServiceRequest = execution.getVariable("bpmnRequest")\r
-                       utils.logAudit(createVcpeServiceRequest)\r
-                       execution.setVariable("createVcpeServiceRequest", createVcpeServiceRequest);\r
-                       println 'createVcpeServiceRequest - ' + createVcpeServiceRequest\r
-\r
-                       // extract requestId\r
-                       String requestId = execution.getVariable("mso-request-id")\r
-                       execution.setVariable("msoRequestId", requestId)\r
-\r
-                       String serviceInstanceId = execution.getVariable("serviceInstanceId")\r
-\r
-                       if ((serviceInstanceId == null) || (serviceInstanceId.isEmpty())) {\r
-                               serviceInstanceId = UUID.randomUUID().toString()\r
-                               utils.log("DEBUG", " Generated new Service Instance: " + serviceInstanceId , isDebugEnabled)\r
-                       } else {\r
-                               utils.log("DEBUG", "Using provided Service Instance ID: " + serviceInstanceId , isDebugEnabled)\r
-                       }\r
-\r
-                       serviceInstanceId = UriUtils.encode(serviceInstanceId,"UTF-8")\r
-                       execution.setVariable("serviceInstanceId", serviceInstanceId)\r
-\r
-                       String requestAction = execution.getVariable("requestAction")\r
-                       execution.setVariable("requestAction", requestAction)\r
-\r
-                       setBasicDBAuthHeader(execution, isDebugEnabled)\r
-                       \r
-                       String source = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.requestInfo.source")\r
-                       if ((source == null) || (source.isEmpty())) {\r
-                               source = "VID"\r
-                       }\r
-                       execution.setVariable("source", source)\r
-\r
-                       // extract globalSubscriberId\r
-                       String globalSubscriberId = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.subscriberInfo.globalSubscriberId")\r
-\r
-                       // verify element global-customer-id is sent from JSON input, throw exception if missing\r
-                       if ((globalSubscriberId == null) || (globalSubscriberId.isEmpty())) {\r
-                               String dataErrorMessage = " Element 'globalSubscriberId' is missing. "\r
-                               exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)\r
-\r
-                       } else {\r
-                               execution.setVariable("globalSubscriberId", globalSubscriberId)\r
-                               execution.setVariable("globalCustomerId", globalSubscriberId)\r
-                       }\r
-\r
-                       // extract subscriptionServiceType\r
-                       String subscriptionServiceType = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.requestParameters.subscriptionServiceType")\r
-                       execution.setVariable("subscriptionServiceType", subscriptionServiceType)\r
-                       utils.log("DEBUG", "Incoming subscriptionServiceType is: " + subscriptionServiceType, isDebugEnabled)\r
-\r
-                       String suppressRollback = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.requestInfo.suppressRollback")\r
-                       execution.setVariable("disableRollback", suppressRollback)\r
-                       utils.log("DEBUG", "Incoming Suppress/Disable Rollback is: " + suppressRollback, isDebugEnabled)\r
-\r
-                       String productFamilyId = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.requestInfo.productFamilyId")\r
-                       execution.setVariable("productFamilyId", productFamilyId)\r
-                       utils.log("DEBUG", "Incoming productFamilyId is: " + productFamilyId, isDebugEnabled)\r
-                       \r
-                       String subscriberInfo = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.subscriberInfo")\r
-                       execution.setVariable("subscriberInfo", subscriberInfo)\r
-                       utils.log("DEBUG", "Incoming subscriberInfo is: " + subscriberInfo, isDebugEnabled)\r
-\r
-                 /*\r
-                 * Extracting User Parameters from incoming Request and converting into a Map\r
-                 */\r
-                 def jsonSlurper = new JsonSlurper()\r
-                 def jsonOutput = new JsonOutput()\r
-\r
-                 Map reqMap = jsonSlurper.parseText(createVcpeServiceRequest)\r
-\r  
-                 //InputParams\r
-                 def userParams = reqMap.requestDetails?.requestParameters?.userParams\r
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.bpmn.vcpe.scripts;
+
+import groovy.xml.XmlUtil
+import groovy.json.*
+
+import org.openecomp.mso.bpmn.core.json.JsonUtils
+import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
+import org.openecomp.mso.bpmn.common.scripts.CatalogDbUtils
+import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
+import org.openecomp.mso.bpmn.common.scripts.VidUtils
+import org.openecomp.mso.bpmn.core.RollbackData
+import org.openecomp.mso.bpmn.core.WorkflowException
+import org.openecomp.mso.bpmn.core.domain.*
+
+import java.util.UUID;
+
+import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.runtime.Execution
+import org.json.JSONObject;
+import org.json.JSONArray;
+import org.apache.commons.lang3.*
+import org.apache.commons.codec.binary.Base64;
+import org.springframework.web.util.UriUtils;
+import static org.apache.commons.lang3.StringUtils.*
+
+/**
+ * This groovy class supports the <class>CreateVcpeResCustService.bpmn</class> process.
+ *
+ * @author ek1439
+ *
+ */
+public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
+
+    private static final String DebugFlag = "isDebugLogEnabled"
+
+    String Prefix="CVRCS_"
+    ExceptionUtil exceptionUtil = new ExceptionUtil()
+    JsonUtils jsonUtil = new JsonUtils()
+    VidUtils vidUtils = new VidUtils()
+    CatalogDbUtils catalogDbUtils = new CatalogDbUtils()
+
+    /**
+     * This method is executed during the preProcessRequest task of the
+     * <class>CreateServiceInstance.bpmn</class> process.
+     * @param execution
+     */
+    public InitializeProcessVariables(Execution execution){
+        /* Initialize all the process variables in this block */
+
+        execution.setVariable("createVcpeServiceRequest", "")
+        execution.setVariable("globalSubscriberId", "")
+        execution.setVariable("serviceInstanceName", "")
+        execution.setVariable("msoRequestId", "")
+        execution.setVariable(Prefix+"VnfsCreatedCount", 0)
+        execution.setVariable("productFamilyId", "")
+        execution.setVariable("brgWanMacAddress", "")
+        execution.setVariable("customerLocation", "")
+
+        //TODO
+        execution.setVariable("sdncVersion", "1707")
+    }
+
+    // **************************************************
+    //     Pre or Prepare Request Section
+    // **************************************************
+    /**
+     * This method is executed during the preProcessRequest task of the
+     * <class>CreateServiceInstance.bpmn</class> process.
+     * @param execution
+     */
+    public void preProcessRequest (Execution execution) {
+        def isDebugEnabled=execution.getVariable(DebugFlag)
+        execution.setVariable("prefix",Prefix)
+
+        utils.log("DEBUG", " ***** Inside preProcessRequest CreateVcpeResCustService Request ***** ", isDebugEnabled)
+
+        try {
+            // initialize flow variables
+            InitializeProcessVariables(execution)
+
+            //Config Inputs
+            String aaiDistDelay = execution.getVariable('URN_mso_workflow_aai_distribution_delay')
+            if (isBlank(aaiDistDelay)) {
+                msg = "URN_mso_workflow_aai_distribution_delay is null"
+                utils.log("DEBUG", msg, isDebugEnabled)
+                exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+            }
+            execution.setVariable("aaiDistDelay", aaiDistDelay)
+            utils.log("DEBUG","AAI distribution delay: " + aaiDistDelay, isDebugEnabled)
+
+            // check for incoming json message/input
+            String createVcpeServiceRequest = execution.getVariable("bpmnRequest")
+            utils.logAudit(createVcpeServiceRequest)
+            execution.setVariable("createVcpeServiceRequest", createVcpeServiceRequest);
+            println 'createVcpeServiceRequest - ' + createVcpeServiceRequest
+
+            // extract requestId
+            String requestId = execution.getVariable("mso-request-id")
+            execution.setVariable("msoRequestId", requestId)
+
+            String serviceInstanceId = execution.getVariable("serviceInstanceId")
+
+            if ((serviceInstanceId == null) || (serviceInstanceId.isEmpty())) {
+                serviceInstanceId = UUID.randomUUID().toString()
+                utils.log("DEBUG", " Generated new Service Instance: " + serviceInstanceId , isDebugEnabled)
+            } else {
+                utils.log("DEBUG", "Using provided Service Instance ID: " + serviceInstanceId , isDebugEnabled)
+            }
+
+            serviceInstanceId = UriUtils.encode(serviceInstanceId,"UTF-8")
+            execution.setVariable("serviceInstanceId", serviceInstanceId)
+
+            String requestAction = execution.getVariable("requestAction")
+            execution.setVariable("requestAction", requestAction)
+
+            setBasicDBAuthHeader(execution, isDebugEnabled)
+
+            String source = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.requestInfo.source")
+            if ((source == null) || (source.isEmpty())) {
+                source = "VID"
+            }
+            execution.setVariable("source", source)
+
+            // extract globalSubscriberId
+            String globalSubscriberId = jsonUtil.getJsonValue(createVcpeServiceRequest,
+                    "requestDetails.subscriberInfo.globalSubscriberId")
+
+            // verify element global-customer-id is sent from JSON input, throw exception if missing
+            if ((globalSubscriberId == null) || (globalSubscriberId.isEmpty())) {
+                String dataErrorMessage = " Element 'globalSubscriberId' is missing. "
+                exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
+
+            } else {
+                execution.setVariable("globalSubscriberId", globalSubscriberId)
+                execution.setVariable("globalCustomerId", globalSubscriberId)
+            }
+
+            // extract subscriptionServiceType
+            String subscriptionServiceType = jsonUtil.getJsonValue(createVcpeServiceRequest,
+                    "requestDetails.requestParameters.subscriptionServiceType")
+            execution.setVariable("subscriptionServiceType", subscriptionServiceType)
+            utils.log("DEBUG", "Incoming subscriptionServiceType is: " + subscriptionServiceType, isDebugEnabled)
+
+            String suppressRollback = jsonUtil.getJsonValue(createVcpeServiceRequest,
+                    "requestDetails.requestInfo.suppressRollback")
+            execution.setVariable("disableRollback", suppressRollback)
+            utils.log("DEBUG", "Incoming Suppress/Disable Rollback is: " + suppressRollback, isDebugEnabled)
+
+            String productFamilyId = jsonUtil.getJsonValue(createVcpeServiceRequest,
+                    "requestDetails.requestInfo.productFamilyId")
+            execution.setVariable("productFamilyId", productFamilyId)
+            utils.log("DEBUG", "Incoming productFamilyId is: " + productFamilyId, isDebugEnabled)
+
+            String subscriberInfo = jsonUtil.getJsonValue(createVcpeServiceRequest,
+                    "requestDetails.subscriberInfo")
+            execution.setVariable("subscriberInfo", subscriberInfo)
+            utils.log("DEBUG", "Incoming subscriberInfo is: " + subscriberInfo, isDebugEnabled)
+
+          /*
+          * Extracting User Parameters from incoming Request and converting into a Map
+          */
+          def jsonSlurper = new JsonSlurper()
+          def jsonOutput = new JsonOutput()
+
+          Map reqMap = jsonSlurper.parseText(createVcpeServiceRequest)
+
   
-                 Map<String, String> inputMap = [:]\r
-\r
-\r
-                 if (userParams) {\r
-                               userParams.each {\r
-                                                               userParam ->\r
-                                                               if("BRG_WAN_MAC_Address".equals(userParam?.name)) {\r
-                                                                                               execution.setVariable("brgWanMacAddress", userParam.value)\r
-                                                                                               inputMap.put("BRG_WAN_MAC_Address", userParam.value)\r
-                                       }\r
-                               }\r
-                 }\r
-\r
-                 utils.log("DEBUG", "User Input Parameters map: " + userParams.toString(), isDebugEnabled)\r
-                 execution.setVariable("serviceInputParams", inputMap)\r
-\r
-                       utils.log("DEBUG", "Incoming brgWanMacAddress is: " + execution.getVariable('brgWanMacAddress'), isDebugEnabled)\r
-\r
-                       //For Completion Handler & Fallout Handler\r
-                       String requestInfo =\r
-                       """<request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">\r
-                                       <request-id>${requestId}</request-id>\r
-                                       <action>CREATE</action>\r
-                                       <source>${source}</source>\r
-                                  </request-info>"""\r
-\r
-                       execution.setVariable(Prefix+"requestInfo", requestInfo)\r
-\r
-                       utils.log("DEBUG", " ***** Completed preProcessRequest CreateVcpeResCustService Request ***** ", isDebugEnabled)\r
-\r
-               } catch (BpmnError e) {\r
-                       throw e;\r
-\r
-               } catch (Exception ex){\r
-                       String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. Unexpected from method preProcessRequest() - " + ex.getMessage()\r
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)\r
-               }\r
-       }\r
-\r
-       public void sendSyncResponse(Execution execution) {\r
-               def isDebugEnabled=execution.getVariable(DebugFlag)\r
-\r
-               utils.log("DEBUG", " ***** Inside sendSyncResponse of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-\r
-               try {\r
-                       String serviceInstanceId = execution.getVariable("serviceInstanceId")\r
-                       String requestId = execution.getVariable("mso-request-id")\r
-\r
-                       // RESTResponse (for API Handler (APIH) Reply Task)\r
-                       String syncResponse ="""{"requestReferences":{"instanceId":"${serviceInstanceId}","requestId":"${requestId}"}}""".trim()\r
-\r
-                       utils.log("DEBUG", " sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse, isDebugEnabled)\r
-                       sendWorkflowResponse(execution, 202, syncResponse)\r
-\r
-               } catch (Exception ex) {\r
-                       String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. Unexpected from method sendSyncResponse() - " + ex.getMessage()\r
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)\r
-               }\r
-       }\r
-\r
-       // *******************************\r
-       //\r
-       // *******************************\r
-       public void prepareDecomposeService(Execution execution) {\r
-               def isDebugEnabled=execution.getVariable(DebugFlag)\r
-\r
-               try {\r
-                       utils.log("DEBUG", " ***** Inside prepareDecomposeService of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-\r
-                       String createVcpeServiceRequest = execution.getVariable("createVcpeServiceRequest")\r
-\r
-                       //serviceModelInfo JSON string will be used as-is for DoCreateServiceInstance BB\r
-                       String serviceModelInfo = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.modelInfo")\r
-                       execution.setVariable("serviceModelInfo", serviceModelInfo)\r
-\r
-                       utils.log("DEBUG", " ***** Completed prepareDecomposeService of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-               } catch (Exception ex) {\r
-                       // try error in method block\r
-                       String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. Unexpected Error from method prepareDecomposeService() - " + ex.getMessage()\r
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)\r
-               }\r
-        }\r
-\r
-       // *******************************\r
-       //\r
-       // *******************************\r
-       public void prepareCreateServiceInstance(Execution execution) {\r
-               def isDebugEnabled=execution.getVariable(DebugFlag)\r
-\r
-               try {\r
-                       utils.log("DEBUG", " ***** Inside prepareCreateServiceInstance of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-\r
-                       /*\r
-                        * Service modelInfo is created in earlier step. This flow can use it as-is ... or, extract from DecompositionObject\r
-                        *              ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")\r
-                        *              ModelInfo modelInfo = serviceDecomposition.getModelInfo()\r
-                        *\r
-                        */\r
-                       String createVcpeServiceRequest = execution.getVariable("createVcpeServiceRequest")\r
-//                     String serviceInputParams = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.requestParameters")\r
-//                     execution.setVariable("serviceInputParams", serviceInputParams)\r
-\r
-
-                       String serviceInstanceName = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.requestInfo.instanceName")\r
-                       execution.setVariable("serviceInstanceName", serviceInstanceName)\r
-\r
-                       ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")\r
-                       execution.setVariable("serviceDecompositionString", serviceDecomposition.toJsonStringNoRootName())\r
-\r
-                       utils.log("DEBUG", " ***** Completed prepareCreateServiceInstance of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-               } catch (Exception ex) {\r
-                       // try error in method block\r
-                       String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. Unexpected Error from method prepareCreateServiceInstance() - " + ex.getMessage()\r
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)\r
-               }\r
-        }\r
-\r
-       public void postProcessServiceInstanceCreate (Execution execution){\r
-               def method = getClass().getSimpleName() + '.postProcessServiceInstanceCreate(' +'execution=' + execution.getId() +')'\r
-               def isDebugLogEnabled = execution.getVariable(DebugFlag)\r
-               logDebug('Entered ' + method, isDebugLogEnabled)\r
-\r
-               String requestId = execution.getVariable("mso-request-id")\r
-               String serviceInstanceId = execution.getVariable("serviceInstanceId")\r
-               String serviceInstanceName = execution.getVariable("serviceInstanceName")\r
-\r
-               try {\r
-\r
-                       String payload = """\r
-                       <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://org.openecomp.mso/requestsdb">\r
-                       <soapenv:Header/>\r
-                       <soapenv:Body>\r
-                       <req:updateInfraRequest>\r
-                               <requestId>${requestId}</requestId>\r
-                               <lastModifiedBy>BPEL</lastModifiedBy>\r
-                               <serviceInstanceId>${serviceInstanceId}</serviceInstanceId>\r
-                               <serviceInstanceName>${serviceInstanceName}</serviceInstanceName>\r
-                       </req:updateInfraRequest>\r
-                       </soapenv:Body>\r
-                       </soapenv:Envelope>\r
-                       """\r
-                       execution.setVariable(Prefix+"setUpdateDbInstancePayload", payload)\r
-                       utils.logAudit(Prefix+"setUpdateDbInstancePayload: " + payload)\r
-                       logDebug('Exited ' + method, isDebugLogEnabled)\r
-\r
-               } catch (BpmnError e) {\r
-                       throw e;\r
-               } catch (Exception e) {\r
-                       logError('Caught exception in ' + method, e)\r
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error - Occured in" + method)\r
-               }\r
-       }\r
-\r
-\r
-       public void processDecomposition (Execution execution) {\r
-               def isDebugEnabled=execution.getVariable(DebugFlag)\r
-\r
-               utils.log("DEBUG", " ***** Inside processDecomposition() of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-\r
-               try {\r
-\r
-                       ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")\r
-\r
-                       // VNFs\r
-                       List<VnfResource> vnfList = serviceDecomposition.getServiceVnfs()\r
-                       filterVnfs(vnfList)\r
-                       serviceDecomposition.setServiceVnfs(vnfList)\r
-                       \r
-                       execution.setVariable("vnfList", vnfList)\r
-                       execution.setVariable("vnfListString", vnfList.toString())\r
-\r
-                       String vnfModelInfoString = ""\r
-                       if (vnfList != null && vnfList.size() > 0) {\r
-                               execution.setVariable(Prefix+"VNFsCount", vnfList.size())\r
-                               utils.log("DEBUG", "vnfs to create: "+ vnfList.size(), isDebugEnabled)\r
-                               ModelInfo vnfModelInfo = vnfList[0].getModelInfo()\r
-\r
-                               vnfModelInfoString = vnfModelInfo.toString()\r
-                               String vnfModelInfoWithRoot = vnfModelInfo.toString()\r
-                               vnfModelInfoString = jsonUtil.getJsonValue(vnfModelInfoWithRoot, "modelInfo")\r
-                       } else {\r
-                                       execution.setVariable(Prefix+"VNFsCount", 0)\r
-                                       utils.log("DEBUG", "no vnfs to create based upon serviceDecomposition content", isDebugEnabled)\r
-                       }\r
-\r
-                       execution.setVariable("vnfModelInfo", vnfModelInfoString)\r
-                       execution.setVariable("vnfModelInfoString", vnfModelInfoString)\r
-                       utils.log("DEBUG", " vnfModelInfoString :" + vnfModelInfoString, isDebugEnabled)\r
-\r
-                       utils.log("DEBUG", " ***** Completed processDecomposition() of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-               } catch (Exception ex) {\r
-                       sendSyncError(execution)\r
-                  String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. processDecomposition() - " + ex.getMessage()\r
-                  utils.log("DEBUG", exceptionMessage, isDebugEnabled)\r
-                  exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)\r
-               }\r
-       }\r
-       \r
-       private void filterVnfs(List<VnfResource> vnfList) {\r
-               if(vnfList == null) {\r
-                       return\r
-               }\r
-               \r
-               // remove BRG & TXC from VNF list\r
-               \r
-               Iterator<VnfResource> it = vnfList.iterator()\r
-               while(it.hasNext()) {\r
-                       VnfResource vr = it.next()\r
-                       \r
-                       String role = vr.getNfRole()\r
-                       if(role == "BRG" || role == "TunnelXConn") {\r
-                               it.remove()\r
-                       }\r
-               }\r
-       }\r
-\r
-\r
-       public void prepareCreateAllottedResourceTXC(Execution execution) {\r
-               def isDebugEnabled=execution.getVariable(DebugFlag)\r
-\r
-               try {\r
-                       utils.log("DEBUG", " ***** Inside prepareCreateAllottedResourceTXC of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-\r
-                       /*\r
-                        * Service modelInfo is created in earlier step. This flow can use it as-is ... or, extract from DecompositionObject\r
-                        *              ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")\r
-                        *              ModelInfo modelInfo = serviceDecomposition.getModelInfo()\r
-                        *\r
-                        */\r
-                       String createVcpeServiceRequest = execution.getVariable("createVcpeServiceRequest")\r
-                       ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")\r
-\r
-                       //allottedResourceModelInfo\r
-                       //allottedResourceRole\r
-                       //The model Info parameters are a JSON structure as defined in the Service Instantiation API.\r
-                       //It would be sufficient to only include the service model UUID (i.e. the modelVersionId), since this BB will query the full model from the Catalog DB.\r
-                       List<AllottedResource> allottedResources = serviceDecomposition.getServiceAllottedResources()\r
-                       if (allottedResources != null) {\r
-                               Iterator iter = allottedResources.iterator();\r
-                               while (iter.hasNext()){\r
-                                       AllottedResource allottedResource = (AllottedResource)iter.next();\r
-\r
-                                       utils.log("DEBUG", " getting model info for AllottedResource # :" + allottedResource.toJsonStringNoRootName(), isDebugEnabled)\r
-                                       utils.log("DEBUG", " allottedResource.getAllottedResourceType() :" + allottedResource.getAllottedResourceType(), isDebugEnabled)\r
-                                       if("TunnelXConn".equalsIgnoreCase(allottedResource.getAllottedResourceType())){\r
-                                               //set create flag to true\r
-                                               execution.setVariable("createTXCAR", true)\r
-                                               ModelInfo allottedResourceModelInfo = allottedResource.getModelInfo()\r
-                                               execution.setVariable("allottedResourceModelInfoTXC", allottedResourceModelInfo.toJsonStringNoRootName())\r
-                                               execution.setVariable("allottedResourceRoleTXC", allottedResource.getAllottedResourceRole())\r
-                                               execution.setVariable("allottedResourceTypeTXC", allottedResource.getAllottedResourceType())\r
-                                               //After decomposition and homing BBs, there should be an allotted resource object in the decomposition that represents the TXC,\r
-                                               //and in its homingSolution section should be found the infraServiceInstanceId (i.e. infraServiceInstanceId in TXC Allotted Resource structure) (which the Homing BB would have populated).\r
-                                               execution.setVariable("parentServiceInstanceIdTXC", allottedResource.getHomingSolution().getServiceInstanceId())\r
-                                       }
-                               }\r
-                       }\r
-\r
-                       //unit test only\r
-                       String allottedResourceId = execution.getVariable("allottedResourceId")\r
-                       execution.setVariable("allottedResourceIdTXC", allottedResourceId)\r
-                       utils.log("DEBUG", "setting allottedResourceId CreateVcpeResCustService "+allottedResourceId, isDebugEnabled)\r
-                       \r
-                       utils.log("DEBUG", " ***** Completed prepareCreateAllottedResourceTXC of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-               } catch (Exception ex) {\r
-                       // try error in method block\r
-                       String exceptionMessage = "Bpmn error encountered in prepareCreateAllottedResourceTXC flow. Unexpected Error from method prepareCreateServiceInstance() - " + ex.getMessage()\r
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)\r
-               }\r
-        }\r
-       public void prepareCreateAllottedResourceBRG(Execution execution) {\r
-               def isDebugEnabled=execution.getVariable(DebugFlag)\r
-\r
-               try {\r
-                       utils.log("DEBUG", " ***** Inside prepareCreateAllottedResourceBRG of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-\r
-                       /*\r
-                        * Service modelInfo is created in earlier step. This flow can use it as-is ... or, extract from DecompositionObject\r
-                        *              ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")\r
-                        *              ModelInfo modelInfo = serviceDecomposition.getModelInfo()\r
-                        *\r
-                        */\r
-                       String createVcpeServiceRequest = execution.getVariable("createVcpeServiceRequest")\r
-                       ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")\r
-\r
-                       //allottedResourceModelInfo\r
-                       //allottedResourceRole\r
-                       //The model Info parameters are a JSON structure as defined in the Service Instantiation API.\r
-                       //It would be sufficient to only include the service model UUID (i.e. the modelVersionId), since this BB will query the full model from the Catalog DB.\r
-                       List<AllottedResource> allottedResources = serviceDecomposition.getServiceAllottedResources()\r
-                       if (allottedResources != null) {\r
-                               Iterator iter = allottedResources.iterator();\r
-                               while (iter.hasNext()){\r
-                                       AllottedResource allottedResource = (AllottedResource)iter.next();\r
-\r
-                                       utils.log("DEBUG", " getting model info for AllottedResource # :" + allottedResource.toJsonStringNoRootName(), isDebugEnabled)\r
-                                       utils.log("DEBUG", " allottedResource.getAllottedResourceType() :" + allottedResource.getAllottedResourceType(), isDebugEnabled)\r
-                                       if("BRG".equalsIgnoreCase(allottedResource.getAllottedResourceType())){\r
-                                               //set create flag to true\r
-                                               execution.setVariable("createBRGAR", true)\r
-                                               ModelInfo allottedResourceModelInfo = allottedResource.getModelInfo()\r
-                                               execution.setVariable("allottedResourceModelInfoBRG", allottedResourceModelInfo.toJsonStringNoRootName())\r
-                                               execution.setVariable("allottedResourceRoleBRG", allottedResource.getAllottedResourceRole())\r
-                                               execution.setVariable("allottedResourceTypeBRG", allottedResource.getAllottedResourceType())\r
-                                               //After decomposition and homing BBs, there should be an allotted resource object in the decomposition that represents the BRG,\r
-                                               //and in its homingSolution section should be found the infraServiceInstanceId (i.e. infraServiceInstanceId in BRG Allotted Resource structure) (which the Homing BB would have populated).\r
-                                               execution.setVariable("parentServiceInstanceIdBRG", allottedResource.getHomingSolution().getServiceInstanceId())\r
-                                       }\r
-                               }\r
-                       }\r
-\r
-                       //unit test only\r
-                       String allottedResourceId = execution.getVariable("allottedResourceId")\r
-                       execution.setVariable("allottedResourceIdBRG", allottedResourceId)\r
-                       utils.log("DEBUG", "setting allottedResourceId CreateVcpeResCustService "+allottedResourceId, isDebugEnabled)\r
-                       \r
-                       utils.log("DEBUG", " ***** Completed prepareCreateAllottedResourceBRG of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-               } catch (Exception ex) {\r
-                       // try error in method block\r
-                       String exceptionMessage = "Bpmn error encountered in prepareCreateAllottedResourceBRG flow. Unexpected Error from method prepareCreateServiceInstance() - " + ex.getMessage()\r
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)\r
-               }\r
-        }\r
-\r
-
-
-       // *******************************\r
-       //     Generate Network request Section\r
-       // *******************************\r
-       public void prepareVnfAndModulesCreate (Execution execution) {\r
-               def isDebugEnabled=execution.getVariable(DebugFlag)\r
-\r
-               try {\r
-                       utils.log("DEBUG", " ***** Inside prepareVnfAndModulesCreate of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-\r
-                       //                      String disableRollback = execution.getVariable("disableRollback")\r
-                       //                      def backoutOnFailure = ""\r
-                       //                      if(disableRollback != null){\r
-                       //                              if ( disableRollback == true) {\r
-                       //                                      backoutOnFailure = "false"\r
-                       //                              } else if ( disableRollback == false) {\r
-                       //                                      backoutOnFailure = "true"\r
-                       //                              }\r
-                       //                      }\r
-                                               //failIfExists - optional\r
-\r
-                       String createVcpeServiceRequest = execution.getVariable("createVcpeServiceRequest")\r
-                       String productFamilyId = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.requestInfo.productFamilyId")\r
-                       execution.setVariable("productFamilyId", productFamilyId)\r
-                       utils.log("DEBUG","productFamilyId: "+ productFamilyId, isDebugEnabled)\r
-\r
-                       List<VnfResource> vnfList = execution.getVariable("vnfList")\r
-\r
-                       Integer vnfsCreatedCount = execution.getVariable(Prefix+"VnfsCreatedCount")\r
-                       String vnfModelInfoString = null;\r
-\r
-                       if (vnfList != null && vnfList.size() > 0 ) {\r
-                               utils.log("DEBUG", "getting model info for vnf # " + vnfsCreatedCount, isDebugEnabled)\r
-                               ModelInfo vnfModelInfo1 = vnfList[0].getModelInfo()\r
-                               utils.log("DEBUG", "got 0 ", isDebugEnabled)\r
-                               ModelInfo vnfModelInfo = vnfList[vnfsCreatedCount.intValue()].getModelInfo()\r
-                               vnfModelInfoString = vnfModelInfo.toString()\r
-                       } else {\r
-                               //TODO: vnfList does not contain data. Need to investigate why ... . Fro VCPE use model stored\r
-                               vnfModelInfoString = execution.getVariable("vnfModelInfo")\r
-                       }\r
-\r
-                       utils.log("DEBUG", " vnfModelInfoString :" + vnfModelInfoString, isDebugEnabled)\r
-\r
-                       // extract cloud configuration\r
-                       String lcpCloudRegionId = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.cloudConfiguration.lcpCloudRegionId")\r
-                       execution.setVariable("lcpCloudRegionId", lcpCloudRegionId)\r
-                       utils.log("DEBUG","lcpCloudRegionId: "+ lcpCloudRegionId, isDebugEnabled)\r
-                       String tenantId = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.cloudConfiguration.tenantId")\r
-                       execution.setVariable("tenantId", tenantId)\r
-                       utils.log("DEBUG","tenantId: "+ tenantId, isDebugEnabled)\r
-\r
-                       String sdncVersion = execution.getVariable("sdncVersion")\r
-                       utils.log("DEBUG","sdncVersion: "+ sdncVersion, isDebugEnabled)\r
-\r
-                       utils.log("DEBUG", " ***** Completed prepareVnfAndModulesCreate of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-               } catch (Exception ex) {\r
-                       // try error in method block\r
-                       String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. Unexpected Error from method prepareVnfAndModulesCreate() - " + ex.getMessage()\r
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)\r
-               }\r
-        }\r
-\r
-       // *******************************\r
-       //     Validate Vnf request Section -> increment count\r
-       // *******************************\r
-       public void validateVnfCreate (Execution execution) {\r
-               def isDebugEnabled=execution.getVariable(DebugFlag)\r
-\r
-               try {\r
-                       utils.log("DEBUG", " ***** Inside validateVnfCreate of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-\r
-                       Integer vnfsCreatedCount = execution.getVariable(Prefix+"VnfsCreatedCount")\r
-                       vnfsCreatedCount++\r
-\r
-                       execution.setVariable(Prefix+"VnfsCreatedCount", vnfsCreatedCount)\r
-\r
-                       utils.log("DEBUG", " ***** Completed validateVnfCreate of CreateVcpeResCustService ***** "+" vnf # "+vnfsCreatedCount, isDebugEnabled)\r
-               } catch (Exception ex) {\r
-                       // try error in method block\r
-                       String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. Unexpected Error from method validateVnfCreate() - " + ex.getMessage()\r
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)\r
-               }\r
-        }\r
-\r
-       // *****************************************\r
-       //     Prepare Completion request Section\r
-       // *****************************************\r
-       public void postProcessResponse (Execution execution) {\r
-               def isDebugEnabled=execution.getVariable(DebugFlag)\r
-\r
-               utils.log("DEBUG", " ***** Inside postProcessResponse of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-\r
-               try {\r
-                       String source = execution.getVariable("source")\r
-                       String requestId = execution.getVariable("mso-request-id")\r
-                       String serviceInstanceId = execution.getVariable("serviceInstanceId")\r
-\r
-                       String msoCompletionRequest =\r
-                                       """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"\r
-                                                                       xmlns:ns="http://org.openecomp/mso/request/types/v1">\r
-                                                       <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">\r
-                                                               <request-id>${requestId}</request-id>\r
-                                                               <action>CREATE</action>\r
-                                                               <source>${source}</source>\r
-                                                       </request-info>\r
-                                                       <status-message>Service Instance has been created successfully via macro orchestration</status-message>\r
-                                                       <serviceInstanceId>${serviceInstanceId}</serviceInstanceId>\r
-                                                       <mso-bpel-name>BPMN macro create</mso-bpel-name>\r
-                                               </aetgt:MsoCompletionRequest>"""\r
-\r
-                       // Format Response\r
-                       String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)\r
-\r
-                       utils.logAudit(xmlMsoCompletionRequest)\r
-                       execution.setVariable(Prefix+"Success", true)\r
-                       execution.setVariable(Prefix+"CompleteMsoProcessRequest", xmlMsoCompletionRequest)\r
-                       utils.log("DEBUG", " SUCCESS flow, going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest, isDebugEnabled)\r
-               } catch (BpmnError e) {\r
-                       throw e;\r
-               } catch (Exception ex) {\r
-                       // try error in method block\r
-                       String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. Unexpected Error from method postProcessResponse() - " + ex.getMessage()\r
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)\r
-               }\r
-       }\r
-\r
-       public void preProcessRollback (Execution execution) {\r
-               def isDebugEnabled=execution.getVariable(DebugFlag)\r
-               utils.log("DEBUG"," ***** preProcessRollback of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-               try {\r
-\r
-                       Object workflowException = execution.getVariable("WorkflowException");\r
-\r
-                       if (workflowException instanceof WorkflowException) {\r
-                               utils.log("DEBUG", "Prev workflowException: " + workflowException.getErrorMessage(), isDebugEnabled)\r
-                               execution.setVariable("prevWorkflowException", workflowException);\r
-                               //execution.setVariable("WorkflowException", null);\r
-                       }\r
-               } catch (BpmnError e) {\r
-                       utils.log("DEBUG", "BPMN Error during preProcessRollback", isDebugEnabled)\r
-               } catch(Exception ex) {\r
-                       String msg = "Exception in preProcessRollback. " + ex.getMessage()\r
-                       utils.log("DEBUG", msg, isDebugEnabled)\r
-               }\r
-               utils.log("DEBUG"," *** Exit preProcessRollback of CreateVcpeResCustService *** ", isDebugEnabled)\r
-       }\r
-\r
-       public void postProcessRollback (Execution execution) {\r
-               def isDebugEnabled=execution.getVariable(DebugFlag)\r
-               utils.log("DEBUG"," ***** postProcessRollback of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-               String msg = ""\r
-               try {\r
-                       Object workflowException = execution.getVariable("prevWorkflowException");\r
-                       if (workflowException instanceof WorkflowException) {\r
-                               utils.log("DEBUG", "Setting prevException to WorkflowException: ", isDebugEnabled)\r
-                               execution.setVariable("WorkflowException", workflowException);\r
-                       }\r
-               } catch (BpmnError b) {\r
-                       utils.log("DEBUG", "BPMN Error during postProcessRollback", isDebugEnabled)\r
-                       throw b;\r
-               } catch(Exception ex) {\r
-                       msg = "Exception in postProcessRollback. " + ex.getMessage()\r
-                       utils.log("DEBUG", msg, isDebugEnabled)\r
-               }\r
-               utils.log("DEBUG"," *** Exit postProcessRollback of CreateVcpeResCustService *** ", isDebugEnabled)\r
-       }\r
-\r
-       public void prepareFalloutRequest(Execution execution){\r
-               def isDebugEnabled=execution.getVariable(DebugFlag)\r
-\r
-               utils.log("DEBUG", " *** STARTED CreateVcpeResCustService prepareFalloutRequest Process *** ", isDebugEnabled)\r
-\r
-               try {\r
-                       WorkflowException wfex = execution.getVariable("WorkflowException")\r
-                       utils.log("DEBUG", " Incoming Workflow Exception: " + wfex.toString(), isDebugEnabled)\r
-                       String requestInfo = execution.getVariable(Prefix+"requestInfo")\r
-                       utils.log("DEBUG", " Incoming Request Info: " + requestInfo, isDebugEnabled)\r
-\r
-                       //TODO. hmmm. there is no way to UPDATE error message.\r
-//                     String errorMessage = wfex.getErrorMessage()\r
-//                     boolean successIndicator = execution.getVariable("DCRESI_rolledBack")\r
-//                     if (successIndicator){\r
-//                             errorMessage = errorMessage + ". Rollback successful."\r
-//                     } else {\r
-//                             errorMessage = errorMessage + ". Rollback not completed."\r
-//                     }\r
-\r
-                       String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)\r
-\r
-                       execution.setVariable(Prefix+"falloutRequest", falloutRequest)\r
-\r
-               } catch (Exception ex) {\r
-                       utils.log("DEBUG", "Error Occured in CreateVcpeResCustService prepareFalloutRequest Process " + ex.getMessage(), isDebugEnabled)\r
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVcpeResCustService prepareFalloutRequest Process")\r
-               }\r
-               utils.log("DEBUG", "*** COMPLETED CreateVcpeResCustService prepareFalloutRequest Process ***", isDebugEnabled)\r
-       }\r
-\r
-\r
-       public void sendSyncError (Execution execution) {\r
-               def isDebugEnabled=execution.getVariable(DebugFlag)\r
-               execution.setVariable("prefix", Prefix)\r
-\r
-               utils.log("DEBUG", " ***** Inside sendSyncError() of CreateVcpeResCustService ***** ", isDebugEnabled)\r
-\r
-               try {\r
-                       String errorMessage = ""\r
-                       def wfe = execution.getVariable("WorkflowException")\r
-                       if (wfe instanceof WorkflowException) {\r
-                               errorMessage = wfe.getErrorMessage()\r
-                       } else {\r
-                               errorMessage = "Sending Sync Error."\r
-                       }\r
-\r
-                       String buildworkflowException =\r
-                               """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">\r
-                                       <aetgt:ErrorMessage>${errorMessage}</aetgt:ErrorMessage>\r
-                                       <aetgt:ErrorCode>7000</aetgt:ErrorCode>\r
-                                  </aetgt:WorkflowException>"""\r
-\r
-                       utils.logAudit(buildworkflowException)\r
-                       sendWorkflowResponse(execution, 500, buildworkflowException)\r
-               } catch (Exception ex) {\r
-                       utils.log("DEBUG", " Sending Sync Error Activity Failed. " + "\n" + ex.getMessage(), isDebugEnabled)\r
-               }\r
-       }\r
-\r
-       public void processJavaException(Execution execution){\r
-               def isDebugEnabled=execution.getVariable(DebugFlag)\r
-               execution.setVariable("prefix",Prefix)\r
-               try{\r
-                       utils.log("DEBUG", "Caught a Java Exception", isDebugEnabled)\r
-                       utils.log("DEBUG", "Started processJavaException Method", isDebugEnabled)\r
-                       utils.log("DEBUG", "Variables List: " + execution.getVariables(), isDebugEnabled)\r
-                       execution.setVariable(Prefix+"unexpectedError", "Caught a Java Lang Exception")  // Adding this line temporarily until this flows error handling gets updated\r
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Caught a Java Lang Exception")\r
-               }catch(BpmnError b){\r
-                       utils.log("ERROR", "Rethrowing MSOWorkflowException", isDebugEnabled)\r
-                       throw b\r
-               }catch(Exception e){\r
-                       utils.log("DEBUG", "Caught Exception during processJavaException Method: " + e, isDebugEnabled)\r
-                       execution.setVariable(Prefix+"unexpectedError", "Exception in processJavaException method")  // Adding this line temporarily until this flows error handling gets updated\r
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Exception in processJavaException method")\r
-               }\r
-               utils.log("DEBUG", "Completed processJavaException Method", isDebugEnabled)\r
-       }\r
-}\r
+          //InputParams
+          def userParams = reqMap.requestDetails?.requestParameters?.userParams
+  
+          Map<String, String> inputMap = [:]
+
+
+          if (userParams) {
+                userParams.each {
+                                userParam ->
+                                if("BRG_WAN_MAC_Address".equals(userParam?.name)) {
+                                                execution.setVariable("brgWanMacAddress", userParam.value)
+                                                inputMap.put("BRG_WAN_MAC_Address", userParam.value)
+                    }
+                                if("Customer_Location".equals(userParam?.name)) {
+                                    execution.setVariable("customerLocation", userParam.value)
+                                    userParam.value.each {
+                                        customerLocParam ->
+                                        inputMap.put(customerLocParam.key, customerLocParam.value)
+                                    }
+                                }
+                }
+          }
+
+          utils.log("DEBUG", "User Input Parameters map: " + userParams.toString(), isDebugEnabled)
+          execution.setVariable("serviceInputParams", inputMap)
+
+            utils.log("DEBUG", "Incoming brgWanMacAddress is: " +
+                    execution.getVariable('brgWanMacAddress'), isDebugEnabled)
+            utils.log("DEBUG", "Incoming customerLocation is: " +
+                    execution.getVariable('customerLocation'), isDebugEnabled)
+
+            //For Completion Handler & Fallout Handler
+            String requestInfo =
+            """<request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+                    <request-id>${requestId}</request-id>
+                    <action>CREATE</action>
+                    <source>${source}</source>
+                   </request-info>"""
+
+            execution.setVariable(Prefix+"requestInfo", requestInfo)
+
+            utils.log("DEBUG",
+                    " ***** Completed preProcessRequest CreateVcpeResCustService Request ***** ", isDebugEnabled)
+
+        } catch (BpmnError e) {
+            throw e;
+
+        } catch (Exception ex){
+            String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow." +
+                    " Unexpected from method preProcessRequest() - " + ex.getMessage()
+            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
+        }
+    }
+
+    public void sendSyncResponse(Execution execution) {
+        def isDebugEnabled=execution.getVariable(DebugFlag)
+
+        utils.log("DEBUG", " ***** Inside sendSyncResponse of CreateVcpeResCustService ***** ", isDebugEnabled)
+
+        try {
+            String serviceInstanceId = execution.getVariable("serviceInstanceId")
+            String requestId = execution.getVariable("mso-request-id")
+
+            // RESTResponse (for API Handler (APIH) Reply Task)
+            String syncResponse ="""{"requestReferences":{
+                        "instanceId":"${serviceInstanceId}",
+                        "requestId":"${requestId}"
+                        }}""".trim()
+
+            utils.log("DEBUG", " sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse, isDebugEnabled)
+            sendWorkflowResponse(execution, 202, syncResponse)
+
+        } catch (Exception ex) {
+            String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. " +
+                    "Unexpected from method sendSyncResponse() - " + ex.getMessage()
+            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
+        }
+    }
+
+    // *******************************
+    //
+    // *******************************
+    public void prepareDecomposeService(Execution execution) {
+        def isDebugEnabled=execution.getVariable(DebugFlag)
+
+        try {
+            utils.log("DEBUG",
+                    " ***** Inside prepareDecomposeService of CreateVcpeResCustService ***** ", isDebugEnabled)
+
+            String createVcpeServiceRequest = execution.getVariable("createVcpeServiceRequest")
+
+            //serviceModelInfo JSON string will be used as-is for DoCreateServiceInstance BB
+            String serviceModelInfo = jsonUtil.getJsonValue(createVcpeServiceRequest,
+                    "requestDetails.modelInfo")
+            execution.setVariable("serviceModelInfo", serviceModelInfo)
+
+            utils.log("DEBUG",
+                    " ***** Completed prepareDecomposeService of CreateVcpeResCustService ***** ", isDebugEnabled)
+        } catch (Exception ex) {
+            // try error in method block
+            String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. " +
+                    "Unexpected Error from method prepareDecomposeService() - " + ex.getMessage()
+            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
+        }
+     }
+
+    // *******************************
+    //
+    // *******************************
+    public void prepareCreateServiceInstance(Execution execution) {
+        def isDebugEnabled=execution.getVariable(DebugFlag)
+
+        try {
+            utils.log("DEBUG",
+                    " ***** Inside prepareCreateServiceInstance of CreateVcpeResCustService ***** ", isDebugEnabled)
+
+            /*
+             * Service modelInfo is created in earlier step. This flow can use it as-is ... or, extract from
+             * DecompositionObject
+             *      ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+             *      ModelInfo modelInfo = serviceDecomposition.getModelInfo()
+             *
+             */
+            String createVcpeServiceRequest = execution.getVariable("createVcpeServiceRequest")
+//          String serviceInputParams = jsonUtil.getJsonValue(createVcpeServiceRequest,
+//                  "requestDetails.requestParameters")
+//          execution.setVariable("serviceInputParams", serviceInputParams)
+
+
+            String serviceInstanceName = jsonUtil.getJsonValue(createVcpeServiceRequest,
+                    "requestDetails.requestInfo.instanceName")
+            execution.setVariable("serviceInstanceName", serviceInstanceName)
+
+            ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+            execution.setVariable("serviceDecompositionString", serviceDecomposition.toJsonStringNoRootName())
+
+            utils.log("DEBUG",
+                    " ***** Completed prepareCreateServiceInstance of CreateVcpeResCustService ***** ", isDebugEnabled)
+        } catch (Exception ex) {
+            // try error in method block
+            String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. " +
+                    "Unexpected Error from method prepareCreateServiceInstance() - " + ex.getMessage()
+            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
+        }
+     }
+
+    public void postProcessServiceInstanceCreate (Execution execution){
+        def method = getClass().getSimpleName() + '.postProcessServiceInstanceCreate(' +
+                'execution=' + execution.getId() +')'
+        def isDebugLogEnabled = execution.getVariable(DebugFlag)
+        logDebug('Entered ' + method, isDebugLogEnabled)
+
+        String requestId = execution.getVariable("mso-request-id")
+        String serviceInstanceId = execution.getVariable("serviceInstanceId")
+        String serviceInstanceName = execution.getVariable("serviceInstanceName")
+
+        try {
+
+            String payload = """
+            <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
+xmlns:req="http://org.openecomp.mso/requestsdb">
+            <soapenv:Header/>
+            <soapenv:Body>
+            <req:updateInfraRequest>
+                <requestId>${requestId}</requestId>
+                <lastModifiedBy>BPEL</lastModifiedBy>
+                <serviceInstanceId>${serviceInstanceId}</serviceInstanceId>
+                <serviceInstanceName>${serviceInstanceName}</serviceInstanceName>
+            </req:updateInfraRequest>
+            </soapenv:Body>
+            </soapenv:Envelope>
+            """
+            execution.setVariable(Prefix+"setUpdateDbInstancePayload", payload)
+            utils.logAudit(Prefix+"setUpdateDbInstancePayload: " + payload)
+            logDebug('Exited ' + method, isDebugLogEnabled)
+
+        } catch (BpmnError e) {
+            throw e;
+        } catch (Exception e) {
+            logError('Caught exception in ' + method, e)
+            exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error - Occured in" + method)
+        }
+    }
+
+
+    public void processDecomposition (Execution execution) {
+        def isDebugEnabled=execution.getVariable(DebugFlag)
+
+        utils.log("DEBUG", " ***** Inside processDecomposition() of CreateVcpeResCustService ***** ", isDebugEnabled)
+
+        try {
+
+            ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+
+            // VNFs
+            List<VnfResource> vnfList = serviceDecomposition.getServiceVnfs()
+            filterVnfs(vnfList)
+            serviceDecomposition.setServiceVnfs(vnfList)
+
+            execution.setVariable("vnfList", vnfList)
+            execution.setVariable("vnfListString", vnfList.toString())
+
+            String vnfModelInfoString = ""
+            if (vnfList != null && vnfList.size() > 0) {
+                execution.setVariable(Prefix+"VNFsCount", vnfList.size())
+                utils.log("DEBUG", "vnfs to create: "+ vnfList.size(), isDebugEnabled)
+                ModelInfo vnfModelInfo = vnfList[0].getModelInfo()
+
+                vnfModelInfoString = vnfModelInfo.toString()
+                String vnfModelInfoWithRoot = vnfModelInfo.toString()
+                vnfModelInfoString = jsonUtil.getJsonValue(vnfModelInfoWithRoot, "modelInfo")
+            } else {
+                    execution.setVariable(Prefix+"VNFsCount", 0)
+                    utils.log("DEBUG", "no vnfs to create based upon serviceDecomposition content", isDebugEnabled)
+            }
+
+            execution.setVariable("vnfModelInfo", vnfModelInfoString)
+            execution.setVariable("vnfModelInfoString", vnfModelInfoString)
+            utils.log("DEBUG", " vnfModelInfoString :" + vnfModelInfoString, isDebugEnabled)
+
+            utils.log("DEBUG",
+                    " ***** Completed processDecomposition() of CreateVcpeResCustService ***** ", isDebugEnabled)
+        } catch (Exception ex) {
+            sendSyncError(execution)
+           String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. " +
+                   "processDecomposition() - " + ex.getMessage()
+           utils.log("DEBUG", exceptionMessage, isDebugEnabled)
+           exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
+        }
+    }
+
+    private void filterVnfs(List<VnfResource> vnfList) {
+        if(vnfList == null) {
+            return
+        }
+
+        // remove BRG & TXC from VNF list
+
+        Iterator<VnfResource> it = vnfList.iterator()
+        while(it.hasNext()) {
+            VnfResource vr = it.next()
+
+            String role = vr.getNfRole()
+            if(role == "BRG" || role == "TunnelXConn") {
+                it.remove()
+            }
+        }
+    }
+
+
+    public void prepareCreateAllottedResourceTXC(Execution execution) {
+        def isDebugEnabled=execution.getVariable(DebugFlag)
+
+        try {
+            utils.log("DEBUG",
+                    " ***** Inside prepareCreateAllottedResourceTXC of CreateVcpeResCustService ***** ", isDebugEnabled)
+
+            /*
+             * Service modelInfo is created in earlier step. This flow can use it as-is ... or, extract from
+             * DecompositionObject
+             *      ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+             *      ModelInfo modelInfo = serviceDecomposition.getModelInfo()
+             *
+             */
+            String createVcpeServiceRequest = execution.getVariable("createVcpeServiceRequest")
+            ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+
+            //allottedResourceModelInfo
+            //allottedResourceRole
+            //The model Info parameters are a JSON structure as defined in the Service Instantiation API.
+            //It would be sufficient to only include the service model UUID (i.e. the modelVersionId), since this
+            //BB will query the full model from the Catalog DB.
+            List<AllottedResource> allottedResources = serviceDecomposition.getServiceAllottedResources()
+            if (allottedResources != null) {
+                Iterator iter = allottedResources.iterator();
+                while (iter.hasNext()){
+                    AllottedResource allottedResource = (AllottedResource)iter.next();
+
+                    utils.log("DEBUG", " getting model info for AllottedResource # :" +
+                            allottedResource.toJsonStringNoRootName(), isDebugEnabled)
+                    utils.log("DEBUG", " allottedResource.getAllottedResourceType() :" +
+                            allottedResource.getAllottedResourceType(), isDebugEnabled)
+                    if("TunnelXConn".equalsIgnoreCase(allottedResource.getAllottedResourceType())){
+                        //set create flag to true
+                        execution.setVariable("createTXCAR", true)
+                        ModelInfo allottedResourceModelInfo = allottedResource.getModelInfo()
+                        execution.setVariable("allottedResourceModelInfoTXC",
+                                allottedResourceModelInfo.toJsonStringNoRootName())
+                        execution.setVariable("allottedResourceRoleTXC", allottedResource.getAllottedResourceRole())
+                        execution.setVariable("allottedResourceTypeTXC", allottedResource.getAllottedResourceType())
+                        //After decomposition and homing BBs, there should be an allotted resource object in the
+                        // decomposition that represents the TXC,
+                        //and in its homingSolution section should be found the infraServiceInstanceId
+                        // (i.e. infraServiceInstanceId in TXC Allotted Resource structure) (which the Homing
+                        // BB would have populated).
+                        execution.setVariable("parentServiceInstanceIdTXC",
+                                allottedResource.getHomingSolution().getServiceInstanceId())
+                    }
+                }
+            }
+
+            //unit test only
+            String allottedResourceId = execution.getVariable("allottedResourceId")
+            execution.setVariable("allottedResourceIdTXC", allottedResourceId)
+            utils.log("DEBUG",
+                    "setting allottedResourceId CreateVcpeResCustService "+ allottedResourceId, isDebugEnabled)
+
+            utils.log("DEBUG",
+                    " ***** Completed prepareCreateAllottedResourceTXC of CreateVcpeResCustService ***** ",
+                    isDebugEnabled)
+        } catch (Exception ex) {
+            // try error in method block
+            String exceptionMessage = "Bpmn error encountered in prepareCreateAllottedResourceTXC flow. " +
+                    "Unexpected Error from method prepareCreateServiceInstance() - " + ex.getMessage()
+            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
+        }
+     }
+    public void prepareCreateAllottedResourceBRG(Execution execution) {
+        def isDebugEnabled=execution.getVariable(DebugFlag)
+
+        try {
+            utils.log("DEBUG",
+                    " ***** Inside prepareCreateAllottedResourceBRG of CreateVcpeResCustService ***** ", isDebugEnabled)
+
+            /*
+             * Service modelInfo is created in earlier step. This flow can use it as-is ... or, extract from
+             * DecompositionObject
+             *      ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+             *      ModelInfo modelInfo = serviceDecomposition.getModelInfo()
+             *
+             */
+            String createVcpeServiceRequest = execution.getVariable("createVcpeServiceRequest")
+            ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+
+            //allottedResourceModelInfo
+            //allottedResourceRole
+            //The model Info parameters are a JSON structure as defined in the Service Instantiation API.
+            //It would be sufficient to only include the service model UUID (i.e. the modelVersionId), since this
+            // BB will query the full model from the Catalog DB.
+            List<AllottedResource> allottedResources = serviceDecomposition.getServiceAllottedResources()
+            if (allottedResources != null) {
+                Iterator iter = allottedResources.iterator();
+                while (iter.hasNext()){
+                    AllottedResource allottedResource = (AllottedResource)iter.next();
+
+                    utils.log("DEBUG", " getting model info for AllottedResource # :" +
+                            allottedResource.toJsonStringNoRootName(), isDebugEnabled)
+                    utils.log("DEBUG", " allottedResource.getAllottedResourceType() :" +
+                            allottedResource.getAllottedResourceType(), isDebugEnabled)
+                    if("BRG".equalsIgnoreCase(allottedResource.getAllottedResourceType())){
+                        //set create flag to true
+                        execution.setVariable("createBRGAR", true)
+                        ModelInfo allottedResourceModelInfo = allottedResource.getModelInfo()
+                        execution.setVariable("allottedResourceModelInfoBRG",
+                                allottedResourceModelInfo.toJsonStringNoRootName())
+                        execution.setVariable("allottedResourceRoleBRG", allottedResource.getAllottedResourceRole())
+                        execution.setVariable("allottedResourceTypeBRG", allottedResource.getAllottedResourceType())
+                        //After decomposition and homing BBs, there should be an allotted resource object in the
+                        // decomposition that represents the BRG,
+                        //and in its homingSolution section should be found the infraServiceInstanceId
+                        // (i.e. infraServiceInstanceId in BRG Allotted Resource structure) (which the Homing
+                        // BB would have populated).
+                        execution.setVariable("parentServiceInstanceIdBRG",
+                                allottedResource.getHomingSolution().getServiceInstanceId())
+                    }
+                }
+            }
+
+            //unit test only
+            String allottedResourceId = execution.getVariable("allottedResourceId")
+            execution.setVariable("allottedResourceIdBRG", allottedResourceId)
+            utils.log("DEBUG",
+                    "setting allottedResourceId CreateVcpeResCustService " + allottedResourceId, isDebugEnabled)
+
+            utils.log("DEBUG",
+                    " ***** Completed prepareCreateAllottedResourceBRG of CreateVcpeResCustService ***** ",
+                    isDebugEnabled)
+        } catch (Exception ex) {
+            // try error in method block
+            String exceptionMessage = "Bpmn error encountered in prepareCreateAllottedResourceBRG flow. " +
+                    "Unexpected Error from method prepareCreateServiceInstance() - " + ex.getMessage()
+            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
+        }
+     }
+
+
+
+    // *******************************
+    //     Generate Network request Section
+    // *******************************
+    public void prepareVnfAndModulesCreate (Execution execution) {
+        def isDebugEnabled=execution.getVariable(DebugFlag)
+
+        try {
+            utils.log("DEBUG",
+                    " ***** Inside prepareVnfAndModulesCreate of CreateVcpeResCustService ***** ", isDebugEnabled)
+
+            //          String disableRollback = execution.getVariable("disableRollback")
+            //          def backoutOnFailure = ""
+            //          if(disableRollback != null){
+            //              if ( disableRollback == true) {
+            //                  backoutOnFailure = "false"
+            //              } else if ( disableRollback == false) {
+            //                  backoutOnFailure = "true"
+            //              }
+            //          }
+                        //failIfExists - optional
+
+            String createVcpeServiceRequest = execution.getVariable("createVcpeServiceRequest")
+            String productFamilyId = jsonUtil.getJsonValue(createVcpeServiceRequest,
+                    "requestDetails.requestInfo.productFamilyId")
+            execution.setVariable("productFamilyId", productFamilyId)
+            utils.log("DEBUG","productFamilyId: "+ productFamilyId, isDebugEnabled)
+
+            List<VnfResource> vnfList = execution.getVariable("vnfList")
+
+            Integer vnfsCreatedCount = execution.getVariable(Prefix+"VnfsCreatedCount")
+            String vnfModelInfoString = null;
+
+            if (vnfList != null && vnfList.size() > 0 ) {
+                utils.log("DEBUG", "getting model info for vnf # " + vnfsCreatedCount, isDebugEnabled)
+                ModelInfo vnfModelInfo1 = vnfList[0].getModelInfo()
+                utils.log("DEBUG", "got 0 ", isDebugEnabled)
+                ModelInfo vnfModelInfo = vnfList[vnfsCreatedCount.intValue()].getModelInfo()
+                vnfModelInfoString = vnfModelInfo.toString()
+            } else {
+                //TODO: vnfList does not contain data. Need to investigate why ... . Fro VCPE use model stored
+                vnfModelInfoString = execution.getVariable("vnfModelInfo")
+            }
+
+            utils.log("DEBUG", " vnfModelInfoString :" + vnfModelInfoString, isDebugEnabled)
+
+            // extract cloud configuration
+            String lcpCloudRegionId = jsonUtil.getJsonValue(createVcpeServiceRequest,
+                    "requestDetails.cloudConfiguration.lcpCloudRegionId")
+            execution.setVariable("lcpCloudRegionId", lcpCloudRegionId)
+            utils.log("DEBUG","lcpCloudRegionId: "+ lcpCloudRegionId, isDebugEnabled)
+            String tenantId = jsonUtil.getJsonValue(createVcpeServiceRequest,
+                    "requestDetails.cloudConfiguration.tenantId")
+            execution.setVariable("tenantId", tenantId)
+            utils.log("DEBUG","tenantId: "+ tenantId, isDebugEnabled)
+
+            String sdncVersion = execution.getVariable("sdncVersion")
+            utils.log("DEBUG","sdncVersion: "+ sdncVersion, isDebugEnabled)
+
+            utils.log("DEBUG",
+                    " ***** Completed prepareVnfAndModulesCreate of CreateVcpeResCustService ***** ", isDebugEnabled)
+        } catch (Exception ex) {
+            // try error in method block
+            String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. " +
+                    "Unexpected Error from method prepareVnfAndModulesCreate() - " + ex.getMessage()
+            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
+        }
+     }
+
+    // *******************************
+    //     Validate Vnf request Section -> increment count
+    // *******************************
+    public void validateVnfCreate (Execution execution) {
+        def isDebugEnabled=execution.getVariable(DebugFlag)
+
+        try {
+            utils.log("DEBUG", " ***** Inside validateVnfCreate of CreateVcpeResCustService ***** ", isDebugEnabled)
+
+            Integer vnfsCreatedCount = execution.getVariable(Prefix+"VnfsCreatedCount")
+            vnfsCreatedCount++
+
+            execution.setVariable(Prefix+"VnfsCreatedCount", vnfsCreatedCount)
+
+            utils.log("DEBUG",
+                    " ***** Completed validateVnfCreate of CreateVcpeResCustService ***** "+" vnf # "+vnfsCreatedCount, isDebugEnabled)
+        } catch (Exception ex) {
+            // try error in method block
+            String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. " +
+                    "Unexpected Error from method validateVnfCreate() - " + ex.getMessage()
+            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
+        }
+     }
+
+    // *****************************************
+    //     Prepare Completion request Section
+    // *****************************************
+    public void postProcessResponse (Execution execution) {
+        def isDebugEnabled=execution.getVariable(DebugFlag)
+
+        utils.log("DEBUG", " ***** Inside postProcessResponse of CreateVcpeResCustService ***** ", isDebugEnabled)
+
+        try {
+            String source = execution.getVariable("source")
+            String requestId = execution.getVariable("mso-request-id")
+            String serviceInstanceId = execution.getVariable("serviceInstanceId")
+
+            String msoCompletionRequest =
+                    """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+                                    xmlns:ns="http://org.openecomp/mso/request/types/v1">
+                            <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+                                <request-id>${requestId}</request-id>
+                                <action>CREATE</action>
+                                <source>${source}</source>
+                            </request-info>
+                            <status-message>Service Instance has been created successfully via macro orchestration</status-message>
+                            <serviceInstanceId>${serviceInstanceId}</serviceInstanceId>
+                            <mso-bpel-name>BPMN macro create</mso-bpel-name>
+                        </aetgt:MsoCompletionRequest>"""
+
+            // Format Response
+            String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
+
+            utils.logAudit(xmlMsoCompletionRequest)
+            execution.setVariable(Prefix+"Success", true)
+            execution.setVariable(Prefix+"CompleteMsoProcessRequest", xmlMsoCompletionRequest)
+            utils.log("DEBUG", " SUCCESS flow, going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest, isDebugEnabled)
+        } catch (BpmnError e) {
+            throw e;
+        } catch (Exception ex) {
+            // try error in method block
+            String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. " +
+                    "Unexpected Error from method postProcessResponse() - " + ex.getMessage()
+            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
+        }
+    }
+
+    public void preProcessRollback (Execution execution) {
+        def isDebugEnabled=execution.getVariable(DebugFlag)
+        utils.log("DEBUG"," ***** preProcessRollback of CreateVcpeResCustService ***** ", isDebugEnabled)
+        try {
+
+            Object workflowException = execution.getVariable("WorkflowException");
+
+            if (workflowException instanceof WorkflowException) {
+                utils.log("DEBUG", "Prev workflowException: " + workflowException.getErrorMessage(), isDebugEnabled)
+                execution.setVariable("prevWorkflowException", workflowException);
+                //execution.setVariable("WorkflowException", null);
+            }
+        } catch (BpmnError e) {
+            utils.log("DEBUG", "BPMN Error during preProcessRollback", isDebugEnabled)
+        } catch(Exception ex) {
+            String msg = "Exception in preProcessRollback. " + ex.getMessage()
+            utils.log("DEBUG", msg, isDebugEnabled)
+        }
+        utils.log("DEBUG"," *** Exit preProcessRollback of CreateVcpeResCustService *** ", isDebugEnabled)
+    }
+
+    public void postProcessRollback (Execution execution) {
+        def isDebugEnabled=execution.getVariable(DebugFlag)
+        utils.log("DEBUG"," ***** postProcessRollback of CreateVcpeResCustService ***** ", isDebugEnabled)
+        String msg = ""
+        try {
+            Object workflowException = execution.getVariable("prevWorkflowException");
+            if (workflowException instanceof WorkflowException) {
+                utils.log("DEBUG", "Setting prevException to WorkflowException: ", isDebugEnabled)
+                execution.setVariable("WorkflowException", workflowException);
+            }
+        } catch (BpmnError b) {
+            utils.log("DEBUG", "BPMN Error during postProcessRollback", isDebugEnabled)
+            throw b;
+        } catch(Exception ex) {
+            msg = "Exception in postProcessRollback. " + ex.getMessage()
+            utils.log("DEBUG", msg, isDebugEnabled)
+        }
+        utils.log("DEBUG"," *** Exit postProcessRollback of CreateVcpeResCustService *** ", isDebugEnabled)
+    }
+
+    public void prepareFalloutRequest(Execution execution){
+        def isDebugEnabled=execution.getVariable(DebugFlag)
+
+        utils.log("DEBUG", " *** STARTED CreateVcpeResCustService prepareFalloutRequest Process *** ", isDebugEnabled)
+
+        try {
+            WorkflowException wfex = execution.getVariable("WorkflowException")
+            utils.log("DEBUG", " Incoming Workflow Exception: " + wfex.toString(), isDebugEnabled)
+            String requestInfo = execution.getVariable(Prefix+"requestInfo")
+            utils.log("DEBUG", " Incoming Request Info: " + requestInfo, isDebugEnabled)
+
+            //TODO. hmmm. there is no way to UPDATE error message.
+//          String errorMessage = wfex.getErrorMessage()
+//          boolean successIndicator = execution.getVariable("DCRESI_rolledBack")
+//          if (successIndicator){
+//              errorMessage = errorMessage + ". Rollback successful."
+//          } else {
+//              errorMessage = errorMessage + ". Rollback not completed."
+//          }
+
+            String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
+
+            execution.setVariable(Prefix+"falloutRequest", falloutRequest)
+
+        } catch (Exception ex) {
+            utils.log("DEBUG",
+                    "Error Occured in CreateVcpeResCustService prepareFalloutRequest Process " + ex.getMessage(),
+                    isDebugEnabled)
+            exceptionUtil.buildAndThrowWorkflowException(execution, 2500,
+                    "Internal Error - Occured in CreateVcpeResCustService prepareFalloutRequest Process")
+        }
+        utils.log("DEBUG",
+                "*** COMPLETED CreateVcpeResCustService prepareFalloutRequest Process ***", isDebugEnabled)
+    }
+
+
+    public void sendSyncError (Execution execution) {
+        def isDebugEnabled=execution.getVariable(DebugFlag)
+        execution.setVariable("prefix", Prefix)
+
+        utils.log("DEBUG", " ***** Inside sendSyncError() of CreateVcpeResCustService ***** ", isDebugEnabled)
+
+        try {
+            String errorMessage = ""
+            def wfe = execution.getVariable("WorkflowException")
+            if (wfe instanceof WorkflowException) {
+                errorMessage = wfe.getErrorMessage()
+            } else {
+                errorMessage = "Sending Sync Error."
+            }
+
+            String buildworkflowException =
+                """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
+                    <aetgt:ErrorMessage>${errorMessage}</aetgt:ErrorMessage>
+                    <aetgt:ErrorCode>7000</aetgt:ErrorCode>
+                   </aetgt:WorkflowException>"""
+
+            utils.logAudit(buildworkflowException)
+            sendWorkflowResponse(execution, 500, buildworkflowException)
+        } catch (Exception ex) {
+            utils.log("DEBUG", " Sending Sync Error Activity Failed. " + "\n" + ex.getMessage(), isDebugEnabled)
+        }
+    }
+
+    public void processJavaException(Execution execution){
+        def isDebugEnabled=execution.getVariable(DebugFlag)
+        execution.setVariable("prefix",Prefix)
+        try{
+            utils.log("DEBUG", "Caught a Java Exception", isDebugEnabled)
+            utils.log("DEBUG", "Started processJavaException Method", isDebugEnabled)
+            utils.log("DEBUG", "Variables List: " + execution.getVariables(), isDebugEnabled)
+            // Adding below line temporarily until this flows error handling gets updated
+            execution.setVariable(Prefix+"unexpectedError", "Caught a Java Lang Exception")
+            exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Caught a Java Lang Exception")
+        }catch(BpmnError b){
+            utils.log("ERROR", "Rethrowing MSOWorkflowException", isDebugEnabled)
+            throw b
+        }catch(Exception e){
+            utils.log("DEBUG", "Caught Exception during processJavaException Method: " + e, isDebugEnabled)
+            // Adding below line temporarily until this flows error handling gets updated
+            execution.setVariable(Prefix+"unexpectedError", "Exception in processJavaException method")
+            exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Exception in processJavaException method")
+        }
+        utils.log("DEBUG", "Completed processJavaException Method", isDebugEnabled)
+    }
+}
index c26b14e..cac2ad8 100644 (file)
@@ -222,7 +222,7 @@ public class DoCreateAllottedResourceBRGRollback extends AbstractServiceTaskProc
                try {
                        execution.setVariable("rollbackData", null)
                        boolean skipRollback = execution.getVariable("skipRollback")
-                       if (skipRollback != true)
+                       if (!skipRollback)
                        {
                                execution.setVariable("rolledBack", true)
                                utils.log("DEBUG","rolledBack", isDebugEnabled)
index ff621e5..08f2df2 100644 (file)
@@ -222,7 +222,7 @@ public class DoCreateAllottedResourceTXCRollback extends AbstractServiceTaskProc
                try {
                        execution.setVariable("rollbackData", null)
                        boolean skipRollback = execution.getVariable("skipRollback")
-                       if (skipRollback != true)
+                       if (!skipRollback)
                        {
                                execution.setVariable("rolledBack", true)
                                utils.log("DEBUG","rolledBack", isDebugEnabled)
index 80b11bb..dbf5a57 100644 (file)
@@ -32,8 +32,8 @@ import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResource;
 \r
 @ApplicationPath("/")\r
 public class WorkflowResourceApplication extends Application {\r
-    private Set<Object> singletons = new HashSet<Object>();\r
-    private Set<Class<?>> classes = new HashSet<Class<?>>();\r
+    private Set<Object> singletons = new HashSet<>();\r
+    private Set<Class<?>> classes = new HashSet<>();\r
 \r
     public WorkflowResourceApplication() {\r
         singletons.add(new WorkflowResource());\r
index 54bd8cd..0749c78 100644 (file)
@@ -24,9 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.entity.ContentType;
 import org.apache.http.entity.StringEntity;
@@ -43,7 +41,6 @@ import org.openecomp.mso.bpmn.core.PropertyConfiguration;
 import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.GenericResourceApi;
 import org.openecomp.mso.logger.MessageEnum;
 import org.openecomp.mso.logger.MsoLogger;
-import org.openecomp.mso.requestsdb.RequestsDatabase;
 import org.openecomp.mso.requestsdb.RequestsDbConstant;
 import org.openecomp.mso.requestsdb.ResourceOperationStatus;
 import org.slf4j.Logger;
@@ -62,12 +59,12 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
     private static final Logger logger = LoggerFactory.getLogger(AbstractSdncOperationTask.class);
 
     private static final String DEFAULT_MSB_IP = "127.0.0.1";
-    private static final int DEFAULT_MSB_Port = 80;
+    private static final int DEFAULT_MSB_PORT = 80;
     private static final String SDCADAPTOR_INPUTS = "resourceParameters";
+    private static final String TOPOLOGY_PROPERTIES = "topology.properties";
     public static final String ONAP_IP = "ONAP_IP";
-    private RequestsDatabase requestsDB = RequestsDatabase.getInstance();
 
-    private static final String postBodyTemplate = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://org.openecomp.mso/requestsdb\"><soapenv:Header/><soapenv:Body>\n"+
+    private static final String POST_BODY_TEMPLATE = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://org.openecomp.mso/requestsdb\"><soapenv:Header/><soapenv:Body>\n"+
             "     <ns:updateResourceOperationStatus>\n"+
             "                <errorCode>$errorCode</errorCode>\n"+
             "                <jobId>$jobId</jobId>\n"+
@@ -80,7 +77,7 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
             "                <statusDescription>$statusDescription</statusDescription>\n"+
             "     </ns:updateResourceOperationStatus></soapenv:Body></soapenv:Envelope>";
 
-    private static final String getBodyTemplate = " <soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://org.openecomp.mso/requestsdb\"><soapenv:Header/><soapenv:Body>\n" +
+    private static final String GET_BODY_TEMPLATE = " <soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://org.openecomp.mso/requestsdb\"><soapenv:Header/><soapenv:Body>\n" +
             "     <ns:getResourceOperationStatus>\n" +
             "                <operationId>$operationId</operationId>\n" +
             "                <resourceTemplateUUID>$resourceTemplateUUID</resourceTemplateUUID>\n" +
@@ -98,7 +95,6 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
         httpPost.setEntity(new StringEntity(postBody, ContentType.APPLICATION_XML));
         httpPost(url, httpPost);
         logger.info("AbstractSdncOperationTask.updateResOperStatus end!");
-        //requestsDB.updateResOperStatus(resourceOperationStatus);
     }
 
     protected String getPostbody(Object inputEntity) {
@@ -108,7 +104,7 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
             objectMapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
             postBody = objectMapper.writeValueAsString(inputEntity);
         } catch (JsonProcessingException e) {
-            e.printStackTrace();
+            logger.error(e.getStackTrace().toString());
         }
         return postBody;
     }
@@ -118,24 +114,20 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
         String result = null;
 
         String errorMsg;
-        label91: {
-            try(CloseableHttpClient httpClient = HttpClients.createDefault()) {
-                CloseableHttpResponse closeableHttpResponse = httpClient.execute(httpPost);
-                result = EntityUtils.toString(closeableHttpResponse.getEntity());
-                logger.info("result = {}", result);
-//                LOGGER.info(MessageEnum.RA_RESPONSE_FROM_SDNC, result.toString(), "SDNC", "");
-                if(closeableHttpResponse.getStatusLine().getStatusCode() != 200) {
-                    logger.info("exception: fail for status code = {}", closeableHttpResponse.getStatusLine().getStatusCode());
-                    throw new RouteException(result, "SERVICE_GET_ERR");
-                }
-
-                closeableHttpResponse.close();
-                break label91;
-            } catch (IOException e) {
-                errorMsg = url + ":httpPostWithJSON connect faild";
-                logger.info("exception: POST_CONNECT_FAILD : {}", errorMsg);
-                throwsRouteException(errorMsg, e, "POST_CONNECT_FAILD");
+        try(CloseableHttpClient httpClient = HttpClients.createDefault()) {
+            CloseableHttpResponse closeableHttpResponse = httpClient.execute(httpPost);
+            result = EntityUtils.toString(closeableHttpResponse.getEntity());
+            logger.info("result = {}", result);
+            if(closeableHttpResponse.getStatusLine().getStatusCode() != 200) {
+                logger.info("exception: fail for status code = {}", closeableHttpResponse.getStatusLine().getStatusCode());
+                throw new RouteException(result, "SERVICE_GET_ERR");
             }
+
+            closeableHttpResponse.close();
+        } catch (IOException e) {
+            errorMsg = url + ":httpPostWithJSON connect faild";
+            logger.info("exception: POST_CONNECT_FAILD : {}", errorMsg);
+            throwsRouteException(errorMsg, e, "POST_CONNECT_FAILD");
         }
 
         logger.info("AbstractSdncOperationTask.httpPost end!");
@@ -150,7 +142,7 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
 
     private String getPostStringBody(ResourceOperationStatus resourceOperationStatus) {
         logger.info("AbstractSdncOperationTask.getPostStringBody begin!");
-        String postBody = new String(postBodyTemplate);
+        String postBody = POST_BODY_TEMPLATE;
         postBody = postBody.replace("$errorCode", resourceOperationStatus.getErrorCode());
         postBody = postBody.replace("$jobId", resourceOperationStatus.getJobId());
         postBody = postBody.replace("$operType", resourceOperationStatus.getOperType());
@@ -166,7 +158,7 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
 
     private String getGetStringBody(String serviceId, String operationId, String resourceTemplateUUID) {
         logger.info("AbstractSdncOperationTask.getGetStringBody begin!");
-        String getBody = new String(getBodyTemplate);
+        String getBody = GET_BODY_TEMPLATE;
         getBody = getBody.replace("$operationId", operationId);
         getBody = getBody.replace("$resourceTemplateUUID", resourceTemplateUUID);
         getBody = getBody.replace("$serviceId", serviceId);
@@ -186,35 +178,6 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
         ResourceOperationStatus resourceOperationStatus = getResourceOperationStatusFromXmlString(result);
         logger.info("AbstractSdncOperationTask.getResourceOperationStatus end!");
         return resourceOperationStatus;
-
-        //return requestsDB.getResourceOperationStatus(serviceId, operationId, resourceTemplateUUID);
-    }
-
-    private String httpGet(String url, HttpGet httpGet) throws RouteException {
-        logger.info("AbstractSdncOperationTask.httpGet begin!");
-        String result = "";
-        String errorMsg;
-        try(CloseableHttpClient httpClient = HttpClients.createDefault()) {
-                   CloseableHttpResponse e = httpClient.execute(httpGet);
-                   result = EntityUtils.toString(e.getEntity());
-                   logger.info("result = {}", result);
-               if (e.getStatusLine().getStatusCode() != 200) {
-                       logger.info("exception: fail for status code = {}", e.getStatusLine().getStatusCode());
-                        throw new RouteException(result, "SERVICE_GET_ERR");
-                    }
-                    e.close();
-           } catch (ClientProtocolException e) {
-                   errorMsg = url + ":httpGetWithJSON connect faild";
-                   logger.info("exception: GET_CONNECT_FAILD {}", errorMsg);
-                   throwsRouteException(errorMsg, e, "GET_CONNECT_FAILD");
-           } catch (IOException e) {
-                   errorMsg = url + ":httpGetWithJSON connect faild";
-                   logger.info("exception: GET_CONNECT_FAILD {}", errorMsg);
-                   throwsRouteException(errorMsg, e, "GET_CONNECT_FAILD");
-           }
-
-        logger.info("AbstractSdncOperationTask.httpGet end!");
-        return result;
     }
 
     private ResourceOperationStatus getResourceOperationStatusFromXmlString(String result) {
@@ -233,33 +196,30 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
         return resourceOperationStatus;
     }
 
-    private String getValueByName(String Name, String xml) {
-        if (!StringUtils.isBlank(xml) && xml.contains(Name)) {
-            String start = "<" + Name + ">";
-            String end = "</" + Name + ">";
+    private String getValueByName(String name, String xml) {
+        if (!StringUtils.isBlank(xml) && xml.contains(name)) {
+            String start = "<" + name + ">";
+            String end = "</" + name + ">";
             return xml.substring(xml.indexOf(start), xml.indexOf(end)).replace(start, "");
         }
         return "";
     }
 
-    protected static MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
+    protected static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
 
     @Override
     public void execute(DelegateExecution execution) {
         logger.info("AbstractSdncOperationTask.execute begin!");
-        GenericResourceApi genericResourceApiClient = getGenericResourceApiClient(execution);
-//        updateProgress(execution, RequestsDbConstant.Status.PROCESSING, null, "10", "execute begin!");
+        GenericResourceApi genericResourceApiClient = getGenericResourceApiClient();
         try {
             Map<String, String> inputs = getInputs(execution);
-//        updateProgress(execution, null, null, "30", "getGenericResourceApiClient finished!");
 
             sendRestrequestAndHandleResponse(execution, inputs, genericResourceApiClient);
             execution.setVariable("SDNCA_SuccessIndicator", true);
-//            updateProgress(execution, RequestsDbConstant.Status.FINISHED, null, RequestsDbConstant.Progress.ONE_HUNDRED, "execute finished!");
         } catch (Exception e) {
             logger.info("exception: AbstractSdncOperationTask.fail!");
             logger.error("exception: AbstractSdncOperationTask.fail!:", e);
-            e.printStackTrace();
+            logger.error(e.getStackTrace().toString());
             execution.setVariable("SDNCA_SuccessIndicator", false);
             updateProgress(execution, RequestsDbConstant.Status.ERROR, null, "100", "sendRestrequestAndHandleResponse finished!");
 
@@ -279,9 +239,6 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
                 String key = iterator.next();
                 inputs.put(key, paras.getString(key));
             }
-/*        if (paras.keys().hasNext()) {
-            paras.keySet().stream().forEach(key -> inputs.put(key, paras.getString((String) key)));
-        }*/
         }
         logger.info("AbstractSdncOperationTask.getInputs end!");
         return inputs;
@@ -321,14 +278,14 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
         } catch (Exception exception) {
             logger.info("exception: AbstractSdncOperationTask.updateProgress fail!");
             logger.error("exception: AbstractSdncOperationTask.updateProgress fail:", exception);
-            LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " updateProgress catch exception: ", "", this.getTaskName(), MsoLogger.ErrorCode.UnknownError, exception.getClass().toString());
+            msoLogger.error(MessageEnum.GENERAL_EXCEPTION, " updateProgress catch exception: ", "", this.getTaskName(), MsoLogger.ErrorCode.UnknownError, exception.getClass().toString());
         }
     }
 
 
     protected boolean isSend2SdncDirectly() {
         logger.info("AbstractSdncOperationTask.isSend2SdncDirectly begin!");
-        Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("topology.properties");
+        Map<String, String> properties = PropertyConfiguration.getInstance().getProperties(TOPOLOGY_PROPERTIES);
         if (properties != null) {
             String sdncIp = properties.get("sdnc-ip");
             String sdncPort = properties.get("sdnc-port");
@@ -365,11 +322,10 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
         return returnPort;
     }
 
-    private GenericResourceApi getGenericResourceApiClient(DelegateExecution execution) {
+    private GenericResourceApi getGenericResourceApiClient() {
         logger.info("AbstractSdncOperationTask.getGenericResourceApiClient begin!");
-//        updateProgress(execution, null, null, "20", "getGenericResourceApiClient begin!");
         String msbIp = System.getenv().get(ONAP_IP);
-        int msbPort = DEFAULT_MSB_Port;
+        int msbPort = DEFAULT_MSB_PORT;
         Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("topology.properties");
         if (properties != null) {
             if (StringUtils.isBlank(msbIp) || !isIp(msbIp)) {
@@ -380,7 +336,7 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
             }
             String strMsbPort = properties.get("msb-port");
             if (StringUtils.isBlank(strMsbPort)) {
-                strMsbPort = getString(properties, "msb.port", String.valueOf(DEFAULT_MSB_Port));
+                strMsbPort = getString(properties, "msb.port", String.valueOf(DEFAULT_MSB_PORT));
             }
             msbPort = Integer.valueOf(strMsbPort);
         }
@@ -402,19 +358,7 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
                 return vlaue;
             }
         } catch (Exception e) {
-            LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " getMsbIp catch exception: ", "", this.getTaskName(), MsoLogger.ErrorCode.UnknownError, e.getClass().toString());
-        }
-        return defaultValue;
-    }
-
-    private Integer getInteger(DelegateExecution execution, String name, Integer defaultValue) {
-        Integer vlaue = (Integer) execution.getVariable(name);
-        try {
-            if (vlaue != null) {
-                return vlaue;
-            }
-        } catch (Exception e) {
-            LOGGER.error(MessageEnum.GENERAL_EXCEPTION, " getMsbIp catch exception: ", "", this.getTaskName(), MsoLogger.ErrorCode.UnknownError, e.getClass().toString());
+            msoLogger.error(MessageEnum.GENERAL_EXCEPTION, " getMsbIp catch exception: ", "", this.getTaskName(), MsoLogger.ErrorCode.UnknownError, e.getClass().toString());
         }
         return defaultValue;
     }
index 60bc83b..25c85f7 100644 (file)
@@ -42,7 +42,7 @@ import java.util.Map;
  * Created by 10112215 on 2017/9/20.
  */
 public class SdncNetworkTopologyOperationTask extends AbstractSdncOperationTask {
-    private static final Logger logger = LoggerFactory.getLogger(SdncNetworkTopologyOperationTask.class);
+    private static final Logger sdncLogger = LoggerFactory.getLogger(SdncNetworkTopologyOperationTask.class);
 
 
     private static final String URL = "/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation";
@@ -51,7 +51,7 @@ public class SdncNetworkTopologyOperationTask extends AbstractSdncOperationTask
     public void sendRestrequestAndHandleResponse(DelegateExecution execution,
                                                  Map<String, String> inputs,
                                                  GenericResourceApi genericResourceApiClient) throws Exception {
-        logger.info("SdncNetworkTopologyOperationTask.sendRestrequestAndHandleResponse begin!");
+        sdncLogger.info("SdncNetworkTopologyOperationTask.sendRestrequestAndHandleResponse begin!");
         updateProgress(execution, RequestsDbConstant.Status.PROCESSING, null, "40", "sendRestrequestAndHandleResponse begin!");
         NetworkRpcInputEntityBuilder builder = new NetworkRpcInputEntityBuilder();
         RpcNetworkTopologyOperationInputEntity inputEntity = builder.build(execution, inputs);
@@ -63,41 +63,41 @@ public class SdncNetworkTopologyOperationTask extends AbstractSdncOperationTask
             updateProgress(execution, null, null, "90", "sendRestrequestAndHandleResponse finished!");
             saveOutput(execution, outputEntity);
         } else {
-            Send2SdncDirectly(HeaderUtil.DefaulAuth, inputEntity);
+            send2SdncDirectly(HeaderUtil.DefaulAuth, inputEntity);
         }
         updateProgress(execution, RequestsDbConstant.Status.FINISHED, null, RequestsDbConstant.Progress.ONE_HUNDRED, "execute finished!");
-        logger.info("SdncNetworkTopologyOperationTask.sendRestrequestAndHandleResponse end!");
+        sdncLogger.info("SdncNetworkTopologyOperationTask.sendRestrequestAndHandleResponse end!");
     }
 
-    private void Send2SdncDirectly(String defaulAuth,
+    private void send2SdncDirectly(String defaulAuth,
                                    RpcNetworkTopologyOperationInputEntity inputEntity) throws RouteException {
-        logger.info("SdncNetworkTopologyOperationTask.Send2SdncDirectly begin!");
+        sdncLogger.info("SdncNetworkTopologyOperationTask.send2SdncDirectly begin!");
         String url = "http://" + getSdncIp() + ":" + getSdncPort() + URL;
         HttpPost httpPost = new HttpPost(url);
         httpPost.addHeader("Authorization", defaulAuth);
         httpPost.addHeader("Content-type", "application/json");
         String postBody = getPostbody(inputEntity);
-        LOGGER.info(MessageEnum.RA_SEND_REQUEST_SDNC, postBody, "SDNC", "");
+        msoLogger.info(MessageEnum.RA_SEND_REQUEST_SDNC, postBody, "SDNC", "");
         httpPost.setEntity(new StringEntity(postBody, ContentType.APPLICATION_XML));
         httpPost(url, httpPost);
-        logger.info("SdncNetworkTopologyOperationTask.Send2SdncDirectly end!");
+        sdncLogger.info("SdncNetworkTopologyOperationTask.send2SdncDirectly end!");
     }
 
-    private void saveOutput(DelegateExecution execution, RpcNetworkTopologyOperationOutputEntity output) throws Exception {
-        logger.info("SdncNetworkTopologyOperationTask.saveOutput begin!");
+    private void saveOutput(DelegateExecution execution, RpcNetworkTopologyOperationOutputEntity output) throws RouteException {
+        sdncLogger.info("SdncNetworkTopologyOperationTask.saveOutput begin!");
         String responseCode = output.getOutput().getResponseCode();
         if (!"200".equals(responseCode)) {
             String processKey = getProcessKey(execution);
-            int errorCode = Integer.valueOf(responseCode);
+            int errorCode = Integer.parseInt(responseCode);
             String errorMessage = output.getOutput().getResponseMessage();
             WorkflowException workflowException = new WorkflowException(processKey, errorCode, errorMessage);
             execution.setVariable("SDNCA_SuccessIndicator", workflowException);
             updateProgress(execution, RequestsDbConstant.Status.ERROR, String.valueOf(errorCode), "100", errorMessage);
-            logger.info("exception: SdncNetworkTopologyOperationTask.saveOutput fail!");
-            throw new Exception("");
+            sdncLogger.info("exception: SdncNetworkTopologyOperationTask.saveOutput fail!");
+            throw new RouteException();
         }
-        
-        logger.info("SdncNetworkTopologyOperationTask.saveOutput end!");
+
+        sdncLogger.info("SdncNetworkTopologyOperationTask.saveOutput end!");
     }
 
 }
index 6028944..130c97e 100644 (file)
@@ -42,7 +42,7 @@ import java.util.Map;
  * Created by 10112215 on 2017/9/26.
  */
 public class SdncServiceTopologyOperationTask extends AbstractSdncOperationTask {
-    private static final Logger logger = LoggerFactory.getLogger(SdncServiceTopologyOperationTask.class);
+    private static final Logger sdncLogger = LoggerFactory.getLogger(SdncServiceTopologyOperationTask.class);
 
 
     private static final String URL = "/restconf/operations/GENERIC-RESOURCE-API:service-topology-operation";
@@ -51,7 +51,7 @@ public class SdncServiceTopologyOperationTask extends AbstractSdncOperationTask
     public void sendRestrequestAndHandleResponse(DelegateExecution execution,
                                                  Map<String, String> inputs,
                                                  GenericResourceApi genericResourceApiClient) throws Exception {
-        logger.info("SdncServiceTopologyOperationTask.sendRestrequestAndHandleResponse begin!");
+        sdncLogger.info("SdncServiceTopologyOperationTask.sendRestrequestAndHandleResponse begin!");
 //        updateProgress(execution, null, null, "40", "sendRestrequestAndHandleResponse begin!");
         ServiceRpcInputEntityBuilder builder = new ServiceRpcInputEntityBuilder();
         RpcServiceTopologyOperationInputEntity inputEntity = builder.build(execution, inputs);
@@ -63,39 +63,39 @@ public class SdncServiceTopologyOperationTask extends AbstractSdncOperationTask
 //        updateProgress(execution, null, null, "90", "sendRestrequestAndHandleResponse finished!");
             saveOutput(execution, outputEntity);
         } else {
-            Send2SdncDirectly(HeaderUtil.DefaulAuth, inputEntity);
+            send2SdncDirectly(HeaderUtil.DefaulAuth, inputEntity);
         }
-        logger.info("SdncServiceTopologyOperationTask.sendRestrequestAndHandleResponse end!");
+        sdncLogger.info("SdncServiceTopologyOperationTask.sendRestrequestAndHandleResponse end!");
 
     }
 
-    private void Send2SdncDirectly(String defaulAuth,
+    private void send2SdncDirectly(String defaulAuth,
                                    RpcServiceTopologyOperationInputEntity inputEntity) throws RouteException {
-        logger.info("SdncServiceTopologyOperationTask.Send2SdncDirectly begin!");
+        sdncLogger.info("SdncServiceTopologyOperationTask.send2SdncDirectly begin!");
         String url = "http://" + getSdncIp() + ":" + getSdncPort() + URL;
         HttpPost httpPost = new HttpPost(url);
         httpPost.addHeader("Authorization", defaulAuth);
         httpPost.addHeader("Content-type", "application/json");
         String postBody = getPostbody(inputEntity);
-        LOGGER.info(MessageEnum.RA_SEND_REQUEST_SDNC, postBody, "SDNC", "");
+        msoLogger.info(MessageEnum.RA_SEND_REQUEST_SDNC, postBody, "SDNC", "");
         httpPost.setEntity(new StringEntity(postBody, ContentType.APPLICATION_XML));
         httpPost(url, httpPost);
-        logger.info("SdncServiceTopologyOperationTask.Send2SdncDirectly end!");
+        sdncLogger.info("SdncServiceTopologyOperationTask.send2SdncDirectly end!");
     }
 
     private void saveOutput(DelegateExecution execution, RpcServiceTopologyOperationOutputEntity output) throws Exception {
-        logger.info("SdncServiceTopologyOperationTask.saveOutput begin!");
+        sdncLogger.info("SdncServiceTopologyOperationTask.saveOutput begin!");
         String responseCode = output.getOutput().getResponseCode();
         if (!"200".equals(responseCode)) {
             String processKey = getProcessKey(execution);
-            int errorCode = Integer.valueOf(responseCode);
+            int errorCode = Integer.parseInt(responseCode);
             String errorMessage = output.getOutput().getResponseMessage();
             WorkflowException workflowException = new WorkflowException(processKey, errorCode, errorMessage);
             execution.setVariable("SDNCA_SuccessIndicator", workflowException);
 //            updateProgress(execution, RequestsDbConstant.Status.ERROR, String.valueOf(errorCode), null, errorMessage);
-            logger.info("exception: SdncServiceTopologyOperationTask.saveOutput fail!");
-            throw new Exception("");
+            sdncLogger.info("exception: SdncServiceTopologyOperationTask.saveOutput fail!");
+            throw new RouteException();
         }
-        logger.info("SdncServiceTopologyOperationTask.saveOutput end!");
+        sdncLogger.info("SdncServiceTopologyOperationTask.saveOutput end!");
     }
 }
index 49d702d..add87b1 100644 (file)
@@ -41,7 +41,7 @@ import java.util.Map;
 public class SdncUnderlayVpnOperationClient {
 
     private static final String DEFAULT_MSB_IP = "127.0.0.1";
-    private static final int DEFAULT_MSB_Port = 10081;
+    private static final int DEFAULT_MSB_PORT = 10081;
     private RequestsDatabase requestsDB = RequestsDatabase.getInstance();
 
     private String serviceId;
@@ -54,11 +54,11 @@ public class SdncUnderlayVpnOperationClient {
     public boolean excute(String msbIp,
                        int msbPort,
                        Map<String, String> inputs,
-                       String serviceId_i,
-                       String operationId_i,
+                       String iServiceID,
+                       String iOperationID,
                        String resourceTemplateUUID_i){
-        serviceId = serviceId_i;
-        operationId = operationId_i;
+        serviceId = iServiceID;
+        operationId = iOperationID;
         resourceTemplateUUID = resourceTemplateUUID_i;
         GenericResourceApi genericResourceApiClient = getGenericResourceApiClient(msbIp, msbPort);
         updateProgress(RequestsDbConstant.Status.PROCESSING, null, "10", "execute begin!");
@@ -72,15 +72,13 @@ public class SdncUnderlayVpnOperationClient {
         updateProgress(null, null, "50", "RequestBody build finished!");
         RpcNetworkTopologyOperationOutputEntity networkRpcOutputEntiy = null;
         try {
-            networkRpcOutputEntiy = genericResourceApiClient.postNetworkTopologyOperation
-                    (HeaderUtil.DefaulAuth ,body).execute().body();
+            genericResourceApiClient.postNetworkTopologyOperation(HeaderUtil.DefaulAuth ,body).execute().body();
         } catch (Exception e) {
             logger.debug("Exception: ", e);
             updateProgress(RequestsDbConstant.Status.ERROR, null, null, "sendRestrequestAndHandleResponse exception:" + e.getMessage());
             return false;
         }
         updateProgress(null, null, "90", "sendRestrequestAndHandleResponse finished!");
-        saveOutput(networkRpcOutputEntiy);
         updateProgress(RequestsDbConstant.Status.FINISHED, null, RequestsDbConstant.Progress.ONE_HUNDRED, "execute finished!");
         return true;
     }
@@ -90,7 +88,7 @@ public class SdncUnderlayVpnOperationClient {
             msbIp = DEFAULT_MSB_IP;
         }
         if (msbPort <= 0) {
-            msbPort = DEFAULT_MSB_Port;
+            msbPort = DEFAULT_MSB_PORT;
         }
         MSBServiceClient msbClient = new MSBServiceClient(msbIp, msbPort);
         RestServiceCreater restServiceCreater = new RestServiceCreater(msbClient);
@@ -117,7 +115,7 @@ public class SdncUnderlayVpnOperationClient {
         requestsDB.updateResOperStatus(resourceOperationStatus);
     }
 
-    private void saveOutput(RpcNetworkTopologyOperationOutputEntity output) {
-
+    private void saveOutput() {
+        // Not implemented.
     }
 }
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/UpdateCustomE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/UpdateCustomE2EServiceInstance.bpmn
new file mode 100644 (file)
index 0000000..e7a88be
--- /dev/null
@@ -0,0 +1,337 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.11.3">
+  <bpmn:process id="UpdateCustomE2EServiceInstance" name="UpdateCustomE2EServiceInstance" isExecutable="true">
+    <bpmn:startEvent id="StartEvent_00qj6ro" name="Update SI Start Flow">
+      <bpmn:outgoing>SequenceFlow_0s2spoq</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:subProcess id="SubProcess_0ka59nc" name="Sub-process for UnexpectedErrors" triggeredByEvent="true">
+      <bpmn:scriptTask id="ScriptTask_0u3lw39" name="Handle Unexpected Error" scriptFormat="groovy">
+        <bpmn:incoming>SequenceFlow_1dsbjjb</bpmn:incoming>
+        <bpmn:outgoing>SequenceFlow_1yay321</bpmn:outgoing>
+        <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.common.scripts.*\r
+ExceptionUtil ex = new ExceptionUtil()\r
+ex.processJavaException(execution)]]></bpmn:script>
+      </bpmn:scriptTask>
+      <bpmn:startEvent id="StartEvent_0v1ffn4">
+        <bpmn:outgoing>SequenceFlow_1dsbjjb</bpmn:outgoing>
+        <bpmn:errorEventDefinition />
+      </bpmn:startEvent>
+      <bpmn:endEvent id="EndEvent_0eznq6x">
+        <bpmn:incoming>SequenceFlow_1yay321</bpmn:incoming>
+      </bpmn:endEvent>
+      <bpmn:sequenceFlow id="SequenceFlow_1dsbjjb" name="" sourceRef="StartEvent_0v1ffn4" targetRef="ScriptTask_0u3lw39" />
+      <bpmn:sequenceFlow id="SequenceFlow_1yay321" name="" sourceRef="ScriptTask_0u3lw39" targetRef="EndEvent_0eznq6x" />
+    </bpmn:subProcess>
+    <bpmn:callActivity id="DoUpdateE2EServiceInstance" name="Call DoUpdateE2EServiceInstance&#10;" calledElement="DoUpdateE2EServiceInstance">
+      <bpmn:extensionElements>
+        <camunda:out source="WorkflowException" target="WorkflowException" />
+        <camunda:in source="msoRequestId" target="msoRequestId" />
+        <camunda:out source="rollbackData" target="rollbackData" />
+        <camunda:in source="serviceInstanceId" target="serviceInstanceId" />
+        <camunda:in source="serviceInstanceName" target="serviceInstanceName" />
+        <camunda:in source="productFamilyId" target="productFamilyId" />
+        <camunda:in source="disableRollback" target="disableRollback" />
+        <camunda:in source="uuiRequest" target="uuiRequest" />
+        <camunda:out source="rolledBack" target="rolledBack" />
+        <camunda:out source="serviceInstanceName" target="serviceInstanceName" />
+        <camunda:in source="failIfExists" target="failIfExists" />
+        <camunda:in source="globalSubscriberId" target="globalSubscriberId" />
+        <camunda:in source="serviceType" target="serviceType" />
+        <camunda:in source="initialStatus" target="initialStatus" />
+        <camunda:in source="operationId" target="operationId" />
+        <camunda:in source="operationType" target="operationType" />
+        <camunda:in source="URN_mso_adapters_openecomp_db_endpoint" target="URN_mso_adapters_openecomp_db_endpoint" />
+      </bpmn:extensionElements>
+      <bpmn:incoming>SequenceFlow_19eilro</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0klbpxx</bpmn:outgoing>
+    </bpmn:callActivity>
+    <bpmn:endEvent id="EndEvent_0bpd6c0" name="End">
+      <bpmn:incoming>SequenceFlow_0yayvrf</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:scriptTask id="ScriptTask_1s09c7d" name="Pre Process Incoming Request" scriptFormat="groovy">
+      <bpmn:incoming>SequenceFlow_0s2spoq</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0z4faf9</bpmn:outgoing>
+      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*\r
+def csi= new UpdateCustomE2EServiceInstance()\r
+csi.preProcessRequest(execution)]]></bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:scriptTask id="ScriptTask_0ttvn8r" name="Prepare Completion Request" scriptFormat="groovy">
+      <bpmn:incoming>SequenceFlow_14zu6wr</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0je30si</bpmn:outgoing>
+      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*\r
+def csi = new UpdateCustomE2EServiceInstance()\r
+csi.prepareCompletionRequest(execution)]]></bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:callActivity id="CallActivity_02fyxz0" name="Call CompleteMsoProcess" calledElement="CompleteMsoProcess">
+      <bpmn:extensionElements>
+        <camunda:in source="completionRequest" target="CompleteMsoProcessRequest" />
+        <camunda:in source="mso-request-id" target="mso-request-id" />
+        <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" />
+        <camunda:out source="CMSO_ResponseCode" target="CMSO_ResponseCode" />
+        <camunda:out source="CompleteMsoProcessResponse" target="CompleteMsoProcessResponse" />
+        <camunda:out source="CMSO_ErrorResponse" target="CMSO_ErrorResponse" />
+      </bpmn:extensionElements>
+      <bpmn:incoming>SequenceFlow_0je30si</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0yayvrf</bpmn:outgoing>
+    </bpmn:callActivity>
+    <bpmn:subProcess id="SubProcess_0vaws86" name="Sub-process for FalloutHandler and Rollback" triggeredByEvent="true">
+      <bpmn:startEvent id="StartEvent_0dug28e">
+        <bpmn:outgoing>SequenceFlow_0e1r62n</bpmn:outgoing>
+        <bpmn:errorEventDefinition />
+      </bpmn:startEvent>
+      <bpmn:endEvent id="EndEvent_03wysuk">
+        <bpmn:incoming>SequenceFlow_1ysapam</bpmn:incoming>
+      </bpmn:endEvent>
+      <bpmn:scriptTask id="ScriptTask_0u8o9p2" name="Prepare Fallout Request" scriptFormat="groovy">
+        <bpmn:incoming>SequenceFlow_0n9pexp</bpmn:incoming>
+        <bpmn:outgoing>SequenceFlow_01umodj</bpmn:outgoing>
+        <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*\r
+def csi = new UpdateCustomE2EServiceInstance()\r
+csi.prepareFalloutRequest(execution)]]></bpmn:script>
+      </bpmn:scriptTask>
+      <bpmn:callActivity id="CallActivity_1ang7q8" name="Call FalloutHandler" calledElement="FalloutHandler">
+        <bpmn:extensionElements>
+          <camunda:in source="falloutRequest" target="FalloutHandlerRequest" />
+          <camunda:in source="mso-request-id" target="mso-request-id" />
+          <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" />
+          <camunda:out source="FH_ResponseCode" target="FH_ResponseCode" />
+          <camunda:out source="FalloutHandlerResponse" target="FalloutHandlerResponse" />
+          <camunda:out source="FH_ErrorResponse" target="FH_ErrorResponse" />
+        </bpmn:extensionElements>
+        <bpmn:incoming>SequenceFlow_01umodj</bpmn:incoming>
+        <bpmn:outgoing>SequenceFlow_1ysapam</bpmn:outgoing>
+      </bpmn:callActivity>
+      <bpmn:scriptTask id="ScriptTask_1rn6nqi" name="Send Error Response">
+        <bpmn:incoming>SequenceFlow_0e1r62n</bpmn:incoming>
+        <bpmn:outgoing>SequenceFlow_0n9pexp</bpmn:outgoing>
+        <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*\r
+def csi = new  UpdateCustomE2EServiceInstance()\r
+csi.sendSyncError(execution)]]></bpmn:script>
+      </bpmn:scriptTask>
+      <bpmn:sequenceFlow id="SequenceFlow_0e1r62n" sourceRef="StartEvent_0dug28e" targetRef="ScriptTask_1rn6nqi" />
+      <bpmn:sequenceFlow id="SequenceFlow_1ysapam" sourceRef="CallActivity_1ang7q8" targetRef="EndEvent_03wysuk" />
+      <bpmn:sequenceFlow id="SequenceFlow_0n9pexp" sourceRef="ScriptTask_1rn6nqi" targetRef="ScriptTask_0u8o9p2" />
+      <bpmn:sequenceFlow id="SequenceFlow_01umodj" sourceRef="ScriptTask_0u8o9p2" targetRef="CallActivity_1ang7q8" />
+    </bpmn:subProcess>
+    <bpmn:scriptTask id="ScriptTask_0xupxj9" name="Send Sync Ack Response" scriptFormat="groovy">
+      <bpmn:incoming>SequenceFlow_0z4faf9</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_19eilro</bpmn:outgoing>
+      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*\r
+def csi = new  UpdateCustomE2EServiceInstance()\r
+csi.sendSyncResponse(execution)]]></bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:exclusiveGateway id="ExclusiveGateway_0aqn64l" name="Success?">
+      <bpmn:incoming>SequenceFlow_0klbpxx</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_14zu6wr</bpmn:outgoing>
+      <bpmn:outgoing>SequenceFlow_1fueo69</bpmn:outgoing>
+    </bpmn:exclusiveGateway>
+    <bpmn:endEvent id="EndEvent_07uk5iy">
+      <bpmn:incoming>SequenceFlow_1fueo69</bpmn:incoming>
+      <bpmn:errorEventDefinition errorRef="Error_0nbdy47" />
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_0s2spoq" sourceRef="StartEvent_00qj6ro" targetRef="ScriptTask_1s09c7d" />
+    <bpmn:sequenceFlow id="SequenceFlow_19eilro" sourceRef="ScriptTask_0xupxj9" targetRef="DoUpdateE2EServiceInstance" />
+    <bpmn:sequenceFlow id="SequenceFlow_0klbpxx" sourceRef="DoUpdateE2EServiceInstance" targetRef="ExclusiveGateway_0aqn64l" />
+    <bpmn:sequenceFlow id="SequenceFlow_0yayvrf" sourceRef="CallActivity_02fyxz0" targetRef="EndEvent_0bpd6c0" />
+    <bpmn:sequenceFlow id="SequenceFlow_0z4faf9" sourceRef="ScriptTask_1s09c7d" targetRef="ScriptTask_0xupxj9" />
+    <bpmn:sequenceFlow id="SequenceFlow_14zu6wr" name="yes" sourceRef="ExclusiveGateway_0aqn64l" targetRef="ScriptTask_0ttvn8r">
+      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("WorkflowException") == null}]]></bpmn:conditionExpression>
+    </bpmn:sequenceFlow>
+    <bpmn:sequenceFlow id="SequenceFlow_0je30si" sourceRef="ScriptTask_0ttvn8r" targetRef="CallActivity_02fyxz0" />
+    <bpmn:sequenceFlow id="SequenceFlow_1fueo69" name="no" sourceRef="ExclusiveGateway_0aqn64l" targetRef="EndEvent_07uk5iy">
+      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("WorkflowException") != null}]]></bpmn:conditionExpression>
+    </bpmn:sequenceFlow>
+  </bpmn:process>
+  <bpmn:error id="Error_0nbdy47" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="UpdateCustomE2EServiceInstance">
+      <bpmndi:BPMNShape id="StartEvent_00qj6ro_di" bpmnElement="StartEvent_00qj6ro">
+        <dc:Bounds x="-6" y="180" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="-24" y="221" width="73" height="24" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="SubProcess_0ka59nc_di" bpmnElement="SubProcess_0ka59nc" isExpanded="true">
+        <dc:Bounds x="463" y="632" width="394" height="188" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="CallActivity_0rhljy8_di" bpmnElement="DoUpdateE2EServiceInstance">
+        <dc:Bounds x="717" y="158" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_0bpd6c0_di" bpmnElement="EndEvent_0bpd6c0">
+        <dc:Bounds x="1258" y="286" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1268" y="322" width="22" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ScriptTask_1s09c7d_di" bpmnElement="ScriptTask_1s09c7d">
+        <dc:Bounds x="214" y="158" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ScriptTask_0ttvn8r_di" bpmnElement="ScriptTask_0ttvn8r">
+        <dc:Bounds x="1038" y="158" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="CallActivity_02fyxz0_di" bpmnElement="CallActivity_02fyxz0">
+        <dc:Bounds x="1226" y="158" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="SubProcess_0vaws86_di" bpmnElement="SubProcess_0vaws86" isExpanded="true">
+        <dc:Bounds x="348" y="370" width="679" height="194" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ScriptTask_0xupxj9_di" bpmnElement="ScriptTask_0xupxj9">
+        <dc:Bounds x="459" y="158" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ExclusiveGateway_0aqn64l_di" bpmnElement="ExclusiveGateway_0aqn64l" isMarkerVisible="true">
+        <dc:Bounds x="903" y="173" width="50" height="50" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="903" y="145" width="50" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_07uk5iy_di" bpmnElement="EndEvent_07uk5iy">
+        <dc:Bounds x="910" y="286" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="883" y="322" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0s2spoq_di" bpmnElement="SequenceFlow_0s2spoq">
+        <di:waypoint xsi:type="dc:Point" x="30" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="214" y="198" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="77" y="177" width="90" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_19eilro_di" bpmnElement="SequenceFlow_19eilro">
+        <di:waypoint xsi:type="dc:Point" x="559" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="717" y="198" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="593" y="177" width="90" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_0klbpxx_di" bpmnElement="SequenceFlow_0klbpxx">
+        <di:waypoint xsi:type="dc:Point" x="817" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="903" y="198" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="815" y="177" width="90" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_0yayvrf_di" bpmnElement="SequenceFlow_0yayvrf">
+        <di:waypoint xsi:type="dc:Point" x="1276" y="238" />
+        <di:waypoint xsi:type="dc:Point" x="1276" y="286" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1246" y="262" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_0z4faf9_di" bpmnElement="SequenceFlow_0z4faf9">
+        <di:waypoint xsi:type="dc:Point" x="314" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="459" y="198" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="341.5" y="177" width="90" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_14zu6wr_di" bpmnElement="SequenceFlow_14zu6wr">
+        <di:waypoint xsi:type="dc:Point" x="953" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="990" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="990" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="1038" y="198" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="987" y="195" width="20" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_0je30si_di" bpmnElement="SequenceFlow_0je30si">
+        <di:waypoint xsi:type="dc:Point" x="1138" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="1226" y="198" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1137" y="183" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_1fueo69_di" bpmnElement="SequenceFlow_1fueo69">
+        <di:waypoint xsi:type="dc:Point" x="928" y="223" />
+        <di:waypoint xsi:type="dc:Point" x="928" y="250" />
+        <di:waypoint xsi:type="dc:Point" x="928" y="250" />
+        <di:waypoint xsi:type="dc:Point" x="928" y="286" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="901" y="228" width="15" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ScriptTask_0u3lw39_di" bpmnElement="ScriptTask_0u3lw39">
+        <dc:Bounds x="611" y="687" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="StartEvent_0v1ffn4_di" bpmnElement="StartEvent_0v1ffn4">
+        <dc:Bounds x="496" y="709" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="469" y="750" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_0eznq6x_di" bpmnElement="EndEvent_0eznq6x">
+        <dc:Bounds x="772" y="709" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="745" y="750" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="StartEvent_0dug28e_di" bpmnElement="StartEvent_0dug28e">
+        <dc:Bounds x="363" y="456" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="336" y="497" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_03wysuk_di" bpmnElement="EndEvent_03wysuk">
+        <dc:Bounds x="942" y="456" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="915" y="497" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ScriptTask_0u8o9p2_di" bpmnElement="ScriptTask_0u8o9p2">
+        <dc:Bounds x="621" y="434" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="CallActivity_1ang7q8_di" bpmnElement="CallActivity_1ang7q8">
+        <dc:Bounds x="798" y="434" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ScriptTask_1rn6nqi_di" bpmnElement="ScriptTask_1rn6nqi">
+        <dc:Bounds x="443" y="434" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_1dsbjjb_di" bpmnElement="SequenceFlow_1dsbjjb">
+        <di:waypoint xsi:type="dc:Point" x="532" y="727" />
+        <di:waypoint xsi:type="dc:Point" x="611" y="727" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529.5" y="727" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_1yay321_di" bpmnElement="SequenceFlow_1yay321">
+        <di:waypoint xsi:type="dc:Point" x="711" y="727" />
+        <di:waypoint xsi:type="dc:Point" x="772" y="727" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="701.5" y="727" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_0e1r62n_di" bpmnElement="SequenceFlow_0e1r62n">
+        <di:waypoint xsi:type="dc:Point" x="399" y="474" />
+        <di:waypoint xsi:type="dc:Point" x="421" y="474" />
+        <di:waypoint xsi:type="dc:Point" x="421" y="474" />
+        <di:waypoint xsi:type="dc:Point" x="442" y="474" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="391" y="474" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_1ysapam_di" bpmnElement="SequenceFlow_1ysapam">
+        <di:waypoint xsi:type="dc:Point" x="898" y="474" />
+        <di:waypoint xsi:type="dc:Point" x="942" y="474" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="875" y="459" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_0n9pexp_di" bpmnElement="SequenceFlow_0n9pexp">
+        <di:waypoint xsi:type="dc:Point" x="543" y="474" />
+        <di:waypoint xsi:type="dc:Point" x="570" y="474" />
+        <di:waypoint xsi:type="dc:Point" x="570" y="474" />
+        <di:waypoint xsi:type="dc:Point" x="621" y="474" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="540" y="474" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01umodj_di" bpmnElement="SequenceFlow_01umodj">
+        <di:waypoint xsi:type="dc:Point" x="721" y="474" />
+        <di:waypoint xsi:type="dc:Point" x="798" y="474" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="715.5" y="459" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
index 3b97cad..7a494db 100644 (file)
@@ -109,6 +109,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
                assertTrue(map.containsKey("subscriberInfo"))
                
                verify(mex).setVariable("brgWanMacAddress", "brgmac")
+               verify(mex).setVariable("customerLocation", ["customerLatitude":"32.897480", "customerLongitude":"-97.040443", "customerName":"some_company"])
                assertTrue(map.containsKey("serviceInputParams"))
                assertTrue(map.containsKey(Prefix+"requestInfo"))
                
@@ -141,6 +142,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
                def req = request
                                        .replace('"source"', '"sourceXXX"')
                                        .replace('"BRG_WAN_MAC_Address"', '"BRG_WAN_MAC_AddressXXX"')
+                                       .replace('"Customer_Location"', '"Customer_LocationXXX"')
                
                when(mex.getVariable("bpmnRequest")).thenReturn(req)
                when(mex.getVariable("serviceInstanceId")).thenReturn(null)
@@ -164,6 +166,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
                assertTrue(map.containsKey("subscriberInfo"))
                
                assertEquals("", map.get("brgWanMacAddress"))
+               assertEquals("", map.get("customerLocation"))
                assertTrue(map.containsKey("serviceInputParams"))
                assertTrue(map.containsKey(Prefix+"requestInfo"))
                
index 571db76..5496645 100644 (file)
@@ -113,7 +113,7 @@ public class CreateGenericALaCarteServiceInstanceTest extends WorkflowTest {
 
        // Success Scenario
        private Map<String, String> setupVariables() {
-               Map<String, String> variables = new HashMap<String, String>();
+               Map<String, String> variables = new HashMap<>();
                variables.put("isDebugLogEnabled", "true");
                variables.put("bpmnRequest", getRequest());
                variables.put("mso-request-id", "RaaCSIRequestId-1");
index c259310..b95ebb5 100644 (file)
@@ -430,7 +430,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest {
 
        // Success Scenario
        private Map<String, String> setupVariables1() {
-               Map<String, String> variables = new HashMap<String, String>();
+               Map<String, String> variables = new HashMap<>();
                variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
                variables.put("msoRequestId", "testRequestId");
                variables.put("requestId", "testRequestId");
@@ -455,7 +455,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest {
 
        // Success Scenario 2
        private Map<String, String> setupVariables2() {
-               Map<String, String> variables = new HashMap<String, String>();
+               Map<String, String> variables = new HashMap<>();
                variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
                variables.put("msoRequestId", "testRequestId");
                variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
@@ -479,7 +479,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest {
 
        // Active Scenario
        private Map<String, String> setupVariablesActive() {
-               Map<String, String> variables = new HashMap<String, String>();
+               Map<String, String> variables = new HashMap<>();
                variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
                variables.put("msoRequestId", "testRequestId");
                variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
@@ -503,7 +503,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest {
 
        // Missing Name Scenario
        private Map<String, String> setupVariablesMissingName() {
-               Map<String, String> variables = new HashMap<String, String>();
+               Map<String, String> variables = new HashMap<>();
                //variables.put("bpmnRequest", getCreateNetworkRequestMissingName());
                variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
                variables.put("msoRequestId", "testRequestId");
@@ -524,7 +524,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest {
 
        // SDNC Rollback Scenario
        private Map<String, String> setupVariablesSDNCRollback() {
-               Map<String, String> variables = new HashMap<String, String>();
+               Map<String, String> variables = new HashMap<>();
                variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
                variables.put("msoRequestId", "testRequestId");
                variables.put("serviceInstanceId", "f70e927b-6087-4974-9ef8-c5e4d5847ca4");
@@ -609,7 +609,7 @@ public class CreateNetworkInstanceTest extends WorkflowTest {
 
        // VID json input
        private Map<String, String> setupVariablesVID1() {
-               Map<String, String> variables = new HashMap<String, String>();
+               Map<String, String> variables = new HashMap<>();
                variables.put("bpmnRequest", getCreateNetworkRequestVID1());
                variables.put("mso-request-id", "testRequestId");
                //variables.put("msoRequestId", "testRequestId");
index 7585899..a28e95a 100644 (file)
@@ -175,7 +175,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
        \r
        // Active Scenario\r
                private Map<String, Object> setupVariablesSunnyDayVID() {\r
-                       Map<String, Object> variables = new HashMap<String, Object>();\r
+                       Map<String, Object> variables = new HashMap<>();\r
                        //try {\r
                                //variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));\r
                        //}\r
@@ -263,7 +263,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
                \r
                // Active Scenario\r
                        private Map<String, Object> setupVariablesSunnyDayVIDWVolumeAttach() {\r
-                               Map<String, Object> variables = new HashMap<String, Object>();\r
+                               Map<String, Object> variables = new HashMap<>();\r
                                //try {\r
                                //      variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));\r
                                //}\r
index 4496ab0..23999c9 100644 (file)
@@ -88,7 +88,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
                String businessKey = UUID.randomUUID().toString();
                String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json");
                
-               Map<String, Object> testVariables = new HashMap<String, Object>();
+               Map<String, Object> testVariables = new HashMap<>();
                testVariables.put("requestId", "TEST-REQUEST-ID-0123");
                testVariables.put("serviceInstanceId", "test-service-instance-id");
                testVariables.put("vnfId", "TEST-VNF-ID-0123");
@@ -138,7 +138,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
                String businessKey = UUID.randomUUID().toString();
                String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json");
                
-               Map<String, Object> testVariables = new HashMap<String, Object>();
+               Map<String, Object> testVariables = new HashMap<>();
                testVariables.put("requestId", "TEST-REQUEST-ID-0123");
                testVariables.put("serviceInstanceId", "test-service-instance-id");
                testVariables.put("vnfId", "TEST-VNF-ID-0123");
@@ -182,7 +182,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
                String businessKey = UUID.randomUUID().toString();
                String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json");
                
-               Map<String, Object> testVariables = new HashMap<String, Object>();
+               Map<String, Object> testVariables = new HashMap<>();
                testVariables.put("requestId", "TEST-REQUEST-ID-0123");
                testVariables.put("serviceInstanceId", "test-service-instance-id");
                testVariables.put("vnfId", "TEST-VNF-ID-0123");
@@ -229,7 +229,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
                String businessKey = UUID.randomUUID().toString();
                String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json");
                
-               Map<String, Object> testVariables = new HashMap<String, Object>();
+               Map<String, Object> testVariables = new HashMap<>();
                testVariables.put("requestId", "TEST-REQUEST-ID-0123");
                testVariables.put("serviceInstanceId", "test-service-instance-id");
                testVariables.put("vnfId", "TEST-VNF-ID-0123");
@@ -271,7 +271,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
                String businessKey = UUID.randomUUID().toString();
                String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request_noreqparm.json");
                
-               Map<String, Object> testVariables = new HashMap<String, Object>();
+               Map<String, Object> testVariables = new HashMap<>();
                testVariables.put("requestId", "TEST-REQUEST-ID-0123");
                testVariables.put("serviceInstanceId", "test-service-instance-id");
                testVariables.put("vnfId", "TEST-VNF-ID-0123");
@@ -311,7 +311,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
                String businessKey = UUID.randomUUID().toString();
                String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json");
                
-               Map<String, Object> testVariables = new HashMap<String, Object>();
+               Map<String, Object> testVariables = new HashMap<>();
                testVariables.put("requestId", "TEST-REQUEST-ID-0123");
                testVariables.put("serviceInstanceId", "test-service-instance-id");
                //testVariables.put("vnfId", "TEST-VNF-ID-0123");
@@ -349,7 +349,7 @@ public class CreateVfModuleVolumeInfraV1Test extends WorkflowTest {
                String businessKey = UUID.randomUUID().toString();
                String createVfModuleVolRequest = FileUtil.readResourceFile("__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json");
                
-               Map<String, Object> testVariables = new HashMap<String, Object>();
+               Map<String, Object> testVariables = new HashMap<>();
                testVariables.put("requestId", "TEST-REQUEST-ID-0123");
                testVariables.put("serviceInstanceId", "test-service-instance-id");
                //testVariables.put("vnfId", "TEST-VNF-ID-0123");
index 803977b..d5f9496 100644 (file)
@@ -87,7 +87,7 @@ public class CreateVnfInfraTest extends WorkflowTest {
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
                String businessKey = UUID.randomUUID().toString();
-               Map<String, Object> variables = new HashMap<String, Object>();
+               Map<String, Object> variables = new HashMap<>();
                setVariablesSuccess(variables, createVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
                TestAsyncResponse asyncResponse = invokeAsyncProcess("CreateVnfInfra",
                                "v1", businessKey, createVnfInfraRequest, variables);
@@ -124,7 +124,7 @@ public class CreateVnfInfraTest extends WorkflowTest {
 
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
-               Map<String, String> variables = new HashMap<String, String>();
+               Map<String, String> variables = new HashMap<>();
                setVariables(variables, null, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVnfInfra", variables);
@@ -142,7 +142,7 @@ public class CreateVnfInfraTest extends WorkflowTest {
                MockNodeQueryServiceInstanceById_404("MIS%2F1604%2F0026%2FSW_INTERNET");
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
-               Map<String, String> variables = new HashMap<String, String>();
+               Map<String, String> variables = new HashMap<>();
                setVariables(variables, createVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVnfInfra", variables);
@@ -174,7 +174,7 @@ public class CreateVnfInfraTest extends WorkflowTest {
                MockPutGenericVnf();
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
-               Map<String, String> variables = new HashMap<String, String>();
+               Map<String, String> variables = new HashMap<>();
                setVariables(variables, createVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "CreateVnfInfra", variables);
index 02e236c..aa05953 100644 (file)
@@ -95,7 +95,7 @@ public class DeleteGenericALaCarteServiceInstanceTest extends WorkflowTest {
 \r
        // Success Scenario\r
        private Map<String, String> setupVariables() {\r
-               Map<String, String> variables = new HashMap<String, String>();\r
+               Map<String, String> variables = new HashMap<>();\r
                variables.put("isDebugLogEnabled", "true");\r
                variables.put("bpmnRequest", getRequest());\r
                variables.put("mso-request-id", "RaaTestRequestId-1");\r
index ca04d6f..4317a57 100644 (file)
@@ -87,7 +87,7 @@ public class DeleteNetworkInstanceTest extends WorkflowTest {
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");\r
                MockGetCloudRegion("RDM2WAGPLCP", 200, "DeleteNetworkV2/cloudRegion30_AAIResponse_Success.xml");\r
 \r
-               Map<String, String> variables = new HashMap<String, String>();\r
+               Map<String, String> variables = new HashMap<>();\r
                variables.put("mso-request-id", "testRequestId");\r
                variables.put("requestId", "testRequestId");\r
                variables.put("isBaseVfModule", "true");\r
@@ -160,7 +160,7 @@ public class DeleteNetworkInstanceTest extends WorkflowTest {
                String networkModelInfo = "  {\"modelName\": \"modelName\", " + '\n' +\r
                                          "   \"networkType\": \"modelName\" }";\r
 \r
-               Map<String, String> variables = new HashMap<String, String>();\r
+               Map<String, String> variables = new HashMap<>();\r
                variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");\r
                variables.put("msoRequestId", "testRequestId");\r
                variables.put("requestId", "testRequestId");\r
@@ -236,7 +236,7 @@ public class DeleteNetworkInstanceTest extends WorkflowTest {
                String networkModelInfo = "  {\"modelCustomizationId\": \"uuid-nrc-001-1234\", " + '\n' +\r
                 "   \"modelInvariantId\": \"was-ist-das-001-1234\" }";\r
 \r
-               Map<String, String> variables = new HashMap<String, String>();\r
+               Map<String, String> variables = new HashMap<>();\r
                variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");\r
                variables.put("msoRequestId", "testRequestId");\r
                variables.put("requestId", "testRequestId");\r
index e89c64e..4c478e6 100644 (file)
@@ -552,7 +552,7 @@ public class DeleteVfModuleInfraTest extends WorkflowTest {
        \r
        // Active Scenario\r
                        private Map<String, Object> setupVariablesSunnyDayVID() {\r
-                               Map<String, Object> variables = new HashMap<String, Object>();\r
+                               Map<String, Object> variables = new HashMap<>();\r
                                //try {\r
                                //      variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));\r
                                //}\r
@@ -576,4 +576,4 @@ public class DeleteVfModuleInfraTest extends WorkflowTest {
                        }\r
 \r
        \r
-}
+}\r
index c343c97..84050c4 100644 (file)
@@ -65,7 +65,7 @@ public class DeleteVfModuleVolumeInfraV1Test extends WorkflowTest {
                String deleteVfModuleVolRequest =
                        FileUtil.readResourceFile("__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json");
                
-               Map<String, Object> testVariables = new HashMap<String, Object>();
+               Map<String, Object> testVariables = new HashMap<>();
                testVariables.put("requestId", "TEST-REQUEST-ID-0123");
                testVariables.put("volumeGroupId", "78987");
                testVariables.put("serviceInstanceId", "test-service-instance-id-0123");
@@ -105,7 +105,7 @@ public class DeleteVfModuleVolumeInfraV1Test extends WorkflowTest {
                String deleteVfModuleVolRequest =
                        FileUtil.readResourceFile("__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json");
                
-               Map<String, Object> testVariables = new HashMap<String, Object>();
+               Map<String, Object> testVariables = new HashMap<>();
                testVariables.put("requestId", "TEST-REQUEST-ID-0123");
                testVariables.put("volumeGroupId", "78987");
                
@@ -145,7 +145,7 @@ public class DeleteVfModuleVolumeInfraV1Test extends WorkflowTest {
                String deleteVfModuleVolRequest =
                        FileUtil.readResourceFile("__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json");
                
-               Map<String, Object> testVariables = new HashMap<String, Object>();
+               Map<String, Object> testVariables = new HashMap<>();
                testVariables.put("requestId", "TEST-REQUEST-ID-0123");
                testVariables.put("volumeGroupId", "78987");
                
index 29e278c..89bf141 100644 (file)
@@ -79,7 +79,7 @@ public class DeleteVnfInfraTest extends WorkflowTest {
                MockDeleteGenericVnf();
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
-               Map<String, String> variables = new HashMap<String, String>();
+               Map<String, String> variables = new HashMap<>();
                setVariables(variables, deleteVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables);
                waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
@@ -109,7 +109,7 @@ public class DeleteVnfInfraTest extends WorkflowTest {
                MockDeleteGenericVnf();
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
-               Map<String, String> variables = new HashMap<String, String>();
+               Map<String, String> variables = new HashMap<>();
                setVariables(variables, deleteVnfInfraRequestCascadeDelete, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables);
                waitForWorkflowToFinish(processEngineRule, workflowResponse.getProcessInstanceID());
@@ -139,7 +139,7 @@ public class DeleteVnfInfraTest extends WorkflowTest {
                MockDeleteGenericVnf_404();
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
-               Map<String, String> variables = new HashMap<String, String>();
+               Map<String, String> variables = new HashMap<>();
                setVariables(variables, deleteVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables);
@@ -173,7 +173,7 @@ public class DeleteVnfInfraTest extends WorkflowTest {
                MockDeleteGenericVnf();
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
-               Map<String, String> variables = new HashMap<String, String>();
+               Map<String, String> variables = new HashMap<>();
                setVariables(variables, deleteVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
 
                WorkflowResponse workflowResponse = executeWorkFlow(processEngineRule, "DeleteVnfInfra", variables);
index 852c8f9..16433ca 100644 (file)
@@ -84,7 +84,7 @@ public class DoCreateSIRollbackTest extends WorkflowTest {
                mockUpdateRequestDB(200, "DBUpdateResponse.xml");\r
                String businessKey = UUID.randomUUID().toString();\r
 \r
-               Map<String, Object> variables =  new HashMap<String, Object>();\r
+               Map<String, Object> variables = new HashMap<>();\r
                setupVariables(variables);\r
                invokeSubProcess("DoCreateServiceInstanceRollback", businessKey, variables);\r
                injectSDNCCallbacks(callbacks, "deactivate");\r
@@ -196,4 +196,4 @@ public class DoCreateSIRollbackTest extends WorkflowTest {
                variables.put("rollbackData",rollbackData);\r
                                \r
        }\r
-}
+}\r
index 5f05364..f6c5d90 100644 (file)
@@ -90,7 +90,7 @@ public class DoCreateServiceInstanceTest extends WorkflowTest {
                mockUpdateRequestDB(200, "DBUpdateResponse.xml");
                String businessKey = UUID.randomUUID().toString();
 
-               Map<String, Object> variables =  new HashMap<String, Object>();
+               Map<String, Object> variables = new HashMap<>();
                setupVariables(variables);
                invokeSubProcess("DoCreateServiceInstance", businessKey, variables);
                injectSDNCCallbacks(callbacks, "assign");
index 1d0cb0c..25787c7 100644 (file)
@@ -105,7 +105,7 @@ public class DoCreateVfModuleRollbackTest extends WorkflowTest {
                MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");\r
                \r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();\r
+               Map<String, Object> variables = new HashMap<>();\r
                RollbackData rollbackData = new RollbackData();\r
                rollbackData.put("VFMODULE", "source", "PORTAL");\r
                rollbackData.put("VFMODULE", "vnfid", "a27ce5a9-29c4-4c22-a017-6615ac73c721");\r
index 84e9ad1..d62c759 100644 (file)
@@ -230,7 +230,7 @@ public class DoCreateVfModuleTest extends WorkflowTest {
        \r
        \r
        private Map<String, Object> setupVariablesSunnyDayBuildingBlocks() {\r
-               Map<String, Object> variables = new HashMap<String, Object>();\r
+               Map<String, Object> variables = new HashMap<>();\r
                //try {\r
                //      variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));\r
                //}\r
index f5c8ab6..e9082d9 100644 (file)
@@ -67,7 +67,7 @@ public class DoCreateVfModuleVolumeV2Test extends WorkflowTest {
                String businessKey = UUID.randomUUID().toString();\r
                String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");\r
                \r
-               Map<String, Object> testVariables = new HashMap<String, Object>();\r
+               Map<String, Object> testVariables = new HashMap<>();\r
                testVariables.put("volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");\r
                testVariables.put("vnfId", "TEST-VNF-ID-0123");\r
                testVariables.put("lcpCloudRegionId", "AAIAIC25");\r
@@ -100,7 +100,7 @@ public class DoCreateVfModuleVolumeV2Test extends WorkflowTest {
                String businessKey = UUID.randomUUID().toString();\r
                String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");\r
                \r
-               Map<String, Object> testVariables = new HashMap<String, Object>();\r
+               Map<String, Object> testVariables = new HashMap<>();\r
                testVariables.put("DCVFMODVOLV2_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");\r
                testVariables.put("vnf-id", "TEST-VNF-ID-0123");\r
                testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");\r
@@ -139,7 +139,7 @@ public class DoCreateVfModuleVolumeV2Test extends WorkflowTest {
                String businessKey = UUID.randomUUID().toString();\r
                String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");\r
                \r
-               Map<String, Object> testVariables = new HashMap<String, Object>();\r
+               Map<String, Object> testVariables = new HashMap<>();\r
                testVariables.put("DCVFMODVOLV2_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");\r
                testVariables.put("vnf-id", "TEST-VNF-ID-0123");\r
                testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");\r
@@ -176,7 +176,7 @@ public class DoCreateVfModuleVolumeV2Test extends WorkflowTest {
                String businessKey = UUID.randomUUID().toString();\r
                String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml");\r
                \r
-               Map<String, Object> testVariables = new HashMap<String, Object>();\r
+               Map<String, Object> testVariables = new HashMap<>();\r
                testVariables.put("DCVFMODVOLV2_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");\r
                testVariables.put("vnf-id", "TEST-VNF-ID-0123");\r
                testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");\r
@@ -217,7 +217,7 @@ public class DoCreateVfModuleVolumeV2Test extends WorkflowTest {
                String businessKey = UUID.randomUUID().toString();\r
                String createVfModuleVolRequest = FileUtil.readResourceFile("__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeNoRollbackRequest.xml");\r
                \r
-               Map<String, Object> testVariables = new HashMap<String, Object>();\r
+               Map<String, Object> testVariables = new HashMap<>();\r
                testVariables.put("DCVFMODVOLV2_volumeGroupId", "TEST-VOLUME-VOLUME-GROUP-ID-0123");\r
                testVariables.put("vnf-id", "TEST-VNF-ID-0123");\r
                testVariables.put("volume-group-id", "TEST-VOLUME-GROUP-ID-0123");\r
index 6c36f12..fb2160d 100644 (file)
@@ -145,7 +145,7 @@ public class DoCreateVnfAndModulesRollbackTest extends WorkflowTest {
                MockDeleteGenericVnf("a27ce5a9-29c4-4c22-a017-6615ac73c721", "0000021");\r
                MockDeleteVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73", "0000073", 200);\r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();\r
+               Map<String, Object> variables = new HashMap<>();\r
                RollbackData rollbackData = new RollbackData();\r
 \r
                rollbackData.put("VFMODULE_BASE", "source", "PORTAL");\r
@@ -240,7 +240,7 @@ public class DoCreateVnfAndModulesRollbackTest extends WorkflowTest {
                MockDoDeleteVfModule_SDNCSuccess();\r
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");\r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();\r
+               Map<String, Object> variables = new HashMap<>();\r
                RollbackData rollbackData = new RollbackData();\r
 \r
                rollbackData.put("VNF", "vnfId", "testVnfId123");\r
@@ -327,7 +327,7 @@ public class DoCreateVnfAndModulesRollbackTest extends WorkflowTest {
                MockDeleteGenericVnf("a27ce5a9-29c4-4c22-a017-6615ac73c721", "0000021");\r
                MockDeleteVfModuleId("", "", "", 200);\r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();\r
+               Map<String, Object> variables = new HashMap<>();\r
                RollbackData rollbackData = new RollbackData();\r
        \r
                rollbackData.put("VFMODULE_BASE", "source", "PORTAL");\r
index b2afc87..c8f97ca 100644 (file)
@@ -114,7 +114,7 @@ public class DoCreateVnfAndModulesTest extends WorkflowTest {
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");\r
 \r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();\r
+               Map<String, Object> variables = new HashMap<>();\r
                setVariablesSuccess(variables, "", "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");\r
                invokeSubProcess("DoCreateVnfAndModules", businessKey, variables);\r
 \r
@@ -168,7 +168,7 @@ public class DoCreateVnfAndModulesTest extends WorkflowTest {
                mockSDNCAdapter("VfModularity/StandardSDNCSynchResponse.xml");\r
                \r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();\r
+               Map<String, Object> variables = new HashMap<>();\r
                setVariablesAddonSuccess(variables, "", "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");\r
                invokeSubProcess("DoCreateVnfAndModules", businessKey, variables);\r
 \r
index bbdc285..90d562e 100644 (file)
@@ -74,7 +74,7 @@ public class DoCreateVnfTest extends WorkflowTest {
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
                String businessKey = UUID.randomUUID().toString();
-               Map<String, Object> variables = new HashMap<String, Object>();
+               Map<String, Object> variables = new HashMap<>();
                setVariablesSuccess(variables, createVnfInfraRequest, "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");
                invokeSubProcess("DoCreateVnf", businessKey, variables);
 
index e2850b6..3781499 100644 (file)
@@ -84,7 +84,7 @@ public class DoDeleteServiceInstanceTest extends WorkflowTest {
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
                String businessKey = UUID.randomUUID().toString();
 
-               Map<String, Object> variables =  new HashMap<String, Object>();
+               Map<String, Object> variables = new HashMap<>();
                setupVariables(variables);
                invokeSubProcess("DoDeleteServiceInstance", businessKey, variables);
                injectSDNCCallbacks(callbacks, "deactivate");
index c0d5539..13b2f54 100644 (file)
@@ -113,7 +113,7 @@ public class DoDeleteVfModuleFromVnfTest extends WorkflowTest {
                MockAAIDeleteVfModule();\r
                \r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();          \r
+               Map<String, Object> variables = new HashMap<>();\r
                variables.put("isDebugLogEnabled","true");\r
                variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");\r
                variables.put("msoRequestId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");\r
index c741dfd..578fda3 100644 (file)
@@ -128,7 +128,7 @@ public class DoDeleteVfModuleTest extends WorkflowTest {
                MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");\r
                \r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();          \r
+               Map<String, Object> variables = new HashMap<>();\r
                variables.put("isDebugLogEnabled","true");\r
                variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");\r
                variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");\r
@@ -173,7 +173,7 @@ public class DoDeleteVfModuleTest extends WorkflowTest {
                MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");\r
                \r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();          \r
+               Map<String, Object> variables = new HashMap<>();\r
                \r
                variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");        \r
                variables.put("requestId", "a27ce5a9-29c4-4c22-a017-6615ac73c721");             \r
@@ -263,7 +263,7 @@ public class DoDeleteVfModuleTest extends WorkflowTest {
                MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");\r
                \r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();          \r
+               Map<String, Object> variables = new HashMap<>();\r
                variables.put("isDebugLogEnabled","true");\r
                variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");\r
                variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");\r
@@ -334,7 +334,7 @@ public class DoDeleteVfModuleTest extends WorkflowTest {
                MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");\r
                \r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();          \r
+               Map<String, Object> variables = new HashMap<>();\r
                variables.put("isDebugLogEnabled","true");\r
                variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");\r
                variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");\r
@@ -405,7 +405,7 @@ public class DoDeleteVfModuleTest extends WorkflowTest {
                MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");\r
                \r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();          \r
+               Map<String, Object> variables = new HashMap<>();\r
                variables.put("isDebugLogEnabled","true");\r
                variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");\r
                variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");\r
@@ -475,7 +475,7 @@ public class DoDeleteVfModuleTest extends WorkflowTest {
                MockPatchVfModuleId("a27ce5a9-29c4-4c22-a017-6615ac73c721", "973ed047-d251-4fb9-bf1a-65b8949e0a73");\r
                \r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();          \r
+               Map<String, Object> variables = new HashMap<>();\r
                variables.put("isDebugLogEnabled","true");\r
                variables.put("mso-request-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");\r
                variables.put("mso-service-instance-id", "a27ce5a9-29c4-4c22-a017-6615ac73c721");\r
index 454c530..165debe 100644 (file)
@@ -64,7 +64,7 @@ public class DoDeleteVfModuleVolumeV2Test extends WorkflowTest {
                MockGetVolumeGroupById("AAIAIC25", "78987", "VfModularity/VolumeGroup.xml");\r
                String businessKey = UUID.randomUUID().toString();\r
 \r
-               Map<String, Object> testVariables = new HashMap<String, Object>();\r
+               Map<String, Object> testVariables = new HashMap<>();\r
                testVariables.put("mso-request-id", "TEST-REQUEST-ID-0123");\r
                testVariables.put("msoRequestId", "TEST-REQUEST-ID-0123");\r
                testVariables.put("isDebugLogEnabled", "true");\r
@@ -102,7 +102,7 @@ public class DoDeleteVfModuleVolumeV2Test extends WorkflowTest {
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");\r
                String businessKey = UUID.randomUUID().toString();\r
 \r
-               Map<String, Object> testVariables = new HashMap<String, Object>();\r
+               Map<String, Object> testVariables = new HashMap<>();\r
                testVariables.put("mso-request-id", "TEST-REQUEST-ID-0123");\r
                testVariables.put("msoRequestId", "TEST-REQUEST-ID-0123");\r
                testVariables.put("isDebugLogEnabled", "true");\r
@@ -138,7 +138,7 @@ public class DoDeleteVfModuleVolumeV2Test extends WorkflowTest {
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");\r
                String businessKey = UUID.randomUUID().toString();\r
 \r
-               Map<String, Object> testVariables = new HashMap<String, Object>();\r
+               Map<String, Object> testVariables = new HashMap<>();\r
                testVariables.put("mso-request-id", "TEST-REQUEST-ID-0123");\r
                testVariables.put("msoRequestId", "TEST-REQUEST-ID-0123");\r
                testVariables.put("isDebugLogEnabled", "true");\r
@@ -174,7 +174,7 @@ public class DoDeleteVfModuleVolumeV2Test extends WorkflowTest {
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");\r
                String businessKey = UUID.randomUUID().toString();\r
 \r
-               Map<String, Object> testVariables = new HashMap<String, Object>();\r
+               Map<String, Object> testVariables = new HashMap<>();\r
                testVariables.put("mso-request-id", "TEST-REQUEST-ID-0123");\r
                testVariables.put("msoRequestId", "TEST-REQUEST-ID-0123");\r
                testVariables.put("isDebugLogEnabled", "true");\r
index de2fc86..a9dde90 100644 (file)
@@ -77,7 +77,7 @@ public class DoDeleteVnfAndModulesTest extends WorkflowTest {
                mockSDNCAdapter(200);\r
 \r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();\r
+               Map<String, Object> variables = new HashMap<>();\r
                setVariablesVnfOnly(variables);\r
                invokeSubProcess("DoDeleteVnfAndModules", businessKey, variables);\r
                \r
@@ -142,7 +142,7 @@ public class DoDeleteVnfAndModulesTest extends WorkflowTest {
                MockAAIDeleteVfModule();\r
 \r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();\r
+               Map<String, Object> variables = new HashMap<>();\r
                setVariablesVnfAndModules(variables);\r
                invokeSubProcess("DoDeleteVnfAndModules", businessKey, variables);\r
                \r
index 086ac09..8caa9f2 100644 (file)
@@ -54,7 +54,7 @@ public class DoDeleteVnfTest extends WorkflowTest {
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
                
                String businessKey = UUID.randomUUID().toString();
-               Map<String, Object> variables = new HashMap<String, Object>();
+               Map<String, Object> variables = new HashMap<>();
                setVariables(variables);
                invokeSubProcess("DoDeleteVnf", businessKey, variables);
                // Disabled until SDNC support is there
@@ -81,7 +81,7 @@ public class DoDeleteVnfTest extends WorkflowTest {
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
                
                String businessKey = UUID.randomUUID().toString();
-               Map<String, Object> variables = new HashMap<String, Object>();
+               Map<String, Object> variables = new HashMap<>();
                setVariables(variables);
 
                invokeSubProcess("DoDeleteVnf", businessKey, variables);
@@ -110,7 +110,7 @@ public class DoDeleteVnfTest extends WorkflowTest {
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");
 
                String businessKey = UUID.randomUUID().toString();
-               Map<String, Object> variables = new HashMap<String, Object>();
+               Map<String, Object> variables = new HashMap<>();
                setVariables(variables);
 
                invokeSubProcess("DoDeleteVnf", businessKey, variables);
index a626fde..9fa9323 100644 (file)
@@ -100,7 +100,7 @@ public class DoUpdateVfModuleTest extends WorkflowTest {
                MockGetGenericVnfByIdWithPriority("skask", "supercool", 200, "VfModularity/VfModule-supercool.xml", 1);\r
                \r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();\r
+               Map<String, Object> variables = new HashMap<>();\r
                variables.put("mso-request-id", "DEV-VF-0011");\r
                variables.put("isDebugLogEnabled","true");\r
                variables.put("DoUpdateVfModuleRequest", doUpdateVfModuleRequest);\r
@@ -146,7 +146,7 @@ public class DoUpdateVfModuleTest extends WorkflowTest {
                MockVNFAdapterRestVfModule();\r
                \r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();\r
+               Map<String, Object> variables = new HashMap<>();\r
                variables.put("mso-request-id", "DEV-VF-0011");\r
                variables.put("isDebugLogEnabled","true");\r
                variables.put("msoRequestId", "DEV-VF-0011");\r
index 9f19b35..4def56c 100644 (file)
@@ -104,7 +104,7 @@ public class DoUpdateVnfAndModulesTest extends WorkflowTest {
                mockUpdateRequestDB(200, "Database/DBUpdateResponse.xml");\r
 \r
                String businessKey = UUID.randomUUID().toString();\r
-               Map<String, Object> variables = new HashMap<String, Object>();\r
+               Map<String, Object> variables = new HashMap<>();\r
                setVariablesSuccess(variables, "", "testRequestId123", "MIS%2F1604%2F0026%2FSW_INTERNET");\r
                invokeSubProcess("DoUpdateVnfAndModules", businessKey, variables);\r
 \r
index d3d1b5b..64852df 100644 (file)
@@ -210,7 +210,7 @@ public class ReplaceVnfInfraTest extends WorkflowTest {
        \r
        // Active Scenario\r
        private Map<String, Object> setupVariablesSunnyDayVID() {\r
-                               Map<String, Object> variables = new HashMap<String, Object>();\r
+                               Map<String, Object> variables = new HashMap<>();\r
                                //try {\r
                                //      variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));\r
                                //}\r
index 7aca55d..5b5e4e5 100644 (file)
@@ -291,7 +291,7 @@ public class UpdateNetworkInstanceTest extends WorkflowTest {
 
        // Success Scenario
        private Map<String, String> setupVariablesVID1() {
-               Map<String, String> variables = new HashMap<String, String>();
+               Map<String, String> variables = new HashMap<>();
                variables.put("bpmnRequest", getCreateNetworkRequest1());
                variables.put("mso-request-id", "testRequestId");
                variables.put("requestId", "testRequestId");
@@ -378,7 +378,7 @@ public class UpdateNetworkInstanceTest extends WorkflowTest {
 
        // Success Scenario
        private Map<String, String> setupVariablesVIPER1() {
-               Map<String, String> variables = new HashMap<String, String>();
+               Map<String, String> variables = new HashMap<>();
                variables.put("testMessageId", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
                variables.put("msoRequestId", "testRequestId");
                variables.put("requestId", "testRequestId");
@@ -402,7 +402,7 @@ public class UpdateNetworkInstanceTest extends WorkflowTest {
 
        // Missing Name Scenario
        private Map<String, String> setupVariablesMissingNetworkId() {
-               Map<String, String> variables = new HashMap<String, String>();
+               Map<String, String> variables = new HashMap<>();
                variables.put("mso-request-id", "88f65519-9a38-4c4b-8445-9eb4a5a5af56");
                variables.put("bpmnRequest", getCreateNetworkRequestNetworkId());
                variables.put("requestId", "testRequestId");
index 04189a3..37c548a 100644 (file)
@@ -118,7 +118,7 @@ public class UpdateVfModuleInfraTest extends WorkflowTest {
        \r
        // Active Scenario\r
        private Map<String, Object> setupVariablesSunnyDayVID() {\r
-                               Map<String, Object> variables = new HashMap<String, Object>();\r
+                               Map<String, Object> variables = new HashMap<>();\r
                                //try {\r
                                //      variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));\r
                                //}\r
index 6f3ce69..65a514c 100644 (file)
@@ -98,7 +98,7 @@ public class UpdateVfModuleInfraV2Test extends WorkflowTest {
        \r
        // Active Scenario\r
        private Map<String, Object> setupVariablesSunnyDayVID() {\r
-                               Map<String, Object> variables = new HashMap<String, Object>();\r
+                               Map<String, Object> variables = new HashMap<>();\r
                                variables.put("requestId", "testRequestId");            \r
                                variables.put("isBaseVfModule", false);\r
                                variables.put("isDebugLogEnabled", "true");\r
index ab72118..b24eb56 100644 (file)
@@ -76,7 +76,7 @@ public class UpdateVfModuleVolumeInfraV1Test extends WorkflowTest {
                String updaetVfModuleVolRequest =\r
                        FileUtil.readResourceFile("__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request.json");\r
                \r
-               Map<String, Object> testVariables = new HashMap<String, Object>();\r
+               Map<String, Object> testVariables = new HashMap<>();\r
                testVariables.put("requestId", "TEST-REQUEST-ID-0123");\r
                testVariables.put("serviceInstanceId", "test-service-instance-id");\r
                testVariables.put("volumeGroupId", "78987");\r
@@ -122,7 +122,7 @@ public class UpdateVfModuleVolumeInfraV1Test extends WorkflowTest {
                String updaetVfModuleVolRequest =\r
                        FileUtil.readResourceFile("__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request_2.json");\r
                \r
-               Map<String, Object> testVariables = new HashMap<String, Object>();\r
+               Map<String, Object> testVariables = new HashMap<>();\r
                testVariables.put("requestId", "TEST-REQUEST-ID-0123");\r
                testVariables.put("serviceInstanceId", "test-service-instance-id");\r
                testVariables.put("volumeGroupId", "78987");\r
index 5976285..391fc23 100644 (file)
@@ -152,7 +152,7 @@ public class UpdateVnfInfraTest extends WorkflowTest {
        \r
        // Active Scenario\r
        private Map<String, Object> setupVariablesSunnyDayVID() {\r
-                               Map<String, Object> variables = new HashMap<String, Object>();\r
+                               Map<String, Object> variables = new HashMap<>();\r
                                //try {\r
                                //      variables.put("bpmnRequest", FileUtil.readResourceFile("__files/CreateVfModule_VID_request.json"));\r
                                //}\r
index 0af43a2..1b3bfa8 100644 (file)
@@ -134,9 +134,9 @@ public class CreateVcpeResCustServiceTest extends AbstractTestBase {
                assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND));
                assertEquals("200", BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE));
                assertEquals(null, workflowException);
-               assertTrue(completionReq.indexOf("request-id>testRequestId<") >= 0);
-               assertTrue(completionReq.indexOf("action>CREATE<") >= 0);
-               assertTrue(completionReq.indexOf("source>VID<") >= 0);
+               assertTrue(completionReq.contains("request-id>testRequestId<"));
+               assertTrue(completionReq.contains("action>CREATE<"));
+               assertTrue(completionReq.contains("source>VID<"));
 
                assertEquals("1", BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+"VnfsCreatedCount"));
        }
@@ -200,9 +200,9 @@ public class CreateVcpeResCustServiceTest extends AbstractTestBase {
                assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND));
                assertEquals("200", BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE));
                assertEquals(null, workflowException);
-               assertTrue(completionReq.indexOf("request-id>testRequestId<") >= 0);
-               assertTrue(completionReq.indexOf("action>CREATE<") >= 0);
-               assertTrue(completionReq.indexOf("source>VID<") >= 0);
+               assertTrue(completionReq.contains("request-id>testRequestId<"));
+               assertTrue(completionReq.contains("action>CREATE<"));
+               assertTrue(completionReq.contains("source>VID<"));
 
                assertEquals("0", BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+"VnfsCreatedCount"));
        }
index 88b6464..d026b7a 100644 (file)
@@ -162,9 +162,9 @@ public class DeleteVcpeResCustServiceTest extends AbstractTestBase {
                assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND));
                assertEquals("200", BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE));
                assertEquals(null, workflowException);
-               assertTrue(completionReq.indexOf("<request-id>testRequestId<") >= 0);
-               assertTrue(completionReq.indexOf("<action>DELETE<") >= 0);
-               assertTrue(completionReq.indexOf("<source>VID<") >= 0);
+               assertTrue(completionReq.contains("<request-id>testRequestId<"));
+               assertTrue(completionReq.contains("<action>DELETE<"));
+               assertTrue(completionReq.contains("<source>VID<"));
 
                assertEquals("2", BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+"vnfsDeletedCount"));
 
@@ -223,9 +223,9 @@ public class DeleteVcpeResCustServiceTest extends AbstractTestBase {
                assertEquals("true", BPMNUtil.getVariable(processEngineRule, PROCNAME, PROCNAME+VAR_SUCCESS_IND));
                assertEquals("200", BPMNUtil.getVariable(processEngineRule, PROCNAME, VAR_RESP_CODE));
                assertEquals(null, workflowException);
-               assertTrue(completionReq.indexOf("<request-id>testRequestId<") >= 0);
-               assertTrue(completionReq.indexOf("<action>DELETE<") >= 0);
-               assertTrue(completionReq.indexOf("<source>VID<") >= 0);
+               assertTrue(completionReq.contains("<request-id>testRequestId<"));
+               assertTrue(completionReq.contains("<action>DELETE<"));
+               assertTrue(completionReq.contains("<source>VID<"));
 
                assertEquals("0", BPMNUtil.getVariable(processEngineRule, PROCNAME, Prefix+"vnfsDeletedCount"));
                
index a0168bd..3e05ba0 100644 (file)
                                        "aLaCarte":"false",
                                        "userParams":
                                           [
-                                               {
-                                                       "name":"BRG_WAN_MAC_Address",
-                                                       "value":"brgmac"
-                                               }
-                                          ]
+                                                       {
+                                                               "name":"BRG_WAN_MAC_Address",
+                                                               "value":"brgmac"
+                                                       },
+                                                       {
+                                                               "name": "Customer_Location",
+                                                               "value": {
+                                                                       "customerLatitude": "32.897480",
+                                                                       "customerLongitude": "-97.040443",
+                                                                       "customerName": "some_company"
+                                                               }
+                                                       }
+                                               ]
                                }
-                               
                }
 }
index 17c6d15..cf02444 100644 (file)
                                {
                                        "subscriptionServiceType":"123456789",
                                        "aLaCarte":"false",
-                    "userParams":
-                       [
-                            {
-                                "name":"BRG_WAN_MAC_Address",
-                                "value":"brgmac"
-                            }
-                       ]
+                                       "userParams":
+                                          [
+                                                       {
+                                                               "name":"BRG_WAN_MAC_Address",
+                                                               "value":"brgmac"
+                                                       },
+                                                       {
+                                                               "name": "Customer_Location",
+                                                               "value": {
+                                                                       "customerLatitude": "32.897480",
+                                                                       "customerLongitude": "-97.040443",
+                                                                       "customerName": "some_company"
+                                                               }
+                                                       }
+                                               ]
                                }
-                               
                }
 }
index 8583e66..39be40a 100644 (file)
                                {
                                        "subscriptionServiceType":"123456789",
                                        "aLaCarte":"false",
-                    "userParams":
-                       [
-                            {
-                                "name":"BRG_WAN_MAC_Address",
-                                "value":"brgmac"
-                            }
-                       ]
+                                       "userParams":
+                                          [
+                                                       {
+                                                               "name":"BRG_WAN_MAC_Address",
+                                                               "value":"brgmac"
+                                                       },
+                                                       {
+                                                               "name": "Customer_Location",
+                                                               "value": {
+                                                                       "customerLatitude": "32.897480",
+                                                                       "customerLongitude": "-97.040443",
+                                                                       "customerName": "some_company"
+                                                               }
+                                                       }
+                                               ]
                                }
-                               
                }
 }
index 5d89e29..9c5ce14 100644 (file)
@@ -9,7 +9,6 @@
                <version>1.2.0-SNAPSHOT</version>\r
        </parent>\r
        \r
-       <groupId>org.onap.so</groupId>\r
        <artifactId>MSORESTClient</artifactId>\r
        \r
        <packaging>jar</packaging>\r
index 6504615..3170e49 100644 (file)
@@ -242,16 +242,16 @@ public class RESTClient {
     /**
      * Creates a RESTClient with the RESTConfig object.
      *
-     * @param RESTConfig config to use for sending request
+     * @param restConfig config to use for sending request
      *
      * @throws RESTException if unable to create a RESTClient
      */
-    public RESTClient(RESTConfig cfg) throws RESTException {
-        this.headers = new LinkedHashMap<String, List<String>>();
-        this.parameters = new LinkedHashMap<String, List<String>>();
-        this.URL = cfg.getURL();
-        this.proxyHost = cfg.getProxyHost();
-        this.proxyPort = cfg.getProxyPort();
+    public RESTClient(RESTConfig restConfig) throws RESTException {
+        this.headers = new LinkedHashMap<>();
+        this.parameters = new LinkedHashMap<>();
+        this.URL = restConfig.getURL();
+        this.proxyHost = restConfig.getProxyHost();
+        this.proxyPort = restConfig.getProxyPort();
     }
 
     /**
@@ -266,7 +266,7 @@ public class RESTClient {
      */
     public RESTClient addParameter(String name, String value) {
         if (!parameters.containsKey(name)) {
-            parameters.put(name, new ArrayList<String>());
+            parameters.put(name, new ArrayList<>());
         }
 
         List<String> values = parameters.get(name);
@@ -306,7 +306,7 @@ public class RESTClient {
      */
     public RESTClient addHeader(String name, String value) {
         if (!headers.containsKey(name)) {
-            headers.put(name, new ArrayList<String>());
+            headers.put(name, new ArrayList<>());
         }
 
         List<String> values = headers.get(name);
index d36d4c7..bcd95e5 100644 (file)
@@ -9,7 +9,6 @@
     <version>1.2.0-SNAPSHOT</version>
   </parent>
 
-  <groupId>org.onap.so</groupId>
   <artifactId>bpmn</artifactId>
   <name>BPMN Subsystem</name>
   <description>BPMN Subsystem for MSO</description>
index 48518ae..c83f7d3 100644 (file)
@@ -7,7 +7,6 @@
         <version>1.2.0-SNAPSHOT</version>
     </parent>
 
-    <groupId>org.onap.so</groupId>
     <artifactId>common</artifactId>
     <name>MSO Common classes</name>
     <description>MSO Common classes:- Logger</description>
index 7b9c6a5..b2b8d0a 100644 (file)
@@ -162,8 +162,8 @@ public class MsoAlarmLogger implements ServletContextListener {
         encoder.setPattern(logPattern);
         encoder.setContext(context);
         encoder.start();
-        RollingFileAppender<ILoggingEvent> fileAppender=new RollingFileAppender<ILoggingEvent>();
-        TimeBasedRollingPolicy<ILoggingEvent> rollingPolicy=new TimeBasedRollingPolicy<ILoggingEvent>();
+        RollingFileAppender<ILoggingEvent> fileAppender= new RollingFileAppender<>();
+        TimeBasedRollingPolicy<ILoggingEvent> rollingPolicy= new TimeBasedRollingPolicy<>();
         rollingPolicy.setContext(context);
         rollingPolicy.setFileNamePattern(msoAlarmFile + ".%d");
         rollingPolicy.setParent(fileAppender);
index b8c4aed..6588995 100644 (file)
@@ -98,11 +98,11 @@ public class MsoLogger {
 
     public enum Catalog {
         APIH, BPEL, RA, ASDC, GENERAL
-    };
+    }
 
     public enum StatusCode {
         COMPLETE, ERROR
-    };
+    }
 
     public enum ResponseCode {
         Suc(0), PermissionError(100), DataError(300), DataNotFound(301), BadRequest(302), SchemaError(
@@ -115,10 +115,10 @@ public class MsoLogger {
             return this.value;
         }
 
-        private ResponseCode(int value) {
+        ResponseCode(int value) {
             this.value = value;
         }
-    };
+    }
 
     public enum ErrorCode {
         PermissionError(100), AvailabilityError(200), DataError(300), SchemaError(400), BusinessProcesssError(
@@ -130,10 +130,10 @@ public class MsoLogger {
             return this.value;
         }
 
-        private ErrorCode(int value) {
+        ErrorCode(int value) {
             this.value = value;
         }
-    };
+    }
 
     private EELFLogger          logger, auditLogger, metricsLogger;
     private static final String CONFIG_FILE = System.getProperty("jboss.home.dir") + "/mso-config/uuid/uuid_"
index 8da155f..ec0b54a 100644 (file)
@@ -159,15 +159,9 @@ public class MsoJsonProperties extends AbstractMsoProperties {
 
        @Override
        public String toString() {
-               StringBuilder response = new StringBuilder();
-               response.append("Config file ").append(propertiesFileName).append("(Timer:").append(automaticRefreshInMinutes)
-            .append("mins):").append(System.getProperty("line.separator"));
-               response.append(this.jsonRootNode.toString());
-               response.append(System.getProperty("line.separator"));
-               response.append(System.getProperty("line.separator"));
-               return response.toString();
-
+               return "Config file " + propertiesFileName + "(Timer:" + automaticRefreshInMinutes + "mins):" + System
+                       .getProperty("line.separator") + this.jsonRootNode.toString() + System.getProperty("line.separator")
+                       + System.getProperty("line.separator");
        }
 
-
 }
index cf69cf9..3f81734 100644 (file)
@@ -78,7 +78,7 @@ public class MsoPropertiesFactory implements Serializable {
             // Hardcode if nothing is received
             prefixMsoPropertiesPath = "";
         }
-        msoPropertiesCache = new ConcurrentHashMap <String, MsoPropertiesParameters> ();
+        msoPropertiesCache = new ConcurrentHashMap<>();
     }
 
     private static final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock ();
@@ -268,7 +268,7 @@ public class MsoPropertiesFactory implements Serializable {
      */
     public List <AbstractMsoProperties> getAllMsoProperties () {
 
-        List <AbstractMsoProperties> resultList = new LinkedList <AbstractMsoProperties> ();
+        List <AbstractMsoProperties> resultList = new LinkedList<>();
         rwl.readLock ().lock ();
         try {
 
index 488bb35..b89a5d4 100644 (file)
@@ -23,8 +23,8 @@ package org.openecomp.mso.properties;
 
 public class MsoPropertiesParameters {
        
-       protected enum MsoPropertiesType {JSON_PROP,JAVA_PROP};
-       
+       protected enum MsoPropertiesType {JSON_PROP,JAVA_PROP}
+
        protected MsoPropertiesType msoPropertiesType;
        
        protected int refreshCounter;
index 75337f0..ad0344d 100644 (file)
@@ -36,7 +36,7 @@ public class CheckResults {
     private List <CheckResult> results;
 
     public CheckResults () {
-        results = new ArrayList <CheckResult> ();
+        results = new ArrayList<>();
     }
 
     public List <CheckResult> getResults () {
index f038cbc..a814c4e 100644 (file)
@@ -146,7 +146,7 @@ public class MsoPropertiesFactoryConcurrencyTest {
        public final void testGetMsoProperties()
                        throws MsoPropertiesException, InterruptedException, ExecutionException, FileNotFoundException {
 
-               List<Future<Integer>> list = new ArrayList<Future<Integer>>();
+               List<Future<Integer>> list = new ArrayList<>();
                ExecutorService executor = Executors.newFixedThreadPool(20);
 
                for (int i = 0; i <= 100000; i++) {
index 7b559df..db58c5a 100644 (file)
@@ -598,8 +598,8 @@ public class MsoPropertiesFactoryTest {
                assertFalse(msoProperties.equals(msoProperties2));
                assertTrue(msoProperties.equals(msoProperties));
                assertFalse(msoProperties.equals(null));
-               assertFalse(msoProperties.equals(new String()));
-               
+               assertFalse(msoProperties.toString().isEmpty());
+
                // Test a reload with timer set to 1 in PATH_MSO_JSON_PROP2
                msoPropertiesFactory.changeMsoPropertiesFilePath(MSO_JSON_PROP_ID, PATH_MSO_JSON_PROP);
 
index 8eab5d6..28cc3b5 100644 (file)
@@ -8,8 +8,6 @@
                <version>1.2.0-SNAPSHOT</version>
        </parent>
 
-
-       <groupId>org.onap.so</groupId>
        <artifactId>mso-api-handler-common</artifactId>
 
        <name>ECOMP MSO API Handler common</name>
index 371d316..9258cab 100644 (file)
@@ -60,7 +60,8 @@ public class CamundaClient extends RequestClient{
                        if(encryptedCredentials != null){
                                String userCredentials = getEncryptedPropValue(encryptedCredentials, CommonConstants.DEFAULT_BPEL_AUTH, CommonConstants.ENCRYPTION_KEY);
                                if(userCredentials != null){
-                                       post.addHeader("Authorization", "Basic " + new String(DatatypeConverter.printBase64Binary(userCredentials.getBytes())));
+                                       post.addHeader("Authorization", "Basic " + DatatypeConverter
+                        .printBase64Binary(userCredentials.getBytes()));
                                }
                        }
                }
@@ -83,7 +84,8 @@ public class CamundaClient extends RequestClient{
                        if(encryptedCredentials != null){
                                String userCredentials = getEncryptedPropValue(encryptedCredentials, CommonConstants.DEFAULT_BPEL_AUTH, CommonConstants.ENCRYPTION_KEY);
                                if(userCredentials != null){
-                                       post.addHeader("Authorization", "Basic " + new String(DatatypeConverter.printBase64Binary(userCredentials.getBytes())));
+                                       post.addHeader("Authorization", "Basic " + DatatypeConverter
+                        .printBase64Binary(userCredentials.getBytes()));
                                }
                        }
                }
@@ -115,7 +117,8 @@ public class CamundaClient extends RequestClient{
                        if(encryptedCredentials != null){
                                String userCredentials = getEncryptedPropValue(encryptedCredentials, CommonConstants.DEFAULT_BPEL_AUTH, CommonConstants.ENCRYPTION_KEY);
                                if(userCredentials != null){
-                                       post.addHeader("Authorization", "Basic " + new String(DatatypeConverter.printBase64Binary(userCredentials.getBytes())));
+                                       post.addHeader("Authorization", "Basic " + DatatypeConverter
+                        .printBase64Binary(userCredentials.getBytes()));
                                }
                        }
                }
index 364169d..4b179da 100644 (file)
@@ -52,7 +52,8 @@ public class CamundaTaskClient extends RequestClient{
                        if(encryptedCredentials != null){\r
                                String userCredentials = getEncryptedPropValue(encryptedCredentials, CommonConstants.DEFAULT_BPEL_AUTH, CommonConstants.ENCRYPTION_KEY);\r
                                if(userCredentials != null){\r
-                                       post.addHeader("Authorization", "Basic " + new String(DatatypeConverter.printBase64Binary(userCredentials.getBytes())));\r
+                                       post.addHeader("Authorization", "Basic " + DatatypeConverter\r
+                        .printBase64Binary(userCredentials.getBytes()));\r
                                }\r
                        }\r
                }\r
@@ -90,7 +91,8 @@ public class CamundaTaskClient extends RequestClient{
                        if(encryptedCredentials != null){\r
                                String userCredentials = getEncryptedPropValue(encryptedCredentials, CommonConstants.DEFAULT_BPEL_AUTH, CommonConstants.ENCRYPTION_KEY);\r
                                if(userCredentials != null){\r
-                                       get.addHeader("Authorization", "Basic " + new String(DatatypeConverter.printBase64Binary(userCredentials.getBytes())));\r
+                                       get.addHeader("Authorization", "Basic " + DatatypeConverter\r
+                        .printBase64Binary(userCredentials.getBytes()));\r
                                }\r
                        }\r
                }\r
index 0914516..c51c61e 100644 (file)
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.apihandlerinfra;
-
-import java.io.IOException;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.hibernate.Session;
-import org.json.JSONObject;
-import org.openecomp.mso.apihandler.common.ErrorNumbers;
-import org.openecomp.mso.apihandler.common.RequestClient;
-import org.openecomp.mso.apihandler.common.RequestClientFactory;
-import org.openecomp.mso.apihandler.common.ResponseHandler;
-import org.openecomp.mso.apihandlerinfra.Messages;
-import org.openecomp.mso.apihandlerinfra.MsoException;
-import org.openecomp.mso.apihandlerinfra.MsoRequest;
-import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.DelE2ESvcResp;
-import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EServiceInstanceDeleteRequest;
-import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EServiceInstanceRequest;
-import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EUserParam;
-import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.GetE2EServiceInstanceResponse;
-import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.ModelInfo;
-import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestDetails;
-import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestInfo;
-import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestParameters;
-import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.ServiceInstancesRequest;
-import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.SubscriberInfo;
-import org.openecomp.mso.db.AbstractSessionFactoryManager;
-import org.openecomp.mso.db.catalog.CatalogDatabase;
-import org.openecomp.mso.db.catalog.beans.Service;
-import org.openecomp.mso.db.catalog.beans.ServiceRecipe;
-import org.openecomp.mso.logger.MessageEnum;
-import org.openecomp.mso.logger.MsoAlarmLogger;
-import org.openecomp.mso.logger.MsoLogger;
-import org.openecomp.mso.properties.MsoDatabaseException;
-import org.openecomp.mso.requestsdb.OperationStatus;
-import org.openecomp.mso.requestsdb.RequestsDatabase;
-import org.openecomp.mso.requestsdb.RequestsDbSessionFactoryManager;
-import org.openecomp.mso.utils.UUIDChecker;
-
-import com.wordnik.swagger.annotations.Api;
-import com.wordnik.swagger.annotations.ApiOperation;
-
-@Path("/e2eServiceInstances")
-@Api(value = "/e2eServiceInstances", description = "API Requests for E2E Service Instances")
-public class E2EServiceInstances {
-
-       private HashMap<String, String> instanceIdMap = new HashMap<>();
-       private static MsoLogger msoLogger = MsoLogger
-                       .getMsoLogger(MsoLogger.Catalog.APIH);
-       private static MsoAlarmLogger alarmLogger = new MsoAlarmLogger();
-       public static final String MSO_PROP_APIHANDLER_INFRA = "MSO_PROP_APIHANDLER_INFRA";
-       private ServiceInstancesRequest sir = null;
-
-       public static final String END_OF_THE_TRANSACTION = "End of the transaction, the final response is: ";
-       public static final String EXCEPTION_CREATING_DB_RECORD = "Exception while creating record in DB";
-       public static final String EXCEPTION_COMMUNICATE_BPMN_ENGINE = "Exception while communicate with BPMN engine";
-
-       /**
-        * POST Requests for E2E Service create Instance on a version provided
-        */
-
-       @POST
-       @Path("/{version:[vV][3-5]}")
-       @Consumes(MediaType.APPLICATION_JSON)
-       @Produces(MediaType.APPLICATION_JSON)
-       @ApiOperation(value = "Create a E2E Service Instance on a version provided", response = Response.class)
-       public Response createE2EServiceInstance(String request,
-                       @PathParam("version") String version) {
-
-               return processE2EserviceInstances(request, Action.createInstance, null,
-                               version);
-       }
-
-       /**
-        * DELETE Requests for E2E Service delete Instance on a specified version
-        * and serviceId
-        */
-
-       @DELETE
-       @Path("/{version:[vV][3-5]}/{serviceId}")
-       @Consumes(MediaType.APPLICATION_JSON)
-       @Produces(MediaType.APPLICATION_JSON)
-       @ApiOperation(value = "Delete E2E Service Instance on a specified version and serviceId", response = Response.class)
-       public Response deleteE2EServiceInstance(String request,
-                       @PathParam("version") String version,
-                       @PathParam("serviceId") String serviceId) {
-
-               instanceIdMap.put("serviceId", serviceId);
-
-               return deleteE2EserviceInstances(request, Action.deleteInstance,
-                               instanceIdMap, version);
-       }
-
-       @GET
-       @Path("/{version:[vV][3-5]}/{serviceId}/operations/{operationId}")
-       @ApiOperation(value = "Find e2eServiceInstances Requests for a given serviceId and operationId", response = Response.class)
-       @Produces(MediaType.APPLICATION_JSON)
-       public Response getE2EServiceInstances(
-                       @PathParam("serviceId") String serviceId,
-                       @PathParam("version") String version,
-                       @PathParam("operationId") String operationId) {
-               return getE2EServiceInstances(serviceId, operationId);
-       }
-
-       private Response getE2EServiceInstances(String serviceId, String operationId) {
-               RequestsDatabase requestsDB = RequestsDatabase.getInstance();
-
-               GetE2EServiceInstanceResponse e2eServiceResponse = new GetE2EServiceInstanceResponse();
-
-               MsoRequest msoRequest = new MsoRequest(serviceId);
-
-               long startTime = System.currentTimeMillis();
-
-               OperationStatus operationStatus = null;
-
-               try {
-                       operationStatus = requestsDB.getOperationStatus(serviceId,
-                                       operationId);
-
-               } catch (Exception e) {
-                       msoLogger
-                                       .error(MessageEnum.APIH_DB_ACCESS_EXC,
-                                                       MSO_PROP_APIHANDLER_INFRA,
-                                                       "",
-                                                       "",
-                                                       MsoLogger.ErrorCode.AvailabilityError,
-                                                       "Exception while communciate with Request DB - Infra Request Lookup",
-                                                       e);
-                       msoRequest
-                                       .setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
-                       Response response = msoRequest.buildServiceErrorResponse(
-                                       HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
-                                       e.getMessage(),
-                                       ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB, null);
-                       alarmLogger.sendAlarm("MsoDatabaseAccessError",
-                                       MsoAlarmLogger.CRITICAL, Messages.errors
-                                                       .get(ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB));
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
-                                       MsoLogger.ResponseCode.DBAccessError,
-                                       "Exception while communciate with Request DB");
-                       msoLogger.debug("End of the transaction, the final response is: "
-                                       + (String) response.getEntity());
-                       return response;
-
-               }
-
-               if (operationStatus == null) {
-                       Response resp = msoRequest.buildServiceErrorResponse(
-                                       HttpStatus.SC_NO_CONTENT, MsoException.ServiceException,
-                                       "E2E serviceId " + serviceId + " is not found in DB",
-                                       ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
-                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
-                                       MSO_PROP_APIHANDLER_INFRA, "", "",
-                                       MsoLogger.ErrorCode.BusinessProcesssError,
-                                       "Null response from RequestDB when searching by serviceId");
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
-                                       MsoLogger.ResponseCode.DataNotFound,
-                                       "Null response from RequestDB when searching by serviceId");
-                       msoLogger.debug("End of the transaction, the final response is: "
-                                       + (String) resp.getEntity());
-                       return resp;
-
-               }
-
-               e2eServiceResponse.setOperationStatus(operationStatus);
-
-               return Response.status(200).entity(e2eServiceResponse).build();
-       }
-
-       private Response deleteE2EserviceInstances(String requestJSON,
-                       Action action, HashMap<String, String> instanceIdMap, String version) {
-               // TODO should be a new one or the same service instance Id
-               String requestId = instanceIdMap.get("serviceId");
-               long startTime = System.currentTimeMillis();
-               msoLogger.debug("requestId is: " + requestId);
-               E2EServiceInstanceDeleteRequest e2eDelReq = null;
-
-               MsoRequest msoRequest = new MsoRequest(requestId);
-
-               ObjectMapper mapper = new ObjectMapper();
-               try {
-                       e2eDelReq = mapper.readValue(requestJSON,
-                                       E2EServiceInstanceDeleteRequest.class);
-
-               } catch (Exception e) {
-
-                       msoLogger.debug("Mapping of request to JSON object failed : ", e);
-                       Response response = msoRequest.buildServiceErrorResponse(
-                                       HttpStatus.SC_BAD_REQUEST,
-                                       MsoException.ServiceException,
-                                       "Mapping of request to JSON object failed.  "
-                                                       + e.getMessage(), ErrorNumbers.SVC_BAD_PARAMETER,
-                                       null);
-                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR,
-                                       MSO_PROP_APIHANDLER_INFRA, "", "",
-                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
-                                       MsoLogger.ResponseCode.SchemaError,
-                                       "Mapping of request to JSON object failed");
-                       msoLogger.debug("End of the transaction, the final response is: "
-                                       + (String) response.getEntity());
-                       createOperationStatusRecordForError(action, requestId);
-                       return response;
-               }
-
-               CatalogDatabase db = null;
-               RecipeLookupResult recipeLookupResult = null;
-               try {
-                       db = CatalogDatabase.getInstance();
-                       //TODO  Get the service template model version uuid from AAI.
-                       recipeLookupResult = getServiceInstanceOrchestrationURI(db, null, action);
-               } catch (Exception e) {
-                       msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC,
-                                       MSO_PROP_APIHANDLER_INFRA, "", "",
-                                       MsoLogger.ErrorCode.AvailabilityError,
-                                       "Exception while communciate with Catalog DB", e);
-                       msoRequest
-                                       .setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
-                       Response response = msoRequest.buildServiceErrorResponse(
-                                       HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
-                                       "No communication to catalog DB " + e.getMessage(),
-                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
-                       alarmLogger.sendAlarm("MsoDatabaseAccessError",
-                                       MsoAlarmLogger.CRITICAL, Messages.errors
-                                                       .get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));
-                       msoRequest.createRequestRecord(Status.FAILED, action);
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
-                                       MsoLogger.ResponseCode.DBAccessError,
-                                       "Exception while communciate with DB");
-                       msoLogger.debug(END_OF_THE_TRANSACTION
-                                       + (String) response.getEntity());
-                       return response;
-               } finally {
-                       closeCatalogDB(db);
-               }
-               if (recipeLookupResult == null) {
-                       msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND,
-                                       MSO_PROP_APIHANDLER_INFRA, "", "",
-                                       MsoLogger.ErrorCode.DataError, "No recipe found in DB");
-                       msoRequest
-                                       .setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
-                       Response response = msoRequest.buildServiceErrorResponse(
-                                       HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
-                                       "Recipe does not exist in catalog DB",
-                                       ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);
-                       msoRequest.createRequestRecord(Status.FAILED, action);
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
-                                       MsoLogger.ResponseCode.DataNotFound,
-                                       "No recipe found in DB");
-                       msoLogger.debug(END_OF_THE_TRANSACTION
-                                       + (String) response.getEntity());
-                       createOperationStatusRecordForError(action, requestId);
-                       return response;
-               }
-
-               RequestClient requestClient = null;
-               HttpResponse response = null;
-
-               long subStartTime = System.currentTimeMillis();
-               // String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);
-
-               try {
-                       requestClient = RequestClientFactory.getRequestClient(
-                                       recipeLookupResult.getOrchestrationURI(),
-                                       MsoPropertiesUtils.loadMsoProperties());
-
-                       JSONObject jjo = new JSONObject(requestJSON);
-                       jjo.put("operationId", UUIDChecker.generateUUID(msoLogger));
-
-                       String bpmnRequest = jjo.toString();
-
-                       // Capture audit event
-                       msoLogger
-                                       .debug("MSO API Handler Posting call to BPEL engine for url: "
-                                                       + requestClient.getUrl());
-                       String serviceId = instanceIdMap.get("serviceId");
-                       String serviceInstanceType = e2eDelReq.getServiceType();
-                       response = requestClient.post(requestId, false,
-                                       recipeLookupResult.getRecipeTimeout(), action.name(),
-                                       serviceId, null, null, null, null, serviceInstanceType,
-                                       null, null, null, bpmnRequest, recipeLookupResult.getRecipeParamXsd());
-
-                       msoLogger.recordMetricEvent(subStartTime,
-                                       MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
-                                       "Successfully received response from BPMN engine", "BPMN",
-                                       recipeLookupResult.getOrchestrationURI(), null);
-               } catch (Exception e) {
-                       msoLogger.recordMetricEvent(subStartTime,
-                                       MsoLogger.StatusCode.ERROR,
-                                       MsoLogger.ResponseCode.CommunicationError,
-                                       "Exception while communicate with BPMN engine", "BPMN",
-                                       recipeLookupResult.getOrchestrationURI(), null);
-                       Response resp = msoRequest.buildServiceErrorResponse(
-                                       HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
-                                       "Failed calling bpmn " + e.getMessage(),
-                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
-                       alarmLogger.sendAlarm("MsoConfigurationError",
-                                       MsoAlarmLogger.CRITICAL,
-                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));
-                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
-                                       MSO_PROP_APIHANDLER_INFRA, "", "",
-                                       MsoLogger.ErrorCode.AvailabilityError,
-                                       "Exception while communicate with BPMN engine");
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
-                                       MsoLogger.ResponseCode.CommunicationError,
-                                       "Exception while communicate with BPMN engine");
-                       msoLogger.debug("End of the transaction, the final response is: "
-                                       + (String) resp.getEntity());
-                       createOperationStatusRecordForError(action, requestId);
-                       return resp;
-               }
-
-               if (response == null) {
-                       Response resp = msoRequest.buildServiceErrorResponse(
-                                       HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
-                                       "bpelResponse is null",
-                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
-                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
-                                       MSO_PROP_APIHANDLER_INFRA, "", "",
-                                       MsoLogger.ErrorCode.BusinessProcesssError,
-                                       "Null response from BPEL");
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
-                                       MsoLogger.ResponseCode.InternalError,
-                                       "Null response from BPMN");
-                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity());
-                       createOperationStatusRecordForError(action, requestId);
-                       return resp;
-               }
-
-               ResponseHandler respHandler = new ResponseHandler(response,
-                               requestClient.getType());
-               int bpelStatus = respHandler.getStatus();
-
-               return beplStatusUpdate(requestId, startTime, msoRequest,
-                               requestClient, respHandler, bpelStatus, action, instanceIdMap);
-       }
-
-       private Response processE2EserviceInstances(String requestJSON, Action action,
-                       HashMap<String, String> instanceIdMap, String version) {
-
-               String requestId = UUIDChecker.generateUUID(msoLogger);
-               long startTime = System.currentTimeMillis();
-               msoLogger.debug("requestId is: " + requestId);
-               E2EServiceInstanceRequest e2eSir = null;
-
-               MsoRequest msoRequest = new MsoRequest(requestId);
-               ObjectMapper mapper = new ObjectMapper();
-               try {
-                       e2eSir = mapper.readValue(requestJSON, E2EServiceInstanceRequest.class);
-
-               } catch (Exception e) {
-          //TODO update the service name
-          this.createOperationStatusRecordForError(action, requestId);
-                 
-                       msoLogger.debug("Mapping of request to JSON object failed : ", e);
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,
-                                       MsoException.ServiceException, "Mapping of request to JSON object failed.  " + e.getMessage(),
-                                       ErrorNumbers.SVC_BAD_PARAMETER, null);
-                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
-                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,
-                                       "Mapping of request to JSON object failed");
-                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
-                       return response;
-               }
-
-               mapReqJsonToSvcInstReq(e2eSir, requestJSON);
-               sir.getRequestDetails().getRequestParameters().setaLaCarte(true);
-               try {
-                       msoRequest.parse(sir, instanceIdMap, action, version);
-               } catch (Exception e) {
-                       msoLogger.debug("Validation failed: ", e);
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,
-                                       MsoException.ServiceException, "Error parsing request.  " + e.getMessage(),
-                                       ErrorNumbers.SVC_BAD_PARAMETER, null);
-                       if (msoRequest.getRequestId() != null) {
-                               msoLogger.debug("Logging failed message to the database");
-                               //TODO update the service name
-                         this.createOperationStatusRecordForError(action, requestId);
-                       }
-                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
-                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,
-                                       "Validation of the input request failed");
-                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
-                       return response;
-               }
-               
-               OperationStatus dup = null;
-               String instanceName = sir.getRequestDetails().getRequestInfo().getInstanceName();
-               String requestScope = sir.getRequestDetails().getModelInfo().getModelType().name();
-               try {
-                       if (!(instanceName == null && "service".equals(requestScope)
-                                       && (action == Action.createInstance || action == Action.activateInstance))) {
-                         //TODO : Need to check for the duplicate record from the operation status,
-                         //TODO : commenting this check for unblocking current testing for now...  induces dead code...
-                               dup = chkDuplicateServiceNameInOperStatus( instanceName);
-                       }
-               } catch (Exception e) {
-                       msoLogger.error(MessageEnum.APIH_DUPLICATE_CHECK_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",
-                                       MsoLogger.ErrorCode.DataError, "Error during duplicate check ", e);
-
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,
-                                       MsoException.ServiceException, e.getMessage(), ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
-
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
-                                       "Error during duplicate check");
-                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
-                       return response;
-               }
-
-               if (dup != null) {
-                       // Found the duplicate record. Return the appropriate error.
-                       String instance = null;
-                       if (instanceName != null) {
-                               instance = instanceName;
-                       } else {
-                               instance = instanceIdMap.get(requestScope + "InstanceId");
-                       }
-                       String dupMessage = "Error: Locked instance - This " + requestScope + " (" + instance + ") "
-                                       + "already has a request being worked with a status of " + dup.getProgress() + " (ServiceId - "
-                                       + dup.getServiceId() + "). The existing request must finish or be cleaned up before proceeding.";
-
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_CONFLICT,
-                                       MsoException.ServiceException, dupMessage, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
-
-                       msoLogger.warn(MessageEnum.APIH_DUPLICATE_FOUND, dupMessage, "", "", MsoLogger.ErrorCode.SchemaError,
-                                       "Duplicate request - Subscriber already has a request for this service");
-                       
-                       
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict,
-                                       dupMessage);
-                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
-                       createOperationStatusRecordForError(action, requestId);
-                       return response;
-               }
-               
-               CatalogDatabase db = null;
-               RecipeLookupResult recipeLookupResult = null;
-               try {
-                       db = CatalogDatabase.getInstance();
-                       recipeLookupResult = getServiceInstanceOrchestrationURI(db, e2eSir.getService().getTemplateId(), action);
-               } catch (Exception e) {
-                       msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",
-                                       MsoLogger.ErrorCode.AvailabilityError, "Exception while communciate with Catalog DB", e);
-                       msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
-                                       MsoException.ServiceException, "No communication to catalog DB " + e.getMessage(),
-                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
-                       alarmLogger.sendAlarm("MsoDatabaseAccessError", MsoAlarmLogger.CRITICAL,
-                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));
-                       
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
-                                       "Exception while communciate with DB");
-                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());
-                       createOperationStatusRecordForError(action, requestId);
-                       return response;
-               } finally {
-                       closeCatalogDB(db);
-               }
-
-               if (recipeLookupResult == null) {
-                       msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, MSO_PROP_APIHANDLER_INFRA, "", "",
-                                       MsoLogger.ErrorCode.DataError, "No recipe found in DB");
-                       msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
-                                       MsoException.ServiceException, "Recipe does not exist in catalog DB",
-                                       ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);
-               
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
-                                       "No recipe found in DB");
-                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());
-                       createOperationStatusRecordForError(action, requestId);
-                       return response;
-               }
-//             try {
-//                     msoRequest.createRequestRecord(Status.PENDING, action);
-//                     //createOperationStatusRecord(action, requestId);
-//             } catch (Exception e) {
-//                     msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC_REASON, "Exception while creating record in DB", "", "",
-//                                     MsoLogger.ErrorCode.SchemaError, "Exception while creating record in DB", e);
-//                     msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
-//                     Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,
-//                                     MsoException.ServiceException, "Exception while creating record in DB " + e.getMessage(),
-//                                     ErrorNumbers.SVC_BAD_PARAMETER, null);
-//                     msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
-//                                     "Exception while creating record in DB");
-//                     msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
-//                     return response;
-//             }
-
-               String serviceInstanceType = e2eSir.getService().getParameters().getServiceType();
-
-               String serviceId = "";
-               RequestClient requestClient = null;
-               HttpResponse response = null;
-
-               long subStartTime = System.currentTimeMillis();
-               String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);
-
-               try {
-                       requestClient = RequestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI(),
-                                       MsoPropertiesUtils.loadMsoProperties());
-
-                       // Capture audit event
-                       msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
-
-                       response = requestClient.post(requestId, false, recipeLookupResult.getRecipeTimeout(), action.name(),
-                                       serviceId, null, null, null, null, serviceInstanceType, null, null, null, sirRequestJson, recipeLookupResult.getRecipeParamXsd());
-
-                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
-                                       "Successfully received response from BPMN engine", "BPMN", recipeLookupResult.getOrchestrationURI(),
-                                       null);
-               } catch (Exception e) {
-                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.ERROR,
-                                       MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine", "BPMN",
-                                       recipeLookupResult.getOrchestrationURI(), null);
-                       Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
-                                       MsoException.ServiceException, "Failed calling bpmn " + e.getMessage(),
-                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
-                       alarmLogger.sendAlarm("MsoConfigurationError", MsoAlarmLogger.CRITICAL,
-                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));
-                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
-                                       MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine");
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
-                                       "Exception while communicate with BPMN engine");
-                       msoLogger.debug("End of the transaction, the final response is: " + (String) resp.getEntity());
-                       createOperationStatusRecordForError(action, requestId);
-                       return resp;
-               }
-
-               if (response == null) {
-                       Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
-                                       MsoException.ServiceException, "bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
-                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
-                                       MsoLogger.ErrorCode.BusinessProcesssError, "Null response from BPEL");
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError,
-                                       "Null response from BPMN");
-                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity());
-                       return resp;
-               }
-
-               ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
-               int bpelStatus = respHandler.getStatus();
-
-               return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus, action, instanceIdMap);
-       }
-
-       private void closeCatalogDB(CatalogDatabase db) {
-               if (db != null) {
-                       db.close();
-               }
-       }
-
-       private Response beplStatusUpdate(String requestId, long startTime,
-                       MsoRequest msoRequest, RequestClient requestClient,
-                       ResponseHandler respHandler, int bpelStatus, Action action,
-                       HashMap<String, String> instanceIdMap) {
-               // BPMN accepted the request, the request is in progress
-               if (bpelStatus == HttpStatus.SC_ACCEPTED) {
-                       String camundaJSONResponseBody = respHandler.getResponseBody();
-                       msoLogger
-                                       .debug("Received from Camunda: " + camundaJSONResponseBody);
-
-                       // currently only for delete case we update the status here
-                       if (action == Action.deleteInstance) {
-                               ObjectMapper mapper = new ObjectMapper();
-                               try {
-                                       DelE2ESvcResp jo = mapper.readValue(
-                                                       camundaJSONResponseBody, DelE2ESvcResp.class);
-                                       String operationId = jo.getOperationId();
-                               this.createOperationStatusRecord("DELETE", requestId,
-                                                               operationId);
-                               } catch (Exception ex) {
-                                       msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,
-                                                       requestClient.getUrl(), "", "",
-                                                       MsoLogger.ErrorCode.BusinessProcesssError,
-                                                       "Response from BPEL engine is failed with HTTP Status="
-                                                                       + bpelStatus);
-                               }
-                       }
-                       msoLogger.recordAuditEvent(startTime,
-                                       MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
-                                       "BPMN accepted the request, the request is in progress");
-                       msoLogger.debug(END_OF_THE_TRANSACTION + camundaJSONResponseBody);
-                       return Response.status(HttpStatus.SC_ACCEPTED)
-                                       .entity(camundaJSONResponseBody).build();
-               } else {
-                       List<String> variables = new ArrayList<>();
-                       variables.add(bpelStatus + "");
-                       String camundaJSONResponseBody = respHandler.getResponseBody();
-                       if (camundaJSONResponseBody != null
-                                       && !camundaJSONResponseBody.isEmpty()) {
-                               Response resp = msoRequest.buildServiceErrorResponse(
-                                               bpelStatus, MsoException.ServiceException,
-                                               "Request Failed due to BPEL error with HTTP Status= %1 "
-                                                               + '\n' + camundaJSONResponseBody,
-                                               ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, variables);
-                               msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,
-                                               requestClient.getUrl(), "", "",
-                                               MsoLogger.ErrorCode.BusinessProcesssError,
-                                               "Response from BPEL engine is failed with HTTP Status="
-                                                               + bpelStatus);
-                               msoLogger.recordAuditEvent(startTime,
-                                               MsoLogger.StatusCode.ERROR,
-                                               MsoLogger.ResponseCode.InternalError,
-                                               "Response from BPMN engine is failed");
-                               msoLogger.debug(END_OF_THE_TRANSACTION
-                                               + (String) resp.getEntity());
-                               return resp;
-                       } else {
-                               Response resp = msoRequest
-                                               .buildServiceErrorResponse(
-                                                               bpelStatus,
-                                                               MsoException.ServiceException,
-                                                               "Request Failed due to BPEL error with HTTP Status= %1",
-                                                               ErrorNumbers.SVC_DETAILED_SERVICE_ERROR,
-                                                               variables);
-                               msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,
-                                               requestClient.getUrl(), "", "",
-                                               MsoLogger.ErrorCode.BusinessProcesssError,
-                                               "Response from BPEL engine is empty");
-                               msoLogger.recordAuditEvent(startTime,
-                                               MsoLogger.StatusCode.ERROR,
-                                               MsoLogger.ResponseCode.InternalError,
-                                               "Response from BPEL engine is empty");
-                               msoLogger.debug(END_OF_THE_TRANSACTION
-                                               + (String) resp.getEntity());
-                               return resp;
-                       }
-               }
-       }
-
-       /**
-        * Getting recipes from catalogDb
-        * 
-        * @param db the catalog db
-        * @param serviceModelUUID the service model version uuid
-        * @param action the action for the service
-        * @return the service recipe result
-        */
-       private RecipeLookupResult getServiceInstanceOrchestrationURI(
-                       CatalogDatabase db, String serviceModelUUID, Action action) {
-
-               RecipeLookupResult recipeLookupResult = getServiceURI(db, serviceModelUUID, action);
-
-               if (recipeLookupResult != null) {
-                       msoLogger.debug("Orchestration URI is: "
-                                       + recipeLookupResult.getOrchestrationURI()
-                                       + ", recipe Timeout is: "
-                                       + Integer.toString(recipeLookupResult.getRecipeTimeout()));
-               } else {
-                       msoLogger.debug("No matching recipe record found");
-               }
-               return recipeLookupResult;
-       }
-
-       /**
-        * Getting recipes from catalogDb
-        * If Service recipe is not set, use default recipe, if set , use special recipe.
-        * @param db the catalog db
-        * @param serviceModelUUID the service version uuid
-        * @param action the action of the service.
-        * @return the service recipe result.
-        */
-       private RecipeLookupResult getServiceURI(CatalogDatabase db, String serviceModelUUID, Action action) {
-
-               String defaultServiceModelName = "UUI_DEFAULT";
-
-               Service defaultServiceRecord = db
-                               .getServiceByModelName(defaultServiceModelName);
-               ServiceRecipe defaultRecipe = db.getServiceRecipeByModelUUID(
-                       defaultServiceRecord.getModelUUID(), action.name());
-               //set recipe as default generic recipe
-               ServiceRecipe recipe = defaultRecipe;
-               //check the service special recipe 
-               if(null != serviceModelUUID && ! serviceModelUUID.isEmpty()){
-                     ServiceRecipe serviceSpecialRecipe = db.getServiceRecipeByModelUUID(
-                             serviceModelUUID, action.name());
-                     if(null != serviceSpecialRecipe){
-                         //set service special recipe.
-                         recipe = serviceSpecialRecipe;
-                     }
-               }       
-               
-               if (recipe == null) {
-                       return null;
-               }
-               return new RecipeLookupResult(recipe.getOrchestrationUri(),
-                               recipe.getRecipeTimeout(), recipe.getServiceParamXSD());
-
-       }
-
-       /**
-        * Converting E2EServiceInstanceRequest to ServiceInstanceRequest and
-        * passing it to camunda engine.
-        * 
-        * @param e2eSir
-        * @return
-        */
-       private String mapReqJsonToSvcInstReq(E2EServiceInstanceRequest e2eSir,
-                       String requestJSON) {
-
-               sir = new ServiceInstancesRequest();
-
-               String returnString = null;
-               RequestDetails requestDetails = new RequestDetails();
-               ModelInfo modelInfo = new ModelInfo();
-
-               // ModelInvariantId
-               modelInfo.setModelInvariantId(e2eSir.getService().getServiceDefId());
-
-               // modelNameVersionId
-               modelInfo.setModelNameVersionId(e2eSir.getService().getTemplateId());
-
-               // String modelInfoValue =
-               // e2eSir.getService().getParameters().getNodeTemplateName();
-               // String[] arrayOfInfo = modelInfoValue.split(":");
-               // String modelName = arrayOfInfo[0];
-               // String modelVersion = arrayOfInfo[1];
-
-               // TODO: To ensure, if we dont get the values from the UUI
-               String modelName = "voLTE";
-               String modelVersion = "1.0";
-               // modelName
-               modelInfo.setModelName(modelName);
-
-               // modelVersion
-               modelInfo.setModelVersion(modelVersion);
-
-               // modelType
-               modelInfo.setModelType(ModelType.service);
-
-               // setting modelInfo to requestDetails
-               requestDetails.setModelInfo(modelInfo);
-
-               SubscriberInfo subscriberInfo = new SubscriberInfo();
-
-               // globalsubscriberId
-               subscriberInfo.setGlobalSubscriberId(e2eSir.getService()
-                               .getParameters().getGlobalSubscriberId());
-
-               // subscriberName
-               subscriberInfo.setSubscriberName(e2eSir.getService().getParameters()
-                               .getSubscriberName());
-
-               // setting subscriberInfo to requestDetails
-               requestDetails.setSubscriberInfo(subscriberInfo);
-
-               RequestInfo requestInfo = new RequestInfo();
-
-               // instanceName
-               requestInfo.setInstanceName(e2eSir.getService().getName());
-
-               // source
-               requestInfo.setSource("UUI");
-
-               // suppressRollback
-               requestInfo.setSuppressRollback(true);
-
-               // setting requestInfo to requestDetails
-               requestDetails.setRequestInfo(requestInfo);
-
-               RequestParameters requestParameters = new RequestParameters();
-
-               // subscriptionServiceType
-               requestParameters.setSubscriptionServiceType("MOG");
-
-               // Userparams
-               List<E2EUserParam> userParams;
-               // userParams =
-               // e2eSir.getService().getParameters().getRequestParameters().getUserParams();
-               List<Map<String, String>> userParamList = new ArrayList<>();
-               Map<String, String> userParamMap = new HashMap<>();
-               // complete json request updated in the camunda
-               userParamMap.put("UUIRequest", requestJSON);
-               userParamMap.put("ServiceInstanceName", e2eSir.getService().getName());
-
-               // Map<String, String> userParamMap3 = null;
-               // for (E2EUserParam userp : userParams) {
-               // userParamMap.put(userp.getName(), userp.getValue());
-               //
-               // }
-               userParamList.add(userParamMap);
-               requestParameters.setUserParams(userParamList);
-
-               // setting requestParameters to requestDetails
-               requestDetails.setRequestParameters(requestParameters);
-
-               sir.setRequestDetails(requestDetails);
-
-               // converting to string
-               ObjectMapper mapper = new ObjectMapper();
-               try {
-                       returnString = mapper.writeValueAsString(sir);
-               } catch (IOException e) {
-                       msoLogger
-                                       .debug("Exception while converting ServiceInstancesRequest object to string",
-                                                       e);
-               }
-
-               return returnString;
-       }
-
-       private void createOperationStatusRecordForError(Action action,
-                       String requestId) throws MsoDatabaseException {
-
-               AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager();
-
-               Session session = null;
-               try {
-
-                       session = requestsDbSessionFactoryManager.getSessionFactory()
-                                       .openSession();
-                       session.beginTransaction();
-
-                       OperationStatus os = new OperationStatus();
-                       os.setOperation(action.name());
-                       os.setOperationContent("");
-                       os.setOperationId("");
-                       os.setProgress("100");
-                       os.setReason("");
-                       os.setResult("error");
-                       os.setServiceId(requestId);
-                       os.setUserId("");
-                       Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
-                       Timestamp endTimeStamp = new Timestamp(System.currentTimeMillis());
-                       os.setFinishedAt(endTimeStamp);
-                       os.setOperateAt(startTimeStamp);
-
-                       session.save(os);
-                       session.getTransaction().commit();
-
-               } catch (Exception e) {
-                       msoLogger.error(MessageEnum.APIH_DB_INSERT_EXC, "", "",
-                                       MsoLogger.ErrorCode.DataError,
-                                       "Exception when creation record request in Operation", e);
-                       throw new MsoDatabaseException(
-                                       "Data did inserted in Operatus Status Table for failure", e);
-               } finally {
-                       if (null != session) {
-                               session.close();
-                       }
-               }
-       }
-
-       private void createOperationStatusRecord(String actionNm, String serviceId,
-                       String operationId) throws MsoDatabaseException {
-
-               AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager();
-
-               Session session = null;
-               try {
-
-                       session = requestsDbSessionFactoryManager.getSessionFactory()
-                                       .openSession();
-                       session.beginTransaction();
-
-                       OperationStatus os = new OperationStatus();
-                       os.setOperation(actionNm);
-                       os.setOperationContent("");
-                       os.setOperationId(operationId);
-                       os.setProgress("0");
-                       os.setReason("");
-                       os.setResult("processing");
-                       os.setServiceId(serviceId);
-                       // TODO : to be updated...
-                       os.setUserId("");
-                       Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
-                       Timestamp endTimeStamp = new Timestamp(System.currentTimeMillis());
-                       os.setFinishedAt(endTimeStamp);
-                       os.setOperateAt(startTimeStamp);
-
-                       session.save(os);
-                       session.getTransaction().commit();
-
-               } catch (Exception e) {
-                       msoLogger.error(MessageEnum.APIH_DB_INSERT_EXC, "", "",
-                                       MsoLogger.ErrorCode.DataError,
-                                       "Exception when creation record request in Operation", e);
-                       throw new MsoDatabaseException(
-                                       "Data did inserted in Operatus Status Table", e);
-               } finally {
-                       if (null != session) {
-                               session.close();
-                       }
-               }
-       }
-
-       private OperationStatus chkDuplicateServiceInOperStatus(String serviceId) {
-               OperationStatus dupServiceName = (RequestsDatabase.getInstance())
-                               .getOperationStatusByServiceId(serviceId);
-
-               return dupServiceName;
-       }
-
-       private OperationStatus chkDuplicateServiceNameInOperStatus(
-                       String serviceName) {
-               OperationStatus dupServiceName = (RequestsDatabase.getInstance())
-                               .getOperationStatusByServiceName(serviceName);
-
-               return dupServiceName;
-       }
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END=========================================================\r
+ */\r
+\r
+package org.openecomp.mso.apihandlerinfra;\r
+\r
+import java.io.IOException;\r
+import java.sql.Timestamp;\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+import java.util.Map;\r
+\r
+import javax.ws.rs.Consumes;\r
+import javax.ws.rs.DELETE;\r
+import javax.ws.rs.GET;\r
+import javax.ws.rs.POST;\r
+import javax.ws.rs.PUT;\r
+import javax.ws.rs.Path;\r
+import javax.ws.rs.PathParam;\r
+import javax.ws.rs.Produces;\r
+import javax.ws.rs.core.MediaType;\r
+import javax.ws.rs.core.Response;\r
+\r
+import org.apache.http.HttpResponse;\r
+import org.apache.http.HttpStatus;\r
+import org.codehaus.jackson.map.ObjectMapper;\r
+import org.hibernate.Session;\r
+import org.json.JSONObject;\r
+import org.openecomp.mso.apihandler.common.ErrorNumbers;\r
+import org.openecomp.mso.apihandler.common.RequestClient;\r
+import org.openecomp.mso.apihandler.common.RequestClientFactory;\r
+import org.openecomp.mso.apihandler.common.ResponseHandler;\r
+import org.openecomp.mso.apihandlerinfra.Messages;\r
+import org.openecomp.mso.apihandlerinfra.MsoException;\r
+import org.openecomp.mso.apihandlerinfra.MsoRequest;\r
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.DelE2ESvcResp;\r
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EServiceInstanceDeleteRequest;\r
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EServiceInstanceRequest;\r
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EUserParam;\r
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.GetE2EServiceInstanceResponse;\r
+import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.ModelInfo;\r
+import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestDetails;\r
+import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestInfo;\r
+import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestParameters;\r
+import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.ServiceInstancesRequest;\r
+import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.SubscriberInfo;\r
+import org.openecomp.mso.db.AbstractSessionFactoryManager;\r
+import org.openecomp.mso.db.catalog.CatalogDatabase;\r
+import org.openecomp.mso.db.catalog.beans.Service;\r
+import org.openecomp.mso.db.catalog.beans.ServiceRecipe;\r
+import org.openecomp.mso.logger.MessageEnum;\r
+import org.openecomp.mso.logger.MsoAlarmLogger;\r
+import org.openecomp.mso.logger.MsoLogger;\r
+import org.openecomp.mso.properties.MsoDatabaseException;\r
+import org.openecomp.mso.requestsdb.OperationStatus;\r
+import org.openecomp.mso.requestsdb.RequestsDatabase;\r
+import org.openecomp.mso.requestsdb.RequestsDbSessionFactoryManager;\r
+import org.openecomp.mso.utils.UUIDChecker;\r
+\r
+import com.wordnik.swagger.annotations.Api;\r
+import com.wordnik.swagger.annotations.ApiOperation;\r
+\r
+@Path("/e2eServiceInstances")\r
+@Api(value = "/e2eServiceInstances", description = "API Requests for E2E Service Instances")\r
+public class E2EServiceInstances {\r
+\r
+       private HashMap<String, String> instanceIdMap = new HashMap<>();\r
+       private static MsoLogger msoLogger = MsoLogger\r
+                       .getMsoLogger(MsoLogger.Catalog.APIH);\r
+       private static MsoAlarmLogger alarmLogger = new MsoAlarmLogger();\r
+       public static final String MSO_PROP_APIHANDLER_INFRA = "MSO_PROP_APIHANDLER_INFRA";\r
+       private ServiceInstancesRequest sir = null;\r
+\r
+       public static final String END_OF_THE_TRANSACTION = "End of the transaction, the final response is: ";\r
+       public static final String EXCEPTION_CREATING_DB_RECORD = "Exception while creating record in DB";\r
+       public static final String EXCEPTION_COMMUNICATE_BPMN_ENGINE = "Exception while communicate with BPMN engine";\r
+\r
+       /**\r
+        * POST Requests for E2E Service create Instance on a version provided\r
+        */\r
+\r
+       @POST\r
+       @Path("/{version:[vV][3-5]}")\r
+       @Consumes(MediaType.APPLICATION_JSON)\r
+       @Produces(MediaType.APPLICATION_JSON)\r
+       @ApiOperation(value = "Create an E2E Service Instance on a version provided", response = Response.class)\r
+       public Response createE2EServiceInstance(String request,\r
+                       @PathParam("version") String version) {\r
+\r
+               return processE2EserviceInstances(request, Action.createInstance, null,\r
+                               version);\r
+       }\r
+       \r
+       /**\r
+        * PUT Requests for E2E Service update Instance on a version provided\r
+        */\r
+\r
+       @PUT\r
+       @Path("/{version:[vV][3-5]}/{serviceId}")\r
+       @Consumes(MediaType.APPLICATION_JSON)\r
+       @Produces(MediaType.APPLICATION_JSON)\r
+       @ApiOperation(value = "Update an E2E Service Instance on a version provided and serviceId", response = Response.class)\r
+       public Response updateE2EServiceInstance(String request,\r
+                       @PathParam("version") String version,\r
+                       @PathParam("serviceId") String serviceId) {\r
+               \r
+               instanceIdMap.put("serviceId", serviceId);\r
+\r
+               return updateE2EserviceInstances(request, Action.updateInstance, instanceIdMap,\r
+                               version);\r
+       }\r
+\r
+       /**\r
+        * DELETE Requests for E2E Service delete Instance on a specified version\r
+        * and serviceId\r
+        */\r
+\r
+       @DELETE\r
+       @Path("/{version:[vV][3-5]}/{serviceId}")\r
+       @Consumes(MediaType.APPLICATION_JSON)\r
+       @Produces(MediaType.APPLICATION_JSON)\r
+       @ApiOperation(value = "Delete E2E Service Instance on a specified version and serviceId", response = Response.class)\r
+       public Response deleteE2EServiceInstance(String request,\r
+                       @PathParam("version") String version,\r
+                       @PathParam("serviceId") String serviceId) {\r
+\r
+               instanceIdMap.put("serviceId", serviceId);\r
+\r
+               return deleteE2EserviceInstances(request, Action.deleteInstance,\r
+                               instanceIdMap, version);\r
+       }\r
+\r
+       @GET\r
+       @Path("/{version:[vV][3-5]}/{serviceId}/operations/{operationId}")\r
+       @ApiOperation(value = "Find e2eServiceInstances Requests for a given serviceId and operationId", response = Response.class)\r
+       @Produces(MediaType.APPLICATION_JSON)\r
+       public Response getE2EServiceInstances(\r
+                       @PathParam("serviceId") String serviceId,\r
+                       @PathParam("version") String version,\r
+                       @PathParam("operationId") String operationId) {\r
+               return getE2EServiceInstances(serviceId, operationId);\r
+       }\r
+\r
+       private Response getE2EServiceInstances(String serviceId, String operationId) {\r
+               RequestsDatabase requestsDB = RequestsDatabase.getInstance();\r
+\r
+               GetE2EServiceInstanceResponse e2eServiceResponse = new GetE2EServiceInstanceResponse();\r
+\r
+               MsoRequest msoRequest = new MsoRequest(serviceId);\r
+\r
+               long startTime = System.currentTimeMillis();\r
+\r
+               OperationStatus operationStatus = null;\r
+\r
+               try {\r
+                       operationStatus = requestsDB.getOperationStatus(serviceId,\r
+                                       operationId);\r
+\r
+               } catch (Exception e) {\r
+                       msoLogger\r
+                                       .error(MessageEnum.APIH_DB_ACCESS_EXC,\r
+                                                       MSO_PROP_APIHANDLER_INFRA,\r
+                                                       "",\r
+                                                       "",\r
+                                                       MsoLogger.ErrorCode.AvailabilityError,\r
+                                                       "Exception while communciate with Request DB - Infra Request Lookup",\r
+                                                       e);\r
+                       msoRequest\r
+                                       .setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
+                       Response response = msoRequest.buildServiceErrorResponse(\r
+                                       HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,\r
+                                       e.getMessage(),\r
+                                       ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB, null);\r
+                       alarmLogger.sendAlarm("MsoDatabaseAccessError",\r
+                                       MsoAlarmLogger.CRITICAL, Messages.errors\r
+                                                       .get(ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB));\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
+                                       MsoLogger.ResponseCode.DBAccessError,\r
+                                       "Exception while communciate with Request DB");\r
+                       msoLogger.debug("End of the transaction, the final response is: "\r
+                                       + (String) response.getEntity());\r
+                       return response;\r
+\r
+               }\r
+\r
+               if (operationStatus == null) {\r
+                       Response resp = msoRequest.buildServiceErrorResponse(\r
+                                       HttpStatus.SC_NO_CONTENT, MsoException.ServiceException,\r
+                                       "E2E serviceId " + serviceId + " is not found in DB",\r
+                                       ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);\r
+                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,\r
+                                       MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.BusinessProcesssError,\r
+                                       "Null response from RequestDB when searching by serviceId");\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
+                                       MsoLogger.ResponseCode.DataNotFound,\r
+                                       "Null response from RequestDB when searching by serviceId");\r
+                       msoLogger.debug("End of the transaction, the final response is: "\r
+                                       + (String) resp.getEntity());\r
+                       return resp;\r
+\r
+               }\r
+\r
+               e2eServiceResponse.setOperationStatus(operationStatus);\r
+\r
+               return Response.status(200).entity(e2eServiceResponse).build();\r
+       }\r
+\r
+       private Response deleteE2EserviceInstances(String requestJSON,\r
+                       Action action, HashMap<String, String> instanceIdMap, String version) {\r
+               // TODO should be a new one or the same service instance Id\r
+               String requestId = instanceIdMap.get("serviceId");\r
+               long startTime = System.currentTimeMillis();\r
+               msoLogger.debug("requestId is: " + requestId);\r
+               E2EServiceInstanceDeleteRequest e2eDelReq = null;\r
+\r
+               MsoRequest msoRequest = new MsoRequest(requestId);\r
+\r
+               ObjectMapper mapper = new ObjectMapper();\r
+               try {\r
+                       e2eDelReq = mapper.readValue(requestJSON,\r
+                                       E2EServiceInstanceDeleteRequest.class);\r
+\r
+               } catch (Exception e) {\r
+\r
+                       msoLogger.debug("Mapping of request to JSON object failed : ", e);\r
+                       Response response = msoRequest.buildServiceErrorResponse(\r
+                                       HttpStatus.SC_BAD_REQUEST,\r
+                                       MsoException.ServiceException,\r
+                                       "Mapping of request to JSON object failed.  "\r
+                                                       + e.getMessage(), ErrorNumbers.SVC_BAD_PARAMETER,\r
+                                       null);\r
+                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR,\r
+                                       MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
+                                       MsoLogger.ResponseCode.SchemaError,\r
+                                       "Mapping of request to JSON object failed");\r
+                       msoLogger.debug("End of the transaction, the final response is: "\r
+                                       + (String) response.getEntity());\r
+                       createOperationStatusRecordForError(action, requestId);\r
+                       return response;\r
+               }\r
+\r
+               CatalogDatabase db = null;\r
+               RecipeLookupResult recipeLookupResult = null;\r
+               try {\r
+                       db = CatalogDatabase.getInstance();\r
+                       //TODO  Get the service template model version uuid from AAI.\r
+                       recipeLookupResult = getServiceInstanceOrchestrationURI(db, null, action);\r
+               } catch (Exception e) {\r
+                       msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC,\r
+                                       MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.AvailabilityError,\r
+                                       "Exception while communciate with Catalog DB", e);\r
+                       msoRequest\r
+                                       .setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
+                       Response response = msoRequest.buildServiceErrorResponse(\r
+                                       HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,\r
+                                       "No communication to catalog DB " + e.getMessage(),\r
+                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
+                       alarmLogger.sendAlarm("MsoDatabaseAccessError",\r
+                                       MsoAlarmLogger.CRITICAL, Messages.errors\r
+                                                       .get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));\r
+                       msoRequest.createRequestRecord(Status.FAILED, action);\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
+                                       MsoLogger.ResponseCode.DBAccessError,\r
+                                       "Exception while communciate with DB");\r
+                       msoLogger.debug(END_OF_THE_TRANSACTION\r
+                                       + (String) response.getEntity());\r
+                       return response;\r
+               } finally {\r
+                       closeCatalogDB(db);\r
+               }\r
+               if (recipeLookupResult == null) {\r
+                       msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND,\r
+                                       MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.DataError, "No recipe found in DB");\r
+                       msoRequest\r
+                                       .setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
+                       Response response = msoRequest.buildServiceErrorResponse(\r
+                                       HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,\r
+                                       "Recipe does not exist in catalog DB",\r
+                                       ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);\r
+                       msoRequest.createRequestRecord(Status.FAILED, action);\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
+                                       MsoLogger.ResponseCode.DataNotFound,\r
+                                       "No recipe found in DB");\r
+                       msoLogger.debug(END_OF_THE_TRANSACTION\r
+                                       + (String) response.getEntity());\r
+                       createOperationStatusRecordForError(action, requestId);\r
+                       return response;\r
+               }\r
+\r
+               RequestClient requestClient = null;\r
+               HttpResponse response = null;\r
+\r
+               long subStartTime = System.currentTimeMillis();\r
+               // String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);\r
+\r
+               try {\r
+                       requestClient = RequestClientFactory.getRequestClient(\r
+                                       recipeLookupResult.getOrchestrationURI(),\r
+                                       MsoPropertiesUtils.loadMsoProperties());\r
+\r
+                       JSONObject jjo = new JSONObject(requestJSON);\r
+                       jjo.put("operationId", UUIDChecker.generateUUID(msoLogger));\r
+\r
+                       String bpmnRequest = jjo.toString();\r
+\r
+                       // Capture audit event\r
+                       msoLogger\r
+                                       .debug("MSO API Handler Posting call to BPEL engine for url: "\r
+                                                       + requestClient.getUrl());\r
+                       String serviceId = instanceIdMap.get("serviceId");\r
+                       String serviceInstanceType = e2eDelReq.getServiceType();\r
+                       response = requestClient.post(requestId, false,\r
+                                       recipeLookupResult.getRecipeTimeout(), action.name(),\r
+                                       serviceId, null, null, null, null, serviceInstanceType,\r
+                                       null, null, null, bpmnRequest, recipeLookupResult.getRecipeParamXsd());\r
+\r
+                       msoLogger.recordMetricEvent(subStartTime,\r
+                                       MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,\r
+                                       "Successfully received response from BPMN engine", "BPMN",\r
+                                       recipeLookupResult.getOrchestrationURI(), null);\r
+               } catch (Exception e) {\r
+                       msoLogger.recordMetricEvent(subStartTime,\r
+                                       MsoLogger.StatusCode.ERROR,\r
+                                       MsoLogger.ResponseCode.CommunicationError,\r
+                                       "Exception while communicate with BPMN engine", "BPMN",\r
+                                       recipeLookupResult.getOrchestrationURI(), null);\r
+                       Response resp = msoRequest.buildServiceErrorResponse(\r
+                                       HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,\r
+                                       "Failed calling bpmn " + e.getMessage(),\r
+                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
+                       alarmLogger.sendAlarm("MsoConfigurationError",\r
+                                       MsoAlarmLogger.CRITICAL,\r
+                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));\r
+                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,\r
+                                       MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.AvailabilityError,\r
+                                       "Exception while communicate with BPMN engine");\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
+                                       MsoLogger.ResponseCode.CommunicationError,\r
+                                       "Exception while communicate with BPMN engine");\r
+                       msoLogger.debug("End of the transaction, the final response is: "\r
+                                       + (String) resp.getEntity());\r
+                       createOperationStatusRecordForError(action, requestId);\r
+                       return resp;\r
+               }\r
+\r
+               if (response == null) {\r
+                       Response resp = msoRequest.buildServiceErrorResponse(\r
+                                       HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,\r
+                                       "bpelResponse is null",\r
+                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
+                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,\r
+                                       MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.BusinessProcesssError,\r
+                                       "Null response from BPEL");\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
+                                       MsoLogger.ResponseCode.InternalError,\r
+                                       "Null response from BPMN");\r
+                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity());\r
+                       createOperationStatusRecordForError(action, requestId);\r
+                       return resp;\r
+               }\r
+\r
+               ResponseHandler respHandler = new ResponseHandler(response,\r
+                               requestClient.getType());\r
+               int bpelStatus = respHandler.getStatus();\r
+\r
+               return beplStatusUpdate(requestId, startTime, msoRequest,\r
+                               requestClient, respHandler, bpelStatus, action, instanceIdMap);\r
+       }\r
+\r
+       private Response updateE2EserviceInstances(String requestJSON, Action action,\r
+                       HashMap<String, String> instanceIdMap, String version) {\r
+\r
+               String requestId = instanceIdMap.get("serviceId");\r
+               long startTime = System.currentTimeMillis();\r
+               msoLogger.debug("requestId is: " + requestId);\r
+               E2EServiceInstanceRequest e2eSir = null;\r
+\r
+               MsoRequest msoRequest = new MsoRequest(requestId);\r
+               ObjectMapper mapper = new ObjectMapper();\r
+               try {\r
+                       e2eSir = mapper.readValue(requestJSON, E2EServiceInstanceRequest.class);\r
+\r
+               } catch (Exception e) {\r
+          \r
+          this.createOperationStatusRecordForError(action, requestId);\r
+                 \r
+                       msoLogger.debug("Mapping of request to JSON object failed : ", e);\r
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,\r
+                                       MsoException.ServiceException, "Mapping of request to JSON object failed.  " + e.getMessage(),\r
+                                       ErrorNumbers.SVC_BAD_PARAMETER, null);\r
+                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,\r
+                                       "Mapping of request to JSON object failed");\r
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
+                       return response;\r
+               }\r
+\r
+               mapReqJsonToSvcInstReq(e2eSir, requestJSON);\r
+               sir.getRequestDetails().getRequestParameters().setaLaCarte(true);\r
+               try {\r
+                       msoRequest.parse(sir, instanceIdMap, action, version);\r
+               } catch (Exception e) {\r
+                       msoLogger.debug("Validation failed: ", e);\r
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,\r
+                                       MsoException.ServiceException, "Error parsing request.  " + e.getMessage(),\r
+                                       ErrorNumbers.SVC_BAD_PARAMETER, null);\r
+                       if (msoRequest.getRequestId() != null) {\r
+                               msoLogger.debug("Logging failed message to the database");\r
+                               this.createOperationStatusRecordForError(action, requestId);\r
+                       }\r
+                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,\r
+                                       "Validation of the input request failed");\r
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
+                       return response;\r
+               }\r
+               \r
+               //check for the current operation status\r
+               Response resp = checkE2ESvcInstStatus(action, requestId, startTime, msoRequest);\r
+               if(resp != null && resp.getStatus() != 200) {\r
+                       return resp;\r
+               }\r
+               \r
+               CatalogDatabase db = null;\r
+               RecipeLookupResult recipeLookupResult = null;\r
+               try {\r
+                       db = CatalogDatabase.getInstance();\r
+                       recipeLookupResult = getServiceInstanceOrchestrationURI(db, e2eSir.getService().getTemplateId(), action);\r
+               } catch (Exception e) {\r
+                       msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.AvailabilityError, "Exception while communciate with Catalog DB", e);\r
+                       msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,\r
+                                       MsoException.ServiceException, "No communication to catalog DB " + e.getMessage(),\r
+                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
+                       alarmLogger.sendAlarm("MsoDatabaseAccessError", MsoAlarmLogger.CRITICAL,\r
+                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));\r
+                       \r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,\r
+                                       "Exception while communciate with DB");\r
+                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());\r
+                       createOperationStatusRecordForError(action, requestId);\r
+                       return response;\r
+               } finally {\r
+                       closeCatalogDB(db);\r
+               }\r
+\r
+               if (recipeLookupResult == null) {\r
+                       msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.DataError, "No recipe found in DB");\r
+                       msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,\r
+                                       MsoException.ServiceException, "Recipe does not exist in catalog DB",\r
+                                       ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);\r
+               \r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,\r
+                                       "No recipe found in DB");\r
+                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());\r
+                       createOperationStatusRecordForError(action, requestId);\r
+                       return response;\r
+               }\r
+\r
+               String serviceInstanceType = e2eSir.getService().getParameters().getServiceType();\r
+\r
+               String serviceId = "";\r
+               RequestClient requestClient = null;\r
+               HttpResponse response = null;\r
+\r
+               long subStartTime = System.currentTimeMillis();\r
+               String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);\r
+\r
+               try {\r
+                       requestClient = RequestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI(),\r
+                                       MsoPropertiesUtils.loadMsoProperties());\r
+\r
+                       // Capture audit event\r
+                       msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());\r
+\r
+                       response = requestClient.post(requestId, false, recipeLookupResult.getRecipeTimeout(), action.name(),\r
+                                       serviceId, null, null, null, null, serviceInstanceType, null, null, null, sirRequestJson, recipeLookupResult.getRecipeParamXsd());\r
+\r
+                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,\r
+                                       "Successfully received response from BPMN engine", "BPMN", recipeLookupResult.getOrchestrationURI(),\r
+                                       null);\r
+               } catch (Exception e) {\r
+                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.ERROR,\r
+                                       MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine", "BPMN",\r
+                                       recipeLookupResult.getOrchestrationURI(), null);\r
+                       Response getBPMNResp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,\r
+                                       MsoException.ServiceException, "Failed calling bpmn " + e.getMessage(),\r
+                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
+                       alarmLogger.sendAlarm("MsoConfigurationError", MsoAlarmLogger.CRITICAL,\r
+                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));\r
+                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine");\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,\r
+                                       "Exception while communicate with BPMN engine");\r
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) getBPMNResp.getEntity());\r
+                       createOperationStatusRecordForError(action, requestId);\r
+                       return getBPMNResp;\r
+               }\r
+\r
+               if (response == null) {\r
+                       Response getBPMNResp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,\r
+                                       MsoException.ServiceException, "bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
+                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.BusinessProcesssError, "Null response from BPEL");\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError,\r
+                                       "Null response from BPMN");\r
+                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) getBPMNResp.getEntity());\r
+                       return getBPMNResp;\r
+               }\r
+\r
+               ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());\r
+               int bpelStatus = respHandler.getStatus();\r
+\r
+               return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus, action, instanceIdMap);\r
+       }\r
+\r
+       private Response checkE2ESvcInstStatus(Action action, String requestId, long startTime, MsoRequest msoRequest) {\r
+               OperationStatus curStatus = null;\r
+//             String instanceName = sir.getRequestDetails().getRequestInfo().getInstanceName();\r
+               String requestScope = sir.getRequestDetails().getModelInfo().getModelType().name();\r
+               try {\r
+                       if (!(requestId == null && "service".equals(requestScope) && (action == Action.updateInstance))) {                          \r
+                               curStatus = chkSvcInstOperStatusbySvcId(requestId);\r
+                       }\r
+               } catch (Exception e) {\r
+                       msoLogger.error(MessageEnum.APIH_DUPLICATE_CHECK_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.DataError, "Error during current operation status check ", e);\r
+\r
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,\r
+                                       MsoException.ServiceException, e.getMessage(), ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);\r
+\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,\r
+                                       "Error during current operation status check");\r
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
+                       return response;\r
+               }\r
+\r
+               if (curStatus != null && !curStatus.getProgress().equals("100")) {\r
+                       String chkMessage = "Error: Locked instance - This " + requestScope + " (" + requestId + ") "\r
+                                       + "now being worked with a status of " + curStatus.getProgress() + " (ServiceName - "\r
+                                       + curStatus.getServiceName()\r
+                                       + "). The existing request must finish or be cleaned up before proceeding.";\r
+\r
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_CONFLICT,\r
+                                       MsoException.ServiceException, chkMessage, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);\r
+\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict,\r
+                                       chkMessage);\r
+\r
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
+\r
+                       createOperationStatusRecordForError(action, requestId);\r
+\r
+                       return response;\r
+               }\r
+               \r
+               return Response.status(200).entity(null).build();\r
+       }\r
+       \r
+       private Response processE2EserviceInstances(String requestJSON, Action action,\r
+                       HashMap<String, String> instanceIdMap, String version) {\r
+\r
+               String requestId = UUIDChecker.generateUUID(msoLogger);\r
+               long startTime = System.currentTimeMillis();\r
+               msoLogger.debug("requestId is: " + requestId);\r
+               E2EServiceInstanceRequest e2eSir = null;\r
+\r
+               MsoRequest msoRequest = new MsoRequest(requestId);\r
+               ObjectMapper mapper = new ObjectMapper();\r
+               try {\r
+                       e2eSir = mapper.readValue(requestJSON, E2EServiceInstanceRequest.class);\r
+\r
+               } catch (Exception e) {\r
+          //TODO update the service name\r
+          this.createOperationStatusRecordForError(action, requestId);\r
+                 \r
+                       msoLogger.debug("Mapping of request to JSON object failed : ", e);\r
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,\r
+                                       MsoException.ServiceException, "Mapping of request to JSON object failed.  " + e.getMessage(),\r
+                                       ErrorNumbers.SVC_BAD_PARAMETER, null);\r
+                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,\r
+                                       "Mapping of request to JSON object failed");\r
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
+                       return response;\r
+               }\r
+\r
+               mapReqJsonToSvcInstReq(e2eSir, requestJSON);\r
+               sir.getRequestDetails().getRequestParameters().setaLaCarte(true);\r
+               try {\r
+                       msoRequest.parse(sir, instanceIdMap, action, version);\r
+               } catch (Exception e) {\r
+                       msoLogger.debug("Validation failed: ", e);\r
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,\r
+                                       MsoException.ServiceException, "Error parsing request.  " + e.getMessage(),\r
+                                       ErrorNumbers.SVC_BAD_PARAMETER, null);\r
+                       if (msoRequest.getRequestId() != null) {\r
+                               msoLogger.debug("Logging failed message to the database");\r
+                               //TODO update the service name\r
+                         this.createOperationStatusRecordForError(action, requestId);\r
+                       }\r
+                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,\r
+                                       "Validation of the input request failed");\r
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
+                       return response;\r
+               }\r
+               \r
+               OperationStatus dup = null;\r
+               String instanceName = sir.getRequestDetails().getRequestInfo().getInstanceName();\r
+               String requestScope = sir.getRequestDetails().getModelInfo().getModelType().name();\r
+               try {\r
+                       if (!(instanceName == null && "service".equals(requestScope)\r
+                                       && (action == Action.createInstance || action == Action.activateInstance))) {\r
+                         //TODO : Need to check for the duplicate record from the operation status,\r
+                         //TODO : commenting this check for unblocking current testing for now...  induces dead code...\r
+                               dup = chkDuplicateServiceNameInOperStatus( instanceName);\r
+                       }\r
+               } catch (Exception e) {\r
+                       msoLogger.error(MessageEnum.APIH_DUPLICATE_CHECK_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.DataError, "Error during duplicate check ", e);\r
+\r
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,\r
+                                       MsoException.ServiceException, e.getMessage(), ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);\r
+\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,\r
+                                       "Error during duplicate check");\r
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
+                       return response;\r
+               }\r
+\r
+               if (dup != null) {\r
+                       // Found the duplicate record. Return the appropriate error.\r
+                       String instance = null;\r
+                       if (instanceName != null) {\r
+                               instance = instanceName;\r
+                       } else {\r
+                               instance = instanceIdMap.get(requestScope + "InstanceId");\r
+                       }\r
+                       String dupMessage = "Error: Locked instance - This " + requestScope + " (" + instance + ") "\r
+                                       + "already has a request being worked with a status of " + dup.getProgress() + " (ServiceId - "\r
+                                       + dup.getServiceId() + "). The existing request must finish or be cleaned up before proceeding.";\r
+\r
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_CONFLICT,\r
+                                       MsoException.ServiceException, dupMessage, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);\r
+\r
+                       msoLogger.warn(MessageEnum.APIH_DUPLICATE_FOUND, dupMessage, "", "", MsoLogger.ErrorCode.SchemaError,\r
+                                       "Duplicate request - Subscriber already has a request for this service");\r
+                       \r
+                       \r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict,\r
+                                       dupMessage);\r
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
+                       createOperationStatusRecordForError(action, requestId);\r
+                       return response;\r
+               }\r
+               \r
+               CatalogDatabase db = null;\r
+               RecipeLookupResult recipeLookupResult = null;\r
+               try {\r
+                       db = CatalogDatabase.getInstance();\r
+                       recipeLookupResult = getServiceInstanceOrchestrationURI(db, e2eSir.getService().getTemplateId(), action);\r
+               } catch (Exception e) {\r
+                       msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.AvailabilityError, "Exception while communciate with Catalog DB", e);\r
+                       msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,\r
+                                       MsoException.ServiceException, "No communication to catalog DB " + e.getMessage(),\r
+                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
+                       alarmLogger.sendAlarm("MsoDatabaseAccessError", MsoAlarmLogger.CRITICAL,\r
+                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));\r
+                       \r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,\r
+                                       "Exception while communciate with DB");\r
+                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());\r
+                       createOperationStatusRecordForError(action, requestId);\r
+                       return response;\r
+               } finally {\r
+                       closeCatalogDB(db);\r
+               }\r
+\r
+               if (recipeLookupResult == null) {\r
+                       msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.DataError, "No recipe found in DB");\r
+                       msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,\r
+                                       MsoException.ServiceException, "Recipe does not exist in catalog DB",\r
+                                       ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);\r
+               \r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,\r
+                                       "No recipe found in DB");\r
+                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());\r
+                       createOperationStatusRecordForError(action, requestId);\r
+                       return response;\r
+               }\r
+//             try {\r
+//                     msoRequest.createRequestRecord(Status.PENDING, action);\r
+//                     //createOperationStatusRecord(action, requestId);\r
+//             } catch (Exception e) {\r
+//                     msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC_REASON, "Exception while creating record in DB", "", "",\r
+//                                     MsoLogger.ErrorCode.SchemaError, "Exception while creating record in DB", e);\r
+//                     msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
+//                     Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,\r
+//                                     MsoException.ServiceException, "Exception while creating record in DB " + e.getMessage(),\r
+//                                     ErrorNumbers.SVC_BAD_PARAMETER, null);\r
+//                     msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,\r
+//                                     "Exception while creating record in DB");\r
+//                     msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
+//                     return response;\r
+//             }\r
+\r
+               String serviceInstanceType = e2eSir.getService().getParameters().getServiceType();\r
+\r
+               String serviceId = "";\r
+               RequestClient requestClient = null;\r
+               HttpResponse response = null;\r
+\r
+               long subStartTime = System.currentTimeMillis();\r
+               String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);\r
+\r
+               try {\r
+                       requestClient = RequestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI(),\r
+                                       MsoPropertiesUtils.loadMsoProperties());\r
+\r
+                       // Capture audit event\r
+                       msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());\r
+\r
+                       response = requestClient.post(requestId, false, recipeLookupResult.getRecipeTimeout(), action.name(),\r
+                                       serviceId, null, null, null, null, serviceInstanceType, null, null, null, sirRequestJson, recipeLookupResult.getRecipeParamXsd());\r
+\r
+                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,\r
+                                       "Successfully received response from BPMN engine", "BPMN", recipeLookupResult.getOrchestrationURI(),\r
+                                       null);\r
+               } catch (Exception e) {\r
+                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.ERROR,\r
+                                       MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine", "BPMN",\r
+                                       recipeLookupResult.getOrchestrationURI(), null);\r
+                       Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,\r
+                                       MsoException.ServiceException, "Failed calling bpmn " + e.getMessage(),\r
+                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
+                       alarmLogger.sendAlarm("MsoConfigurationError", MsoAlarmLogger.CRITICAL,\r
+                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));\r
+                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine");\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,\r
+                                       "Exception while communicate with BPMN engine");\r
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) resp.getEntity());\r
+                       createOperationStatusRecordForError(action, requestId);\r
+                       return resp;\r
+               }\r
+\r
+               if (response == null) {\r
+                       Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,\r
+                                       MsoException.ServiceException, "bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
+                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
+                                       MsoLogger.ErrorCode.BusinessProcesssError, "Null response from BPEL");\r
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError,\r
+                                       "Null response from BPMN");\r
+                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity());\r
+                       return resp;\r
+               }\r
+\r
+               ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());\r
+               int bpelStatus = respHandler.getStatus();\r
+\r
+               return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus, action, instanceIdMap);\r
+       }\r
+\r
+       private void closeCatalogDB(CatalogDatabase db) {\r
+               if (db != null) {\r
+                       db.close();\r
+               }\r
+       }\r
+\r
+       private Response beplStatusUpdate(String requestId, long startTime,\r
+                       MsoRequest msoRequest, RequestClient requestClient,\r
+                       ResponseHandler respHandler, int bpelStatus, Action action,\r
+                       HashMap<String, String> instanceIdMap) {\r
+               // BPMN accepted the request, the request is in progress\r
+               if (bpelStatus == HttpStatus.SC_ACCEPTED) {\r
+                       String camundaJSONResponseBody = respHandler.getResponseBody();\r
+                       msoLogger\r
+                                       .debug("Received from Camunda: " + camundaJSONResponseBody);\r
+\r
+                       // currently only for delete case we update the status here\r
+                       if (action == Action.deleteInstance) {\r
+                               ObjectMapper mapper = new ObjectMapper();\r
+                               try {\r
+                                       DelE2ESvcResp jo = mapper.readValue(\r
+                                                       camundaJSONResponseBody, DelE2ESvcResp.class);\r
+                                       String operationId = jo.getOperationId();\r
+                               this.createOperationStatusRecord("DELETE", requestId,\r
+                                                               operationId);\r
+                               } catch (Exception ex) {\r
+                                       msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,\r
+                                                       requestClient.getUrl(), "", "",\r
+                                                       MsoLogger.ErrorCode.BusinessProcesssError,\r
+                                                       "Response from BPEL engine is failed with HTTP Status="\r
+                                                                       + bpelStatus);\r
+                               }\r
+                       }\r
+                       msoLogger.recordAuditEvent(startTime,\r
+                                       MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,\r
+                                       "BPMN accepted the request, the request is in progress");\r
+                       msoLogger.debug(END_OF_THE_TRANSACTION + camundaJSONResponseBody);\r
+                       return Response.status(HttpStatus.SC_ACCEPTED)\r
+                                       .entity(camundaJSONResponseBody).build();\r
+               } else {\r
+                       List<String> variables = new ArrayList<>();\r
+                       variables.add(bpelStatus + "");\r
+                       String camundaJSONResponseBody = respHandler.getResponseBody();\r
+                       if (camundaJSONResponseBody != null\r
+                                       && !camundaJSONResponseBody.isEmpty()) {\r
+                               Response resp = msoRequest.buildServiceErrorResponse(\r
+                                               bpelStatus, MsoException.ServiceException,\r
+                                               "Request Failed due to BPEL error with HTTP Status= %1 "\r
+                                                               + '\n' + camundaJSONResponseBody,\r
+                                               ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, variables);\r
+                               msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,\r
+                                               requestClient.getUrl(), "", "",\r
+                                               MsoLogger.ErrorCode.BusinessProcesssError,\r
+                                               "Response from BPEL engine is failed with HTTP Status="\r
+                                                               + bpelStatus);\r
+                               msoLogger.recordAuditEvent(startTime,\r
+                                               MsoLogger.StatusCode.ERROR,\r
+                                               MsoLogger.ResponseCode.InternalError,\r
+                                               "Response from BPMN engine is failed");\r
+                               msoLogger.debug(END_OF_THE_TRANSACTION\r
+                                               + (String) resp.getEntity());\r
+                               return resp;\r
+                       } else {\r
+                               Response resp = msoRequest\r
+                                               .buildServiceErrorResponse(\r
+                                                               bpelStatus,\r
+                                                               MsoException.ServiceException,\r
+                                                               "Request Failed due to BPEL error with HTTP Status= %1",\r
+                                                               ErrorNumbers.SVC_DETAILED_SERVICE_ERROR,\r
+                                                               variables);\r
+                               msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,\r
+                                               requestClient.getUrl(), "", "",\r
+                                               MsoLogger.ErrorCode.BusinessProcesssError,\r
+                                               "Response from BPEL engine is empty");\r
+                               msoLogger.recordAuditEvent(startTime,\r
+                                               MsoLogger.StatusCode.ERROR,\r
+                                               MsoLogger.ResponseCode.InternalError,\r
+                                               "Response from BPEL engine is empty");\r
+                               msoLogger.debug(END_OF_THE_TRANSACTION\r
+                                               + (String) resp.getEntity());\r
+                               return resp;\r
+                       }\r
+               }\r
+       }\r
+\r
+       /**\r
+        * Getting recipes from catalogDb\r
+        * \r
+        * @param db the catalog db\r
+        * @param serviceModelUUID the service model version uuid\r
+        * @param action the action for the service\r
+        * @return the service recipe result\r
+        */\r
+       private RecipeLookupResult getServiceInstanceOrchestrationURI(\r
+                       CatalogDatabase db, String serviceModelUUID, Action action) {\r
+\r
+               RecipeLookupResult recipeLookupResult = getServiceURI(db, serviceModelUUID, action);\r
+\r
+               if (recipeLookupResult != null) {\r
+                       msoLogger.debug("Orchestration URI is: "\r
+                                       + recipeLookupResult.getOrchestrationURI()\r
+                                       + ", recipe Timeout is: "\r
+                                       + Integer.toString(recipeLookupResult.getRecipeTimeout()));\r
+               } else {\r
+                       msoLogger.debug("No matching recipe record found");\r
+               }\r
+               return recipeLookupResult;\r
+       }\r
+\r
+       /**\r
+        * Getting recipes from catalogDb\r
+        * If Service recipe is not set, use default recipe, if set , use special recipe.\r
+        * @param db the catalog db\r
+        * @param serviceModelUUID the service version uuid\r
+        * @param action the action of the service.\r
+        * @return the service recipe result.\r
+        */\r
+       private RecipeLookupResult getServiceURI(CatalogDatabase db, String serviceModelUUID, Action action) {\r
+\r
+               String defaultServiceModelName = "UUI_DEFAULT";\r
+\r
+               Service defaultServiceRecord = db\r
+                               .getServiceByModelName(defaultServiceModelName);\r
+               ServiceRecipe defaultRecipe = db.getServiceRecipeByModelUUID(\r
+                       defaultServiceRecord.getModelUUID(), action.name());\r
+               //set recipe as default generic recipe\r
+               ServiceRecipe recipe = defaultRecipe;\r
+               //check the service special recipe \r
+               if(null != serviceModelUUID && ! serviceModelUUID.isEmpty()){\r
+                     ServiceRecipe serviceSpecialRecipe = db.getServiceRecipeByModelUUID(\r
+                             serviceModelUUID, action.name());\r
+                     if(null != serviceSpecialRecipe){\r
+                         //set service special recipe.\r
+                         recipe = serviceSpecialRecipe;\r
+                     }\r
+               }       \r
+               \r
+               if (recipe == null) {\r
+                       return null;\r
+               }\r
+               return new RecipeLookupResult(recipe.getOrchestrationUri(),\r
+                               recipe.getRecipeTimeout(), recipe.getServiceParamXSD());\r
+\r
+       }\r
+\r
+       /**\r
+        * Converting E2EServiceInstanceRequest to ServiceInstanceRequest and\r
+        * passing it to camunda engine.\r
+        * \r
+        * @param e2eSir\r
+        * @return\r
+        */\r
+       private String mapReqJsonToSvcInstReq(E2EServiceInstanceRequest e2eSir,\r
+                       String requestJSON) {\r
+\r
+               sir = new ServiceInstancesRequest();\r
+\r
+               String returnString = null;\r
+               RequestDetails requestDetails = new RequestDetails();\r
+               ModelInfo modelInfo = new ModelInfo();\r
+\r
+               // ModelInvariantId\r
+               modelInfo.setModelInvariantId(e2eSir.getService().getServiceDefId());\r
+\r
+               // modelNameVersionId\r
+               modelInfo.setModelNameVersionId(e2eSir.getService().getTemplateId());\r
+\r
+               // String modelInfoValue =\r
+               // e2eSir.getService().getParameters().getNodeTemplateName();\r
+               // String[] arrayOfInfo = modelInfoValue.split(":");\r
+               // String modelName = arrayOfInfo[0];\r
+               // String modelVersion = arrayOfInfo[1];\r
+\r
+               // TODO: To ensure, if we dont get the values from the UUI\r
+               String modelName = "voLTE";\r
+               String modelVersion = "1.0";\r
+               // modelName\r
+               modelInfo.setModelName(modelName);\r
+\r
+               // modelVersion\r
+               modelInfo.setModelVersion(modelVersion);\r
+\r
+               // modelType\r
+               modelInfo.setModelType(ModelType.service);\r
+\r
+               // setting modelInfo to requestDetails\r
+               requestDetails.setModelInfo(modelInfo);\r
+\r
+               SubscriberInfo subscriberInfo = new SubscriberInfo();\r
+\r
+               // globalsubscriberId\r
+               subscriberInfo.setGlobalSubscriberId(e2eSir.getService()\r
+                               .getParameters().getGlobalSubscriberId());\r
+\r
+               // subscriberName\r
+               subscriberInfo.setSubscriberName(e2eSir.getService().getParameters()\r
+                               .getSubscriberName());\r
+\r
+               // setting subscriberInfo to requestDetails\r
+               requestDetails.setSubscriberInfo(subscriberInfo);\r
+\r
+               RequestInfo requestInfo = new RequestInfo();\r
+\r
+               // instanceName\r
+               requestInfo.setInstanceName(e2eSir.getService().getName());\r
+\r
+               // source\r
+               requestInfo.setSource("UUI");\r
+\r
+               // suppressRollback\r
+               requestInfo.setSuppressRollback(true);\r
+\r
+               // setting requestInfo to requestDetails\r
+               requestDetails.setRequestInfo(requestInfo);\r
+\r
+               RequestParameters requestParameters = new RequestParameters();\r
+\r
+               // subscriptionServiceType\r
+               requestParameters.setSubscriptionServiceType("MOG");\r
+\r
+               // Userparams\r
+               List<E2EUserParam> userParams;\r
+               // userParams =\r
+               // e2eSir.getService().getParameters().getRequestParameters().getUserParams();\r
+               List<Map<String, String>> userParamList = new ArrayList<>();\r
+               Map<String, String> userParamMap = new HashMap<>();\r
+               // complete json request updated in the camunda\r
+               userParamMap.put("UUIRequest", requestJSON);\r
+               userParamMap.put("ServiceInstanceName", e2eSir.getService().getName());\r
+\r
+               // Map<String, String> userParamMap3 = null;\r
+               // for (E2EUserParam userp : userParams) {\r
+               // userParamMap.put(userp.getName(), userp.getValue());\r
+               //\r
+               // }\r
+               userParamList.add(userParamMap);\r
+               requestParameters.setUserParams(userParamList);\r
+\r
+               // setting requestParameters to requestDetails\r
+               requestDetails.setRequestParameters(requestParameters);\r
+\r
+               sir.setRequestDetails(requestDetails);\r
+\r
+               // converting to string\r
+               ObjectMapper mapper = new ObjectMapper();\r
+               try {\r
+                       returnString = mapper.writeValueAsString(sir);\r
+               } catch (IOException e) {\r
+                       msoLogger\r
+                                       .debug("Exception while converting ServiceInstancesRequest object to string",\r
+                                                       e);\r
+               }\r
+\r
+               return returnString;\r
+       }\r
+\r
+       private void createOperationStatusRecordForError(Action action,\r
+                       String requestId) throws MsoDatabaseException {\r
+\r
+               AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager();\r
+\r
+               Session session = null;\r
+               try {\r
+\r
+                       session = requestsDbSessionFactoryManager.getSessionFactory()\r
+                                       .openSession();\r
+                       session.beginTransaction();\r
+\r
+                       OperationStatus os = new OperationStatus();\r
+                       os.setOperation(action.name());\r
+                       os.setOperationContent("");\r
+                       os.setOperationId("");\r
+                       os.setProgress("100");\r
+                       os.setReason("");\r
+                       os.setResult("error");\r
+                       os.setServiceId(requestId);\r
+                       os.setUserId("");\r
+                       Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());\r
+                       Timestamp endTimeStamp = new Timestamp(System.currentTimeMillis());\r
+                       os.setFinishedAt(endTimeStamp);\r
+                       os.setOperateAt(startTimeStamp);\r
+\r
+                       session.save(os);\r
+                       session.getTransaction().commit();\r
+\r
+               } catch (Exception e) {\r
+                       msoLogger.error(MessageEnum.APIH_DB_INSERT_EXC, "", "",\r
+                                       MsoLogger.ErrorCode.DataError,\r
+                                       "Exception when creation record request in Operation", e);\r
+                       throw new MsoDatabaseException(\r
+                                       "Data did inserted in Operatus Status Table for failure", e);\r
+               } finally {\r
+                       if (null != session) {\r
+                               session.close();\r
+                       }\r
+               }\r
+       }\r
+\r
+       private void createOperationStatusRecord(String actionNm, String serviceId,\r
+                       String operationId) throws MsoDatabaseException {\r
+\r
+               AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager();\r
+\r
+               Session session = null;\r
+               try {\r
+\r
+                       session = requestsDbSessionFactoryManager.getSessionFactory()\r
+                                       .openSession();\r
+                       session.beginTransaction();\r
+\r
+                       OperationStatus os = new OperationStatus();\r
+                       os.setOperation(actionNm);\r
+                       os.setOperationContent("");\r
+                       os.setOperationId(operationId);\r
+                       os.setProgress("0");\r
+                       os.setReason("");\r
+                       os.setResult("processing");\r
+                       os.setServiceId(serviceId);\r
+                       // TODO : to be updated...\r
+                       os.setUserId("");\r
+                       Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());\r
+                       Timestamp endTimeStamp = new Timestamp(System.currentTimeMillis());\r
+                       os.setFinishedAt(endTimeStamp);\r
+                       os.setOperateAt(startTimeStamp);\r
+\r
+                       session.save(os);\r
+                       session.getTransaction().commit();\r
+\r
+               } catch (Exception e) {\r
+                       msoLogger.error(MessageEnum.APIH_DB_INSERT_EXC, "", "",\r
+                                       MsoLogger.ErrorCode.DataError,\r
+                                       "Exception when creation record request in Operation", e);\r
+                       throw new MsoDatabaseException(\r
+                                       "Data did inserted in Operatus Status Table", e);\r
+               } finally {\r
+                       if (null != session) {\r
+                               session.close();\r
+                       }\r
+               }\r
+       }\r
+\r
+       private OperationStatus chkSvcInstOperStatusbySvcId(String serviceId) {\r
+               OperationStatus svcInstanceOperStatus = (RequestsDatabase.getInstance())\r
+                               .getOperationStatusByServiceId(serviceId);\r
+\r
+               return svcInstanceOperStatus;\r
+       }\r
+\r
+       private OperationStatus chkDuplicateServiceNameInOperStatus(\r
+                       String serviceName) {\r
+               OperationStatus dupServiceName = (RequestsDatabase.getInstance())\r
+                               .getOperationStatusByServiceName(serviceName);\r
+\r
+               return dupServiceName;\r
+       }\r
 }
\ No newline at end of file
index ad76a15..79ac76f 100644 (file)
@@ -252,15 +252,12 @@ public class MsoRequest {
         }
 
         RequestParameters requestParameters = sir.getRequestDetails().getRequestParameters();
-        if(this.reqVersion >= 3){
-               if(requestParameters!=null){
-                       this.aLaCarteFlag = sir.getRequestDetails().getRequestParameters().isaLaCarte();
-               }else{
-                       this.aLaCarteFlag = false;
-               }
-        }else{
-               this.aLaCarteFlag = true;
-        }
+               if (this.reqVersion >= 3) {
+                       this.aLaCarteFlag =
+                               requestParameters != null && sir.getRequestDetails().getRequestParameters().isaLaCarte();
+               } else {
+                       this.aLaCarteFlag = true;
+               }
 
                if(requestParameters != null && (reqVersion < 3) && requestParameters.getAutoBuildVfModules()){
                throw new ValidationException("AutoBuildVfModule", version);
index 4e1468c..2c7bd1c 100644 (file)
@@ -130,33 +130,35 @@ public class NetworkInfoHandler {
         if (ar.getVnfType () != null) {
             vi.setNetworkType (ar.getVnfType ());
         }
-        if (version.equals(Constants.SCHEMA_VERSION_V1)) {
-               if (ar.getServiceType () != null) {
-                       vi.setServiceType (ar.getServiceType ());
-               }
-               if (ar.getAicNodeClli () != null) {
-                       vi.setAicNodeClli (ar.getAicNodeClli ());
-               }
-        }
-        else if (version.equals(Constants.SCHEMA_VERSION_V2)) {
-               if (ar.getAaiServiceId () != null) {
-                       vi.setServiceId (ar.getAaiServiceId ());
-               }
-               if (ar.getAicCloudRegion () != null) {
-                       vi.setAicCloudRegion (ar.getAicCloudRegion ());
-               }
-        }
-        else if (version.equals(Constants.SCHEMA_VERSION_V3)) {
-               if (ar.getAaiServiceId () != null) {
-                       vi.setServiceId (ar.getAaiServiceId ());
-               }
-               if (ar.getAicCloudRegion () != null) {
-                       vi.setAicCloudRegion (ar.getAicCloudRegion ());
-               }
-               if (ar.getServiceInstanceId () != null) {
-                       vi.setServiceInstanceId (ar.getServiceInstanceId ());
-               }
-                               
+        switch (version) {
+            case Constants.SCHEMA_VERSION_V1:
+                if (ar.getServiceType() != null) {
+                    vi.setServiceType(ar.getServiceType());
+                }
+                if (ar.getAicNodeClli() != null) {
+                    vi.setAicNodeClli(ar.getAicNodeClli());
+                }
+                break;
+            case Constants.SCHEMA_VERSION_V2:
+                if (ar.getAaiServiceId() != null) {
+                    vi.setServiceId(ar.getAaiServiceId());
+                }
+                if (ar.getAicCloudRegion() != null) {
+                    vi.setAicCloudRegion(ar.getAicCloudRegion());
+                }
+                break;
+            case Constants.SCHEMA_VERSION_V3:
+                if (ar.getAaiServiceId() != null) {
+                    vi.setServiceId(ar.getAaiServiceId());
+                }
+                if (ar.getAicCloudRegion() != null) {
+                    vi.setAicCloudRegion(ar.getAicCloudRegion());
+                }
+                if (ar.getServiceInstanceId() != null) {
+                    vi.setServiceInstanceId(ar.getServiceInstanceId());
+                }
+
+                break;
         }
         
         if (ar.getTenantId () != null) {
index c87b4f3..3d41992 100644 (file)
@@ -147,24 +147,27 @@ public class NetworkMsoInfraRequest {
         }
         
         // Verify that the elements correspond to the version
-        
-        if (version.equals(Constants.SCHEMA_VERSION_V1)) {
-                       if (this.networkInputs.getBackoutOnFailure() != null || this.networkInputs.getAicCloudRegion() != null ||
-                                       this.networkInputs.getServiceInstanceId() != null) {
-                               throw new ValidationException ("format for v1 version of network request");
-                       }
-        }
-        else if (version.equals(Constants.SCHEMA_VERSION_V2)) {
-                       if (this.networkInputs.getServiceType() != null || this.networkInputs.getAicNodeClli() != null ||
-                                       this.networkInputs.getServiceInstanceId() != null) {
-                               throw new ValidationException ("format for v2 version of network request");
-                       }
+
+        switch (version) {
+            case Constants.SCHEMA_VERSION_V1:
+                if (this.networkInputs.getBackoutOnFailure() != null || this.networkInputs.getAicCloudRegion() != null
+                    ||
+                    this.networkInputs.getServiceInstanceId() != null) {
+                    throw new ValidationException("format for v1 version of network request");
+                }
+                break;
+            case Constants.SCHEMA_VERSION_V2:
+                if (this.networkInputs.getServiceType() != null || this.networkInputs.getAicNodeClli() != null ||
+                    this.networkInputs.getServiceInstanceId() != null) {
+                    throw new ValidationException("format for v2 version of network request");
+                }
+                break;
+            case Constants.SCHEMA_VERSION_V3:
+                if (this.networkInputs.getServiceType() != null || this.networkInputs.getAicNodeClli() != null) {
+                    throw new ValidationException("format for v3 version of network request");
+                }
+                break;
         }
-        else if (version.equals(Constants.SCHEMA_VERSION_V3)) {
-               if (this.networkInputs.getServiceType() != null || this.networkInputs.getAicNodeClli() != null) {
-                       throw new ValidationException ("format for v3 version of network request");
-               }
-    }
 
         switch (action) {            
             case UPDATE:
index 79247de..6a77020 100644 (file)
@@ -158,33 +158,35 @@ public class NetworkRequestHandler {
         if (ar.getVnfType () != null) {
             vi.setNetworkType (ar.getVnfType ());
         }
-        if (version.equals(Constants.SCHEMA_VERSION_V1)) {
-               if (ar.getServiceType () != null) {
-                       vi.setServiceType (ar.getServiceType ());
-               }
-               if (ar.getAicNodeClli () != null) {
-                       vi.setAicNodeClli (ar.getAicNodeClli ());
-               }
-        }
-        else if (version.equals(Constants.SCHEMA_VERSION_V2)) {
-               if (ar.getAaiServiceId () != null) {
-                       vi.setServiceId (ar.getAaiServiceId ());
-               }
-               if (ar.getAicCloudRegion () != null) {
-                       vi.setAicCloudRegion (ar.getAicCloudRegion ());
-               }
-        }
-        else if (version.equals(Constants.SCHEMA_VERSION_V3)) {
-               if (ar.getAaiServiceId () != null) {
-                       vi.setServiceId (ar.getAaiServiceId ());
-               }
-               if (ar.getAicCloudRegion () != null) {
-                       vi.setAicCloudRegion (ar.getAicCloudRegion ());
-               }
-               if (ar.getServiceInstanceId () != null) {
-                       vi.setServiceInstanceId (ar.getServiceInstanceId ());
-               }
-                               
+        switch (version) {
+            case Constants.SCHEMA_VERSION_V1:
+                if (ar.getServiceType() != null) {
+                    vi.setServiceType(ar.getServiceType());
+                }
+                if (ar.getAicNodeClli() != null) {
+                    vi.setAicNodeClli(ar.getAicNodeClli());
+                }
+                break;
+            case Constants.SCHEMA_VERSION_V2:
+                if (ar.getAaiServiceId() != null) {
+                    vi.setServiceId(ar.getAaiServiceId());
+                }
+                if (ar.getAicCloudRegion() != null) {
+                    vi.setAicCloudRegion(ar.getAicCloudRegion());
+                }
+                break;
+            case Constants.SCHEMA_VERSION_V3:
+                if (ar.getAaiServiceId() != null) {
+                    vi.setServiceId(ar.getAaiServiceId());
+                }
+                if (ar.getAicCloudRegion() != null) {
+                    vi.setAicCloudRegion(ar.getAicCloudRegion());
+                }
+                if (ar.getServiceInstanceId() != null) {
+                    vi.setServiceInstanceId(ar.getServiceInstanceId());
+                }
+
+                break;
         }
         
         if (ar.getTenantId () != null) {
index a5e1f6f..d13212a 100644 (file)
@@ -148,50 +148,52 @@ public class VnfInfoHandler {
         if (ar.getVolumeGroupId () != null) {
                vi.setVolumeGroupId (ar.getVolumeGroupId ());
         }
-        if (version.equals(Constants.SCHEMA_VERSION_V1)) {
-               if (ar.getServiceType () != null) {
-                       vi.setServiceType (ar.getServiceType ());
-               }
-               if (ar.getAicNodeClli () != null) {
-                       vi.setAicNodeClli (ar.getAicNodeClli ());
-               }
-        }
-        else if (version.equals(Constants.SCHEMA_VERSION_V2)) {
-               if (ar.getAaiServiceId () != null) {
-                       vi.setServiceId (ar.getAaiServiceId ());
-               }
-               if (ar.getAicCloudRegion () != null) {
-                       vi.setAicCloudRegion (ar.getAicCloudRegion ());
-               }
-               if (ar.getVfModuleName () != null) {
-                       vi.setVfModuleName (ar.getVfModuleName ());
-               }
-               if (ar.getVfModuleId () != null) {
-                       vi.setVfModuleId (ar.getVfModuleId ());
-               }
-               if (ar.getVfModuleModelName () != null) {
-                       vi.setVfModuleModelName (ar.getVfModuleModelName ());
-               }               
-        }
-        else if (version.equals(Constants.SCHEMA_VERSION_V3)) {
-               if (ar.getAaiServiceId () != null) {
-                       vi.setServiceId (ar.getAaiServiceId ());
-               }
-               if (ar.getAicCloudRegion () != null) {
-                       vi.setAicCloudRegion (ar.getAicCloudRegion ());
-               }
-               if (ar.getVfModuleName () != null) {
-                       vi.setVfModuleName (ar.getVfModuleName ());
-               }
-               if (ar.getVfModuleId () != null) {
-                       vi.setVfModuleId (ar.getVfModuleId ());
-               }
-               if (ar.getVfModuleModelName () != null) {
-                       vi.setVfModuleModelName (ar.getVfModuleModelName ());
-               }
-               if (ar.getServiceInstanceId () != null) {
-                       vi.setServiceInstanceId (ar.getServiceInstanceId ());
-               }
+        switch (version) {
+            case Constants.SCHEMA_VERSION_V1:
+                if (ar.getServiceType() != null) {
+                    vi.setServiceType(ar.getServiceType());
+                }
+                if (ar.getAicNodeClli() != null) {
+                    vi.setAicNodeClli(ar.getAicNodeClli());
+                }
+                break;
+            case Constants.SCHEMA_VERSION_V2:
+                if (ar.getAaiServiceId() != null) {
+                    vi.setServiceId(ar.getAaiServiceId());
+                }
+                if (ar.getAicCloudRegion() != null) {
+                    vi.setAicCloudRegion(ar.getAicCloudRegion());
+                }
+                if (ar.getVfModuleName() != null) {
+                    vi.setVfModuleName(ar.getVfModuleName());
+                }
+                if (ar.getVfModuleId() != null) {
+                    vi.setVfModuleId(ar.getVfModuleId());
+                }
+                if (ar.getVfModuleModelName() != null) {
+                    vi.setVfModuleModelName(ar.getVfModuleModelName());
+                }
+                break;
+            case Constants.SCHEMA_VERSION_V3:
+                if (ar.getAaiServiceId() != null) {
+                    vi.setServiceId(ar.getAaiServiceId());
+                }
+                if (ar.getAicCloudRegion() != null) {
+                    vi.setAicCloudRegion(ar.getAicCloudRegion());
+                }
+                if (ar.getVfModuleName() != null) {
+                    vi.setVfModuleName(ar.getVfModuleName());
+                }
+                if (ar.getVfModuleId() != null) {
+                    vi.setVfModuleId(ar.getVfModuleId());
+                }
+                if (ar.getVfModuleModelName() != null) {
+                    vi.setVfModuleModelName(ar.getVfModuleModelName());
+                }
+                if (ar.getServiceInstanceId() != null) {
+                    vi.setServiceInstanceId(ar.getServiceInstanceId());
+                }
+                break;
         }
         qr.setVnfInputs (vi);
 
index 80d0c48..1f3008a 100644 (file)
@@ -157,26 +157,29 @@ public class VnfMsoInfraRequest {
                 throw new ValidationException ("format for vnf request");              
         }
         // Verify that the elements correspond to the version
-        
-               
-        if (version.equals(Constants.SCHEMA_VERSION_V1)) {
-                       if (this.vnfInputs.getVfModuleName () != null || this.vnfInputs.getVfModuleId () != null ||
-                                       this.vnfInputs.getVfModuleModelName () != null || this.vnfInputs.getAsdcServiceModelVersion () != null ||
-                                       this.vnfInputs.getBackoutOnFailure() != null || this.vnfInputs.getAicCloudRegion() != null ||
-                                       this.vnfInputs.getServiceInstanceId  () != null) {
-                               throw new ValidationException ("format for v1 version of vnf request");
-                       }
-        }
-        else if (version.equals(Constants.SCHEMA_VERSION_V2)) {
-                       if (this.vnfInputs.getServiceType() != null || this.vnfInputs.getAicNodeClli() != null || this.vnfInputs.getServiceInstanceId  () != null) {
-                               throw new ValidationException ("format for v2 version of vnf request");
-                       }
+
+        switch (version) {
+            case Constants.SCHEMA_VERSION_V1:
+                if (this.vnfInputs.getVfModuleName() != null || this.vnfInputs.getVfModuleId() != null ||
+                    this.vnfInputs.getVfModuleModelName() != null || this.vnfInputs.getAsdcServiceModelVersion() != null
+                    ||
+                    this.vnfInputs.getBackoutOnFailure() != null || this.vnfInputs.getAicCloudRegion() != null ||
+                    this.vnfInputs.getServiceInstanceId() != null) {
+                    throw new ValidationException("format for v1 version of vnf request");
+                }
+                break;
+            case Constants.SCHEMA_VERSION_V2:
+                if (this.vnfInputs.getServiceType() != null || this.vnfInputs.getAicNodeClli() != null
+                    || this.vnfInputs.getServiceInstanceId() != null) {
+                    throw new ValidationException("format for v2 version of vnf request");
+                }
+                break;
+            case Constants.SCHEMA_VERSION_V3:
+                if (this.vnfInputs.getServiceType() != null || this.vnfInputs.getAicNodeClli() != null) {
+                    throw new ValidationException("format for v3 version of vnf request");
+                }
+                break;
         }
-        else if (version.equals(Constants.SCHEMA_VERSION_V3)) {
-               if (this.vnfInputs.getServiceType() != null || this.vnfInputs.getAicNodeClli() != null) {
-                       throw new ValidationException ("format for v3 version of vnf request");
-               }
-    }
         
         
         if (!InfraUtils.isActionAllowed (props, "vnf", version, action.value ())) {
index 7a61c64..098ed31 100644 (file)
@@ -179,50 +179,52 @@ public class VnfRequestHandler {
         if (ar.getVolumeGroupId () != null) {
                vi.setVolumeGroupId (ar.getVolumeGroupId ());
         }
-        if (version.equals(Constants.SCHEMA_VERSION_V1)) {
-               if (ar.getServiceType () != null) {
-                       vi.setServiceType (ar.getServiceType ());
-               }
-               if (ar.getAicNodeClli () != null) {
-                       vi.setAicNodeClli (ar.getAicNodeClli ());
-               }
-        }
-        else if (version.equals(Constants.SCHEMA_VERSION_V2)) {
-               if (ar.getAaiServiceId () != null) {
-                       vi.setServiceId (ar.getAaiServiceId ());
-               }
-               if (ar.getAicCloudRegion () != null) {
-                       vi.setAicCloudRegion (ar.getAicCloudRegion ());
-               }
-               if (ar.getVfModuleName () != null) {
-                       vi.setVfModuleName (ar.getVfModuleName ());
-               }
-               if (ar.getVfModuleId () != null) {
-                       vi.setVfModuleId (ar.getVfModuleId ());
-               }
-               if (ar.getVfModuleModelName () != null) {
-                       vi.setVfModuleModelName (ar.getVfModuleModelName ());
-               }               
-        }
-        else if (version.equals(Constants.SCHEMA_VERSION_V3)) {
-               if (ar.getAaiServiceId () != null) {
-                       vi.setServiceId (ar.getAaiServiceId ());
-               }
-               if (ar.getAicCloudRegion () != null) {
-                       vi.setAicCloudRegion (ar.getAicCloudRegion ());
-               }
-               if (ar.getVfModuleName () != null) {
-                       vi.setVfModuleName (ar.getVfModuleName ());
-               }
-               if (ar.getVfModuleId () != null) {
-                       vi.setVfModuleId (ar.getVfModuleId ());
-               }
-               if (ar.getVfModuleModelName () != null) {
-                       vi.setVfModuleModelName (ar.getVfModuleModelName ());
-               }
-               if (ar.getServiceInstanceId () != null) {
-                       vi.setServiceInstanceId (ar.getServiceInstanceId ());
-               }
+        switch (version) {
+            case Constants.SCHEMA_VERSION_V1:
+                if (ar.getServiceType() != null) {
+                    vi.setServiceType(ar.getServiceType());
+                }
+                if (ar.getAicNodeClli() != null) {
+                    vi.setAicNodeClli(ar.getAicNodeClli());
+                }
+                break;
+            case Constants.SCHEMA_VERSION_V2:
+                if (ar.getAaiServiceId() != null) {
+                    vi.setServiceId(ar.getAaiServiceId());
+                }
+                if (ar.getAicCloudRegion() != null) {
+                    vi.setAicCloudRegion(ar.getAicCloudRegion());
+                }
+                if (ar.getVfModuleName() != null) {
+                    vi.setVfModuleName(ar.getVfModuleName());
+                }
+                if (ar.getVfModuleId() != null) {
+                    vi.setVfModuleId(ar.getVfModuleId());
+                }
+                if (ar.getVfModuleModelName() != null) {
+                    vi.setVfModuleModelName(ar.getVfModuleModelName());
+                }
+                break;
+            case Constants.SCHEMA_VERSION_V3:
+                if (ar.getAaiServiceId() != null) {
+                    vi.setServiceId(ar.getAaiServiceId());
+                }
+                if (ar.getAicCloudRegion() != null) {
+                    vi.setAicCloudRegion(ar.getAicCloudRegion());
+                }
+                if (ar.getVfModuleName() != null) {
+                    vi.setVfModuleName(ar.getVfModuleName());
+                }
+                if (ar.getVfModuleId() != null) {
+                    vi.setVfModuleId(ar.getVfModuleId());
+                }
+                if (ar.getVfModuleModelName() != null) {
+                    vi.setVfModuleModelName(ar.getVfModuleModelName());
+                }
+                if (ar.getServiceInstanceId() != null) {
+                    vi.setServiceInstanceId(ar.getServiceInstanceId());
+                }
+                break;
         }
         qr.setVnfInputs (vi);
 
@@ -307,7 +309,7 @@ public class VnfRequestHandler {
                                                                                                    queryValue,
                                                                                                    getRequestType ());
 
-        List <VnfRequest> queryResponseList = new LinkedList <VnfRequest> ();
+        List <VnfRequest> queryResponseList = new LinkedList<>();
 
         if (activeReqList != null) {
             // build response for active
@@ -351,7 +353,7 @@ public class VnfRequestHandler {
     }
 
     private List <VnfRequest> infraRequestsResponses (List <? extends InfraRequests> arList, String version) {
-        List <VnfRequest> queryResponseList = new LinkedList <VnfRequest> ();
+        List <VnfRequest> queryResponseList = new LinkedList<>();
 
         for (InfraRequests ar : arList) {
             VnfRequest qr = fillGeneric (ar);
index 3de945a..c74bb07 100644 (file)
@@ -134,43 +134,45 @@ public class VolumeInfoHandler {
         if (ar.getVnfType () != null) {
             vi.setVnfType (ar.getVnfType ());
         }
-        
-        if (version.equals(Constants.SCHEMA_VERSION_V1)) {
-               if (ar.getServiceType () != null) {
-                       vi.setServiceType (ar.getServiceType ());
-               }
-               if (ar.getAicNodeClli () != null) {
-                       vi.setAicNodeClli (ar.getAicNodeClli ());
-               }
-        }
-        else if (version.equals(Constants.SCHEMA_VERSION_V2)) {
-               if (ar.getAaiServiceId () != null) {
-                       vi.setServiceId (ar.getAaiServiceId ());
-               }
-               if (ar.getAicCloudRegion () != null) {
-                       vi.setAicCloudRegion (ar.getAicCloudRegion ());
-               }               
-               if (ar.getVfModuleModelName () != null) {
-                       vi.setVfModuleModelName (ar.getVfModuleModelName ());
-               }               
-        }
-        else if (version.equals(Constants.SCHEMA_VERSION_V3)) {
-               if (ar.getAaiServiceId () != null) {
-                       vi.setServiceId (ar.getAaiServiceId ());
-               }
-               if (ar.getAicCloudRegion () != null) {
-                       vi.setAicCloudRegion (ar.getAicCloudRegion ());
-               }               
-               if (ar.getVfModuleModelName () != null) {
-                       vi.setVfModuleModelName (ar.getVfModuleModelName ());
-               }
-               if (ar.getServiceInstanceId () != null) {
-                       vi.setServiceInstanceId (ar.getServiceInstanceId ());
-               }
-               if (ar.getVnfId () != null) {
-                vi.setVnfId (ar.getVnfId ());
-            }
-        }
+
+         switch (version) {
+             case Constants.SCHEMA_VERSION_V1:
+                 if (ar.getServiceType() != null) {
+                     vi.setServiceType(ar.getServiceType());
+                 }
+                 if (ar.getAicNodeClli() != null) {
+                     vi.setAicNodeClli(ar.getAicNodeClli());
+                 }
+                 break;
+             case Constants.SCHEMA_VERSION_V2:
+                 if (ar.getAaiServiceId() != null) {
+                     vi.setServiceId(ar.getAaiServiceId());
+                 }
+                 if (ar.getAicCloudRegion() != null) {
+                     vi.setAicCloudRegion(ar.getAicCloudRegion());
+                 }
+                 if (ar.getVfModuleModelName() != null) {
+                     vi.setVfModuleModelName(ar.getVfModuleModelName());
+                 }
+                 break;
+             case Constants.SCHEMA_VERSION_V3:
+                 if (ar.getAaiServiceId() != null) {
+                     vi.setServiceId(ar.getAaiServiceId());
+                 }
+                 if (ar.getAicCloudRegion() != null) {
+                     vi.setAicCloudRegion(ar.getAicCloudRegion());
+                 }
+                 if (ar.getVfModuleModelName() != null) {
+                     vi.setVfModuleModelName(ar.getVfModuleModelName());
+                 }
+                 if (ar.getServiceInstanceId() != null) {
+                     vi.setServiceInstanceId(ar.getServiceInstanceId());
+                 }
+                 if (ar.getVnfId() != null) {
+                     vi.setVnfId(ar.getVnfId());
+                 }
+                 break;
+         }
         if (ar.getTenantId () != null) {
             vi.setTenantId (ar.getTenantId ());
         }
index 0524a85..f908a3f 100644 (file)
@@ -144,24 +144,27 @@ public class VolumeMsoInfraRequest {
 
         // Verify that the elements correspond to the version
 
-        if (version.equals(Constants.SCHEMA_VERSION_V1)) {
-               if (this.volumeInputs.getBackoutOnFailure() != null || this.volumeInputs.getAicCloudRegion() != null ||
-                               this.volumeInputs.getVfModuleModelName () != null || this.volumeInputs.getAsdcServiceModelVersion () != null ||
-                               this.volumeInputs.getServiceInstanceId () != null || this.volumeInputs.getVnfId () != null) {
-                       throw new ValidationException ("format for v1 version of volume request");
-               }
-    }
-    else if (version.equals(Constants.SCHEMA_VERSION_V2)) {
-               if (this.volumeInputs.getServiceType() != null || this.volumeInputs.getAicNodeClli() != null ||
-                               this.volumeInputs.getServiceInstanceId () != null || this.volumeInputs.getVnfId () != null) {
-                       throw new ValidationException ("format for v2 version of volume request");
-               }
-    }
-    else if (version.equals(Constants.SCHEMA_VERSION_V3)) {
-               if (this.volumeInputs.getServiceType() != null || this.volumeInputs.getAicNodeClli() != null) {
-                       throw new ValidationException ("format for v3 version of volume request");
-               }
-    }
+        switch (version) {
+            case Constants.SCHEMA_VERSION_V1:
+                if (this.volumeInputs.getBackoutOnFailure() != null || this.volumeInputs.getAicCloudRegion() != null ||
+                    this.volumeInputs.getVfModuleModelName() != null
+                    || this.volumeInputs.getAsdcServiceModelVersion() != null ||
+                    this.volumeInputs.getServiceInstanceId() != null || this.volumeInputs.getVnfId() != null) {
+                    throw new ValidationException("format for v1 version of volume request");
+                }
+                break;
+            case Constants.SCHEMA_VERSION_V2:
+                if (this.volumeInputs.getServiceType() != null || this.volumeInputs.getAicNodeClli() != null ||
+                    this.volumeInputs.getServiceInstanceId() != null || this.volumeInputs.getVnfId() != null) {
+                    throw new ValidationException("format for v2 version of volume request");
+                }
+                break;
+            case Constants.SCHEMA_VERSION_V3:
+                if (this.volumeInputs.getServiceType() != null || this.volumeInputs.getAicNodeClli() != null) {
+                    throw new ValidationException("format for v3 version of volume request");
+                }
+                break;
+        }
 
 
         if (!InfraUtils.isActionAllowed (props, "volume", version, action.value ())) {
index 3fa4a7a..e3af83d 100644 (file)
@@ -166,43 +166,45 @@ public class VolumeRequestHandler {
         if (ar.getVnfType () != null) {
             vi.setVnfType (ar.getVnfType ());
         }
-        
-        if (version.equals(Constants.SCHEMA_VERSION_V1)) {
-               if (ar.getServiceType () != null) {
-                       vi.setServiceType (ar.getServiceType ());
-               }
-               if (ar.getAicNodeClli () != null) {
-                       vi.setAicNodeClli (ar.getAicNodeClli ());
-               }
-        }
-        else if (version.equals(Constants.SCHEMA_VERSION_V2)) {
-               if (ar.getAaiServiceId () != null) {
-                       vi.setServiceId (ar.getAaiServiceId ());
-               }
-               if (ar.getAicCloudRegion () != null) {
-                       vi.setAicCloudRegion (ar.getAicCloudRegion ());
-               }               
-               if (ar.getVfModuleModelName () != null) {
-                       vi.setVfModuleModelName (ar.getVfModuleModelName ());
-               }               
-        }
-        else if (version.equals(Constants.SCHEMA_VERSION_V3)) {
-               if (ar.getAaiServiceId () != null) {
-                       vi.setServiceId (ar.getAaiServiceId ());
-               }
-               if (ar.getAicCloudRegion () != null) {
-                       vi.setAicCloudRegion (ar.getAicCloudRegion ());
-               }               
-               if (ar.getVfModuleModelName () != null) {
-                       vi.setVfModuleModelName (ar.getVfModuleModelName ());
-               }
-               if (ar.getServiceInstanceId () != null) {
-                       vi.setServiceInstanceId (ar.getServiceInstanceId ());
-               }
-               if (ar.getVnfId () != null) {
-                vi.setVnfId (ar.getVnfId ());
-            }
-        }
+
+         switch (version) {
+             case Constants.SCHEMA_VERSION_V1:
+                 if (ar.getServiceType() != null) {
+                     vi.setServiceType(ar.getServiceType());
+                 }
+                 if (ar.getAicNodeClli() != null) {
+                     vi.setAicNodeClli(ar.getAicNodeClli());
+                 }
+                 break;
+             case Constants.SCHEMA_VERSION_V2:
+                 if (ar.getAaiServiceId() != null) {
+                     vi.setServiceId(ar.getAaiServiceId());
+                 }
+                 if (ar.getAicCloudRegion() != null) {
+                     vi.setAicCloudRegion(ar.getAicCloudRegion());
+                 }
+                 if (ar.getVfModuleModelName() != null) {
+                     vi.setVfModuleModelName(ar.getVfModuleModelName());
+                 }
+                 break;
+             case Constants.SCHEMA_VERSION_V3:
+                 if (ar.getAaiServiceId() != null) {
+                     vi.setServiceId(ar.getAaiServiceId());
+                 }
+                 if (ar.getAicCloudRegion() != null) {
+                     vi.setAicCloudRegion(ar.getAicCloudRegion());
+                 }
+                 if (ar.getVfModuleModelName() != null) {
+                     vi.setVfModuleModelName(ar.getVfModuleModelName());
+                 }
+                 if (ar.getServiceInstanceId() != null) {
+                     vi.setServiceInstanceId(ar.getServiceInstanceId());
+                 }
+                 if (ar.getVnfId() != null) {
+                     vi.setVnfId(ar.getVnfId());
+                 }
+                 break;
+         }
         if (ar.getTenantId () != null) {
             vi.setTenantId (ar.getTenantId ());
         }
@@ -289,7 +291,7 @@ public class VolumeRequestHandler {
                                                                                                    queryValue,
                                                                                                    "VOLUME");
   
-        List <VolumeRequest> queryResponseList = new LinkedList <VolumeRequest> ();
+        List <VolumeRequest> queryResponseList = new LinkedList<>();
 
         if (activeReqList != null) {
             // build response for active
@@ -334,7 +336,7 @@ public class VolumeRequestHandler {
     }
 
     private List <VolumeRequest> infraRequestsResponses (List <? extends InfraRequests> arList, String version) {
-        List <VolumeRequest> queryResponseList = new LinkedList <VolumeRequest> ();
+        List <VolumeRequest> queryResponseList = new LinkedList<>();
 
         for (InfraRequests ar : arList) {
             VolumeRequest qr = fillGeneric (ar);
index 6121e47..4343847 100644 (file)
@@ -35,7 +35,7 @@ public class NsParameters {
 
     private List<LocationConstraint> locationConstraints;
 
-    private Map<String, Object> additionalParamForNs = new HashMap<String,Object>();
+    private Map<String, Object> additionalParamForNs = new HashMap<>();
     /**
      * @return Returns the locationConstraints.
      */
index 036694b..a223d6e 100644 (file)
@@ -91,7 +91,7 @@ public class NetworkRequests {
      */
     public List<NetworkRequest> getNetworkRequest() {
         if (networkRequest == null) {
-            networkRequest = new ArrayList<NetworkRequest>();
+            networkRequest = new ArrayList<>();
         }
         return this.networkRequest;
     }
index 0c0b622..9e9a832 100644 (file)
@@ -91,7 +91,7 @@ public class NetworkTypes {
      */
     public List<NetworkType> getNetworkType() {
         if (networkType == null) {
-            networkType = new ArrayList<NetworkType>();
+            networkType = new ArrayList<>();
         }
         return this.networkType;
     }
index 3655643..652c6a3 100644 (file)
@@ -123,7 +123,7 @@ public class ObjectFactory {
      */
     @XmlElementDecl(namespace = "http://org.openecomp/mso/infra/network-request/v1", name = "network-params")
     public JAXBElement<Object> createNetworkParams(Object value) {
-        return new JAXBElement<Object>(_NetworkParams_QNAME, Object.class, null, value);
+        return new JAXBElement<>(_NetworkParams_QNAME, Object.class, null, value);
     }
 
 }
index e4faf72..a3ad61c 100644 (file)
@@ -148,7 +148,7 @@ public class ExceptionType {
      */
     public List<String> getVariables() {
         if (variables == null) {
-            variables = new ArrayList<String>();
+            variables = new ArrayList<>();
         }
         return this.variables;
     }
index cfd49d2..e77257c 100644 (file)
@@ -144,7 +144,7 @@ public class ObjectFactory {
      */
     @XmlElementDecl(namespace = "http://org.openecomp/mso/infra/vnf-request/v1", name = "vnf-params")
     public JAXBElement<Object> createVnfParams(Object value) {
-        return new JAXBElement<Object>(_VnfParams_QNAME, Object.class, null, value);
+        return new JAXBElement<>(_VnfParams_QNAME, Object.class, null, value);
     }
 
 }
index c3f6ec7..371cbb8 100644 (file)
@@ -91,7 +91,7 @@ public class VfModuleModelNames {
      */
     public List<VfModuleModelName> getVfModuleModelName() {
         if (vfModuleModelName == null) {
-            vfModuleModelName = new ArrayList<VfModuleModelName>();
+            vfModuleModelName = new ArrayList<>();
         }
         return this.vfModuleModelName;
     }
index 336cad5..993c76c 100644 (file)
@@ -91,7 +91,7 @@ public class VnfRequests {
      */
     public List<VnfRequest> getVnfRequest() {
         if (vnfRequest == null) {
-            vnfRequest = new ArrayList<VnfRequest>();
+            vnfRequest = new ArrayList<>();
         }
         return this.vnfRequest;
     }
index eebb1d9..c066ff4 100644 (file)
@@ -91,7 +91,7 @@ public class VnfTypes {
      */
     public List<VnfType> getVnfType() {
         if (vnfType == null) {
-            vnfType = new ArrayList<VnfType>();
+            vnfType = new ArrayList<>();
         }
         return this.vnfType;
     }
index 48cca8f..2d4d588 100644 (file)
@@ -109,7 +109,7 @@ public class ObjectFactory {
      */
     @XmlElementDecl(namespace = "http://org.openecomp/mso/infra/volume-request/v1", name = "volume-params")
     public JAXBElement<Object> createVolumeParams(Object value) {
-        return new JAXBElement<Object>(_VolumeParams_QNAME, Object.class, null, value);
+        return new JAXBElement<>(_VolumeParams_QNAME, Object.class, null, value);
     }
 
 }
index 00c88a0..318ff90 100644 (file)
@@ -91,7 +91,7 @@ public class VolumeRequests {
      */
     public List<VolumeRequest> getVolumeRequest() {
         if (volumeRequest == null) {
-            volumeRequest = new ArrayList<VolumeRequest>();
+            volumeRequest = new ArrayList<>();
         }
         return this.volumeRequest;
     }
index 21c59ac..664f810 100644 (file)
@@ -127,7 +127,7 @@ public class E2EServiceInstancesTest {
                String request = "{\"service\":{\"name\":\"so_test4\",\"description\":\"so_test2\",\"serviceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561519\",\"templateId\":\"592f9437-a9c0-4303-b9f6-c445bb7e9814\",\"parameters\":{\"globalSubscriberId\":\"123457\",\"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"vIMS\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"vEPC\",\"resourceDefId\":\"61c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"62c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-CSCF-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad1\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"underlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561513\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561514\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}},{\"resourceName\":\"overlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561517\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561518\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}}]}}}";\r
                Response resp = instance.createE2EServiceInstance(request, "v3");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
        }\r
 \r
        @Test\r
@@ -198,7 +198,7 @@ public class E2EServiceInstancesTest {
                String request = "{\"service\":{\"name\":\"so_test4\",\"description\":\"so_test2\",\"serviceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561519\",\"templateId\":\"592f9437-a9c0-4303-b9f6-c445bb7e9814\",\"parameters\":{\"globalSubscriberId\":\"123457\",\"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"vIMS\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"vEPC\",\"resourceDefId\":\"61c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"62c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-CSCF-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad1\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"underlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561513\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561514\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}},{\"resourceName\":\"overlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561517\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561518\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}}]}}}";\r
                Response resp = instance.createE2EServiceInstance(request, "v3");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
        }\r
 \r
        @Test\r
@@ -269,7 +269,7 @@ public class E2EServiceInstancesTest {
                String request = "{\"service\":{\"name\":\"so_test4\",\"description\":\"so_test2\",\"serviceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561519\",\"templateId\":\"592f9437-a9c0-4303-b9f6-c445bb7e9814\",\"parameters\":{\"globalSubscriberId\":\"123457\",\"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"vIMS\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"vEPC\",\"resourceDefId\":\"61c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"62c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-CSCF-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad1\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"underlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561513\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561514\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}},{\"resourceName\":\"overlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561517\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561518\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}}]}}}";\r
                Response resp = instance.createE2EServiceInstance(request, "v3");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
        }\r
 \r
        @Test\r
@@ -333,7 +333,7 @@ public class E2EServiceInstancesTest {
                String request = "{\"service\":{\"name\":\"so_test4\",\"description\":\"so_test2\",\"serviceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561519\",\"templateId\":\"592f9437-a9c0-4303-b9f6-c445bb7e9814\",\"parameters\":{\"globalSubscriberId\":\"123457\",\"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"vIMS\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"vEPC\",\"resourceDefId\":\"61c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"62c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-CSCF-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad1\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"underlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561513\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561514\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}},{\"resourceName\":\"overlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561517\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561518\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}}]}}}";\r
                Response resp = instance.createE2EServiceInstance(request, "v3");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
        }\r
 \r
        @Test\r
@@ -393,7 +393,7 @@ public class E2EServiceInstancesTest {
                String request = "{\"service\":{\"name\":\"so_test4\",\"description\":\"so_test2\",\"serviceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561519\",\"templateId\":\"592f9437-a9c0-4303-b9f6-c445bb7e9814\",\"parameters\":{\"globalSubscriberId\":\"123457\",\"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"vIMS\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"vEPC\",\"resourceDefId\":\"61c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"62c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-CSCF-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad1\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"underlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561513\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561514\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}},{\"resourceName\":\"overlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561517\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561518\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}}]}}}";\r
                Response resp = instance.createE2EServiceInstance(request, "v3");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
        }\r
 \r
        @Test\r
@@ -434,7 +434,7 @@ public class E2EServiceInstancesTest {
                String request = "{\"service\":{\"name\":\"so_test4\",\"description\":\"so_test2\",\"serviceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561519\",\"templateId\":\"592f9437-a9c0-4303-b9f6-c445bb7e9814\",\"parameters\":{\"globalSubscriberId\":\"123457\",\"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"vIMS\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"vEPC\",\"resourceDefId\":\"61c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"62c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-CSCF-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad1\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"underlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561513\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561514\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}},{\"resourceName\":\"overlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561517\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561518\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}}]}}}";\r
                Response resp = instance.createE2EServiceInstance(request, "v3");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
        }\r
 \r
        @Test\r
@@ -459,7 +459,7 @@ public class E2EServiceInstancesTest {
                String request = "{\"service\":{\"name\":\"so_test4\",\"description\":\"so_test2\",\"serviceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561519\",\"templateId\":\"592f9437-a9c0-4303-b9f6-c445bb7e9814\",\"parameters\":{\"globalSubscriberId\":\"123457\",\"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"vIMS\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"vEPC\",\"resourceDefId\":\"61c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"62c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-CSCF-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad1\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"underlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561513\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561514\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}},{\"resourceName\":\"overlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561517\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561518\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}}]}}}";\r
                Response resp = instance.createE2EServiceInstance(request, "v3");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
        }\r
 \r
        @Test\r
@@ -485,7 +485,7 @@ public class E2EServiceInstancesTest {
                String request = "{\"service\":{\"name\":\"so_test4\",\"description\":\"so_test2\",\"serviceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561519\",\"templateId\":\"592f9437-a9c0-4303-b9f6-c445bb7e9814\",\"parameters\":{\"globalSubscriberId\":\"123457\",\"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"vIMS\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"vEPC\",\"resourceDefId\":\"61c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"62c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-CSCF-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad1\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"underlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561513\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561514\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}},{\"resourceName\":\"overlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561517\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561518\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}}]}}}";\r
                Response resp = instance.createE2EServiceInstance(request, "v3");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
        }\r
 \r
        @Test\r
@@ -510,7 +510,7 @@ public class E2EServiceInstancesTest {
                String request = "{\"service\":{\"name\":\"so_test4\",\"description\":\"so_test2\",\"serviceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561519\",\"templateId\":\"592f9437-a9c0-4303-b9f6-c445bb7e9814\",\"parameters\":{\"globalSubscriberId\":\"123457\",\"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"vIMS\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"vEPC\",\"resourceDefId\":\"61c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"62c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-CSCF-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad1\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"underlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561513\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561514\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}},{\"resourceName\":\"overlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561517\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561518\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}}]}}}";\r
                Response resp = instance.createE2EServiceInstance(request, "v3");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
        }\r
 \r
        @Test\r
@@ -527,7 +527,7 @@ public class E2EServiceInstancesTest {
                String request = "{\"service\":{\"name\":\"so_test4\",\"description\":\"so_test2\",\"serviceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561519\",\"templateId\":\"592f9437-a9c0-4303-b9f6-c445bb7e9814\",\"parameters\":{\"globalSubscriberId\":\"123457\",\"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"vIMS\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"vEPC\",\"resourceDefId\":\"61c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"62c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-CSCF-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad1\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"underlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561513\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561514\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}},{\"resourceName\":\"overlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561517\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561518\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}}]}}}";\r
                Response resp = instance.createE2EServiceInstance(request, "v3");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
                // assertTrue(true);\r
        }\r
 \r
@@ -553,7 +553,7 @@ public class E2EServiceInstancesTest {
                String request = "{\"service\":{\"name\":\"so_test4\",\"description\":\"so_test2\",\"serviceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561519\",\"templateId\":\"592f9437-a9c0-4303-b9f6-c445bb7e9814\",\"parameters\":{\"globalSubscriberId\":\"123457\",\"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"vIMS\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"vEPC\",\"resourceDefId\":\"61c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"62c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-CSCF-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad1\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"underlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561513\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561514\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}},{\"resourceName\":\"overlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561517\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561518\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}}]}}}";\r
                Response resp = instance.createE2EServiceInstance(request, "v3");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
        }\r
 \r
        @Test\r
@@ -571,7 +571,7 @@ public class E2EServiceInstancesTest {
                Response resp = instance.createE2EServiceInstance(request, "v3");\r
                String respStr = resp.getEntity().toString();\r
                assertTrue(respStr\r
-                               .indexOf("Mapping of request to JSON object failed.  No content to map to Object due to end of input") != -1);\r
+            .contains("Mapping of request to JSON object failed.  No content to map to Object due to end of input"));\r
        }\r
 \r
        @Test\r
@@ -581,7 +581,7 @@ public class E2EServiceInstancesTest {
                Response resp = instance.deleteE2EServiceInstance(request, "v3",\r
                                "12345678");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC1000") != -1);\r
+               assertTrue(respStr.contains("SVC1000"));\r
        }\r
 \r
        @Test\r
@@ -610,4 +610,147 @@ public class E2EServiceInstancesTest {
                                .getE2EServiceInstances("12345", "v3", "123456");\r
 \r
        }\r
+       \r
+       @Test\r
+       public void updateE2EServiceInstanceTestNormal() {\r
+               new MockUp<RequestsDatabase>() {\r
+                       @Mock\r
+                       public OperationStatus getOperationStatusByServiceId(\r
+                                       String serviceID) {\r
+                               OperationStatus operationStatus = new OperationStatus();\r
+                               operationStatus.setProgress("100");\r
+                               return operationStatus;\r
+                       }\r
+               };\r
+               new MockUp<E2EServiceInstances>() {\r
+                       @Mock\r
+                       private void createOperationStatusRecordForError(Action action,\r
+                                       String requestId) throws MsoDatabaseException {\r
+\r
+                       }\r
+               };\r
+               new MockUp<CatalogDatabase>() {\r
+                       @Mock\r
+                       public Service getServiceByModelName(String modelName) {\r
+                               Service svc = new Service();\r
+                               return svc;\r
+                       }\r
+               };\r
+\r
+               new MockUp<CatalogDatabase>() {\r
+                       @Mock\r
+                       public ServiceRecipe getServiceRecipeByModelUUID(String modelUUID,\r
+                                       String action) {\r
+                               ServiceRecipe rec = new ServiceRecipe();\r
+                               return rec;\r
+                       }\r
+               };\r
+\r
+               new MockUp<RequestClientFactory>() {\r
+                       @Mock\r
+                       public RequestClient getRequestClient(String orchestrationURI,\r
+                                       MsoJavaProperties props) throws IllegalStateException {\r
+                               RequestClient client = new CamundaClient();\r
+                               client.setUrl("/test/url");\r
+                               return client;\r
+                       }\r
+               };\r
+\r
+               new MockUp<CamundaClient>() {\r
+                       @Mock\r
+                       public HttpResponse post(String requestId, boolean isBaseVfModule,\r
+                                       int recipeTimeout, String requestAction,\r
+                                       String serviceInstanceId, String vnfId, String vfModuleId,\r
+                                       String volumeGroupId, String networkId, String serviceType,\r
+                                       String vnfType, String vfModuleType, String networkType,\r
+                                       String requestDetails, String recipeParamXsd) {\r
+                               ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);\r
+                               HttpResponse resp = new BasicHttpResponse(pv, 202,\r
+                                               "test response");\r
+                               BasicHttpEntity entity = new BasicHttpEntity();\r
+                               String body = "{\"response\":\"success\",\"message\":\"success\"}";\r
+                               InputStream instream = new ByteArrayInputStream(body.getBytes());\r
+                               entity.setContent(instream);\r
+                               resp.setEntity(entity);\r
+                               return resp;\r
+                       }\r
+               };\r
+\r
+               E2EServiceInstances instance = new E2EServiceInstances();\r
+               String request = "{\"service\":{\"name\":\"so_test4\",\"description\":\"so_test2\",\"serviceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561519\",\"templateId\":\"592f9437-a9c0-4303-b9f6-c445bb7e9814\",\"parameters\":{\"globalSubscriberId\":\"123457\",\"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"vIMS\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"vEPC\",\"resourceDefId\":\"61c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"62c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-CSCF-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad1\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"underlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561513\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561514\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}},{\"resourceName\":\"overlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561517\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561518\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}}]}}}";\r
+               Response resp = instance.updateE2EServiceInstance(request, "v3", "12345");\r
+               String respStr = resp.getEntity().toString();\r
+               assertTrue(respStr.contains("success"));\r
+       }\r
+       \r
+       @Test\r
+       public void updateE2EServiceInstanceTestChkStatusFalse() {\r
+               new MockUp<RequestsDatabase>() {\r
+                       @Mock\r
+                       public OperationStatus getOperationStatusByServiceId(\r
+                                       String serviceID) {\r
+                               OperationStatus operationStatus = new OperationStatus();\r
+                               return operationStatus;\r
+                       }\r
+               };\r
+               new MockUp<E2EServiceInstances>() {\r
+                       @Mock\r
+                       private void createOperationStatusRecordForError(Action action,\r
+                                       String requestId) throws MsoDatabaseException {\r
+\r
+                       }\r
+               };\r
+               new MockUp<CatalogDatabase>() {\r
+                       @Mock\r
+                       public Service getServiceByModelName(String modelName) {\r
+                               Service svc = new Service();\r
+                               return svc;\r
+                       }\r
+               };\r
+\r
+               new MockUp<CatalogDatabase>() {\r
+                       @Mock\r
+                       public ServiceRecipe getServiceRecipeByModelUUID(String modelUUID,\r
+                                       String action) {\r
+                               ServiceRecipe rec = new ServiceRecipe();\r
+                               return rec;\r
+                       }\r
+               };\r
+\r
+               new MockUp<RequestClientFactory>() {\r
+                       @Mock\r
+                       public RequestClient getRequestClient(String orchestrationURI,\r
+                                       MsoJavaProperties props) throws IllegalStateException {\r
+                               RequestClient client = new CamundaClient();\r
+                               client.setUrl("/test/url");\r
+                               return client;\r
+                       }\r
+               };\r
+\r
+               new MockUp<CamundaClient>() {\r
+                       @Mock\r
+                       public HttpResponse post(String requestId, boolean isBaseVfModule,\r
+                                       int recipeTimeout, String requestAction,\r
+                                       String serviceInstanceId, String vnfId, String vfModuleId,\r
+                                       String volumeGroupId, String networkId, String serviceType,\r
+                                       String vnfType, String vfModuleType, String networkType,\r
+                                       String requestDetails, String recipeParamXsd) {\r
+                               ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);\r
+                               HttpResponse resp = new BasicHttpResponse(pv, 202,\r
+                                               "test response");\r
+                               BasicHttpEntity entity = new BasicHttpEntity();\r
+                               String body = "{\"response\":\"success\",\"message\":\"success\"}";\r
+                               InputStream instream = new ByteArrayInputStream(body.getBytes());\r
+                               entity.setContent(instream);\r
+                               resp.setEntity(entity);\r
+                               return resp;\r
+                       }\r
+               };\r
+\r
+               E2EServiceInstances instance = new E2EServiceInstances();\r
+               String request = "{\"service\":{\"name\":\"so_test4\",\"description\":\"so_test2\",\"serviceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561519\",\"templateId\":\"592f9437-a9c0-4303-b9f6-c445bb7e9814\",\"parameters\":{\"globalSubscriberId\":\"123457\",\"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"vIMS\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"vEPC\",\"resourceDefId\":\"61c3e96e-0970-4871-b6e0-3b6de7561516\",\"resourceId\":\"62c3e96e-0970-4871-b6e0-3b6de7561512\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-CSCF-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad1\"}}],\"additionalParamForNs\":{}}},{\"resourceName\":\"underlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561513\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561514\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}},{\"resourceName\":\"overlayvpn\",\"resourceDefId\":\"60c3e96e-0970-4871-b6e0-3b6de7561517\",\"resourceId\":\"60c3e96e-0970-4871-b6e0-3b6de7561518\",\"nsParameters\":{\"locationConstraints\":[],\"additionalParamForNs\":{\"externalDataNetworkName\":\"Flow_out_net\",\"m6000_mng_ip\":\"181.18.20.2\",\"externalCompanyFtpDataNetworkName\":\"Flow_out_net\",\"externalPluginManageNetworkName\":\"plugin_net_2014\",\"externalManageNetworkName\":\"mng_net_2017\",\"sfc_data_network\":\"sfc_data_net_2016\",\"NatIpRange\":\"210.1.1.10-210.1.1.20\",\"location\":\"4050083f-465f-4838-af1e-47a545222ad0\",\"sdncontroller\":\"9b9f02c0-298b-458a-bc9c-be3692e4f35e\"}}}]}}}";\r
+               Response resp = instance.updateE2EServiceInstance(request, "v3", "12345");\r
+               String respStr = resp.getEntity().toString();\r
+               assertTrue(respStr.contains("SVC2000"));\r
+       }\r
 }\r
index 6a7fc2c..c4a1c1f 100644 (file)
@@ -76,7 +76,7 @@ public class MsoRequestTest {
                    return;
                }
                        ObjectMapper mapper = new ObjectMapper();
-                        HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+                        HashMap<String, String> instanceIdMap = new HashMap<>();
                        instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
                        ServiceInstancesRequest sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
                        MsoRequest msoRequest = new MsoRequest ("1234");
@@ -101,7 +101,7 @@ public class MsoRequestTest {
                    return;
                }
                        ObjectMapper mapper = new ObjectMapper();
-                        HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+                        HashMap<String, String> instanceIdMap = new HashMap<>();
                        instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
                        ServiceInstancesRequest sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
                        MsoRequest msoRequest = new MsoRequest ("1234");
@@ -121,7 +121,7 @@ public class MsoRequestTest {
                    return;
                }
                        ObjectMapper mapper = new ObjectMapper();
-                        HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+                        HashMap<String, String> instanceIdMap = new HashMap<>();
                        instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
                        ServiceInstancesRequest sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
                        MsoRequest msoRequest = new MsoRequest ("1234");
@@ -141,7 +141,7 @@ public class MsoRequestTest {
                    return;
                }
                        ObjectMapper mapper = new ObjectMapper();
-                        HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+                        HashMap<String, String> instanceIdMap = new HashMap<>();
                        instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
                        ServiceInstancesRequest sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
                        MsoRequest msoRequest = new MsoRequest ("1234");
@@ -161,7 +161,7 @@ public class MsoRequestTest {
                    return;
                }
                        ObjectMapper mapper = new ObjectMapper();
-                        HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+                        HashMap<String, String> instanceIdMap = new HashMap<>();
                        instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
                        ServiceInstancesRequest sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
                        MsoRequest msoRequest = new MsoRequest ("1234");
@@ -181,7 +181,7 @@ public class MsoRequestTest {
                    return;
                }
                        ObjectMapper mapper = new ObjectMapper();
-                        HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+                        HashMap<String, String> instanceIdMap = new HashMap<>();
                        instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
                        ServiceInstancesRequest sir  = mapper.readValue(requestJSON1, ServiceInstancesRequest.class);
                        MsoRequest msoRequest = new MsoRequest ("1234");
@@ -210,7 +210,7 @@ public class MsoRequestTest {
                    return;
                }
                        ObjectMapper mapper = new ObjectMapper();
-                        HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+                        HashMap<String, String> instanceIdMap = new HashMap<>();
                        instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
                        ServiceInstancesRequest sir  = mapper.readValue(requestJSON2, ServiceInstancesRequest.class);
                        MsoRequest msoRequest = new MsoRequest ("1234");
@@ -230,7 +230,7 @@ public class MsoRequestTest {
                    return;
                }
                        ObjectMapper mapper = new ObjectMapper();
-                        HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+                        HashMap<String, String> instanceIdMap = new HashMap<>();
                        instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
                        ServiceInstancesRequest sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
                        MsoRequest msoRequest = new MsoRequest ("1234");
@@ -251,7 +251,7 @@ public class MsoRequestTest {
                }
                 
                        ObjectMapper mapper = new ObjectMapper();
-                       HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+                       HashMap<String, String> instanceIdMap = new HashMap<>();
                        instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
                        instanceIdMap.put("vnfInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
                        ServiceInstancesRequest sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
@@ -270,7 +270,7 @@ public class MsoRequestTest {
                }
                 
                        mapper = new ObjectMapper();
-                       instanceIdMap = new HashMap<String,String>();
+                       instanceIdMap = new HashMap<>();
                        instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
                        instanceIdMap.put("vnfInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
                        sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
@@ -291,7 +291,7 @@ public class MsoRequestTest {
                }
                 
                        ObjectMapper mapper = new ObjectMapper();
-                       HashMap<String, String> instanceIdMap = new HashMap<String,String>();
+                       HashMap<String, String> instanceIdMap = new HashMap<>();
                        instanceIdMap.put("serviceInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
                        instanceIdMap.put("vnfInstanceId", "3eecada1-83a4-4f33-9ed2-7937e7b8dbbc");
                        ServiceInstancesRequest sir  = mapper.readValue(requestJSON, ServiceInstancesRequest.class);
index 89d4d0c..c1da76e 100644 (file)
@@ -179,7 +179,7 @@ UriInfo uriInfo = null;
                        public List <InfraActiveRequests> getRequestListFromInfraActive (String queryAttributeName,
                     String queryValue,
                     String requestType) {
-                               List <InfraActiveRequests> list = new ArrayList<InfraActiveRequests>();
+                               List <InfraActiveRequests> list = new ArrayList<>();
                                InfraActiveRequests req = new InfraActiveRequests();
                                req.setAaiServiceId("299392");
                                req.setAction("CREATE");
index 27d3958..d3d995e 100644 (file)
@@ -64,7 +64,7 @@ public class ServiceInstanceTest {
                String requestJson = "{\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v5");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("Error parsing request.  No valid model-info is specified") != -1);\r
+               assertTrue(respBody.contains("Error parsing request.  No valid model-info is specified"));\r
        }\r
        \r
        @Test\r
@@ -84,7 +84,8 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v2");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("Locked instance - This service (testService) already has a request being worked with a status of null (RequestId - null). The existing request must finish or be cleaned up before proceeding.") != -1);\r
+               assertTrue(respBody.contains(\r
+            "Locked instance - This service (testService) already has a request being worked with a status of null (RequestId - null). The existing request must finish or be cleaned up before proceeding."));\r
        }\r
        \r
        @Test\r
@@ -121,7 +122,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v2");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("Exception while creating record in DB null") != -1);\r
+               assertTrue(respBody.contains("Exception while creating record in DB null"));\r
        }\r
        \r
        @Test\r
@@ -165,7 +166,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v2");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("Failed calling bpmn properties") != -1);\r
+               assertTrue(respBody.contains("Failed calling bpmn properties"));\r
        }\r
        \r
        @Test(expected = Exception.class)\r
@@ -306,7 +307,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v2");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("Request Failed due to BPEL error with HTTP Status") != -1);\r
+               assertTrue(respBody.contains("Request Failed due to BPEL error with HTTP Status"));\r
        }\r
        \r
        @Test\r
@@ -377,7 +378,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"vnf\",\"modelName\":\"serviceModel\",\"modelCustomizationName\":\"test\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v5");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("No valid modelVersionId is specified") != -1);\r
+               assertTrue(respBody.contains("No valid modelVersionId is specified"));\r
        }\r
        \r
        @Test\r
@@ -441,7 +442,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v2");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("bpelResponse is null") != -1);\r
+               assertTrue(respBody.contains("bpelResponse is null"));\r
        }\r
        \r
        @Test\r
@@ -461,7 +462,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v2");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("Recipe could not be retrieved from catalog DB null") != -1);\r
+               assertTrue(respBody.contains("Recipe could not be retrieved from catalog DB null"));\r
        }\r
        \r
        \r
@@ -476,7 +477,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v5");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("Error parsing request.  No valid modelVersionId is specified") != -1);\r
+               assertTrue(respBody.contains("Error parsing request.  No valid modelVersionId is specified"));\r
        }\r
        \r
        @Test\r
@@ -490,7 +491,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v2");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("Error parsing request.  No valid instanceName is specified") != -1);\r
+               assertTrue(respBody.contains("Error parsing request.  No valid instanceName is specified"));\r
        }\r
        \r
        \r
@@ -505,7 +506,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\"},\"requestParameters\": { \"autoBuildVfModules\": false}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v2");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("Error parsing request.  No valid model-info is specified") != -1);\r
+               assertTrue(respBody.contains("Error parsing request.  No valid model-info is specified"));\r
        }\r
        \r
        @Test\r
@@ -519,7 +520,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\"},\"requestParameters\": { \"autoBuildVfModules\": false},\"modelInfo\":{\"modelInvariantId\": \"1234\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v2");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("Error parsing request.  No valid modelType is specified") != -1);\r
+               assertTrue(respBody.contains("Error parsing request.  No valid modelType is specified"));\r
        }\r
        \r
        @Test\r
@@ -533,7 +534,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\"},\"requestParameters\": { \"autoBuildVfModules\": false},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v2");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("Error parsing request.  No valid modelType is specified") != -1);\r
+               assertTrue(respBody.contains("Error parsing request.  No valid modelType is specified"));\r
        }\r
        \r
        \r
@@ -548,7 +549,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\"},\"requestParameters\": { \"autoBuildVfModules\": false},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v2");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("Error parsing request.  No valid modelType is specified") != -1);\r
+               assertTrue(respBody.contains("Error parsing request.  No valid modelType is specified"));\r
        }\r
        \r
        @Test\r
@@ -562,7 +563,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\"},\"requestParameters\": { \"autoBuildVfModules\": false},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"testmodel\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v2");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("Mapping of request to JSON object failed.") != -1);\r
+               assertTrue(respBody.contains("Mapping of request to JSON object failed."));\r
        }\r
        \r
        @Test\r
@@ -576,7 +577,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\"},\"requestParameters\": { \"autoBuildVfModules\": false},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v2");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("Error parsing request.  No valid modelName is specified") != -1);\r
+               assertTrue(respBody.contains("Error parsing request.  No valid modelName is specified"));\r
        }\r
        \r
        @Test\r
@@ -590,7 +591,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\"},\"requestParameters\": { \"autoBuildVfModules\": true},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v2");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("Error parsing request.  AutoBuildVfModule is not valid in the v2 version") != -1);\r
+               assertTrue(respBody.contains("Error parsing request.  AutoBuildVfModule is not valid in the v2 version"));\r
        }\r
        \r
        @Test\r
@@ -604,7 +605,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\"},\"requestParameters\": { \"autoBuildVfModules\": false},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v2");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("Error parsing request.  No valid subscriptionServiceType is specified") != -1);\r
+               assertTrue(respBody.contains("Error parsing request.  No valid subscriptionServiceType is specified"));\r
        }\r
        \r
        @Test\r
@@ -618,7 +619,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\"},\"requestParameters\": { \"autoBuildVfModules\": false},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.createServiceInstance(requestJson, "v2");\r
                String respBody = resp.getEntity().toString();\r
-               assertTrue(respBody.indexOf("Error parsing request.  No valid subscriptionServiceType is specified") != -1);\r
+               assertTrue(respBody.contains("Error parsing request.  No valid subscriptionServiceType is specified"));\r
        }\r
        \r
        @Test\r
@@ -627,7 +628,7 @@ public class ServiceInstanceTest {
                String requestJson = "{\"name\":\"test\"}";\r
                Response resp = instance.createServiceInstance(requestJson, "v2");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("Mapping of request to JSON object failed") != -1);\r
+               assertTrue(respStr.contains("Mapping of request to JSON object failed"));\r
        }\r
        \r
        /*** Activate Service Instance Test Cases ***/\r
@@ -638,7 +639,7 @@ public class ServiceInstanceTest {
                String requestJson = "{\"name\":\"test\"}";\r
                Response resp = instance.activateServiceInstance(requestJson, "v5","557ea944-c83e-43cf-9ed7-3a354abd6d34");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("Mapping of request to JSON object failed") != -1);\r
+               assertTrue(respStr.contains("Mapping of request to JSON object failed"));\r
        }\r
        \r
        @Test\r
@@ -652,7 +653,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"relatedInstanceList\" :[{\"relatedInstance\":{\"instanceName\":\"testInstance\",\"instanceId\":\"557ea944-c83e-43cf-9ed7-3a354abd6d37\",\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}],\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.activateServiceInstance(requestJson, "v5","557ea944-c83e-43cf-9ed7-3a354abd6d34");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("Error parsing request.  No valid modelVersionId in relatedInstance is specified") != -1);\r
+               assertTrue(respStr.contains("Error parsing request.  No valid modelVersionId in relatedInstance is specified"));\r
        }\r
        \r
        @Test\r
@@ -666,7 +667,8 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"relatedInstanceList\" :[{\"relatedInstance\":{\"instanceName\":\"testInstance\",\"instanceId\":\"557ea944-c83e-43cf-9ed7-3a354abd6d37\",\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"4839499\"}}}],\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.activateServiceInstance(requestJson, "v5","557ea944-c83e-43cf-9ed7-3a354abd6d34");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("Error parsing request.  No valid serviceInstanceId matching the serviceInstanceId in request URI is specified") != -1);\r
+               assertTrue(respStr.contains(\r
+            "Error parsing request.  No valid serviceInstanceId matching the serviceInstanceId in request URI is specified"));\r
        }\r
        \r
        @Test\r
@@ -680,7 +682,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"relatedInstanceList\" :[{\"relatedInstance\":{\"instanceName\":\"testInstance\",\"instanceId\":\"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"4839499\"}}}],\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.activateServiceInstance(requestJson, "v5","557ea944-c83e-43cf-9ed7-3a354abd6d34");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
        }\r
        \r
        /*** Deactivate Service Instance Test Cases ***/\r
@@ -691,7 +693,7 @@ public class ServiceInstanceTest {
                String requestJson = "{\"name\":\"test\"}";\r
                Response resp = instance.deactivateServiceInstance(requestJson, "v5","557ea944-c83e-43cf-9ed7-3a354abd6d34");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("Mapping of request to JSON object failed") != -1);\r
+               assertTrue(respStr.contains("Mapping of request to JSON object failed"));\r
        }\r
        \r
        @Test\r
@@ -705,7 +707,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"relatedInstanceList\" :[{\"relatedInstance\":{\"instanceName\":\"testInstance\",\"instanceId\":\"557ea944-c83e-43cf-9ed7-3a354abd6d37\",\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}],\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.deactivateServiceInstance(requestJson, "v5","557ea944-c83e-43cf-9ed7-3a354abd6d34");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("Error parsing request.  No valid modelVersionId in relatedInstance is specified") != -1);\r
+               assertTrue(respStr.contains("Error parsing request.  No valid modelVersionId in relatedInstance is specified"));\r
        }\r
        \r
        @Test\r
@@ -719,7 +721,8 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"relatedInstanceList\" :[{\"relatedInstance\":{\"instanceName\":\"testInstance\",\"instanceId\":\"557ea944-c83e-43cf-9ed7-3a354abd6d37\",\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"4839499\"}}}],\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.deactivateServiceInstance(requestJson, "v5","557ea944-c83e-43cf-9ed7-3a354abd6d34");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("Error parsing request.  No valid serviceInstanceId matching the serviceInstanceId in request URI is specified") != -1);\r
+               assertTrue(respStr.contains(\r
+            "Error parsing request.  No valid serviceInstanceId matching the serviceInstanceId in request URI is specified"));\r
        }\r
        \r
        @Test\r
@@ -733,7 +736,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"relatedInstanceList\" :[{\"relatedInstance\":{\"instanceName\":\"testInstance\",\"instanceId\":\"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"4839499\"}}}],\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.deactivateServiceInstance(requestJson, "v5","557ea944-c83e-43cf-9ed7-3a354abd6d34");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
        }\r
        \r
        /*** Delete Service Instance Test Cases ***/\r
@@ -744,7 +747,7 @@ public class ServiceInstanceTest {
                String requestJson = "{\"name\":\"test\"}";\r
                Response resp = instance.deleteServiceInstance(requestJson, "v5","557ea944-c83e-43cf-9ed7-3a354abd6d34");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("Mapping of request to JSON object failed") != -1);\r
+               assertTrue(respStr.contains("Mapping of request to JSON object failed"));\r
        }\r
        \r
        @Test\r
@@ -758,7 +761,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"relatedInstanceList\" :[{\"relatedInstance\":{\"instanceName\":\"testInstance\",\"instanceId\":\"557ea944-c83e-43cf-9ed7-3a354abd6d37\",\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}],\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.deleteServiceInstance(requestJson, "v5","557ea944-c83e-43cf-9ed7-3a354abd6d34");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("Error parsing request.  No valid modelVersionId is specified") != -1);\r
+               assertTrue(respStr.contains("Error parsing request.  No valid modelVersionId is specified"));\r
        }\r
        \r
        @Test\r
@@ -772,7 +775,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"relatedInstanceList\" :[{\"relatedInstance\":{\"instanceName\":\"testInstance\",\"instanceId\":\"557ea944-c83e-43cf-9ed7-3a354abd6d37\",\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"4839499\"}}}],\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\"}}}";\r
                Response resp = instance.deleteServiceInstance(requestJson, "v5","557ea944-c83e-43cf-9ed7-3a354abd6d34");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("Error parsing request.  No valid modelVersionId is specified") != -1);\r
+               assertTrue(respStr.contains("Error parsing request.  No valid modelVersionId is specified"));\r
        }\r
        \r
        @Test\r
@@ -786,7 +789,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"relatedInstanceList\" :[{\"relatedInstance\":{\"instanceName\":\"testInstance\",\"instanceId\":\"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"4839499\"}}}],\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"288393\",\"modelCustomizationId\":\"389823213\"}}}";\r
                Response resp = instance.deleteServiceInstance(requestJson, "v5","557ea944-c83e-43cf-9ed7-3a354abd6d34");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
        }\r
        \r
        /*** Create Vnf Instance Test Cases ***/\r
@@ -802,7 +805,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"relatedInstanceList\" :[{\"relatedInstance\":{\"instanceName\":\"testInstance\",\"instanceId\":\"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"4839499\"}}}],\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"288393\",\"modelCustomizationId\":\"389823213\"}}}";\r
                Response resp = instance.createVnfInstance(requestJson, "v3","557ea944-c83e-43cf-9ed7-3a354abd6d34");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("Error parsing request.  No valid cloudConfiguration is specified") != -1);\r
+               assertTrue(respStr.contains("Error parsing request.  No valid cloudConfiguration is specified"));\r
        }\r
        \r
        @Test\r
@@ -817,7 +820,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"cloudConfiguration\":{}, \"relatedInstanceList\" :[{\"relatedInstance\":{\"instanceName\":\"testInstance\",\"instanceId\":\"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"4839499\"}}}],\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"288393\",\"modelCustomizationId\":\"389823213\"}}}";\r
                Response resp = instance.createVnfInstance(requestJson, "v3","557ea944-c83e-43cf-9ed7-3a354abd6d34");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("Error parsing request.  No valid lcpCloudRegionId is specified") != -1);\r
+               assertTrue(respStr.contains("Error parsing request.  No valid lcpCloudRegionId is specified"));\r
        }\r
        \r
        @Test\r
@@ -832,7 +835,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"cloudConfiguration\":{\"lcpCloudRegionId\":\"2993841\"}, \"relatedInstanceList\" :[{\"relatedInstance\":{\"instanceName\":\"testInstance\",\"instanceId\":\"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"4839499\"}}}],\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"288393\",\"modelCustomizationId\":\"389823213\"}}}";\r
                Response resp = instance.createVnfInstance(requestJson, "v3","557ea944-c83e-43cf-9ed7-3a354abd6d34");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("Error parsing request.  No valid tenantId is specified") != -1);\r
+               assertTrue(respStr.contains("Error parsing request.  No valid tenantId is specified"));\r
        }\r
        \r
        @Test\r
@@ -847,7 +850,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"cloudConfiguration\":{\"lcpCloudRegionId\":\"2993841\",\"tenantId\":\"2910032\"}, \"relatedInstanceList\" :[{\"relatedInstance\":{\"instanceName\":\"testInstance\",\"instanceId\":\"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"4839499\"}}}],\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"288393\",\"modelCustomizationId\":\"389823213\"}}}";\r
                Response resp = instance.createVnfInstance(requestJson, "v3","557ea944-c83e-43cf-9ed7-3a354abd6d34");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
        }\r
        \r
        /*** Replace Vnf Instance Test Cases ***/\r
@@ -863,7 +866,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"cloudConfiguration\":{\"lcpCloudRegionId\":\"2993841\",\"tenantId\":\"2910032\"}, \"relatedInstanceList\" :[{\"relatedInstance\":{\"instanceName\":\"testInstance\",\"instanceId\":\"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"4839499\"}}}],\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"288393\",\"modelCustomizationId\":\"389823213\"}}}";\r
                Response resp = instance.replaceVnfInstance(requestJson, "v3","557ea944-c83e-43cf-9ed7-3a354abd6d34","557ea944-c83e-43cf-9ed7-3a354abd6d93");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
        }\r
        \r
        /*** Update Vnf Instance Test Cases ***/\r
@@ -880,7 +883,7 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"cloudConfiguration\":{\"lcpCloudRegionId\":\"2993841\",\"tenantId\":\"2910032\"}, \"relatedInstanceList\" :[{\"relatedInstance\":{\"instanceName\":\"testInstance\",\"instanceId\":\"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"4839499\"}}}],\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"288393\",\"modelCustomizationId\":\"389823213\"}}}";\r
                Response resp = instance.updateVnfInstance(requestJson, "v3","557ea944-c83e-43cf-9ed7-3a354abd6d34","557ea944-c83e-43cf-9ed7-3a354abd6d93");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
        }\r
        \r
        /*** Update Vnf Instance Test Cases ***/\r
@@ -897,6 +900,6 @@ public class ServiceInstanceTest {
                                + "\"requestDetails\": {\"cloudConfiguration\":{\"lcpCloudRegionId\":\"2993841\",\"tenantId\":\"2910032\"}, \"relatedInstanceList\" :[{\"relatedInstance\":{\"instanceName\":\"testInstance\",\"instanceId\":\"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"4839499\"}}}],\"requestInfo\": { \"source\": \"VID\", \"requestorId\": \"zz9999\",\"instanceName\": \"testService\"},\"requestParameters\": { \"autoBuildVfModules\": false,\"subscriptionServiceType\": \"test\"},\"modelInfo\":{\"modelInvariantId\": \"557ea944-c83e-43cf-9ed7-3a354abd6d34\",\"modelVersion\":\"v2\",\"modelType\":\"service\",\"modelName\":\"serviceModel\",\"modelVersionId\":\"288393\",\"modelCustomizationId\":\"389823213\"}}}";\r
                Response resp = instance.deleteVnfInstance(requestJson, "v3","557ea944-c83e-43cf-9ed7-3a354abd6d34","557ea944-c83e-43cf-9ed7-3a354abd6d93");\r
                String respStr = resp.getEntity().toString();\r
-               assertTrue(respStr.indexOf("SVC2000") != -1);\r
+               assertTrue(respStr.contains("SVC2000"));\r
        }\r
 }\r
index 4305db3..1c3c856 100644 (file)
@@ -49,7 +49,7 @@ public class VfModuleModelNamesHandlerTest {
                new MockUp<CatalogDatabase>() {
                        @Mock
                        public  List <VfModule>  getAllVfModules(){
-                               List <VfModule> list = new ArrayList<VfModule>();
+                               List <VfModule> list = new ArrayList<>();
                                VfModule resource = new VfModule();
                                list.add(resource);
                                return list;
index 205bb8d..9c9ebae 100644 (file)
@@ -177,7 +177,7 @@ public class VnfRequestHandlerTest {
                        public List <InfraActiveRequests> getRequestListFromInfraActive (String queryAttributeName,
                     String queryValue,
                     String requestType) {
-                               List <InfraActiveRequests> list = new ArrayList<InfraActiveRequests>();
+                               List <InfraActiveRequests> list = new ArrayList<>();
                                InfraActiveRequests req = new InfraActiveRequests();
                                req.setAaiServiceId("299392");
                                req.setAction("CREATE");
@@ -202,7 +202,7 @@ public class VnfRequestHandlerTest {
                        public List <InfraActiveRequests> getRequestListFromInfraActive (String queryAttributeName,
                     String queryValue,
                     String requestType) {
-                               List <InfraActiveRequests> list = new ArrayList<InfraActiveRequests>();
+                               List <InfraActiveRequests> list = new ArrayList<>();
                                InfraActiveRequests req = new InfraActiveRequests();
                                req.setAaiServiceId("299392");
                                req.setAction("CREATE");
index 7eabc1a..1800bb4 100644 (file)
@@ -62,7 +62,7 @@ public class VnfTypesHandlerTest {
                new MockUp<CatalogDatabase>() {
                        @Mock
                        public  List <VnfResource>  getAllVnfResources(){
-                               List <VnfResource> list = new ArrayList<VnfResource>();
+                               List <VnfResource> list = new ArrayList<>();
                                VnfResource resource = new VnfResource();
                                list.add(resource);
                                return list;
index fa6b06b..fa5e094 100644 (file)
@@ -151,7 +151,7 @@ public class VolumeRequestHandlerTest {
                        public List <InfraActiveRequests> getRequestListFromInfraActive (String queryAttributeName,
                     String queryValue,
                     String requestType) {
-                               List <InfraActiveRequests> list = new ArrayList<InfraActiveRequests>();
+                               List <InfraActiveRequests> list = new ArrayList<>();
                                InfraActiveRequests req = new InfraActiveRequests();
                                req.setAaiServiceId("299392");
                                req.setAction("CREATE");
index e3c7cda..c88f31c 100644 (file)
@@ -30,7 +30,7 @@ public class MockRequestsDatabase {
        private Map<String, InfraActiveRequests> activeRequests;
        
        public MockRequestsDatabase() {
-               activeRequests = new HashMap<String, InfraActiveRequests>();
+               activeRequests = new HashMap<>();
        }
        
        public void addRecord(InfraActiveRequests record) {
index d9448d0..d6b0b6b 100644 (file)
@@ -178,7 +178,7 @@ public class RequestsDatabase {
         long startTime = System.currentTimeMillis ();
         msoLogger.debug ("Execute query on infra active request table");
         
-        List <InfraActiveRequests> results = new ArrayList<InfraActiveRequests>();
+        List <InfraActiveRequests> results = new ArrayList<>();
 
         Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
         try {
@@ -699,7 +699,7 @@ public class RequestsDatabase {
      * update the resource operation
      * <br>
      * 
-     * @param operstatus the resource operation object
+     * @param operStatus the resource operation object
      * @since ONAP Amsterdam Release
      */
     public void updateResOperStatus(ResourceOperationStatus operStatus) {
index 06eedc5..08d5ba7 100644 (file)
@@ -7,7 +7,6 @@
                <version>1.2.0-SNAPSHOT</version>
        </parent>
 
-       <groupId>org.onap.so</groupId>
        <artifactId>mso-api-handlers</artifactId>
        <name>API Handler</name>
        <description>API Handler for MSO</description>
index e3115f1..99977a4 100644 (file)
@@ -7,7 +7,6 @@
                <version>1.2.0-SNAPSHOT</version>
        </parent>
 
-       <groupId>org.onap.so</groupId>
        <artifactId>mso-catalog-db</artifactId>
        <name>mso-catalog-db</name>
        <description>MSO Catalog Database definition and Hibernate objects</description>
index 26b641d..6b27c50 100644 (file)
@@ -207,7 +207,7 @@ public class CatalogDatabase implements Closeable {
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. No template found", "CatalogDB", "getHeatTemplate", null);
             return null;
         }
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getHeatTemplate", null);
@@ -368,7 +368,7 @@ public class CatalogDatabase implements Closeable {
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Service not found", "CatalogDB", "getServiceByName", null);
             return null;
         }
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceByName", null);
@@ -530,7 +530,7 @@ public class CatalogDatabase implements Closeable {
             LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. Service not found", "CatalogDB", "getServiceByModelName", null);
             return null;
         }
-        Collections.sort(resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceByModelName", null);
@@ -602,7 +602,7 @@ public class CatalogDatabase implements Closeable {
                                 return null;
                         }
 
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceRecipe", null);
@@ -646,7 +646,7 @@ public class CatalogDatabase implements Closeable {
             return null;
         }
 
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceRecipe", null);
@@ -673,7 +673,7 @@ public class CatalogDatabase implements Closeable {
             return Collections.EMPTY_LIST;
         }
 
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getServiceRecipes", null);
@@ -750,7 +750,7 @@ public class CatalogDatabase implements Closeable {
             LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF not found", "CatalogDB", "getVnfResource", null);
             return null;
         }
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResource", null);
@@ -876,7 +876,7 @@ public class CatalogDatabase implements Closeable {
             return null;
         }
         
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResourceCustomizationByModelCustomizationName", null);
@@ -977,7 +977,7 @@ public class CatalogDatabase implements Closeable {
             LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VF not found", "CatalogDB", "getVfModuleModelName", null);
             return null;
         }
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleModelName", null);
@@ -1075,7 +1075,7 @@ public class CatalogDatabase implements Closeable {
             return null;
         }
 
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getNetworkResource", null);
         return resultList.get(0);
@@ -1124,7 +1124,7 @@ public class CatalogDatabase implements Closeable {
             return null;
         }
 
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfRecipe", null);
@@ -1141,14 +1141,13 @@ public class CatalogDatabase implements Closeable {
      * @return VnfRecipe object or null if none found
      */
     public VnfRecipe getVnfRecipe(String vnfType, String action) {
-        StringBuilder hql = new StringBuilder("FROM VnfRecipe WHERE vnfType = :vnfType AND action = :action ");
 
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database - get VNF recipe with name " + vnfType
                                       + " and action "
                                       + action);
 
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery("FROM VnfRecipe WHERE vnfType = :vnfType AND action = :action ");
         query.setParameter(VNF_TYPE, vnfType);
         query.setParameter(ACTION, action);
 
@@ -1160,7 +1159,7 @@ public class CatalogDatabase implements Closeable {
             return null;
         }
 
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfRecipe", null);
@@ -1176,14 +1175,11 @@ public class CatalogDatabase implements Closeable {
      * @return VnfRecipe object or null if none found
      */
     public VnfRecipe getVnfRecipeByNameVersion(String modelName, String modelVersion, String action) {
-        StringBuilder hql = new StringBuilder("FROM VnfRecipe WHERE vnfType = :vnfType AND version= :version AND action = :action ");
 
         long startTime = System.currentTimeMillis();
-        LOGGER.debug("Catalog database - get VNF recipe with name " + modelName
-                                      + " and action "
-                                      + action);
+        LOGGER.debug("Catalog database - get VNF recipe with name " + modelName + " and action " + action);
 
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery("FROM VnfRecipe WHERE vnfType = :vnfType AND version= :version AND action = :action ");
         query.setParameter(VNF_TYPE, modelName);
         query.setParameter(MODEL_VERSION, modelVersion);
         query.setParameter(ACTION, action);
@@ -1196,7 +1192,7 @@ public class CatalogDatabase implements Closeable {
             return null;
         }
 
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfRecipe", null);
@@ -1233,12 +1229,10 @@ public class CatalogDatabase implements Closeable {
      */
     public VnfRecipe getVnfRecipeByVfModuleId(String vnfType, String vfModuleId, String action) {
 
-       StringBuilder hql = new StringBuilder("FROM VnfRecipe WHERE vfModuleId = :vfModuleId and action = :action  ");
-
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database - get VNF Recipe with vfModuleId " + vfModuleId);
 
-        Query query = getSession().createQuery(hql.toString ());
+        Query query = getSession().createQuery("FROM VnfRecipe WHERE vfModuleId = :vfModuleId and action = :action  ");
         query.setParameter(VF_MODULE_MODEL_UUID, vfModuleId);
         query.setParameter(ACTION, action);
 
@@ -1250,7 +1244,7 @@ public class CatalogDatabase implements Closeable {
             return null;
         }
 
-        Collections.sort(resultList, new MavenLikeVersioningComparator());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse(resultList);
 
         LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF Recipe Entry found", "CatalogDB", "getVnfRecipeByVfModuleId", null);
@@ -1307,7 +1301,7 @@ public class CatalogDatabase implements Closeable {
             LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VF not found", "CatalogDB", "getVfModuleType", null);
             return null;
        }
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleType", null);
@@ -1434,7 +1428,7 @@ public class CatalogDatabase implements Closeable {
         VfModule module = null;
         
         if (modules != null && ! modules.isEmpty()) {
-               Collections.sort (modules, new MavenLikeVersioningComparator ());
+               modules.sort(new MavenLikeVersioningComparator());
                Collections.reverse (modules);
                module =  modules.get(0);
         }
@@ -1641,7 +1635,7 @@ public class CatalogDatabase implements Closeable {
      * Return the VnfResourceCustomization object identified by the given modelCustomizationUuid 1707
      * Note that the corresponding VnfResource Object will be put in the VnfResourceCustomization bean
      *
-     * @param getVnfResourceCustomizationByModelVersionId
+     * @param modelVersionId
      * @return VnfResourceCustomization or null if not found
      */
     public VnfResourceCustomization getVnfResourceCustomizationByModelVersionId(String modelVersionId) {
@@ -1890,7 +1884,7 @@ public class CatalogDatabase implements Closeable {
             return null;
         }
         
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResourceCustomizationByVnfModelCustomizationNameAndModelVersionId", null);
@@ -1923,7 +1917,7 @@ public class CatalogDatabase implements Closeable {
      * Return the VnfResourceCustomization object identified by the given modelCustomizationUuid 1707
      * Note that the corresponding VnfResource Object will be put in the VnfResourceCustomization bean
      *
-     * @param modelCustomizationUuid
+     * @param modelUuid
      * @return VnfResourceCustomization or null if not found
      */
     public VnfResource getVnfResourceByModelUuid(String modelUuid) {
@@ -1954,17 +1948,17 @@ public class CatalogDatabase implements Closeable {
         } else {
                LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfResourceByModelUuid", null);
         }
-        return vnfResource;    
+        return vnfResource;
     }
-    
+
     public VnfResCustomToVfModuleCustom getVnfResCustomToVfModule(String vnfId, String vfId) {
        long startTime = System.currentTimeMillis();
        LOGGER.debug("Catalog database - getVnfResCustomToVfModule - vnfResourceCustModelCustUuid: " + vnfId + ", vfModuleCustModelCustomUuid=" + vfId);
-       StringBuilder hql = new StringBuilder("FROM VnfResCustomToVfModuleCustom where vnfResourceCustModelCustomizationUuid = :vnfIdValue and vfModuleCustModelCustomizationUuid = :vfIdValue");       
-       HashMap<String, String> parameters = new HashMap<>();
+        HashMap<String, String> parameters = new HashMap<>();
        parameters.put("vnfIdValue", vnfId);
        parameters.put("vfIdValue", vfId);
-       VnfResCustomToVfModuleCustom vrctvmc = this.executeQuerySingleRow(hql.toString(), parameters, true);
+       VnfResCustomToVfModuleCustom vrctvmc = this.executeQuerySingleRow(
+            "FROM VnfResCustomToVfModuleCustom where vnfResourceCustModelCustomizationUuid = :vnfIdValue and vfModuleCustModelCustomizationUuid = :vfIdValue", parameters, true);
         if (vrctvmc == null) {
                LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "NotFound", "CatalogDB", "getVnfResCustomToVfModule", null);
         } else {
@@ -1987,8 +1981,7 @@ public class CatalogDatabase implements Closeable {
     public List<VfModule> getVfModulesForVnfResource(String vnfResourceModelUuid) {
         long startTime = System.currentTimeMillis();
        LOGGER.debug("Catalog database - getVfModulesForVnfResource - vnfResourceModelUuid: " + vnfResourceModelUuid);
-       StringBuilder hql = new StringBuilder("FROM VfModule where vnfResourceModelUUId = :vnfResourceModelUUId");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery("FROM VfModule where vnfResourceModelUUId = :vnfResourceModelUUId");
        query.setParameter("vnfResourceModelUUId", vnfResourceModelUuid);
         List<VfModule> resultList = null;
         try {
@@ -2236,8 +2229,7 @@ public class CatalogDatabase implements Closeable {
     public List<NetworkResourceCustomization> getAllNetworksByServiceModelInvariantUuid(String serviceModelInvariantUuid) {
         LOGGER.debug("Catalog database: getServiceNetworksByServiceModelInvariantUuid - " + serviceModelInvariantUuid);
 
-        StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         @SuppressWarnings("unchecked")
         List<Service> serviceList = query.list();
@@ -2247,7 +2239,7 @@ public class CatalogDatabase implements Closeable {
             return new ArrayList<>();
         }
 
-        Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+        serviceList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
@@ -2260,8 +2252,8 @@ public class CatalogDatabase implements Closeable {
     public List<NetworkResourceCustomization> getAllNetworksByServiceModelInvariantUuid(String serviceModelInvariantUuid, String serviceModelVersion) {
         LOGGER.debug("Catalog database: getServiceNetworksByServiceModelInvariantUuid - " + serviceModelInvariantUuid + ", version=" + serviceModelVersion);
 
-        StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery(
+            "FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         query.setParameter("serviceModelVersion", serviceModelVersion);
 
@@ -2275,7 +2267,7 @@ public class CatalogDatabase implements Closeable {
             return new ArrayList<>();
         }
 
-        Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+        serviceList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
@@ -2289,18 +2281,18 @@ public class CatalogDatabase implements Closeable {
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllNetworksByNetworkModelCustomizationUuid - " + networkModelCustomizationUuid);
 
-        StringBuilder hql = new StringBuilder("FROM NetworkResourceCustomization WHERE modelCustomizationUuid = :networkModelCustomizationUuid");
-       //Query query = getSession().createQuery(hql.toString());
+        //Query query = getSession().createQuery(hql.toString());
        //query.setParameter("networkModelCustomizationUuid", networkModelCustomizationUuid);
        //LOGGER.debug("QUERY: " + hql.toString() + ", networkModelCustomizationUuid=" + networkModelCustomizationUuid);
-       
+
        //@SuppressWarnings("unchecked")
        //List<NetworkResourceCustomization> resultList = query.list();
-       
+
        HashMap<String, String> params = new HashMap<>();
        params.put("networkModelCustomizationUuid", networkModelCustomizationUuid);
 
-       List<NetworkResourceCustomization> resultList = this.executeQueryMultipleRows(hql.toString(), params, true);
+       List<NetworkResourceCustomization> resultList = this.executeQueryMultipleRows(
+            "FROM NetworkResourceCustomization WHERE modelCustomizationUuid = :networkModelCustomizationUuid", params, true);
 
        if (resultList.isEmpty()) {
                LOGGER.debug("Unable to find an NMC with nmcu=" + networkModelCustomizationUuid);
@@ -2309,7 +2301,6 @@ public class CatalogDatabase implements Closeable {
        for (NetworkResourceCustomization nrc : resultList) {
                nrc.setNetworkResource(this.getNetworkResourceById(nrc.getNetworkResourceModelUuid()));
        }
-       
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllNetworksByNetworkModelCustomizationUuid", null);
         return resultList;
@@ -2326,9 +2317,9 @@ public class CatalogDatabase implements Closeable {
        String networkResourceId = nr.getModelUUID();
 
         LOGGER.debug("Now searching for NRC's with networkResourceId = " + networkResourceId);
-       StringBuilder hql = new StringBuilder("FROM NetworkResourceCustomization WHERE networkResourceModelUuid = :networkResourceId");
 
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery(
+            "FROM NetworkResourceCustomization WHERE networkResourceModelUuid = :networkResourceId");
         query.setParameter("networkResourceId", networkResourceId);
 
         @SuppressWarnings("unchecked")
@@ -2347,7 +2338,7 @@ public class CatalogDatabase implements Closeable {
     }
     public ArrayList<VfModuleCustomization> getAllVfmcForVrc(VnfResourceCustomization vrc) {
        LOGGER.debug("Catalog database: getAllVfmcForVrc - " + vrc.getModelCustomizationUuid());
-       
+
        List<VnfResCustomToVfModuleCustom> vfmcs = this.getVRCtoVFMC(vrc.getModelCustomizationUuid(), null);
        if (vfmcs == null || vfmcs.isEmpty()) {
                return new ArrayList<>();
@@ -2367,8 +2358,7 @@ public class CatalogDatabase implements Closeable {
     public List<VnfResourceCustomization> getAllVnfsByServiceModelUuid(String serviceModelUuid) {
         LOGGER.debug("Catalog database: getAllVnfsByServiceModelUuid - " + serviceModelUuid);
 
-       StringBuilder hql = new StringBuilder("FROM Service WHERE modelUUID = :serviceModelUuid");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery("FROM Service WHERE modelUUID = :serviceModelUuid");
         query.setParameter("serviceModelUuid", serviceModelUuid);
         @SuppressWarnings("unchecked")
         List<Service> serviceList = query.list();
@@ -2378,7 +2368,7 @@ public class CatalogDatabase implements Closeable {
                return new ArrayList<>();
         }
 
-        Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+        serviceList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (serviceList);
 
         // Step 2 - Now query to get the related VnfResourceCustomizations
@@ -2389,7 +2379,7 @@ public class CatalogDatabase implements Closeable {
                LOGGER.debug("Unable to find any related vnfs to a service with modelUuid=" + serviceModelUuid);
                return new ArrayList<>();
     }
-        
+
         ArrayList<VnfResourceCustomization> allVrcs = new ArrayList<>();
         for (ServiceToResourceCustomization strc : strcs) {
                LOGGER.debug("Try to find VRC for mcu=" + strc.getResourceModelCustomizationUUID());
@@ -2398,13 +2388,12 @@ public class CatalogDatabase implements Closeable {
                        allVrcs.add(vrc);
         }
         return allVrcs;
-       
+
     }
     public List<VnfResourceCustomization> getAllVnfsByServiceModelInvariantUuid(String serviceModelInvariantUuid) {
         LOGGER.debug("Catalog database: getAllVnfsByServiceModelInvariantUuid - " + serviceModelInvariantUuid);
 
-        StringBuilder hqlService = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
-        Query query = getSession().createQuery(hqlService.toString());
+        Query query = getSession().createQuery("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         @SuppressWarnings("unchecked")
         List<Service> resultList = query.list();
@@ -2412,7 +2401,7 @@ public class CatalogDatabase implements Closeable {
         if (resultList.isEmpty()) {
                return new ArrayList<>();
         }
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
         Service service = resultList.get(0);
         //now just call the method that takes the version - the service object will have the highest version
@@ -2422,8 +2411,8 @@ public class CatalogDatabase implements Closeable {
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllVnfsByServiceModelInvariantUuid - " + serviceModelInvariantUuid + ", version=" + serviceModelVersion);
 
-       StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery(
+            "FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         query.setParameter("serviceModelVersion", serviceModelVersion);
 
@@ -2433,7 +2422,7 @@ public class CatalogDatabase implements Closeable {
         if (resultList.isEmpty()) {
                return new ArrayList<>();
                 }
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
         Service service = resultList.get(0);
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllVnfsByServiceModelInvariantUuid", null);
@@ -2446,8 +2435,8 @@ public class CatalogDatabase implements Closeable {
             return this.getAllVnfsByServiceName(serviceName);
         }
 
-       StringBuilder hql = new StringBuilder("FROM Service WHERE modelName = :serviceName and version = :serviceVersion");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery(
+            "FROM Service WHERE modelName = :serviceName and version = :serviceVersion");
         query.setParameter("serviceName", serviceName);
         query.setParameter("serviceVersion", serviceVersion);
 
@@ -2463,8 +2452,7 @@ public class CatalogDatabase implements Closeable {
     public List<VnfResourceCustomization> getAllVnfsByServiceName(String serviceName) {
         LOGGER.debug("Catalog database: getAllVnfsByServiceName - " + serviceName);
 
-       StringBuilder hql = new StringBuilder("FROM Service WHERE modelName = :serviceName");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery("FROM Service WHERE modelName = :serviceName");
         query.setParameter("serviceName", serviceName);
 
         @SuppressWarnings("unchecked")
@@ -2473,7 +2461,7 @@ public class CatalogDatabase implements Closeable {
         if (resultList.isEmpty()) {
             return Collections.EMPTY_LIST;
         }
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
         Service service = resultList.get(0);
 
@@ -2484,8 +2472,7 @@ public class CatalogDatabase implements Closeable {
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllVnfsByVnfModelCustomizationUuid - " + vnfModelCustomizationUuid);
 
-       StringBuilder hql1 = new StringBuilder("FROM VnfResourceCustomization WHERE modelCustomizationUuid = :vrcmcu");
-       Query query1 = getSession().createQuery(hql1.toString());
+        Query query1 = getSession().createQuery("FROM VnfResourceCustomization WHERE modelCustomizationUuid = :vrcmcu");
        query1.setParameter("vrcmcu", vnfModelCustomizationUuid);
         @SuppressWarnings("unchecked")
        List<VnfResourceCustomization> resultList1 = query1.list();
@@ -2494,12 +2481,12 @@ public class CatalogDatabase implements Closeable {
             LOGGER.debug("Found no records matching " + vnfModelCustomizationUuid);
             return Collections.EMPTY_LIST;
         }
-       
-       for (VnfResourceCustomization vrc : resultList1) {
-               VnfResource vr = this.getVnfResourceByModelUuid(vrc.getVnfResourceModelUuid());
-               vrc.setVnfResource(vr);
-               vrc.setVfModuleCustomizations(this.getAllVfmcForVrc(vrc));
-                }
+
+        for (VnfResourceCustomization vrc : resultList1) {
+            VnfResource vr = this.getVnfResourceByModelUuid(vrc.getVnfResourceModelUuid());
+            vrc.setVnfResource(vr);
+            vrc.setVfModuleCustomizations(this.getAllVfmcForVrc(vrc));
+        }
 
        LOGGER.debug("Returning " + resultList1.size() + " vnf modules");
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getAllVnfsByVnfModelCustomizationUuid", null);
@@ -2534,8 +2521,7 @@ public class CatalogDatabase implements Closeable {
     public List<AllottedResourceCustomization> getAllAllottedResourcesByServiceModelInvariantUuid(String serviceModelInvariantUuid) {
         LOGGER.debug("Catalog database: getAllAllottedResourcesByServiceModelInvariantUuid - " + serviceModelInvariantUuid);
 
-        StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         @SuppressWarnings("unchecked")
         List<Service> serviceList = query.list();
@@ -2545,7 +2531,7 @@ public class CatalogDatabase implements Closeable {
             return new ArrayList<>();
         }
 
-        Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+        serviceList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
@@ -2558,8 +2544,8 @@ public class CatalogDatabase implements Closeable {
     public List<AllottedResourceCustomization> getAllAllottedResourcesByServiceModelInvariantUuid(String serviceModelInvariantUuid, String serviceModelVersion) {
         LOGGER.debug("Catalog database: getAllAllottedResourcesByServiceModelInvariantUuid - " + serviceModelInvariantUuid + ", version=" + serviceModelVersion);
 
-        StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery(
+            "FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         query.setParameter("serviceModelVersion", serviceModelVersion);
 
@@ -2571,7 +2557,7 @@ public class CatalogDatabase implements Closeable {
             return new ArrayList<>();
         }
 
-        Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+        serviceList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
@@ -2584,8 +2570,8 @@ public class CatalogDatabase implements Closeable {
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllAllottedResourcesByArModelCustomizationUuid - " + arModelCustomizationUuid);
 
-        StringBuilder hql = new StringBuilder("FROM AllottedResourceCustomization WHERE modelCustomizationUuid = :arModelCustomizationUuid");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery(
+            "FROM AllottedResourceCustomization WHERE modelCustomizationUuid = :arModelCustomizationUuid");
         query.setParameter("arModelCustomizationUuid", arModelCustomizationUuid);
 
         @SuppressWarnings("unchecked")
@@ -2643,7 +2629,7 @@ public class CatalogDatabase implements Closeable {
             return new ServiceMacroHolder();
         }
 
-        Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+        serviceList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
@@ -2662,8 +2648,7 @@ public class CatalogDatabase implements Closeable {
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllResourcesByServiceModelInvariantUuid - " + serviceModelInvariantUuid);
 
-        StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid");
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         @SuppressWarnings("unchecked")
         List<Service> serviceList = query.list();
@@ -2673,7 +2658,7 @@ public class CatalogDatabase implements Closeable {
             return new ServiceMacroHolder();
         }
 
-        Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+        serviceList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
@@ -2693,8 +2678,8 @@ public class CatalogDatabase implements Closeable {
         long startTime = System.currentTimeMillis();
         LOGGER.debug("Catalog database: getAllResourcesByServiceModelInvariantUuid - " + serviceModelInvariantUuid + ", version=" + serviceModelVersion);
 
-        StringBuilder hql = new StringBuilder("FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
-        Query query = getSession().createQuery(hql.toString());
+        Query query = getSession().createQuery(
+            "FROM Service WHERE modelInvariantUUID = :serviceModelInvariantUuid and version = :serviceModelVersion");
         query.setParameter("serviceModelInvariantUuid", serviceModelInvariantUuid);
         query.setParameter("serviceModelVersion", serviceModelVersion);
         //TODO make this a unique query
@@ -2706,7 +2691,7 @@ public class CatalogDatabase implements Closeable {
             return new ServiceMacroHolder();
         }
 
-        Collections.sort (serviceList, new MavenLikeVersioningComparator ());
+        serviceList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (serviceList);
         Service service = serviceList.get(0);
 
@@ -2754,7 +2739,7 @@ public class CatalogDatabase implements Closeable {
     }
 
     private void populateNetworkResourceType(List<NetworkResourceCustomization> resultList) {
-        HashMap<String, NetworkResource> networkResources = new HashMap<String, NetworkResource>();
+        HashMap<String, NetworkResource> networkResources = new HashMap<>();
 
         for (NetworkResourceCustomization nrc : resultList) {
                String network_id = nrc.getNetworkResourceModelUuid();
@@ -2792,12 +2777,10 @@ public class CatalogDatabase implements Closeable {
     public VnfRecipe getVfModuleRecipe (String vnfType, String vfModuleModelName, String action) {
        String vfModuleType = vnfType + "::" + vfModuleModelName;
 
-       StringBuilder hql = new StringBuilder ("FROM VfModule WHERE type = :type ");
-
         long startTime = System.currentTimeMillis ();
         LOGGER.debug ("Catalog database - get VF MODULE  with type " + vfModuleType);
 
-        Query query = getSession ().createQuery (hql.toString ());
+        Query query = getSession ().createQuery ("FROM VfModule WHERE type = :type ");
         query.setParameter (TYPE, vfModuleType);
 
         @SuppressWarnings("unchecked")
@@ -2808,20 +2791,18 @@ public class CatalogDatabase implements Closeable {
             return null;
         }
 
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
 
         VfModule vfMod = resultList.get(0);
 
         String vfModuleId = vfMod.getModelUUID();
 
-        StringBuilder hql1 = new StringBuilder ("FROM VnfRecipe WHERE vfModuleId = :vfModuleId AND action = :action ");
-
         LOGGER.debug ("Catalog database - get VNF recipe with vf module id " + vfModuleId
                                       + " and action "
                                       + action);
 
-        Query query1 = getSession ().createQuery (hql1.toString ());
+        Query query1 = getSession ().createQuery ("FROM VnfRecipe WHERE vfModuleId = :vfModuleId AND action = :action ");
         query1.setParameter (VF_MODULE_MODEL_UUID, vfModuleId);
         query1.setParameter (ACTION, action);
 
@@ -2833,7 +2814,7 @@ public class CatalogDatabase implements Closeable {
             return null;
         }
 
-        Collections.sort (resultList1, new MavenLikeVersioningComparator ());
+        resultList1.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList1);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe found", "CatalogDB", "getVfModuleRecipe", null);
@@ -2844,7 +2825,7 @@ public class CatalogDatabase implements Closeable {
      * Return a VNF Module List that matches a given VNF_TYPE, VF_MODULE_MODEL_NAME,
      * ASDC_SERVICE_MODEL_VERSION, MODEL_VERSION, and ACTION
      *
-     * @param vnfModuleType
+     * @param vfModuleType
      * @parm modelCustomizationUuid
      * @param asdcServiceModelVersion
      * @param modelVersion
@@ -2900,20 +2881,19 @@ public class CatalogDatabase implements Closeable {
             return null;
         }
 
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
 
         VfModule vfMod = resultList.get(0);
 
         String vfModuleId = vfMod.getModelUUID();
 
-        StringBuilder hql1 = new StringBuilder ("FROM VnfComponentsRecipe WHERE vfModuleId = :vfModuleId AND action = :action ");
-
         LOGGER.debug ("Catalog database - get Vnf Components recipe with vf module id " + vfModuleId
                 + " and action "
                 + action);
 
-        Query query1 = getSession ().createQuery (hql1.toString ());
+        Query query1 = getSession ().createQuery (
+            "FROM VnfComponentsRecipe WHERE vfModuleId = :vfModuleId AND action = :action ");
         query1.setParameter (VF_MODULE_MODEL_UUID, vfModuleId);
         query1.setParameter (ACTION, action);
 
@@ -2925,7 +2905,7 @@ public class CatalogDatabase implements Closeable {
             return null;
         }
 
-        Collections.sort (resultList1, new MavenLikeVersioningComparator ());
+        resultList1.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList1);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe found", "CatalogDB", "getVnfComponentsRecipe", null);
@@ -2955,20 +2935,19 @@ public class CatalogDatabase implements Closeable {
             return null;
         }
 
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
 
         VfModule vfMod = resultList.get(0);
 
-        String vfModuleId = vfMod.getModelName();      
-
-        StringBuilder hql1 = new StringBuilder ("FROM VnfComponentsRecipe WHERE vfModuleId = :vfModuleId AND action = :action ");
+        String vfModuleId = vfMod.getModelName();
 
         LOGGER.debug ("Catalog database - get Vnf Components recipe with vf module id " + vfModuleId
                                       + " and action "
                                       + action);
 
-        Query query1 = getSession ().createQuery (hql1.toString ());
+        Query query1 = getSession ().createQuery (
+            "FROM VnfComponentsRecipe WHERE vfModuleId = :vfModuleId AND action = :action ");
         query1.setParameter (VF_MODULE_MODEL_UUID, vfModuleId);
         query1.setParameter (ACTION, action);
 
@@ -2980,7 +2959,7 @@ public class CatalogDatabase implements Closeable {
             return null;
         }
 
-        Collections.sort (resultList1, new MavenLikeVersioningComparator ());
+        resultList1.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList1);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully. VNF recipe found", "CatalogDB", "getVnfComponentsRecipe", null);
@@ -3384,7 +3363,9 @@ public class CatalogDatabase implements Closeable {
     /**
      * Return a ServiceToResourceCustomization object 
      * 
-     * @param vfModuleModelUuid, heatFilesArtifactUuid
+     * @param serviceModelUuid
+     * @param resourceModelCustomizationUuid
+     * @param modelType
      * @return VfModuleToHeatFiles or null if none found
      */ 
     public ServiceToResourceCustomization getServiceToResourceCustomization(String serviceModelUuid, String resourceModelCustomizationUuid, String modelType) {
@@ -3410,7 +3391,7 @@ public class CatalogDatabase implements Closeable {
     /**
      * Return a Map<String, HeatFiles> for returning the heat files associated with a vfModule 1707
      * 
-     * @param parentHeatTemplateId
+     * @param vfModuleModelUuid
      * @return Map<String,Object> or null if none found
      */ 
     public Map <String, HeatFiles> getHeatFilesForVfModule(String vfModuleModelUuid) {
@@ -3626,7 +3607,7 @@ public class CatalogDatabase implements Closeable {
     /**
      * Retrieves a Heat environment from DB based on its unique key. 1707
      *
-     * @param name the environment artifact name
+     * @param artifactUuid the environment artifact name
      * @param version the environment resource version
      * @return the heat environment from DB or null if not found
      */
@@ -3859,7 +3840,7 @@ public class CatalogDatabase implements Closeable {
     /**
      * Return the newest version of a specific Tosca CSAR Record resource (queried by Name).
      *
-     * @param ToscaCsar
+     * @param artifactChecksum
      * @return ToscaCsar object or null if none found
      */
     public ToscaCsar getToscaCsar (String artifactChecksum) {
@@ -4422,9 +4403,7 @@ public class CatalogDatabase implements Closeable {
     /**
      * Return a Network Resource that matches the Network Customization defined by given MODEL_CUSTOMIZATION_UUID
      *
-     * @param networkType
-     * @param action
-     * @param serviceType
+     * @param modelUUID
      * @return NetworkRecipe object or null if none found
      */
     public NetworkResource getNetworkResourceByModelUuid(String modelUUID) {
@@ -4444,7 +4423,7 @@ public class CatalogDatabase implements Closeable {
                 return null;
             }
             
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
             
             return resultList.get (0);
@@ -4495,7 +4474,7 @@ public class CatalogDatabase implements Closeable {
                 return null;
             }
 
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
 
             return resultList.get (0);
@@ -4554,7 +4533,7 @@ public class CatalogDatabase implements Closeable {
                 return null;
             }
 
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
 
             return resultList.get (0);
@@ -4594,7 +4573,7 @@ public class CatalogDatabase implements Closeable {
                 return null;
             }
 
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
 
             return resultList.get (0);
@@ -4606,9 +4585,7 @@ public class CatalogDatabase implements Closeable {
     /**
      * Return a Network Resource that matches the Network Customization defined by given MODEL_CUSTOMIZATION_UUID
      *
-     * @param networkType
-     * @param action
-     * @param serviceType
+     * @param modelCustomizationUuid
      * @return NetworkRecipe object or null if none found
      */
     public NetworkResource getNetworkResourceByModelCustUuid(String modelCustomizationUuid) {
@@ -4628,7 +4605,7 @@ public class CatalogDatabase implements Closeable {
                 return null;
             }
 
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
 
             return resultList.get (0);
@@ -4685,7 +4662,7 @@ public class CatalogDatabase implements Closeable {
             if (resultList.isEmpty ()) {
                 return null;
             }
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
 
             return resultList.get (0);
@@ -4697,7 +4674,7 @@ public class CatalogDatabase implements Closeable {
     /**
      * Return a VnfComponents recipe that matches a given VF_MODULE_ID, VNF_COMPONENT_TYPE, ACTION
      *
-     * @param vfModuleId
+     * @param vfModuleModelUUId
      * @param vnfComponentType
      * @param action
      * @return VnfComponentsRecipe object or null if none found
@@ -4728,7 +4705,7 @@ public class CatalogDatabase implements Closeable {
             if (resultList.isEmpty ()) {
                 return null;
             }
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
 
             return resultList.get (0);
@@ -4757,7 +4734,7 @@ public class CatalogDatabase implements Closeable {
             return Collections.EMPTY_LIST;
         }
         
-        Collections.sort (resultList, new MavenLikeVersioningComparator ());
+        resultList.sort(new MavenLikeVersioningComparator());
         Collections.reverse (resultList);
 
         LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVfModuleRecipes", null);
@@ -4807,7 +4784,7 @@ public class CatalogDatabase implements Closeable {
             if (resultList.isEmpty ()) {
                 return null;
             }
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
 
             return resultList.get (0);
@@ -4819,7 +4796,7 @@ public class CatalogDatabase implements Closeable {
     /**
      * Return a VfModule record that matches a given MODEL_NAME
      *
-     * @param modelName
+     * @param modelUUID
      * @return VfModule object or null if none found
      */
     public VfModule getVfModuleByModelUUID (String modelUUID) {
@@ -4841,7 +4818,7 @@ public class CatalogDatabase implements Closeable {
             if (resultList.isEmpty ()) {
                 return null;
             }
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
 
             return resultList.get (0);
@@ -4882,7 +4859,7 @@ public class CatalogDatabase implements Closeable {
                                LOGGER.debug("Catalog database - recipeResultList is null");
                                return null;
                        }
-                       Collections.sort(recipeResultList, new MavenLikeVersioningComparator());
+                       recipeResultList.sort(new MavenLikeVersioningComparator());
                        Collections.reverse(recipeResultList);
                        LOGGER.debug("Catalog database - recipeResultList contains " + recipeResultList.get(0).toString());
 
@@ -4954,7 +4931,7 @@ public class CatalogDatabase implements Closeable {
                                LOGGER.debug("Catalog database - recipeResultList is null");
                                return null;
                        }
-                       Collections.sort(recipeResultList, new MavenLikeVersioningComparator());
+                       recipeResultList.sort(new MavenLikeVersioningComparator());
                        Collections.reverse(recipeResultList);
                        LOGGER.debug("Catalog database - recipeResultList contains " + recipeResultList.get(0).toString());
 
@@ -5002,7 +4979,7 @@ public class CatalogDatabase implements Closeable {
                 LOGGER.debug("Catalog database - modelResultList is null");
                 return null;
             }
-            Collections.sort(modelResultList, new MavenLikeVersioningComparator());
+            modelResultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse(modelResultList);
             LOGGER.debug("Catalog database - modelResultList contains " + modelResultList.get(0).toString());
 
@@ -5019,7 +4996,7 @@ public class CatalogDatabase implements Closeable {
                 LOGGER.debug("Catalog database - recipeResultList is null");
                 return null;
             }
-            Collections.sort(recipeResultList, new MavenLikeVersioningComparator());
+            recipeResultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse(recipeResultList);
             LOGGER.debug("Catalog database - recipeResultList contains " + recipeResultList.get(0).toString());
 
@@ -5181,7 +5158,7 @@ public class CatalogDatabase implements Closeable {
                 return null;
             }
 
-            Collections.sort (resultList, new MavenLikeVersioningComparator ());
+            resultList.sort(new MavenLikeVersioningComparator());
             Collections.reverse (resultList);
 
             return resultList.get (0);
index daeefcc..6fdf236 100644 (file)
@@ -130,20 +130,12 @@ public class AllottedResourceCustomization extends MavenLikeVersioning implement
        }
 
        @Override
-       public String toString () {
-               StringBuilder sb = new StringBuilder();
-               sb.append("modelCustomizationUuid=");
-               sb.append(this.modelCustomizationUuid);
-               sb.append(",modelInstanceName=");
-               sb.append(this.modelInstanceName);
-               sb.append(",modelInstanceName=");
-               sb.append(this.modelInstanceName);
-               sb.append(",created=");
-               sb.append(this.created);
-               sb.append(",ar=");
-               sb.append(this.ar);
-
-               return sb.toString();
+       public String toString() {
+               return "modelCustomizationUuid=" + this.modelCustomizationUuid +
+                       ",modelInstanceName=" + this.modelInstanceName +
+                       ",modelInstanceName=" + this.modelInstanceName +
+                       ",created=" + this.created +
+                       ",ar=" + this.ar;
        }
 
 }
index b4c1f05..e22d1eb 100644 (file)
@@ -37,10 +37,6 @@ public class ArRecipe extends Recipe implements Serializable {
 
     @Override
        public String toString () {
-               StringBuilder sb = new StringBuilder();
-               sb.append(super.toString());
-               sb.append(",modelName=").append(modelName);
-               sb.append(",arParamXSD=").append(getParamXSD());
-               return sb.toString();
+               return super.toString() + ",modelName=" + modelName + ",arParamXSD=" + getParamXSD();
        }
 }
index 54acf12..f6202b7 100644 (file)
@@ -44,15 +44,12 @@ public class HeatTemplateArtifactUuidModelUuid implements Serializable {
        public void setModelUuid(String modelUuid) {\r
                this.modelUuid = modelUuid;\r
        }\r
-       \r
+\r
        @Override\r
        public String toString() {\r
-               StringBuilder sb = new StringBuilder();\r
-               sb.append("heatTemplateArtifactUuid=").append(this.heatTemplateArtifactUuid);\r
-               sb.append(" modelUuid=").append(this.modelUuid);\r
-               return sb.toString();\r
+               return "heatTemplateArtifactUuid=" + this.heatTemplateArtifactUuid + " modelUuid=" + this.modelUuid;\r
        }\r
-       \r
+\r
     @Override\r
     public boolean equals (Object o) {\r
         if (!(o instanceof HeatTemplateArtifactUuidModelUuid)) {\r
@@ -73,9 +70,7 @@ public class HeatTemplateArtifactUuidModelUuid implements Serializable {
     public int hashCode () {\r
         // hash code does not have to be a unique result - only that two objects that should be treated as equal\r
         // return the same value. so this should work.\r
-        int result;\r
-        result = this.heatTemplateArtifactUuid.hashCode() + this.modelUuid.hashCode();\r
-        return result;\r
+        return this.heatTemplateArtifactUuid.hashCode() + this.modelUuid.hashCode();\r
     }\r
 \r
 }\r
index 7f8c3db..7ef5a4a 100644 (file)
@@ -89,7 +89,7 @@ public class ModelRecipe extends MavenLikeVersioning implements Serializable {
        }
 
        /**
-        * @param versionStr the versionStr to set
+        * @param schemaVersion the versionStr to set
         */
        public void setSchemaVersion(String schemaVersion) {
                this.schemaVersion = schemaVersion;
index 4e905b6..eeaa363 100644 (file)
@@ -37,10 +37,6 @@ public class NetworkRecipe extends Recipe implements Serializable {
 
        @Override
        public String toString () {
-               StringBuilder sb = new StringBuilder();
-               sb.append(super.toString());
-               sb.append(",modelName=").append(modelName);
-               sb.append(",networkParamXSD=").append(getParamXSD());
-               return sb.toString();
+               return super.toString() + ",modelName=" + modelName + ",networkParamXSD=" + getParamXSD();
        }
 }
index ef09fef..b581545 100644 (file)
@@ -103,24 +103,14 @@ public class NetworkResourceCustomization implements Serializable{
        }
 
        @Override
-       public String toString () {
-               StringBuilder sb = new StringBuilder();
-               sb.append("modelCustomizationUuid=");
-               sb.append(this.modelCustomizationUuid);
-               sb.append("networkResourceModelUuid=");
-               sb.append(this.networkResourceModelUuid);
-               sb.append("modelInstanceName=");
-               sb.append(this.modelInstanceName);
-               sb.append("networkType=");
-               sb.append(this.networkType);
-               sb.append("networkTechnology=");
-               sb.append(this.networkTechnology);
-               sb.append("networkScope=");
-               sb.append(this.networkScope);
-               sb.append("networkRole=");
-               sb.append(this.networkRole);
-
-               return sb.toString();
+       public String toString() {
+               return "modelCustomizationUuid=" + this.modelCustomizationUuid +
+                       "networkResourceModelUuid=" + this.networkResourceModelUuid +
+                       "modelInstanceName=" + this.modelInstanceName +
+                       "networkType=" + this.networkType +
+                       "networkTechnology=" + this.networkTechnology +
+                       "networkScope=" + this.networkScope +
+                       "networkRole=" + this.networkRole;
        }
 
     @Override
index 645626d..78f94e4 100644 (file)
@@ -43,7 +43,7 @@ public class ServiceMacroHolder implements Serializable {
        public ServiceMacroHolder() {
                super();
                this.service = null;
-               this.vnfResources = new ArrayList<VnfResource>();
+               this.vnfResources = new ArrayList<>();
                this.networkResourceCustomizations = new ArrayList<>();
                this.allottedResourceCustomizations = new ArrayList<>();
                this.vnfResourceCustomizations = new ArrayList<>();
index 59495f4..6515a12 100644 (file)
@@ -71,22 +71,16 @@ public class ServiceToAllottedResources implements Serializable {
        
        @Override 
        public int hashCode() {
-               
+
                int code = this.arModelCustomizationUuid == null ? 0 : this.arModelCustomizationUuid.hashCode();
                code += this.serviceModelUuid == null ? 0 : this.serviceModelUuid.hashCode();
                
                return code;
        }
-       
+
        @Override
        public String toString() {
-               StringBuilder sb = new StringBuilder();
-               sb.append("serviceModelUuid=");
-               sb.append(this.serviceModelUuid);
-               sb.append("arModelCustomizationUuid=");
-               sb.append(this.arModelCustomizationUuid);
-
-               return sb.toString();
+               return "serviceModelUuid=" + this.serviceModelUuid + "arModelCustomizationUuid=" + this.arModelCustomizationUuid;
        }
 
 }
index a380a58..69dc327 100644 (file)
@@ -80,14 +80,11 @@ public class ServiceToNetworks implements Serializable {
                
                return code;
        }
-       
+
        @Override
        public String toString() {
-               StringBuilder sb = new StringBuilder();
-               sb.append("ServiceToNetworks mapping: ");
-               sb.append("serviceModelUuid=").append(this.serviceModelUuid);
-               sb.append(",networkModelCustomizationUuid=").append(networkModelCustomizationUuid);
-               return sb.toString();
+               return "ServiceToNetworks mapping: " + "serviceModelUuid=" + this.serviceModelUuid
+                       + ",networkModelCustomizationUuid=" + networkModelCustomizationUuid;
        }
 
 }
index 783fc2d..3ef7e6e 100644 (file)
@@ -23,7 +23,7 @@ package org.openecomp.mso.db.catalog.beans;
 import java.io.Serializable;\r
 \r
 public class TempNetworkHeatTemplateLookup implements Serializable {\r
-       \r
+\r
        private String networkResourceModelName;\r
        private String heatTemplateArtifactUuid;\r
        private String aicVersionMin;\r
@@ -33,14 +33,14 @@ public class TempNetworkHeatTemplateLookup implements Serializable {
        public TempNetworkHeatTemplateLookup() {\r
                super();\r
        }\r
-       \r
+\r
        public String getNetworkResourceModelName() {\r
                return this.networkResourceModelName;\r
        }\r
        public void setNetworkResourceModelName(String networkResourceModelName) {\r
                this.networkResourceModelName = networkResourceModelName;\r
        }\r
-       \r
+\r
        public String getHeatTemplateArtifactUuid() {\r
                return this.heatTemplateArtifactUuid;\r
        }\r
@@ -50,29 +50,26 @@ public class TempNetworkHeatTemplateLookup implements Serializable {
        public String getAicVersionMin() {\r
                return this.aicVersionMin;\r
        }\r
-       \r
+\r
        public void setAicVersionMin(String aicVersionMin) {\r
                this.aicVersionMin = aicVersionMin;\r
        }\r
-       \r
+\r
        public String getAicVersionMax() {\r
                return this.aicVersionMax;\r
        }\r
-       \r
+\r
        public void setAicVersionMax(String aicVersionMax) {\r
                this.aicVersionMax = aicVersionMax;\r
        }\r
 \r
        @Override\r
        public String toString() {\r
-               StringBuilder sb = new StringBuilder();\r
-               sb.append("NetworkResourceModelName=").append(this.networkResourceModelName);\r
-               sb.append("HeatTemplateArtifactUuid=").append(this.heatTemplateArtifactUuid);\r
-               sb.append("aicVersionMin=").append(this.aicVersionMin);\r
-               sb.append("aicVersionMax=").append(this.aicVersionMax);\r
-               return sb.toString();\r
+               return "NetworkResourceModelName=" + this.networkResourceModelName + "HeatTemplateArtifactUuid=" +\r
+                       this.heatTemplateArtifactUuid + "aicVersionMin=" + this.aicVersionMin + "aicVersionMax=" + this.aicVersionMax;\r
        }\r
-    @Override\r
+\r
+       @Override\r
     public boolean equals (Object o) {\r
         if (!(o instanceof TempNetworkHeatTemplateLookup)) {\r
             return false;\r
index 9f2dae5..db3a266 100644 (file)
@@ -109,22 +109,22 @@ public class VfModuleCustomization implements Serializable {
        public void setVfModule(VfModule vfModule) {\r
                this.vfModule = vfModule;\r
        }\r
+\r
        @Override\r
        public String toString() {\r
-               StringBuilder sb = new StringBuilder();\r
-               sb.append("modelCustomizationUuid=").append(this.modelCustomizationUuid);\r
-               sb.append("vfModuleModelUuid=").append(this.vfModuleModelUuid);\r
-               sb.append("label=").append(this.label);\r
-               sb.append("initalCount=").append(this.initialCount);\r
-               sb.append("minInstances=").append(this.minInstances);\r
-               sb.append("maxInstances=").append(this.maxInstances);\r
-               sb.append("availabilityZoneCount=").append(this.availabilityZoneCount);\r
-               sb.append("heatEnvironmentArtifactUuid=").append(this.heatEnvironmentArtifactUuid);\r
-               sb.append("volEnvironmentArtifactUuid=").append(this.volEnvironmentArtifactUuid);\r
-               sb.append("created=").append(this.created);\r
-               return sb.toString();\r
+               return "modelCustomizationUuid=" + this.modelCustomizationUuid +\r
+                       "vfModuleModelUuid=" + this.vfModuleModelUuid +\r
+                       "label=" + this.label +\r
+                       "initalCount=" + this.initialCount +\r
+                       "minInstances=" + this.minInstances +\r
+                       "maxInstances=" + this.maxInstances +\r
+                       "availabilityZoneCount=" + this.availabilityZoneCount +\r
+                       "heatEnvironmentArtifactUuid=" + this.heatEnvironmentArtifactUuid +\r
+                       "volEnvironmentArtifactUuid=" + this.volEnvironmentArtifactUuid +\r
+                       "created=" + this.created;\r
        }\r
-    @Override\r
+\r
+       @Override\r
     public boolean equals (Object o) {\r
         if (!(o instanceof VfModuleCustomization)) {\r
             return false;\r
index 476283e..611604e 100644 (file)
@@ -46,13 +46,10 @@ public class VfModuleToHeatFiles implements Serializable {
        public void setHeatFilesArtifactUuid(String heatFilesArtifactUuid) {
                this.heatFilesArtifactUuid = heatFilesArtifactUuid;
        }
-       
-    @Override
-    public String toString () {
-        StringBuilder sb = new StringBuilder ();
-        sb.append("vfModuleModelUuid=").append(this.vfModuleModelUuid);
-        sb.append(", heatFilesArtifactUuid=").append(this.heatFilesArtifactUuid);
-        return sb.toString ();
-    }
+
+       @Override
+       public String toString() {
+               return "vfModuleModelUuid=" + this.vfModuleModelUuid + ", heatFilesArtifactUuid=" + this.heatFilesArtifactUuid;
+       }
 
 }
index 6eac5a2..30a5133 100644 (file)
@@ -56,12 +56,7 @@ public class VnfComponentsRecipe extends Recipe implements Serializable {
 
        @Override
        public String toString () {
-               StringBuilder sb = new StringBuilder();
-               sb.append(super.toString());
-               sb.append(",vnfComponentParamXSD=").append(getParamXSD());
-               sb.append(",serviceType=").append(getServiceType());
-               sb.append(",vnfComponentType=").append(getVnfComponentType());
-               sb.append(",vfModuleId=").append(getVfModuleModelUUId());
-               return sb.toString();
+               return super.toString() + ",vnfComponentParamXSD=" + getParamXSD() + ",serviceType=" + getServiceType() +
+                       ",vnfComponentType=" + getVnfComponentType() + ",vfModuleId=" + getVfModuleModelUUId();
        }
 }
index 46017c2..0dd38cb 100644 (file)
@@ -48,11 +48,7 @@ public class VnfRecipe extends Recipe implements Serializable {
        
        @Override
        public String toString () {
-               StringBuilder sb = new StringBuilder();
-               sb.append(super.toString());
-               sb.append(",vnfParamXSD=").append(getParamXSD());
-               sb.append(",serviceType=").append(getServiceType());
-               sb.append(",vfModuleId=").append(getVfModuleId());
-               return sb.toString();
+               return super.toString() + ",vnfParamXSD=" + getParamXSD() + ",serviceType=" + getServiceType() + ",vfModuleId=" +
+                       getVfModuleId();
        }
 }
index 7b2364d..fd1e6b6 100644 (file)
@@ -53,15 +53,14 @@ public class VnfResCustomToVfModuleCustom implements Serializable {
        public void setCreated(Timestamp created) {\r
                this.created = created;\r
        }\r
+\r
        @Override\r
        public String toString() {\r
-               StringBuilder sb = new StringBuilder();\r
-               sb.append("vnfResourceCustModelCustomizationUuid=").append(this.vnfResourceCustModelCustomizationUuid);\r
-               sb.append("vfModuleCustModelCustomizationUuid=").append(this.vfModuleCustModelCustomizationUuid);\r
-               sb.append("created=").append(this.created);\r
-               return sb.toString();\r
+               return "vnfResourceCustModelCustomizationUuid=" + this.vnfResourceCustModelCustomizationUuid +\r
+                       "vfModuleCustModelCustomizationUuid=" + this.vfModuleCustModelCustomizationUuid + "created=" + this.created;\r
        }\r
-    @Override\r
+\r
+       @Override\r
     public boolean equals (Object o) {\r
         if (!(o instanceof VnfResCustomToVfModuleCustom)) {\r
             return false;\r
index f0b990a..806cbeb 100644 (file)
@@ -195,7 +195,7 @@ public class VnfResource extends MavenLikeVersioning implements Serializable {
        }
 
        public List<VfModuleCustomization> getVfModuleCustomizations() {
-               return this.vfModuleCustomizations == null ? new ArrayList<VfModuleCustomization>() : this.vfModuleCustomizations;
+               return this.vfModuleCustomizations == null ? new ArrayList<>() : this.vfModuleCustomizations;
        }
        public void setVfModuleCustomizations(ArrayList<VfModuleCustomization> vfModuleCustomizations) {
                this.vfModuleCustomizations = vfModuleCustomizations;
@@ -205,7 +205,7 @@ public class VnfResource extends MavenLikeVersioning implements Serializable {
                        if (this.vfModuleCustomizations != null) {
                                this.vfModuleCustomizations.add(vfmc);
                        } else {
-                               this.vfModuleCustomizations = new ArrayList<VfModuleCustomization>();
+                               this.vfModuleCustomizations = new ArrayList<>();
                                this.vfModuleCustomizations.add(vfmc);
                        }
        }
@@ -216,7 +216,7 @@ public class VnfResource extends MavenLikeVersioning implements Serializable {
                        if (this.vfModules != null) {
                                this.vfModules.add(vfm);
                        } else {
-                               this.vfModules = new HashSet<VfModule>();
+                               this.vfModules = new HashSet<>();
                                this.vfModules.add(vfm);
                        }
                }
@@ -225,7 +225,7 @@ public class VnfResource extends MavenLikeVersioning implements Serializable {
                if (this.vfModules == null || this.vfModules.size() < 1) {
                        return null;
        }
-               ArrayList<VfModule> list = new ArrayList<VfModule>();
+               ArrayList<VfModule> list = new ArrayList<>();
                list.addAll(this.vfModules);
                return list;
        }
index 151c9e5..cb5bf64 100644 (file)
@@ -155,7 +155,7 @@ public class VnfResourceCustomization extends MavenLikeVersioning implements Ser
                        if (this.vfModuleCustomizations != null) {
                                this.vfModuleCustomizations.add(vfmc);
                        } else {
-                               this.vfModuleCustomizations = new ArrayList<VfModuleCustomization>();
+                               this.vfModuleCustomizations = new ArrayList<>();
                                this.vfModuleCustomizations.add(vfmc);
                        }
                }
@@ -179,21 +179,17 @@ public class VnfResourceCustomization extends MavenLikeVersioning implements Ser
 
        @Override
        public String toString() {
-               StringBuilder sb = new StringBuilder("VnfResourceCustomization: ");
-               sb.append("ModelCustUuid=").append(this.modelCustomizationUuid);
-               sb.append(", ModelInstanceName=").append(this.modelInstanceName);
-               sb.append(", vnfResourceModelUuid=").append(this.vnfResourceModelUUID);
-               sb.append(", creationTimestamp=").append(this.created);
-               sb.append(", minInstances=").append(this.minInstances);
-               sb.append(", maxInstances=").append(this.maxInstances);
-               sb.append(", availabilityZoneMaxCount=").append(this.availabilityZoneMaxCount);
-//             sb.append(", vnfResource:\n" + this.vnfResource == null ? "null" : this.vnfResource.toString());
-               sb.append(", nfFunction=").append(this.nfFunction);
-               sb.append(", nfType=").append(this.nfType);
-               sb.append(", nfRole=").append(this.nfRole);
-               sb.append(", nfNamingCode=").append(this.nfNamingCode);
-               
-               return sb.toString();
+        return "VnfResourceCustomization: " + "ModelCustUuid=" + this.modelCustomizationUuid +
+            ", ModelInstanceName=" + this.modelInstanceName +
+            ", vnfResourceModelUuid=" + this.vnfResourceModelUUID +
+            ", creationTimestamp=" + this.created +
+            ", minInstances=" + this.minInstances +
+            ", maxInstances=" + this.maxInstances +
+            ", availabilityZoneMaxCount=" + this.availabilityZoneMaxCount +
+            ", nfFunction=" + this.nfFunction +
+            ", nfType=" + this.nfType +
+            ", nfRole=" + this.nfRole +
+            ", nfNamingCode=" + this.nfNamingCode;
        }
 
 }
index 564fd5a..e42f734 100644 (file)
@@ -51,29 +51,32 @@ public class MavenLikeVersioning implements Serializable {
         *
         */
        public boolean isMoreRecentThan (String versionToCompare) {
-               if (versionToCompare == null || versionToCompare.trim().equals("") || this.version == null || this.version.trim().equals("")) {
+               if (versionToCompare == null || versionToCompare.trim().isEmpty() || this.version == null || this.version.trim().isEmpty()) {
                        return false;
                }
-               String [] currentVersionArray = this.version.split("\\.");
-               String [] specifiedVersionArray = versionToCompare.split("\\.");
+               String[] currentVersionArray = this.version.split("\\.");
+               String[] specifiedVersionArray = versionToCompare.split("\\.");
 
-        int smalestStringLength = Math.min(currentVersionArray.length, specifiedVersionArray.length);
+               int smalestStringLength = Math.min(currentVersionArray.length, specifiedVersionArray.length);
 
-               for (int currentVersionIndex=0;currentVersionIndex < smalestStringLength;++currentVersionIndex) {
+               for (int currentVersionIndex = 0; currentVersionIndex < smalestStringLength; ++currentVersionIndex) {
 
-                       if (Integer.parseInt(currentVersionArray[currentVersionIndex]) < Integer.parseInt(specifiedVersionArray[currentVersionIndex])) {
+                       if (Integer.parseInt(currentVersionArray[currentVersionIndex]) < Integer
+                               .parseInt(specifiedVersionArray[currentVersionIndex])) {
                                return false;
-                       } else if (Integer.parseInt(currentVersionArray[currentVersionIndex]) > Integer.parseInt(specifiedVersionArray[currentVersionIndex])) {
+                       } else if (Integer.parseInt(currentVersionArray[currentVersionIndex]) > Integer
+                               .parseInt(specifiedVersionArray[currentVersionIndex])) {
                                return true;
                        }
                }
-
-               // Even if versionToCompare has more digits, it means versionToCompare is more recent
-               if (Integer.parseInt(currentVersionArray[smalestStringLength-1]) == Integer.parseInt(specifiedVersionArray[smalestStringLength-1])) {
-                   return currentVersionArray.length > specifiedVersionArray.length;
+               try {
+                       // Even if versionToCompare has more digits, it means versionToCompare is more recent
+                       return Integer.parseInt(currentVersionArray[smalestStringLength - 1]) != Integer
+                               .parseInt(specifiedVersionArray[smalestStringLength - 1])
+                               || currentVersionArray.length > specifiedVersionArray.length;
+               } catch (NumberFormatException e) {
+                       return false;
                }
-
-               return true;
        }
 
        /**
index e9f080b..3cab4f2 100644 (file)
@@ -2445,7 +2445,7 @@ public class CatalogDatabaseTest {
     @Test(expected = Exception.class)
     public void saveHeatTemplateTest(){
         HeatTemplate heat = new HeatTemplate();
-        Set <HeatTemplateParam> paramSet = new HashSet<HeatTemplateParam>();
+        Set <HeatTemplateParam> paramSet = new HashSet<>();
         cd.saveHeatTemplate(heat,paramSet);
     }
     @Test(expected = Exception.class)
@@ -2665,12 +2665,12 @@ public class CatalogDatabaseTest {
     @Test(expected = Exception.class)
     public void executeQuerySingleRow(){
         VnfComponent ar = new VnfComponent();
-        HashMap<String, String> variables = new HashMap<String, String>();
+        HashMap<String, String> variables = new HashMap<>();
         cd.executeQuerySingleRow("tets",variables,false);
     }
     @Test(expected = Exception.class)
     public void executeQueryMultipleRows(){
-        HashMap<String, String> variables = new HashMap<String, String>();
+        HashMap<String, String> variables = new HashMap<>();
         cd.executeQueryMultipleRows("select",variables,false);
     }
 }
index 5bcadb7..c99a714 100644 (file)
@@ -153,7 +153,7 @@ public class MavenVersioningTest {
                MavenLikeVersioning test12 = new MavenLikeVersioning();
                test12.setVersion("2.0");
                
-               List<MavenLikeVersioning> list= new LinkedList<MavenLikeVersioning>();
+               List<MavenLikeVersioning> list= new LinkedList<>();
                list.add(test1);
                list.add(test2);
                list.add(test3);
@@ -167,7 +167,7 @@ public class MavenVersioningTest {
                list.add(test11);
                list.add(test12);
                
-               Collections.sort(list,new MavenLikeVersioningComparator());
+               list.sort(new MavenLikeVersioningComparator());
                //Collections.reverse(list);
                assertTrue(list.get(0).getVersion().equals("0.02"));
                assertTrue(list.get(1).getVersion().equals("1.1"));
index 1957dc7..b13bbcf 100644 (file)
@@ -9,7 +9,6 @@
        </parent>
 
        <packaging>pom</packaging>
-       <groupId>org.onap.so</groupId>
        <artifactId>docker</artifactId>
 
        <name>MSO Docker Deliveries</name>
index 74d4c30..c298501 100644 (file)
@@ -7,7 +7,6 @@
                <version>1.2.0-SNAPSHOT</version>\r
        </parent>\r
 \r
-       <groupId>org.onap.so</groupId>\r
        <artifactId>packages</artifactId>\r
        <packaging>pom</packaging>\r
        <name>MSO Packages</name>\r
index e8ba05e..413090e 100644 (file)
@@ -9,7 +9,6 @@
         <version>1.2.0-SNAPSHOT</version>\r
     </parent>\r
 \r
-    <groupId>org.onap.so</groupId>\r
     <artifactId>status-control</artifactId>\r
     <name>MSO Status Control module</name>\r
     <description>Contains classes to update and query the MSO status per site</description>\r