summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java2
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java6
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java21
-rw-r--r--adapters/mso-adapter-utils/src/test/java/org/onap/so/cloudify/utils/MsoCloudifyUtilsTest.java13
-rw-r--r--adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsUnitTest.java16
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/application.yaml1
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.3__AddBluePrintNameVersion.sql8
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.4__AddPnfResourceAndCustomization.sql39
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java10
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java307
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql12
-rw-r--r--adapters/mso-openstack-adapters/pom.xml142
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java (renamed from adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackServiceData.java)9
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java90
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java30
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java17
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java56
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java18
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java6
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java1
-rw-r--r--
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVnfInfra.groovy53
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy47
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy25
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy116
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy67
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy239
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy59
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy53
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy157
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy62
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy62
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy491
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy106
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeRollback.groovy17
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2.groovy63
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy153
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModules.groovy160
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy100
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy114
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceV2.groovy314
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy99
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy210
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy54
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy53
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy55
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy67
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy110
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy151
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy29
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnf.groovy32
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy131
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoScaleE2EServiceInstance.groovy28
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy26
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy83
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstanceRollback.groovy55
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy201
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollback.groovy50
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModule.groovy219
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy100
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HealchCheckActivate.groovy6
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ReplaceVnfInfra.groovy122
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/RollbackVnf.groovy24
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstance.groovy66
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy90
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstance.groovy71
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModule.groovy70
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleInfra.groovy87
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleInfraV2.groovy81
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy88
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy35
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVnfInfra.groovy114
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfCmBase.groovy237
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfConfigUpdate.groovy212
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfInPlaceUpdate.groovy115
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy206
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy90
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy166
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy82
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy154
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy82
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy91
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy93
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java13
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java13
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java13
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/audit/AuditTasks.java22
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CloudSiteCatalogUtils.java15
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java91
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java110
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowType.java3
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java15
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIInstanceGroupResources.java10
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java1
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java17
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java19
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasksTest.java11
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java33
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java18
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIInstanceGroupResourcesTest.java21
-rw-r--r--common/src/main/java/org/onap/so/client/RestClient.java4
-rw-r--r--common/src/main/java/org/onap/so/client/aai/AAIDSLQueryClient.java14
-rw-r--r--common/src/main/java/org/onap/so/client/aai/AAIQueryClient.java13
-rw-r--r--common/src/main/java/org/onap/so/client/aai/entities/AAIEdgeLabel.java4
-rw-r--r--common/src/main/java/org/onap/so/client/aai/entities/uri/HttpLookupUri.java5
-rw-r--r--common/src/main/java/org/onap/so/client/cds/BasicAuthClientInterceptor.java53
-rw-r--r--common/src/main/java/org/onap/so/client/cds/CDSProcessingClient.java1
-rw-r--r--common/src/main/java/org/onap/so/client/cds/CDSProperties.java3
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryQueryClient.java72
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNode.java7
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNodeKey.java11
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java41
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/entities/GraphInventoryRelationships.java2
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/entities/GraphInventoryResultWrapper.java15
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/entities/Id.java5
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/entities/Pathed.java5
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/entities/Resource.java40
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/entities/ResourceAndUrl.java36
-rw-r--r--common/src/main/java/org/onap/so/logger/MsoLogger.java80
-rw-r--r--common/src/test/java/org/onap/so/client/aai/AAIQueryClientTest.java65
-rw-r--r--common/src/test/java/org/onap/so/client/aai/AAIResourcesClientTest.java9
-rw-r--r--common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java29
-rw-r--r--common/src/test/java/org/onap/so/client/aai/entities/RelationshipsTest.java2
-rw-r--r--common/src/test/java/org/onap/so/client/aai/entities/uri/ServiceInstanceUriTest.java4
-rw-r--r--common/src/test/java/org/onap/so/client/cds/TestCDSPropertiesImpl.java9
-rw-r--r--common/src/test/java/org/onap/so/client/defaultproperties/DefaultAAIPropertiesImpl.java15
-rw-r--r--common/src/test/resources/__files/aai/query/pathed-result.json12
-rw-r--r--common/src/test/resources/__files/aai/query/single-query-result.json80
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java450
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/NodeHealthcheckHandler.java3
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java34
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java1
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java7
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/InstanceIdMapValidation.java8
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java74
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequestTest.java34
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java16
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/RequestDBConfig.java11
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImplTest.java30
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql2
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java2
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResource.java215
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java220
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java1
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java605
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java17
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java510
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfVfmoduleCvnfcConfigurationCustomization.java1
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java1363
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepository.java32
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfResourceRepository.java29
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepository.java8
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/ServiceTest.java89
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepositoryTest.java62
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/PnfResourceRepositoryTest.java50
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepositoryTest.java78
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest.java11
-rw-r--r--mso-catalog-db/src/test/resources/data.sql17
-rw-r--r--mso-catalog-db/src/test/resources/schema.sql40
-rw-r--r--so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/CorsConfigurer.java9
-rw-r--r--so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/CamundaConfigurationTest.java (renamed from so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/CamundaConfigurationTest.java)0
-rw-r--r--so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/CamundaRestUrlProviderTest.java (renamed from so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/CamundaRestUrlProviderTest.java)0
-rw-r--r--so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/HttpServiceProviderConfigurationTest.java (renamed from so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/HttpServiceProviderConfigurationTest.java)0
-rw-r--r--so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/PojoClassesTests.java (renamed from so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/PojoClassesTests.java)0
-rw-r--r--so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/database/DatabaseUrlProviderTest.java (renamed from so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/database/DatabaseUrlProviderTest.java)0
-rw-r--r--so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/db/api/DatabaseServiceProviderTest.java (renamed from so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/db/api/DatabaseServiceProviderTest.java)0
-rw-r--r--so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderTest.java (renamed from so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/rest/service/CamundaProcessDataServiceProviderTest.java)0
-rw-r--r--so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/utils/ObjectEqualsUtilsTest.java (renamed from so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/utils/ObjectEqualsUtilsTest.java)0
255 files changed, 11057 insertions, 7074 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java
index 00602af216..8fbccaaf69 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java
@@ -128,6 +128,6 @@ public class KeystoneV3Authentication {
}
}
}
- throw new ServiceEndpointNotFoundException("endpoint url not found");
+ throw new ServiceEndpointNotFoundException("endpoint url not found: type:" + type +" region: " + region + " facing: " + facing);
}
}
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java
index f50a6fd1bd..97e1627fd3 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java
@@ -1047,7 +1047,11 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin{
}
} else if (type.equalsIgnoreCase("json")) {
try {
- return JSON_MAPPER.writeValueAsString(inputValue);
+ if (inputValue instanceof String) {
+ return JSON_MAPPER.readTree(inputValue.toString());
+ }
+ //will already marshal to json without intervention
+ return inputValue;
}
catch (Exception e) {
logger.debug("Unable to convert {} to a JsonNode!", inputValue);
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java
index ee1c79c09c..012c560689 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java
@@ -38,6 +38,8 @@ import com.woorea.openstack.keystone.Keystone;
import com.woorea.openstack.keystone.model.Access;
import com.woorea.openstack.keystone.model.Authentication;
import com.woorea.openstack.keystone.utils.KeystoneUtils;
+
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
@@ -999,6 +1001,7 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin{
OpenStackRequest <Stack> request = heatClient.getStacks ().byName (stackName);
return executeAndRecordOpenstackRequest (request);
} catch (OpenStackResponseException e) {
+ logger.error("Error in Query Stack", e);
if (e.getStatus () == 404) {
logger.debug ("queryHeatStack - stack not found: {}", stackName);
return null;
@@ -1355,18 +1358,22 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin{
}
} else if ("json".equalsIgnoreCase(type)) {
Object jsonObj = inputs.get(key);
- String jsonString;
+ Object json;
try {
- jsonString = JSON_MAPPER.writeValueAsString(jsonObj);
- } catch (JsonProcessingException e) {
+ if (jsonObj instanceof String) {
+ json = JSON_MAPPER.readTree(jsonObj.toString());
+ } else {
+ //will already marshal to json without intervention
+ json = jsonObj;
+ }
+ } catch (IOException e) {
logger.error("failed to map to json, directly converting to string instead", e);
- jsonString = jsonObj.toString();
+ json = jsonObj.toString();
}
if (alias)
- newInputs.put(realName, jsonString);
+ newInputs.put(realName, json);
else
- newInputs.put(key, jsonString);
- //}
+ newInputs.put(key, json);
} else if ("comma_delimited_list".equalsIgnoreCase(type)) {
String commaSeparated = inputs.get(key).toString();
try {
diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloudify/utils/MsoCloudifyUtilsTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloudify/utils/MsoCloudifyUtilsTest.java
index f63aab7ce1..833b4ab760 100644
--- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloudify/utils/MsoCloudifyUtilsTest.java
+++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloudify/utils/MsoCloudifyUtilsTest.java
@@ -24,6 +24,7 @@ package org.onap.so.cloudify.utils;
import static com.shazam.shazamcrest.MatcherAssert.assertThat;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
@@ -70,6 +71,7 @@ import org.skyscreamer.jsonassert.JSONAssert;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
public class MsoCloudifyUtilsTest {
@@ -305,11 +307,18 @@ public class MsoCloudifyUtilsTest {
paramJson.setParamType("json");
paramJson.setParamName("my-json");
- Map<String, Object> jsonMap = mapper.readValue(getJson("free-form.json"), new TypeReference<Map<String, Object>>(){});
+ HeatTemplateParam paramJsonEscaped = new HeatTemplateParam();
+ paramJsonEscaped.setParamType("json");
+ paramJsonEscaped.setParamName("my-json-escaped");
+ Map<String, Object> jsonMap = mapper.readValue(getJson("free-form.json"), new TypeReference<Map<String, Object>>(){});
+
assertEquals(3, utils.convertInputValue("3", paramNum));
assertEquals("hello", utils.convertInputValue("hello", paramString));
- JSONAssert.assertEquals(getJson("free-form.json"), utils.convertInputValue(jsonMap, paramJson).toString(), false);
+ assertTrue("expect no change in type", utils.convertInputValue(jsonMap, paramJson) instanceof Map);
+ assertTrue("expect string to become jsonNode", utils.convertInputValue(getJson("free-form.json"), paramJsonEscaped) instanceof JsonNode);
+
+ JSONAssert.assertEquals(getJson("free-form.json"), mapper.writeValueAsString(utils.convertInputValue(getJson("free-form.json"), paramJsonEscaped)), false);
}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsUnitTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsUnitTest.java
index 40bbe90218..66d6f59e79 100644
--- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsUnitTest.java
+++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsUnitTest.java
@@ -1,6 +1,7 @@
package org.onap.so.openstack.utils;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.nio.file.Files;
@@ -17,6 +18,7 @@ import org.skyscreamer.jsonassert.JSONAssert;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
public class MsoHeatUtilsUnitTest {
@@ -45,18 +47,28 @@ public class MsoHeatUtilsUnitTest {
paramJson.setParamType("json");
paramJson.setParamName("my-json");
+ HeatTemplateParam paramJsonEscaped = new HeatTemplateParam();
+ paramJsonEscaped.setParamType("json");
+ paramJsonEscaped.setParamName("my-json-escaped");
+
Map<String, Object> jsonMap = mapper.readValue(getJson("free-form.json"), new TypeReference<Map<String, Object>>(){});
input.put("my-json", jsonMap);
+ input.put("my-json-escaped", getJson("free-form.json"));
+
parameters.add(paramNum);
parameters.add(paramString);
parameters.add(paramJson);
-
+ parameters.add(paramJsonEscaped);
+
Map<String, Object> output = utils.convertInputMap(input, template);
assertEquals(3, output.get("my-number"));
assertEquals("hello", output.get("my-string"));
- JSONAssert.assertEquals(getJson("free-form.json"), (String)output.get("my-json"), false);
+ assertTrue("expect no change in type", output.get("my-json") instanceof Map);
+ assertTrue("expect string to become jsonNode", output.get("my-json-escaped") instanceof JsonNode);
+
+ JSONAssert.assertEquals(getJson("free-form.json"), mapper.writeValueAsString(output.get("my-json-escaped")), false);
}
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml b/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml
index aa9317c920..07b000875e 100644
--- a/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml
@@ -28,6 +28,7 @@ spring:
password: ${DB_ADMIN_PASSWORD}
outOfOrder: true
validateOnMigrate: false
+ repeatableSqlMigrationPrefix: RATT
jpa:
show-sql: true
hibernate:
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.3__AddBluePrintNameVersion.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.3__AddBluePrintNameVersion.sql
new file mode 100644
index 0000000000..97397df290
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.3__AddBluePrintNameVersion.sql
@@ -0,0 +1,8 @@
+use catalogdb;
+
+ALTER TABLE vnf_resource_customization
+ADD CDS_BLUEPRINT_NAME varchar(200) null;
+
+ALTER TABLE vnf_resource_customization
+ADD CDS_BLUEPRINT_VERSION varchar(20) null;
+
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.4__AddPnfResourceAndCustomization.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.4__AddPnfResourceAndCustomization.sql
new file mode 100644
index 0000000000..5571bf89ee
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.4__AddPnfResourceAndCustomization.sql
@@ -0,0 +1,39 @@
+use catalogdb;
+
+CREATE TABLE IF NOT EXISTS `pnf_resource` (
+ `ORCHESTRATION_MODE` varchar(20) DEFAULT NULL,
+ `DESCRIPTION` varchar(1200) DEFAULT NULL,
+ `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `MODEL_UUID` varchar(200) NOT NULL,
+ `MODEL_INVARIANT_UUID` varchar(200) DEFAULT NULL,
+ `MODEL_VERSION` varchar(20) NOT NULL,
+ `MODEL_NAME` varchar(200) DEFAULT NULL,
+ `TOSCA_NODE_TYPE` varchar(200) DEFAULT NULL,
+ `RESOURCE_CATEGORY` varchar(200) DEFAULT NULL,
+ `RESOURCE_SUB_CATEGORY` varchar(200) DEFAULT NULL,
+ PRIMARY KEY (`MODEL_UUID`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE IF NOT EXISTS `pnf_resource_customization` (
+ `MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL,
+ `MODEL_INSTANCE_NAME` varchar(200) NOT NULL,
+ `NF_TYPE` varchar(200) DEFAULT NULL,
+ `NF_ROLE` varchar(200) DEFAULT NULL,
+ `NF_FUNCTION` varchar(200) DEFAULT NULL,
+ `NF_NAMING_CODE` varchar(200) DEFAULT NULL,
+ `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `PNF_RESOURCE_MODEL_UUID` varchar(200) NOT NULL,
+ `MULTI_STAGE_DESIGN` varchar(20) DEFAULT NULL,
+ `RESOURCE_INPUT` varchar(2000) DEFAULT NULL,
+ CDS_BLUEPRINT_NAME varchar(200) DEFAULT NULL,
+ CDS_BLUEPRINT_VERSION varchar(20) DEFAULT NULL,
+ PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`),
+ KEY `fk_pnf_resource_customization__pnf_resource1_idx` (`PNF_RESOURCE_MODEL_UUID`),
+ CONSTRAINT `fk_pnf_resource_customization__pnf_resource1` FOREIGN KEY (`PNF_RESOURCE_MODEL_UUID`) REFERENCES `pnf_resource` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE IF NOT EXISTS `pnf_resource_customization_to_service` (
+ `SERVICE_MODEL_UUID` varchar(200) NOT NULL,
+ `RESOURCE_MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL,
+ PRIMARY KEY (`SERVICE_MODEL_UUID`,`RESOURCE_MODEL_CUSTOMIZATION_UUID`)
+)ENGINE=InnoDB DEFAULT CHARSET=latin1; \ No newline at end of file
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java
index b08b93eb87..89f4824492 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java
@@ -170,6 +170,14 @@ public class CvnfcCatalogDbQueryTest {
} else {
Assert.fail("No linked VnfVfmoduleCvnfcConfigurationCustomization found for CvnfcCustomization");
}
+
+ VnfVfmoduleCvnfcConfigurationCustomization vnfVfmoduleCvnfcConfigurationCustomizationFound = client.
+ getVnfVfmoduleCvnfcConfigurationCustomizationByVnfCustomizationUuidAndVfModuleCustomizationUuidAndCvnfcCustomizationUuid(
+ "6912dd02-2b16-11e9-b210-d663bd873d93",
+ "bdbf984a-2b16-11e9-b210-d663bd873d93",
+ "0c042562-2bac-11e9-b210-d663bd873d93");
+ assertNotNull(vnfVfmoduleCvnfcConfigurationCustomizationFound);
+ System.out.println(vnfVfmoduleCvnfcConfigurationCustomizationFound.getModelCustomizationUUID());
}
protected CvnfcCustomization setUpCvnfcCustomization(String id){
@@ -198,4 +206,4 @@ public class CvnfcCatalogDbQueryTest {
vnfcCustomization.setDescription("testVnfcCustomizationDescription");
return vnfcCustomization;
}
-}
+} \ No newline at end of file
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
index 4479e1ba4a..d28784bb93 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
@@ -7,9 +7,9 @@
* 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.
@@ -22,6 +22,7 @@ package org.onap.so.db.catalog.client;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.when;
import java.util.List;
@@ -42,6 +43,8 @@ import org.onap.so.db.catalog.beans.ExternalServiceToInternalService;
import org.onap.so.db.catalog.beans.HomingInstance;
import org.onap.so.db.catalog.beans.InstanceGroup;
import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
+import org.onap.so.db.catalog.beans.PnfResource;
+import org.onap.so.db.catalog.beans.PnfResourceCustomization;
import org.onap.so.db.catalog.beans.ServerType;
import org.onap.so.db.catalog.beans.Service;
import org.onap.so.db.catalog.beans.ServiceRecipe;
@@ -59,6 +62,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.security.core.parameters.P;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
@@ -68,31 +72,36 @@ import com.fasterxml.jackson.databind.ObjectMapper;
@SpringBootTest(classes = CatalogDBApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ActiveProfiles("test")
public class CatalogDbClientTest {
+
public static final String MTN13 = "mtn13";
-
+
@LocalServerPort
private int port;
@Value("${mso.db.auth}")
private String msoAdaptersAuth;
-
+
@Autowired
CatalogDbClientPortChanger client;
@Before
- public void initialize(){
- client.wiremockPort= String.valueOf(port);
+ public void initialize() {
+ client.wiremockPort = String.valueOf(port);
}
@Test
- public void testGetRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(){
- RainyDayHandlerStatus rainyDayHandlerStatus = client.getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep("AssignServiceInstanceBB", "*", "*", "*", "*");
+ public void testGetRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep() {
+ RainyDayHandlerStatus rainyDayHandlerStatus = client
+ .getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(
+ "AssignServiceInstanceBB", "*", "*", "*", "*");
Assert.assertEquals("Rollback", rainyDayHandlerStatus.getPolicy());
}
@Test
- public void testGetRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStepRecordNotFound(){
- RainyDayHandlerStatus rainyDayHandlerStatus = client.getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(UUID.randomUUID().toString(), "*", "*", "*", "*");
+ public void testGetRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStepRecordNotFound() {
+ RainyDayHandlerStatus rainyDayHandlerStatus = client
+ .getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(
+ UUID.randomUUID().toString(), "*", "*", "*", "*");
Assert.assertNull(rainyDayHandlerStatus);
}
@@ -184,7 +193,8 @@ public class CatalogDbClientTest {
@Test
public void testGetVnfResourceCustomizationByModelCustomizationUUID() {
- VnfResourceCustomization vnfResourceCustomization = client.getVnfResourceCustomizationByModelCustomizationUUID("68dc9a92-214c-11e7-93ae-92361f002671");
+ VnfResourceCustomization vnfResourceCustomization = client
+ .getVnfResourceCustomizationByModelCustomizationUUID("68dc9a92-214c-11e7-93ae-92361f002671");
Assert.assertNotNull(vnfResourceCustomization);
Assert.assertEquals("vSAMP", vnfResourceCustomization.getNfRole());
Assert.assertNotNull(vnfResourceCustomization.getModelCustomizationUUID());
@@ -196,7 +206,8 @@ public class CatalogDbClientTest {
@Test
public void testGetVnfResourceCustomizationByModelCustomizationUUINotFound() {
- VnfResourceCustomization vnfResourceCustomization = client.getVnfResourceCustomizationByModelCustomizationUUID(UUID.randomUUID().toString());
+ VnfResourceCustomization vnfResourceCustomization = client
+ .getVnfResourceCustomizationByModelCustomizationUUID(UUID.randomUUID().toString());
Assert.assertNull(vnfResourceCustomization);
}
@@ -205,12 +216,14 @@ public class CatalogDbClientTest {
InstanceGroup instanceGroup = client.getInstanceGroupByModelUUID("0c8692ef-b9c0-435d-a738-edf31e71f38b");
Assert.assertNotNull(instanceGroup);
Assert.assertEquals("network_collection_resource_1806..NetworkCollection..0", instanceGroup.getModelName());
- Assert.assertEquals("org.openecomp.resource.cr.NetworkCollectionResource1806", instanceGroup.getToscaNodeType().toString());
+ Assert.assertEquals("org.openecomp.resource.cr.NetworkCollectionResource1806",
+ instanceGroup.getToscaNodeType().toString());
}
@Test
public void testGetVfModuleCustomizationByModelCuztomizationUUID() {
- VfModuleCustomization vfModuleCustomization = client.getVfModuleCustomizationByModelCuztomizationUUID("cb82ffd8-252a-11e7-93ae-92361f002671");
+ VfModuleCustomization vfModuleCustomization = client
+ .getVfModuleCustomizationByModelCuztomizationUUID("cb82ffd8-252a-11e7-93ae-92361f002671");
Assert.assertNotNull(vfModuleCustomization);
Assert.assertNotNull(vfModuleCustomization.getModelCustomizationUUID());
Assert.assertEquals("base", vfModuleCustomization.getLabel());
@@ -218,13 +231,15 @@ public class CatalogDbClientTest {
@Test
public void testGetVfModuleCustomizationByModelCuztomizationUUIDNotFound() {
- VfModuleCustomization vfModuleCustomization = client.getVfModuleCustomizationByModelCuztomizationUUID(UUID.randomUUID().toString());
+ VfModuleCustomization vfModuleCustomization = client
+ .getVfModuleCustomizationByModelCuztomizationUUID(UUID.randomUUID().toString());
Assert.assertNull(vfModuleCustomization);
}
@Test
public void testGetNetworkResourceCustomizationByModelCustomizationUUID() {
- NetworkResourceCustomization networkResourceCustomization = client.getNetworkResourceCustomizationByModelCustomizationUUID("3bdbb104-476c-483e-9f8b-c095b3d308ac");
+ NetworkResourceCustomization networkResourceCustomization = client
+ .getNetworkResourceCustomizationByModelCustomizationUUID("3bdbb104-476c-483e-9f8b-c095b3d308ac");
Assert.assertNotNull(networkResourceCustomization);
Assert.assertNotNull(networkResourceCustomization.getModelCustomizationUUID());
Assert.assertEquals("CONTRAIL30_GNDIRECT 9", networkResourceCustomization.getModelInstanceName());
@@ -233,13 +248,16 @@ public class CatalogDbClientTest {
@Test
public void testGetNetworkResourceCustomizationByModelCustomizationUUIDNotFound() {
- NetworkResourceCustomization networkResourceCustomization = client.getNetworkResourceCustomizationByModelCustomizationUUID(UUID.randomUUID().toString());
+ NetworkResourceCustomization networkResourceCustomization = client
+ .getNetworkResourceCustomizationByModelCustomizationUUID(UUID.randomUUID().toString());
Assert.assertNull(networkResourceCustomization);
}
@Test
public void testGgetVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUID() {
- VfModuleCustomization vfModuleCustomization = client.getVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUID("cb82ffd8-252a-11e7-93ae-92361f002672", "20c4431c-246d-11e7-93ae-92361f002672");
+ VfModuleCustomization vfModuleCustomization = client
+ .getVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUID(
+ "cb82ffd8-252a-11e7-93ae-92361f002672", "20c4431c-246d-11e7-93ae-92361f002672");
Assert.assertNotNull(vfModuleCustomization);
Assert.assertNotNull(vfModuleCustomization.getModelCustomizationUUID());
Assert.assertNotNull(vfModuleCustomization.getVfModule());
@@ -248,29 +266,35 @@ public class CatalogDbClientTest {
@Test
public void testGgetVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUIDNotFound() {
- VfModuleCustomization vfModuleCustomization = client.getVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUID("cb82ffd8-252a-11e7-93ae-92361f002672", UUID.randomUUID().toString());
+ VfModuleCustomization vfModuleCustomization = client
+ .getVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUID(
+ "cb82ffd8-252a-11e7-93ae-92361f002672", UUID.randomUUID().toString());
Assert.assertNull(vfModuleCustomization);
}
@Test
public void testGetFirstByServiceModelUUIDAndAction() {
- ServiceRecipe serviceRecipe = client.getFirstByServiceModelUUIDAndAction("4694a55f-58b3-4f17-92a5-796d6f5ffd0d", "createInstance");
+ ServiceRecipe serviceRecipe = client
+ .getFirstByServiceModelUUIDAndAction("4694a55f-58b3-4f17-92a5-796d6f5ffd0d", "createInstance");
Assert.assertNotNull(serviceRecipe);
Assert.assertNotNull(serviceRecipe.getServiceModelUUID());
Assert.assertNotNull(serviceRecipe.getAction());
- Assert.assertEquals("/mso/async/services/CreateGenericALaCarteServiceInstance", serviceRecipe.getOrchestrationUri());
+ Assert.assertEquals("/mso/async/services/CreateGenericALaCarteServiceInstance",
+ serviceRecipe.getOrchestrationUri());
Assert.assertEquals("MSOTADevInfra aLaCarte", serviceRecipe.getDescription());
}
@Test
public void testGetFirstByServiceModelUUIDAndActionNotFound() {
- ServiceRecipe serviceRecipe = client.getFirstByServiceModelUUIDAndAction("5df8b6de-2083-11e7-93ae-92361f002671", UUID.randomUUID().toString());
+ ServiceRecipe serviceRecipe = client
+ .getFirstByServiceModelUUIDAndAction("5df8b6de-2083-11e7-93ae-92361f002671", UUID.randomUUID().toString());
Assert.assertNull(serviceRecipe);
}
-
+
@Test
public void testGetFirstVnfResourceByModelInvariantUUIDAndModelVersion() {
- VnfResource vnfResource = client.getFirstVnfResourceByModelInvariantUUIDAndModelVersion("2fff5b20-214b-11e7-93ae-92361f002671", "2.0");
+ VnfResource vnfResource = client
+ .getFirstVnfResourceByModelInvariantUUIDAndModelVersion("2fff5b20-214b-11e7-93ae-92361f002671", "2.0");
Assert.assertNotNull(vnfResource);
Assert.assertNotNull(vnfResource.getModelInvariantId());
Assert.assertNotNull(vnfResource.getModelVersion());
@@ -281,7 +305,9 @@ public class CatalogDbClientTest {
@Test
public void testGetFirstVnfResourceByModelInvariantUUIDAndModelVersionNotFound() {
- VnfResource vnfResource = client.getFirstVnfResourceByModelInvariantUUIDAndModelVersion("2fff5b20-214b-11e7-93ae-92361f002671", UUID.randomUUID().toString());
+ VnfResource vnfResource = client
+ .getFirstVnfResourceByModelInvariantUUIDAndModelVersion("2fff5b20-214b-11e7-93ae-92361f002671",
+ UUID.randomUUID().toString());
Assert.assertNull(vnfResource);
}
@@ -289,12 +315,15 @@ public class CatalogDbClientTest {
public void testGetFirstVnfResourceCustomizationByModelInstanceNameAndVnfResources() {
VnfResource vnfr = new VnfResource();
vnfr.setModelUUID("ff2ae348-214a-11e7-93ae-92361f002671");
- VnfResourceCustomization firstVnfResourceCustomizationByModelInstanceNameAndVnfResources = client.getFirstVnfResourceCustomizationByModelInstanceNameAndVnfResources("vSAMP10a 1", vnfr);
+ VnfResourceCustomization firstVnfResourceCustomizationByModelInstanceNameAndVnfResources = client
+ .getFirstVnfResourceCustomizationByModelInstanceNameAndVnfResources("vSAMP10a 1", vnfr);
Assert.assertNotNull(firstVnfResourceCustomizationByModelInstanceNameAndVnfResources);
Assert.assertEquals("vSAMP", firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getNfRole());
- Assert.assertEquals("vSAMP10a 1", firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getModelInstanceName());
+ Assert.assertEquals("vSAMP10a 1",
+ firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getModelInstanceName());
Assert.assertNotNull(firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getVnfResources());
- Assert.assertNotNull(firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getVfModuleCustomizations());
+ Assert
+ .assertNotNull(firstVnfResourceCustomizationByModelInstanceNameAndVnfResources.getVfModuleCustomizations());
}
@Test
@@ -315,7 +344,9 @@ public class CatalogDbClientTest {
@Test
public void testGetFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction() {
- VnfComponentsRecipe vnfComponentsRecipe = client.getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction("20c4431c-246d-11e7-93ae-92361f002671", "volumeGroup", "createInstance");
+ VnfComponentsRecipe vnfComponentsRecipe = client
+ .getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(
+ "20c4431c-246d-11e7-93ae-92361f002671", "volumeGroup", "createInstance");
Assert.assertNotNull(vnfComponentsRecipe);
Assert.assertNotNull(vnfComponentsRecipe.getAction());
Assert.assertNotNull(vnfComponentsRecipe.getVfModuleModelUUID());
@@ -328,23 +359,28 @@ public class CatalogDbClientTest {
@Test
public void testGetFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndActionNotFound() {
- VnfComponentsRecipe vnfComponentsRecipe = client.getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(UUID.randomUUID().toString(), "volumeGroup", "createInstance");
+ VnfComponentsRecipe vnfComponentsRecipe = client
+ .getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(UUID.randomUUID().toString(),
+ "volumeGroup", "createInstance");
Assert.assertNull(vnfComponentsRecipe);
}
@Test
public void testGetFirstVnfComponentsRecipeByVnfComponentTypeAndAction() {
- VnfComponentsRecipe vnfComponentsRecipe = client.getFirstVnfComponentsRecipeByVnfComponentTypeAndAction("volumeGroup", "createInstance");
+ VnfComponentsRecipe vnfComponentsRecipe = client
+ .getFirstVnfComponentsRecipeByVnfComponentTypeAndAction("volumeGroup", "createInstance");
Assert.assertNotNull(vnfComponentsRecipe);
Assert.assertNotNull(vnfComponentsRecipe.getAction());
Assert.assertNotNull(vnfComponentsRecipe.getVnfComponentType());
Assert.assertEquals("VID_DEFAULT recipe t", vnfComponentsRecipe.getDescription());
- Assert.assertEquals("/mso/async/services/CreateVfModuleVolumeInfraV1", vnfComponentsRecipe.getOrchestrationUri());
+ Assert
+ .assertEquals("/mso/async/services/CreateVfModuleVolumeInfraV1", vnfComponentsRecipe.getOrchestrationUri());
}
@Test
public void testGetServiceByModelVersionAndModelInvariantUUID() {
- Service service = client.getServiceByModelVersionAndModelInvariantUUID("2.0", "9647dfc4-2083-11e7-93ae-92361f002671");
+ Service service = client
+ .getServiceByModelVersionAndModelInvariantUUID("2.0", "9647dfc4-2083-11e7-93ae-92361f002671");
Assert.assertNotNull(service);
Assert.assertNotNull(service.getModelVersion());
Assert.assertNotNull(service.getModelInvariantUUID());
@@ -360,7 +396,8 @@ public class CatalogDbClientTest {
@Test
public void testGetVfModuleByModelInvariantUUIDAndModelVersion() {
- VfModule vfModule = client.getVfModuleByModelInvariantUUIDAndModelVersion("78ca26d0-246d-11e7-93ae-92361f002671", "2");
+ VfModule vfModule = client
+ .getVfModuleByModelInvariantUUIDAndModelVersion("78ca26d0-246d-11e7-93ae-92361f002671", "2");
Assert.assertNotNull(vfModule);
Assert.assertNotNull(vfModule.getModelVersion());
Assert.assertNotNull(vfModule.getModelInvariantUUID());
@@ -373,10 +410,11 @@ public class CatalogDbClientTest {
VfModule vfModule = client.getVfModuleByModelInvariantUUIDAndModelVersion(UUID.randomUUID().toString(), "2");
Assert.assertNull(vfModule);
}
-
+
@Test
public void testGetServiceByModelInvariantUUIDOrderByModelVersionDesc() {
- List<Service> serviceList = client.getServiceByModelInvariantUUIDOrderByModelVersionDesc("9647dfc4-2083-11e7-93ae-92361f002671");
+ List<Service> serviceList = client
+ .getServiceByModelInvariantUUIDOrderByModelVersionDesc("9647dfc4-2083-11e7-93ae-92361f002671");
Assert.assertFalse(serviceList.isEmpty());
Assert.assertEquals(2, serviceList.size());
Service service = serviceList.get(0);
@@ -385,22 +423,25 @@ public class CatalogDbClientTest {
@Test
public void testGetServiceByModelInvariantUUIDOrderByModelVersionDescNotFound() {
- List<Service> serviceList = client.getServiceByModelInvariantUUIDOrderByModelVersionDesc(UUID.randomUUID().toString());
+ List<Service> serviceList = client
+ .getServiceByModelInvariantUUIDOrderByModelVersionDesc(UUID.randomUUID().toString());
Assert.assertTrue(serviceList.isEmpty());
}
@Test
public void testGetVfModuleByModelInvariantUUIDOrderByModelVersionDesc() {
- List<VfModule> moduleList = client.getVfModuleByModelInvariantUUIDOrderByModelVersionDesc("78ca26d0-246d-11e7-93ae-92361f002671");
+ List<VfModule> moduleList = client
+ .getVfModuleByModelInvariantUUIDOrderByModelVersionDesc("78ca26d0-246d-11e7-93ae-92361f002671");
Assert.assertFalse(moduleList.isEmpty());
Assert.assertEquals(2, moduleList.size());
VfModule module = moduleList.get(0);
- Assert.assertEquals("vSAMP10a DEV Base",module.getDescription());
+ Assert.assertEquals("vSAMP10a DEV Base", module.getDescription());
}
@Test
public void testPostCloudSite() {
- CatalogDbClientPortChanger localClient = new CatalogDbClientPortChanger("http://localhost:" + client.wiremockPort, msoAdaptersAuth, client.wiremockPort);
+ CatalogDbClientPortChanger localClient = new CatalogDbClientPortChanger(
+ "http://localhost:" + client.wiremockPort, msoAdaptersAuth, client.wiremockPort);
CloudSite cloudSite = new CloudSite();
cloudSite.setId("MTN6");
cloudSite.setClli("TESTCLLI");
@@ -438,60 +479,61 @@ public class CatalogDbClientTest {
@Test
public void testPostHomingInstance() {
- CatalogDbClientPortChanger localClient = new CatalogDbClientPortChanger("http://localhost:" + client.wiremockPort, msoAdaptersAuth, client.wiremockPort);
+ CatalogDbClientPortChanger localClient = new CatalogDbClientPortChanger(
+ "http://localhost:" + client.wiremockPort, msoAdaptersAuth, client.wiremockPort);
HomingInstance homingInstance = new HomingInstance();
homingInstance.setServiceInstanceId("5df8d6be-2083-11e7-93ae-92361f232671");
homingInstance.setCloudOwner("CloudOwner-1");
homingInstance.setCloudRegionId("CloudRegionOne");
homingInstance.setOofDirectives("{\n" +
- "\"directives\": [\n" +
- "{\n" +
- "\"directives\": [\n" +
- "{\n" +
- "\"attributes\": [\n" +
- "{\n" +
- "\"attribute_value\": \"onap.hpa.flavor31\",\n" +
- "\"attribute_name\": \"firewall_flavor_name\"\n" +
- "}\n" +
- "],\n" +
- "\"type\": \"flavor_directives\"\n" +
- "}\n" +
- "],\n" +
- "\"type\": \"vnfc\",\n" +
- "\"id\": \"vfw\"\n" +
- "},\n" +
- "{\n" +
- "\"directives\": [\n" +
- "{\n" +
- "\"attributes\": [\n" +
- "{\n" +
- "\"attribute_value\": \"onap.hpa.flavor32\",\n" +
- "\"attribute_name\": \"packetgen_flavor_name\"\n" +
- "}\n" +
- "],\n" +
- "\"type\": \"flavor_directives\"\n" +
- "}\n" +
- "],\n" +
- "\"type\": \"vnfc\",\n" +
- "\"id\": \"vgenerator\"\n" +
- "},\n" +
- "{\n" +
- "\"directives\": [\n" +
- "{\n" +
- "\"attributes\": [\n" +
- "{\n" +
- "\"attribute_value\": \"onap.hpa.flavor31\",\n" +
- "\"attribute_name\": \"sink_flavor_name\"\n" +
- "}\n" +
- "],\n" +
- "\"type\": \"flavor_directives\"\n" +
- "}\n" +
- "],\n" +
- "\"type\": \"vnfc\",\n" +
- "\"id\": \"vsink\"\n" +
- "}\n" +
- "]\n" +
- "}");
+ "\"directives\": [\n" +
+ "{\n" +
+ "\"directives\": [\n" +
+ "{\n" +
+ "\"attributes\": [\n" +
+ "{\n" +
+ "\"attribute_value\": \"onap.hpa.flavor31\",\n" +
+ "\"attribute_name\": \"firewall_flavor_name\"\n" +
+ "}\n" +
+ "],\n" +
+ "\"type\": \"flavor_directives\"\n" +
+ "}\n" +
+ "],\n" +
+ "\"type\": \"vnfc\",\n" +
+ "\"id\": \"vfw\"\n" +
+ "},\n" +
+ "{\n" +
+ "\"directives\": [\n" +
+ "{\n" +
+ "\"attributes\": [\n" +
+ "{\n" +
+ "\"attribute_value\": \"onap.hpa.flavor32\",\n" +
+ "\"attribute_name\": \"packetgen_flavor_name\"\n" +
+ "}\n" +
+ "],\n" +
+ "\"type\": \"flavor_directives\"\n" +
+ "}\n" +
+ "],\n" +
+ "\"type\": \"vnfc\",\n" +
+ "\"id\": \"vgenerator\"\n" +
+ "},\n" +
+ "{\n" +
+ "\"directives\": [\n" +
+ "{\n" +
+ "\"attributes\": [\n" +
+ "{\n" +
+ "\"attribute_value\": \"onap.hpa.flavor31\",\n" +
+ "\"attribute_name\": \"sink_flavor_name\"\n" +
+ "}\n" +
+ "],\n" +
+ "\"type\": \"flavor_directives\"\n" +
+ "}\n" +
+ "],\n" +
+ "\"type\": \"vnfc\",\n" +
+ "\"id\": \"vsink\"\n" +
+ "}\n" +
+ "]\n" +
+ "}");
localClient.postHomingInstance(homingInstance);
HomingInstance getHomingInstance = this.client.getHomingInstance("5df8d6be-2083-11e7-93ae-92361f232671");
Assert.assertNotNull(getHomingInstance);
@@ -501,7 +543,7 @@ public class CatalogDbClientTest {
Assert.assertEquals("CloudRegionOne", getHomingInstance.getCloudRegionId());
}
- @Test
+ @Test
public void testGetServiceByModelName() {
Service service = client.getServiceByModelName("MSOTADevInfra_Test_Service");
Assert.assertNotNull(service);
@@ -534,39 +576,44 @@ public class CatalogDbClientTest {
}
@Test
- public void testGetNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(){
- NorthBoundRequest northBoundRequest = new NorthBoundRequest();
- northBoundRequest.setAction("createService");
- northBoundRequest.setRequestScope("service");
- northBoundRequest.setIsAlacarte(true);
- northBoundRequest.setCloudOwner("my-custom-cloud-owner");
- client.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner("createService", "service", true, "my-custom-cloud-owner");
- Assert.assertNotNull(northBoundRequest);
- Assert.assertEquals("createService",northBoundRequest.getAction());
- Assert.assertEquals("service",northBoundRequest.getRequestScope());
- Assert.assertEquals(true,northBoundRequest.getIsAlacarte() );
- Assert.assertEquals("my-custom-cloud-owner", northBoundRequest.getCloudOwner());
+ public void testGetNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner() {
+ NorthBoundRequest northBoundRequest = new NorthBoundRequest();
+ northBoundRequest.setAction("createService");
+ northBoundRequest.setRequestScope("service");
+ northBoundRequest.setIsAlacarte(true);
+ northBoundRequest.setCloudOwner("my-custom-cloud-owner");
+ client.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner("createService", "service", true,
+ "my-custom-cloud-owner");
+ Assert.assertNotNull(northBoundRequest);
+ Assert.assertEquals("createService", northBoundRequest.getAction());
+ Assert.assertEquals("service", northBoundRequest.getRequestScope());
+ Assert.assertEquals(true, northBoundRequest.getIsAlacarte());
+ Assert.assertEquals("my-custom-cloud-owner", northBoundRequest.getCloudOwner());
}
-
+
@Test
public void testFindServiceRecipeByActionAndServiceModelUUID() {
- ServiceRecipe serviceRecipe = client.findServiceRecipeByActionAndServiceModelUUID("createInstance","4694a55f-58b3-4f17-92a5-796d6f5ffd0d" );
+ ServiceRecipe serviceRecipe = client
+ .findServiceRecipeByActionAndServiceModelUUID("createInstance", "4694a55f-58b3-4f17-92a5-796d6f5ffd0d");
Assert.assertNotNull(serviceRecipe);
Assert.assertNotNull(serviceRecipe.getServiceModelUUID());
Assert.assertNotNull(serviceRecipe.getAction());
- Assert.assertEquals("/mso/async/services/CreateGenericALaCarteServiceInstance", serviceRecipe.getOrchestrationUri());
+ Assert.assertEquals("/mso/async/services/CreateGenericALaCarteServiceInstance",
+ serviceRecipe.getOrchestrationUri());
Assert.assertEquals("MSOTADevInfra aLaCarte", serviceRecipe.getDescription());
}
@Test
public void testFindServiceRecipeByActionAndServiceModelUUIDNotFound() {
- ServiceRecipe serviceRecipe = client.findServiceRecipeByActionAndServiceModelUUID("not_found","5df8b6de-2083-11e7-93ae-test" );
+ ServiceRecipe serviceRecipe = client
+ .findServiceRecipeByActionAndServiceModelUUID("not_found", "5df8b6de-2083-11e7-93ae-test");
Assert.assertNull(serviceRecipe);
}
@Test
public void testFindExternalToInternalServiceByServiceName() {
- ExternalServiceToInternalService externalServiceToInternalService = client.findExternalToInternalServiceByServiceName("MySpecialServiceName");
+ ExternalServiceToInternalService externalServiceToInternalService = client
+ .findExternalToInternalServiceByServiceName("MySpecialServiceName");
Assert.assertNotNull(externalServiceToInternalService);
Assert.assertNotNull(externalServiceToInternalService.getServiceName());
Assert.assertNotNull(externalServiceToInternalService.getServiceModelUUID());
@@ -575,7 +622,51 @@ public class CatalogDbClientTest {
@Test
public void testFindExternalToInternalServiceByServiceNameNotFound() {
- ExternalServiceToInternalService externalServiceToInternalService = client.findExternalToInternalServiceByServiceName("Not_Found");
+ ExternalServiceToInternalService externalServiceToInternalService = client
+ .findExternalToInternalServiceByServiceName("Not_Found");
Assert.assertNull(externalServiceToInternalService);
}
+
+ @Test
+ public void getPnfResourceByModelUUID_validUuid_expectedOutput() {
+ PnfResource pnfResource = client.getPnfResourceByModelUUID("ff2ae348-214a-11e7-93ae-92361f002680");
+ Assert.assertNotNull(pnfResource);
+ assertEquals("PNFResource modelUUID", "ff2ae348-214a-11e7-93ae-92361f002680", pnfResource.getModelUUID());
+ assertEquals("PNFResource modelInvariantUUID", "2fff5b20-214b-11e7-93ae-92361f002680",
+ pnfResource.getModelInvariantUUID());
+ assertEquals("PNFResource modelVersion", "1.0", pnfResource.getModelVersion());
+ assertEquals("PNFResource orchestration mode", "", pnfResource.getOrchestrationMode());
+ }
+
+ @Test
+ public void getPnfResourceByModelUUID_invalidUuid_NullOutput() {
+ PnfResource pnfResource = client.getPnfResourceByModelUUID(UUID.randomUUID().toString());
+ Assert.assertNull(pnfResource);
+ }
+
+ @Test
+ public void getPnfResourceCustomizationByModelCustomizationUUID_validUuid_expectedOutput() {
+ PnfResourceCustomization pnfResourceCustomization = client
+ .getPnfResourceCustomizationByModelCustomizationUUID("68dc9a92-214c-11e7-93ae-92361f002680");
+ assertEquals("modelInstanceName", "PNF routing", pnfResourceCustomization.getModelInstanceName());
+ assertEquals("blueprintName", "test_configuration_restconf", pnfResourceCustomization.getBlueprintName());
+ assertEquals("blueprintVersion", "1.0.0", pnfResourceCustomization.getBlueprintVersion());
+ PnfResource pnfResource = pnfResourceCustomization.getPnfResources();
+ assertNotNull(pnfResource);
+
+ assertEquals("PNFResource modelUUID", "ff2ae348-214a-11e7-93ae-92361f002680", pnfResource.getModelUUID());
+ assertEquals("PNFResource modelInvariantUUID", "2fff5b20-214b-11e7-93ae-92361f002680",
+ pnfResource.getModelInvariantUUID());
+ assertEquals("PNFResource modelVersion", "1.0", pnfResource.getModelVersion());
+ assertEquals("PNFResource orchestration mode", "", pnfResource.getOrchestrationMode());
+
+ }
+
+ @Test
+ public void getPnfResourceCustomizationByModelCustomizationUUID_invalidUuid_nullOutput() {
+ PnfResourceCustomization pnfResourceCustomization = client
+ .getPnfResourceCustomizationByModelCustomizationUUID(UUID.randomUUID().toString());
+ Assert.assertNull(pnfResourceCustomization);
+ }
+
}
diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql
index 1223080e59..91deab8fff 100644
--- a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql
+++ b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql
@@ -293,3 +293,15 @@ VALUES ( '1',
'68dc9a92-214c-11e7-93ae-92361f002671',
'cb82ffd8-252a-11e7-93ae-92361f002671',
'9bcce658-9b37-11e8-98d0-529269fb1459');
+
+insert into service(model_uuid, model_name, model_invariant_uuid, model_version, description, creation_timestamp, tosca_csar_artifact_uuid, service_type, service_role, environment_context, workload_context) values
+('5df8b6de-2083-11e7-93ae-92361f002676', 'PNF_routing_service', '9647dfc4-2083-11e7-93ae-92361f002676', '1.0', 'PNF service', '2019-03-08 12:00:29', null, 'NA', 'NA', 'Luna', 'Oxygen');
+
+insert into pnf_resource(orchestration_mode, description, creation_timestamp, model_uuid, model_invariant_uuid, model_version, model_name, tosca_node_type) values
+('', 'PNF routing', '2019-03-08 12:00:28', 'ff2ae348-214a-11e7-93ae-92361f002680', '2fff5b20-214b-11e7-93ae-92361f002680', '1.0', 'PNF resource', null);
+
+insert into pnf_resource_customization(model_customization_uuid, model_instance_name, nf_type, nf_role, nf_function, nf_naming_code, creation_timestamp, pnf_resource_model_uuid, multi_stage_design, cds_blueprint_name, cds_blueprint_version) values
+('68dc9a92-214c-11e7-93ae-92361f002680', 'PNF routing', 'routing', 'routing', 'routing', 'routing', '2019-03-08 12:00:29', 'ff2ae348-214a-11e7-93ae-92361f002680', null, "test_configuration_restconf", "1.0.0");
+
+insert into pnf_resource_customization_to_service(service_model_uuid, resource_model_customization_uuid) values
+('5df8b6de-2083-11e7-93ae-92361f002676', '68dc9a92-214c-11e7-93ae-92361f002680'); \ No newline at end of file
diff --git a/adapters/mso-openstack-adapters/pom.xml b/adapters/mso-openstack-adapters/pom.xml
index f2f411d5b6..cb35e90860 100644
--- a/adapters/mso-openstack-adapters/pom.xml
+++ b/adapters/mso-openstack-adapters/pom.xml
@@ -13,8 +13,8 @@
<build>
<finalName>${project.artifactId}-${project.version}</finalName>
-
- <plugins>
+
+ <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
@@ -36,25 +36,75 @@
</executions>
</plugin>
- <!-- run the following plugin only when there's a wsdl change and you
- need to recompile the java classes <plugin> <groupId>org.codehaus.mojo</groupId>
- <artifactId>jaxws-maven-plugin</artifactId> <version>2.4.1</version> <executions>
- <execution> <id>generate-network-async-stubs</id> <phase>process-classes</phase>
- <goals> <goal>wsimport</goal> </goals> <configuration> <vmArgs> <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
- </vmArgs> <wsdlDirectory>src/main/resources/wsdl</wsdlDirectory> <wsdlFiles>
- <wsdlFile>NetworkAdapterNotify.wsdl</wsdlFile> </wsdlFiles> <wsdlLocation>/NetworkAdapterNotify.wsdl</wsdlLocation>
- <packageName>org.onap.so.adapters.network.async.client</packageName> <xnocompile>false</xnocompile>
- <keep>true</keep> </configuration> </execution> <execution> <id>generate-vnf-async-stubs</id>
- <phase>process-classes</phase> <goals> <goal>wsimport</goal> </goals> <configuration>
- <vmArgs> <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg> </vmArgs> <wsdlDirectory>src/main/resources/wsdl</wsdlDirectory>
- <wsdlFiles> <wsdlFile>VnfAdapterNotify.wsdl</wsdlFile> </wsdlFiles> <wsdlLocation>/VnfAdapterNotify.wsdl</wsdlLocation>
- <packageName>org.onap.so.adapters.vnf.async.client</packageName> <xnocompile>false</xnocompile>
- <keep>true</keep> </configuration> </execution> </executions> </plugin> <plugin>
- <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId>
- <version>3.0.0</version> <executions> <execution> <id>add-source</id> <phase>generate-sources</phase>
- <goals> <goal>add-source</goal> </goals> <configuration> <sources> <source>${project.build.directory}/generated-sources/wsimport/</source>
- </sources> </configuration> </execution> </executions> </plugin> -->
+<!-- run the following plugin only when there's a wsdl change and you need to recompile the java classes
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jaxws-maven-plugin</artifactId>
+ <version>2.4.1</version>
+ <executions>
+ <execution>
+ <id>generate-network-async-stubs</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>wsimport</goal>
+ </goals>
+ <configuration>
+ <vmArgs>
+ <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
+ </vmArgs>
+ <wsdlDirectory>src/main/resources/wsdl</wsdlDirectory>
+ <wsdlFiles>
+ <wsdlFile>NetworkAdapterNotify.wsdl</wsdlFile>
+ </wsdlFiles>
+ <wsdlLocation>/NetworkAdapterNotify.wsdl</wsdlLocation>
+ <packageName>org.onap.so.adapters.network.async.client</packageName>
+ <xnocompile>false</xnocompile>
+ <keep>true</keep>
+ </configuration>
+ </execution>
+
+ <execution>
+ <id>generate-vnf-async-stubs</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>wsimport</goal>
+ </goals>
+ <configuration>
+ <vmArgs>
+ <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
+ </vmArgs>
+ <wsdlDirectory>src/main/resources/wsdl</wsdlDirectory>
+ <wsdlFiles>
+ <wsdlFile>VnfAdapterNotify.wsdl</wsdlFile>
+ </wsdlFiles>
+ <wsdlLocation>/VnfAdapterNotify.wsdl</wsdlLocation>
+ <packageName>org.onap.so.adapters.vnf.async.client</packageName>
+ <xnocompile>false</xnocompile>
+ <keep>true</keep>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>3.0.0</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${project.build.directory}/generated-sources/wsimport/</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ --> <plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
@@ -76,12 +126,12 @@
</execution>
</executions>
</plugin>
- </plugins>
-
-
+ </plugins>
+
+
<pluginManagement>
<plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings
+ <!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
@@ -118,10 +168,10 @@
</build>
<dependencies>
- <!-- added for spring boot support -->
+ <!-- added for spring boot support -->
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-actuator</artifactId>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
@@ -134,7 +184,7 @@
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
- <version>${cxf.version}</version>
+ <version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
@@ -142,9 +192,9 @@
<version>${cxf.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-rs-service-description-swagger</artifactId>
- <version>${cxf.version}</version>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-rs-service-description-swagger</artifactId>
+ <version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
@@ -157,16 +207,16 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>janino</groupId>
- <artifactId>janino</artifactId>
- <version>2.5.15</version>
+ <groupId>janino</groupId>
+ <artifactId>janino</artifactId>
+ <version>2.5.15</version>
</dependency>
-
- <!-- end added for spring boot support -->
-
-
-
- <!-- added for unit testing -->
+
+ <!-- end added for spring boot support -->
+
+
+
+ <!-- added for unit testing -->
<dependency>
<groupId>org.onap.so.adapters</groupId>
<artifactId>mso-adapter-utils</artifactId>
@@ -181,11 +231,11 @@
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>test</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.onap.so</groupId>
<artifactId>common</artifactId>
@@ -214,9 +264,9 @@
<version>${openstack.version}</version>
</dependency>
<dependency>
- <groupId>org.camunda.bpm</groupId>
- <artifactId>camunda-external-task-client</artifactId>
- <version>1.0.0</version>
- </dependency>
+ <groupId>org.camunda.bpm</groupId>
+ <artifactId>camunda-external-task-client</artifactId>
+ <version>1.1.1</version>
+ </dependency>
</dependencies>
</project>
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackServiceData.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java
index 773705d566..24980ae4e0 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackServiceData.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java
@@ -22,7 +22,6 @@
package org.onap.so.adapters.audit;
-
import org.camunda.bpm.client.task.ExternalTask;
import org.camunda.bpm.client.task.ExternalTaskService;
import org.onap.logging.ref.slf4j.ONAPLogConstants;
@@ -35,14 +34,14 @@ import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@Component
-public class AuditStackServiceData {
+public class AuditCreateStackService {
private static final String UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI = "Unable to find all VServers and L-Interaces in A&AI";
private static final int[] RETRY_SEQUENCE = new int[] { 1, 1, 2, 3, 5, 8, 13, 20};
- private static final Logger logger = LoggerFactory.getLogger(AuditStackServiceData.class);
+ private static final Logger logger = LoggerFactory.getLogger(AuditCreateStackService.class);
@Autowired
public HeatStackAudit heatStackAudit;
@@ -56,7 +55,7 @@ public class AuditStackServiceData {
boolean success = false;
try {
logger.info("Executing External Task Audit Inventory, Retry Number: {} \n {}", auditInventory,externalTask.getRetries());
- success=heatStackAudit.auditHeatStack(auditInventory.getCloudRegion(), auditInventory.getCloudOwner(),
+ success=heatStackAudit.auditHeatStackCreate(auditInventory.getCloudRegion(), auditInventory.getCloudOwner(),
auditInventory.getTenantId(), auditInventory.getHeatStackName());
} catch (Exception e) {
logger.error("Error during audit of stack", e);
@@ -72,7 +71,7 @@ public class AuditStackServiceData {
}else if(externalTask.getRetries() != null &&
externalTask.getRetries()-1 == 0){
logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTask.getId());
- externalTaskService.handleBpmnError(externalTask, "AuditAAIInventoryFailure");
+ externalTaskService.handleBpmnError(externalTask, "AuditAAIInventoryFailure", "Number of Retries Exceeded auditing inventory");
}else{
logger.debug("The External Task Id: {} Failed, Decrementing Retries: {} , Retry Delay: ", externalTask.getId(),externalTask.getRetries()-1, calculateRetryDelay(externalTask.getRetries()));
externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, externalTask.getRetries()-1, calculateRetryDelay(externalTask.getRetries()));
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java
new file mode 100644
index 0000000000..66d8fbd47c
--- /dev/null
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java
@@ -0,0 +1,90 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017-2019 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.onap.so.adapters.audit;
+
+import org.camunda.bpm.client.task.ExternalTask;
+import org.camunda.bpm.client.task.ExternalTaskService;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.so.audit.beans.AuditInventory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+
+@Component
+public class AuditDeleteStackService {
+
+ private static final String UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI = "All VServers have not been deleted in A&AI";
+
+ private static final int[] RETRY_SEQUENCE = new int[] { 1, 1, 2, 3, 5, 8, 13, 20};
+
+
+ private static final Logger logger = LoggerFactory.getLogger(AuditDeleteStackService.class);
+
+ @Autowired
+ public HeatStackAudit heatStackAudit;
+
+ @Autowired
+ public Environment env;
+
+ protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService){
+ AuditInventory auditInventory = externalTask.getVariable("auditInventory");
+ setupMDC(externalTask);
+ boolean success = false;
+ try {
+ logger.info("Executing External Task Audit Inventory, Retry Number: {} \n {}", auditInventory,externalTask.getRetries());
+ success=heatStackAudit.auditHeatStackDeleted(auditInventory.getCloudRegion(), auditInventory.getCloudOwner(),
+ auditInventory.getTenantId(), auditInventory.getHeatStackName());
+ } catch (Exception e) {
+ logger.error("Error during audit of stack", e);
+ }
+
+ if (success) {
+ externalTaskService.complete(externalTask);
+ logger.debug("The External Task Id: {} Successful", externalTask.getId());
+ } else {
+ if(externalTask.getRetries() == null){
+ logger.debug("The External Task Id: {} Failed, Setting Retries to Default Start Value: {}", externalTask.getId(),RETRY_SEQUENCE.length);
+ externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, RETRY_SEQUENCE.length, 10000);
+ }else if(externalTask.getRetries() != null &&
+ externalTask.getRetries()-1 == 0){
+ logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTask.getId());
+ externalTaskService.complete(externalTask);
+ }else{
+ logger.debug("The External Task Id: {} Failed, Decrementing Retries: {} , Retry Delay: ", externalTask.getId(),externalTask.getRetries()-1, calculateRetryDelay(externalTask.getRetries()));
+ externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, externalTask.getRetries()-1, calculateRetryDelay(externalTask.getRetries()));
+ }
+ logger.debug("The External Task Id: {} Failed", externalTask.getId());
+ }
+ }
+ private void setupMDC(ExternalTask externalTask) {
+ String msoRequestId = (String)externalTask.getVariable("mso-request-id");
+ if(msoRequestId != null && !msoRequestId.isEmpty())
+ MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, msoRequestId);
+ }
+ protected long calculateRetryDelay(int currentRetries){
+ int retrySequence = RETRY_SEQUENCE.length - currentRetries;
+ long retryMultiplier = Long.parseLong(env.getProperty("mso.workflow.topics.retryMultiplier","6000"));
+ return RETRY_SEQUENCE[retrySequence] * retryMultiplier;
+ }
+}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
index 499c1137c7..6ea14dcac7 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
@@ -46,10 +46,30 @@ public class AuditStackService {
public Environment env;
@Autowired
- private AuditStackServiceData auditStack;
+ private AuditCreateStackService auditCreateStack;
+
+ @Autowired
+ private AuditDeleteStackService auditDeleteStack;
@PostConstruct
- public void auditAAIInventory() {
+ public void auditAddAAIInventory() {
+ String auth = "";
+ try {
+ auth = CryptoUtils.decrypt(env.getRequiredProperty("mso.auth"), env.getRequiredProperty("mso.msoKey"));
+ } catch (IllegalStateException | GeneralSecurityException e) {
+ logger.error("Error Decrypting Password", e);
+ }
+ ClientRequestInterceptor interceptor = new BasicAuthProvider(env.getRequiredProperty("mso.config.cadi.aafId"),
+ auth);
+ ExternalTaskClient client = ExternalTaskClient.create()
+ .baseUrl(env.getRequiredProperty("mso.workflow.endpoint")).maxTasks(1).addInterceptor(interceptor)
+ .asyncResponseTimeout(120000).build();
+ client.subscribe("InventoryAddAudit").lockDuration(60000)
+ .handler(auditCreateStack::executeExternalTask).open();
+ }
+
+ @PostConstruct
+ public void auditDeleteAAIInventory() {
String auth = "";
try {
auth = CryptoUtils.decrypt(env.getRequiredProperty("mso.auth"), env.getRequiredProperty("mso.msoKey"));
@@ -60,9 +80,9 @@ public class AuditStackService {
auth);
ExternalTaskClient client = ExternalTaskClient.create()
.baseUrl(env.getRequiredProperty("mso.workflow.endpoint")).maxTasks(1).addInterceptor(interceptor)
- .asyncResponseTimeout(120000).backoffStrategy(new ExponentialBackoffStrategy(10000, 2, 120000)).build();
- client.subscribe("InventoryAudit").lockDuration(60000)
- .handler(auditStack::executeExternalTask).open();
+ .asyncResponseTimeout(120000).build();
+ client.subscribe("InventoryDeleteAudit").lockDuration(60000)
+ .handler(auditDeleteStack::executeExternalTask).open();
}
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java
index 6e6ecd51d4..c81dac7c6f 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java
@@ -39,23 +39,32 @@ import org.springframework.stereotype.Component;
public class AuditVServer extends AbstractAudit {
private static final Logger logger = LoggerFactory.getLogger(AuditVServer.class);
- public boolean auditVservers(Set<Vserver> vServersToAudit, String tenantId, String cloudOwner, String cloudRegion) {
+ public boolean auditAllVserversDoExist(Set<Vserver> vServersToAudit, String tenantId, String cloudOwner, String cloudRegion) {
if (vServersToAudit == null || vServersToAudit.isEmpty()){
return false;
}
return vServersToAudit.stream()
- .filter(vServer -> !doesVServerExistInAAI(vServer, tenantId, cloudOwner, cloudRegion)).findFirst()
+ .filter(vServer -> !doesVServerExistInAAI(vServer, tenantId, cloudOwner, cloudRegion,true)).findFirst()
+ .map(v -> false).orElse(true);
+ }
+
+ public boolean auditAllVserversDoNotExist(Set<Vserver> vServersToAudit, String tenantId, String cloudOwner, String cloudRegion) {
+ if (vServersToAudit == null || vServersToAudit.isEmpty()){
+ return true;
+ }
+ return vServersToAudit.stream()
+ .filter(vServer -> doesVServerExistInAAI(vServer, tenantId, cloudOwner, cloudRegion,false)).findFirst()
.map(v -> false).orElse(true);
}
- private boolean doesVServerExistInAAI(Vserver vServer, String tenantId, String cloudOwner, String cloudRegion) {
+ private boolean doesVServerExistInAAI(Vserver vServer, String tenantId, String cloudOwner, String cloudRegion, boolean checkLinterfaces) {
AAIResourceUri vserverURI = AAIUriFactory.createResourceUri(AAIObjectType.VSERVER, cloudOwner, cloudRegion,
tenantId, vServer.getVserverId());
boolean vServerExists = getAaiClient().exists(vserverURI);
boolean doesExist = getAaiClient().exists(vserverURI);
logger.info("v-server {} exists: {}", vServer.getVserverId(), doesExist);
boolean allNeutronNetworksExist = true;
- if (vServerExists && vServer.getLInterfaces() != null) {
+ if (vServerExists && vServer.getLInterfaces() != null && checkLinterfaces) {
allNeutronNetworksExist = vServer.getLInterfaces()
.getLInterface().stream().filter(lInterface -> !doesLinterfaceExistinAAI(lInterface,
vServer.getVserverId(), tenantId, cloudOwner, cloudRegion))
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java
index da833c7b07..19e3ab71f5 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java
@@ -57,26 +57,51 @@ public class HeatStackAudit {
@Autowired
protected AuditVServer auditVservers;
- public boolean auditHeatStack(String cloudRegion, String cloudOwner, String tenantId, String heatStackName) {
+ public boolean auditHeatStackCreate(String cloudRegion, String cloudOwner, String tenantId, String heatStackName) {
try {
- logger.debug("Fetching Top Level Stack Information");
- Resources resources = heat.queryStackResources(cloudRegion, tenantId, heatStackName);
- List<Resource> novaResources = resources.getList().stream()
- .filter(p -> "OS::Nova::Server".equals(p.getType())).collect(Collectors.toList());
- List<Resource> resourceGroups = resources.getList().stream()
- .filter(p -> "OS::Heat::ResourceGroup".equals(p.getType()) && p.getName().contains("subinterfaces")).collect(Collectors.toList());
- if(novaResources.isEmpty())
- return true;
- else{
- Set<Vserver> vserversToAudit = createVserverSet(resources, novaResources);
- Set<Vserver> vserversWithSubInterfaces = processSubInterfaces(cloudRegion, tenantId, resourceGroups,
- vserversToAudit);
- return auditVservers.auditVservers(vserversWithSubInterfaces, tenantId, cloudOwner, cloudRegion);
- }
+ return auditStack(cloudRegion,cloudOwner,tenantId,heatStackName,true);
} catch (Exception e) {
logger.error("Error during auditing stack resources", e);
return false;
}
+ }
+
+ public boolean auditHeatStackDeleted(String cloudRegion, String cloudOwner, String tenantId, String heatStackName) {
+ try {
+ return auditStack(cloudRegion,cloudOwner,tenantId,heatStackName,false);
+ } catch (Exception e) {
+ logger.error("Error during auditing stack resources", e);
+ return false;
+ }
+ }
+
+ private boolean auditStack(String cloudRegion, String cloudOwner, String tenantId, String heatStackName,boolean isCreateAudit) throws Exception{
+ logger.debug("Fetching Top Level Stack Information");
+ Resources resources = heat.queryStackResources(cloudRegion, tenantId, heatStackName);
+ List<Resource> novaResources = extractNovaResources(resources);
+ if(novaResources.isEmpty())
+ return true;
+ else{
+ List<Resource> resourceGroups = extractResourceGroups(resources);
+ Set<Vserver> vserversToAudit = createVserverSet(resources, novaResources);
+ Set<Vserver> vserversWithSubInterfaces = processSubInterfaces(cloudRegion, tenantId, resourceGroups,
+ vserversToAudit);
+ if(isCreateAudit){
+ return auditVservers.auditAllVserversDoExist(vserversWithSubInterfaces, tenantId, cloudOwner, cloudRegion);
+ }else{
+ return auditVservers.auditAllVserversDoNotExist(vserversWithSubInterfaces, tenantId, cloudOwner, cloudRegion);
+ }
+ }
+ }
+
+ private List<Resource> extractResourceGroups(Resources resources) {
+ return resources.getList().stream()
+ .filter(p -> "OS::Heat::ResourceGroup".equals(p.getType()) && p.getName().contains("subinterfaces")).collect(Collectors.toList());
+ }
+
+ private List<Resource> extractNovaResources(Resources resources) {
+ return resources.getList().stream()
+ .filter(p -> "OS::Nova::Server".equals(p.getType())).collect(Collectors.toList());
}
protected Set<Vserver> processSubInterfaces(String cloudRegion, String tenantId, List<Resource> resourceGroups,
@@ -208,5 +233,4 @@ public class HeatStackAudit {
return Optional.empty();
}
-
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java
index 80333d6c7e..25d8e564da 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java
@@ -129,7 +129,6 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
String error;
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName ("CreateNetworkA");
logger.debug("Async Create Network: {} of type {} in {}/{}", networkName, networkType, cloudSiteId, tenantId);
// Use the synchronous method to perform the actual Create
@@ -252,10 +251,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
String messageId,
MsoRequest msoRequest,
String notificationUrl) {
- String error;
- String serviceName = "UpdateNetworkA";
- MsoLogger.setServiceName (serviceName);
MsoLogger.setLogContext (msoRequest);
logger.debug("Async Update Network: {} of type {} in {}/{}", networkId, networkType, cloudSiteId, tenantId);
@@ -292,9 +288,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
msoRequest,
subnetIdMap,
networkRollback);
- MsoLogger.setServiceName (serviceName);
} catch (NetworkException e) {
- MsoLogger.setServiceName (serviceName);
logger.debug ("Got a NetworkException on updateNetwork: ", e);
MsoExceptionCategory exCat = null;
String eMsg = null;
@@ -351,8 +345,6 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
String error;
MsoLogger.setLogContext (msoRequest);
- String serviceName = "QueryNetworkA";
- MsoLogger.setServiceName (serviceName);
logger.debug("Async Query Network {} in {}/{}", networkNameOrId, cloudSiteId, tenantId);
String errorCreateNetworkMessage = "{} {} Error sending createNetwork notification {} ";
@@ -378,9 +370,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
status,
vlans,
subnetIdMap);
- MsoLogger.setServiceName (serviceName);
} catch (NetworkException e) {
- MsoLogger.setServiceName (serviceName);
logger.debug (NETWORK_EXCEPTION_MSG, e);
MsoExceptionCategory exCat = null;
String eMsg = null;
@@ -453,7 +443,6 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
String error;
MsoLogger.setLogContext (msoRequest);
String serviceName = "DeleteNetworkA";
- MsoLogger.setServiceName (serviceName);
logger.debug("Async Delete Network {} in {}/{}", networkId, cloudSiteId, tenantId);
// Use the synchronous method to perform the actual Create
@@ -464,9 +453,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
try {
networkAdapter.deleteNetwork (cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkId, msoRequest, networkDeleted);
- MsoLogger.setServiceName (serviceName);
} catch (NetworkException e) {
- MsoLogger.setServiceName (serviceName);
logger.debug (NETWORK_EXCEPTION_MSG, e);
MsoExceptionCategory exCat = null;
String eMsg = null;
@@ -513,9 +500,6 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
*/
@Override
public void rollbackNetworkA (NetworkRollback rollback, String messageId, String notificationUrl) {
- String error;
- String serviceName = "RollbackNetworkA";
- MsoLogger.setServiceName (serviceName);
// rollback may be null (e.g. if network already existed when Create was called)
if (rollback == null) {
logger.warn("{} {} Rollback is null", MessageEnum.RA_ROLLBACK_NULL,
@@ -530,9 +514,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
try {
networkAdapter.rollbackNetwork (rollback);
- MsoLogger.setServiceName (serviceName);
} catch (NetworkException e) {
- MsoLogger.setServiceName (serviceName);
logger.debug ("Got a NetworkException on rollbackNetwork: ", e);
// Build and send Asynchronous error response
MsoExceptionCategory exCat = null;
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
index 79966577f8..bcb6b1be42 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
@@ -267,8 +267,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
Holder <Map <String, String>> subnetIdMap,
Holder <NetworkRollback> rollback) throws NetworkException {
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName (CREATE_NETWORK_CONTEXT);
-
logger.debug("*** CREATE Network: {} of type {} in {}/{}", networkName, networkType, cloudSiteId, tenantId);
// Will capture execution time for metrics
@@ -715,7 +713,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
Holder <Map <String, String>> subnetIdMap,
Holder <NetworkRollback> rollback) throws NetworkException {
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName (UPDATE_NETWORK_CONTEXT);
logger.debug("***UPDATE Network adapter with Network: {} of type {} in {}/{}", networkName, networkType,
cloudSiteId, tenantId);
@@ -1151,7 +1148,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
Holder <List <RouteTarget>> routeTargets,
Holder <Map <String, String>> subnetIdMap) throws NetworkException {
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName ("QueryNetwork");
logger.debug("*** QUERY Network with Network: {} in {}/{}", networkNameOrId, cloudSiteId, tenantId);
// Will capture execution time for metrics
@@ -1290,7 +1286,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
MsoRequest msoRequest,
Holder <Boolean> networkDeleted) throws NetworkException {
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName ("DeleteNetwork");
logger.debug("*** DELETE Network adapter with Network: {} in {}/{}", networkId, cloudSiteId, tenantId);
// Will capture execution time for metrics
@@ -1382,7 +1377,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
*/
@Override
public void rollbackNetwork (NetworkRollback rollback) throws NetworkException {
- MsoLogger.setServiceName ("RollbackNetwork");
// Will capture execution time for metrics
long startTime = System.currentTimeMillis ();
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java
index 8f9152a86d..253f13d57d 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java
@@ -90,6 +90,7 @@ public class NetworkAdapterRest {
@Autowired
private MsoNetworkAdapterImpl adapter;
+
@Autowired
private Provider<BpelRestClient> bpelRestClientProvider;
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/MsoTenantAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/MsoTenantAdapterImpl.java
index db9226bb19..a937bd9499 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/MsoTenantAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/MsoTenantAdapterImpl.java
@@ -89,7 +89,6 @@ public class MsoTenantAdapterImpl implements MsoTenantAdapter {
Holder <String> tenantId,
Holder <TenantRollback> rollback) throws TenantException {
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName (CREATE_TENANT);
logger.debug("Call to MSO createTenant adapter. Creating Tenant: {} in {}", tenantName, cloudSiteId);
@@ -154,7 +153,6 @@ public class MsoTenantAdapterImpl implements MsoTenantAdapter {
Holder <String> tenantName,
Holder <Map <String, String>> metadata) throws TenantException {
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName (QUERY_TENANT);
logger.debug ("Querying Tenant {} in {}", tenantNameOrId, cloudSiteId);
MsoTenantUtils tUtils;
@@ -199,7 +197,6 @@ public class MsoTenantAdapterImpl implements MsoTenantAdapter {
MsoRequest msoRequest,
Holder <Boolean> tenantDeleted) throws TenantException {
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName (DELETE_TENANT);
logger.debug ("Deleting Tenant {} in {}", tenantId, cloudSiteId);
@@ -230,7 +227,6 @@ public class MsoTenantAdapterImpl implements MsoTenantAdapter {
*/
@Override
public void rollbackTenant (TenantRollback rollback) throws TenantException {
- MsoLogger.setServiceName (ROLLBACK_TENANT);
// rollback may be null (e.g. if stack already existed when Create was called)
if (rollback == null) {
logger.warn("{} {} rollbackTenant, rollback is null", MessageEnum.RA_ROLLBACK_NULL,
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java
index 7265a59397..8a5a083c63 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java
@@ -59,7 +59,7 @@ import org.springframework.stereotype.Component;
* org.onap.so.adapters.vnf.retrylist list of response codes that will trigger a retry (the special code
* 900 means "connection was not established")
*/
-@Component()
+@Component
@Scope("prototype")
public class BpelRestClient {
public static final String MSO_PROP_VNF_ADAPTER = "MSO_PROP_VNF_ADAPTER";
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java
index 2c9d3776a7..b445dc8a26 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java
@@ -132,10 +132,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
String messageId,
MsoRequest msoRequest,
String notificationUrl) {
- String error;
- String serviceName = "CreateVnfA";
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName (serviceName);
logger.info("{} createVnfA", MessageEnum.RA_ASYNC_CREATE_VNF);
// Use the synchronous method to perform the actual Create
MsoVnfAdapter vnfAdapter = vnfImpl;
@@ -160,9 +157,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
vnfId,
outputs,
vnfRollback);
- MsoLogger.setServiceName (serviceName);
} catch (VnfException e) {
- MsoLogger.setServiceName (serviceName);
logger.error("{} {} VnfException in createVnfA ", MessageEnum.RA_CREATE_VNF_ERR,
MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
@@ -218,9 +213,6 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
String messageId,
MsoRequest msoRequest,
String notificationUrl) {
- String error;
- String serviceName = "UpdateVnfA";
- MsoLogger.setServiceName (serviceName);
MsoLogger.setLogContext (msoRequest);
logger.info("{} UpdateVnfA", MessageEnum.RA_ASYNC_UPDATE_VNF);
@@ -234,9 +226,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
try {
vnfAdapter.updateVnf (cloudSiteId, tenantId, vnfType,vnfVersion, vnfName, requestType, volumeGroupHeatStackId, inputs, msoRequest, outputs, vnfRollback);
- MsoLogger.setServiceName (serviceName);
} catch (VnfException e) {
- MsoLogger.setServiceName (serviceName);
logger.error("{} {} Exception sending updateVnf notification ", MessageEnum.RA_UPDATE_VNF_ERR,
MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
@@ -301,7 +291,6 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
String notificationUrl) {
String error;
String serviceName = "QueryVnfA";
- MsoLogger.setServiceName (serviceName);
MsoLogger.setLogContext (msoRequest);
logger.info("{}", MessageEnum.RA_ASYNC_QUERY_VNF);
@@ -316,9 +305,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
try {
vnfAdapter.queryVnf (cloudSiteId, tenantId, vnfName, msoRequest, vnfExists, vnfId, status, outputs);
- MsoLogger.setServiceName (serviceName);
} catch (VnfException e) {
- MsoLogger.setServiceName (serviceName);
logger.error("{} {} Exception sending queryVnfA notification ", MessageEnum.RA_QUERY_VNF_ERR,
MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
@@ -391,7 +378,6 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
String notificationUrl) {
String error;
String serviceName = "DeleteVnfA";
- MsoLogger.setServiceName (serviceName);
MsoLogger.setLogContext (msoRequest);
logger.info("{}", MessageEnum.RA_ASYNC_DELETE_VNF);
@@ -400,9 +386,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
try {
vnfAdapter.deleteVnf (cloudSiteId, tenantId, vnfName, msoRequest);
- MsoLogger.setServiceName (serviceName);
} catch (VnfException e) {
- MsoLogger.setServiceName (serviceName);
logger.error("{} {} Exception sending deleteVnfA notification ", MessageEnum.RA_DELETE_VNF_ERR,
MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
@@ -451,9 +435,6 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
*/
@Override
public void rollbackVnfA (VnfRollback rollback, String messageId, String notificationUrl) {
- String serviceName = "RollbackVnfA";
- MsoLogger.setServiceName (serviceName);
- String error;
// rollback may be null (e.g. if stack already existed when Create was called)
if (rollback == null) {
logger.info("{} rollbackVnfA: Empty Rollback: No action to perform", MessageEnum.RA_ROLLBACK_NULL);
@@ -468,9 +449,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
try {
vnfAdapter.rollbackVnf (rollback);
- MsoLogger.setServiceName (serviceName);
} catch (VnfException e) {
- MsoLogger.setServiceName (serviceName);
logger.error("{} {} Exception sending rollbackVnfA notification ", MessageEnum.RA_ROLLBACK_VNF_ERR,
MsoLogger.ErrorCode.BusinessProcesssError.getValue(), e);
org.onap.so.adapters.vnf.async.client.MsoExceptionCategory exCat = null;
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
index 96160760fd..a1d7698ad1 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -73,6 +75,8 @@ import org.onap.so.adapters.valet.beans.ValetRollbackResponse;
import org.onap.so.adapters.valet.beans.ValetStatus;
import org.onap.so.adapters.valet.beans.ValetUpdateResponse;
import org.onap.so.adapters.valet.GenericValetResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@@ -93,10 +97,10 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
@Autowired
private Environment environment;
+ private static final Logger logger = LoggerFactory.getLogger(MsoVnfAdapterImpl.class);
+
private static final String MSO_CONFIGURATION_ERROR = "MsoConfigurationError";
private static final String VNF_ADAPTER_SERVICE_NAME = "MSO-BPMN:MSO-VnfAdapter.";
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA,MsoVnfAdapterImpl.class);
-
private static final String CHECK_REQD_PARAMS = "org.onap.so.adapters.vnf.checkRequiredParameters";
private static final String ADD_GET_FILES_ON_VOLUME_REQ = "org.onap.so.adapters.vnf.addGetFilesOnVolumeReq";
private static final ObjectMapper JSON_MAPPER = new ObjectMapper();
@@ -132,7 +136,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
*/
@Override
public void healthCheck () {
- LOGGER.debug ("Health check call in VNF Adapter");
+ logger.debug ("Health check call in VNF Adapter");
}
/**
@@ -193,7 +197,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
String vfModuleId = "";
// Create a hook here to catch shortcut createVf requests:
if (requestType != null && requestType.startsWith("VFMOD")) {
- LOGGER.debug("Calling createVfModule from createVnf -- requestType=" + requestType);
+ logger.debug("Calling createVfModule from createVnf -- requestType=" + requestType);
String newRequestType = requestType.substring(5);
String vfVolGroupHeatStackId = "";
String vfBaseHeatStackId = "";
@@ -204,7 +208,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
}
} catch (Exception e) {
// might be ok - both are just blank
- LOGGER.debug("ERROR trying to parse the volumeGroupHeatStackId " + volumeGroupHeatStackId,e);
+ logger.debug("ERROR trying to parse the volumeGroupHeatStackId " + volumeGroupHeatStackId,e);
}
this.createVfModule(cloudSiteId,
tenantId,
@@ -258,7 +262,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
}
@Override
- public void updateVnf (String cloudSiteId,
+ public void updateVnf(String cloudSiteId,
String tenantId,
String vnfType,
String vnfVersion,
@@ -271,8 +275,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
Holder <VnfRollback> rollback) throws VnfException {
// As of 1707 - this method should no longer be called
MsoLogger.setLogContext (msoRequest.getRequestId (), msoRequest.getServiceInstanceId ());
- MsoLogger.setServiceName ("UpdateVnf");
- LOGGER.debug("UpdateVnf called?? This should not be called any longer - update vfModule");
+ logger.debug("UpdateVnf called?? This should not be called any longer - update vfModule");
}
/**
@@ -300,8 +303,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
Holder <VnfStatus> status,
Holder <Map <String, String>> outputs) throws VnfException {
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName ("QueryVnf");
- LOGGER.debug ("Querying VNF " + vnfName + " in " + cloudSiteId + "/" + tenantId);
+ logger.debug("Querying VNF {} in {}", vnfName, cloudSiteId + "/" + tenantId);
// Will capture execution time for metrics
long startTime = System.currentTimeMillis ();
@@ -310,15 +312,15 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
long subStartTime = System.currentTimeMillis ();
try {
heatStack = heat.queryStack (cloudSiteId, tenantId, vnfName);
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESS_MSG, "OpenStack", "QueryStack", vnfName);
} catch (MsoException me) {
me.addContext ("QueryVNF");
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
String error = "Query VNF: " + vnfName + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryStack", vnfName);
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vnfName, cloudSiteId, tenantId, "OpenStack", "QueryVNF", MsoLogger.ErrorCode.DataError, "Exception - queryStack", me);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudSiteId,
+ tenantId, "OpenStack", "QueryVNF", MsoLogger.ErrorCode.DataError.getValue(), "Exception - queryStack",
+ me);
+ logger.debug(error);
throw new VnfException (me);
}
@@ -331,16 +333,15 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
vnfId.value = null;
outputs.value = new HashMap<>(); // Return as an empty map
- LOGGER.debug ("VNF " + vnfName + " not found");
+ logger.debug ("VNF {} not found", vnfName);
} else {
vnfExists.value = Boolean.TRUE;
status.value = stackStatusToVnfStatus (heatStack.getStatus ());
vnfId.value = heatStack.getCanonicalName ();
outputs.value = copyStringOutputs (heatStack.getOutputs ());
- LOGGER.debug ("VNF " + vnfName + " found, ID = " + vnfId.value);
+ logger.debug ("VNF {} found, ID = {}", vnfName, vnfId.value);
}
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully query VNF");
return;
}
@@ -361,8 +362,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
String vnfName,
MsoRequest msoRequest) throws VnfException {
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName ("DeleteVnf");
- LOGGER.debug ("Deleting VNF " + vnfName + " in " + cloudSiteId + "/" + tenantId);
+ logger.debug("Deleting VNF {} in {}", vnfName, cloudSiteId + "/" + tenantId);
// Will capture execution time for metrics
long startTime = System.currentTimeMillis ();
@@ -373,20 +373,19 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
long subStartTime = System.currentTimeMillis ();
try {
heat.deleteStack (tenantId, cloudSiteId, vnfName, true);
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESS_MSG, "OpenStack", "DeleteStack", vnfName);
} catch (MsoException me) {
me.addContext ("DeleteVNF");
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
String error = "Delete VNF: " + vnfName + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteStack", vnfName);
- LOGGER.error (MessageEnum.RA_DELETE_VNF_ERR, vnfName, cloudSiteId, tenantId, "OpenStack", "DeleteVNF", MsoLogger.ErrorCode.DataError, "Exception - DeleteVNF", me);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vnfName, cloudSiteId,
+ tenantId, "OpenStack", "DeleteVNF", MsoLogger.ErrorCode.DataError.getValue(), "Exception - DeleteVNF",
+ me);
+ logger.debug(error);
throw new VnfException (me);
}
// On success, nothing is returned.
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully delete VNF");
return;
}
@@ -399,11 +398,9 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
@Override
public void rollbackVnf (VnfRollback rollback) throws VnfException {
long startTime = System.currentTimeMillis ();
- MsoLogger.setServiceName ("RollbackVnf");
// rollback may be null (e.g. if stack already existed when Create was called)
if (rollback == null) {
- LOGGER.info (MessageEnum.RA_ROLLBACK_NULL.toString(), "OpenStack", "rollbackVnf");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, "Rollback request content is null");
+ logger.info(MessageEnum.RA_ROLLBACK_NULL.toString(), "OpenStack", "rollbackVnf");
return;
}
@@ -414,7 +411,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
MsoLogger.setLogContext (rollback.getMsoRequest());
- LOGGER.debug ("Rolling Back VNF " + vnfId + " in " + cloudSiteId + "/" + tenantId);
+ logger.debug("Rolling Back VNF {} in {}", vnfId, cloudSiteId + "/" + tenantId);
// Use the MsoHeatUtils to delete the stack. Set the polling flag to true.
// The possible outcomes of deleteStack are a StackInfo object with status
@@ -423,18 +420,17 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
long subStartTime = System.currentTimeMillis ();
try {
heat.deleteStack (tenantId, cloudSiteId, vnfId, true);
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESS_MSG, "OpenStack", "DeleteStack", null);
} catch (MsoException me) {
// Failed to rollback the Stack due to an openstack exception.
// Convert to a generic VnfException
me.addContext ("RollbackVNF");
String error = "Rollback VNF: " + vnfId + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteStack", null);
- LOGGER.error (MessageEnum.RA_DELETE_VNF_ERR, vnfId, cloudSiteId, tenantId, "OpenStack", "DeleteStack", MsoLogger.ErrorCode.DataError, "Exception - DeleteStack", me);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vnfId, cloudSiteId,
+ tenantId, "OpenStack", "DeleteStack", MsoLogger.ErrorCode.DataError.getValue(),
+ "Exception - DeleteStack", me);
+ logger.debug(error);
throw new VnfException (me);
}
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully roll back VNF");
return;
}
@@ -468,7 +464,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
} else {
msg.append(" - unable to call .toString() " + e.getMessage());
}
- LOGGER.debug(msg.toString(), e);
+ logger.debug(msg.toString(), e);
}
}
return stringOutputs;
@@ -483,26 +479,28 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
String openstackIdentityUrl = "", username = "", password = "", tenant = "", region = "", owner = "";
long waitTimeMs = 10000L;
try {
- String[] cmdarray = {"/usr/bin/python", "HeatBridgeMain.py", openstackIdentityUrl, username, password, tenant, region, owner, heatStackId};
- String[] envp = null;
- File dir = new File(executionDir);
- LOGGER.debug("Calling HeatBridgeMain.py in " + dir + " with arguments " + Arrays.toString(cmdarray));
- Runtime r = Runtime.getRuntime();
- Process p = r.exec(cmdarray, envp, dir);
- boolean wait = p.waitFor(waitTimeMs, TimeUnit.MILLISECONDS);
-
- LOGGER.debug(" HeatBridgeMain.py returned " + wait + " with code " + p.exitValue());
- return wait && p.exitValue()==0;
- } catch (IOException e) {
- LOGGER.debug(" HeatBridgeMain.py failed with IO Exception! " + e);
- return false;
+ String[] cmdarray =
+ {"/usr/bin/python", "HeatBridgeMain.py", openstackIdentityUrl, username, password, tenant, region, owner,
+ heatStackId};
+ String[] envp = null;
+ File dir = new File(executionDir);
+ logger.debug("Calling HeatBridgeMain.py in {} with arguments {}", dir, Arrays.toString(cmdarray));
+ Runtime r = Runtime.getRuntime();
+ Process p = r.exec(cmdarray, envp, dir);
+ boolean wait = p.waitFor(waitTimeMs, TimeUnit.MILLISECONDS);
+
+ logger.debug(" HeatBridgeMain.py returned {} with code {}", wait, p.exitValue());
+ return wait && p.exitValue() == 0;
+ } catch (IOException e) {
+ logger.debug(" HeatBridgeMain.py failed with IO Exception! " + e);
+ return false;
} catch (RuntimeException e) {
- LOGGER.debug(" HeatBridgeMain.py failed during runtime!" + e);
- return false;
- }
+ logger.debug(" HeatBridgeMain.py failed during runtime!" + e);
+ return false;
+ }
catch (Exception e) {
- LOGGER.debug(" HeatBridgeMain.py failed for unknown reasons! " + e);
- return false;
+ logger.debug(" HeatBridgeMain.py failed for unknown reasons! " + e);
+ return false;
}
}
@@ -511,9 +509,9 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
final Object obj = JSON_MAPPER.treeToValue(node, Object.class);
return JSON_MAPPER.writeValueAsString(obj);
} catch (JsonParseException jpe) {
- LOGGER.debug("Error converting json to string " + jpe.getMessage(),jpe);
+ logger.debug("Error converting json to string " + jpe.getMessage(),jpe);
} catch (Exception e) {
- LOGGER.debug("Error converting json to string " + e.getMessage(),e);
+ logger.debug("Error converting json to string " + e.getMessage(),e);
}
return "[Error converting json to string]";
}
@@ -535,30 +533,30 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
String str = this.convertNode((JsonNode) obj);
stringMap.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for JsonNode "+ key,e);
+ logger.debug("DANGER WILL ROBINSON: unable to convert value for JsonNode "+ key,e);
//okay in this instance - only string values (fqdn) are expected to be needed
}
} else if (obj instanceof java.util.LinkedHashMap) {
- LOGGER.debug("LinkedHashMap - this is showing up as a LinkedHashMap instead of JsonNode");
+ logger.debug("LinkedHashMap - this is showing up as a LinkedHashMap instead of JsonNode");
try {
String str = JSON_MAPPER.writeValueAsString(obj);
stringMap.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for LinkedHashMap "+ key,e);
+ logger.debug("DANGER WILL ROBINSON: unable to convert value for LinkedHashMap "+ key,e);
}
} else if (obj instanceof Integer) {
try {
String str = "" + obj;
stringMap.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for Integer "+ key,e);
+ logger.debug("DANGER WILL ROBINSON: unable to convert value for Integer "+ key,e);
}
} else {
try {
String str = obj.toString();
stringMap.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value "+ key + " (" + e.getMessage() + ")",e);
+ logger.debug("DANGER WILL ROBINSON: unable to convert value "+ key + " (" + e.getMessage() + ")",e);
}
}
}
@@ -594,16 +592,15 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
boolean useMCUuid = false;
if (mcu != null && !mcu.isEmpty()) {
if ("null".equalsIgnoreCase(mcu)) {
- LOGGER.debug("modelCustomizationUuid: passed in as the string 'null' - will ignore: " + modelCustomizationUuid);
+ logger.debug("modelCustomizationUuid: passed in as the string 'null' - will ignore: " + modelCustomizationUuid);
useMCUuid = false;
mcu = "";
} else {
- LOGGER.debug("Found modelCustomizationUuid! Will use that: " + mcu);
+ logger.debug("Found modelCustomizationUuid! Will use that: " + mcu);
useMCUuid = true;
}
}
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName ("CreateVfModule");
String requestTypeString = "";
if (requestType != null && !"".equals(requestType)) {
requestTypeString = requestType;
@@ -621,7 +618,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
boolean oldWay = false;
if (requestTypeString.startsWith("X")) {
oldWay = true;
- LOGGER.debug("orchestrating a VNF - *NOT* a module!");
+ logger.debug("orchestrating a VNF - *NOT* a module!");
requestTypeString = requestTypeString.substring(1);
}
@@ -632,7 +629,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
isVolumeRequest = true;
}
- LOGGER.debug("requestTypeString = " + requestTypeString + ", nestedStackId = " + nestedStackId + ", nestedBaseStackId = " + nestedBaseStackId);
+ logger.debug("requestTypeString = " + requestTypeString + ", nestedStackId = " + nestedStackId + ", nestedBaseStackId = " + nestedBaseStackId);
// Will capture execution time for metrics
long startTime = System.currentTimeMillis ();
@@ -656,15 +653,15 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
long subStartTime1 = System.currentTimeMillis ();
try {
heatStack = heat.queryStack (cloudSiteId, tenantId, vfModuleName);
- LOGGER.recordMetricEvent (subStartTime1, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESS_MSG, "OpenStack", "QueryStack", vfModuleName);
} catch (MsoException me) {
String error = "Create VF Module: Query " + vfModuleName + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- LOGGER.recordMetricEvent (subStartTime1, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryStack", vfModuleName);
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vfModuleName, cloudSiteId, tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.DataError, "Exception - queryStack", me);
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudSiteId,
+ tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.DataError.getValue(), "Exception - queryStack",
+ me);
+ logger.debug(error);
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
me.addContext ("CreateVFModule");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
throw new VnfException (me);
}
// New with 1607 - more precise handling/messaging if the stack already exists
@@ -674,40 +671,50 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
if (status == HeatStatus.INIT || status == HeatStatus.BUILDING || status == HeatStatus.DELETING || status == HeatStatus.UPDATING) {
// fail - it's in progress - return meaningful error
String error = "Create VF: Stack " + vfModuleName + " already exists and has status " + status.toString() + " in " + cloudSiteId + "/" + tenantId + "; please wait for it to complete, or fix manually.";
- LOGGER.error (MessageEnum.RA_VNF_ALREADY_EXIST, vfModuleName, cloudSiteId, tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.DataError, "Stack " + vfModuleName + " already exists");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudSiteId, tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.DataError.getValue(),
+ "Stack " + vfModuleName + " already exists");
+ logger.debug(error);
throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, heatStack.getCanonicalName ());
}
if (status == HeatStatus.FAILED) {
// fail - it exists and is in a FAILED state
- String error = "Create VF: Stack " + vfModuleName + " already exists and is in FAILED state in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
- LOGGER.error (MessageEnum.RA_VNF_ALREADY_EXIST, vfModuleName, cloudSiteId, tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.DataError, "Stack " + vfModuleName + " already exists and is in FAILED state");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
+ String error = "Create VF: Stack " + vfModuleName + " already exists and is in FAILED state in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudSiteId, tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.DataError.getValue(),
+ "Stack " + vfModuleName + " already exists and is " + "in FAILED state");
+ logger.debug(error);
throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, heatStack.getCanonicalName ());
}
if (status == HeatStatus.UNKNOWN || status == HeatStatus.UPDATED) {
// fail - it exists and is in a FAILED state
- String error = "Create VF: Stack " + vfModuleName + " already exists and has status " + status.toString() + " in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
- LOGGER.error (MessageEnum.RA_VNF_ALREADY_EXIST, vfModuleName, cloudSiteId, tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.DataError, "Stack " + vfModuleName + " already exists and is in UPDATED or UNKNOWN state");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
- throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, heatStack.getCanonicalName ());
- }
+ String error =
+ "Create VF: Stack " + vfModuleName + " already exists and has status " + status.toString() + " in "
+ + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudSiteId, tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.DataError.getValue(),
+ "Stack " + vfModuleName + " already exists and is " + "in UPDATED or UNKNOWN state");
+ logger.debug(error);
+ throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, heatStack.getCanonicalName());
+ }
if (status == HeatStatus.CREATED) {
// fail - it exists
if (failIfExists != null && failIfExists) {
- String error = "Create VF: Stack " + vfModuleName + " already exists in " + cloudSiteId + "/" + tenantId;
- LOGGER.error (MessageEnum.RA_VNF_ALREADY_EXIST, vfModuleName, cloudSiteId, tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.DataError, "Stack " + vfModuleName + " already exists");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
- throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, heatStack.getCanonicalName ());
- } else {
- LOGGER.debug ("Found Existing stack, status=" + heatStack.getStatus ());
+ String error =
+ "Create VF: Stack " + vfModuleName + " already exists in " + cloudSiteId + "/" + tenantId;
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudSiteId, tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.DataError.getValue(),
+ "Stack " + vfModuleName + " already exists");
+ logger.debug(error);
+ throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, heatStack.getCanonicalName());
+ } else {
+ logger.debug ("Found Existing stack, status={}", heatStack.getStatus ());
// Populate the outputs from the existing stack.
vnfId.value = heatStack.getCanonicalName ();
outputs.value = copyStringOutputs (heatStack.getOutputs ());
rollback.value = vfRollback; // Default rollback - no updates performed
}
}
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully create VF Module");
return;
}
@@ -718,28 +725,29 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
Map<String, Object> nestedVolumeOutputs = null;
if (nestedStackId != null) {
try {
- LOGGER.debug("Querying for nestedStackId = " + nestedStackId);
+ logger.debug("Querying for nestedStackId = {}", nestedStackId);
nestedHeatStack = heat.queryStack(cloudSiteId, tenantId, nestedStackId);
- LOGGER.recordMetricEvent (subStartTime2, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESS_MSG, "OpenStack", "QueryStack", vfModuleName);
} catch (MsoException me) {
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
me.addContext ("CreateVFModule");
String error = "Create VFModule: Attached heatStack ID Query " + nestedStackId + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- LOGGER.recordMetricEvent (subStartTime2, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryStack", vfModuleName);
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vfModuleName, cloudSiteId, tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.BusinessProcesssError, "MsoException trying to query nested stack", me);
- LOGGER.debug("ERROR trying to query nested stack= " + error);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudSiteId,
+ tenantId, "OpenStack", "queryStack", MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+ "MsoException trying to query nested stack", me);
+ logger.debug("ERROR trying to query nested stack= {}", error);
throw new VnfException (me);
}
if (nestedHeatStack == null || nestedHeatStack.getStatus() == HeatStatus.NOTFOUND) {
String error = "Create VFModule: Attached heatStack ID DOES NOT EXIST " + nestedStackId + " in " + cloudSiteId + "/" + tenantId + " USER ERROR" ;
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vfModuleName, cloudSiteId, tenantId, error, "OpenStack", "queryStack", MsoLogger.ErrorCode.BusinessProcesssError, "Create VFModule: Attached heatStack ID DOES NOT EXIST");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
- LOGGER.debug(error);
- throw new VnfException (error, MsoExceptionCategory.USERDATA);
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName,
+ cloudSiteId, tenantId, error, "OpenStack", "queryStack",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+ "Create VFModule: Attached heatStack ID " + "DOES NOT EXIST");
+ logger.debug(error);
+ throw new VnfException (error, MsoExceptionCategory.USERDATA);
} else {
- LOGGER.debug("Found nested volume heat stack - copying values to inputs *later*");
+ logger.debug("Found nested volume heat stack - copying values to inputs *later*");
nestedVolumeOutputs = nestedHeatStack.getOutputs();
}
}
@@ -750,28 +758,30 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
Map<String, Object> baseStackOutputs = null;
if (nestedBaseStackId != null) {
try {
- LOGGER.debug("Querying for nestedBaseStackId = " + nestedBaseStackId);
+ logger.debug("Querying for nestedBaseStackId = {}", nestedBaseStackId);
nestedBaseHeatStack = heat.queryStack(cloudSiteId, tenantId, nestedBaseStackId);
- LOGGER.recordMetricEvent (subStartTime3, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESS_MSG, "OpenStack", "QueryStack", vfModuleName);
} catch (MsoException me) {
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
me.addContext ("CreateVFModule");
String error = "Create VFModule: Attached baseHeatStack ID Query " + nestedBaseStackId + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- LOGGER.recordMetricEvent (subStartTime3, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryStack", vfModuleName);
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vfModuleName, cloudSiteId, tenantId, "OpenStack", "QueryStack", MsoLogger.ErrorCode.BusinessProcesssError, "MsoException trying to query nested base stack", me);
- LOGGER.debug("ERROR trying to query nested base stack= " + error);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
- throw new VnfException (me);
+ logger
+ .error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudSiteId,
+ tenantId, "OpenStack", "QueryStack", MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+ "MsoException trying to query nested base stack", me);
+ logger.debug("ERROR trying to query nested base stack= {}", error);
+ throw new VnfException (me);
}
if (nestedBaseHeatStack == null || nestedBaseHeatStack.getStatus() == HeatStatus.NOTFOUND) {
String error = "Create VFModule: Attached base heatStack ID DOES NOT EXIST " + nestedBaseStackId + " in " + cloudSiteId + "/" + tenantId + " USER ERROR" ;
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vfModuleName, cloudSiteId, tenantId, error, "OpenStack", "QueryStack", MsoLogger.ErrorCode.BusinessProcesssError, "Create VFModule: Attached base heatStack ID DOES NOT EXIST");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
- LOGGER.debug(error);
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName,
+ cloudSiteId, tenantId, error, "OpenStack", "QueryStack",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+ "Create VFModule: Attached base heatStack ID DOES NOT EXIST");
+ logger.debug("Exception occurred", error);
throw new VnfException (error, MsoExceptionCategory.USERDATA);
} else {
- LOGGER.debug("Found nested base heat stack - these values will be copied to inputs *later*");
+ logger.debug("Found nested base heat stack - these values will be copied to inputs *later*");
baseStackOutputs = nestedBaseHeatStack.getOutputs();
}
}
@@ -785,7 +795,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
VfModule vf = null;
VnfResource vnfResource = null;
VfModuleCustomization vfmc = null;
- LOGGER.debug("version: " + vfVersion);
+ logger.debug("version: {}", vfVersion);
if (useMCUuid) {
// 1707 - db refactoring
vfmc = vfModuleCustomRepo.findByModelCustomizationUUID(mcu);
@@ -796,22 +806,24 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
// 1702 - this will be the new way going forward. We find the vf by mcu - otherwise, code is the same.
if (vf == null) {
- LOGGER.debug("Unable to find vfModuleCust with modelCustomizationUuid=" + mcu);
+ logger.debug("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);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(),
+ "VF Module ModelCustomizationUuid", modelCustomizationUuid, "OpenStack",
+ MsoLogger.ErrorCode.DataError.getValue(),
+ "Create VF Module: Unable to find vfModule with " + "modelCustomizationUuid=" + mcu);
+ logger.debug(error);
throw new VnfException(error, MsoExceptionCategory.USERDATA);
} else {
- LOGGER.trace("Found vfModuleCust entry " + vfmc.toString());
+ logger.trace("Found vfModuleCust entry {}", vfmc.toString());
}
if (vf.getIsBase()) {
isBaseRequest = true;
- LOGGER.debug("This is a BASE VF request!");
+ logger.debug("This is a BASE VF request!");
} else {
- LOGGER.debug("This is *not* a BASE VF request!");
+ 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");
}
}
}
@@ -823,15 +835,14 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
vnfResource = vnfResourceRepo.findByModelName(vnfType);
}
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);
- throw new VnfException(error, MsoExceptionCategory.USERDATA);
- }
- LOGGER.debug("Got VNF module definition from Catalog: "
- + vnfResource.toString());
- }
+ String error = "Create VNF: Unknown VNF Type: " + vnfType;
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "VNF Type", vnfType,
+ "OpenStack", MsoLogger.ErrorCode.DataError.getValue(), "Create VNF: Unknown VNF Type");
+ logger.debug(error);
+ throw new VnfException(error, MsoExceptionCategory.USERDATA);
+ }
+ logger.debug("Got VNF module definition from Catalog: {}", vnfResource.toString());
+ }
// By here - we have either a vf or vnfResource
//1607 - Add version check
@@ -840,7 +851,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
if (!oldWay && vf.getVnfResources() != null) {
vnfResource = vf.getVnfResources();
if (vnfResource == null) {
- LOGGER.debug("Unable to find vnfResource will not error for now...");
+ logger.debug("Unable to find vnfResource will not error for now...");
}
}
String minVersionVnf = null;
@@ -850,7 +861,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;
}
@@ -881,29 +892,35 @@ 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);
- doNotTest = true;
+ logger.debug("An exception occurred while trying to test AIC Version {} - will default to not check",
+ e.getMessage(), 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: " + cloudSiteId + " with AIC_Version:" + cloudSiteOpt.get().getCloudVersion());
- } else {
+ logger.debug(
+ "VNF Resource " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUUID()
+ + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf + " supported on Cloud: "
+ + cloudSiteId + " with AIC_Version:" + cloudSiteOpt.get().getCloudVersion());
+ } else {
// ERROR
String error = "VNF Resource type: " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUUID() + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf + " NOT supported on Cloud: " + cloudSiteId + " with AIC_Version:" + cloudSiteOpt.get().getCloudVersion();
- LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - setVersion");
- LOGGER.debug(error);
+ logger.error("{} {} {} {} {}", MessageEnum.RA_CONFIG_EXC.toString(), error, "OpenStack",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception - setVersion");
+ logger.debug(error);
throw new VnfException(error, MsoExceptionCategory.USERDATA);
}
} else {
- LOGGER.debug("bypassing testing AIC version...");
+ logger.debug("bypassing testing AIC version...");
}
} // let this error out downstream to avoid introducing uncertainty at this stage
} else {
- LOGGER.debug("cloudConfig is NULL - cannot check cloud site version");
+ 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
@@ -931,28 +948,31 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
if (heatTemplate == 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);
+ logger
+ .error("{} {} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Template ID", vfModuleType,
+ "OpenStack", MsoLogger.ErrorCode.DataError.getValue(), error);
+ logger.debug(error);
throw new VnfException(error, MsoExceptionCategory.INTERNAL);
} else {
- LOGGER.debug ("Got HEAT Template from DB: " + heatTemplate.getHeatTemplate());
+ logger.debug("Got HEAT Template from DB: {}", heatTemplate.getHeatTemplate());
}
if (oldWay) {
//This will handle old Gamma BrocadeVCE VNF
- LOGGER.debug ("No environment parameter found for this Type " + vfModuleType);
+ logger.debug("No environment parameter found for this Type " + vfModuleType);
} else {
if (heatEnvironment == null) {
String error = "Update VNF: undefined Heat Environment. VF=" + vfModuleType;
- LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Environment ID", "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+ logger.error("{} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Environment ID",
+ "OpenStack", MsoLogger.ErrorCode.DataError.getValue(), error);
+ logger.debug(error);
throw new VnfException (error, MsoExceptionCategory.INTERNAL);
} else {
- LOGGER.debug ("Got Heat Environment from DB: " + heatEnvironment.getEnvironment());
- }
+ logger.debug("Got Heat Environment from DB: {}", heatEnvironment.getEnvironment());
+ }
}
- LOGGER.debug ("In MsoVnfAdapterImpl, about to call db.getNestedTemplates avec templateId="
+ logger.debug("In MsoVnfAdapterImpl, about to call db.getNestedTemplates avec templateId="
+ heatTemplate.getArtifactUuid ());
@@ -960,13 +980,13 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
Map <String, Object> nestedTemplatesChecked = new HashMap <> ();
if (nestedTemplates != null && !nestedTemplates.isEmpty()) {
// for debugging print them out
- LOGGER.debug ("Contents of nestedTemplates - to be added to files: on stack:");
+ logger.debug("Contents of nestedTemplates - to be added to files: on stack:");
for (HeatTemplate entry : nestedTemplates) {
nestedTemplatesChecked.put (entry.getTemplateName(), entry.getTemplateBody());
- LOGGER.debug (entry.getTemplateName() + " -> " + entry.getTemplateBody());
+ logger.debug(entry.getTemplateName() + " -> " + entry.getTemplateBody());
}
} else {
- LOGGER.debug ("No nested templates found - nothing to do here");
+ logger.debug("No nested templates found - nothing to do here");
nestedTemplatesChecked = null;
}
@@ -982,18 +1002,20 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
String propertyString = this.environment.getProperty(MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ);
if ("true".equalsIgnoreCase(propertyString) || "y".equalsIgnoreCase(propertyString)) {
addGetFilesOnVolumeReq = true;
- LOGGER.debug("AddGetFilesOnVolumeReq - setting to true! " + propertyString);
+ 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!");
} 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 = vf.getHeatFiles();
}
@@ -1002,17 +1024,16 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
// 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(HeatFiles heatfile : heatFiles){
- LOGGER.debug(heatfile.getFileName() + " -> "
- + heatfile.getFileBody());
- heatFilesObjects.put(heatfile.getFileName(), heatfile.getFileBody());
- }
- } else {
- LOGGER.debug("No heat files found -nothing to do here");
- heatFilesObjects = null;
- }
+ for (HeatFiles heatfile : heatFiles) {
+ logger.debug(heatfile.getFileName() + " -> " + heatfile.getFileBody());
+ heatFilesObjects.put(heatfile.getFileName(), heatfile.getFileBody());
+ }
+ } else {
+ logger.debug("No heat files found -nothing to do here");
+ heatFilesObjects = null;
+ }
}
// Check that required parameters have been supplied
@@ -1029,12 +1050,12 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
String propertyString = this.environment.getProperty (MsoVnfAdapterImpl.CHECK_REQD_PARAMS);
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
@@ -1043,7 +1064,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
MsoHeatEnvironmentEntry mhee = null;
if (heatEnvironment != null && heatEnvironment.getEnvironment() != null && heatEnvironment.getEnvironment().contains ("parameters:")) {
- LOGGER.debug("Enhanced environment checking enabled - 1604");
+ logger.debug("Enhanced environment checking enabled - 1604");
StringBuilder sb = new StringBuilder(heatEnvironment.getEnvironment());
mhee = new MsoHeatEnvironmentEntry(sb);
@@ -1057,14 +1078,14 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
sb2.append("\nEnvironment:");
sb2.append(mhee.toFullString());
}
- LOGGER.debug(sb2.toString());
+ logger.debug(sb2.toString());
} else {
- LOGGER.debug("NO ENVIRONMENT for this entry");
+ logger.debug("NO ENVIRONMENT for this entry");
}
// New with 1707 - all variables converted to their native object types
Map<String, Object> goldenInputs = null;
- LOGGER.debug("Now handle the inputs....first convert");
+ logger.debug("Now handle the inputs....first convert");
ArrayList<String> parameterNames = new ArrayList<>();
HashMap<String, String> aliasToParam = new HashMap<>();
StringBuilder sb = new StringBuilder("\nTemplate Parameters:\n");
@@ -1079,36 +1100,35 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
}
sb.append("\n");
}
- LOGGER.debug(sb.toString());
+ 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
// This will also not copy over params that aren't identified in the template
goldenInputs = heat.convertInputMap(inputs, heatTemplate);
// Step 2 - now simply add the outputs as we received them - no need to convert to string
- LOGGER.debug("Now add in the base stack outputs if applicable");
+ logger.debug("Now add in the base stack outputs if applicable");
heat.copyBaseOutputsToInputs(goldenInputs, baseStackOutputs, parameterNames, aliasToParam);
// Step 3 - add the volume inputs if any
- LOGGER.debug("Now add in the volume stack outputs if applicable");
+ logger.debug("Now add in the volume stack outputs if applicable");
heat.copyBaseOutputsToInputs(goldenInputs, nestedVolumeOutputs, parameterNames, aliasToParam);
for (HeatTemplateParam parm : heatTemplate.getParameters ()) {
- LOGGER.debug ("Parameter:'" + parm.getParamName ()
- + "', isRequired="
- + parm.isRequired ()
- + ", alias="
- + parm.getParamAlias ());
+ logger.debug(
+ "Parameter:'" + parm.getParamName() + "', isRequired=" + parm.isRequired() + ", alias=" + parm
+ .getParamAlias());
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 {} appears to be in environment - do not count as missing",
+ parm.getParamName());
} else {
- LOGGER.debug ("adding to missing parameters list: " + parm.getParamName ());
+ logger.debug("adding to missing parameters list: {}", parm.getParamName());
if (missingParams == null) {
missingParams = parm.getParamName ();
} else {
@@ -1122,14 +1142,15 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
if (checkRequiredParameters) {
// Problem - missing one or more required parameters
String error = "Create VFModule: Missing Required inputs: " + missingParams;
- LOGGER.error (MessageEnum.RA_MISSING_PARAM, missingParams, "OpenStack", "", MsoLogger.ErrorCode.DataError, "Create VFModule: Missing Required inputs");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
+ logger.error("{} {} {} {} {}", MessageEnum.RA_MISSING_PARAM.toString(), missingParams, "OpenStack",
+ MsoLogger.ErrorCode.DataError.getValue(), "Create VFModule: Missing Required inputs");
+ logger.debug(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
@@ -1145,10 +1166,10 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
// Valet - 1806
boolean isValetEnabled = this.checkBooleanProperty(MsoVnfAdapterImpl.VALET_ENABLED, false);
boolean failRequestOnValetFailure = this.checkBooleanProperty(MsoVnfAdapterImpl.FAIL_REQUESTS_ON_VALET_FAILURE, false);
- LOGGER.debug("isValetEnabled=" + isValetEnabled + ", failRequestsOnValetFailure=" + failRequestOnValetFailure);
+ logger.debug("isValetEnabled={}, failRequestsOnValetFailure={}", isValetEnabled, failRequestOnValetFailure);
if (oldWay || isVolumeRequest) {
isValetEnabled = false;
- LOGGER.debug("do not send to valet for volume requests or brocade");
+ logger.debug("do not send to valet for volume requests or brocade");
}
boolean sendResponseToValet = false;
if (isValetEnabled) {
@@ -1172,7 +1193,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
backout = true;
}
if (heat != null) {
- LOGGER.debug("heat is not null!!");
+ logger.debug("heat is not null!!");
heatStack = heat.createStack (cloudSiteId,
tenantId,
@@ -1187,39 +1208,40 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
backout.booleanValue());
}
else {
- LOGGER.debug("heat is null!");
+ logger.debug("heat is null!");
throw new MsoHeatNotFoundException();
}
- LOGGER.recordMetricEvent (createStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESS_MSG, "OpenStack", "CreateStack", vfModuleName);
} catch (MsoException me) {
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);
+ logger
+ .error("{} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudSiteId,
+ tenantId, "OpenStack", MsoLogger.ErrorCode.DataError.getValue(), "MsoException - createStack",
+ me);
+ logger.debug(error);
if (isValetEnabled && sendResponseToValet) {
- LOGGER.debug("valet is enabled, the orchestration failed - now sending rollback to valet");
+ logger.debug("valet is enabled, the orchestration failed - now sending rollback to valet");
try {
GenericValetResponse<ValetRollbackResponse> gvr = this.vci.callValetRollbackRequest(msoRequest.getRequestId(), null, backout, me.getMessage());
// Nothing to really do here whether it succeeded or not other than log it.
- LOGGER.debug("Return code from Rollback response is " + gvr.getStatusCode());
+ logger.debug("Return code from Rollback response is {}", gvr.getStatusCode());
} catch (Exception e) {
- LOGGER.error("Exception encountered while sending Rollback to Valet ", e);
+ logger.error("Exception encountered while sending Rollback to Valet ", e);
}
}
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.debug("NULL POINTER EXCEPTION at heat.createStack");
+ logger
+ .error("{} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudSiteId,
+ tenantId, "OpenStack", MsoLogger.ErrorCode.DataError.getValue(),
+ "NullPointerException - createStack", npe);
+ logger.debug(error);
+ logger.debug("NULL POINTER EXCEPTION at heat.createStack");
//npe.addContext ("CreateVNF");
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.debug("unhandled exception at heat.createStack",e);
throw new VnfException("Exception during heat.createStack! " + e.getMessage());
}
// Reach this point if createStack is successful.
@@ -1231,20 +1253,19 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
outputs.value = copyStringOutputs (heatStack.getOutputs ());
rollback.value = vfRollback;
if (isValetEnabled && sendResponseToValet) {
- LOGGER.debug("valet is enabled, the orchestration succeeded - now send confirm to valet with stack id");
+ logger.debug("valet is enabled, the orchestration succeeded - now send confirm to valet with stack id");
try {
GenericValetResponse<ValetConfirmResponse> gvr = this.vci.callValetConfirmRequest(msoRequest.getRequestId(), heatStack.getCanonicalName());
// Nothing to really do here whether it succeeded or not other than log it.
- LOGGER.debug("Return code from Confirm response is " + gvr.getStatusCode());
+ logger.debug("Return code from Confirm response is {}", gvr.getStatusCode());
} catch (Exception e) {
- LOGGER.error("Exception encountered while sending Confirm to Valet ", e);
+ logger.error("Exception encountered while sending Confirm to Valet ", e);
}
}
- LOGGER.debug ("VF Module " + vfModuleName + " successfully created");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully create VF Module");
+ logger.debug("VF Module {} successfully created", vfModuleName);
return;
} 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());
}
}
@@ -1255,9 +1276,8 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
String vnfName,
MsoRequest msoRequest,
Holder <Map <String, String>> outputs) throws VnfException {
- MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName ("DeleteVf");
- LOGGER.debug ("Deleting VF " + vnfName + " in " + cloudSiteId + "/" + tenantId);
+
+ logger.debug("Deleting VF {} in ", vnfName, cloudSiteId + "/" + tenantId);
// Will capture execution time for metrics
long startTime = System.currentTimeMillis ();
@@ -1271,9 +1291,10 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
// Convert to a generic VnfException
me.addContext ("DeleteVFModule");
String error = "Delete VFModule: Query to get outputs: " + vnfName + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryStack", null);
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vnfName, cloudSiteId, tenantId, "OpenStack", "QueryStack", MsoLogger.ErrorCode.DataError, "Exception - QueryStack", me);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudSiteId,
+ tenantId, "OpenStack", "QueryStack", MsoLogger.ErrorCode.DataError.getValue(), "Exception - QueryStack",
+ me);
+ logger.debug(error);
throw new VnfException (me);
}
// call method which handles the conversion from Map<String,Object> to Map<String,String> for our expected Object types
@@ -1281,7 +1302,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
boolean isValetEnabled = this.checkBooleanProperty(MsoVnfAdapterImpl.VALET_ENABLED, false);
boolean failRequestOnValetFailure = this.checkBooleanProperty(MsoVnfAdapterImpl.FAIL_REQUESTS_ON_VALET_FAILURE, false);
- LOGGER.debug("isValetEnabled=" + isValetEnabled + ", failRequestsOnValetFailure=" + failRequestOnValetFailure);
+ logger.debug("isValetEnabled={}, failRequestsOnValetFailure={}", isValetEnabled, failRequestOnValetFailure);
boolean valetDeleteRequestSucceeded = false;
if (isValetEnabled) {
valetDeleteRequestSucceeded = this.valetDeleteRequest(cloudSiteId, tenantId, vnfName, msoRequest, failRequestOnValetFailure);
@@ -1294,41 +1315,40 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
long subStartTime = System.currentTimeMillis ();
try {
heat.deleteStack (tenantId, cloudSiteId, vnfName, true);
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, SUCCESS_MSG, "OpenStack", "DeleteStack", vnfName);
} catch (MsoException me) {
me.addContext ("DeleteVNF");
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
String error = "Delete VF: " + vnfName + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "DeleteStack", vnfName);
- LOGGER.error (MessageEnum.RA_DELETE_VNF_ERR, vnfName, cloudSiteId, tenantId, "OpenStack", "DeleteStack", MsoLogger.ErrorCode.DataError, "Exception - deleteStack", me);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vnfName, cloudSiteId,
+ tenantId, "OpenStack", "DeleteStack", MsoLogger.ErrorCode.DataError.getValue(),
+ "Exception - deleteStack", me);
+ logger.debug(error);
if (isValetEnabled && valetDeleteRequestSucceeded) {
- LOGGER.debug("valet is enabled, the orchestration failed - now sending rollback to valet");
+ logger.debug("valet is enabled, the orchestration failed - now sending rollback to valet");
try {
GenericValetResponse<ValetRollbackResponse> gvr = this.vci.callValetRollbackRequest(msoRequest.getRequestId(), vnfName, false, me.getMessage());
// Nothing to really do here whether it succeeded or not other than log it.
- LOGGER.debug("Return code from Rollback response is " + gvr.getStatusCode());
+ logger.debug("Return code from Rollback response is {}", gvr.getStatusCode());
} catch (Exception e) {
- LOGGER.error("Exception encountered while sending Rollback to Valet ", e);
+ logger.error("Exception encountered while sending Rollback to Valet ", e);
}
}
throw new VnfException (me);
}
if (isValetEnabled && valetDeleteRequestSucceeded) {
// only if the original request succeeded do we send a confirm
- LOGGER.debug("valet is enabled, the delete succeeded - now send confirm to valet");
+ logger.debug("valet is enabled, the delete succeeded - now send confirm to valet");
try {
GenericValetResponse<ValetConfirmResponse> gvr = this.vci.callValetConfirmRequest(msoRequest.getRequestId(), vnfName);
// Nothing to really do here whether it succeeded or not other than log it.
- LOGGER.debug("Return code from Confirm response is " + gvr.getStatusCode());
+ logger.debug("Return code from Confirm response is {}", gvr.getStatusCode());
} catch (Exception e) {
- LOGGER.error("Exception encountered while sending Confirm to Valet ", e);
+ logger.error("Exception encountered while sending Confirm to Valet ", e);
}
}
// On success, nothing is returned.
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully delete VF");
return;
}
@@ -1352,7 +1372,6 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
String methodName = "updateVfModule";
MsoLogger.setLogContext (msoRequest.getRequestId (), msoRequest.getServiceInstanceId ());
String serviceName = VNF_ADAPTER_SERVICE_NAME + methodName;
- MsoLogger.setServiceName (serviceName);
StringBuilder sbInit = new StringBuilder();
sbInit.append("updateVfModule: \n");
@@ -1366,17 +1385,18 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
sbInit.append("baseVfHeatStackId=" + baseVfHeatStackId + "\n");
sbInit.append("vfModuleStackId=" + vfModuleStackId + "\n");
sbInit.append("modelCustomizationUuid=" + modelCustomizationUuid + "\n");
- LOGGER.debug(sbInit.toString());
+ logger.debug(sbInit.toString());
String mcu = modelCustomizationUuid;
boolean useMCUuid = false;
if (mcu != null && !mcu.isEmpty()) {
if ("null".equalsIgnoreCase(mcu)) {
- LOGGER.debug("modelCustomizationUuid: passed in as the string 'null' - will ignore: " + modelCustomizationUuid);
+ logger.debug("modelCustomizationUuid: passed in as the string 'null' - will ignore: {}",
+ modelCustomizationUuid);
useMCUuid = false;
mcu = "";
} else {
- LOGGER.debug("Found modelCustomizationUuid! Will use that: " + mcu);
+ logger.debug("Found modelCustomizationUuid! Will use that: {}", mcu);
useMCUuid = true;
}
}
@@ -1398,7 +1418,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
if (inputs == null) {
// Create an empty set of inputs
inputs = new HashMap<>();
- LOGGER.debug("inputs == null - setting to empty");
+ logger.debug("inputs == null - setting to empty");
}
boolean isBaseRequest = false;
@@ -1410,8 +1430,8 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
vfModuleName = this.getVfModuleNameFromModuleStackId(vfModuleStackId);
}
- LOGGER.debug ("Updating VFModule: " + vfModuleName + " of type " + vfModuleType + "in " + cloudSiteId + "/" + tenantId);
- LOGGER.debug("requestTypeString = " + requestTypeString + ", nestedVolumeStackId = " + nestedStackId + ", nestedBaseStackId = " + nestedBaseStackId);
+ logger.debug ("Updating VFModule: " + vfModuleName + " of type " + vfModuleType + "in " + cloudSiteId + "/" + tenantId);
+ logger.debug("requestTypeString = " + requestTypeString + ", nestedVolumeStackId = " + nestedStackId + ", nestedBaseStackId = " + nestedBaseStackId);
// Will capture execution time for metrics
long startTime = System.currentTimeMillis ();
@@ -1430,18 +1450,18 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
StackInfo heatStack = null;
long queryStackStarttime = System.currentTimeMillis ();
- LOGGER.debug("UpdateVfModule - querying for " + vfModuleName);
+ logger.debug("UpdateVfModule - querying for {}", vfModuleName);
try {
heatStack = heat.queryStack (cloudSiteId, tenantId, vfModuleName);
- LOGGER.recordMetricEvent (queryStackStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully receive response from Open Stack", "OpenStack", "QueryStack", null);
} catch (MsoException me) {
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
me.addContext ("UpdateVFModule");
String error = "Update VFModule: Query " + vfModuleName + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- LOGGER.recordMetricEvent (queryStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryStack", null);
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vfModuleName, cloudSiteId, tenantId, "OpenStack", "QueryStack", MsoLogger.ErrorCode.DataError, "Exception - QueryStack", me);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudSiteId,
+ tenantId, "OpenStack", "QueryStack", MsoLogger.ErrorCode.DataError.getValue(), "Exception - QueryStack",
+ me);
+ logger.debug(error);
throw new VnfException (me);
}
@@ -1449,11 +1469,11 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
if (heatStack == null || heatStack.getStatus () == HeatStatus.NOTFOUND) {
// Not Found
String error = "Update VF: Stack " + vfModuleName + " does not exist in " + cloudSiteId + "/" + tenantId;
- LOGGER.error (MessageEnum.RA_VNF_NOT_EXIST, vfModuleName, cloudSiteId, tenantId, "OpenStack", "QueryStack", MsoLogger.ErrorCode.DataError, error);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_NOT_EXIST.toString(), vfModuleName, cloudSiteId,
+ tenantId, "OpenStack", "QueryStack", MsoLogger.ErrorCode.DataError.getValue(), error);
throw new VnfNotFound (cloudSiteId, tenantId, vfModuleName);
} else {
- LOGGER.debug ("Found Existing stack, status=" + heatStack.getStatus ());
+ logger.debug("Found Existing stack, status={}", heatStack.getStatus());
// Populate the outputs from the existing stack.
outputs.value = copyStringOutputs (heatStack.getOutputs ());
rollback.value = vfRollback; // Default rollback - no updates performed
@@ -1465,29 +1485,27 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
Map<String, Object> nestedVolumeOutputs = null;
if (nestedStackId != null) {
try {
- LOGGER.debug("Querying for nestedStackId = " + nestedStackId);
+ logger.debug("Querying for nestedStackId = {}", nestedStackId);
nestedHeatStack = heat.queryStack(cloudSiteId, tenantId, nestedStackId);
- LOGGER.recordMetricEvent (queryStackStarttime2, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully receive response from Open Stack", "OpenStack", "QueryStack", null);
} catch (MsoException me) {
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
me.addContext ("UpdateVFModule");
String error = "Update VF: Attached heatStack ID Query " + nestedStackId + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- LOGGER.recordMetricEvent (queryStackStarttime2, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryStack", null);
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vnfName, cloudSiteId, tenantId, "OpenStack", "QueryStack", MsoLogger.ErrorCode.DataError, "Exception - " + error, me);
- LOGGER.debug("ERROR trying to query nested stack= " + error);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
- throw new VnfException (me);
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudSiteId,
+ tenantId, "OpenStack", "QueryStack", MsoLogger.ErrorCode.DataError.getValue(), "Exception - " + error,
+ me);
+ logger.debug("ERROR trying to query nested stack= {}", error);
+ throw new VnfException (me);
}
if (nestedHeatStack == null || nestedHeatStack.getStatus() == HeatStatus.NOTFOUND) {
- MsoLogger.setServiceName (serviceName);
String error = "Update VFModule: Attached volume heatStack ID DOES NOT EXIST " + nestedStackId + " in " + cloudSiteId + "/" + tenantId + " USER ERROR" ;
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vnfName, cloudSiteId, tenantId, error, "OpenStack", "QueryStack", MsoLogger.ErrorCode.DataError, error);
- LOGGER.debug(error);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudSiteId,
+ tenantId, error, "OpenStack", "QueryStack", MsoLogger.ErrorCode.DataError.getValue(), error);
+ logger.debug(error);
throw new VnfException (error, MsoExceptionCategory.USERDATA);
} else {
- LOGGER.debug("Found nested heat stack - copying values to inputs *later*");
+ logger.debug("Found nested heat stack - copying values to inputs *later*");
nestedVolumeOutputs = nestedHeatStack.getOutputs();
heat.copyStringOutputsToInputs(inputs, nestedHeatStack.getOutputs(), false);
}
@@ -1498,29 +1516,29 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
if (nestedBaseStackId != null) {
long queryStackStarttime3 = System.currentTimeMillis ();
try {
- LOGGER.debug("Querying for nestedBaseStackId = " + nestedBaseStackId);
+ logger.debug("Querying for nestedBaseStackId = {}", nestedBaseStackId);
nestedBaseHeatStack = heat.queryStack(cloudSiteId, tenantId, nestedBaseStackId);
- LOGGER.recordMetricEvent (queryStackStarttime3, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully receive response from Open Stack", "OpenStack", "QueryStack", null);
} catch (MsoException me) {
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
me.addContext ("UpdateVfModule");
String error = "Update VFModule: Attached baseHeatStack ID Query " + nestedBaseStackId + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- LOGGER.recordMetricEvent (queryStackStarttime3, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "OpenStack", "QueryStack", null);
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vfModuleName, cloudSiteId, tenantId, "OpenStack", "QueryStack", MsoLogger.ErrorCode.DataError, "Exception - " + error, me);
- LOGGER.debug("ERROR trying to query nested base stack= " + error);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+ logger
+ .error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudSiteId,
+ tenantId, "OpenStack", "QueryStack", MsoLogger.ErrorCode.DataError.getValue(),
+ "Exception - " + error, me);
+ logger.debug("ERROR trying to query nested base stack= {}", error);
throw new VnfException (me);
}
if (nestedBaseHeatStack == null || nestedBaseHeatStack.getStatus() == HeatStatus.NOTFOUND) {
- MsoLogger.setServiceName (serviceName);
String error = "Update VFModule: Attached base heatStack ID DOES NOT EXIST " + nestedBaseStackId + " in " + cloudSiteId + "/" + tenantId + " USER ERROR" ;
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vfModuleName, cloudSiteId, tenantId, error, "OpenStack", "QueryStack", MsoLogger.ErrorCode.DataError, error);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
- LOGGER.debug(error);
+ logger.error ("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName,
+ cloudSiteId, tenantId, error, "OpenStack",
+ "QueryStack", MsoLogger.ErrorCode.DataError.getValue(), error);
+ logger.debug(error);
throw new VnfException (error, MsoExceptionCategory.USERDATA);
} else {
- LOGGER.debug("Found nested base heat stack - copying values to inputs *later*");
+ logger.debug("Found nested base heat stack - copying values to inputs *later*");
baseStackOutputs = nestedBaseHeatStack.getOutputs();
heat.copyStringOutputsToInputs(inputs, nestedBaseHeatStack.getOutputs(), false);
}
@@ -1538,25 +1556,25 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
vfmc = vfModuleCustomRepo.findByModelCustomizationUUID(modelCustomizationUuid);
vf = vfmc != null ? vfmc.getVfModule() : null;
if (vf == null) {
- LOGGER.debug("Unable to find a vfModule matching modelCustomizationUuid=" + mcu);
+ logger.debug("Unable to find a vfModule matching modelCustomizationUuid={}", mcu);
}
} else {
- LOGGER.debug("1707 and later - MUST PROVIDE Model Customization UUID!");
+ logger.debug("1707 and later - MUST PROVIDE Model Customization UUID!");
}
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);
+ String error = "Update VfModule: unable to find vfModule with modelCustomizationUuid=" + mcu;
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "VF Module Type",
+ vfModuleType, "OpenStack", MsoLogger.ErrorCode.DataError.getValue(), 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.getIsBase()) {
isBaseRequest = true;
- LOGGER.debug("This a BASE update request");
+ logger.debug("This a BASE update request");
} else {
- LOGGER.debug("This is *not* a BASE VF update request");
+ 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");
}
}
@@ -1568,7 +1586,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
vnfResource = vf.getVnfResources();
if (vnfResource == null) {
- LOGGER.debug("Unable to find vnfResource at " + vnfResourceModelUuid + " will not error for now...");
+ logger.debug("Unable to find vnfResource at ? will not error for now...", vnfResourceModelUuid);
}
}
@@ -1579,7 +1597,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;
}
@@ -1609,36 +1627,36 @@ 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);
- doNotTest = true;
+ logger.debug("An exception occured while trying to test AIC Version {} - will default to not check",
+ e.getMessage(), e);
+ doNotTest = true;
}
if (!doNotTest) {
if ((moreThanMin || equalToMin) // aic >= min
&& ((equalToMax) || !(moreThanMax))) { // aic <= max
- LOGGER.debug("VNF Resource " + vnfResource.getModelName() + " VersionMin=" + minVersionVnf
- + " VersionMax:" + maxVersionVnf + " supported on Cloud: " + cloudSiteId
- + " with AIC_Version:" + aicV);
- } else {
+ logger.debug(
+ "VNF Resource " + vnfResource.getModelName() + " VersionMin=" + minVersionVnf + " VersionMax:"
+ + maxVersionVnf + " supported on Cloud: " + cloudSiteId + " with AIC_Version:" + aicV);
+ } else {
// ERROR
String error = "VNF Resource type: " + vnfResource.getModelName() + " VersionMin="
+ minVersionVnf + " VersionMax:" + maxVersionVnf + " NOT supported on Cloud: "
+ cloudSiteId + " with AIC_Version:" + aicV;
- LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "",
- MsoLogger.ErrorCode.BusinessProcesssError, "Exception - setVersion");
- LOGGER.debug(error);
+ logger.error("{} {} {} {} {}", MessageEnum.RA_CONFIG_EXC.toString(), error, "OpenStack",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception - setVersion");
+ logger.debug(error);
throw new VnfException(error, MsoExceptionCategory.USERDATA);
}
} else {
- LOGGER.debug("bypassing testing AIC version...");
+ logger.debug("bypassing testing AIC version...");
}
} // let this error out downstream to avoid introducing uncertainty at this stage
} else {
- LOGGER.debug("cloudConfig is NULL - cannot check cloud site version");
+ logger.debug("cloudConfig is NULL - cannot check cloud site version");
}
} else {
- LOGGER.debug("AIC Version not set in VNF_Resource - do not error for now - not checked.");
+ logger.debug("AIC Version not set in VNF_Resource - do not error for now - not checked.");
}
// End Version check 1607
@@ -1654,45 +1672,46 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
if (heatTemplate == 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);
- throw new VnfException(error, MsoExceptionCategory.INTERNAL);
+ logger
+ .error("{} {} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Template ID", vfModuleType,
+ "OpenStack", MsoLogger.ErrorCode.DataError.getValue(), error);
+ throw new VnfException(error, MsoExceptionCategory.INTERNAL);
} else {
- LOGGER.debug ("Got HEAT Template from DB: " + heatTemplate.getHeatTemplate());
- }
+ logger.debug("Got HEAT Template from DB: {}", heatTemplate.getHeatTemplate());
+ }
if (heatEnvironment == null) {
String error = "Update VNF: undefined Heat Environment. VF=" + vfModuleType;
- LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Environment ID", "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+ logger.error("{} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Environment ID",
+ "OpenStack", MsoLogger.ErrorCode.DataError.getValue(), error);
throw new VnfException (error, MsoExceptionCategory.INTERNAL);
} else {
- LOGGER.debug ("Got Heat Environment from DB: " + heatEnvironment.getEnvironment());
+ logger.debug ("Got Heat Environment from DB: {}", heatEnvironment.getEnvironment());
}
- LOGGER.debug ("In MsoVnfAdapterImpl, about to call db.getNestedTemplates avec templateId="
- + heatTemplate.getArtifactUuid ());
+ logger.debug("In MsoVnfAdapterImpl, about to call db.getNestedTemplates avec templateId={}",
+ heatTemplate.getArtifactUuid());
List<HeatTemplate> nestedTemplates = heatTemplate.getChildTemplates();
Map <String, Object> nestedTemplatesChecked = new HashMap <> ();
if (nestedTemplates != null && !nestedTemplates.isEmpty()) {
// for debugging print them out
- LOGGER.debug ("Contents of nestedTemplates - to be added to files: on stack:");
+ logger.debug("Contents of nestedTemplates - to be added to files: on stack:");
for (HeatTemplate entry : nestedTemplates) {
nestedTemplatesChecked.put (entry.getTemplateName(), entry.getTemplateBody());
- LOGGER.debug (entry.getTemplateName() + " -> " + entry.getTemplateBody());
+ logger.debug(entry.getTemplateName() + " -> " + entry.getTemplateBody());
}
} 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());
List<HeatFiles> heatFiles = null;
Map <String, Object> heatFilesObjects = new HashMap <> ();
@@ -1703,28 +1722,28 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
String propertyString = this.environment.getProperty(MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ);
if ("true".equalsIgnoreCase(propertyString) || "y".equalsIgnoreCase(propertyString)) {
addGetFilesOnVolumeReq = true;
- LOGGER.debug("AddGetFilesOnVolumeReq - setting to true! " + propertyString);
+ 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 {} - default to false",
+ MsoVnfAdapterImpl.ADD_GET_FILES_ON_VOLUME_REQ, e);
}
if (!isVolumeRequest || addGetFilesOnVolumeReq) {
- LOGGER.debug("In MsoVnfAdapterImpl updateVfModule, about to call db.getHeatFilesForVfModule avec vfModuleId="
- + vf.getModelUUID());
+ logger.debug("In MsoVnfAdapterImpl updateVfModule, about to call db.getHeatFilesForVfModule avec "
+ + "vfModuleId={}", vf.getModelUUID());
heatFiles = vf.getHeatFiles();
if (heatFiles != null && !heatFiles.isEmpty()) {
// 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:");
- for(HeatFiles heatfile : heatFiles){
- LOGGER.debug(heatfile.getFileName() + " -> "
- + heatfile.getFileBody());
- heatFilesObjects.put(heatfile.getFileName(), heatfile.getFileBody());
- }
+ logger.debug("Contents of heatFiles - to be added to files: on stack:");
+ for (HeatFiles heatfile : heatFiles) {
+ logger.debug(heatfile.getFileName() + " -> " + heatfile.getFileBody());
+ heatFilesObjects.put(heatfile.getFileName(), heatfile.getFileBody());
+ }
} else {
- LOGGER.debug ("No heat files found -nothing to do here");
+ logger.debug("No heat files found -nothing to do here");
heatFilesObjects = null;
}
}
@@ -1743,12 +1762,13 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
String propertyString = this.environment.getProperty (MsoVnfAdapterImpl.CHECK_REQD_PARAMS);
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
@@ -1756,7 +1776,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
// Note this also removes any comments
MsoHeatEnvironmentEntry mhee = null;
if (heatEnvironment != null && heatEnvironment.getEnvironment().toLowerCase ().contains ("parameters:")) {
- LOGGER.debug("Enhanced environment checking enabled - 1604");
+ logger.debug("Enhanced environment checking enabled - 1604");
StringBuilder sb = new StringBuilder(heatEnvironment.getEnvironment());
mhee = new MsoHeatEnvironmentEntry(sb);
StringBuilder sb2 = new StringBuilder("\nHeat Template Parameters:\n");
@@ -1769,16 +1789,16 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
sb2.append("\nEnvironment:");
sb2.append(mhee.toFullString());
}
- LOGGER.debug(sb2.toString());
+ logger.debug(sb2.toString());
} else {
- LOGGER.debug("NO ENVIRONMENT for this entry");
+ logger.debug("NO ENVIRONMENT for this entry");
}
// New for 1607 - support params of json type
HashMap<String, JsonNode> jsonParams = new HashMap<>();
boolean hasJson = false;
for (HeatTemplateParam parm : heatTemplate.getParameters ()) {
- LOGGER.debug ("Parameter:'" + parm.getParamName ()
+ logger.debug ("Parameter:'" + parm.getParamName ()
+ "', isRequired="
+ parm.isRequired ()
+ ", alias="
@@ -1800,15 +1820,15 @@ 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);
- hasJson = false;
- jsonNode = null;
- }
+ // or here?
+ logger.debug("Json Error Converting " + parm.getParamName() + " " + e.getMessage(), e);
+ hasJson = false;
+ jsonNode = null;
+ }
if (jsonNode != null) {
jsonParams.put(parm.getParamName(), jsonNode);
}
@@ -1822,15 +1842,15 @@ 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);
- hasJson = false;
- jsonNode = null;
- }
+ // or here?
+ 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
@@ -1848,23 +1868,23 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
String realParamName = parm.getParamName ();
String alias = parm.getParamAlias ();
Object value = inputs.get (alias);
- LOGGER.debug ("*Found an Alias: paramName=" + realParamName
+ 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);
+ logger.debug ("{} entry removed from inputs, added back using {}", alias, 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");
+ logger.debug("Required parameter {} appears to be in environment - do not count as missing",
+ parm.getParamName());
}
else {
- LOGGER.debug ("adding to missing parameters list: " + parm.getParamName ());
+ logger.debug("adding to missing parameters list: {}", parm.getParamName());
if (missingParams == null) {
missingParams = parm.getParamName ();
} else {
@@ -1880,14 +1900,14 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
// Problem - missing one or more required parameters
if (checkRequiredParameters) {
String error = "Update VNF: Missing Required inputs: " + missingParams;
- LOGGER.error (MessageEnum.RA_MISSING_PARAM, missingParams, "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, error);
+ logger.error("{} {} {} {} {}", MessageEnum.RA_MISSING_PARAM.toString(), missingParams, "OpenStack",
+ MsoLogger.ErrorCode.DataError.getValue(), 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
@@ -1902,7 +1922,8 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
// 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");
+ logger.warn("{} {} {} {} {} {}", MessageEnum.RA_VNF_EXTRA_PARAM.toString(), vnfType,
+ extraParams.toString(), "OpenStack", MsoLogger.ErrorCode.DataError.getValue(), "Extra params");
inputs.keySet ().removeAll (extraParams);
}
}
@@ -1929,10 +1950,10 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
boolean isValetEnabled = this.checkBooleanProperty(MsoVnfAdapterImpl.VALET_ENABLED, false);
boolean failRequestOnValetFailure = this.checkBooleanProperty(MsoVnfAdapterImpl.FAIL_REQUESTS_ON_VALET_FAILURE, false);
- LOGGER.debug("isValetEnabled=" + isValetEnabled + ", failRequestsOnValetFailure=" + failRequestOnValetFailure);
+ logger.debug("isValetEnabled={}, failRequestsOnValetFailure={}", isValetEnabled, failRequestOnValetFailure);
if (isVolumeRequest) {
isValetEnabled = false;
- LOGGER.debug("never send a volume request to valet");
+ logger.debug("never send a volume request to valet");
}
boolean sendResponseToValet = false;
if (isValetEnabled) {
@@ -1968,21 +1989,20 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
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");
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);
+ logger
+ .error("{} {} {} {} {} {} {}", MessageEnum.RA_UPDATE_VNF_ERR.toString(), vfModuleType, cloudSiteId,
+ tenantId, "OpenStack", MsoLogger.ErrorCode.DataError.getValue(), "Exception - " + error, me);
if (isValetEnabled && sendResponseToValet) {
- LOGGER.debug("valet is enabled, the orchestration failed - now sending rollback to valet");
+ logger.debug("valet is enabled, the orchestration failed - now sending rollback to valet");
try {
GenericValetResponse<ValetRollbackResponse> gvr = this.vci.callValetRollbackRequest(msoRequest.getRequestId(), null, false, me.getMessage());
// Nothing to really do here whether it succeeded or not other than log it.
- LOGGER.debug("Return code from Rollback response is " + gvr.getStatusCode());
+ logger.debug("Return code from Rollback response is {}", gvr.getStatusCode());
} catch (Exception e) {
- LOGGER.error("Exception encountered while sending Rollback to Valet ", e);
+ logger.error("Exception encountered while sending Rollback to Valet ", e);
}
}
throw new VnfException (me);
@@ -1995,19 +2015,18 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
vfRollback.setVnfCreated (true);
if (isValetEnabled && sendResponseToValet) {
- LOGGER.debug("valet is enabled, the update succeeded - now send confirm to valet with stack id");
+ logger.debug("valet is enabled, the update succeeded - now send confirm to valet with stack id");
try {
GenericValetResponse<ValetConfirmResponse> gvr = this.vci.callValetConfirmRequest(msoRequest.getRequestId(), heatStack.getCanonicalName());
// Nothing to really do here whether it succeeded or not other than log it.
- LOGGER.debug("Return code from Confirm response is " + gvr.getStatusCode());
+ logger.debug("Return code from Confirm response is {}", gvr.getStatusCode());
} catch (Exception e) {
- LOGGER.error("Exception encountered while sending Confirm to Valet ", e);
+ logger.error("Exception encountered while sending Confirm to Valet ", e);
}
}
outputs.value = copyStringOutputs (heatStack.getOutputs ());
rollback.value = vfRollback;
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully update VF Module");
return;
}
@@ -2023,7 +2042,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
try {
vfModuleName = vfModuleStackId.substring(0, index);
} catch (Exception e) {
- LOGGER.debug("Exception", e);
+ logger.debug("Exception", e);
vfModuleName = null;
}
return vfModuleName;
@@ -2042,8 +2061,8 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
property = false;
}
} catch (Exception e) {
- LOGGER.debug ("An exception occured trying to get property " + propertyName + " - defaulting to " + defaultValue, e);
- property = defaultValue;
+ logger.debug("An exception occured trying to get property {} - defaulting to ", propertyName, defaultValue, e);
+ property = defaultValue;
}
return property;
}
@@ -2107,13 +2126,13 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
Map<String, Object> newInputs = vcr.getParameters();
if (newInputs != null) {
Map<String, Object> oldGold = goldenInputs;
- LOGGER.debug("parameters before being modified by valet:" + oldGold.toString());
+ logger.debug("parameters before being modified by valet:{}", oldGold.toString());
goldenInputs = new HashMap<String, Object>();
for (String key : newInputs.keySet()) {
goldenInputs.put(key, newInputs.get(key));
}
valetModifiedParamsHolder.value = goldenInputs;
- LOGGER.debug("parameters after being modified by valet:" + goldenInputs.toString());
+ logger.debug("parameters after being modified by valet:{}", goldenInputs.toString());
valetSucceeded = true;
}
} else {
@@ -2121,15 +2140,15 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
}
}
} else {
- LOGGER.debug("Got a bad response back from valet");
+ logger.debug("Got a bad response back from valet");
valetErrorMessage = "Bad response back from Valet";
valetSucceeded = false;
}
} catch (Exception e) {
- LOGGER.error("An exception occurred trying to call valet ...", e);
- valetSucceeded = false;
- valetErrorMessage = e.getMessage();
- }
+ logger.error("An exception occurred trying to call valet ...", e);
+ valetSucceeded = false;
+ valetErrorMessage = e.getMessage();
+ }
if (failRequestOnValetFailure && !valetSucceeded) {
// The valet request failed - and property says to fail the request
//TODO Create a new exception class for valet?
@@ -2170,13 +2189,13 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
Map<String, Object> newInputs = vur.getParameters();
if (newInputs != null) {
Map<String, Object> oldGold = goldenInputs;
- LOGGER.debug("parameters before being modified by valet:" + oldGold.toString());
+ logger.debug("parameters before being modified by valet:{}", oldGold.toString());
goldenInputs = new HashMap<String, Object>();
for (String key : newInputs.keySet()) {
goldenInputs.put(key, newInputs.get(key));
}
valetModifiedParamsHolder.value = goldenInputs;
- LOGGER.debug("parameters after being modified by valet:" + goldenInputs.toString());
+ logger.debug("parameters after being modified by valet:{}", goldenInputs.toString());
valetSucceeded = true;
}
} else {
@@ -2184,15 +2203,15 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
}
}
} else {
- LOGGER.debug("Got a bad response back from valet");
+ logger.debug("Got a bad response back from valet");
valetErrorMessage = "Got a bad response back from valet";
valetSucceeded = false;
}
} catch (Exception e) {
- LOGGER.error("An exception occurred trying to call valet - will continue processing for now...", e);
- valetErrorMessage = e.getMessage();
- valetSucceeded = false;
- }
+ logger.error("An exception occurred trying to call valet - will continue processing for now...", e);
+ valetErrorMessage = e.getMessage();
+ valetSucceeded = false;
+ }
if (failRequestOnValetFailure && !valetSucceeded) {
// The valet request failed - and property says to fail the request
// TODO Create a new exception class for valet?
@@ -2216,7 +2235,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
vfModuleId = vnfName.substring(vnfName.indexOf('/') + 1);
} catch (Exception e) {
// do nothing - send what we got for vnfName for both to valet
- LOGGER.error("An exception occurred trying to call MsoVnfAdapterImpl.valetDeleteRequest() method", e);
+ logger.error("An exception occurred trying to call MsoVnfAdapterImpl.valetDeleteRequest() method", e);
}
GenericValetResponse<ValetDeleteResponse> deleteReq = this.vci.callValetDeleteRequest(msoRequest.getRequestId(),
cloudSiteId, tenantId, vfModuleId, vfModuleName);
@@ -2225,27 +2244,28 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
ValetStatus status = vdr.getStatus();
if (status != null) {
String statusCode = status.getStatus(); // "ok" or "failed"
- if ("ok".equalsIgnoreCase(statusCode)) {
- LOGGER.debug("delete request to valet returned success");
- valetDeleteRequestSucceeded = true;
- } else {
- LOGGER.debug("delete request to valet returned failure");
- valetDeleteRequestSucceeded = false;
- valetErrorMessage = status.getMessage();
- }
- }
+ if ("ok".equalsIgnoreCase(statusCode)) {
+ logger.debug("delete request to valet returned success");
+ valetDeleteRequestSucceeded = true;
+ } else {
+ logger.debug("delete request to valet returned failure");
+ valetDeleteRequestSucceeded = false;
+ valetErrorMessage = status.getMessage();
+ }
+ }
} else {
- LOGGER.debug("Got a bad response back from valet - delete request failed");
+ logger.debug("Got a bad response back from valet - delete request failed");
valetDeleteRequestSucceeded = false;
valetErrorMessage = "Got a bad response back from valet - delete request failed";
}
} catch (Exception e) {
- LOGGER.error("An exception occurred trying to call valet - valetDeleteRequest failed", e);
- valetDeleteRequestSucceeded = false;
- valetErrorMessage = e.getMessage();
- }
+ logger.error("An exception occurred trying to call valet - valetDeleteRequest failed", e);
+ valetDeleteRequestSucceeded = false;
+ valetErrorMessage = e.getMessage();
+ }
if (valetDeleteRequestSucceeded == false && failRequestOnValetFailure == true) {
- LOGGER.error("ValetDeleteRequestFailed - del req still will be sent to openstack", new VnfException("ValetDeleteRequestFailedError"));
+ logger.error("ValetDeleteRequestFailed - del req still will be sent to openstack", new VnfException
+ ("ValetDeleteRequestFailedError"));
}
return valetDeleteRequestSucceeded;
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java
index f34a79491e..bba960cddf 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java
@@ -5,6 +5,7 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Modifications Copyright (C) 2018 IBM.
+ * Modifications Copyright (c) 2019 Samsung
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -63,6 +64,8 @@ import org.onap.so.openstack.exceptions.MsoExceptionCategory;
import org.onap.so.openstack.utils.MsoHeatEnvironmentEntry;
import org.onap.so.openstack.utils.MsoHeatEnvironmentParameter;
import org.onap.so.openstack.utils.MsoKeystoneUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@@ -77,11 +80,11 @@ import org.springframework.transaction.annotation.Transactional;
@WebService(serviceName = "VnfAdapter", endpointInterface = "org.onap.so.adapters.vnf.MsoVnfAdapter", targetNamespace = "http://org.onap.so/vnf")
public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
+ private static Logger logger = LoggerFactory.getLogger(MsoVnfCloudifyAdapterImpl.class);
+
private static final String MSO_CONFIGURATION_ERROR = "MsoConfigurationError";
private static final String VNF_ADAPTER_SERVICE_NAME = "MSO-BPMN:MSO-VnfAdapter.";
private static final String LOG_REPLY_NAME = "MSO-VnfAdapter:MSO-BPMN.";
- private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, MsoVnfCloudifyAdapterImpl.class);
-
private static final String CHECK_REQD_PARAMS = "org.onap.so.adapters.vnf.checkRequiredParameters";
private static final String ADD_GET_FILES_ON_VOLUME_REQ = "org.onap.so.adapters.vnf.addGetFilesOnVolumeReq";
private static final String CLOUDIFY_RESPONSE_SUCCESS="Successfully received response from Cloudify";
@@ -108,7 +111,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
*/
@Override
public void healthCheck () {
- LOGGER.debug ("Health check call in VNF Cloudify Adapter");
+ logger.debug("Health check call in VNF Cloudify Adapter");
}
/**
@@ -142,9 +145,9 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
Holder <VnfRollback> rollback)
throws VnfException
{
- // This operation is no longer supported at the VNF level. The adapter is only called to deploy modules.
- LOGGER.debug ("CreateVNF command attempted but not supported");
- throw new VnfException ("CreateVNF: Unsupported command", MsoExceptionCategory.USERDATA);
+ // This operation is no longer supported at the VNF level. The adapter is only called to deploy modules.
+ logger.debug("CreateVNF command attempted but not supported");
+ throw new VnfException("CreateVNF: Unsupported command", MsoExceptionCategory.USERDATA);
}
/**
@@ -167,8 +170,8 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
throws VnfException
{
// This operation is no longer supported at the VNF level. The adapter is only called to deploy modules.
- LOGGER.debug ("UpdateVNF command attempted but not supported");
- throw new VnfException ("UpdateVNF: Unsupported command", MsoExceptionCategory.USERDATA);
+ logger.debug("UpdateVNF command attempted but not supported");
+ throw new VnfException ("UpdateVNF: Unsupported command", MsoExceptionCategory.USERDATA);
}
/**
@@ -204,8 +207,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
throws VnfException
{
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName ("QueryVnfCloudify");
- LOGGER.debug ("Querying VNF " + vnfName + " in " + cloudSiteId + "/" + tenantId);
+ logger.debug ("Querying VNF {} in {}", vnfName, cloudSiteId + "/" + tenantId);
// Will capture execution time for metrics
long startTime = System.currentTimeMillis ();
@@ -215,7 +217,6 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
try {
deployment = cloudifyUtils.queryDeployment(cloudSiteId, tenantId, vnfName);
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, CLOUDIFY_RESPONSE_SUCCESS, CLOUDIFY, "QueryDeployment", vnfName);
}
catch (MsoCloudifyManagerNotFound e) {
// This site does not have a Cloudify Manager.
@@ -223,33 +224,32 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
deployment = null;
}
catch (MsoException me) {
- // Failed to query the Deployment due to a cloudify exception.
- // Convert to a generic VnfException
- me.addContext ("QueryVNF");
- String error = "Query VNF (Cloudify): " + vnfName + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, CLOUDIFY, "QueryDeployment", vnfName);
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vnfName, cloudSiteId, tenantId, CLOUDIFY, "QueryVNF", MsoLogger.ErrorCode.DataError, "Exception - queryDeployment", me);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
- throw new VnfException (me);
- }
-
- if (deployment != null && deployment.getStatus() != DeploymentStatus.NOTFOUND) {
+ // Failed to query the Deployment due to a cloudify exception.
+ // Convert to a generic VnfException
+ me.addContext("QueryVNF");
+ String error = "Query VNF (Cloudify): " + vnfName + " in " + cloudSiteId + "/" + tenantId + ": " + me;
+ logger
+ .error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudSiteId, tenantId,
+ CLOUDIFY, "QueryVNF", MsoLogger.ErrorCode.DataError.getValue(), "Exception - queryDeployment", me);
+ logger.debug(error);
+ throw new VnfException(me);
+ }
+
+ if (deployment != null && deployment.getStatus() != DeploymentStatus.NOTFOUND) {
vnfExists.value = Boolean.TRUE;
status.value = deploymentStatusToVnfStatus(deployment);
vnfId.value = deployment.getId();
- outputs.value = copyStringOutputs (deployment.getOutputs ());
+ outputs.value = copyStringOutputs(deployment.getOutputs());
- LOGGER.debug ("VNF " + vnfName + " found in Cloudify, ID = " + vnfId.value);
- }
- else {
+ logger.debug("VNF {} found in Cloudify, ID = {}", vnfName, vnfId.value);
+ } else {
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<String, String>(); // Return as an empty map
- LOGGER.debug ("VNF " + vnfName + " not found");
- }
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully query VNF");
+ logger.debug("VNF {} not found", vnfName);
+ }
return;
}
@@ -265,11 +265,10 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
String vnfName,
MsoRequest msoRequest) throws VnfException {
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName ("DeleteVnf");
// This operation is no longer supported at the VNF level. The adapter is only called to deploy modules.
- LOGGER.debug ("DeleteVNF command attempted but not supported");
- throw new VnfException ("DeleteVNF: Unsupported command", MsoExceptionCategory.USERDATA);
+ logger.debug("DeleteVNF command attempted but not supported");
+ throw new VnfException ("DeleteVNF: Unsupported command", MsoExceptionCategory.USERDATA);
}
/**
@@ -284,17 +283,15 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
@Override
public void rollbackVnf (VnfRollback rollback) throws VnfException {
long startTime = System.currentTimeMillis ();
- MsoLogger.setServiceName ("RollbackVnf");
// rollback may be null (e.g. if stack already existed when Create was called)
if (rollback == null) {
- LOGGER.info (MessageEnum.RA_ROLLBACK_NULL, "OpenStack", "rollbackVnf", MsoLogger.getServiceName());
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, "Rollback request content is null");
+ logger.info ("{} {} {} {}", MessageEnum.RA_ROLLBACK_NULL.toString(), "OpenStack", "rollbackVnf", MsoLogger
+ .getServiceName());
return;
}
// Don't rollback if nothing was done originally
if (!rollback.getVnfCreated()) {
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Rollback VF Module - nothing to roll back");
return;
}
@@ -305,7 +302,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
MsoLogger.setLogContext (rollback.getMsoRequest());
- LOGGER.debug ("Rolling Back VF Module " + vfModuleId + " in " + cloudSiteId + "/" + tenantId);
+ logger.debug("Rolling Back VF Module {} in {}", vfModuleId, cloudSiteId + "/" + tenantId);
DeploymentInfo deployment = null;
@@ -322,19 +319,18 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
// TODO: Get a reasonable timeout. Use a global property, or store the creation timeout in rollback object and use that.
deployment = cloudifyUtils.uninstallAndDeleteDeployment(cloudSiteId, tenantName, vfModuleId, 5);
- LOGGER.debug("Rolled back deployment: " + deployment.getId());
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, CLOUDIFY_RESPONSE_SUCCESS, CLOUDIFY, "DeleteDeployment", null);
+ logger.debug("Rolled back deployment: {}", deployment.getId());
} catch (MsoException me) {
// Failed to rollback the VNF due to a cloudify exception.
// Convert to a generic VnfException
me.addContext ("RollbackVNF");
String error = "Rollback VF Module: " + vfModuleId + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, CLOUDIFY, "DeleteDeployment", null);
- LOGGER.error (MessageEnum.RA_DELETE_VNF_ERR, vfModuleId, cloudSiteId, tenantId, CLOUDIFY, "DeleteDeployment", MsoLogger.ErrorCode.DataError, "Exception - DeleteDeployment", me);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vfModuleId, cloudSiteId,
+ tenantId, CLOUDIFY, "DeleteDeployment", MsoLogger.ErrorCode.DataError.getValue(),
+ "Exception - DeleteDeployment", me);
+ logger.debug(error);
throw new VnfException (me);
}
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully roll back VF Module");
return;
}
@@ -376,28 +372,28 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
String str = "" + stackOutputs.get(key);
stringOutputs.put(key, str);
} catch (Exception e) {
- LOGGER.debug("Unable to add " + key + " to outputs");
+ logger.debug("Unable to add " + key + " to outputs");
}
} else if (stackOutputs.get(key) instanceof JsonNode) {
try {
String str = this.convertNode((JsonNode) stackOutputs.get(key));
stringOutputs.put(key, str);
} catch (Exception e) {
- LOGGER.debug("Unable to add " + key + " to outputs - exception converting JsonNode");
- }
+ logger.debug("Unable to add " + key + " to outputs - exception converting JsonNode");
+ }
} else if (stackOutputs.get(key) instanceof java.util.LinkedHashMap) {
try {
String str = JSON_MAPPER.writeValueAsString(stackOutputs.get(key));
stringOutputs.put(key, str);
} catch (Exception e) {
- LOGGER.debug("Unable to add " + key + " to outputs - exception converting LinkedHashMap");
+ logger.debug("Unable to add " + key + " to outputs - exception converting LinkedHashMap");
}
} else {
try {
String str = stackOutputs.get(key).toString();
stringOutputs.put(key, str);
} catch (Exception e) {
- LOGGER.debug("Unable to add " + key + " to outputs - unable to call .toString() " + e.getMessage());
+ logger.debug("Unable to add " + key + " to outputs - unable to call .toString() " + e.getMessage());
}
}
}
@@ -424,7 +420,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
sb.append("\t\nitem " + i++ + ": '" + str + "'='" + outputString + "'");
}
}
- LOGGER.debug(sb.toString());
+ logger.debug(sb.toString());
return;
}
@@ -441,7 +437,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
sb.append("\titem " + i++ + ": " + str + "=" + inputs.get(str));
}
}
- LOGGER.debug(sb.toString());
+ logger.debug(sb.toString());
return;
}
@@ -451,9 +447,9 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
final String json = JSON_MAPPER.writeValueAsString(obj);
return json;
} catch (JsonParseException jpe) {
- LOGGER.debug("Error converting json to string " + jpe.getMessage());
+ logger.debug("Error converting json to string " + jpe.getMessage());
} catch (Exception e) {
- LOGGER.debug("Error converting json to string " + e.getMessage());
+ logger.debug("Error converting json to string " + e.getMessage());
}
return "[Error converting json to string]";
}
@@ -475,30 +471,30 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
String str = this.convertNode((JsonNode) obj);
stringMap.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for JsonNode "+ key);
+ logger.debug("DANGER WILL ROBINSON: unable to convert value for JsonNode "+ key);
//okay in this instance - only string values (fqdn) are expected to be needed
}
} else if (obj instanceof java.util.LinkedHashMap) {
- LOGGER.debug("LinkedHashMap - this is showing up as a LinkedHashMap instead of JsonNode");
+ logger.debug("LinkedHashMap - this is showing up as a LinkedHashMap instead of JsonNode");
try {
String str = JSON_MAPPER.writeValueAsString(obj);
stringMap.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for LinkedHashMap "+ key);
+ logger.debug("DANGER WILL ROBINSON: unable to convert value for LinkedHashMap "+ key);
}
} else if (obj instanceof Integer) {
try {
String str = "" + obj;
stringMap.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for Integer "+ key);
+ logger.debug("DANGER WILL ROBINSON: unable to convert value for Integer "+ key);
}
} else {
try {
String str = obj.toString();
stringMap.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value "+ key + " (" + e.getMessage() + ")");
+ logger.debug("DANGER WILL ROBINSON: unable to convert value "+ key + " (" + e.getMessage() + ")");
}
}
}
@@ -581,15 +577,15 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
long startTime = System.currentTimeMillis ();
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName ("CreateVfModule");
// Require a model customization ID. Every VF Module definition must have one.
- if (modelCustomizationUuid == null || modelCustomizationUuid.isEmpty()) {
- LOGGER.debug("Missing required input: modelCustomizationUuid");
- String error = "Create vfModule error: Missing required input: modelCustomizationUuid";
- LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM,
- "VF Module ModelCustomizationUuid", "null", CLOUDIFY, "", MsoLogger.ErrorCode.DataError, "Create VF Module: Missing required input: modelCustomizationUuid");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+ if (modelCustomizationUuid == null || modelCustomizationUuid.isEmpty()) {
+ logger.debug("Missing required input: modelCustomizationUuid");
+ String error = "Create vfModule error: Missing required input: modelCustomizationUuid";
+ logger.error("{} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(),
+ "VF Module ModelCustomizationUuid", CLOUDIFY, MsoLogger.ErrorCode.DataError.getValue(),
+ "Create VF Module: Missing required input: modelCustomizationUuid");
+ logger.debug(error);
throw new VnfException(error, MsoExceptionCategory.USERDATA);
}
@@ -606,7 +602,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
if (inputs == null) {
// Create an empty set of inputs
inputs = new HashMap<>();
- LOGGER.debug("inputs == null - setting to empty");
+ logger.debug("inputs == null - setting to empty");
} else {
this.sendMapToDebug(inputs);
}
@@ -617,7 +613,8 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
isVolumeRequest = true;
}
- LOGGER.debug("requestType = " + requestType + ", volumeGroupStackId = " + volumeGroupId + ", baseStackId = " + baseVfModuleId);
+ logger.debug("requestType = " + requestType + ", volumeGroupStackId = " + volumeGroupId + ", baseStackId = " +
+ baseVfModuleId);
// Build a default rollback object (no actions performed)
VnfRollback vfRollback = new VnfRollback();
@@ -641,17 +638,18 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
VfModuleCustomization vfmc = null;
try {
- vfmc = vfModuleCustomRepo.findByModelCustomizationUUID(modelCustomizationUuid);
+ vfmc = vfModuleCustomRepo.findByModelCustomizationUUID(modelCustomizationUuid);
if (vfmc == null) {
- String error = "Create vfModule error: Unable to find vfModuleCust with modelCustomizationUuid=" + modelCustomizationUuid;
- LOGGER.debug(error);
- LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM,
- "VF Module ModelCustomizationUuid", modelCustomizationUuid, "CatalogDb", "", MsoLogger.ErrorCode.DataError, error);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+ String error = "Create vfModule error: Unable to find vfModuleCust with modelCustomizationUuid="
+ + modelCustomizationUuid;
+ logger.debug(error);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "VF Module "
+ + "ModelCustomizationUuid",
+ modelCustomizationUuid, "CatalogDb", MsoLogger.ErrorCode.DataError.getValue(), error);
throw new VnfException(error, MsoExceptionCategory.USERDATA);
} else {
- LOGGER.debug("Found vfModuleCust entry " + vfmc.toString());
+ logger.debug("Found vfModuleCust entry " + vfmc.toString());
}
// Get the vfModule and vnfResource records
@@ -660,7 +658,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
}
catch (Exception e) {
- LOGGER.debug("unhandled exception in create VF - [Query]" + e.getMessage());
+ logger.debug("unhandled exception in create VF - [Query]" + e.getMessage());
throw new VnfException("Exception during create VF " + e.getMessage());
}
@@ -681,10 +679,13 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
(vnfMax != null && aicV.isMoreRecentThan(vnfMax)))
{
// ERROR
- String error = "VNF Resource type: " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUUID() + " VersionMin=" + vnfMin + " VersionMax:" + vnfMax + " NOT supported on Cloud: " + cloudSiteId + " with AIC_Version:" + cloudSite.getCloudVersion();
- LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - setVersion");
- LOGGER.debug(error);
- throw new VnfException(error, MsoExceptionCategory.USERDATA);
+ String error = "VNF Resource type: " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUUID()
+ + " VersionMin=" + vnfMin + " VersionMax:" + vnfMax + " NOT supported on Cloud: " + cloudSiteId
+ + " with AIC_Version:" + cloudSite.getCloudVersion();
+ logger.error("{} {} {} {} {}", MessageEnum.RA_CONFIG_EXC.toString(), error, "OpenStack",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception - setVersion");
+ logger.debug(error);
+ throw new VnfException(error, MsoExceptionCategory.USERDATA);
}
// End Version check
@@ -696,14 +697,14 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
long subStartTime1 = System.currentTimeMillis ();
try {
cloudifyDeployment = cloudifyUtils.queryDeployment (cloudSiteId, tenantId, vfModuleName);
- LOGGER.recordMetricEvent (subStartTime1, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, CLOUDIFY_RESPONSE_SUCCESS, CLOUDIFY, "QueryDeployment", vfModuleName);
}
catch (MsoException me) {
// Failed to query the Deployment due to a cloudify exception.
String error = "Create VF Module: Query " + vfModuleName + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vfModuleName, cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", MsoLogger.ErrorCode.DataError, "Exception - queryDeployment", me);
- LOGGER.recordMetricEvent (subStartTime1, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, CLOUDIFY, "QueryDeployment", vfModuleName);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudSiteId,
+ tenantId, CLOUDIFY, "queryDeployment", MsoLogger.ErrorCode.DataError.getValue(),
+ "Exception - queryDeployment", me);
+ logger.debug(error);
// Convert to a generic VnfException
me.addContext ("CreateVFModule");
@@ -714,54 +715,65 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
if (cloudifyDeployment != null && !(cloudifyDeployment.getStatus () == DeploymentStatus.NOTFOUND)) {
// CREATED, INSTALLED, INSTALLING, FAILED, UNINSTALLING, UNKNOWN
DeploymentStatus status = cloudifyDeployment.getStatus();
- LOGGER.debug ("Found Existing Deployment, status=" + status);
+ logger.debug ("Found Existing Deployment, status=" + status);
if (status == DeploymentStatus.INSTALLED) {
// fail - it exists
if (failIfExists != null && failIfExists) {
String error = "Create VF: Deployment " + vfModuleName + " already exists in " + cloudSiteId + "/" + tenantId;
- LOGGER.error (MessageEnum.RA_VNF_ALREADY_EXIST, vfModuleName, cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", MsoLogger.ErrorCode.DataError, "Deployment " + vfModuleName + " already exists");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
- throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, cloudifyDeployment.getId());
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", MsoLogger.ErrorCode.DataError.getValue(),
+ "Deployment " + vfModuleName + " already exists");
+ logger.debug(error);
+ throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, cloudifyDeployment.getId());
} else {
// Found existing deployment and client has not requested "failIfExists".
// Populate the outputs from the existing deployment.
vnfId.value = cloudifyDeployment.getId();
outputs.value = copyStringOutputs (cloudifyDeployment.getOutputs ());
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully create VF Module (found existing)");
return;
}
}
// Check through various detailed error cases
if (status == DeploymentStatus.INSTALLING || status == DeploymentStatus.UNINSTALLING) {
// fail - it's in progress - return meaningful error
- String error = "Create VF: Deployment " + vfModuleName + " already exists and has status " + status.toString() + " in " + cloudSiteId + "/" + tenantId + "; please wait for it to complete, or fix manually.";
- LOGGER.error (MessageEnum.RA_VNF_ALREADY_EXIST, vfModuleName, cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", MsoLogger.ErrorCode.DataError, "Deployment " + vfModuleName + " already exists");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
+ String error = "Create VF: Deployment " + vfModuleName + " already exists and has status " + status.toString() + " in " + cloudSiteId + "/" + tenantId + "; please wait for it to complete, or fix manually.";
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", MsoLogger.ErrorCode.DataError.getValue(),
+ "Deployment " + vfModuleName + " already exists");
+ logger.debug(error);
throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, cloudifyDeployment.getId());
}
else if (status == DeploymentStatus.FAILED) {
// fail - it exists and is in a FAILED state
- String error = "Create VF: Deployment " + vfModuleName + " already exists and is in FAILED state in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
- LOGGER.error (MessageEnum.RA_VNF_ALREADY_EXIST, vfModuleName, cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", MsoLogger.ErrorCode.DataError, "Deployment " + vfModuleName + " already exists and is in FAILED state");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
+ String error = "Create VF: Deployment " + vfModuleName + " already exists and is in FAILED state in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", MsoLogger.ErrorCode.DataError.getValue(),
+ "Deployment " + vfModuleName + " already " + "exists and is in FAILED state");
+ logger.debug(error);
throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, cloudifyDeployment.getId());
}
else if (status == DeploymentStatus.UNKNOWN || status == DeploymentStatus.CREATED) {
// fail - it exists and is in a UNKNOWN state
- String error = "Create VF: Deployment " + vfModuleName + " already exists and has status " + status.toString() + " in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
- LOGGER.error (MessageEnum.RA_VNF_ALREADY_EXIST, vfModuleName, cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", MsoLogger.ErrorCode.DataError, "Deployment " + vfModuleName + " already exists and is in " + status.toString() + " state");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
+ String error = "Create VF: Deployment " + vfModuleName + " already exists and has status " + status.toString() + " in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", MsoLogger.ErrorCode.DataError.getValue(),
+ "Deployment " + vfModuleName + " already " + "exists and is in " + status.toString() + " state");
+ logger.debug(error);
throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, cloudifyDeployment.getId());
}
else {
// Unexpected, since all known status values have been tested for
- String error = "Create VF: Deployment " + vfModuleName + " already exists with unexpected status " + status.toString() + " in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
- LOGGER.error (MessageEnum.RA_VNF_ALREADY_EXIST, vfModuleName, cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", MsoLogger.ErrorCode.DataError, "Deployment " + vfModuleName + " already exists and is in an unknown state");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
- throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, cloudifyDeployment.getId());
- }
+ String error =
+ "Create VF: Deployment " + vfModuleName + " already exists with unexpected status " + status
+ .toString() + " in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", MsoLogger.ErrorCode.DataError.getValue(),
+ "Deployment " + vfModuleName + " already " + "exists and is in an unknown state");
+ logger.debug(error);
+ throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, cloudifyDeployment.getId());
+ }
}
@@ -775,28 +787,31 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
DeploymentInfo volumeDeployment = null;
try {
volumeDeployment = cloudifyUtils.queryDeployment (cloudSiteId, tenantId, volumeGroupId);
- LOGGER.recordMetricEvent (subStartTime2, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Success response from Cloudify", CLOUDIFY, "QueryDeployment", volumeGroupId);
}
catch (MsoException me) {
// Failed to query the Volume GroupDeployment due to a cloudify exception.
String error = "Create VF Module: Query Volume Group " + volumeGroupId + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, volumeGroupId, cloudSiteId, tenantId, CLOUDIFY, "queryDeployment(volume)", MsoLogger.ErrorCode.DataError, "Exception - queryDeployment(volume)", me);
- LOGGER.recordMetricEvent (subStartTime2, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, CLOUDIFY, "QueryDeployment(volume)", volumeGroupId);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId,
+ cloudSiteId, tenantId, CLOUDIFY, "queryDeployment(volume)",
+ MsoLogger.ErrorCode.DataError.getValue(), "Exception - queryDeployment(volume)", me);
+ logger.debug(error);
// Convert to a generic VnfException
me.addContext ("CreateVFModule(QueryVolume)");
throw new VnfException (me);
}
if (volumeDeployment == null || volumeDeployment.getStatus() == DeploymentStatus.NOTFOUND) {
- String error = "Create VFModule: Attached Volume Group DOES NOT EXIST " + volumeGroupId + " in " + cloudSiteId + "/" + tenantId + " USER ERROR" ;
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, volumeGroupId, cloudSiteId, tenantId, error, CLOUDIFY, "queryDeployment(volume)", MsoLogger.ErrorCode.BusinessProcesssError, "Create VFModule: Attached Volume Group DOES NOT EXIST");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
- LOGGER.debug(error);
- throw new VnfException (error, MsoExceptionCategory.USERDATA);
- } else {
- LOGGER.debug("Found nested volume group");
+ String error =
+ "Create VFModule: Attached Volume Group DOES NOT EXIST " + volumeGroupId + " in " + cloudSiteId + "/"
+ + tenantId + " USER ERROR";
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId,
+ cloudSiteId, tenantId, error, CLOUDIFY, "queryDeployment(volume)",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+ "Create VFModule: Attached Volume Group DOES NOT EXIST");
+ logger.debug(error);
+ throw new VnfException(error, MsoExceptionCategory.USERDATA);
+ } else {
+ logger.debug("Found nested volume group");
volumeGroupOutputs = volumeDeployment.getOutputs();
this.sendMapToDebug(volumeGroupOutputs, "volumeGroupOutputs");
}
@@ -807,15 +822,15 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
// Add-On Volume Group or Add-On VF Module
if (vf.getIsBase()) {
- LOGGER.debug("This is a BASE Module request");
+ logger.debug("This is a BASE Module request");
vfRollback.setIsBase(true);
} else {
- LOGGER.debug("This is an Add-On Module request");
+ logger.debug("This is an Add-On Module request");
// Add-On Modules should always have a Base, but just treat as a warning if not provided.
// Add-on Volume requests may or may not specify a base.
if (!isVolumeRequest && baseVfModuleId == null) {
- LOGGER.debug ("WARNING: Add-on Module request - no Base Module ID provided");
+ logger.debug ("WARNING: Add-on Module request - no Base Module ID provided");
}
if (baseVfModuleId != null) {
@@ -823,31 +838,36 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
DeploymentInfo baseDeployment = null;
try {
baseDeployment = cloudifyUtils.queryDeployment (cloudSiteId, tenantId, baseVfModuleId);
- LOGGER.recordMetricEvent (subStartTime2, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Success response from Cloudify", CLOUDIFY, "QueryDeployment(Base)", baseVfModuleId);
}
catch (MsoException me) {
// Failed to query the Volume GroupDeployment due to a cloudify exception.
- String error = "Create VF Module: Query Base " + baseVfModuleId + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, baseVfModuleId, cloudSiteId, tenantId, CLOUDIFY, "queryDeployment(Base)", MsoLogger.ErrorCode.DataError, "Exception - queryDeployment(Base)", me);
- LOGGER.recordMetricEvent (subStartTime2, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, CLOUDIFY, "QueryDeployment(Base)", baseVfModuleId);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-
- // Convert to a generic VnfException
- me.addContext ("CreateVFModule(QueryBase)");
- throw new VnfException (me);
+ String error =
+ "Create VF Module: Query Base " + baseVfModuleId + " in " + cloudSiteId + "/" + tenantId + ": "
+ + me;
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId,
+ cloudSiteId, tenantId, CLOUDIFY, "queryDeployment(Base)",
+ MsoLogger.ErrorCode.DataError.getValue(), "Exception - queryDeployment(Base)", me);
+ logger.debug(error);
+ // Convert to a generic VnfException
+ me.addContext("CreateVFModule(QueryBase)");
+ throw new VnfException (me);
}
- if (baseDeployment == null || baseDeployment.getStatus() == DeploymentStatus.NOTFOUND) {
- String error = "Create VFModule: Base Module DOES NOT EXIST " + baseVfModuleId + " in " + cloudSiteId + "/" + tenantId + " USER ERROR" ;
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, baseVfModuleId, cloudSiteId, tenantId, error, CLOUDIFY, "queryDeployment(Base)", MsoLogger.ErrorCode.BusinessProcesssError, "Create VFModule: Base Module DOES NOT EXIST");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
- LOGGER.debug(error);
- throw new VnfException (error, MsoExceptionCategory.USERDATA);
- } else {
- LOGGER.debug("Found base module");
- baseModuleOutputs = baseDeployment.getOutputs();
- this.sendMapToDebug(baseModuleOutputs, "baseModuleOutputs");
- }
+ if (baseDeployment == null || baseDeployment.getStatus() == DeploymentStatus.NOTFOUND) {
+ String error =
+ "Create VFModule: Base Module DOES NOT EXIST " + baseVfModuleId + " in " + cloudSiteId + "/"
+ + tenantId + " USER ERROR";
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId,
+ cloudSiteId, tenantId, error, CLOUDIFY, "queryDeployment(Base)",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+ "Create VFModule: Base " + "Module DOES NOT EXIST");
+ logger.debug(error);
+ throw new VnfException(error, MsoExceptionCategory.USERDATA);
+ } else {
+ logger.debug("Found base module");
+ baseModuleOutputs = baseDeployment.getOutputs();
+ this.sendMapToDebug(baseModuleOutputs, "baseModuleOutputs");
+ }
}
}
@@ -871,24 +891,23 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
}
if (heatTemplate == null) {
- String error = "UpdateVF: No Heat Template ID defined in catalog database for " + vfModuleType + ", reqType=" + requestType;
- 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);
- throw new VnfException(error, MsoExceptionCategory.INTERNAL);
- } else {
- LOGGER.debug ("Got HEAT Template from DB: " + heatTemplate.getHeatTemplate());
+ String error = "UpdateVF: No Heat Template ID defined in catalog database for " + vfModuleType + ", reqType="
+ + requestType;
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Template ID", vfModuleType,
+ "OpenStack", MsoLogger.ErrorCode.DataError.getValue(), error);
+ throw new VnfException(error, MsoExceptionCategory.INTERNAL);
+ } else {
+ logger.debug("Got HEAT Template from DB: {}", heatTemplate.getHeatTemplate());
}
if (heatEnvironment == null) {
- String error = "Update VNF: undefined Heat Environment. VF=" + vfModuleType;
- LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Environment ID", "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
- // Alarm on this error, configuration must be fixed
-
-
- throw new VnfException (error, MsoExceptionCategory.INTERNAL);
+ String error = "Update VNF: undefined Heat Environment. VF=" + vfModuleType;
+ logger.error("{} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Environment ID",
+ "OpenStack", MsoLogger.ErrorCode.DataError.getValue(), error);
+ // Alarm on this error, configuration must be fixed
+ throw new VnfException(error, MsoExceptionCategory.INTERNAL);
} else {
- LOGGER.debug ("Got Heat Environment from DB: " + heatEnvironment.getEnvironment());
+ logger.debug("Got Heat Environment from DB: {}", heatEnvironment.getEnvironment());
}
@@ -912,7 +931,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
HashMap<String, HeatTemplateParam> params = new HashMap<String, HeatTemplateParam>();
Set<HeatTemplateParam> paramSet = heatTemplate.getParameters();
- LOGGER.debug("paramSet has " + paramSet.size() + " entries");
+ logger.debug("paramSet has {} entries", paramSet.size());
for (HeatTemplateParam htp : paramSet) {
params.put(htp.getParamName(), htp);
@@ -932,7 +951,8 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
goldenInputs.put(key, value);
}
else {
- LOGGER.debug("Failed to convert input " + key + "='" + inputs.get(key) + "' to " + params.get(key).getParamType());
+ logger.debug("Failed to convert input " + key + "='" + inputs.get(key) + "' to " + params.get(key)
+ .getParamType());
}
} else {
extraInputs.add(key);
@@ -940,7 +960,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
}
if (!extraInputs.isEmpty()) {
- LOGGER.debug("Ignoring extra inputs: " + extraInputs);
+ logger.debug("Ignoring extra inputs: " + extraInputs);
}
// Next add in Volume Group Outputs if there are any. Copy directly without conversions.
@@ -979,7 +999,8 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
goldenInputs.put(envKey, value);
}
else {
- LOGGER.debug("Failed to convert environment parameter " + envKey + "='" + envParam.getValue() + "' to " + params.get(envKey).getParamType());
+ logger.debug("Failed to convert environment parameter " + envKey + "='" + envParam.getValue() + "' to " +
+ params.get(envKey).getParamType());
}
}
}
@@ -995,39 +1016,43 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
String propertyString = this.environment.getProperty(MsoVnfCloudifyAdapterImpl.CHECK_REQD_PARAMS);
if ("false".equalsIgnoreCase (propertyString) || "n".equalsIgnoreCase (propertyString)) {
checkRequiredParameters = false;
- LOGGER.debug ("CheckRequiredParameters is FALSE. Will still check but then skip blocking..."
- + MsoVnfCloudifyAdapterImpl.CHECK_REQD_PARAMS);
- }
+ logger.debug("CheckRequiredParameters is FALSE. Will still check but then skip blocking... {}",
+ MsoVnfCloudifyAdapterImpl.CHECK_REQD_PARAMS);
+ }
} catch (Exception e) {
// No problem - default is true
- LOGGER.debug ("An exception occured trying to get property " + MsoVnfCloudifyAdapterImpl.CHECK_REQD_PARAMS, e);
- }
+ logger.debug("An exception occured trying to get property {}",
+ MsoVnfCloudifyAdapterImpl.CHECK_REQD_PARAMS, e);
+ }
for (HeatTemplateParam parm : heatTemplate.getParameters ()) {
if (parm.isRequired () && (!goldenInputs.containsKey (parm.getParamName ()))) {
- LOGGER.debug ("adding to missing parameters list: " + parm.getParamName ());
- if (missingParams == null) {
- missingParams = parm.getParamName ();
- } else {
- missingParams += "," + parm.getParamName ();
- }
- }
+ logger.debug("adding to missing parameters list: {}", parm.getParamName());
+ if (missingParams == null) {
+ missingParams = parm.getParamName();
+ } else {
+ missingParams += "," + 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, CLOUDIFY, "", 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 [" + missingParams + "] - but checkRequiredParameters is false - will not block");
- }
- } else {
- LOGGER.debug ("No missing parameters found - ok to proceed");
- }
+ 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.toString(), missingParams, CLOUDIFY,
+ MsoLogger.ErrorCode.DataError.getValue(), "Create VFModule: Missing Required inputs");
+ logger.debug(error);
+ throw new VnfException(error, MsoExceptionCategory.USERDATA);
+ } else {
+ logger.debug(
+ "found missing parameters [" + missingParams + "] - but checkRequiredParameters is false -"
+ + " will not block");
+ }
+ } else {
+ logger.debug("No missing parameters found - ok to proceed");
+ }
} // NOTE: END PARAMETER CHECKING
@@ -1043,7 +1068,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
try {
if (! cloudifyUtils.isBlueprintLoaded (cloudSiteId, blueprintId)) {
- LOGGER.debug ("Blueprint " + blueprintId + " is not loaded. Will upload it now.");
+ logger.debug("Blueprint " + blueprintId + " is not loaded. Will upload it now.");
Map<String,byte[]> blueprintFiles = new HashMap<String,byte[]>();
@@ -1077,12 +1102,12 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
}
catch (MsoException me) {
- me.addContext ("CreateVFModule");
- String error = "Create VF Module: Upload blueprint failed. Blueprint=" + blueprintName + ": " + me;
- LOGGER.error (MessageEnum.RA_CREATE_VNF_ERR, vfModuleType, cloudSiteId, tenantId, CLOUDIFY, "", MsoLogger.ErrorCode.DataError, "MsoException - uploadBlueprint", me);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
- throw new VnfException (me);
-
+ me.addContext("CreateVFModule");
+ String error = "Create VF Module: Upload blueprint failed. Blueprint=" + blueprintName + ": " + me;
+ logger.error("{} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudSiteId,
+ tenantId, CLOUDIFY, MsoLogger.ErrorCode.DataError.getValue(), "MsoException - uploadBlueprint", me);
+ logger.debug(error);
+ throw new VnfException(me);
}
// Ignore MsoTenantNotFound and MsoStackAlreadyExists exceptions
@@ -1107,30 +1132,31 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
heatTemplate.getTimeoutMinutes (),
backout.booleanValue());
- LOGGER.recordMetricEvent (createDeploymentStarttime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, CLOUDIFY_RESPONSE_SUCCESS, CLOUDIFY, "CreateDeployment", vfModuleName);
} catch (MsoException me) {
me.addContext ("CreateVFModule");
String error = "Create VF Module " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- LOGGER.recordMetricEvent (createDeploymentStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, CLOUDIFY, "CreateDeployment", vfModuleName);
- LOGGER.error (MessageEnum.RA_CREATE_VNF_ERR, vfModuleType, cloudSiteId, tenantId, CLOUDIFY, "", MsoLogger.ErrorCode.DataError, "MsoException - createDeployment", me);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+ logger
+ .error("{} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudSiteId,
+ tenantId, CLOUDIFY, MsoLogger.ErrorCode.DataError.getValue(), "MsoException - createDeployment",
+ me);
+ logger.debug(error);
throw new VnfException (me);
} catch (NullPointerException npe) {
String error = "Create VFModule " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + npe;
- LOGGER.recordMetricEvent (createDeploymentStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, CLOUDIFY, "CreateDeployment", vfModuleName);
- LOGGER.error (MessageEnum.RA_CREATE_VNF_ERR, vfModuleType, cloudSiteId, tenantId, CLOUDIFY, "", MsoLogger.ErrorCode.DataError, "NullPointerException - createDeployment", npe);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
- LOGGER.debug("NULL POINTER EXCEPTION at cloudify.createAndInstallDeployment");
+ logger
+ .error("{} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudSiteId,
+ tenantId, CLOUDIFY, MsoLogger.ErrorCode.DataError.getValue(),
+ "NullPointerException - createDeployment", npe);
+ logger.debug(error);
+ logger.debug("NULL POINTER EXCEPTION at cloudify.createAndInstallDeployment");
//npe.addContext ("CreateVNF");
throw new VnfException ("NullPointerException during cloudify.createAndInstallDeployment");
} catch (Exception e) {
- LOGGER.recordMetricEvent (createDeploymentStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while creating deployment with Cloudify", CLOUDIFY, "CreateDeployment", vfModuleName);
- LOGGER.debug("unhandled exception at cloudify.createAndInstallDeployment");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while creating deployment with Cloudify");
+ logger.debug("unhandled exception at cloudify.createAndInstallDeployment");
throw new VnfException("Exception during cloudify.createAndInstallDeployment! " + e.getMessage());
}
} catch (Exception e) {
- LOGGER.debug("unhandled exception in create VF");
+ logger.debug("unhandled exception in create VF");
throw new VnfException("Exception during create VF " + e.getMessage());
}
@@ -1144,8 +1170,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
rollback.value = vfRollback;
- LOGGER.debug ("VF Module " + vfModuleName + " successfully created");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully create VF Module");
+ logger.debug("VF Module successfully created", vfModuleName);
return;
}
@@ -1155,8 +1180,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
MsoRequest msoRequest,
Holder <Map <String, String>> outputs) throws VnfException {
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName ("DeleteVf");
- LOGGER.debug ("Deleting VF " + vnfName + " in " + cloudSiteId + "/" + tenantId);
+ logger.debug ("Deleting VF " + vnfName + " in " + cloudSiteId + "/" + tenantId);
// Will capture execution time for metrics
long startTime = System.currentTimeMillis ();
@@ -1169,9 +1193,10 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
// Failed to query the deployment. Convert to a generic VnfException
me.addContext ("DeleteVFModule");
String error = "Delete VFModule: Query to get outputs: " + vnfName + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, CLOUDIFY, "QueryDeployment", null);
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vnfName, cloudSiteId, tenantId, CLOUDIFY, "QueryDeployment", MsoLogger.ErrorCode.DataError, "Exception - QueryDeployment", me);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudSiteId,
+ tenantId, CLOUDIFY, "QueryDeployment", MsoLogger.ErrorCode.DataError.getValue(),
+ "Exception - QueryDeployment", me);
+ logger.debug(error);
throw new VnfException (me);
}
// call method which handles the conversion from Map<String,Object> to Map<String,String> for our expected Object types
@@ -1184,19 +1209,18 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
long subStartTime = System.currentTimeMillis ();
try {
cloudifyUtils.uninstallAndDeleteDeployment(cloudSiteId, tenantId, vnfName, 5);
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from DeleteDeployment", CLOUDIFY, "DeleteDeployment", vnfName);
} catch (MsoException me) {
- me.addContext ("DeleteVfModule");
+ me.addContext("DeleteVfModule");
// Convert to a generic VnfException
String error = "Delete VF: " + vnfName + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "DeleteDeployment", "DeleteDeployment", vnfName);
- LOGGER.error (MessageEnum.RA_DELETE_VNF_ERR, vnfName, cloudSiteId, tenantId, "DeleteDeployment", "DeleteDeployment", MsoLogger.ErrorCode.DataError, "Exception - DeleteDeployment: " + me.getMessage());
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
- throw new VnfException (me);
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vnfName, cloudSiteId,
+ tenantId, "DeleteDeployment", "DeleteDeployment", MsoLogger.ErrorCode.DataError.getValue(),
+ "Exception - DeleteDeployment: " + me.getMessage());
+ logger.debug(error);
+ throw new VnfException(me);
}
// On success, nothing is returned.
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully delete VF");
return;
}
@@ -1218,8 +1242,8 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter {
Holder <VnfRollback> rollback) throws VnfException
{
// This operation is not currently supported for Cloudify-orchestrated VF Modules.
- LOGGER.debug ("Update VF Module command attempted but not supported");
+ logger.debug("Update VF Module command attempted but not supported");
throw new VnfException ("UpdateVfModule: Unsupported command", MsoExceptionCategory.USERDATA);
}
-} \ No newline at end of file
+}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java
index 13212be74a..704d54c918 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -82,6 +84,8 @@ import org.onap.so.openstack.utils.MsoHeatEnvironmentEntry;
import org.onap.so.openstack.utils.MsoHeatUtils;
import org.onap.so.openstack.utils.MsoKeystoneUtils;
import org.onap.so.openstack.utils.MsoMulticloudUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@@ -97,7 +101,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
private static final String MSO_CONFIGURATION_ERROR = "MsoConfigurationError";
- private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, MsoVnfPluginAdapterImpl.class);
+ private static Logger logger = LoggerFactory.getLogger(MsoVnfPluginAdapterImpl.class);
private static final String CHECK_REQD_PARAMS = "org.onap.so.adapters.vnf.checkRequiredParameters";
private static final ObjectMapper JSON_MAPPER = new ObjectMapper();
@@ -131,7 +135,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
*/
@Override
public void healthCheck () {
- LOGGER.debug ("Health check call in VNF Plugin Adapter");
+ logger.debug("Health check call in VNF Plugin Adapter");
}
/**
@@ -165,9 +169,9 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
Holder <VnfRollback> rollback)
throws VnfException
{
- // This operation is no longer supported at the VNF level. The adapter is only called to deploy modules.
- LOGGER.debug ("CreateVNF command attempted but not supported");
- throw new VnfException ("CreateVNF: Unsupported command", MsoExceptionCategory.USERDATA);
+ // This operation is no longer supported at the VNF level. The adapter is only called to deploy modules.
+ logger.debug("CreateVNF command attempted but not supported");
+ throw new VnfException("CreateVNF: Unsupported command", MsoExceptionCategory.USERDATA);
}
/**
@@ -190,7 +194,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
throws VnfException
{
// This operation is no longer supported at the VNF level. The adapter is only called to deploy modules.
- LOGGER.debug ("UpdateVNF command attempted but not supported");
+ logger.debug("UpdateVNF command attempted but not supported");
throw new VnfException ("UpdateVNF: Unsupported command", MsoExceptionCategory.USERDATA);
}
@@ -222,8 +226,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
throws VnfException
{
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName ("QueryVnf");
- LOGGER.debug ("Querying VNF " + vnfNameOrId + " in " + cloudSiteId + "/" + tenantId);
+ logger.debug("Querying VNF " + vnfNameOrId + " in " + cloudSiteId + "/" + tenantId);
// Will capture execution time for metrics
long startTime = System.currentTimeMillis ();
@@ -236,36 +239,34 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
try {
vduInstance = vduPlugin.queryVdu (cloudInfo, vnfNameOrId);
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received VDU Query response", "VDU", "QueryVDU", vnfNameOrId);
}
catch (VduException e) {
- // Failed to query the VDU due to a plugin exception.
- // Convert to a generic VnfException
- e.addContext ("QueryVNF");
- String error = "Query VNF (VDU): " + vnfNameOrId + " in " + cloudSiteId + "/" + tenantId + ": " + e;
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "VDU", "QueryVNF", vnfNameOrId);
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vnfNameOrId, cloudSiteId, tenantId, "VDU", "QueryVNF", MsoLogger.ErrorCode.DataError, "Exception - queryVDU", e);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
- throw new VnfException (e);
- }
+ // Failed to query the VDU due to a plugin exception.
+ // Convert to a generic VnfException
+ e.addContext("QueryVNF");
+ String error = "Query VNF (VDU): " + vnfNameOrId + " in " + cloudSiteId + "/" + tenantId + ": " + e;
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfNameOrId, cloudSiteId,
+ tenantId, "VDU", "QueryVNF", MsoLogger.ErrorCode.DataError.getValue(), "Exception - queryVDU", e);
+ logger.debug(error);
+ throw new VnfException(e);
+ }
if (vduInstance != null && vduInstance.getStatus().getState() != VduStateType.NOTFOUND) {
- vnfExists.value = Boolean.TRUE;
- status.value = vduStatusToVnfStatus(vduInstance);
- vnfId.value = vduInstance.getVduInstanceId();
- outputs.value = copyStringOutputs (vduInstance.getOutputs ());
+ vnfExists.value = Boolean.TRUE;
+ status.value = vduStatusToVnfStatus(vduInstance);
+ vnfId.value = vduInstance.getVduInstanceId();
+ outputs.value = copyStringOutputs(vduInstance.getOutputs());
- LOGGER.debug ("VNF " + vnfNameOrId + " found, ID = " + vnfId.value);
+ logger.debug("VNF {} found, ID = {}", vnfNameOrId, vnfId.value);
}
else {
- vnfExists.value = Boolean.FALSE;
- status.value = VnfStatus.NOTFOUND;
- vnfId.value = null;
- outputs.value = new HashMap <String, String> (); // Return as an empty map
+ vnfExists.value = Boolean.FALSE;
+ status.value = VnfStatus.NOTFOUND;
+ vnfId.value = null;
+ outputs.value = new HashMap<String, String>(); // Return as an empty map
- LOGGER.debug ("VNF " + vnfNameOrId + " not found");
- }
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully query VNF");
+ logger.debug("VNF {} not found", vnfNameOrId);
+ }
return;
}
@@ -281,10 +282,9 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
String vnfName,
MsoRequest msoRequest) throws VnfException {
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName ("DeleteVnf");
// This operation is no longer supported at the VNF level. The adapter is only called to deploy modules.
- LOGGER.debug ("DeleteVNF command attempted but not supported");
+ logger.debug("DeleteVNF command attempted but not supported");
throw new VnfException ("DeleteVNF: Unsupported command", MsoExceptionCategory.USERDATA);
}
@@ -300,17 +300,15 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
@Override
public void rollbackVnf (VnfRollback rollback) throws VnfException {
long startTime = System.currentTimeMillis ();
- MsoLogger.setServiceName ("RollbackVnf");
// rollback may be null (e.g. if stack already existed when Create was called)
if (rollback == null) {
- LOGGER.info (MessageEnum.RA_ROLLBACK_NULL, "OpenStack", "rollbackVnf", MsoLogger.getServiceName());
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.BadRequest, "Rollback request content is null");
+ logger.info("{} {} {} {}", MessageEnum.RA_ROLLBACK_NULL.toString(), "OpenStack", "rollbackVnf",
+ MsoLogger.getServiceName());
return;
}
// Don't rollback if nothing was done originally
if (!rollback.getVnfCreated()) {
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Rollback VF Module - nothing to roll back");
return;
}
@@ -323,7 +321,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
MsoLogger.setLogContext (rollback.getMsoRequest());
- LOGGER.debug ("Rolling Back VF Module " + vfModuleId + " in " + cloudSiteId + "/" + tenantId);
+ logger.debug("Rolling Back VF Module " + vfModuleId + " in " + cloudSiteId + "/" + tenantId);
VduInstance vduInstance = null;
@@ -335,20 +333,18 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
// TODO: Get a reasonable timeout. Use a global property, or store the creation timeout in rollback object and use that.
vduInstance = vduPlugin.deleteVdu(cloudInfo, vfModuleId, 5);
- LOGGER.debug("Rolled back VDU instantiation: " + vduInstance.getVduInstanceId());
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from VDU Plugin", "VDU", "DeleteVdu", null);
+ logger.debug("Rolled back VDU instantiation: {}", vduInstance.getVduInstanceId());
}
catch (VduException ve) {
// Failed to rollback the VF Module due to a plugin exception.
// Convert to a generic VnfException
ve.addContext ("RollbackVFModule");
String error = "Rollback VF Module: " + vfModuleId + " in " + cloudSiteId + "/" + tenantId + ": " + ve;
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "VDU", "DeleteVdu", null);
- LOGGER.error (MessageEnum.RA_DELETE_VNF_ERR, vfModuleId, cloudSiteId, tenantId, "VDU", "DeleteVdu", MsoLogger.ErrorCode.DataError, "Exception - DeleteVdu", ve);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vfModuleId, cloudSiteId,
+ tenantId, "VDU", "DeleteVdu", MsoLogger.ErrorCode.DataError.getValue(), "Exception - DeleteVdu", ve);
+ logger.debug(error);
throw new VnfException (ve);
}
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully roll back VF Module");
return;
}
@@ -382,14 +378,14 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
private Object convertInputValue (Object inputValue, HeatTemplateParam templateParam)
{
String type = templateParam.getParamType();
- LOGGER.debug("Parameter: " + templateParam.getParamName() + " is of type " + type);
+ logger.debug("Parameter: {} is of type ", templateParam.getParamName(), type);
if (type.equalsIgnoreCase("number")) {
try {
return Integer.valueOf(inputValue.toString());
}
catch (Exception e) {
- LOGGER.debug("Unable to convert " + inputValue + " to an integer!" , e);
+ logger.debug("Unable to convert " + inputValue + " to an integer!" , e);
return null;
}
} else if (type.equalsIgnoreCase("json")) {
@@ -398,7 +394,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
return jsonNode;
}
catch (Exception e) {
- LOGGER.debug("Unable to convert " + inputValue + " to a JsonNode!", e);
+ logger.debug("Unable to convert " + inputValue + " to a JsonNode!", e);
return null;
}
} else if (type.equalsIgnoreCase("boolean")) {
@@ -419,29 +415,30 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
String str = "" + stackOutputs.get(key);
stringOutputs.put(key, str);
} catch (Exception e) {
- LOGGER.debug("Unable to add " + key + " to outputs", e);
+ logger.debug("Unable to add " + key + " to outputs", e);
}
} else if (stackOutputs.get(key) instanceof JsonNode) {
try {
String str = this.convertNode((JsonNode) stackOutputs.get(key));
stringOutputs.put(key, str);
} catch (Exception e) {
- LOGGER.debug("Unable to add " + key + " to outputs - exception converting JsonNode", e);
+ logger.debug("Unable to add " + key + " to outputs - exception converting JsonNode", e);
}
} else if (stackOutputs.get(key) instanceof java.util.LinkedHashMap) {
try {
String str = JSON_MAPPER.writeValueAsString(stackOutputs.get(key));
stringOutputs.put(key, str);
} catch (Exception e) {
- LOGGER.debug("Unable to add " + key + " to outputs - exception converting LinkedHashMap", e);
- }
+ logger.debug("Unable to add " + key + " to outputs - exception converting LinkedHashMap", e);
+ }
} else {
try {
String str = stackOutputs.get(key).toString();
stringOutputs.put(key, str);
} catch (Exception e) {
- LOGGER.debug("Unable to add " + key + " to outputs - unable to call .toString() " + e.getMessage(), e);
- }
+ logger
+ .debug("Unable to add " + key + " to outputs - unable to call .toString() " + e.getMessage(), e);
+ }
}
}
return stringOutputs;
@@ -467,7 +464,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
sb.append("\t\nitem " + i++ + ": '" + str + "'='" + outputString + "'");
}
}
- LOGGER.debug(sb.toString());
+ logger.debug(sb.toString());
return;
}
@@ -484,7 +481,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
sb.append("\titem " + i++ + ": " + str + "=" + inputs.get(str));
}
}
- LOGGER.debug(sb.toString());
+ logger.debug(sb.toString());
return;
}
@@ -494,9 +491,9 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
final String json = JSON_MAPPER.writeValueAsString(obj);
return json;
} catch (JsonParseException jpe) {
- LOGGER.debug("Error converting json to string " + jpe.getMessage());
+ logger.debug("Error converting json to string " + jpe.getMessage());
} catch (Exception e) {
- LOGGER.debug("Error converting json to string " + e.getMessage());
+ logger.debug("Error converting json to string " + e.getMessage());
}
return "[Error converting json to string]";
}
@@ -518,30 +515,30 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
String str = this.convertNode((JsonNode) obj);
stringMap.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for JsonNode "+ key, e);
+ logger.debug("DANGER WILL ROBINSON: unable to convert value for JsonNode "+ key, e);
//okay in this instance - only string values (fqdn) are expected to be needed
}
} else if (obj instanceof java.util.LinkedHashMap) {
- LOGGER.debug("LinkedHashMap - this is showing up as a LinkedHashMap instead of JsonNode");
+ logger.debug("LinkedHashMap - this is showing up as a LinkedHashMap instead of JsonNode");
try {
String str = JSON_MAPPER.writeValueAsString(obj);
stringMap.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for LinkedHashMap "+ key, e);
+ logger.debug("DANGER WILL ROBINSON: unable to convert value for LinkedHashMap "+ key, e);
}
} else if (obj instanceof Integer) {
try {
String str = "" + obj;
stringMap.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for Integer "+ key, e);
+ logger.debug("DANGER WILL ROBINSON: unable to convert value for Integer "+ key, e);
}
} else {
try {
String str = obj.toString();
stringMap.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value "+ key + " (" + e.getMessage() + ")", e);
+ logger.debug("DANGER WILL ROBINSON: unable to convert value "+ key + " (" + e.getMessage() + ")", e);
}
}
}
@@ -622,15 +619,15 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
long startTime = System.currentTimeMillis ();
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName ("CreateVfModule");
// Require a model customization ID. Every VF Module definition must have one.
if (modelCustomizationUuid == null || modelCustomizationUuid.isEmpty()) {
- LOGGER.debug("Missing required input: modelCustomizationUuid");
- String error = "Create vfModule error: Missing required input: modelCustomizationUuid";
- LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM,
- "VF Module ModelCustomizationUuid", "null", "VDU", "", MsoLogger.ErrorCode.DataError, "Create VF Module: Missing required input: modelCustomizationUuid");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+ logger.debug("Missing required input: modelCustomizationUuid");
+ String error = "Create vfModule error: Missing required input: modelCustomizationUuid";
+ logger.error("{} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(),
+ "VF Module ModelCustomizationUuid", "VDU", MsoLogger.ErrorCode.DataError,
+ "Create VF Module: " + "Missing required input: modelCustomizationUuid");
+ logger.debug(error);
throw new VnfException(error, MsoExceptionCategory.USERDATA);
}
@@ -647,7 +644,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
if (inputs == null) {
// Create an empty set of inputs
inputs = new HashMap<>();
- LOGGER.debug("inputs == null - setting to empty");
+ logger.debug("inputs == null - setting to empty");
} else {
this.sendMapToDebug(inputs);
}
@@ -658,7 +655,8 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
isVolumeRequest = true;
}
- LOGGER.debug("requestType = " + requestType + ", volumeGroupStackId = " + volumeGroupId + ", baseStackId = " + baseVfModuleId);
+ logger.debug("requestType = " + requestType + ", volumeGroupStackId = " + volumeGroupId + ", baseStackId = " +
+ baseVfModuleId);
// Build a default rollback object (no actions performed)
VnfRollback vfRollback = new VnfRollback();
@@ -682,17 +680,18 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
VfModuleCustomization vfModuleCust = null;
try {
- vfModuleCust = vfModuleCustomRepo.findByModelCustomizationUUID(modelCustomizationUuid);
+ vfModuleCust = vfModuleCustomRepo.findByModelCustomizationUUID(modelCustomizationUuid);
if (vfModuleCust == null) {
- String error = "Create vfModule error: Unable to find vfModuleCust with modelCustomizationUuid=" + modelCustomizationUuid;
- LOGGER.debug(error);
- LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM,
- "VF Module ModelCustomizationUuid", modelCustomizationUuid, "CatalogDb", "", MsoLogger.ErrorCode.DataError, error);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
+ String error = "Create vfModule error: Unable to find vfModuleCust with modelCustomizationUuid="
+ + modelCustomizationUuid;
+ logger.debug(error);
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(),
+ "VF Module ModelCustomizationUuid", modelCustomizationUuid, "CatalogDb",
+ MsoLogger.ErrorCode.DataError, error);
throw new VnfException(error, MsoExceptionCategory.USERDATA);
} else {
- LOGGER.debug("Found vfModuleCust entry " + vfModuleCust.toString());
+ logger.debug("Found vfModuleCust entry {}", vfModuleCust.toString());
}
// Get the vfModule and vnfResource records
@@ -701,7 +700,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
}
catch (Exception e) {
- LOGGER.debug("unhandled exception in create VF - [Query]" + e.getMessage());
+ logger.debug("unhandled exception in create VF - [Query]" + e.getMessage());
throw new VnfException("Exception during create VF " + e.getMessage());
}
@@ -719,16 +718,19 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
String vnfMin = vnfResource.getAicVersionMin();
String vnfMax = vnfResource.getAicVersionMax();
- if ( (vnfMin != null && !(aicV.isMoreRecentThan(vnfMin) || aicV.isTheSameVersion(vnfMin))) ||
- (vnfMax != null && aicV.isMoreRecentThan(vnfMax)))
- {
- // ERROR
- String error = "VNF Resource type: " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUUID() + " VersionMin=" + vnfMin + " VersionMax:" + vnfMax + " NOT supported on Cloud: " + cloudSiteId + " with AIC_Version:" + cloudSite.getCloudVersion();
- LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - setVersion");
- LOGGER.debug(error);
- throw new VnfException(error, MsoExceptionCategory.USERDATA);
- }
- // End Version check
+ if ((vnfMin != null && !(aicV.isMoreRecentThan(vnfMin) || aicV.isTheSameVersion(vnfMin))) || (vnfMax != null
+ && aicV.isMoreRecentThan(vnfMax))) {
+ // ERROR
+ String error =
+ "VNF Resource type: " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUUID()
+ + " VersionMin=" + vnfMin + " VersionMax:" + vnfMax + " NOT supported on Cloud: " + cloudSiteId
+ + " with AIC_Version:" + cloudSite.getCloudVersion();
+ logger.error("{} {} {} {} {}", MessageEnum.RA_CONFIG_EXC.toString(), error, "OpenStack",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception - setVersion");
+ logger.debug(error);
+ throw new VnfException(error, MsoExceptionCategory.USERDATA);
+ }
+ // End Version check
VduInstance vduInstance = null;
@@ -743,15 +745,14 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
if (!usingMulticloud) {
try {
vduInstance = vduPlugin.queryVdu (cloudInfo, vfModuleName);
- LOGGER.recordMetricEvent (subStartTime1, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from VduPlugin", "VDU", "QueryVDU", vfModuleName);
}
catch (VduException me) {
// Failed to query the VDU due to a plugin exception.
String error = "Create VF Module: Query " + vfModuleName + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vfModuleName, cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError, "Exception - queryVdu", me);
- LOGGER.recordMetricEvent (subStartTime1, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "VDU", "QueryVdu", vfModuleName);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName,
+ cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError.getValue(),
+ "Exception - queryVdu", me);
+ logger.debug(error);
// Convert to a generic VnfException
me.addContext ("CreateVFModule");
throw new VnfException (me);
@@ -761,54 +762,70 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
// More precise handling/messaging if the Module already exists
if (vduInstance != null && !(vduInstance.getStatus().getState() == VduStateType.NOTFOUND)) {
VduStateType status = vduInstance.getStatus().getState();
- LOGGER.debug ("Found Existing VDU, status=" + status);
-
- if (status == VduStateType.INSTANTIATED) {
- if (failIfExists != null && failIfExists) {
- // fail - it exists
- String error = "Create VF: Deployment " + vfModuleName + " already exists in " + cloudSiteId + "/" + tenantId;
- LOGGER.error (MessageEnum.RA_VNF_ALREADY_EXIST, vfModuleName, cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError, "VF Module " + vfModuleName + " already exists");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
- throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
- } else {
- // Found existing deployment and client has not requested "failIfExists".
- // Populate the outputs from the existing deployment.
-
- vnfId.value = vduInstance.getVduInstanceId();
- outputs.value = copyStringOutputs (vduInstance.getOutputs ());
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully create VF Module (found existing)");
+ logger.debug("Found Existing VDU, status=" + status);
+
+ if (status == VduStateType.INSTANTIATED) {
+ if (failIfExists != null && failIfExists) {
+ // fail - it exists
+ String error =
+ "Create VF: Deployment " + vfModuleName + " already exists in " + cloudSiteId + "/" + tenantId;
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError.getValue(),
+ "VF Module " + vfModuleName + " already exists");
+ logger.debug(error);
+ throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
+ } else {
+ // Found existing deployment and client has not requested "failIfExists".
+ // Populate the outputs from the existing deployment.
+
+ vnfId.value = vduInstance.getVduInstanceId();
+ outputs.value = copyStringOutputs(vduInstance.getOutputs());
return;
- }
- }
- // Check through various detailed error cases
- else if (status == VduStateType.INSTANTIATING || status == VduStateType.DELETING || status == VduStateType.UPDATING) {
- // fail - it's in progress - return meaningful error
- String error = "Create VF: Deployment " + vfModuleName + " already exists and has status " + status.toString() + " in " + cloudSiteId + "/" + tenantId + "; please wait for it to complete, or fix manually.";
- LOGGER.error (MessageEnum.RA_VNF_ALREADY_EXIST, vfModuleName, cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError, "VF Module " + vfModuleName + " already exists");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
- throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
- }
- else if (status == VduStateType.FAILED) {
- // fail - it exists and is in a FAILED state
- String error = "Create VF: Deployment " + vfModuleName + " already exists and is in FAILED state in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
- LOGGER.error (MessageEnum.RA_VNF_ALREADY_EXIST, vfModuleName, cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError, "VF Module " + vfModuleName + " already exists and is in FAILED state");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
- throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
- }
- else if (status == VduStateType.UNKNOWN) {
- // fail - it exists and is in a UNKNOWN state
- String error = "Create VF: Deployment " + vfModuleName + " already exists and has status " + status.toString() + " in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
- LOGGER.error (MessageEnum.RA_VNF_ALREADY_EXIST, vfModuleName, cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError, "VF Module " + vfModuleName + " already exists and is in " + status.toString() + " state");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
- throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
- }
- else {
- // Unexpected, since all known status values have been tested for
- String error = "Create VF: Deployment " + vfModuleName + " already exists with unexpected status " + status.toString() + " in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
- LOGGER.error (MessageEnum.RA_VNF_ALREADY_EXIST, vfModuleName, cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError, "VF Module " + vfModuleName + " already exists and is in an unknown state");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
- throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
- }
+ }
+ }
+ // Check through various detailed error cases
+ else if (status == VduStateType.INSTANTIATING || status == VduStateType.DELETING
+ || status == VduStateType.UPDATING) {
+ // fail - it's in progress - return meaningful error
+ String error =
+ "Create VF: Deployment " + vfModuleName + " already exists and has status " + status.toString()
+ + " in " + cloudSiteId + "/" + tenantId + "; please wait for it to complete, or fix manually.";
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError.getValue(),
+ "VF Module " + vfModuleName + " already exists");
+ logger.debug(error);
+ throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
+ } else if (status == VduStateType.FAILED) {
+ // fail - it exists and is in a FAILED state
+ String error =
+ "Create VF: Deployment " + vfModuleName + " already exists and is in FAILED state in " + cloudSiteId
+ + "/" + tenantId + "; requires manual intervention.";
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError.getValue(),
+ "VF Module " + vfModuleName + " already exists and is in FAILED state");
+ logger.debug(error);
+ throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
+ } else if (status == VduStateType.UNKNOWN) {
+ // fail - it exists and is in a UNKNOWN state
+ String error =
+ "Create VF: Deployment " + vfModuleName + " already exists and has status " + status.toString()
+ + " in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError.getValue(),
+ "VF Module " + vfModuleName + " already exists and is in " + status.toString() + " state");
+ logger.debug(error);
+ throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
+ } else {
+ // Unexpected, since all known status values have been tested for
+ String error =
+ "Create VF: Deployment " + vfModuleName + " already exists with unexpected status " + status
+ .toString() + " in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudSiteId, tenantId, "VDU", "queryVdu", MsoLogger.ErrorCode.DataError.getValue(),
+ "VF Module " + vfModuleName + " already exists and is in an unknown state");
+ logger.debug(error);
+ throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
+ }
}
@@ -822,15 +839,14 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
VduInstance volumeVdu = null;
try {
volumeVdu = vduPlugin.queryVdu (cloudInfo, volumeGroupId);
- LOGGER.recordMetricEvent (subStartTime2, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Success response from VduPlugin", "VDU", "QueryVdu", volumeGroupId);
}
catch (VduException me) {
// Failed to query the Volume Group VDU due to a plugin exception.
String error = "Create VF Module: Query Volume Group " + volumeGroupId + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, volumeGroupId, cloudSiteId, tenantId, "VDU", "queryVdu(volume)", MsoLogger.ErrorCode.DataError, "Exception - queryVdu(volume)", me);
- LOGGER.recordMetricEvent (subStartTime2, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "VDU", "QueryVdu(volume)", volumeGroupId);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId,
+ cloudSiteId, tenantId, "VDU", "queryVdu(volume)", MsoLogger.ErrorCode.DataError.getValue(),
+ "Exception - queryVdu(volume)", me);
+ logger.debug(error);
// Convert to a generic VnfException
me.addContext ("CreateVFModule(QueryVolume)");
throw new VnfException (me);
@@ -838,12 +854,14 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
if (volumeVdu == null || volumeVdu.getStatus().getState() == VduStateType.NOTFOUND) {
String error = "Create VFModule: Attached Volume Group DOES NOT EXIST " + volumeGroupId + " in " + cloudSiteId + "/" + tenantId + " USER ERROR" ;
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, volumeGroupId, cloudSiteId, tenantId, error, "VDU", "queryVdu(volume)", MsoLogger.ErrorCode.BusinessProcesssError, "Create VFModule: Attached Volume Group DOES NOT EXIST");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
- LOGGER.debug(error);
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId,
+ cloudSiteId, tenantId, error, "VDU", "queryVdu(volume)",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+ "Create VFModule: Attached Volume Group " + "DOES NOT EXIST");
+ logger.debug(error);
throw new VnfException (error, MsoExceptionCategory.USERDATA);
} else {
- LOGGER.debug("Found nested volume group");
+ logger.debug("Found nested volume group");
volumeGroupOutputs = volumeVdu.getOutputs();
this.sendMapToDebug(volumeGroupOutputs, "volumeGroupOutputs");
}
@@ -854,15 +872,15 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
// Add-On Volume Group or Add-On VF Module
if (vfModule.getIsBase()) {
- LOGGER.debug("This is a BASE Module request");
+ logger.debug("This is a BASE Module request");
vfRollback.setIsBase(true);
} else {
- LOGGER.debug("This is an Add-On Module request");
+ logger.debug("This is an Add-On Module request");
// Add-On Modules should always have a Base, but just treat as a warning if not provided.
// Add-on Volume requests may or may not specify a base.
if (!isVolumeRequest && baseVfModuleId == null) {
- LOGGER.debug ("WARNING: Add-on Module request - no Base Module ID provided");
+ logger.debug("WARNING: Add-on Module request - no Base Module ID provided");
}
// Need to verify if multicloud needs to have the vaseVfModuleId passed to it. Ignoring this for now.
@@ -871,31 +889,34 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
VduInstance baseVdu = null;
try {
baseVdu = vduPlugin.queryVdu (cloudInfo, baseVfModuleId);
- LOGGER.recordMetricEvent (subStartTime2, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Success response from VduPlugin", "VDU", "QueryVdu(Base)", baseVfModuleId);
}
catch (MsoException me) {
// Failed to query the Base VF Module due to a Vdu Plugin exception.
String error = "Create VF Module: Query Base " + baseVfModuleId + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, baseVfModuleId, cloudSiteId, tenantId, "VDU", "queryVdu(Base)", MsoLogger.ErrorCode.DataError, "Exception - queryVdu(Base)", me);
- LOGGER.recordMetricEvent (subStartTime2, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "VDU", "QueryVdu(Base)", baseVfModuleId);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
-
- // Convert to a generic VnfException
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId,
+ cloudSiteId, tenantId, "VDU", "queryVdu(Base)", MsoLogger.ErrorCode.DataError.getValue(),
+ "Exception - queryVdu(Base)", me);
+ logger.debug(error);
+ // Convert to a generic VnfException
me.addContext ("CreateVFModule(QueryBase)");
throw new VnfException (me);
}
- if (baseVdu == null || baseVdu.getStatus().getState() == VduStateType.NOTFOUND) {
- String error = "Create VFModule: Base Module DOES NOT EXIST " + baseVfModuleId + " in " + cloudSiteId + "/" + tenantId + " USER ERROR" ;
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, baseVfModuleId, cloudSiteId, tenantId, error, "VDU", "queryVdu(Base)", MsoLogger.ErrorCode.BusinessProcesssError, "Create VFModule: Base Module DOES NOT EXIST");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, error);
- LOGGER.debug(error);
- throw new VnfException (error, MsoExceptionCategory.USERDATA);
- } else {
- LOGGER.debug("Found base module");
- baseModuleOutputs = baseVdu.getOutputs();
- this.sendMapToDebug(baseModuleOutputs, "baseModuleOutputs");
- }
+ if (baseVdu == null || baseVdu.getStatus().getState() == VduStateType.NOTFOUND) {
+ String error =
+ "Create VFModule: Base Module DOES NOT EXIST " + baseVfModuleId + " in " + cloudSiteId + "/"
+ + tenantId + " USER ERROR";
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId,
+ cloudSiteId, tenantId, error, "VDU", "queryVdu(Base)",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+ "Create VFModule: Base Module DOES NOT EXIST");
+ logger.debug(error);
+ throw new VnfException(error, MsoExceptionCategory.USERDATA);
+ } else {
+ logger.debug("Found base module");
+ baseModuleOutputs = baseVdu.getOutputs();
+ this.sendMapToDebug(baseModuleOutputs, "baseModuleOutputs");
+ }
}
}
@@ -917,21 +938,23 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
}
if (heatTemplate == null) {
- String error = "UpdateVF: No Heat Template ID defined in catalog database for " + vfModuleType + ", reqType=" + requestType;
- LOGGER.error(MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Template ID", vfModuleType, "VNF", "", MsoLogger.ErrorCode.DataError, error);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
- throw new VnfException(error, MsoExceptionCategory.INTERNAL);
- } else {
- LOGGER.debug ("Got HEAT Template from DB: " + heatTemplate.getHeatTemplate());
- }
+ String error = "UpdateVF: No Heat Template ID defined in catalog database for " + vfModuleType + ", reqType="
+ + requestType;
+ logger.error("{} {} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Template ID", vfModuleType,
+ "VNF", MsoLogger.ErrorCode.DataError.getValue(), error);
+ logger.debug(error);
+ throw new VnfException(error, MsoExceptionCategory.INTERNAL);
+ } else {
+ logger.debug("Got HEAT Template from DB: " + heatTemplate.getHeatTemplate());
+ }
if (heatEnvironment == null) {
- String error = "Update VNF: undefined Heat Environment. VF=" + vfModuleType;
- LOGGER.error (MessageEnum.RA_VNF_UNKNOWN_PARAM, "Heat Environment ID", "OpenStack", "", MsoLogger.ErrorCode.DataError, error);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, error);
- throw new VnfException (error, MsoExceptionCategory.INTERNAL);
+ String error = "Update VNF: undefined Heat Environment. VF=" + vfModuleType;
+ logger.error("{} {} {} {} {}", MessageEnum.RA_VNF_UNKNOWN_PARAM.toString(), "Heat Environment ID",
+ "OpenStack", MsoLogger.ErrorCode.DataError.getValue(), error);
+ throw new VnfException(error, MsoExceptionCategory.INTERNAL);
} else {
- LOGGER.debug ("Got Heat Environment from DB: " + heatEnvironment.getEnvironment());
+ logger.debug("Got Heat Environment from DB: " + heatEnvironment.getEnvironment());
}
@@ -954,7 +977,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
HashMap<String, HeatTemplateParam> params = new HashMap<String, HeatTemplateParam>();
Set<HeatTemplateParam> paramSet = heatTemplate.getParameters();
- LOGGER.debug("paramSet has " + paramSet.size() + " entries");
+ logger.debug("paramSet has " + paramSet.size() + " entries");
for (HeatTemplateParam htp : paramSet) {
params.put(htp.getParamName(), htp);
@@ -974,7 +997,8 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
goldenInputs.put(key, value);
}
else {
- LOGGER.debug("Failed to convert input " + key + "='" + inputs.get(key) + "' to " + params.get(key).getParamType());
+ logger.debug("Failed to convert input " + key + "='" + inputs.get(key) + "' to " + params.get(key)
+ .getParamType());
}
} else {
extraInputs.add(key);
@@ -994,7 +1018,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
}
}
}
- LOGGER.debug("Ignoring extra inputs: " + extraInputs);
+ logger.debug("Ignoring extra inputs: " + extraInputs);
}
// Next add in Volume Group Outputs if there are any. Copy directly without conversions.
@@ -1028,12 +1052,13 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
String propertyString = this.environment.getProperty(MsoVnfPluginAdapterImpl.CHECK_REQD_PARAMS);
if ("false".equalsIgnoreCase (propertyString) || "n".equalsIgnoreCase (propertyString)) {
checkRequiredParameters = false;
- LOGGER.debug ("CheckRequiredParameters is FALSE. Will still check but then skip blocking..."
+ logger.debug("CheckRequiredParameters is FALSE. Will still check but then skip blocking..."
+ MsoVnfPluginAdapterImpl.CHECK_REQD_PARAMS);
}
} catch (Exception e) {
// No problem - default is true
- LOGGER.debug ("An exception occured trying to get property " + MsoVnfPluginAdapterImpl.CHECK_REQD_PARAMS, e);
+ logger.debug ("An exception occured trying to get property " + MsoVnfPluginAdapterImpl.CHECK_REQD_PARAMS,
+ e);
}
// Do the actual parameter checking.
@@ -1046,10 +1071,10 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
for (HeatTemplateParam parm : heatTemplate.getParameters ()) {
if (parm.isRequired () && (!goldenInputs.containsKey (parm.getParamName ()))) {
if (mhee != null && mhee.containsParameter(parm.getParamName())) {
- LOGGER.debug ("Required parameter " + 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("adding to missing parameters list: " + parm.getParamName ());
if (missingParams == null) {
missingParams = parm.getParamName ();
} else {
@@ -1059,19 +1084,22 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
}
}
- 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, "VDU", "", 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 [" + missingParams + "] - but checkRequiredParameters is false - will not block");
- }
+ 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.toString(), missingParams, "VDU",
+ MsoLogger.ErrorCode.DataError.getValue(), "Create VFModule: Missing Required inputs");
+ logger.debug(error);
+ throw new VnfException(error, MsoExceptionCategory.USERDATA);
} else {
- LOGGER.debug ("No missing parameters found - ok to proceed");
+ logger.debug(
+ "found missing parameters [" + missingParams + "] - but checkRequiredParameters is false - "
+ + "will not block");
}
+ } else {
+ logger.debug("No missing parameters found - ok to proceed");
+ }
} // NOTE: END PARAMETER CHECKING
@@ -1080,45 +1108,41 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
long instantiateVduStartTime = System.currentTimeMillis ();
if (backout == null) backout = true;
- try {
- // Construct the VDU Model structure to pass to the targeted VduPlugin
- VduModelInfo vduModel = null;
- if (! isVolumeRequest) {
- vduModel = vduMapper.mapVfModuleCustomizationToVdu(vfModuleCust);
- } else {
- vduModel = vduMapper.mapVfModuleCustVolumeToVdu(vfModuleCust);
- }
+ try {
+ // Construct the VDU Model structure to pass to the targeted VduPlugin
+ VduModelInfo vduModel = null;
+ if (!isVolumeRequest) {
+ vduModel = vduMapper.mapVfModuleCustomizationToVdu(vfModuleCust);
+ } else {
+ vduModel = vduMapper.mapVfModuleCustVolumeToVdu(vfModuleCust);
+ }
- // Invoke the VduPlugin to instantiate the VF Module
- vduInstance = vduPlugin.instantiateVdu(cloudInfo, vfModuleName, goldenInputs, vduModel, backout);
+ // Invoke the VduPlugin to instantiate the VF Module
+ vduInstance = vduPlugin.instantiateVdu(cloudInfo, vfModuleName, goldenInputs, vduModel, backout);
- LOGGER.recordMetricEvent (instantiateVduStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from VduPlugin", "VDU", "instantiateVdu", vfModuleName);
- }
- catch (VduException me) {
+ } catch (VduException me) {
// Failed to instantiate the VDU.
- me.addContext ("CreateVFModule");
+ me.addContext("CreateVFModule");
String error = "Create VF Module " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- LOGGER.recordMetricEvent (instantiateVduStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "VDU", "instantiateVdu", vfModuleName);
- LOGGER.error (MessageEnum.RA_CREATE_VNF_ERR, vfModuleType, cloudSiteId, tenantId, "VDU", "", MsoLogger.ErrorCode.DataError, "MsoException - instantiateVdu", me);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+ logger.error("{} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudSiteId,
+ tenantId, "VDU", MsoLogger.ErrorCode.DataError.getValue(), "MsoException - instantiateVdu", me);
+ logger.debug(error);
// Convert to a generic VnfException
- throw new VnfException (me);
+ throw new VnfException(me);
+ } catch (NullPointerException npe) {
+ String error = "Create VFModule " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + npe;
+ logger.error("{} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudSiteId,
+ tenantId, "VDU", MsoLogger.ErrorCode.DataError.getValue(), "NullPointerException - instantiateVdu",
+ npe);
+ logger.debug(error);
+ logger.debug("NULL POINTER EXCEPTION at vduPlugin.instantiateVdu", npe);
+ throw new VnfException("NullPointerException during instantiateVdu");
+ } catch (Exception e) {
+ String error = "Create VFModule " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + e;
+ logger.debug("Unhandled exception at vduPlugin.instantiateVdu", e);
+ logger.debug(error);
+ throw new VnfException("Exception during instantiateVdu: " + e.getMessage());
}
- catch (NullPointerException npe) {
- String error = "Create VFModule " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + npe;
- LOGGER.recordMetricEvent (instantiateVduStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error, "VDU", "instantiateVdu", vfModuleName);
- LOGGER.error (MessageEnum.RA_CREATE_VNF_ERR, vfModuleType, cloudSiteId, tenantId, "VDU", "", MsoLogger.ErrorCode.DataError, "NullPointerException - instantiateVdu", npe);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, error);
- LOGGER.debug("NULL POINTER EXCEPTION at vduPlugin.instantiateVdu", npe);
- throw new VnfException ("NullPointerException during instantiateVdu");
- }
- catch (Exception e) {
- String error = "Create VFModule " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + e;
- LOGGER.recordMetricEvent (instantiateVduStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.UnknownError, error, "VDU", "instantiateVdu", vfModuleName);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.UnknownError, error);
- LOGGER.debug("Unhandled exception at vduPlugin.instantiateVdu", e);
- throw new VnfException("Exception during instantiateVdu: " + e.getMessage());
- }
// Reach this point if create is successful.
@@ -1130,8 +1154,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
rollback.value = vfRollback;
- LOGGER.debug ("VF Module " + vfModuleName + " successfully created");
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully create VF Module");
+ logger.debug("VF Module " + vfModuleName + " successfully created");
return;
}
@@ -1143,9 +1166,8 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
Holder <Map <String, String>> outputs) throws VnfException
{
MsoLogger.setLogContext (msoRequest);
- MsoLogger.setServiceName ("DeleteVfModule");
- LOGGER.debug ("Deleting VF Module " + vfModuleId + " in " + cloudSiteId + "/" + tenantId);
+ logger.debug("Deleting VF Module " + vfModuleId + " in " + cloudSiteId + "/" + tenantId);
// Will capture execution time for metrics
long startTime = System.currentTimeMillis ();
@@ -1158,18 +1180,17 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
try {
vduInstance = vduPlugin.queryVdu (cloudInfo, vfModuleId);
- LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received VDU Query response", "VDU", "QueryVDU", vfModuleId);
}
catch (VduException e) {
- // Failed to query the VDU due to a plugin exception.
- // Convert to a generic VnfException
- e.addContext ("QueryVFModule");
- String error = "Query VfModule (VDU): " + vfModuleId + " in " + cloudSiteId + "/" + tenantId + ": " + e;
- LOGGER.recordMetricEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "VDU", "QueryVNF", vfModuleId);
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vfModuleId, cloudSiteId, tenantId, "VDU", "QueryVFModule", MsoLogger.ErrorCode.DataError, "Exception - queryVDU", e);
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
- throw new VnfException (e);
- }
+ // Failed to query the VDU due to a plugin exception.
+ // Convert to a generic VnfException
+ e.addContext("QueryVFModule");
+ String error = "Query VfModule (VDU): " + vfModuleId + " in " + cloudSiteId + "/" + tenantId + ": " + e;
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleId, cloudSiteId,
+ tenantId, "VDU", "QueryVFModule", MsoLogger.ErrorCode.DataError.getValue(), "Exception - queryVDU", e);
+ logger.debug(error);
+ throw new VnfException(e);
+ }
// call method which handles the conversion from Map<String,Object> to Map<String,String> for our expected Object types
outputs.value = convertMapStringObjectToStringString(vduInstance.getOutputs());
@@ -1184,19 +1205,18 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
try {
// TODO: Get an appropriate timeout value - require access to the model
vduPlugin.deleteVdu(cloudInfo, vfModuleId, 5);
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from deleteVdu", "VDU", "DeleteVdu", vfModuleId);
} catch (VduException me) {
me.addContext ("DeleteVfModule");
// Convert to a generic VnfException
String error = "Delete VF: " + vfModuleId + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- LOGGER.recordMetricEvent (subStartTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error, "DeleteVdu", "DeleteVdu", vfModuleId);
- LOGGER.error (MessageEnum.RA_DELETE_VNF_ERR, vfModuleId, cloudSiteId, tenantId, "VDU", "DeleteVdu", MsoLogger.ErrorCode.DataError, "Exception - DeleteVdu: " + me.getMessage());
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, error);
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vfModuleId, cloudSiteId,
+ tenantId, "VDU", "DeleteVdu", MsoLogger.ErrorCode.DataError.getValue(),
+ "Exception - DeleteVdu: " + me.getMessage());
+ logger.debug(error);
throw new VnfException (me);
}
// On success, nothing is returned.
- LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully delete VF");
return;
}
@@ -1218,8 +1238,8 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
Holder <VnfRollback> rollback) throws VnfException
{
// This operation is not currently supported for VduPlugin-orchestrated VF Modules.
- LOGGER.debug ("Update VF Module command attempted but not supported");
- throw new VnfException ("UpdateVfModule: Unsupported command", MsoExceptionCategory.USERDATA);
+ logger.debug("Update VF Module command attempted but not supported");
+ throw new VnfException ("UpdateVfModule: Unsupported command", MsoExceptionCategory.USERDATA);
}
/*
@@ -1240,7 +1260,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
return heatUtils;
}
if (orchestrator.equalsIgnoreCase("MULTICLOUD")) {
- LOGGER.debug ("Got MulticloudUtils for vduPlugin");
+ logger.debug ("Got MulticloudUtils for vduPlugin");
return multicloudUtils; }
}
// Default - return HEAT plugin, though will fail later
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java
index ef2073839a..1a114067c3 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRest.java
@@ -6,6 +6,7 @@
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
* Modifications Copyright (C) 2018 IBM.
+ * Modifications Copyright (c) 2019 Samsung
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -60,6 +61,8 @@ import org.onap.so.logger.MsoLogger;
import org.onap.so.openstack.beans.VnfRollback;
import org.onap.so.openstack.beans.VnfStatus;
import org.onap.so.openstack.exceptions.MsoExceptionCategory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@@ -81,7 +84,7 @@ import io.swagger.annotations.ApiResponses;
@Transactional
@Component
public class VnfAdapterRest {
- private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, VnfAdapterRest.class);
+ private static Logger logger = LoggerFactory.getLogger(VnfAdapterRest.class);
private static final String TESTING_KEYWORD = "___TESTING___";
private static final String RESP=", resp=";
@@ -130,9 +133,9 @@ public class VnfAdapterRest {
@ApiParam(value = "DeleteVfModuleRequest", required = true)
final DeleteVfModuleRequest req)
{
- LOGGER.debug("Delete VfModule enter: " + req.toJsonString());
+ logger.debug("Delete VfModule enter: " + req.toJsonString());
if (aaiVnfId == null || !aaiVnfId.equals(req.getVnfId())) {
- LOGGER.debug("Req rejected - aaiVnfId not provided or doesn't match URL");
+ logger.debug("Req rejected - aaiVnfId not provided or doesn't match URL");
return Response
.status(HttpStatus.SC_BAD_REQUEST)
.type(MediaType.TEXT_PLAIN)
@@ -140,7 +143,7 @@ public class VnfAdapterRest {
.build();
}
if (aaiVfModuleId == null || !aaiVfModuleId.equals(req.getVfModuleId())) {
- LOGGER.debug("Req rejected - aaiVfModuleId not provided or doesn't match URL");
+ logger.debug("Req rejected - aaiVfModuleId not provided or doesn't match URL");
return Response
.status(HttpStatus.SC_BAD_REQUEST)
.type(MediaType.TEXT_PLAIN)
@@ -162,11 +165,12 @@ public class VnfAdapterRest {
t1.start();
} catch (Exception e) {
// problem handling delete, send generic failure as sync resp to caller
- LOGGER.error (MessageEnum.RA_DELETE_VNF_ERR, "", "deleteVfModule", MsoLogger.ErrorCode.BusinessProcesssError, "Exception in deleteVfModule", e);
+ logger.error("", MessageEnum.RA_DELETE_VNF_ERR.toString(), "deleteVfModule",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception in deleteVfModule", e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
- LOGGER.debug ("deleteVNFVolumes exit");
+ logger.debug("deleteVNFVolumes exit");
return Response.status(HttpStatus.SC_ACCEPTED).build();
}
}
@@ -208,14 +212,15 @@ public class VnfAdapterRest {
}
response = new DeleteVfModuleResponse(req.getVnfId(), req.getVfModuleId(), Boolean.TRUE, req.getMessageId(), outputs.value);
} catch (VnfException e) {
- LOGGER.error (MessageEnum.RA_DELETE_VNF_ERR, "", "", MsoLogger.ErrorCode.BusinessProcesssError, "VnfException - Delete VNF Module", e);
+ logger.error("{} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(),
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "VnfException - Delete VNF Module", e);
eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE, req.getMessageId());
}
if (!req.isSynchronous()) {
BpelRestClient bpelClient = bpelRestClientProvider.get();
bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
}
- LOGGER.debug ("Delete vfModule exit: code=" + getStatusCode() + RESP+ getResponse());
+ logger.debug("Delete vfModule exit: code=" + getStatusCode() + RESP + getResponse());
}
}
@@ -261,7 +266,7 @@ public class VnfAdapterRest {
@QueryParam("msoRequest.serviceInstanceId") String serviceInstanceId)
{
//This request responds synchronously only
- LOGGER.debug ("Query vfModule enter:" + vfModuleName);
+ logger.debug("Query vfModule enter:" + vfModuleName);
MsoRequest msoRequest = new MsoRequest(requestId, serviceInstanceId);
try {
@@ -273,21 +278,22 @@ public class VnfAdapterRest {
Holder<Map<String, String>> outputs = new Holder <> ();
vnfAdapter.queryVnf (cloudSiteId, tenantId, vfModuleName, msoRequest, vnfExists, vfModuleId, status, outputs);
if (!vnfExists.value) {
- LOGGER.debug ("vfModule not found");
+ logger.debug("vfModule not found");
respStatus = HttpStatus.SC_NOT_FOUND;
} else {
- LOGGER.debug ("vfModule found" + vfModuleId.value + ", status=" + status.value);
+ logger.debug("vfModule found" + vfModuleId.value + ", status=" + status.value);
qryResp.setVfModuleId(vfModuleId.value);
qryResp.setVnfStatus(status.value);
qryResp.setVfModuleOutputs(outputs.value);
}
- LOGGER.debug ("Query vfModule exit");
+ logger.debug("Query vfModule exit");
return Response
.status(respStatus)
.entity(new GenericEntity<QueryVfModuleResponse>(qryResp) {})
.build();
} catch (VnfException e) {
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vfModuleName, "", "queryVfModule", MsoLogger.ErrorCode.BusinessProcesssError, "VnfException - queryVfModule", e);
+ logger.error("{} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, "queryVfModule",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "VnfException - queryVfModule", e);
VfModuleExceptionResponse excResp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.FALSE, null);
return Response
.status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
@@ -340,9 +346,9 @@ public class VnfAdapterRest {
@ApiParam(value = "CreateVfModuleRequest", required = true)
final CreateVfModuleRequest req)
{
- LOGGER.debug("Create VfModule enter inside VnfAdapterRest: " + req.toJsonString());
+ logger.debug("Create VfModule enter inside VnfAdapterRest: " + req.toJsonString());
if (aaiVnfId == null || !aaiVnfId.equals(req.getVnfId())) {
- LOGGER.debug("Req rejected - aaiVnfId not provided or doesn't match URL");
+ logger.debug("Req rejected - aaiVnfId not provided or doesn't match URL");
return Response
.status(HttpStatus.SC_BAD_REQUEST)
.type(MediaType.TEXT_PLAIN)
@@ -364,11 +370,12 @@ public class VnfAdapterRest {
t1.start();
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
- LOGGER.error (MessageEnum.RA_CREATE_VNF_ERR, "", "createVfModule", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - createVfModule", e);
+ logger.error("{} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR, "createVfModule",
+ MsoLogger.ErrorCode.BusinessProcesssError, "Exception - createVfModule", e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
- LOGGER.debug ("createVfModule exit");
+ logger.debug("createVfModule exit");
return Response.status(HttpStatus.SC_ACCEPTED).build();
}
}
@@ -401,14 +408,14 @@ public class VnfAdapterRest {
@Override
public void run() {
- LOGGER.debug ("CreateVfModuleTask start");
+ logger.debug ("CreateVfModuleTask start");
try {
// Synchronous Web Service Outputs
Holder <String> vfModuleStackId = new Holder <> ();
Holder <Map <String, String>> outputs = new Holder <> ();
Holder <VnfRollback> vnfRollback = new Holder <> ();
String completeVnfVfModuleType = req.getVnfType() + "::" + req.getVfModuleType();
- LOGGER.debug("completeVnfVfModuleType=" + completeVnfVfModuleType);
+ logger.debug("completeVnfVfModuleType=" + completeVnfVfModuleType);
String cloudsite = req.getCloudSiteId();
if (cloudsite != null && cloudsite.equals(TESTING_KEYWORD)) {
String tenant = req.getTenantId();
@@ -460,14 +467,14 @@ public class VnfAdapterRest {
response = new CreateVfModuleResponse(req.getVnfId(), req.getVfModuleId(),
vfModuleStackId.value, Boolean.TRUE, outputs.value, modRollback, req.getMessageId());
} catch (VnfException e) {
- LOGGER.debug("Exception :",e);
+ logger.debug("Exception :",e);
eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE, req.getMessageId());
}
if (!req.isSynchronous()) {
BpelRestClient bpelClient = bpelRestClientProvider.get();
bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
}
- LOGGER.debug ("CreateVfModuleTask exit: code=" + getStatusCode() + RESP+ getResponse());
+ logger.debug("CreateVfModuleTask exit: code=" + getStatusCode() + RESP + getResponse());
}
}
@@ -490,7 +497,7 @@ public class VnfAdapterRest {
@ApiParam(value = "UpdateVfModuleRequest", required = true)
final UpdateVfModuleRequest req)
{
- LOGGER.debug("Update VfModule enter: " + req.toJsonString());
+ logger.debug("Update VfModule enter: " + req.toJsonString());
UpdateVfModulesTask task = new UpdateVfModulesTask(req);
if (req.isSynchronous()) {
// This is a synchronous request
@@ -506,11 +513,12 @@ public class VnfAdapterRest {
t1.start();
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
- LOGGER.error (MessageEnum.RA_UPDATE_VNF_ERR, "", "updateVfModule", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - updateVfModule", e);
- return Response.serverError().build();
+ logger.error("{} {} {} {}", MessageEnum.RA_UPDATE_VNF_ERR.toString(), "updateVfModule",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception - updateVfModule", e);
+ return Response.serverError().build();
}
// send sync response (ACK) to caller
- LOGGER.debug ("updateVfModules exit");
+ logger.debug("updateVfModules exit");
return Response.status(HttpStatus.SC_ACCEPTED).build();
}
}
@@ -550,7 +558,7 @@ public class VnfAdapterRest {
Holder <Map <String, String>> outputs = new Holder <> ();
Holder <VnfRollback> vnfRollback = new Holder <> ();
String completeVnfVfModuleType = req.getVnfType() + "::" + req.getVfModuleType();
- LOGGER.debug("in updateVf - completeVnfVfModuleType=" + completeVnfVfModuleType);
+ logger.debug("in updateVf - completeVnfVfModuleType=" + completeVnfVfModuleType);
vnfAdapter.updateVfModule (req.getCloudSiteId(),
req.getTenantId(),
@@ -571,7 +579,7 @@ public class VnfAdapterRest {
response = new UpdateVfModuleResponse(req.getVnfId(), req.getVfModuleId(),
vfModuleStackId.value, outputs.value, req.getMessageId());
} catch (VnfException e) {
- LOGGER.debug("Exception :",e);
+ logger.debug("Exception :",e);
eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE, req.getMessageId());
}
if (!req.isSynchronous()) {
@@ -579,7 +587,7 @@ public class VnfAdapterRest {
BpelRestClient bpelClient = bpelRestClientProvider.get();
bpelClient.bpelPost (getResponse(), req.getNotificationUrl(), sendxml);
}
- LOGGER.debug ("Update VfModule exit: code=" + getStatusCode() + RESP+ getResponse());
+ logger.debug("Update VfModule exit: code=" + getStatusCode() + RESP + getResponse());
}
}
/*
@@ -620,7 +628,7 @@ public class VnfAdapterRest {
//@QueryParam("rollback") String rollback,
final RollbackVfModuleRequest req)
{
- LOGGER.debug("Rollback VfModule enter: " + req.toJsonString());
+ logger.debug("Rollback VfModule enter: " + req.toJsonString());
RollbackVfModulesTask task = new RollbackVfModulesTask(req);
if (req.isSynchronous()) {
// This is a synchronous request
@@ -636,11 +644,12 @@ public class VnfAdapterRest {
t1.start();
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
- LOGGER.error (MessageEnum.RA_ROLLBACK_VNF_ERR, "", "rollbackVfModule", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - rollbackVfModule", e);
- return Response.serverError().build();
+ logger.error("{} {} {} {}", MessageEnum.RA_ROLLBACK_VNF_ERR.toString(), "rollbackVfModule",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception - rollbackVfModule", e);
+ return Response.serverError().build();
}
// send sync response (ACK) to caller
- LOGGER.debug ("rollbackVfModule exit");
+ logger.debug("rollbackVfModule exit");
return Response.status(HttpStatus.SC_ACCEPTED).build();
}
}
@@ -680,7 +689,8 @@ public class VnfAdapterRest {
vnfAdapter.rollbackVnf (vrb);
response = new RollbackVfModuleResponse(Boolean.TRUE, req.getMessageId());
} catch (VnfException e) {
- LOGGER.error (MessageEnum.RA_ROLLBACK_VNF_ERR, "", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - rollbackVfModule", e);
+ logger.error("{} {} {}", MessageEnum.RA_ROLLBACK_VNF_ERR, MsoLogger.ErrorCode.BusinessProcesssError,
+ "Exception" + " - " + "rollbackVfModule", e);
eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, false, req.getMessageId());
}
if (!req.isSynchronous()) {
@@ -688,7 +698,7 @@ public class VnfAdapterRest {
BpelRestClient bpelClient = bpelRestClientProvider.get();
bpelClient.bpelPost (getResponse(), req.getNotificationUrl(), sendxml);
}
- LOGGER.debug ("RollbackVfModulesTask exit: code=" + getStatusCode() + RESP+ getResponse());
+ logger.debug("RollbackVfModulesTask exit: code=" + getStatusCode() + RESP + getResponse());
}
}
-} \ No newline at end of file
+}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestUtils.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestUtils.java
index c332c49832..8c96acc361 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestUtils.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestUtils.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -24,14 +26,15 @@ import java.util.Optional;
import org.onap.so.cloud.CloudConfig;
import org.onap.so.db.catalog.beans.CloudSite;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class VnfAdapterRestUtils
{
- private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, VnfAdapterRestUtils.class);
+ private static Logger logger = LoggerFactory.getLogger(VnfAdapterRestUtils.class);
private static final String HEAT_MODE = "HEAT";
private static final String CLOUDIFY_MODE = "CLOUDIFY";
@@ -59,7 +62,7 @@ public class VnfAdapterRestUtils
// If was explicitly provided as a parameter, use that. Else if specified for the
// cloudsite, use that. Otherwise, the default is the (original) HEAT-based impl.
- LOGGER.debug ("Entered GetVnfAdapterImpl: mode=" + mode + ", cloudSite=" + cloudSiteId);
+ logger.debug("Entered GetVnfAdapterImpl: mode=" + mode + ", cloudSite=" + cloudSiteId);
if (mode == null) {
// Didn't get an explicit mode type requested.
@@ -67,7 +70,7 @@ public class VnfAdapterRestUtils
// has a CloudifyManager assigned to it
Optional<CloudSite> cloudSite = cloudConfig.getCloudSite(cloudSiteId);
if (cloudSite.isPresent()) {
- LOGGER.debug("Got CloudSite: " + cloudSite.toString());
+ logger.debug("Got CloudSite: " + cloudSite.toString());
if (cloudConfig.getCloudifyManager(cloudSite.get().getCloudifyId()) != null) {
mode = CLOUDIFY_MODE;
} else if (MULTICLOUD_MODE.equalsIgnoreCase(cloudSite.get().getOrchestrator())) {
@@ -79,26 +82,26 @@ public class VnfAdapterRestUtils
}
}
- LOGGER.debug ("GetVnfAdapterImpl: mode=" + mode);
+ logger.debug ("GetVnfAdapterImpl: mode=" + mode);
MsoVnfAdapter vnfAdapter = null;
// TODO: Make this more dynamic (e.g. Service Loader)
if (CLOUDIFY_MODE.equalsIgnoreCase(mode)) {
- LOGGER.debug ("GetVnfAdapterImpl: Return Cloudify Adapter");
+ logger.debug("GetVnfAdapterImpl: Return Cloudify Adapter");
vnfAdapter = cloudifyImpl;
}
else if (HEAT_MODE.equalsIgnoreCase(mode)) {
- LOGGER.debug ("GetVnfAdapterImpl: Return Heat Adapter");
+ logger.debug("GetVnfAdapterImpl: Return Heat Adapter");
vnfAdapter = vnfImpl;
}
else if (MULTICLOUD_MODE.equalsIgnoreCase(mode)) {
- LOGGER.debug ("GetVnfAdapterImpl: Return Plugin (multicloud) Adapter");
+ logger.debug("GetVnfAdapterImpl: Return Plugin (multicloud) Adapter");
vnfAdapter = vnfPluginImpl;
}
else {
// Don't expect this, but default is the HEAT adapter
- LOGGER.debug ("GetVnfAdapterImpl: Return Default (Heat) Adapter");
+ logger.debug("GetVnfAdapterImpl: Return Default (Heat) Adapter");
vnfAdapter = vnfImpl;
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestV2.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestV2.java
index a3d7c597de..81989a6fcd 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestV2.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/VnfAdapterRestV2.java
@@ -5,6 +5,7 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Modifications Copyright (C) 2018 IBM.
+ * Modifications Copyright (c) 2019 Samsung
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -59,6 +60,8 @@ import org.onap.so.logger.MsoLogger;
import org.onap.so.openstack.beans.VnfRollback;
import org.onap.so.openstack.beans.VnfStatus;
import org.onap.so.openstack.exceptions.MsoExceptionCategory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -81,7 +84,7 @@ import io.swagger.annotations.ApiResponses;
@Api(value = "/v2/vnfs", description = "root of vnf adapters restful web service v2")
@Component
public class VnfAdapterRestV2 {
- private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, VnfAdapterRestV2.class);
+ private static Logger logger = LoggerFactory.getLogger(VnfAdapterRestV2.class);
private static final String TESTING_KEYWORD = "___TESTING___";
private static final String RESP=", resp=";
@@ -130,9 +133,9 @@ public class VnfAdapterRestV2 {
@ApiParam(value = "DeleteVfModuleRequest", required = true)
final DeleteVfModuleRequest req)
{
- LOGGER.debug("Delete VfModule enter: " + req.toJsonString());
+ logger.debug("Delete VfModule enter: " + req.toJsonString());
if (aaiVnfId == null || !aaiVnfId.equals(req.getVnfId())) {
- LOGGER.debug("Req rejected - aaiVnfId not provided or doesn't match URL");
+ logger.debug("Req rejected - aaiVnfId not provided or doesn't match URL");
return Response
.status(HttpStatus.SC_BAD_REQUEST)
.type(MediaType.TEXT_PLAIN)
@@ -140,7 +143,7 @@ public class VnfAdapterRestV2 {
.build();
}
if (aaiVfModuleId == null || !aaiVfModuleId.equals(req.getVfModuleId())) {
- LOGGER.debug("Req rejected - aaiVfModuleId not provided or doesn't match URL");
+ logger.debug("Req rejected - aaiVfModuleId not provided or doesn't match URL");
return Response
.status(HttpStatus.SC_BAD_REQUEST)
.type(MediaType.TEXT_PLAIN)
@@ -163,11 +166,12 @@ public class VnfAdapterRestV2 {
t1.start();
} catch (Exception e) {
// problem handling delete, send generic failure as sync resp to caller
- LOGGER.error (MessageEnum.RA_DELETE_VNF_ERR, "", "deleteVfModule", MsoLogger.ErrorCode.BusinessProcesssError, "Exception in deleteVfModule", e);
+ logger.error("{} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), "deleteVfModule",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception in deleteVfModule", e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
- LOGGER.debug ("deleteVNFVolumes exit");
+ logger.debug("deleteVNFVolumes exit");
return Response.status(HttpStatus.SC_ACCEPTED).build();
}
}
@@ -213,14 +217,15 @@ public class VnfAdapterRestV2 {
}
response = new DeleteVfModuleResponse(req.getVnfId(), req.getVfModuleId(), Boolean.TRUE, req.getMessageId(), outputs.value);
} catch (VnfException e) {
- LOGGER.error (MessageEnum.RA_DELETE_VNF_ERR, "", "", MsoLogger.ErrorCode.BusinessProcesssError, "VnfException - Delete VNF Module", e);
+ logger.error("{} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(),
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "VnfException - " + "Delete VNF Module", e);
eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE, req.getMessageId());
}
if (!req.isSynchronous()) {
BpelRestClient bpelClient = bpelRestClientProvider.get();
bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
}
- LOGGER.debug ("Delete vfModule exit: code=" + getStatusCode() + RESP+ getResponse());
+ logger.debug("Delete vfModule exit: code=" + getStatusCode() + RESP + getResponse());
}
}
@@ -268,7 +273,7 @@ public class VnfAdapterRestV2 {
@QueryParam("mode") String mode)
{
//This request responds synchronously only
- LOGGER.debug ("Query vfModule enter:" + vfModuleName);
+ logger.debug("Query vfModule enter:" + vfModuleName);
MsoRequest msoRequest = new MsoRequest(requestId, serviceInstanceId);
try {
@@ -284,21 +289,22 @@ public class VnfAdapterRestV2 {
adapter.queryVnf (cloudSiteId, tenantId, vfModuleName, msoRequest, vnfExists, vfModuleId, status, outputs);
if (!vnfExists.value) {
- LOGGER.debug ("vfModule not found");
+ logger.debug("vfModule not found");
respStatus = HttpStatus.SC_NOT_FOUND;
} else {
- LOGGER.debug ("vfModule found" + vfModuleId.value + ", status=" + status.value);
+ logger.debug("vfModule found" + vfModuleId.value + ", status=" + status.value);
qryResp.setVfModuleId(vfModuleId.value);
qryResp.setVnfStatus(status.value);
qryResp.setVfModuleOutputs(outputs.value);
}
- LOGGER.debug ("Query vfModule exit");
+ logger.debug ("Query vfModule exit");
return Response
.status(respStatus)
.entity(new GenericEntity<QueryVfModuleResponse>(qryResp) {})
.build();
} catch (VnfException e) {
- LOGGER.error (MessageEnum.RA_QUERY_VNF_ERR, vfModuleName, "", "queryVfModule", MsoLogger.ErrorCode.BusinessProcesssError, "VnfException - queryVfModule", e);
+ logger.error("{} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, "queryVfModule",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "VnfException - queryVfModule", e);
VfModuleExceptionResponse excResp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.FALSE, null);
return Response
.status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
@@ -353,9 +359,9 @@ public class VnfAdapterRestV2 {
@ApiParam(value = "CreateVfModuleRequest", required = true)
final CreateVfModuleRequest req)
{
- LOGGER.debug("Create VfModule enter inside VnfAdapterRest: " + req.toJsonString());
+ logger.debug("Create VfModule enter inside VnfAdapterRest: " + req.toJsonString());
if (aaiVnfId == null || !aaiVnfId.equals(req.getVnfId())) {
- LOGGER.debug("Req rejected - aaiVnfId not provided or doesn't match URL");
+ logger.debug("Req rejected - aaiVnfId not provided or doesn't match URL");
return Response
.status(HttpStatus.SC_BAD_REQUEST)
.type(MediaType.TEXT_PLAIN)
@@ -378,11 +384,12 @@ public class VnfAdapterRestV2 {
t1.start();
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
- LOGGER.error (MessageEnum.RA_CREATE_VNF_ERR, "", "createVfModule", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - createVfModule", e);
+ logger.error("{} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), "createVfModule",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception - createVfModule", e);
return Response.serverError().build();
}
// send sync response (ACK) to caller
- LOGGER.debug ("createVfModule exit");
+ logger.debug("createVfModule exit");
return Response.status(HttpStatus.SC_ACCEPTED).build();
}
}
@@ -417,14 +424,14 @@ public class VnfAdapterRestV2 {
@Override
public void run() {
- LOGGER.debug ("CreateVfModuleTask start");
+ logger.debug("CreateVfModuleTask start");
try {
// Synchronous Web Service Outputs
Holder <String> vfModuleStackId = new Holder <String> ();
Holder <Map <String, String>> outputs = new Holder <Map <String, String>> ();
Holder <VnfRollback> vnfRollback = new Holder <VnfRollback> ();
String completeVnfVfModuleType = req.getVnfType() + "::" + req.getVfModuleType();
- LOGGER.debug("completeVnfVfModuleType=" + completeVnfVfModuleType);
+ logger.debug("completeVnfVfModuleType=" + completeVnfVfModuleType);
String cloudsiteId = req.getCloudSiteId();
if (cloudsiteId != null && cloudsiteId.equals(TESTING_KEYWORD)) {
@@ -470,7 +477,7 @@ public class VnfAdapterRestV2 {
BpelRestClient bpelClient = bpelRestClientProvider.get();
bpelClient.bpelPost(getResponse(), req.getNotificationUrl(), sendxml);
}
- LOGGER.debug ("CreateVfModuleTask exit: code=" + getStatusCode() + RESP+ getResponse());
+ logger.debug("CreateVfModuleTask exit: code=" + getStatusCode() + RESP + getResponse());
}
}
@@ -495,7 +502,7 @@ public class VnfAdapterRestV2 {
@ApiParam(value = "UpdateVfModuleRequest", required = true)
final UpdateVfModuleRequest req)
{
- LOGGER.debug("Update VfModule enter: " + req.toJsonString());
+ logger.debug("Update VfModule enter: " + req.toJsonString());
UpdateVfModulesTask task = new UpdateVfModulesTask(req, mode);
if (req.isSynchronous()) {
// This is a synchronous request
@@ -511,11 +518,12 @@ public class VnfAdapterRestV2 {
t1.start();
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
- LOGGER.error (MessageEnum.RA_UPDATE_VNF_ERR, "", "updateVfModule", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - updateVfModule", e);
- return Response.serverError().build();
+ logger.error("{} {} {} {}", MessageEnum.RA_UPDATE_VNF_ERR.toString(), "updateVfModule",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception - updateVfModule", e);
+ return Response.serverError().build();
}
// send sync response (ACK) to caller
- LOGGER.debug ("updateVfModules exit");
+ logger.debug("updateVfModules exit");
return Response.status(HttpStatus.SC_ACCEPTED).build();
}
}
@@ -557,7 +565,7 @@ public class VnfAdapterRestV2 {
Holder <Map <String, String>> outputs = new Holder <Map <String, String>> ();
Holder <VnfRollback> vnfRollback = new Holder <VnfRollback> ();
String completeVnfVfModuleType = req.getVnfType() + "::" + req.getVfModuleType();
- LOGGER.debug("in updateVf - completeVnfVfModuleType=" + completeVnfVfModuleType);
+ logger.debug("in updateVf - completeVnfVfModuleType=" + completeVnfVfModuleType);
String cloudsiteId = req.getCloudSiteId();
@@ -588,7 +596,7 @@ public class VnfAdapterRestV2 {
BpelRestClient bpelClient = bpelRestClientProvider.get();
bpelClient.bpelPost (getResponse(), req.getNotificationUrl(), sendxml);
}
- LOGGER.debug ("Update VfModule exit: code=" + getStatusCode() + RESP+ getResponse());
+ logger.debug("Update VfModule exit: code=" + getStatusCode() + RESP + getResponse());
}
}
/*
@@ -629,7 +637,7 @@ public class VnfAdapterRestV2 {
//@QueryParam("rollback") String rollback,
final RollbackVfModuleRequest req)
{
- LOGGER.debug("Rollback VfModule enter: " + req.toJsonString());
+ logger.debug("Rollback VfModule enter: " + req.toJsonString());
RollbackVfModulesTask task = new RollbackVfModulesTask(req);
if (req.isSynchronous()) {
// This is a synchronous request
@@ -645,11 +653,12 @@ public class VnfAdapterRestV2 {
t1.start();
} catch (Exception e) {
// problem handling create, send generic failure as sync resp to caller
- LOGGER.error (MessageEnum.RA_ROLLBACK_VNF_ERR, "", "rollbackVfModule", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - rollbackVfModule", e);
- return Response.serverError().build();
+ logger.error("{} {} {} {}", MessageEnum.RA_ROLLBACK_VNF_ERR.toString(), "rollbackVfModule",
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception - rollbackVfModule", e);
+ return Response.serverError().build();
}
// send sync response (ACK) to caller
- LOGGER.debug ("rollbackVfModule exit");
+ logger.debug("rollbackVfModule exit");
return Response.status(HttpStatus.SC_ACCEPTED).build();
}
}
@@ -693,7 +702,8 @@ public class VnfAdapterRestV2 {
response = new RollbackVfModuleResponse(Boolean.TRUE, req.getMessageId());
} catch (VnfException e) {
- LOGGER.error (MessageEnum.RA_ROLLBACK_VNF_ERR, "", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - rollbackVfModule", e);
+ logger.error("{} {} {}", MessageEnum.RA_ROLLBACK_VNF_ERR.toString(),
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Exception - rollbackVfModule", e);
eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, false, req.getMessageId());
}
if (!req.isSynchronous()) {
@@ -701,7 +711,7 @@ public class VnfAdapterRestV2 {
BpelRestClient bpelClient = bpelRestClientProvider.get();
bpelClient.bpelPost (getResponse(), req.getNotificationUrl(), sendxml);
}
- LOGGER.debug ("RollbackVfModulesTask exit: code=" + getStatusCode() + RESP+ getResponse());
+ logger.debug("RollbackVfModulesTask exit: code=" + getStatusCode() + RESP + getResponse());
}
}
}
diff --git a/adapters/mso-openstack-adapters/src/main/resources/application.yaml b/adapters/mso-openstack-adapters/src/main/resources/application.yaml
index 4e8d389998..cdd04b8c21 100644
--- a/adapters/mso-openstack-adapters/src/main/resources/application.yaml
+++ b/adapters/mso-openstack-adapters/src/main/resources/application.yaml
@@ -30,8 +30,19 @@ spring:
ddl-auto: validate
naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
enable-lazy-load-no-trans: true
-
-
+org:
+ onap:
+ so:
+ adapters:
+ default_keystone_url_version: /v2.0
+ default_keystone_reg_ex: "/[vV][0-9]"
+ po:
+ retryCodes: 504
+ retryDelay: 5
+ retryCount: 3
+ pollTimeout: 7500
+ pollInterval: 15
+
#Actuator
management:
endpoints:
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditCreateStackServiceTest.java
index d7739e56f6..bcf126d887 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditCreateStackServiceTest.java
@@ -40,10 +40,10 @@ import org.springframework.core.env.Environment;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
-public class AuditStackServiceDataTest extends AuditStackServiceData {
+public class AuditCreateStackServiceTest extends AuditCreateStackService {
@InjectMocks
- AuditStackServiceData auditStackService = new AuditStackServiceData();
+ AuditCreateStackService auditStackService = new AuditCreateStackService();
@Mock
HeatStackAudit heatStackAuditMock;
@@ -73,14 +73,14 @@ public class AuditStackServiceDataTest extends AuditStackServiceData {
@Test
public void execute_external_task_audit_success_Test() {
- doReturn(true).when(heatStackAuditMock).auditHeatStack("cloudRegion", "cloudOwner", "tenantId", "stackName");
+ doReturn(true).when(heatStackAuditMock).auditHeatStackCreate("cloudRegion", "cloudOwner", "tenantId", "stackName");
auditStackService.executeExternalTask(mockExternalTask, mockExternalTaskService);
Mockito.verify(mockExternalTaskService).complete(mockExternalTask);
}
@Test
public void execute_external_task_audit_first_failure_Test() {
- doReturn(false).when(heatStackAuditMock).auditHeatStack("cloudRegion", "cloudOwner", "tenantId", "stackName");
+ doReturn(false).when(heatStackAuditMock).auditHeatStackCreate("cloudRegion", "cloudOwner", "tenantId", "stackName");
doReturn(null).when(mockExternalTask).getRetries();
auditStackService.executeExternalTask(mockExternalTask, mockExternalTaskService);
Mockito.verify(mockExternalTaskService).handleFailure(mockExternalTask,
@@ -90,7 +90,7 @@ public class AuditStackServiceDataTest extends AuditStackServiceData {
@Test
public void execute_external_task_audit_intermediate_failure_Test() {
- doReturn(false).when(heatStackAuditMock).auditHeatStack("cloudRegion", "cloudOwner", "tenantId", "stackName");
+ doReturn(false).when(heatStackAuditMock).auditHeatStackCreate("cloudRegion", "cloudOwner", "tenantId", "stackName");
doReturn(6).when(mockExternalTask).getRetries();
auditStackService.executeExternalTask(mockExternalTask, mockExternalTaskService);
Mockito.verify(mockExternalTaskService).handleFailure(mockExternalTask,
@@ -101,11 +101,11 @@ public class AuditStackServiceDataTest extends AuditStackServiceData {
@Test
public void execute_external_task_audit_final_failure_Test() {
- doReturn(false).when(heatStackAuditMock).auditHeatStack("cloudRegion", "cloudOwner", "tenantId", "stackName");
+ doReturn(false).when(heatStackAuditMock).auditHeatStackCreate("cloudRegion", "cloudOwner", "tenantId", "stackName");
doReturn(1).when(mockExternalTask).getRetries();
auditStackService.executeExternalTask(mockExternalTask, mockExternalTaskService);
Mockito.verify(mockExternalTaskService).handleBpmnError(mockExternalTask,
- "AuditAAIInventoryFailure");
+ "AuditAAIInventoryFailure", "Number of Retries Exceeded auditing inventory");
}
@Test
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditVServerTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditVServerTest.java
index 02557d8c20..9176b58de8 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditVServerTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditVServerTest.java
@@ -58,8 +58,6 @@ import com.woorea.openstack.heat.model.Resources;
@RunWith(MockitoJUnitRunner.Silent.class)
public class AuditVServerTest extends AuditVServer {
- private ObjectMapper objectMapper = new ObjectMapper();
-
@InjectMocks
private AuditVServer auditNova = new AuditVServer();
@@ -225,9 +223,13 @@ public class AuditVServerTest extends AuditVServer {
@Test
public void audit_Vserver_Empty_HashSet() throws JsonParseException, JsonMappingException, IOException {
- boolean exists = auditNova.auditVservers(new HashSet<Vserver>(), tenantId, cloudOwner, cloudRegion);
+ boolean exists = auditNova.auditAllVserversDoExist(new HashSet<Vserver>(), tenantId, cloudOwner, cloudRegion);
assertEquals(false, exists);
+
+ boolean doNotExist = auditNova.auditAllVserversDoNotExist(new HashSet<Vserver>(), tenantId, cloudOwner, cloudRegion);
+ assertEquals(true, doNotExist);
}
+
@Test
public void audit_Vserver_Found_Test() throws JsonParseException, JsonMappingException, IOException {
@@ -246,8 +248,11 @@ public class AuditVServerTest extends AuditVServer {
doReturn(true).when(aaiResourcesMock).exists(service1_sub_0_uri);
doReturn(true).when(aaiResourcesMock).exists(service1_sub_1_uri);
- boolean exists = auditNova.auditVservers(vserversToAudit, tenantId, cloudOwner, cloudRegion);
+ boolean exists = auditNova.auditAllVserversDoExist(vserversToAudit, tenantId, cloudOwner, cloudRegion);
assertEquals(true, exists);
+
+ boolean doNotExist = auditNova.auditAllVserversDoNotExist(vserversToAudit, tenantId, cloudOwner, cloudRegion);
+ assertEquals(false, doNotExist);
}
@Test
@@ -268,8 +273,11 @@ public class AuditVServerTest extends AuditVServer {
doReturn(true).when(aaiResourcesMock).exists(service1_sub_0_uri);
doReturn(true).when(aaiResourcesMock).exists(service1_sub_1_uri);
- boolean exists = auditNova.auditVservers(vserversToAudit, tenantId, cloudOwner, cloudRegion);
+ boolean exists = auditNova.auditAllVserversDoExist(vserversToAudit, tenantId, cloudOwner, cloudRegion);
assertEquals(false, exists);
+
+ boolean doNotExist = auditNova.auditAllVserversDoNotExist(vserversToAudit, tenantId, cloudOwner, cloudRegion);
+ assertEquals(false, doNotExist);
}
@Test
@@ -288,16 +296,23 @@ public class AuditVServerTest extends AuditVServer {
doReturn(true).when(aaiResourcesMock).exists(service2_sub_1_uri);
doReturn(true).when(aaiResourcesMock).exists(service1_sub_0_uri);
doReturn(true).when(aaiResourcesMock).exists(service1_sub_1_uri);
- boolean exists = auditNova.auditVservers(vserversToAudit, tenantId, cloudOwner, cloudRegion);
+ boolean exists = auditNova.auditAllVserversDoExist(vserversToAudit, tenantId, cloudOwner, cloudRegion);
assertEquals(false, exists);
+
+ boolean doNotExist = auditNova.auditAllVserversDoNotExist(vserversToAudit, tenantId, cloudOwner, cloudRegion);
+ assertEquals(false, doNotExist);
}
@Test
- public void audit_Vserver_Not_Found_Test() throws JsonParseException, JsonMappingException, IOException {
+ public void audit_Vservers_Not_Found_Test() throws JsonParseException, JsonMappingException, IOException {
doReturn(false).when(aaiResourcesMock).exists(vserverURI);
doReturn(false).when(aaiResourcesMock).exists(vserverURI2);
- boolean exists = auditNova.auditVservers(vserversToAudit, tenantId, cloudOwner, cloudRegion);
+
+ boolean exists = auditNova.auditAllVserversDoExist(vserversToAudit, tenantId, cloudOwner, cloudRegion);
assertEquals(false, exists);
+
+ boolean doNotExist = auditNova.auditAllVserversDoNotExist(vserversToAudit, tenantId, cloudOwner, cloudRegion);
+ assertEquals(true, doNotExist);
}
@Test
@@ -306,8 +321,11 @@ public class AuditVServerTest extends AuditVServer {
doReturn(true).when(aaiResourcesMock).exists(vserverURI2);
doReturn(Optional.of(test_port_1_plural)).when(aaiResourcesMock).get(LInterface.class,test_port_1_uri);
doReturn(Optional.of(test_port_2_plural)).when(aaiResourcesMock).get(LInterface.class,test_port_2_uri);
- boolean exists = auditNova.auditVservers(vserversToAudit, tenantId, cloudOwner, cloudRegion);
+ boolean exists = auditNova.auditAllVserversDoExist(vserversToAudit, tenantId, cloudOwner, cloudRegion);
assertEquals(false, exists);
+
+ boolean doNotExist = auditNova.auditAllVserversDoNotExist(vserversToAudit, tenantId, cloudOwner, cloudRegion);
+ assertEquals(false, doNotExist);
}
@Test
@@ -325,8 +343,12 @@ public class AuditVServerTest extends AuditVServer {
doReturn(true).when(aaiResourcesMock).exists(service1_sub_0_uri);
doReturn(true).when(aaiResourcesMock).exists(service1_sub_1_uri);
doReturn(false).when(aaiResourcesMock).exists(vserverURI2);
- boolean exists = auditNova.auditVservers(vserversToAudit, tenantId, cloudOwner, cloudRegion);
+
+ boolean exists = auditNova.auditAllVserversDoExist(vserversToAudit, tenantId, cloudOwner, cloudRegion);
assertEquals(false, exists);
+
+ boolean doNotExist = auditNova.auditAllVserversDoNotExist(vserversToAudit, tenantId, cloudOwner, cloudRegion);
+ assertEquals(false, doNotExist);
}
}
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/HeatStackAuditTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/HeatStackAuditTest.java
index 696784110b..5eea46d09f 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/HeatStackAuditTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/HeatStackAuditTest.java
@@ -203,7 +203,7 @@ public class HeatStackAuditTest extends HeatStackAudit {
Resources getResource = objectMapper.readValue(new File("src/test/resources/Service1ResourceGroupResponse.json"), Resources.class);
doReturn(getResource).when(msoHeatUtilsMock).queryStackResources(cloudRegion, tenantId, "heatStackName");
- boolean actual = heatStackAudit.auditHeatStack(cloudRegion, "cloudOwner", tenantId, "heatStackName");
+ boolean actual = heatStackAudit.auditHeatStackCreate(cloudRegion, "cloudOwner", tenantId, "heatStackName");
assertEquals(true, actual);
}
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java
index 75cea9eafc..376076a0a0 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java
@@ -65,7 +65,7 @@ public class MsoVnfMulticloudAdapterImplTest extends BaseRestTestUtils{
@Test
public void createVfModule() throws Exception {
- //expectedException.expect(VnfException.class);
+
Map<String, Object> stackInputs = new HashMap<>();
stackInputs.put("oof_directives", "{}");
stackInputs.put("sdnc_directives", "{}");
diff --git a/adapters/mso-openstack-adapters/src/test/resources/schema.sql b/adapters/mso-openstack-adapters/src/test/resources/schema.sql
index e9f2a09860..ac08f8b645 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/schema.sql
+++ b/adapters/mso-openstack-adapters/src/test/resources/schema.sql
@@ -384,6 +384,8 @@ create table `vnf_resource_customization` (
`vnf_resource_model_uuid` varchar(200) not null,
`multi_stage_design` varchar(20) default null,
`resource_input` varchar(20000) default null,
+ `cds_blueprint_name` varchar(200),
+ `cds_blueprint_version` varchar(200),
primary key (`model_customization_uuid`),
key `fk_vnf_resource_customization__vnf_resource1_idx` (`vnf_resource_model_uuid`),
constraint `fk_vnf_resource_customization__vnf_resource1` foreign key (`vnf_resource_model_uuid`) references `vnf_resource` (`model_uuid`) on delete cascade on update cascade
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java
index 62233273b1..d0973d3c44 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java
@@ -66,7 +66,6 @@ public class SDNCServiceRequestTask {
public void runRequest(SDNCServiceRequest request,String msoRequestId,String msoServiceInstanceId,String myUrlSuffix)
{
MsoLogger.setLogContext(msoRequestId, msoServiceInstanceId);
- MsoLogger.setServiceName(getClass().getSimpleName());
String sdncRequestId = request.getSdncRequestId();
String sdncService = request.getSdncService();
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
index bb70e3c65c..dc30b0e7de 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
@@ -189,7 +189,6 @@ public class ASDCController {
*/
public void initASDC () throws ASDCControllerException {
String event = "Initialize the ASDC Controller";
- MsoLogger.setServiceName ("InitASDC");
logger.debug(event);
if (this.getControllerStatus () != ASDCControllerStatus.STOPPED) {
String endEvent = "The controller is already initialized, call the closeASDC method first";
@@ -237,7 +236,6 @@ public class ASDCController {
*/
public void closeASDC () throws ASDCControllerException {
- MsoLogger.setServiceName ("CloseController");
if (this.getControllerStatus () == ASDCControllerStatus.BUSY) {
throw new ASDCControllerException ("Cannot close the ASDC controller as it's currently in BUSY state");
}
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
index 56784ba475..892a96eb4e 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
@@ -53,6 +53,7 @@ import org.onap.sdc.toscaparser.api.Property;
import org.onap.sdc.toscaparser.api.RequirementAssignment;
import org.onap.sdc.toscaparser.api.RequirementAssignments;
import org.onap.sdc.toscaparser.api.elements.Metadata;
+import org.onap.sdc.toscaparser.api.elements.StatefulEntityType;
import org.onap.sdc.toscaparser.api.functions.GetInput;
import org.onap.sdc.toscaparser.api.parameters.Input;
import org.onap.sdc.utils.DistributionStatusEnum;
@@ -138,6 +139,10 @@ import com.fasterxml.jackson.databind.ObjectMapper;
@Component
public class ToscaResourceInstaller {
+ protected static final String NODES_VRF_ENTRY = "org.openecomp.nodes.VRFEntry";
+
+ protected static final String VLAN_NETWORK_RECEPTOR = "org.openecomp.nodes.VLANNetworkReceptor";
+
protected static final String ALLOTTED_RESOURCE = "Allotted Resource";
protected static final String MULTI_STAGE_DESIGN = "multi_stage_design";
@@ -295,8 +300,7 @@ public class ToscaResourceInstaller {
List<ASDCElementInfo> artifactListForLogging = new ArrayList<>();
try {
createToscaCsar(toscaResourceStruct);
- createService(toscaResourceStruct, vfResourceStruct);
- Service service = toscaResourceStruct.getCatalogService();
+ Service service = createService(toscaResourceStruct, vfResourceStruct);
processResourceSequence(toscaResourceStruct, service);
processVFResources(toscaResourceStruct, service, vfResourceStructure);
@@ -524,6 +528,62 @@ public class ToscaResourceInstaller {
}
}
}
+
+
+ protected ConfigurationResource getConfigurationResource(NodeTemplate nodeTemplate) {
+ Metadata metadata = nodeTemplate.getMetaData();
+ ConfigurationResource configResource = new ConfigurationResource();
+ configResource.setModelName(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
+ configResource.setModelInvariantUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
+ configResource.setModelUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
+ configResource.setModelVersion(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
+ configResource.setDescription(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
+ configResource.setToscaNodeType(nodeTemplate.getType());
+ return configResource;
+ }
+
+ protected ConfigurationResourceCustomization getConfigurationResourceCustomization(NodeTemplate nodeTemplate, ToscaResourceStructure toscaResourceStructure,
+ ServiceProxyResourceCustomization spResourceCustomization ) {
+ Metadata metadata = nodeTemplate.getMetaData();
+
+ ConfigurationResource configResource = getConfigurationResource(nodeTemplate);
+
+ ConfigurationResourceCustomization configCustomizationResource = new ConfigurationResourceCustomization();
+
+ Set<ConfigurationResourceCustomization> configResourceCustomizationSet = new HashSet<>();
+
+ configCustomizationResource.setModelCustomizationUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
+ configCustomizationResource.setModelInstanceName(nodeTemplate.getName());
+
+ configCustomizationResource.setNfFunction(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
+ configCustomizationResource.setNfRole(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFROLE));
+ configCustomizationResource.setNfType(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFTYPE));
+ configCustomizationResource.setServiceProxyResourceCustomizationUUID(spResourceCustomization.getModelCustomizationUUID());
+
+ configCustomizationResource.setConfigurationResource(configResource);
+ configResourceCustomizationSet.add(configCustomizationResource);
+
+ configResource.setConfigurationResourceCustomization(configResourceCustomizationSet);
+ return configCustomizationResource;
+ }
+
+
+ protected Optional<ConfigurationResourceCustomization> getVnrNodeTemplate(List<NodeTemplate> configurationNodeTemplatesList,
+ ToscaResourceStructure toscaResourceStructure, ServiceProxyResourceCustomization spResourceCustomization) {
+ Optional<ConfigurationResourceCustomization> configurationResourceCust = Optional.empty();
+ for (NodeTemplate nodeTemplate : configurationNodeTemplatesList) {
+ StatefulEntityType entityType = nodeTemplate.getTypeDefinition();
+ String type = entityType.getType();
+
+ if(VLAN_NETWORK_RECEPTOR.equals(type)) {
+ configurationResourceCust= Optional.of(getConfigurationResourceCustomization(nodeTemplate,
+ toscaResourceStructure,spResourceCustomization));
+ break;
+ }
+ }
+
+ return configurationResourceCust;
+ }
protected void processServiceProxyAndConfiguration(ToscaResourceStructure toscaResourceStruct, Service service) {
@@ -538,16 +598,16 @@ public class ToscaResourceInstaller {
if (serviceProxyResourceList != null) {
for (NodeTemplate spNode : serviceProxyResourceList) {
- serviceProxy = createServiceProxy(spNode, service, toscaResourceStruct);
-
+ serviceProxy = createServiceProxy(spNode, service, toscaResourceStruct);
serviceProxyList.add(serviceProxy);
-
+ Optional<ConfigurationResourceCustomization> vnrResourceCustomization = getVnrNodeTemplate(configurationNodeTemplatesList,toscaResourceStruct,serviceProxy);
+
for (NodeTemplate configNode : configurationNodeTemplatesList) {
List<RequirementAssignment> requirementsList = toscaResourceStruct.getSdcCsarHelper().getRequirementsOf(configNode).getAll();
for (RequirementAssignment requirement : requirementsList) {
if (requirement.getNodeTemplateName().equals(spNode.getName())) {
- ConfigurationResourceCustomization configurationResource = createConfiguration(configNode, toscaResourceStruct, serviceProxy);
+ ConfigurationResourceCustomization configurationResource = createConfiguration(configNode, toscaResourceStruct, serviceProxy, vnrResourceCustomization);
Optional<ConfigurationResourceCustomization> matchingObject = configurationResourceList.stream()
.filter(configurationResourceCustomization -> configNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID).equals(configurationResource.getModelCustomizationUUID()))
@@ -881,8 +941,6 @@ public class ToscaResourceInstaller {
protected Service createService(ToscaResourceStructure toscaResourceStructure,
VfResourceStructure vfResourceStructure) {
- toscaResourceStructure.getServiceMetadata();
-
Metadata serviceMetadata = toscaResourceStructure.getServiceMetadata();
Service service = new Service();
@@ -945,32 +1003,26 @@ public class ToscaResourceInstaller {
return spCustomizationResource;
}
- protected ConfigurationResourceCustomization createConfiguration(NodeTemplate nodeTemplate, ToscaResourceStructure toscaResourceStructure, ServiceProxyResourceCustomization spResourceCustomization) {
+ protected ConfigurationResourceCustomization createConfiguration(NodeTemplate nodeTemplate,
+ ToscaResourceStructure toscaResourceStructure, ServiceProxyResourceCustomization spResourceCustomization,
+ Optional<ConfigurationResourceCustomization> vnrResourceCustomization) {
- Metadata metadata = nodeTemplate.getMetaData();
-
- ConfigurationResource configResource = new ConfigurationResource();
-
- configResource.setModelName(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
- configResource.setModelInvariantUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
- configResource.setModelUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
- configResource.setModelVersion(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
- configResource.setDescription(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
- configResource.setToscaNodeType(nodeTemplate.getType());
+ ConfigurationResourceCustomization configCustomizationResource = getConfigurationResourceCustomization(nodeTemplate,
+ toscaResourceStructure,spResourceCustomization);
- ConfigurationResourceCustomization configCustomizationResource = new ConfigurationResourceCustomization();
+ ConfigurationResource configResource = getConfigurationResource(nodeTemplate);
Set<ConfigurationResourceCustomization> configResourceCustomizationSet = new HashSet<>();
- configCustomizationResource.setModelCustomizationUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
- configCustomizationResource.setModelInstanceName(nodeTemplate.getName());
-
- configCustomizationResource.setNfFunction(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
- configCustomizationResource.setNfRole(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFROLE));
- configCustomizationResource.setNfType(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFTYPE));
- configCustomizationResource.setServiceProxyResourceCustomizationUUID(spResourceCustomization.getModelCustomizationUUID());
- configCustomizationResource.setConfigResourceCustomization(configCustomizationResource);
+ StatefulEntityType entityType = nodeTemplate.getTypeDefinition();
+ String type = entityType.getType();
+
+ if(NODES_VRF_ENTRY.equals(type)) {
+ configCustomizationResource.setConfigResourceCustomization(vnrResourceCustomization.orElse(null));
+ }
+
configCustomizationResource.setConfigurationResource(configResource);
+
configResourceCustomizationSet.add(configCustomizationResource);
configResource.setConfigurationResourceCustomization(configResourceCustomizationSet);
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
index 9ab4c5ecb2..e4eb09782a 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
@@ -23,71 +23,48 @@ package org.onap.so.asdc.installer.heat;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static com.shazam.shazamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
-
-import static org.junit.Assert.assertNull;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.doNothing;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-import java.io.File;
-import java.io.FileInputStream;
import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
+import java.util.Optional;
-import javax.transaction.Transactional;
-
-import org.apache.commons.io.IOUtils;
import org.hibernate.exception.LockAcquisitionException;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.Mock;
+import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.onap.sdc.api.notification.IResourceInstance;
-import org.onap.sdc.api.results.IDistributionClientDownloadResult;
+import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
import org.onap.sdc.tosca.parser.impl.SdcCsarHelperImpl;
import org.onap.sdc.tosca.parser.impl.SdcPropertyNames;
-import org.onap.sdc.toscaparser.api.CapabilityAssignment;
-import org.onap.sdc.toscaparser.api.CapabilityAssignments;
import org.onap.sdc.toscaparser.api.Group;
import org.onap.sdc.toscaparser.api.NodeTemplate;
import org.onap.sdc.toscaparser.api.elements.Metadata;
+import org.onap.sdc.toscaparser.api.elements.StatefulEntityType;
import org.onap.sdc.utils.DistributionStatusEnum;
import org.onap.so.asdc.BaseTest;
-import org.onap.so.asdc.client.ASDCConfiguration;
import org.onap.so.asdc.client.exceptions.ArtifactInstallerException;
import org.onap.so.asdc.client.test.emulators.ArtifactInfoImpl;
import org.onap.so.asdc.client.test.emulators.JsonStatusData;
import org.onap.so.asdc.client.test.emulators.NotificationDataImpl;
-import org.onap.so.asdc.installer.VfModuleArtifact;
-import org.onap.so.asdc.installer.VfResourceStructure;
-import org.onap.so.db.catalog.beans.AllottedResource;
-import org.onap.so.db.catalog.beans.AllottedResourceCustomization;
-import org.onap.so.db.catalog.beans.ExternalServiceToInternalService;
-import org.onap.so.db.catalog.beans.HeatTemplate;
-import org.onap.so.db.catalog.beans.NetworkResource;
-import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
-import org.onap.so.db.catalog.beans.Service;
-import org.onap.so.db.catalog.beans.VnfResource;
-import org.onap.so.db.catalog.beans.VnfResourceCustomization;
+import org.onap.so.asdc.installer.ToscaResourceStructure;
+import org.onap.so.db.catalog.beans.ConfigurationResource;
+import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization;
+import org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization;
import org.onap.so.db.catalog.data.repository.AllottedResourceCustomizationRepository;
import org.onap.so.db.catalog.data.repository.AllottedResourceRepository;
-import org.onap.so.db.catalog.data.repository.ExternalServiceToInternalServiceRepository;
import org.onap.so.db.catalog.data.repository.ServiceRepository;
import org.onap.so.db.request.beans.WatchdogComponentDistributionStatus;
-import org.onap.so.db.request.beans.WatchdogDistributionStatus;
-import org.onap.so.db.request.beans.WatchdogServiceModVerIdLookup;
import org.onap.so.db.request.data.repository.WatchdogComponentDistributionStatusRepository;
import org.springframework.beans.factory.annotation.Autowired;
@@ -114,6 +91,16 @@ public class ToscaResourceInstallerTest extends BaseTest {
private IResourceInstance resourceInstance;
@Rule
public ExpectedException expectedException = ExpectedException.none();
+ @Mock
+ private NodeTemplate nodeTemplate;
+ @Mock
+ private ToscaResourceStructure toscaResourceStructure;
+ @Mock
+ private ServiceProxyResourceCustomization spResourceCustomization;
+ @Mock
+ private ISdcCsarHelper csarHelper;
+ @Mock
+ private StatefulEntityType entityType;
private NotificationDataImpl notificationData;
private JsonStatusData statusData;
@@ -310,4 +297,82 @@ public class ToscaResourceInstallerTest extends BaseTest {
}
return actualWatchdogComponentDistributionStatus;
}
+
+
+
+
+ private void prepareConfigurationResource() {
+ doReturn(metadata).when(nodeTemplate).getMetaData();
+ doReturn(MockConstants.TEMPLATE_TYPE).when(nodeTemplate).getType();
+
+ doReturn(MockConstants.MODEL_NAME).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_NAME);
+ doReturn(MockConstants.MODEL_INVARIANT_UUID).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID);
+ doReturn(MockConstants.MODEL_UUID).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_UUID);
+ doReturn(MockConstants.MODEL_VERSION).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_VERSION);
+ doReturn(MockConstants.MODEL_DESCRIPTION).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION);
+ doReturn(MockConstants.MODEL_NAME).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_NAME);
+ doReturn(MockConstants.MODEL_NAME).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_NAME);
+ }
+
+ @Test
+ public void getConfigurationResourceTest() {
+ prepareConfigurationResource();
+
+ ConfigurationResource configResource=toscaInstaller.getConfigurationResource(nodeTemplate);
+
+ assertNotNull(configResource);
+ assertEquals(MockConstants.MODEL_NAME, configResource.getModelName());
+ assertEquals(MockConstants.MODEL_INVARIANT_UUID, configResource.getModelInvariantUUID());
+ assertEquals(MockConstants.MODEL_UUID, configResource.getModelUUID());
+ assertEquals(MockConstants.MODEL_VERSION, configResource.getModelVersion());
+ assertEquals(MockConstants.MODEL_DESCRIPTION, configResource.getDescription());
+ assertEquals(MockConstants.TEMPLATE_TYPE, nodeTemplate.getType());
+ }
+
+ private void prepareConfigurationResourceCustomization() {
+ prepareConfigurationResource();
+ doReturn(MockConstants.MODEL_CUSTOMIZATIONUUID).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID);
+ doReturn(csarHelper).when(toscaResourceStructure).getSdcCsarHelper();
+ doReturn(null).when(csarHelper).getNodeTemplatePropertyLeafValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION);
+ doReturn(null).when(csarHelper).getNodeTemplatePropertyLeafValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFROLE);
+ doReturn(null).when(csarHelper).getNodeTemplatePropertyLeafValue(nodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFTYPE);
+ doReturn(MockConstants.MODEL_CUSTOMIZATIONUUID).when(spResourceCustomization).getModelCustomizationUUID();
+ }
+
+
+ @Test
+ public void getConfigurationResourceCustomizationTest() {
+ prepareConfigurationResourceCustomization();
+
+ ConfigurationResourceCustomization configurationResourceCustomization = toscaInstaller.getConfigurationResourceCustomization(
+ nodeTemplate, toscaResourceStructure, spResourceCustomization);
+ assertNotNull(configurationResourceCustomization);
+ assertNotNull(configurationResourceCustomization.getConfigurationResource());
+ assertEquals(MockConstants.MODEL_CUSTOMIZATIONUUID, configurationResourceCustomization.getServiceProxyResourceCustomizationUUID());
+ }
+
+ @Test
+ public void getVnrNodeTemplateTest() {
+ prepareConfigurationResourceCustomization();
+ List<NodeTemplate> nodeTemplateList = new ArrayList<>();
+ doReturn(ToscaResourceInstaller.VLAN_NETWORK_RECEPTOR).when(entityType).getType();
+ doReturn(entityType).when(nodeTemplate).getTypeDefinition();
+ nodeTemplateList.add(nodeTemplate);
+ Optional<ConfigurationResourceCustomization> vnrResourceCustomization=
+ toscaInstaller.getVnrNodeTemplate(nodeTemplateList, toscaResourceStructure, spResourceCustomization);
+ assertTrue(vnrResourceCustomization.isPresent());
+ assertEquals(ToscaResourceInstaller.VLAN_NETWORK_RECEPTOR, entityType.getType());
+ }
+
+ class MockConstants{
+ public final static String MODEL_NAME = "VLAN Network Receptor Configuration";
+ public final static String MODEL_INVARIANT_UUID = "1608eef4-de53-4334-a8d2-ba79cab4bde0";
+ public final static String MODEL_UUID = "212ca27b-554c-474c-96b9-ddc2f1b1ddba";
+ public final static String MODEL_VERSION = "30.0";
+ public final static String MODEL_DESCRIPTION = "VLAN network receptor configuration object";
+ public final static String MODEL_CUSTOMIZATIONUUID = "2db953e8-679d-437b-bff7-cb262638a8cd";
+ public final static String TEMPLATE_TYPE = "org.openecomp.nodes.VLANNetworkReceptor";
+ public final static String TEMPLATE_NAME = "VLAN Network Receptor Configuration 0";
+
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/InstanceGroup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/InstanceGroup.java
index deb8c8e393..7a58f6db6b 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/InstanceGroup.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/InstanceGroup.java
@@ -30,6 +30,7 @@ import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoInstanceGroup;
+import org.onap.so.db.catalog.beans.OrchestrationStatus;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
@@ -48,10 +49,14 @@ public class InstanceGroup implements Serializable, ShallowCopy<InstanceGroup>
private String resourceVersion;
@JsonProperty("instance-group-name")
private String instanceGroupName;
+ @JsonProperty("orchestration-status")
+ private OrchestrationStatus orchestrationStatus = OrchestrationStatus.PRECREATED;
@JsonProperty("model-info-instance-group")
private ModelInfoInstanceGroup modelInfoInstanceGroup;
@JsonProperty("instance-group-function")
private String instanceGroupFunction;
+ @JsonProperty("vnfs")
+ private List<GenericVnf> vnfs = new ArrayList<>();
public String getId() {
return id;
@@ -76,6 +81,12 @@ public class InstanceGroup implements Serializable, ShallowCopy<InstanceGroup>
}
public void setInstanceGroupName(String instanceGroupName) {
this.instanceGroupName = instanceGroupName;
+ }
+ public OrchestrationStatus getOrchestrationStatus() {
+ return orchestrationStatus;
+ }
+ public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
+ this.orchestrationStatus = orchestrationStatus;
}
public ModelInfoInstanceGroup getModelInfoInstanceGroup() {
return modelInfoInstanceGroup;
@@ -89,6 +100,12 @@ public class InstanceGroup implements Serializable, ShallowCopy<InstanceGroup>
public void setInstanceGroupFunction(String instanceGroupFunction) {
this.instanceGroupFunction = instanceGroupFunction;
}
+ public List<GenericVnf> getVnfs() {
+ return vnfs;
+ }
+ public void setVnfs(List<GenericVnf> vnfs) {
+ this.vnfs = vnfs;
+ }
@Override
public boolean equals(final Object other) {
if (!(other instanceof InstanceGroup)) {
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/ServiceInstance.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/ServiceInstance.java
index 259a988262..e2a8688395 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/ServiceInstance.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/ServiceInstance.java
@@ -79,6 +79,8 @@ public class ServiceInstance implements Serializable, ShallowCopy<ServiceInstanc
private SolutionInfo solutionInfo;
@JsonProperty("model-info-service-instance")
private ModelInfoServiceInstance modelInfoServiceInstance;
+ @JsonProperty("instance-groups")
+ private List<InstanceGroup> instanceGroups = new ArrayList<>();
public List<GenericVnf> getVnfs() {
return vnfs;
@@ -191,6 +193,12 @@ public class ServiceInstance implements Serializable, ShallowCopy<ServiceInstanc
public void setSolutionInfo(SolutionInfo solutionInfo) {
this.solutionInfo = solutionInfo;
}
+ public List<InstanceGroup> getInstanceGroups() {
+ return instanceGroups;
+ }
+ public void setInstanceGroups(List<InstanceGroup> instanceGroups) {
+ this.instanceGroups = instanceGroups;
+ }
@Override
public boolean equals(final Object other) {
if (!(other instanceof ServiceInstance)) {
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Tenant.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Tenant.java
new file mode 100644
index 0000000000..a23f85bae9
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Tenant.java
@@ -0,0 +1,58 @@
+package org.onap.so.bpmn.servicedecomposition.bbobjects;
+
+import java.io.Serializable;
+
+import javax.persistence.Id;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class Tenant implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -8704478668505531590L;
+ @Id
+ @JsonProperty("tenant-id")
+ private String tenantId;
+ @JsonProperty("tenant-name")
+ private String tenantName;
+ @JsonProperty("tenant-context")
+ private String tenantContext;
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof Tenant)) {
+ return false;
+ }
+ Tenant castOther = (Tenant) other;
+ return new EqualsBuilder().append(tenantId, castOther.tenantId).isEquals();
+ }
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(tenantId).toHashCode();
+ }
+ public String getTenantId() {
+ return tenantId;
+ }
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+ public String getTenantName() {
+ return tenantName;
+ }
+ public void setTenantName(String tenantName) {
+ this.tenantName = tenantName;
+ }
+ public String getTenantContext() {
+ return tenantContext;
+ }
+ public void setTenantContext(String tenantContext) {
+ this.tenantContext = tenantContext;
+ }
+
+
+} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/GeneralBuildingBlock.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/GeneralBuildingBlock.java
index adea99c4f3..6d3be0f822 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/GeneralBuildingBlock.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/GeneralBuildingBlock.java
@@ -26,6 +26,7 @@ import java.util.Map;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant;
import org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
@@ -39,10 +40,20 @@ public class GeneralBuildingBlock implements Serializable {
private OrchestrationContext orchContext;
private Map<String, String> userInput;
private CloudRegion cloudRegion;
+ private Tenant tenant;
private Customer customer;
private ServiceInstance serviceInstance;
+
+ public Tenant getTenant() {
+ return tenant;
+ }
+
+ public void setTenant(Tenant tenant) {
+ this.tenant = tenant;
+ }
+
public CloudRegion getCloudRegion() {
return cloudRegion;
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java
index 433315b2ed..15dfe85c1a 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java
@@ -36,6 +36,7 @@ public class WorkflowResourceIds implements Serializable {
private String vfModuleId;
private String networkCollectionId;
private String configurationId;
+ private String instanceGroupId;
@Override
public String toString() {
@@ -100,4 +101,12 @@ public class WorkflowResourceIds implements Serializable {
public void setConfigurationId(String configurationId) {
this.configurationId = configurationId;
}
+
+ public String getInstanceGroupId() {
+ return instanceGroupId;
+ }
+
+ public void setInstanceGroupId(String instanceGroupId) {
+ this.instanceGroupId = instanceGroupId;
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
index fb3094665e..c80cd3d2a0 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
@@ -49,6 +49,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.Project;
import org.onap.so.bpmn.servicedecomposition.bbobjects.RouteTableReference;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceSubscription;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
import org.onap.so.bpmn.servicedecomposition.entities.ConfigurationResourceKeys;
@@ -58,6 +59,7 @@ import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds;
import org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext;
import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
+import org.onap.so.bpmn.servicedecomposition.tasks.exceptions.NoServiceInstanceFoundException;
import org.onap.so.client.aai.AAICommonObjectMapperProvider;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.entities.AAIResultWrapper;
@@ -224,6 +226,7 @@ public class BBInputSetup implements JavaDelegate {
lookupKeyMap.put(ResourceKey.VF_MODULE_ID, workflowResourceIds.getVfModuleId());
lookupKeyMap.put(ResourceKey.VOLUME_GROUP_ID, workflowResourceIds.getVolumeGroupId());
lookupKeyMap.put(ResourceKey.CONFIGURATION_ID, workflowResourceIds.getConfigurationId());
+ lookupKeyMap.put(ResourceKey.INSTANCE_GROUP_ID, workflowResourceIds.getInstanceGroupId());
}
protected GeneralBuildingBlock getGBBALaCarteNonService(ExecuteBuildingBlock executeBB,
@@ -243,7 +246,7 @@ public class BBInputSetup implements JavaDelegate {
ServiceInstance serviceInstance = this.getExistingServiceInstance(aaiServiceInstance);
serviceInstance.setModelInfoServiceInstance(this.mapperLayer.mapCatalogServiceIntoServiceInstance(service));
this.populateObjectsOnAssignAndCreateFlows(requestDetails, service, bbName, serviceInstance, lookupKeyMap,
- resourceId, vnfType);
+ resourceId, vnfType, executeBB.getBuildingBlock().getKey(), executeBB.getConfigurationResourceKeys());
return this.populateGBBWithSIAndAdditionalInfo(requestDetails, serviceInstance, executeBB, requestAction, null);
} else {
logger.debug("Related Service Instance from AAI: {}", aaiServiceInstance);
@@ -254,25 +257,59 @@ public class BBInputSetup implements JavaDelegate {
protected GeneralBuildingBlock getGBBCM(ExecuteBuildingBlock executeBB,
RequestDetails requestDetails, Map<ResourceKey, String> lookupKeyMap, String requestAction,
- String resourceId) throws Exception {
+ String resourceId) throws Exception {
ServiceInstance serviceInstance = new ServiceInstance();
String serviceInstanceId = lookupKeyMap.get(ResourceKey.SERVICE_INSTANCE_ID);
- serviceInstance.setServiceInstanceId(serviceInstanceId);
-
+ serviceInstance.setServiceInstanceId(serviceInstanceId);
+ Customer customer = new Customer();
List<GenericVnf> genericVnfs = serviceInstance.getVnfs();
String vnfId = lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID);
- org.onap.aai.domain.yang.GenericVnf aaiGenericVnf = bbInputSetupUtils.getAAIGenericVnf(vnfId);
-
- GenericVnf genericVnf = this.mapperLayer.mapAAIGenericVnfIntoGenericVnf(aaiGenericVnf);
- genericVnfs.add(genericVnf);
-
- return this.populateGBBWithSIAndAdditionalInfo(requestDetails, serviceInstance, executeBB, requestAction, new Customer());
+ if(vnfId != null) {
+ org.onap.aai.domain.yang.GenericVnf aaiGenericVnf = bbInputSetupUtils.getAAIGenericVnf(vnfId);
+ GenericVnf genericVnf = this.mapperLayer.mapAAIGenericVnfIntoGenericVnf(aaiGenericVnf);
+ genericVnfs.add(genericVnf);
+ }
+ String instanceGroupId = lookupKeyMap.get(ResourceKey.INSTANCE_GROUP_ID);
+ if(instanceGroupId != null) {
+ org.onap.aai.domain.yang.InstanceGroup aaiInstancegroup = bbInputSetupUtils.getAAIInstanceGroup(instanceGroupId);
+ InstanceGroup instanceGroup = this.mapperLayer.mapAAIInstanceGroupIntoInstanceGroup(aaiInstancegroup);
+ instanceGroup.setOrchestrationStatus(OrchestrationStatus.INVENTORIED);
+
+ if(serviceInstanceId == null) {
+ Optional<org.onap.aai.domain.yang.ServiceInstance> aaiServiceInstanceOpt = bbInputSetupUtils.getRelatedServiceInstanceFromInstanceGroup(instanceGroupId);
+ if(aaiServiceInstanceOpt.isPresent()) {
+ org.onap.aai.domain.yang.ServiceInstance aaiServiceInstance = aaiServiceInstanceOpt.get();
+ serviceInstance = this.mapperLayer.mapAAIServiceInstanceIntoServiceInstance(aaiServiceInstance);
+ WorkflowResourceIds workflowResourceIds = executeBB.getWorkflowResourceIds();
+ workflowResourceIds.setServiceInstanceId(serviceInstance.getServiceInstanceId());
+ lookupKeyMap.put(ResourceKey.SERVICE_INSTANCE_ID, workflowResourceIds.getServiceInstanceId());
+ } else {
+ throw new NoServiceInstanceFoundException("Related ServiceInstance not found in A&AI.");
+ }
+ }
+ RelatedInstanceList[] relatedInstanceList = requestDetails.getRelatedInstanceList();
+ if (relatedInstanceList != null) {
+ for (RelatedInstanceList relatedInstList : relatedInstanceList) {
+ RelatedInstance relatedInstance = relatedInstList.getRelatedInstance();
+ if (relatedInstance.getModelInfo().getModelType().equals(ModelType.vnf)) {
+ org.onap.aai.domain.yang.GenericVnf aaiVnf = bbInputSetupUtils.getAAIGenericVnf(relatedInstance.getInstanceId());
+ GenericVnf vnf = this.mapperLayer.mapAAIGenericVnfIntoGenericVnf(aaiVnf);
+ instanceGroup.getVnfs().add(vnf);
+ }
+ }
+ }
+
+ serviceInstance.getInstanceGroups().add(instanceGroup);
+ customer.setServiceSubscription(new ServiceSubscription());
+ }
+ return this.populateGBBWithSIAndAdditionalInfo(requestDetails, serviceInstance, executeBB, requestAction, customer);
}
protected void populateObjectsOnAssignAndCreateFlows(RequestDetails requestDetails, Service service, String bbName,
- ServiceInstance serviceInstance, Map<ResourceKey, String> lookupKeyMap, String resourceId, String vnfType)
+ ServiceInstance serviceInstance, Map<ResourceKey, String> lookupKeyMap, String resourceId, String vnfType,
+ String configurationKey, ConfigurationResourceKeys configurationResourceKeys)
throws Exception {
ModelInfo modelInfo = requestDetails.getModelInfo();
String instanceName = requestDetails.getRequestInfo().getInstanceName();
@@ -295,13 +332,36 @@ public class BBInputSetup implements JavaDelegate {
this.populateVolumeGroup(modelInfo, service, bbName, serviceInstance, lookupKeyMap, resourceId,
relatedInstanceList, instanceName, vnfType, null);
} else if (modelType.equals(ModelType.vfModule)) {
- lookupKeyMap.put(ResourceKey.VF_MODULE_ID, resourceId);
- this.populateVfModule(modelInfo, service, bbName, serviceInstance, lookupKeyMap, resourceId,
- relatedInstanceList, instanceName, null, requestDetails.getCloudConfiguration());
+ if(bbName.contains("Configuration")) {
+ ModelInfo configurationModelInfo = new ModelInfo();
+ configurationModelInfo.setModelCustomizationUuid(configurationKey);
+ populateConfiguration(configurationModelInfo, service, bbName, serviceInstance,
+ lookupKeyMap, resourceId, instanceName, configurationResourceKeys);
+ } else {
+ lookupKeyMap.put(ResourceKey.VF_MODULE_ID, resourceId);
+ this.populateVfModule(modelInfo, service, bbName, serviceInstance, lookupKeyMap, resourceId,
+ relatedInstanceList, instanceName, null, requestDetails.getCloudConfiguration());
+ }
+ } else if (modelType.equals(ModelType.instanceGroup)) {
+ lookupKeyMap.put(ResourceKey.INSTANCE_GROUP_ID, resourceId);
+ this.populateInstanceGroup(modelInfo, service, serviceInstance, resourceId, instanceName);
} else {
return;
}
}
+
+ protected void populateInstanceGroup(ModelInfo modelInfo, Service service, ServiceInstance serviceInstance, String instanceGroupId, String instanceName) {
+ InstanceGroup instanceGroup = new InstanceGroup();
+ instanceGroup.setId(instanceGroupId);
+ instanceGroup.setInstanceGroupName(instanceName);
+ mapCatalogInstanceGroup(instanceGroup, modelInfo, service);
+ serviceInstance.getInstanceGroups().add(instanceGroup);
+ }
+
+ protected void mapCatalogInstanceGroup(InstanceGroup instanceGroup, ModelInfo modelInfo, Service service) {
+ // @TODO: this will populate the instanceGroup model info.
+ // Dependent on MSO-5821 653458 US - MSO - Enhance Catalog DB Schema & Adapter to support VNF Groups
+ }
protected void populateConfiguration(ModelInfo modelInfo, Service service, String bbName,
ServiceInstance serviceInstance, Map<ResourceKey, String> lookupKeyMap, String resourceId, String instanceName, ConfigurationResourceKeys configurationResourceKeys) {
@@ -343,13 +403,19 @@ public class BBInputSetup implements JavaDelegate {
if (configurationResourceCustomization != null && vnfVfmoduleCvnfcConfigurationCustomization != null) {
configuration.setModelInfoConfiguration(this.mapperLayer.mapCatalogConfigurationToConfiguration(configurationResourceCustomization
, vnfVfmoduleCvnfcConfigurationCustomization));
+ } else {
+ logger.debug("for Fabric configuration mapping by VF MODULE CUST UUID: " + configurationResourceKeys.getVfModuleCustomizationUUID());
+ vnfVfmoduleCvnfcConfigurationCustomization = findVnfVfmoduleCvnfcConfigurationCustomization(configurationResourceKeys.getVfModuleCustomizationUUID(),
+ configurationResourceKeys.getVnfResourceCustomizationUUID(), configurationResourceKeys.getCvnfcCustomizationUUID());
+ if (vnfVfmoduleCvnfcConfigurationCustomization != null){
+ configuration.setModelInfoConfiguration(this.mapperLayer.mapCatalogConfigurationToConfiguration(vnfVfmoduleCvnfcConfigurationCustomization));
+ }
}
}
protected VnfVfmoduleCvnfcConfigurationCustomization findVnfVfmoduleCvnfcConfigurationCustomization(String vfModuleCustomizationUUID,
String vnfResourceCustomizationUUID, String cvnfcCustomizationUUID, ConfigurationResourceCustomization configurationResourceCustomization) {
-
- if(configurationResourceCustomization.getConfigurationResource() != null)
+ if(configurationResourceCustomization != null && configurationResourceCustomization.getConfigurationResource() != null)
for(VnfVfmoduleCvnfcConfigurationCustomization vnfVfmoduleCvnfcConfigurationCustomization :
configurationResourceCustomization.getConfigurationResource().getVnfVfmoduleCvnfcConfigurationCustomization()) {
if(vnfVfmoduleCvnfcConfigurationCustomization.getVfModuleCustomization().getModelCustomizationUUID().equalsIgnoreCase(vfModuleCustomizationUUID)
@@ -369,6 +435,13 @@ public class BBInputSetup implements JavaDelegate {
}
return null;
}
+
+ protected VnfVfmoduleCvnfcConfigurationCustomization findVnfVfmoduleCvnfcConfigurationCustomization(String vnfResourceCustomizationUUID,
+ String vfModuleCustomizationUUID, String cvnfcCustomizationUUID) {
+ return bbInputSetupUtils.getVnfVfmoduleCvnfcConfigurationCustomizationByActionAndIsALaCarteAndRequestScopeAndCloudOwner(vnfResourceCustomizationUUID,
+ vfModuleCustomizationUUID, cvnfcCustomizationUUID);
+
+ }
protected void populateVfModule(ModelInfo modelInfo, Service service, String bbName,
ServiceInstance serviceInstance, Map<ResourceKey, String> lookupKeyMap, String resourceId,
@@ -831,7 +904,7 @@ public class BBInputSetup implements JavaDelegate {
}
protected GeneralBuildingBlock populateGBBWithSIAndAdditionalInfo(RequestDetails requestDetails,
- ServiceInstance serviceInstance, ExecuteBuildingBlock executeBB, String requestAction, Customer customer) {
+ ServiceInstance serviceInstance, ExecuteBuildingBlock executeBB, String requestAction, Customer customer) throws Exception {
GeneralBuildingBlock outputBB = new GeneralBuildingBlock();
OrchestrationContext orchContext = mapperLayer.mapOrchestrationContext(requestDetails);
RequestContext requestContext = mapperLayer.mapRequestContext(requestDetails);
@@ -840,9 +913,11 @@ public class BBInputSetup implements JavaDelegate {
org.onap.aai.domain.yang.CloudRegion aaiCloudRegion = bbInputSetupUtils
.getCloudRegion(requestDetails.getCloudConfiguration());
CloudRegion cloudRegion = mapperLayer.mapCloudRegion(requestDetails.getCloudConfiguration(), aaiCloudRegion);
+ Tenant tenant = getTenant(requestDetails.getCloudConfiguration(), aaiCloudRegion);
outputBB.setOrchContext(orchContext);
outputBB.setRequestContext(requestContext);
outputBB.setCloudRegion(cloudRegion);
+ outputBB.setTenant(tenant);
if(customer == null){
Map<String, String> uriKeys = bbInputSetupUtils.getURIKeysFromServiceInstance(serviceInstance.getServiceInstanceId());
String globalCustomerId = uriKeys.get("global-customer-id");
@@ -857,6 +932,23 @@ public class BBInputSetup implements JavaDelegate {
return outputBB;
}
+ protected Tenant getTenant(CloudConfiguration cloudConfiguration, org.onap.aai.domain.yang.CloudRegion aaiCloudRegion) throws Exception {
+ Tenant tenant = new Tenant();
+ if(cloudConfiguration != null && cloudConfiguration.getTenantId() != null
+ && aaiCloudRegion != null && aaiCloudRegion.getTenants() != null) {
+ for(org.onap.aai.domain.yang.Tenant aaiTenant : aaiCloudRegion.getTenants().getTenant()) {
+ if(aaiTenant.getTenantId().equalsIgnoreCase(cloudConfiguration.getTenantId())) {
+ tenant = mapperLayer.mapTenant(aaiTenant);
+ }
+ }
+ if(tenant.getTenantId() == null || tenant.getTenantName() == null) {
+ throw new Exception("Invalid tenant information retrieved: tenantId = " + tenant.getTenantId()
+ + " tenantName = " + tenant.getTenantName());
+ }
+ }
+ return tenant;
+ }
+
protected ServiceSubscription getServiceSubscription(RequestDetails requestDetails, Customer customer) {
org.onap.aai.domain.yang.ServiceSubscription aaiServiceSubscription = bbInputSetupUtils
.getAAIServiceSubscription(customer.getGlobalCustomerId(),
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
index 108fd66488..fac2e9b8c3 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
@@ -53,6 +53,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.SegmentationAssignment;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceSubscription;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Subnet;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
@@ -383,6 +384,14 @@ public class BBInputSetupMapperLayer {
modelMapper.map(aaiCloudRegion, cloudRegion);
return cloudRegion;
}
+
+ protected Tenant mapTenant(org.onap.aai.domain.yang.Tenant aaiTenant) {
+ Tenant tenant = new Tenant();
+ if(aaiTenant != null) {
+ modelMapper.map(aaiTenant, tenant);
+ }
+ return tenant;
+ }
protected Collection mapAAICollectionIntoCollection(org.onap.aai.domain.yang.Collection aaiCollection) {
Collection collection = new Collection();
@@ -487,6 +496,16 @@ public class BBInputSetupMapperLayer {
modelInfoConfiguration.setPolicyName(vnfVfmoduleCvnfcConfigurationCustomization.getPolicyName());
return modelInfoConfiguration;
}
+
+ protected ModelInfoConfiguration mapCatalogConfigurationToConfiguration(
+ VnfVfmoduleCvnfcConfigurationCustomization vnfVfmoduleCvnfcConfigurationCustomization) {
+ ModelInfoConfiguration modelInfoConfiguration = new ModelInfoConfiguration();
+ modelInfoConfiguration.setModelVersionId(vnfVfmoduleCvnfcConfigurationCustomization.getConfigurationResource().getModelUUID());
+ modelInfoConfiguration.setModelCustomizationId(vnfVfmoduleCvnfcConfigurationCustomization.getModelCustomizationUUID());
+ modelInfoConfiguration.setModelInvariantId(vnfVfmoduleCvnfcConfigurationCustomization.getConfigurationResource().getModelInvariantUUID());
+ modelInfoConfiguration.setPolicyName(vnfVfmoduleCvnfcConfigurationCustomization.getPolicyName());
+ return modelInfoConfiguration;
+ }
public NetworkResourceCustomization mapCollectionNetworkResourceCustToNetworkResourceCust(
CollectionNetworkResourceCustomization collectionNetworkResourceCust) {
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java
index b3b4559f1d..a71c38f127 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtils.java
@@ -42,6 +42,8 @@ import org.onap.aai.domain.yang.VolumeGroup;
import org.onap.aai.domain.yang.VolumeGroups;
import org.onap.so.bpmn.common.InjectionHelper;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
+import org.onap.so.bpmn.servicedecomposition.tasks.exceptions.MultipleObjectsFoundException;
+import org.onap.so.bpmn.servicedecomposition.tasks.exceptions.NoServiceInstanceFoundException;
import org.onap.so.client.aai.AAIObjectPlurals;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.entities.AAIResultWrapper;
@@ -53,6 +55,8 @@ import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization;
import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization;
import org.onap.so.db.catalog.beans.NetworkCollectionResourceCustomization;
import org.onap.so.db.catalog.beans.Service;
+import org.onap.so.db.catalog.beans.VfModuleCustomization;
+import org.onap.so.db.catalog.beans.VnfVfmoduleCvnfcConfigurationCustomization;
import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization;
import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.db.request.beans.InfraActiveRequests;
@@ -137,6 +141,16 @@ public class BBInputSetupUtils {
return catalogDbClient.getNetworkCollectionResourceCustomizationByID(collectionCustomizationId);
}
+ public VfModuleCustomization getVfModuleCustomizationByModelCuztomizationUUID(String modelCustomizationUUID) {
+ return catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID(modelCustomizationUUID);
+ }
+
+ public VnfVfmoduleCvnfcConfigurationCustomization getVnfVfmoduleCvnfcConfigurationCustomizationByActionAndIsALaCarteAndRequestScopeAndCloudOwner(String vnfCustomizationUuid,
+ String vfModuleCustomizationUuid, String cvnfcCustomizationUuid) {
+ return catalogDbClient.getVnfVfmoduleCvnfcConfigurationCustomizationByVnfCustomizationUuidAndVfModuleCustomizationUuidAndCvnfcCustomizationUuid(vnfCustomizationUuid,
+ vfModuleCustomizationUuid, cvnfcCustomizationUuid);
+ }
+
public List<VnfcInstanceGroupCustomization> getVnfcInstanceGroups(String modelCustomizationUUID) {
return catalogDbClient.getVnfcInstanceGroupsByVnfResourceCust(modelCustomizationUUID);
}
@@ -173,7 +187,7 @@ public class BBInputSetupUtils {
if (cloudRegionId != null && cloudOwner != null && !cloudRegionId.isEmpty() && !cloudOwner.isEmpty()) {
return injectionHelper.getAaiClient().get(CloudRegion.class,
AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, cloudOwner,
- cloudRegionId)).orElse(null);
+ cloudRegionId).depth(Depth.TWO)).orElse(null);
} else {
return null;
@@ -346,6 +360,26 @@ public class BBInputSetupUtils {
}
+ public Optional<ServiceInstance> getRelatedServiceInstanceFromInstanceGroup(String instanceGroupId) throws Exception {
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.INSTANCE_GROUP, instanceGroupId);
+ uri.relatedTo(AAIObjectPlurals.SERVICE_INSTANCE);
+ Optional<ServiceInstances> serviceInstances = injectionHelper.getAaiClient().get(ServiceInstances.class, uri);
+ ServiceInstance serviceInstance = null;
+ if (!serviceInstances.isPresent()) {
+ logger.debug("No ServiceInstances were found");
+ return Optional.empty();
+ } else {
+ if (serviceInstances.get().getServiceInstance().isEmpty()) {
+ throw new NoServiceInstanceFoundException("No ServiceInstances Returned");
+ } else if (serviceInstances.get().getServiceInstance().size() > 1) {
+ throw new MultipleObjectsFoundException("Multiple ServiceInstances Returned");
+ } else {
+ serviceInstance = serviceInstances.get().getServiceInstance().get(0);
+ }
+ return Optional.of(serviceInstance);
+ }
+ }
+
public Optional<L3Network> getRelatedNetworkByNameFromServiceInstance(String serviceInstanceId, String networkName) throws Exception{
AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId);
uri.relatedTo(AAIObjectPlurals.L3_NETWORK).queryParam("network-name", networkName);
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java
index 79f4a07974..d2d321f8f4 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java
@@ -90,6 +90,10 @@ public class ExtractPojosForBB {
serviceInstance = extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
result = lookupObjectInList(serviceInstance.getVpnBondingLinks(),value);
break;
+ case INSTANCE_GROUP_ID:
+ serviceInstance = extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
+ result = lookupObjectInList(serviceInstance.getInstanceGroups(), value);
+ break;
default:
throw new BBObjectNotFoundException(key, value);
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/MultipleObjectsFoundException.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/MultipleObjectsFoundException.java
new file mode 100644
index 0000000000..d63f98b6ce
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/MultipleObjectsFoundException.java
@@ -0,0 +1,47 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 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.onap.so.bpmn.servicedecomposition.tasks.exceptions;
+
+public class MultipleObjectsFoundException extends Exception {
+
+ private static final long serialVersionUID = -5045275644426587447L;
+
+ public MultipleObjectsFoundException() {
+ super();
+ }
+
+ public MultipleObjectsFoundException(String message) {
+ super(message);
+ }
+
+ public MultipleObjectsFoundException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public MultipleObjectsFoundException(Throwable cause) {
+ super(cause);
+ }
+
+ public MultipleObjectsFoundException(String message, Throwable cause, boolean enableSuppression,
+ boolean writableStackTrace) {
+ super(message, cause, enableSuppression, writableStackTrace);
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/NoServiceInstanceFoundException.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/NoServiceInstanceFoundException.java
new file mode 100644
index 0000000000..2ef1a80cce
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/NoServiceInstanceFoundException.java
@@ -0,0 +1,47 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 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.onap.so.bpmn.servicedecomposition.tasks.exceptions;
+
+public class NoServiceInstanceFoundException extends Exception {
+
+ private static final long serialVersionUID = 3270499954054029908L;
+
+ public NoServiceInstanceFoundException() {
+ super();
+ }
+
+ public NoServiceInstanceFoundException(String message) {
+ super(message);
+ }
+
+ public NoServiceInstanceFoundException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public NoServiceInstanceFoundException(Throwable cause) {
+ super(cause);
+ }
+
+ public NoServiceInstanceFoundException(String message, Throwable cause, boolean enableSuppression,
+ boolean writableStackTrace) {
+ super(message, cause, enableSuppression, writableStackTrace);
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/restproperties/CDSPropertiesImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/restproperties/CDSPropertiesImpl.java
index b8ab588a75..dfdef74886 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/restproperties/CDSPropertiesImpl.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/restproperties/CDSPropertiesImpl.java
@@ -24,6 +24,7 @@ public class CDSPropertiesImpl implements CDSProperties {
private static final String ENDPOINT = "cds.endpoint";
private static final String PORT = "cds.port";
+ private static final String AUTH = "cds.auth";
public CDSPropertiesImpl() {
// Needed for service loader
@@ -40,6 +41,11 @@ public class CDSPropertiesImpl implements CDSProperties {
}
@Override
+ public String getBasicAuth() {
+ return Objects.requireNonNull(UrnPropertiesReader.getVariable(AUTH));
+ }
+
+ @Override
public URL getEndpoint() {
return null;
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/ExtractPojosForBBTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/ExtractPojosForBBTest.java
index 634e0a6c9b..bc41b168ef 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/ExtractPojosForBBTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/ExtractPojosForBBTest.java
@@ -105,12 +105,18 @@ public class ExtractPojosForBBTest extends BaseTest{
allotedResourcePend.setId("abc");
allotedResourcesPend.add(allotedResourcePend);
lookupKeyMap.put(ResourceKey.ALLOTTED_RESOURCE_ID, allotedResourcePend.getId());
-
+
Configuration configurationPend = new Configuration();
configurationPend.setConfigurationId("abc");
serviceInstancePend.getConfigurations().add(configurationPend);
lookupKeyMap.put(ResourceKey.CONFIGURATION_ID, configurationPend.getConfigurationId());
+ List<InstanceGroup> instanceGroupsPend = serviceInstancePend.getInstanceGroups();
+ InstanceGroup instanceGroupPend = new InstanceGroup();
+ instanceGroupPend.setId("test-instance-group-1");
+ instanceGroupsPend.add(instanceGroupPend);
+ lookupKeyMap.put(ResourceKey.INSTANCE_GROUP_ID, instanceGroupPend.getId());
+
customer.getServiceSubscription().getServiceInstances().add(serviceInstancePend);
gBBInput.setCustomer(customer);
@@ -136,6 +142,9 @@ public class ExtractPojosForBBTest extends BaseTest{
VpnBondingLink extractVpnBondingLinkPend = extractPojos.extractByKey(execution, ResourceKey.VPN_BONDING_LINK_ID, "testVpnBondingLink");
assertEquals(extractVpnBondingLinkPend.getVpnBondingLinkId(), vpnBondingLinkPend.getVpnBondingLinkId());
+
+ InstanceGroup extractInstanceGroupPend = extractPojos.extractByKey(execution, ResourceKey.INSTANCE_GROUP_ID, "test-instance-group-1");
+ assertEquals(instanceGroupPend.getId(), extractInstanceGroupPend.getId());
}
@Test
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java
index 3cb7b241dc..ff592f5603 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayerTest.java
@@ -50,6 +50,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.Project;
import org.onap.so.bpmn.servicedecomposition.bbobjects.RouteTableReference;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceSubscription;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext;
@@ -604,6 +605,23 @@ public class BBInputSetupMapperLayerTest {
assertThat(actual, sameBeanAs(expected));
}
+
+ @Test
+ public void testMapTenant() {
+ Tenant expected = new Tenant();
+ expected.setTenantId("tenantId");
+ expected.setTenantName("tenantName");
+ expected.setTenantContext("tenantContext");
+
+ org.onap.aai.domain.yang.Tenant aaiTenant = new org.onap.aai.domain.yang.Tenant();
+ aaiTenant.setTenantId("tenantId");
+ aaiTenant.setTenantName("tenantName");
+ aaiTenant.setTenantContext("tenantContext");
+
+ Tenant actual = bbInputSetupMapperLayer.mapTenant(aaiTenant);
+
+ assertThat(actual, sameBeanAs(expected));
+ }
@Test
public void testMapCloudRegionWithNullCheck() {
@@ -641,6 +659,34 @@ public class BBInputSetupMapperLayerTest {
}
@Test
+ public void testmapCatalogConfigurationToFabricConfiguration() {
+ String modelCustUUID = "modelCustomizationUUID";
+ String modelInvariantUUID = "modelInvariantUUID";
+ String modelVersionUUID = "modelUUID";
+ String policyName = "policyName";
+ ModelInfoConfiguration expected = new ModelInfoConfiguration();
+ expected.setModelCustomizationId(modelCustUUID);
+ expected.setModelInvariantId(modelInvariantUUID);
+ expected.setModelVersionId(modelVersionUUID);
+ expected.setPolicyName(policyName);
+
+ VnfVfmoduleCvnfcConfigurationCustomization fabricCustomization = new VnfVfmoduleCvnfcConfigurationCustomization();
+ fabricCustomization.setCvnfcCustomization(new CvnfcCustomization());
+ fabricCustomization.getCvnfcCustomization().setVnfcCustomization(new VnfcCustomization());
+ fabricCustomization.setPolicyName(policyName);
+ fabricCustomization.setModelCustomizationUUID(modelCustUUID);
+
+ ConfigurationResource configurationResource = new ConfigurationResource();
+ configurationResource.setModelUUID(modelVersionUUID);
+ configurationResource.setModelInvariantUUID(modelInvariantUUID);
+ fabricCustomization.setConfigurationResource(configurationResource);
+
+ ModelInfoConfiguration actual = bbInputSetupMapperLayer.mapCatalogConfigurationToConfiguration(fabricCustomization);
+
+ assertThat(actual, sameBeanAs(expected));
+ }
+
+ @Test
public void testMapNameValueUserParams() throws IOException {
RequestDetails requestDetails = mapper.readValue(new File(RESOURCE_PATH + "RequestDetailsInput_mapReqContext.json"), RequestDetails.class);
Map<String,Object> actual = bbInputSetupMapperLayer.mapNameValueUserParams(requestDetails.getRequestParameters());
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java
index cea8fc3cc2..4b10d513d6 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java
@@ -93,6 +93,7 @@ import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization;
import org.onap.so.db.catalog.beans.CollectionResource;
import org.onap.so.db.catalog.beans.CollectionResourceCustomization;
import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization;
+import org.onap.so.db.catalog.beans.ConfigurationResource;
import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization;
import org.onap.so.db.catalog.beans.InstanceGroupType;
import org.onap.so.db.catalog.beans.NetworkCollectionResourceCustomization;
@@ -101,6 +102,7 @@ import org.onap.so.db.catalog.beans.OrchestrationStatus;
import org.onap.so.db.catalog.beans.Service;
import org.onap.so.db.catalog.beans.VfModuleCustomization;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
+import org.onap.so.db.catalog.beans.VnfVfmoduleCvnfcConfigurationCustomization;
import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.serviceinstancebeans.CloudConfiguration;
@@ -356,13 +358,61 @@ public class BBInputSetupTest {
String resourceId = "123";
String requestAction = "createInstance";
- doReturn(null).when(bbInputSetupMapperLayer).mapAAIGenericVnfIntoGenericVnf(ArgumentMatchers.isNull());
+ lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, "vnf-001");
+
+ doReturn(new org.onap.aai.domain.yang.GenericVnf()).when(SPY_bbInputSetupUtils).getAAIGenericVnf(ArgumentMatchers.isA(String.class));
+ doReturn(null).when(bbInputSetupMapperLayer).mapAAIGenericVnfIntoGenericVnf(ArgumentMatchers.isA(org.onap.aai.domain.yang.GenericVnf.class));
GeneralBuildingBlock actual = SPY_bbInputSetup.getGBBCM(executeBB, requestDetails, lookupKeyMap, requestAction,
resourceId);
-
assertThat(actual, sameBeanAs(expected));
}
+
+ @Test
+ public void testGetGBBCMAddMembersAction() throws Exception {
+ GeneralBuildingBlock expected = mapper.readValue(new File(RESOURCE_PATH + "GeneralBuildingBlockInstanceGroupExpected.json"),
+ GeneralBuildingBlock.class);
+ ExecuteBuildingBlock executeBB = mapper.readValue(new File(RESOURCE_PATH + "ExecuteBuildingBlockSimple.json"),
+ ExecuteBuildingBlock.class);
+ RequestDetails requestDetails = mapper.readValue(
+ new File(RESOURCE_PATH + "RequestDetailsInput_instanceGroupAddMembers.json"), RequestDetails.class);
+ Map<ResourceKey, String> lookupKeyMap = new HashMap<>();
+ String requestAction = "addMembers";
+ String instanceGroupId = "instance-group-001";
+
+ WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+ workflowResourceIds.setInstanceGroupId(instanceGroupId);
+ executeBB.setWorkflowResourceIds(workflowResourceIds);
+
+ lookupKeyMap.put(ResourceKey.INSTANCE_GROUP_ID, instanceGroupId);
+
+ org.onap.aai.domain.yang.InstanceGroup aaiInstanceGroup = new org.onap.aai.domain.yang.InstanceGroup();
+ aaiInstanceGroup.setId(instanceGroupId);
+ aaiInstanceGroup.setInstanceGroupName("test instance group 1");
+
+ org.onap.aai.domain.yang.ServiceInstance aaiServiceInstance = new org.onap.aai.domain.yang.ServiceInstance();
+ aaiServiceInstance.setServiceInstanceId("service-instance-001");
+ aaiServiceInstance.setServiceInstanceName("test service instance 1");
+ Optional<org.onap.aai.domain.yang.ServiceInstance> optSI = Optional.of(aaiServiceInstance);
+
+ org.onap.aai.domain.yang.GenericVnf vnf1 = new org.onap.aai.domain.yang.GenericVnf();
+ vnf1.setVnfId("vnf-001");
+ vnf1.setVnfName("test vnf 1");
+
+ org.onap.aai.domain.yang.GenericVnf vnf2 = new org.onap.aai.domain.yang.GenericVnf();
+ vnf2.setVnfId("vnf-002");
+ vnf2.setVnfName("test vnf 2");
+
+ doReturn(aaiInstanceGroup).when(SPY_bbInputSetupUtils).getAAIInstanceGroup(instanceGroupId);
+ doReturn(optSI).when(SPY_bbInputSetupUtils).getRelatedServiceInstanceFromInstanceGroup(instanceGroupId);
+ doReturn(vnf1).when(SPY_bbInputSetupUtils).getAAIGenericVnf("vnf-001");
+ doReturn(vnf2).when(SPY_bbInputSetupUtils).getAAIGenericVnf("vnf-002");
+
+ GeneralBuildingBlock actual = SPY_bbInputSetup.getGBBCM(executeBB, requestDetails, lookupKeyMap,
+ requestAction, instanceGroupId);
+ assertThat(actual, sameBeanAs(expected));
+ }
+
@Test
public void testGetGBBALaCarteNonService() throws Exception {
GeneralBuildingBlock expected = mapper.readValue(new File(RESOURCE_PATH + "GeneralBuildingBlockExpected.json"),
@@ -385,7 +435,7 @@ public class BBInputSetupTest {
doReturn(aaiServiceInstance).when(SPY_bbInputSetupUtils).getAAIServiceInstanceById("instanceId");
doNothing().when(SPY_bbInputSetup).populateObjectsOnAssignAndCreateFlows(requestDetails, service, "bbName",
- serviceInstance, lookupKeyMap, resourceId, vnfType);
+ serviceInstance, lookupKeyMap, resourceId, vnfType, null, null);
doReturn(serviceInstance).when(SPY_bbInputSetup).getExistingServiceInstance(aaiServiceInstance);
doReturn(expected).when(SPY_bbInputSetup).populateGBBWithSIAndAdditionalInfo(requestDetails, serviceInstance,
executeBB, requestAction, null);
@@ -435,7 +485,7 @@ public class BBInputSetupTest {
doReturn(aaiServiceInstance).when(SPY_bbInputSetupUtils).getAAIServiceInstanceById("instanceId");
doNothing().when(SPY_bbInputSetup).populateObjectsOnAssignAndCreateFlows(requestDetails, service, "bbName",
- serviceInstance, lookupKeyMap, resourceId, vnfType);
+ serviceInstance, lookupKeyMap, resourceId, vnfType, null, null);
doReturn(serviceInstance).when(SPY_bbInputSetup).getExistingServiceInstance(aaiServiceInstance);
doReturn(expected).when(SPY_bbInputSetup).populateGBBWithSIAndAdditionalInfo(requestDetails, serviceInstance,
@@ -738,7 +788,7 @@ public class BBInputSetupTest {
doReturn(ModelType.network).when(modelInfo).getModelType();
SPY_bbInputSetup.populateObjectsOnAssignAndCreateFlows(requestDetails, service, bbName, serviceInstance,
- lookupKeyMap, resourceId, vnfType);
+ lookupKeyMap, resourceId, vnfType, null, null);
verify(SPY_bbInputSetup, times(1)).populateL3Network(instanceName, modelInfo, service, bbName, serviceInstance,
lookupKeyMap, resourceId, null);
assertEquals("NetworkId populated", true, lookupKeyMap.get(ResourceKey.NETWORK_ID).equalsIgnoreCase(resourceId));
@@ -748,7 +798,7 @@ public class BBInputSetupTest {
doNothing().when(SPY_bbInputSetup).populateGenericVnf(modelInfo, instanceName, platform, lineOfBusiness,
service, bbName, serviceInstance, lookupKeyMap, relatedInstanceList, resourceId, vnfType, null, productFamilyId);
SPY_bbInputSetup.populateObjectsOnAssignAndCreateFlows(requestDetails, service, bbName, serviceInstance,
- lookupKeyMap, resourceId, vnfType);
+ lookupKeyMap, resourceId, vnfType, null, null);
verify(SPY_bbInputSetup, times(1)).populateGenericVnf(modelInfo, instanceName, platform, lineOfBusiness,
service, bbName, serviceInstance, lookupKeyMap, relatedInstanceList, resourceId, vnfType, null, productFamilyId);
assertEquals("VnfId populated", true, lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID).equalsIgnoreCase(resourceId));
@@ -758,7 +808,7 @@ public class BBInputSetupTest {
doNothing().when(SPY_bbInputSetup).populateVolumeGroup(modelInfo, service, bbName, serviceInstance,
lookupKeyMap, resourceId, relatedInstanceList, instanceName, vnfType, null);
SPY_bbInputSetup.populateObjectsOnAssignAndCreateFlows(requestDetails, service, bbName, serviceInstance,
- lookupKeyMap, resourceId, vnfType);
+ lookupKeyMap, resourceId, vnfType, null, null);
verify(SPY_bbInputSetup, times(1)).populateVolumeGroup(modelInfo, service, bbName, serviceInstance,
lookupKeyMap, resourceId, relatedInstanceList, instanceName, vnfType, null);
assertEquals("VolumeGroupId populated", true, lookupKeyMap.get(ResourceKey.VOLUME_GROUP_ID).equalsIgnoreCase(resourceId));
@@ -768,7 +818,7 @@ public class BBInputSetupTest {
doNothing().when(SPY_bbInputSetup).populateVfModule(modelInfo, service, bbName, serviceInstance, lookupKeyMap,
resourceId, relatedInstanceList, instanceName, null, cloudConfiguration);
SPY_bbInputSetup.populateObjectsOnAssignAndCreateFlows(requestDetails, service, bbName, serviceInstance,
- lookupKeyMap, resourceId, vnfType);
+ lookupKeyMap, resourceId, vnfType, null, null);
verify(SPY_bbInputSetup, times(1)).populateVfModule(modelInfo, service, bbName, serviceInstance, lookupKeyMap,
resourceId, relatedInstanceList, instanceName, null, cloudConfiguration);
assertEquals("VfModuleId populated", true, lookupKeyMap.get(ResourceKey.VF_MODULE_ID).equalsIgnoreCase(resourceId));
@@ -787,7 +837,9 @@ public class BBInputSetupTest {
ServiceInstance serviceInstance = mapper.readValue(
new File(RESOURCE_PATH + "ServiceInstance_getServiceInstanceNOAAIExpected.json"),
ServiceInstance.class);
-
+ CloudConfiguration cloudConfiguration = new CloudConfiguration();
+ cloudConfiguration.setTenantId("tenantId");
+ requestDetails.setCloudConfiguration(cloudConfiguration);
OrchestrationContext orchestrationContext = new OrchestrationContext();
orchestrationContext.setIsRollbackEnabled(false);
@@ -808,17 +860,30 @@ public class BBInputSetupTest {
customer.setSubscriberName("subscriberName");
customer.setSubscriberType("subscriberType");
customer.setServiceSubscription(serviceSubscription);
+
+ org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant tenant = new org.onap.so.bpmn.servicedecomposition.bbobjects.Tenant();
+ tenant.setTenantContext("tenantContext");
+ tenant.setTenantId("tenantId");
+ tenant.setTenantName("tenantName");
org.onap.aai.domain.yang.CloudRegion aaiCloudRegion = Mockito.mock(org.onap.aai.domain.yang.CloudRegion.class);
+ org.onap.aai.domain.yang.Tenants aaiTenants = Mockito.mock(org.onap.aai.domain.yang.Tenants.class);
+ org.onap.aai.domain.yang.Tenant aaiTenant = new org.onap.aai.domain.yang.Tenant();
+ aaiTenant.setTenantId("tenantId");
+ List<org.onap.aai.domain.yang.Tenant> tenants = new ArrayList<>();
+ tenants.add(aaiTenant);
String requestAction = "createInstance";
-
+
doReturn(uriKeys).when(SPY_bbInputSetupUtils).getURIKeysFromServiceInstance(serviceInstance.getServiceInstanceId());
doReturn(customer).when(SPY_bbInputSetup).mapCustomer(uriKeys.get("global-customer-id"),uriKeys.get("service-type"));
doReturn(aaiCloudRegion).when(SPY_bbInputSetupUtils).getCloudRegion(requestDetails.getCloudConfiguration());
doReturn(orchestrationContext).when(bbInputSetupMapperLayer).mapOrchestrationContext(requestDetails);
doReturn(requestContext).when(bbInputSetupMapperLayer).mapRequestContext(requestDetails);
doReturn(cloudRegion).when(bbInputSetupMapperLayer).mapCloudRegion(requestDetails.getCloudConfiguration(), aaiCloudRegion);
+ doReturn(tenant).when(bbInputSetupMapperLayer).mapTenant(aaiTenant);
+ doReturn(aaiTenants).when(aaiCloudRegion).getTenants();
+ doReturn(tenants).when(aaiTenants).getTenant();
GeneralBuildingBlock actual = SPY_bbInputSetup.populateGBBWithSIAndAdditionalInfo(requestDetails,
serviceInstance, executeBB, requestAction, null);
@@ -951,6 +1016,21 @@ public class BBInputSetupTest {
}
@Test
+ public void testPopulateInstanceGroup() throws Exception {
+ ModelInfo modelInfo = Mockito.mock(ModelInfo.class);
+ Service service = Mockito.mock(Service.class);
+ List<InstanceGroup> instanceGroups = Mockito.spy(new ArrayList<>());
+ ServiceInstance serviceInstance = Mockito.spy(new ServiceInstance());
+ serviceInstance.setServiceInstanceId("si-001");
+ serviceInstance.setServiceInstanceName("test service instance");
+ serviceInstance.setInstanceGroups(instanceGroups);
+
+ SPY_bbInputSetup.populateInstanceGroup(modelInfo, service, serviceInstance, "instance-group-001", "test instance group");
+ verify(SPY_bbInputSetup, times(1)).mapCatalogInstanceGroup(isA(InstanceGroup.class), isA(ModelInfo.class), isA(Service.class));
+ verify(instanceGroups, times(1)).add(isA(InstanceGroup.class));
+ }
+
+ @Test
public void testIsVlanTagging() throws Exception {
boolean expected = true;
Service service = Mockito.mock(Service.class);
@@ -1171,6 +1251,43 @@ public class BBInputSetupTest {
assertEquals(modelInfoNetwork, network.getModelInfoNetwork());
}
+
+ @Test
+ public void testPopulateFabricConfiguration() throws JsonParseException, JsonMappingException, IOException {
+ String instanceName = "configurationName";
+ ModelInfo modelInfo = new ModelInfo();
+ modelInfo.setModelCustomizationUuid("72d9d1cd-f46d-447a-abdb-451d6fb05fa9");
+
+ ServiceInstance serviceInstance = new ServiceInstance();
+ Configuration configuration = new Configuration();
+ configuration.setConfigurationId("configurationId");
+ configuration.setConfigurationName("configurationName");
+ serviceInstance.getConfigurations().add(configuration);
+ String resourceId = "configurationId";
+ // Mock service
+ Service service = mapper.readValue(
+ new File(RESOURCE_PATH + "CatalogDBService_getServiceInstanceNOAAIInput.json"), Service.class);
+ Map<ResourceKey, String> lookupKeyMap = new HashMap<>();
+ lookupKeyMap.put(ResourceKey.CONFIGURATION_ID, "configurationId");
+ String bbName = AssignFlows.FABRIC_CONFIGURATION.toString();
+ ConfigurationResourceKeys configResourceKeys = new ConfigurationResourceKeys();
+ configResourceKeys.setCvnfcCustomizationUUID("cvnfcCustomizationUUID");
+ configResourceKeys.setVfModuleCustomizationUUID("vfModuleCustomizationUUID");
+ configResourceKeys.setVnfResourceCustomizationUUID("vnfResourceCustomizationUUID");
+
+ VnfVfmoduleCvnfcConfigurationCustomization vnfVfmoduleCvnfcConfigurationCustomization = new VnfVfmoduleCvnfcConfigurationCustomization();
+ ConfigurationResource configurationResource = new ConfigurationResource();
+ configurationResource.setModelUUID("modelUUID");
+ configurationResource.setModelInvariantUUID("modelInvariantUUID");
+ vnfVfmoduleCvnfcConfigurationCustomization.setConfigurationResource(configurationResource);
+
+ doReturn(null).when(SPY_bbInputSetup).findConfigurationResourceCustomization(modelInfo, service);
+ doReturn(vnfVfmoduleCvnfcConfigurationCustomization).when(SPY_bbInputSetup).findVnfVfmoduleCvnfcConfigurationCustomization("vfModuleCustomizationUUID","vnfResourceCustomizationUUID","cvnfcCustomizationUUID");
+
+ SPY_bbInputSetup.populateConfiguration(modelInfo, service, bbName, serviceInstance, lookupKeyMap, resourceId,
+ instanceName, configResourceKeys);
+ verify(SPY_bbInputSetup, times(1)).mapCatalogConfiguration(configuration, modelInfo, service, configResourceKeys);
+ }
@Test
public void testPopulateGenericVnf() throws JsonParseException, JsonMappingException, IOException {
@@ -1702,6 +1819,7 @@ public class BBInputSetupTest {
String vfModuleId = "vfModuleId";
String volumeGroupId = "volumeGroupId";
String configurationId = "configurationId";
+ String instanceGroupId = "instancegroupId";
expected.put(ResourceKey.SERVICE_INSTANCE_ID, serviceInstanceId);
expected.put(ResourceKey.NETWORK_ID, networkId);
@@ -1709,6 +1827,7 @@ public class BBInputSetupTest {
expected.put(ResourceKey.VF_MODULE_ID, vfModuleId);
expected.put(ResourceKey.VOLUME_GROUP_ID, volumeGroupId);
expected.put(ResourceKey.CONFIGURATION_ID, configurationId);
+ expected.put(ResourceKey.INSTANCE_GROUP_ID, instanceGroupId);
WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
workflowResourceIds.setServiceInstanceId(serviceInstanceId);
@@ -1717,7 +1836,8 @@ public class BBInputSetupTest {
workflowResourceIds.setVfModuleId(vfModuleId);
workflowResourceIds.setVolumeGroupId(volumeGroupId);
workflowResourceIds.setConfigurationId(configurationId);
-
+ workflowResourceIds.setInstanceGroupId(instanceGroupId);
+
SPY_bbInputSetup.populateLookupKeyMapWithIds(workflowResourceIds, actual);
assertThat(actual, sameBeanAs(expected));
@@ -2587,4 +2707,4 @@ public class BBInputSetupTest {
assertEquals("Lookup Key Map populated with VolumeGroup Id", volumeGroupId, lookupKeyMap.get(ResourceKey.VOLUME_GROUP_ID));
}
-}
+} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java
index ae1af8f960..54e513e7d9 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupUtilsTest.java
@@ -44,6 +44,7 @@ import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
+import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.aai.domain.yang.CloudRegion;
import org.onap.aai.domain.yang.Configuration;
@@ -58,6 +59,8 @@ import org.onap.aai.domain.yang.VolumeGroups;
import org.onap.so.bpmn.common.InjectionHelper;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceSubscription;
+import org.onap.so.bpmn.servicedecomposition.tasks.exceptions.MultipleObjectsFoundException;
+import org.onap.so.bpmn.servicedecomposition.tasks.exceptions.NoServiceInstanceFoundException;
import org.onap.so.client.aai.AAIObjectPlurals;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.AAIResourcesClient;
@@ -181,10 +184,10 @@ public class BBInputSetupUtilsTest {
expected.get().setCloudRegionId("lcpCloudRegionId");
doReturn(expected).when(MOCK_aaiResourcesClient).get(org.onap.aai.domain.yang.CloudRegion.class,
AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, cloudConfig.getCloudOwner(),
- cloudConfig.getLcpCloudRegionId()));
+ cloudConfig.getLcpCloudRegionId()).depth(Depth.TWO));
AAIResourceUri expectedUri = AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, cloudConfig.getCloudOwner(),
- cloudConfig.getLcpCloudRegionId());
+ cloudConfig.getLcpCloudRegionId()).depth(Depth.TWO);
bbInputSetupUtils.getCloudRegion(cloudConfig);
verify(MOCK_aaiResourcesClient, times(1)).get(CloudRegion.class, expectedUri);
@@ -636,6 +639,41 @@ public class BBInputSetupUtilsTest {
}
@Test
+ public void getRelatedServiceInstanceFromInstanceGroupTest() throws Exception {
+ Optional<ServiceInstances> expected = Optional.of(new ServiceInstances());
+ ServiceInstance serviceInstance = new ServiceInstance();
+ serviceInstance.setServiceInstanceId("serviceInstanceId");
+ serviceInstance.setServiceInstanceName("serviceInstanceName");
+ expected.get().getServiceInstance().add(serviceInstance);
+
+ doReturn(expected).when(MOCK_aaiResourcesClient).get(eq(ServiceInstances.class), any(AAIResourceUri.class));
+ Optional<ServiceInstance> actual = this.bbInputSetupUtils.getRelatedServiceInstanceFromInstanceGroup("ig-001");
+ assertEquals(actual.get().getServiceInstanceId(), expected.get().getServiceInstance().get(0).getServiceInstanceId());
+ }
+
+ @Test
+ public void getRelatedServiceInstanceFromInstanceGroupMultipleTest() throws Exception {
+ expectedException.expect(MultipleObjectsFoundException.class);
+ Optional<ServiceInstances> serviceInstances = Optional.of(new ServiceInstances());
+ ServiceInstance si1 = Mockito.mock(ServiceInstance.class);
+ ServiceInstance si2 = Mockito.mock(ServiceInstance.class);
+ serviceInstances.get().getServiceInstance().add(si1);
+ serviceInstances.get().getServiceInstance().add(si2);
+
+ doReturn(serviceInstances).when(MOCK_aaiResourcesClient).get(eq(ServiceInstances.class), any(AAIResourceUri.class));
+ this.bbInputSetupUtils.getRelatedServiceInstanceFromInstanceGroup("ig-001");
+ }
+
+ @Test
+ public void getRelatedServiceInstanceFromInstanceGroupNotFoundTest() throws Exception {
+ expectedException.expect(NoServiceInstanceFoundException.class);
+ Optional<ServiceInstances> serviceInstances = Optional.of(new ServiceInstances());
+
+ doReturn(serviceInstances).when(MOCK_aaiResourcesClient).get(eq(ServiceInstances.class), any(AAIResourceUri.class));
+ this.bbInputSetupUtils.getRelatedServiceInstanceFromInstanceGroup("ig-001");
+ }
+
+ @Test
public void getRelatedVnfByNameFromServiceInstanceTest() throws Exception {
Optional<GenericVnfs> expected = Optional.of(new GenericVnfs());
GenericVnf vnf = new GenericVnf();
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/MultipleObjectsFoundExceptionTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/MultipleObjectsFoundExceptionTest.java
new file mode 100644
index 0000000000..1cf70d050a
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/MultipleObjectsFoundExceptionTest.java
@@ -0,0 +1,67 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 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.onap.so.bpmn.servicedecomposition.tasks.exceptions;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.so.bpmn.servicedecomposition.tasks.exceptions.MultipleObjectsFoundException;
+
+public class MultipleObjectsFoundExceptionTest {
+ private static final String MESSAGE = "message";
+ private static final Throwable CAUSE = new Throwable();
+ private MultipleObjectsFoundException MultipleObjectsFoundException;
+
+ @Test
+ public void defaultConstructorTest() {
+ MultipleObjectsFoundException = new MultipleObjectsFoundException();
+ assertEquals(null, MultipleObjectsFoundException.getMessage());
+ assertEquals(null, MultipleObjectsFoundException.getCause());
+ }
+
+ @Test
+ public void messageConstructorTest() {
+ MultipleObjectsFoundException = new MultipleObjectsFoundException(MESSAGE);
+ assertEquals(MESSAGE, MultipleObjectsFoundException.getMessage());
+ assertEquals(null, MultipleObjectsFoundException.getCause());
+ }
+
+ @Test
+ public void causeConstructorTest() {
+ MultipleObjectsFoundException = new MultipleObjectsFoundException(CAUSE);
+ assertEquals(CAUSE.toString(), MultipleObjectsFoundException.getMessage());
+ assertEquals(CAUSE, MultipleObjectsFoundException.getCause());
+ }
+
+ @Test
+ public void messageAndCauseConstructorTest() {
+ MultipleObjectsFoundException = new MultipleObjectsFoundException(MESSAGE, CAUSE);
+ assertEquals(MESSAGE, MultipleObjectsFoundException.getMessage());
+ assertEquals(CAUSE, MultipleObjectsFoundException.getCause());
+ }
+
+ @Test
+ public void messageAndCauseAndFlagsConstructorTest() {
+ MultipleObjectsFoundException = new MultipleObjectsFoundException(MESSAGE, CAUSE, true, true);
+ assertEquals(MESSAGE, MultipleObjectsFoundException.getMessage());
+ assertEquals(CAUSE, MultipleObjectsFoundException.getCause());
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/NoServiceInstanceFoundExceptionTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/NoServiceInstanceFoundExceptionTest.java
new file mode 100644
index 0000000000..344481dbed
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/exceptions/NoServiceInstanceFoundExceptionTest.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 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.onap.so.bpmn.servicedecomposition.tasks.exceptions;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class NoServiceInstanceFoundExceptionTest {
+ private static final String MESSAGE = "message";
+ private static final Throwable CAUSE = new Throwable();
+ private NoServiceInstanceFoundException NoObjectFoundException;
+
+ @Test
+ public void defaultConstructorTest() {
+ NoObjectFoundException = new NoServiceInstanceFoundException();
+ assertEquals(null, NoObjectFoundException.getMessage());
+ assertEquals(null, NoObjectFoundException.getCause());
+ }
+
+ @Test
+ public void messageConstructorTest() {
+ NoObjectFoundException = new NoServiceInstanceFoundException(MESSAGE);
+ assertEquals(MESSAGE, NoObjectFoundException.getMessage());
+ assertEquals(null, NoObjectFoundException.getCause());
+ }
+
+ @Test
+ public void causeConstructorTest() {
+ NoObjectFoundException = new NoServiceInstanceFoundException(CAUSE);
+ assertEquals(CAUSE.toString(), NoObjectFoundException.getMessage());
+ assertEquals(CAUSE, NoObjectFoundException.getCause());
+ }
+
+ @Test
+ public void messageAndCauseConstructorTest() {
+ NoObjectFoundException = new NoServiceInstanceFoundException(MESSAGE, CAUSE);
+ assertEquals(MESSAGE, NoObjectFoundException.getMessage());
+ assertEquals(CAUSE, NoObjectFoundException.getCause());
+ }
+
+ @Test
+ public void messageAndCauseAndFlagsConstructorTest() {
+ NoObjectFoundException = new NoServiceInstanceFoundException(MESSAGE, CAUSE, true, true);
+ assertEquals(MESSAGE, NoObjectFoundException.getMessage());
+ assertEquals(CAUSE, NoObjectFoundException.getCause());
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json
index a53ed4dfde..fe33308d78 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json
@@ -16,6 +16,8 @@
"cloudRegion": {
"lcp-cloud-region-id" : "myRegionId",
"cloud-owner": "CloudOwner"
+ },
+ "tenant": {
},
"userInput": null,
"customer": {
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json
index 5eb9a26901..b18cad0620 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json
@@ -44,6 +44,11 @@
"tenant-id": "tenantId",
"complex": "complexName"
},
+ "tenant": {
+ "tenant-name": "tenantName",
+ "tenant-context": "tenantContext",
+ "tenant-id": "tenantId"
+ },
"userInput": null,
"customer": {
"global-customer-id": "globalCustomerId",
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpectedWUserParamsInfo.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpectedWUserParamsInfo.json
index 5ac07c6546..f07f060b06 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpectedWUserParamsInfo.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpectedWUserParamsInfo.json
@@ -55,6 +55,11 @@
"complex": "complexName"
},
"userInput": null,
+ "tenant": {
+ "tenant-id": "tenantId",
+ "tenant-name": "tenantName",
+ "tenant-context": "tenantContext"
+ },
"customer": {
"global-customer-id": "globalCustomerId",
"subscriber-name": "subscriberName",
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockInstanceGroupExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockInstanceGroupExpected.json
new file mode 100644
index 0000000000..f55717fc91
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockInstanceGroupExpected.json
@@ -0,0 +1,323 @@
+{
+ "requestContext": {
+ "product-family-id": null,
+ "source": "VID",
+ "requestor-id": "az2016",
+ "subscription-service-type": null,
+ "user-params": {
+
+ },
+ "action": "addMembers",
+ "callback-url": null,
+ "service-uri": null,
+ "mso-request-id": "requestId",
+ "requestParameters": {
+
+ },
+ "configurationParameters": []
+ },
+ "orchContext": {
+ "is-rollback-enabled": true
+ },
+ "userInput": null,
+ "tenant": {
+ },
+ "cloudRegion": {
+ "lcp-cloud-region-id": null,
+ "cloud-owner": null,
+ "tenant-id": null,
+ "complex": null,
+ "cloud-region-version": null
+ },
+ "customer": {
+ "global-customer-id": null,
+ "subscriber-name": null,
+ "subscriber-type": null,
+ "subscriber-common-site-id": null,
+ "service-subscription": {
+ "service-type": null,
+ "temp-ub-sub-account-id": null,
+ "service-instances": [
+ {
+ "service-instance-id": "service-instance-001",
+ "service-instance-name": "test service instance 1",
+ "orchestration-status": null,
+ "owning-entity": null,
+ "project": null,
+ "collection": null,
+ "vnfs": [],
+ "pnfs": [],
+ "allotted-resources": [],
+ "networks": [],
+ "vpn-bonding-links": [],
+ "vhn-portal-url": null,
+ "service-instance-location-id": null,
+ "selflink": null,
+ "metadata": null,
+ "configurations": [],
+ "solution-info": null,
+ "model-info-service-instance": null,
+ "instance-groups": [
+ {
+ "id": "instance-group-001",
+ "description": null,
+ "resource-version": null,
+ "instance-group-name": "test instance group 1",
+ "orchestration-status": "INVENTORIED",
+ "model-info-instance-group": null,
+ "instance-group-function": null,
+ "vnfs": [
+ {
+ "vnf-id": "vnf-001",
+ "vnf-name": "test vnf 1",
+ "vnf-type": null,
+ "orchestration-status": null,
+ "vf-modules": [],
+ "volume-groups": [],
+ "line-of-business": null,
+ "platform": null,
+ "cascaded": null,
+ "cloud-params": {
+
+ },
+ "cloud-context": null,
+ "solution": null,
+ "vnf-name-2": null,
+ "service-id": null,
+ "regional-resource-zone": null,
+ "prov-status": null,
+ "operational-status": null,
+ "equipment-role": null,
+ "management-option": null,
+ "ipv4-oam-address": null,
+ "ipv4-loopback0-address": null,
+ "nm-lan-v6-address": null,
+ "management-v6-address": null,
+ "vcpu": null,
+ "vcpu-units": null,
+ "vmemory": null,
+ "vmemory-units": null,
+ "vdisk": null,
+ "vdisk-units": null,
+ "in-maint": null,
+ "is-closed-loop-disabled": null,
+ "summary-status": null,
+ "encrypted-access-flag": null,
+ "as-number": null,
+ "regional-resource-subzone": null,
+ "self-link": null,
+ "ipv4-oam-gateway-address": null,
+ "ipv4-oam-gateway-address-prefix-length": null,
+ "vlan-id-outer": null,
+ "nm-profile-name": null,
+ "l-interfaces": [],
+ "lag-interfaces": [],
+ "license": null,
+ "entitlements": [],
+ "model-info-generic-vnf": null,
+ "instance-groups": [],
+ "call-homing": null,
+ "nf-function": null,
+ "nf-role": null
+ },
+ {
+ "vnf-id": "vnf-002",
+ "vnf-name": "test vnf 2",
+ "vnf-type": null,
+ "orchestration-status": null,
+ "vf-modules": [],
+ "volume-groups": [],
+ "line-of-business": null,
+ "platform": null,
+ "cascaded": null,
+ "cloud-params": {
+
+ },
+ "cloud-context": null,
+ "solution": null,
+ "vnf-name-2": null,
+ "service-id": null,
+ "regional-resource-zone": null,
+ "prov-status": null,
+ "operational-status": null,
+ "equipment-role": null,
+ "management-option": null,
+ "ipv4-oam-address": null,
+ "ipv4-loopback0-address": null,
+ "nm-lan-v6-address": null,
+ "management-v6-address": null,
+ "vcpu": null,
+ "vcpu-units": null,
+ "vmemory": null,
+ "vmemory-units": null,
+ "vdisk": null,
+ "vdisk-units": null,
+ "in-maint": null,
+ "is-closed-loop-disabled": null,
+ "summary-status": null,
+ "encrypted-access-flag": null,
+ "as-number": null,
+ "regional-resource-subzone": null,
+ "self-link": null,
+ "ipv4-oam-gateway-address": null,
+ "ipv4-oam-gateway-address-prefix-length": null,
+ "vlan-id-outer": null,
+ "nm-profile-name": null,
+ "l-interfaces": [],
+ "lag-interfaces": [],
+ "license": null,
+ "entitlements": [],
+ "model-info-generic-vnf": null,
+ "instance-groups": [],
+ "call-homing": null,
+ "nf-function": null,
+ "nf-role": null
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "vpn-bindings": []
+ },
+ "serviceInstance": {
+ "service-instance-id": "service-instance-001",
+ "service-instance-name": "test service instance 1",
+ "orchestration-status": null,
+ "owning-entity": null,
+ "project": null,
+ "collection": null,
+ "vnfs": [],
+ "pnfs": [],
+ "allotted-resources": [],
+ "networks": [],
+ "vpn-bonding-links": [],
+ "vhn-portal-url": null,
+ "service-instance-location-id": null,
+ "selflink": null,
+ "metadata": null,
+ "configurations": [],
+ "solution-info": null,
+ "model-info-service-instance": null,
+ "instance-groups": [
+ {
+ "id": "instance-group-001",
+ "description": null,
+ "resource-version": null,
+ "instance-group-name": "test instance group 1",
+ "orchestration-status": "INVENTORIED",
+ "model-info-instance-group": null,
+ "instance-group-function": null,
+ "vnfs": [
+ {
+ "vnf-id": "vnf-001",
+ "vnf-name": "test vnf 1",
+ "vnf-type": null,
+ "orchestration-status": null,
+ "vf-modules": [],
+ "volume-groups": [],
+ "line-of-business": null,
+ "platform": null,
+ "cascaded": null,
+ "cloud-params": {
+
+ },
+ "cloud-context": null,
+ "solution": null,
+ "vnf-name-2": null,
+ "service-id": null,
+ "regional-resource-zone": null,
+ "prov-status": null,
+ "operational-status": null,
+ "equipment-role": null,
+ "management-option": null,
+ "ipv4-oam-address": null,
+ "ipv4-loopback0-address": null,
+ "nm-lan-v6-address": null,
+ "management-v6-address": null,
+ "vcpu": null,
+ "vcpu-units": null,
+ "vmemory": null,
+ "vmemory-units": null,
+ "vdisk": null,
+ "vdisk-units": null,
+ "in-maint": null,
+ "is-closed-loop-disabled": null,
+ "summary-status": null,
+ "encrypted-access-flag": null,
+ "as-number": null,
+ "regional-resource-subzone": null,
+ "self-link": null,
+ "ipv4-oam-gateway-address": null,
+ "ipv4-oam-gateway-address-prefix-length": null,
+ "vlan-id-outer": null,
+ "nm-profile-name": null,
+ "l-interfaces": [],
+ "lag-interfaces": [],
+ "license": null,
+ "entitlements": [],
+ "model-info-generic-vnf": null,
+ "instance-groups": [],
+ "call-homing": null,
+ "nf-function": null,
+ "nf-role": null
+ },
+ {
+ "vnf-id": "vnf-002",
+ "vnf-name": "test vnf 2",
+ "vnf-type": null,
+ "orchestration-status": null,
+ "vf-modules": [],
+ "volume-groups": [],
+ "line-of-business": null,
+ "platform": null,
+ "cascaded": null,
+ "cloud-params": {
+
+ },
+ "cloud-context": null,
+ "solution": null,
+ "vnf-name-2": null,
+ "service-id": null,
+ "regional-resource-zone": null,
+ "prov-status": null,
+ "operational-status": null,
+ "equipment-role": null,
+ "management-option": null,
+ "ipv4-oam-address": null,
+ "ipv4-loopback0-address": null,
+ "nm-lan-v6-address": null,
+ "management-v6-address": null,
+ "vcpu": null,
+ "vcpu-units": null,
+ "vmemory": null,
+ "vmemory-units": null,
+ "vdisk": null,
+ "vdisk-units": null,
+ "in-maint": null,
+ "is-closed-loop-disabled": null,
+ "summary-status": null,
+ "encrypted-access-flag": null,
+ "as-number": null,
+ "regional-resource-subzone": null,
+ "self-link": null,
+ "ipv4-oam-gateway-address": null,
+ "ipv4-oam-gateway-address-prefix-length": null,
+ "vlan-id-outer": null,
+ "nm-profile-name": null,
+ "l-interfaces": [],
+ "lag-interfaces": [],
+ "license": null,
+ "entitlements": [],
+ "model-info-generic-vnf": null,
+ "instance-groups": [],
+ "call-homing": null,
+ "nf-function": null,
+ "nf-role": null
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetailsInput_instanceGroupAddMembers.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetailsInput_instanceGroupAddMembers.json
new file mode 100644
index 0000000000..96684b6680
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/RequestDetailsInput_instanceGroupAddMembers.json
@@ -0,0 +1,27 @@
+{
+ "requestInfo": {
+ "source": "VID",
+ "requestorId": "az2016"
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": "vnf-001",
+ "modelInfo": {
+ "modelType": "vnf"
+ }
+ }
+ },
+ {
+ "relatedInstance": {
+ "instanceId": "vnf-002",
+ "modelInfo": {
+ "modelType": "vnf"
+ }
+ }
+ }
+ ],
+ "requestParameters": {
+ "userParams": []
+ }
+} \ No newline at end of file
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerService.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerService.java
index 920cb11e4c..f4617f9978 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerService.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerService.java
@@ -50,12 +50,16 @@ public class CallbackHandlerService {
public static final long FAST_POLL_DUR_SECONDS = 5;
public static final long FAST_POLL_INT_MS = 100;
public static final long SLOW_POLL_INT_MS = 1000;
-
+
private static final Logger logger = LoggerFactory.getLogger(CallbackHandlerService.class);
+ private RuntimeService runtimeService;
+
@Autowired
- RuntimeService runtimeService;
-
+ public CallbackHandlerService(RuntimeService runtimeService) {
+ this.runtimeService = runtimeService;
+ }
+
/**
* Parameterized callback handler.
*/
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/SDNCAdapterCallbackServiceImpl.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/SDNCAdapterCallbackServiceImpl.java
index 710144dbb9..267e24fec4 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/SDNCAdapterCallbackServiceImpl.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/SDNCAdapterCallbackServiceImpl.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -63,7 +65,6 @@ public class SDNCAdapterCallbackServiceImpl extends ProcessEngineAwareService im
String correlationVariable = "SDNCA_requestId";
String correlationValue = sdncAdapterCallbackRequest.getCallbackHeader().getRequestId();
- MsoLogger.setServiceName("MSO." + method);
MsoLogger.setLogContext(correlationValue, "N/A");
CallbackResult result = callback.handleCallback(method, message, messageEventName,
@@ -88,4 +89,4 @@ public class SDNCAdapterCallbackServiceImpl extends ProcessEngineAwareService im
return error;
}
}
-} \ No newline at end of file
+}
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/VnfAdapterNotifyServiceImpl.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/VnfAdapterNotifyServiceImpl.java
index 96a11d21a7..65cc70d5f4 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/VnfAdapterNotifyServiceImpl.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/VnfAdapterNotifyServiceImpl.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -116,7 +118,6 @@ public class VnfAdapterNotifyServiceImpl extends ProcessEngineAwareService imple
String correlationVariable = "VNFQ_messageId";
String correlationValue = messageId;
- MsoLogger.setServiceName("MSO." + method);
MsoLogger.setLogContext(correlationValue, "N/A");
QueryVnfNotification message = new QueryVnfNotification();
@@ -160,7 +161,6 @@ public class VnfAdapterNotifyServiceImpl extends ProcessEngineAwareService imple
String correlationVariable = "VNFC_messageId";
String correlationValue = messageId;
- MsoLogger.setServiceName("MSO." + method);
MsoLogger.setLogContext(correlationValue, "N/A");
CreateVnfNotification message = new CreateVnfNotification();
@@ -201,7 +201,6 @@ public class VnfAdapterNotifyServiceImpl extends ProcessEngineAwareService imple
String correlationVariable = "VNFU_messageId";
String correlationValue = messageId;
- MsoLogger.setServiceName("MSO." + method);
MsoLogger.setLogContext(correlationValue, "N/A");
UpdateVnfNotification message = new UpdateVnfNotification();
@@ -237,7 +236,6 @@ public class VnfAdapterNotifyServiceImpl extends ProcessEngineAwareService imple
String correlationVariable = "VNFDEL_uuid";
String correlationValue = messageId;
- MsoLogger.setServiceName("MSO." + method);
MsoLogger.setLogContext(correlationValue, "N/A");
DeleteVnfNotification message = new DeleteVnfNotification();
@@ -250,4 +248,4 @@ public class VnfAdapterNotifyServiceImpl extends ProcessEngineAwareService imple
callback.handleCallback(method, message, messageEventName, messageVariable,
correlationVariable, correlationValue, logMarker);
}
-} \ No newline at end of file
+}
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowMessageResource.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowMessageResource.java
index 8b35f0e6d6..072dec28c6 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowMessageResource.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowMessageResource.java
@@ -79,7 +79,6 @@ public class WorkflowMessageResource{
String message) {
String method = "receiveWorkflowMessage";
- MsoLogger.setServiceName("MSO." + method);
MsoLogger.setLogContext(correlator, "N/A");
logger.debug(LOGMARKER + " Received workflow message"
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java
index 92f1b7a816..d10ecd1ce2 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java
@@ -237,7 +237,6 @@ public class WorkflowResource extends ProcessEngineAwareService {
}
private void setLogContext(String processKey, Map<String, Object> inputVariables) {
- MsoLogger.setServiceName("MSO." + processKey);
if (inputVariables != null) {
MsoLogger.setLogContext(getValueFromInputVariables(inputVariables, "mso-request-id"),
getValueFromInputVariables(inputVariables, "mso-service-instance-id"));
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java
index 62aad7e345..04059557ae 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java
@@ -314,7 +314,6 @@ public class LoggingAndURNMappingPlugin extends AbstractProcessEnginePlugin {
.getName();
- MsoLogger.setServiceName(processName);
String requestId = (String) execution.getVariable("mso-request-id");
String svcid = (String) execution.getVariable("mso-service-instance-id");
MsoLogger.setLogContext(requestId, svcid);
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerServiceTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerServiceTest.java
new file mode 100644
index 0000000000..051107bb13
--- /dev/null
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerServiceTest.java
@@ -0,0 +1,103 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 Nokia.
+ * ================================================================================
+ * 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.onap.so.bpmn.common.workflow.service;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import org.camunda.bpm.engine.RuntimeService;
+import org.camunda.bpm.engine.impl.ExecutionQueryImpl;
+import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity;
+import org.camunda.bpm.engine.runtime.Execution;
+import org.camunda.bpm.engine.runtime.ExecutionQuery;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.so.bpmn.common.workflow.service.CallbackHandlerService.CallbackError;
+import org.onap.so.bpmn.common.workflow.service.CallbackHandlerService.CallbackResult;
+import org.onap.so.bpmn.common.workflow.service.CallbackHandlerService.CallbackSuccess;
+import org.onap.so.bpmn.core.UrnPropertiesReader;
+import org.springframework.core.env.Environment;
+
+public class CallbackHandlerServiceTest {
+
+ private static final String METHOD_NAME = "testMethod";
+ private static final String MESSAGE = "testMessage";
+ private static final String EVENT_NAME = "eventNameTest";
+ private static final String MESSAGE_VARIABLE = "messageVarTest";
+ private static final String CORRELATION_VARIABLE = "corrVarTest";
+ private static final String CORRELATION_VALUE = "corrValueTest";
+ private static final String LOG_MARKER = "markerTest";
+
+ private RuntimeService runtimeServiceMock;
+ private CallbackHandlerService testedObject;
+
+ @Before
+ public void setup() {
+ runtimeServiceMock = mock(RuntimeService.class);
+ testedObject = new CallbackHandlerService(runtimeServiceMock);
+ mockEnvironment();
+ }
+
+ @Test
+ public void callbackSuccessful() {
+ // given
+ mockRuntimeService(new ArrayList<>(Arrays.asList(new ExecutionEntity())));
+ // when
+ CallbackResult callbackResult = testedObject.handleCallback(METHOD_NAME, MESSAGE, EVENT_NAME, MESSAGE_VARIABLE,
+ CORRELATION_VARIABLE, CORRELATION_VALUE, LOG_MARKER, new HashMap<>());
+ // then
+ assertThat(callbackResult).isExactlyInstanceOf(CallbackSuccess.class);
+ }
+
+ @Test
+ public void callbackNotSuccessful_noWaitingProcesses() {
+ // given
+ mockRuntimeService(Collections.emptyList());
+ // when
+ CallbackResult callbackResult = testedObject.handleCallback(METHOD_NAME, MESSAGE, EVENT_NAME, MESSAGE_VARIABLE,
+ CORRELATION_VARIABLE, CORRELATION_VALUE, LOG_MARKER, new HashMap<>());
+ // then
+ assertThat(callbackResult).isExactlyInstanceOf(CallbackError.class);
+ }
+
+ private void mockRuntimeService(List<Execution> waitingProcesses) {
+ ExecutionQuery executionQueryMock = mock(ExecutionQueryImpl.class);
+ when(runtimeServiceMock.createExecutionQuery()).thenReturn(executionQueryMock);
+ when(executionQueryMock.messageEventSubscriptionName("eventNameTest")).thenReturn(executionQueryMock);
+ when(executionQueryMock.processVariableValueEquals("corrVarTest", "corrValueTest"))
+ .thenReturn(executionQueryMock);
+ when(executionQueryMock.list()).thenReturn(waitingProcesses);
+ }
+
+ private Environment mockEnvironment() {
+ Environment mockEnvironment = mock(Environment.class);
+ UrnPropertiesReader urnPropertiesReader = new UrnPropertiesReader();
+ urnPropertiesReader.setEnvironment(mockEnvironment);
+ when(mockEnvironment.getProperty("mso.correlation.timeout")).thenReturn("1");
+ return mockEnvironment;
+ }
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn
index fd24be100b..c841da3e3a 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn
@@ -35,7 +35,7 @@
<bpmn:incoming>SequenceFlow_0ghzwlo</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0xndboi</bpmn:outgoing>
</bpmn:serviceTask>
- <bpmn:serviceTask id="Audit_AAI_Inventory" name="Validate A&#38;AI Inventory" camunda:type="external" camunda:topic="InventoryAudit">
+ <bpmn:serviceTask id="Audit_AAI_Inventory" name="Validate A&#38;AI Inventory" camunda:type="external" camunda:topic="InventoryAddAudit">
<bpmn:incoming>SequenceFlow_0xndboi</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0ee42yq</bpmn:outgoing>
</bpmn:serviceTask>
@@ -54,7 +54,7 @@
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SequenceFlow_07ybdik" sourceRef="ExclusiveGateway_1v8bmbu" targetRef="ActivateVfModule" />
<bpmn:sequenceFlow id="SequenceFlow_0ghzwlo" sourceRef="ExclusiveGateway_1v8bmbu" targetRef="Setup_AAI_Inventory_Audit">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("auditInventoryNeeded").equals("true")}]]></bpmn:conditionExpression>
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("auditInventoryNeeded") == true}]]></bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="SequenceFlow_0ee42yq" sourceRef="Audit_AAI_Inventory" targetRef="ActivateVfModule" />
<bpmn:serviceTask id="CheckAuditVariable" name="Check Audit Variable" camunda:expression="${AuditTasks.isAuditNeeded(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteInstanceGroupBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteInstanceGroupBB.bpmn
new file mode 100644
index 0000000000..d16f4405b2
--- /dev/null
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteInstanceGroupBB.bpmn
@@ -0,0 +1,62 @@
+<?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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+ <bpmn:process id="DeleteInstanceGroupBB" name="DeleteInstanceGroupBB" isExecutable="true">
+ <bpmn:startEvent id="DeleteInstanceGroupBB_Start">
+ <bpmn:outgoing>SequenceFlow_0wlfmtw</bpmn:outgoing>
+ </bpmn:startEvent>
+ <bpmn:endEvent id="DeleteInstanceGroupBB_End">
+ <bpmn:incoming>SequenceFlow_068apyw</bpmn:incoming>
+ </bpmn:endEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_0wlfmtw" sourceRef="DeleteInstanceGroupBB_Start" targetRef="DeleteInstanceGroupNaming" />
+ <bpmn:sequenceFlow id="SequenceFlow_18azuvq" sourceRef="DeleteInstanceGroupNaming" targetRef="DeleteInstanceGroupAAI" />
+ <bpmn:sequenceFlow id="SequenceFlow_068apyw" sourceRef="DeleteInstanceGroupAAI" targetRef="DeleteInstanceGroupBB_End" />
+ <bpmn:serviceTask id="DeleteInstanceGroupNaming" name="Delete Instance Group from Naming mS" camunda:expression="${NamingServiceDeleteTasks.deleteInstanceGroupName(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:incoming>SequenceFlow_0wlfmtw</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_18azuvq</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:serviceTask id="DeleteInstanceGroupAAI" name="Delete Instance Group from A&#38;AI" camunda:expression="${AAIDeleteTasks.deleteInstanceGroup(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:incoming>SequenceFlow_18azuvq</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_068apyw</bpmn:outgoing>
+ </bpmn:serviceTask>
+ </bpmn:process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DeleteInstanceGroupBB">
+ <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="DeleteInstanceGroupBB_Start">
+ <dc:Bounds x="173" y="102" width="36" height="36" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="EndEvent_1fy6x5e_di" bpmnElement="DeleteInstanceGroupBB_End">
+ <dc:Bounds x="645" y="102" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="663" y="138" width="0" height="0" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0wlfmtw_di" bpmnElement="SequenceFlow_0wlfmtw">
+ <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="280" y="120" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="245" y="105" width="0" height="0" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_18azuvq_di" bpmnElement="SequenceFlow_18azuvq">
+ <di:waypoint xsi:type="dc:Point" x="380" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="460" y="120" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="420" y="105" width="0" height="0" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_068apyw_di" bpmnElement="SequenceFlow_068apyw">
+ <di:waypoint xsi:type="dc:Point" x="560" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="645" y="120" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="603" y="105" width="0" height="0" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_0nh16a5_di" bpmnElement="DeleteInstanceGroupNaming">
+ <dc:Bounds x="280" y="80" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_0ybtwi8_di" bpmnElement="DeleteInstanceGroupAAI">
+ <dc:Bounds x="460" y="80" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn
index 804ae70c58..e1b36cfe65 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn
@@ -1,14 +1,14 @@
<?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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+<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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.7.1">
<bpmn:process id="DeleteVfModuleBB" name="DeleteVfModuleBB" isExecutable="true">
<bpmn:startEvent id="DeleteVfModuleBB_Start">
<bpmn:outgoing>SequenceFlow_1537yw5</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:serviceTask id="DeleteVfModuleVnfAdapter" name="Delete Vf Module VnfAdapter" camunda:expression="${VnfAdapterDeleteTasks.deleteVfModule(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
- <bpmn:incoming>SequenceFlow_1537yw5</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_1n8gab5</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_08tvhtf</bpmn:outgoing>
</bpmn:serviceTask>
- <bpmn:sequenceFlow id="SequenceFlow_1537yw5" sourceRef="DeleteVfModuleBB_Start" targetRef="DeleteVfModuleVnfAdapter" />
+ <bpmn:sequenceFlow id="SequenceFlow_1537yw5" sourceRef="DeleteVfModuleBB_Start" targetRef="ExclusiveGateway_0xrgzm7" />
<bpmn:serviceTask id="UpdateVfModuleDeleteStatus" name="&#10;AAI &#10;Update&#10;(vf module)&#10;" camunda:expression="${AAIUpdateTasks.updateOrchestrationStatusDeleteVfModule(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
<bpmn:incoming>SequenceFlow_01vfwtp</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_09l7pcg</bpmn:outgoing>
@@ -32,7 +32,7 @@
<bpmn:incoming>SequenceFlow_08tvhtf</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_02lpx87</bpmn:outgoing>
</bpmn:callActivity>
- <bpmn:sequenceFlow id="SequenceFlow_02lpx87" sourceRef="VnfAdapter" targetRef="DeleteNetworkPolicies" />
+ <bpmn:sequenceFlow id="SequenceFlow_02lpx87" sourceRef="VnfAdapter" targetRef="ExclusiveGateway_1yvh16a" />
<bpmn:subProcess id="SubProcess_11p7mrh" name="Error Handling&#10;&#10;" triggeredByEvent="true">
<bpmn:startEvent id="StartEvent_1xp6ewt">
<bpmn:outgoing>SequenceFlow_0h607z0</bpmn:outgoing>
@@ -52,7 +52,7 @@
<bpmn:sequenceFlow id="SequenceFlow_09l7pcg" sourceRef="UpdateVfModuleDeleteStatus" targetRef="DeleteVfModuleBB_End" />
<bpmn:sequenceFlow id="SequenceFlow_0xyu3pk" sourceRef="DeleteNetworkPolicies" targetRef="UpdateVnfIpv4OamAddress" />
<bpmn:serviceTask id="DeleteNetworkPolicies" name="AAI Delete (network policies)" camunda:expression="${AAIDeleteTasks.deleteNetworkPolicies(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
- <bpmn:incoming>SequenceFlow_02lpx87</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_14bu4ys</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0xyu3pk</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:serviceTask id="UpdateVnfManagementV6Address" name="AAI Update (VNF)" camunda:expression="${AAIUpdateTasks.updateManagementV6AddressVnf(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
@@ -70,133 +70,280 @@
<bpmn:incoming>SequenceFlow_0khqfnc</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0yuz21z</bpmn:outgoing>
</bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_1n8gab5" sourceRef="ExclusiveGateway_0xrgzm7" targetRef="DeleteVfModuleVnfAdapter" />
+ <bpmn:parallelGateway id="ExclusiveGateway_0xrgzm7">
+ <bpmn:incoming>SequenceFlow_1537yw5</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1n8gab5</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_1v3jgqe</bpmn:outgoing>
+ </bpmn:parallelGateway>
+ <bpmn:sequenceFlow id="SequenceFlow_032jv5j" name="Yes&#10;" sourceRef="ExclusiveGateway_1h2ystu" targetRef="Setup_Audit_Variable">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("auditInventoryNeeded") == true}]]></bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:sequenceFlow id="SequenceFlow_0qfmmgt" sourceRef="Audit_Inventory" targetRef="ExclusiveGateway_1pydilb" />
+ <bpmn:sequenceFlow id="SequenceFlow_14bu4ys" sourceRef="ExclusiveGateway_1yvh16a" targetRef="DeleteNetworkPolicies" />
+ <bpmn:parallelGateway id="ExclusiveGateway_1yvh16a">
+ <bpmn:incoming>SequenceFlow_02lpx87</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_1ut7n32</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_14bu4ys</bpmn:outgoing>
+ </bpmn:parallelGateway>
+ <bpmn:sequenceFlow id="SequenceFlow_1mgunf3" name="No" sourceRef="ExclusiveGateway_1h2ystu" targetRef="ExclusiveGateway_1pydilb" />
+ <bpmn:serviceTask id="Check_Audit" name="Check Audit Variable" camunda:expression="${AuditTasks.isAuditNeeded(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:incoming>SequenceFlow_1v3jgqe</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1odt2wt</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_1v3jgqe" sourceRef="ExclusiveGateway_0xrgzm7" targetRef="Check_Audit" />
+ <bpmn:sequenceFlow id="SequenceFlow_1odt2wt" sourceRef="Check_Audit" targetRef="ExclusiveGateway_1h2ystu" />
+ <bpmn:sequenceFlow id="SequenceFlow_1swistn" sourceRef="Setup_Audit_Variable" targetRef="Audit_Inventory" />
+ <bpmn:serviceTask id="Audit_Inventory" name="Audit Inventory For Delete in AAI" camunda:type="external" camunda:topic="InventoryDeleteAudit">
+ <bpmn:incoming>SequenceFlow_1swistn</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0qfmmgt</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:serviceTask id="Setup_Audit_Variable" name="Setup Audit Variable" camunda:expression="${AuditTasks.setupAuditVariable(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:incoming>SequenceFlow_032jv5j</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1swistn</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_1ut7n32" sourceRef="ExclusiveGateway_1pydilb" targetRef="ExclusiveGateway_1yvh16a" />
+ <bpmn:exclusiveGateway id="ExclusiveGateway_1h2ystu" name="Audit&#10; Enabled?" default="SequenceFlow_1mgunf3">
+ <bpmn:incoming>SequenceFlow_1odt2wt</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_032jv5j</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_1mgunf3</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:exclusiveGateway id="ExclusiveGateway_1pydilb">
+ <bpmn:incoming>SequenceFlow_0qfmmgt</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_1mgunf3</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1ut7n32</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DeleteVfModuleBB">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="DeleteVfModuleBB_Start">
- <dc:Bounds x="173" y="102" width="36" height="36" />
+ <dc:Bounds x="159" y="241" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="179" y="138" width="24" height="12" />
+ <dc:Bounds x="132" y="277" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_16798zf_di" bpmnElement="DeleteVfModuleVnfAdapter">
- <dc:Bounds x="261" y="80" width="100" height="80" />
+ <dc:Bounds x="382" y="278" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1537yw5_di" bpmnElement="SequenceFlow_1537yw5">
- <di:waypoint xsi:type="dc:Point" x="209" y="120" />
- <di:waypoint xsi:type="dc:Point" x="261" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="195" y="259" />
+ <di:waypoint xsi:type="dc:Point" x="282" y="259" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="190" y="99" width="90" height="12" />
+ <dc:Bounds x="193.5" y="238" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0pbhsub_di" bpmnElement="UpdateVfModuleDeleteStatus">
- <dc:Bounds x="758" y="243" width="100" height="80" />
+ <dc:Bounds x="840" y="443" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_08tvhtf_di" bpmnElement="SequenceFlow_08tvhtf">
- <di:waypoint xsi:type="dc:Point" x="361" y="120" />
- <di:waypoint xsi:type="dc:Point" x="427" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="482" y="318" />
+ <di:waypoint xsi:type="dc:Point" x="511" y="318" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="349" y="99" width="90" height="12" />
+ <dc:Bounds x="451.5" y="297" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="EndEvent_1rn6yvh_di" bpmnElement="DeleteVfModuleBB_End">
- <dc:Bounds x="918" y="265" width="36" height="36" />
+ <dc:Bounds x="1087" y="465" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="936" y="305" width="0" height="0" />
+ <dc:Bounds x="1060" y="505" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="CallActivity_0whogn3_di" bpmnElement="VnfAdapter">
- <dc:Bounds x="427" y="80" width="100" height="80" />
+ <dc:Bounds x="511" y="278" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_02lpx87_di" bpmnElement="SequenceFlow_02lpx87">
- <di:waypoint xsi:type="dc:Point" x="527" y="120" />
- <di:waypoint xsi:type="dc:Point" x="591" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="611" y="318" />
+ <di:waypoint xsi:type="dc:Point" x="836" y="318" />
+ <di:waypoint xsi:type="dc:Point" x="836" y="284" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="559" y="105" width="0" height="0" />
+ <dc:Bounds x="678.5" y="303" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="SubProcess_11p7mrh_di" bpmnElement="SubProcess_11p7mrh" isExpanded="true">
- <dc:Bounds x="295" y="412" width="231" height="135" />
+ <dc:Bounds x="294" y="618" width="231" height="135" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="StartEvent_1xp6ewt_di" bpmnElement="StartEvent_1xp6ewt">
- <dc:Bounds x="338" y="474" width="36" height="36" />
+ <dc:Bounds x="337" y="680" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="311" y="510" width="0" height="0" />
+ <dc:Bounds x="265" y="716" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_0guhjau_di" bpmnElement="EndEvent_0guhjau">
- <dc:Bounds x="467" y="474" width="36" height="36" />
+ <dc:Bounds x="466" y="680" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="440" y="510" width="0" height="0" />
+ <dc:Bounds x="394" y="716" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0h607z0_di" bpmnElement="SequenceFlow_0h607z0">
- <di:waypoint xsi:type="dc:Point" x="374" y="492" />
- <di:waypoint xsi:type="dc:Point" x="467" y="492" />
+ <di:waypoint xsi:type="dc:Point" x="373" y="698" />
+ <di:waypoint xsi:type="dc:Point" x="466" y="698" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="421" y="471" width="0" height="0" />
+ <dc:Bounds x="375" y="677" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0vlgqod_di" bpmnElement="UpdateVfModuleHeatStackId">
- <dc:Bounds x="591" y="243" width="100" height="80" />
+ <dc:Bounds x="706" y="443" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_01vfwtp_di" bpmnElement="SequenceFlow_01vfwtp">
- <di:waypoint xsi:type="dc:Point" x="691" y="283" />
- <di:waypoint xsi:type="dc:Point" x="758" y="283" />
+ <di:waypoint xsi:type="dc:Point" x="806" y="483" />
+ <di:waypoint xsi:type="dc:Point" x="840" y="483" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="725" y="268" width="0" height="0" />
+ <dc:Bounds x="778" y="468" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_09l7pcg_di" bpmnElement="SequenceFlow_09l7pcg">
- <di:waypoint xsi:type="dc:Point" x="858" y="283" />
- <di:waypoint xsi:type="dc:Point" x="918" y="283" />
+ <di:waypoint xsi:type="dc:Point" x="940" y="483" />
+ <di:waypoint xsi:type="dc:Point" x="1087" y="483" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="888" y="258" width="0" height="0" />
+ <dc:Bounds x="968.5" y="468" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0xyu3pk_di" bpmnElement="SequenceFlow_0xyu3pk">
- <di:waypoint xsi:type="dc:Point" x="691" y="120" />
- <di:waypoint xsi:type="dc:Point" x="751" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="998" y="259" />
+ <di:waypoint xsi:type="dc:Point" x="1072" y="259" />
+ <di:waypoint xsi:type="dc:Point" x="1072" y="399" />
+ <di:waypoint xsi:type="dc:Point" x="233" y="399" />
+ <di:waypoint xsi:type="dc:Point" x="233" y="483" />
+ <di:waypoint xsi:type="dc:Point" x="280" y="483" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="721" y="105" width="0" height="0" />
+ <dc:Bounds x="607.5" y="384" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0tty0ac_di" bpmnElement="DeleteNetworkPolicies">
- <dc:Bounds x="591" y="80" width="100" height="80" />
+ <dc:Bounds x="898" y="219" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_0lrrd16_di" bpmnElement="UpdateVnfManagementV6Address">
- <dc:Bounds x="261" y="243" width="100" height="80" />
+ <dc:Bounds x="421" y="443" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0jtem3b_di" bpmnElement="SequenceFlow_0jtem3b">
- <di:waypoint xsi:type="dc:Point" x="851" y="120" />
- <di:waypoint xsi:type="dc:Point" x="941" y="120" />
- <di:waypoint xsi:type="dc:Point" x="941" y="205" />
- <di:waypoint xsi:type="dc:Point" x="182" y="205" />
- <di:waypoint xsi:type="dc:Point" x="182" y="283" />
- <di:waypoint xsi:type="dc:Point" x="261" y="283" />
+ <di:waypoint xsi:type="dc:Point" x="380" y="483" />
+ <di:waypoint xsi:type="dc:Point" x="421" y="483" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="562" y="190" width="0" height="0" />
+ <dc:Bounds x="355.5" y="468" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0w9805b_di" bpmnElement="UpdateVnfIpv4OamAddress">
- <dc:Bounds x="751" y="80" width="100" height="80" />
+ <dc:Bounds x="280" y="443" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0khqfnc_di" bpmnElement="SequenceFlow_0khqfnc">
- <di:waypoint xsi:type="dc:Point" x="361" y="283" />
- <di:waypoint xsi:type="dc:Point" x="427" y="283" />
+ <di:waypoint xsi:type="dc:Point" x="521" y="483" />
+ <di:waypoint xsi:type="dc:Point" x="561" y="483" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="394" y="268" width="0" height="0" />
+ <dc:Bounds x="496" y="468" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0yuz21z_di" bpmnElement="SequenceFlow_0yuz21z">
- <di:waypoint xsi:type="dc:Point" x="527" y="283" />
- <di:waypoint xsi:type="dc:Point" x="591" y="283" />
+ <di:waypoint xsi:type="dc:Point" x="661" y="483" />
+ <di:waypoint xsi:type="dc:Point" x="706" y="483" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="559" y="268" width="0" height="0" />
+ <dc:Bounds x="638.5" y="468" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0v8naz9_di" bpmnElement="UpdateVfModuleContrailServiceInstanceFqdn">
- <dc:Bounds x="427" y="243" width="100" height="80" />
+ <dc:Bounds x="561" y="443" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1n8gab5_di" bpmnElement="SequenceFlow_1n8gab5">
+ <di:waypoint xsi:type="dc:Point" x="307" y="284" />
+ <di:waypoint xsi:type="dc:Point" x="307" y="318" />
+ <di:waypoint xsi:type="dc:Point" x="382" y="318" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="277" y="294.5" width="90" height="13" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ParallelGateway_18x6mx2_di" bpmnElement="ExclusiveGateway_0xrgzm7">
+ <dc:Bounds x="282" y="234" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="262" y="287" width="90" height="13" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_032jv5j_di" bpmnElement="SequenceFlow_032jv5j">
+ <di:waypoint xsi:type="dc:Point" x="492" y="149" />
+ <di:waypoint xsi:type="dc:Point" x="492" y="108" />
+ <di:waypoint xsi:type="dc:Point" x="531" y="108" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="499" y="114" width="18" height="25" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0qfmmgt_di" bpmnElement="SequenceFlow_0qfmmgt">
+ <di:waypoint xsi:type="dc:Point" x="754" y="108" />
+ <di:waypoint xsi:type="dc:Point" x="784" y="108" />
+ <di:waypoint xsi:type="dc:Point" x="784" y="149" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="724" y="86.5" width="90" height="13" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_14bu4ys_di" bpmnElement="SequenceFlow_14bu4ys">
+ <di:waypoint xsi:type="dc:Point" x="861" y="259" />
+ <di:waypoint xsi:type="dc:Point" x="898" y="259" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="834.5" y="237.5" width="90" height="13" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ParallelGateway_02fjfb8_di" bpmnElement="ExclusiveGateway_1yvh16a">
+ <dc:Bounds x="811" y="234" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="790" y="287" width="90" height="13" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1mgunf3_di" bpmnElement="SequenceFlow_1mgunf3">
+ <di:waypoint xsi:type="dc:Point" x="492" y="199" />
+ <di:waypoint xsi:type="dc:Point" x="492" y="232" />
+ <di:waypoint xsi:type="dc:Point" x="784" y="232" />
+ <di:waypoint xsi:type="dc:Point" x="784" y="199" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="499" y="212" width="15" height="13" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_1vmz3zo_di" bpmnElement="Check_Audit">
+ <dc:Bounds x="339" y="134" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1v3jgqe_di" bpmnElement="SequenceFlow_1v3jgqe">
+ <di:waypoint xsi:type="dc:Point" x="307" y="234" />
+ <di:waypoint xsi:type="dc:Point" x="307" y="174" />
+ <di:waypoint xsi:type="dc:Point" x="339" y="174" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="277" y="197.5" width="90" height="13" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1odt2wt_di" bpmnElement="SequenceFlow_1odt2wt">
+ <di:waypoint xsi:type="dc:Point" x="439" y="174" />
+ <di:waypoint xsi:type="dc:Point" x="467" y="174" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="408" y="152.5" width="90" height="13" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1swistn_di" bpmnElement="SequenceFlow_1swistn">
+ <di:waypoint xsi:type="dc:Point" x="631" y="108" />
+ <di:waypoint xsi:type="dc:Point" x="654" y="108" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="597.5" y="86.5" width="90" height="13" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_1l8r2a6_di" bpmnElement="Audit_Inventory">
+ <dc:Bounds x="654" y="68" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_1gttdjr_di" bpmnElement="Setup_Audit_Variable">
+ <dc:Bounds x="531" y="68" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1ut7n32_di" bpmnElement="SequenceFlow_1ut7n32">
+ <di:waypoint xsi:type="dc:Point" x="809" y="174" />
+ <di:waypoint xsi:type="dc:Point" x="836" y="174" />
+ <di:waypoint xsi:type="dc:Point" x="836" y="234" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="777.5" y="152.5" width="90" height="13" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ExclusiveGateway_1olwkdn_di" bpmnElement="ExclusiveGateway_1h2ystu" isMarkerVisible="true">
+ <dc:Bounds x="467" y="149" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="518" y="162" width="47" height="25" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ExclusiveGateway_1d1pmqz_di" bpmnElement="ExclusiveGateway_1pydilb" isMarkerVisible="true">
+ <dc:Bounds x="759" y="149" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="694" y="202" width="0" height="13" />
+ </bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java
index 79bade3cf3..f4b528c4be 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java
@@ -61,6 +61,8 @@ import org.onap.so.bpmn.infrastructure.flowspecific.tasks.CreateNetworkCollectio
import org.onap.so.bpmn.infrastructure.flowspecific.tasks.GenericVnfHealthCheck;
import org.onap.so.bpmn.infrastructure.flowspecific.tasks.UnassignNetworkBB;
import org.onap.so.bpmn.infrastructure.flowspecific.tasks.UnassignVnf;
+import org.onap.so.bpmn.infrastructure.namingservice.tasks.NamingServiceCreateTasks;
+import org.onap.so.bpmn.infrastructure.namingservice.tasks.NamingServiceDeleteTasks;
import org.onap.so.bpmn.infrastructure.sdnc.tasks.SDNCActivateTasks;
import org.onap.so.bpmn.infrastructure.sdnc.tasks.SDNCAssignTasks;
import org.onap.so.bpmn.infrastructure.sdnc.tasks.SDNCChangeAssignTasks;
@@ -230,6 +232,12 @@ public abstract class BaseBPMNTest {
protected SniroHomingV2 sniroHoming;
@MockBean
+ protected NamingServiceDeleteTasks namingServiceDeleteTasks;
+
+ @MockBean
+ protected NamingServiceCreateTasks namingServiceCreateTasks;
+
+ @MockBean
protected WorkflowActionBBFailure workflowActionBBFailure;
@MockBean
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java
index 9ffcd9d77a..2dae1173d6 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java
@@ -47,13 +47,13 @@ public class ActivateVfModuleBBTest extends BaseBPMNTest{
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVfModuleBB", variables);
List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId")
- .topic("InventoryAudit", 60L * 1000L).execute();
+ .topic("InventoryAddAudit", 60L * 1000L).execute();
while (!tasks.isEmpty()) {
for (LockedExternalTask task : tasks) {
externalTaskService.complete(task.getId(), "externalWorkerId");
}
tasks = externalTaskService.fetchAndLock(100, "externalWorkerId")
- .topic("InventoryAudit", 60L * 1000L).execute();
+ .topic("InventoryAddAudit", 60L * 1000L).execute();
}
assertThat(pi).isNotNull();
@@ -68,13 +68,13 @@ public class ActivateVfModuleBBTest extends BaseBPMNTest{
doThrow(BpmnError.class).when(aaiUpdateTasks).updateOrchestrationStatusActivateVfModule(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVfModuleBB", variables);
List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId")
- .topic("InventoryAudit", 60L * 1000L).execute();
+ .topic("InventoryAddAudit", 60L * 1000L).execute();
while (!tasks.isEmpty()) {
for (LockedExternalTask task : tasks) {
externalTaskService.complete(task.getId(), "externalWorkerId");
}
tasks = externalTaskService.fetchAndLock(100, "externalWorkerId")
- .topic("InventoryAudit", 60L * 1000L).execute();
+ .topic("InventoryAddAudit", 60L * 1000L).execute();
}
assertThat(pi).isNotNull().isStarted()
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteInstanceGroupBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteInstanceGroupBBTest.java
new file mode 100644
index 0000000000..6dc36ae100
--- /dev/null
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteInstanceGroupBBTest.java
@@ -0,0 +1,53 @@
+/*-
+ * ============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.onap.so.bpmn.infrastructure.bpmn.subprocess;
+import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import java.io.IOException;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+
+public class DeleteInstanceGroupBBTest extends BaseBPMNTest{
+ @Test
+ public void sunnyDay() throws InterruptedException, IOException {
+ ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteInstanceGroupBB", variables);
+ assertThat(pi).isNotNull();
+ assertThat(pi).isStarted().hasPassedInOrder("DeleteInstanceGroupBB_Start", "DeleteInstanceGroupNaming", "DeleteInstanceGroupAAI",
+ "DeleteInstanceGroupBB_End");
+ assertThat(pi).isEnded();
+ }
+
+ @Test
+ public void rainyDay() throws Exception {
+ doThrow(BpmnError.class).when(aaiDeleteTasks).deleteInstanceGroup(any(BuildingBlockExecution.class));
+ ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteInstanceGroupBB", variables);
+ assertThat(pi).isNotNull();
+ assertThat(pi).isStarted()
+ .hasPassedInOrder("DeleteInstanceGroupBB_Start", "DeleteInstanceGroupNaming", "DeleteInstanceGroupAAI")
+ .hasNotPassed("DeleteInstanceGroupBB_End");
+ assertThat(pi).isEnded();
+ }
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVfModuleBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVfModuleBBTest.java
index cedffb77d4..48ae22cb1a 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVfModuleBBTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVfModuleBBTest.java
@@ -7,9 +7,9 @@
* 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.
@@ -23,21 +23,40 @@ import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
import java.io.IOException;
+import java.util.List;
import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.externaltask.LockedExternalTask;
import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Before;
import org.junit.Test;
import org.onap.so.bpmn.BaseBPMNTest;
import org.onap.so.bpmn.common.BuildingBlockExecution;
public class DeleteVfModuleBBTest extends BaseBPMNTest{
+
+ @Before
+ public void before() {
+ variables.put("auditInventoryNeeded", true);
+ }
+
@Test
public void sunnyDay() throws InterruptedException, IOException {
mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub");
mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteVfModuleBB", variables);
+ List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId")
+ .topic("InventoryDeleteAudit", 60L * 1000L).execute();
+ while (!tasks.isEmpty()) {
+ for (LockedExternalTask task : tasks) {
+ externalTaskService.complete(task.getId(), "externalWorkerId");
+ }
+ tasks = externalTaskService.fetchAndLock(100, "externalWorkerId")
+ .topic("InventoryDeleteAudit", 60L * 1000L).execute();
+ }
assertThat(pi).isNotNull();
- assertThat(pi).isStarted().hasPassedInOrder("DeleteVfModuleBB_Start", "DeleteVfModuleVnfAdapter", "VnfAdapter",
+ assertThat(pi).isStarted().hasPassed("DeleteVfModuleBB_Start","ExclusiveGateway_0xrgzm7","ExclusiveGateway_1yvh16a","Check_Audit",
+ "Setup_Audit_Variable","Audit_Inventory","DeleteVfModuleVnfAdapter", "VnfAdapter",
"DeleteNetworkPolicies", "UpdateVnfIpv4OamAddress", "UpdateVnfManagementV6Address",
"UpdateVfModuleContrailServiceInstanceFqdn",
"UpdateVfModuleHeatStackId", "UpdateVfModuleDeleteStatus", "DeleteVfModuleBB_End");
@@ -48,10 +67,19 @@ public class DeleteVfModuleBBTest extends BaseBPMNTest{
public void rainyDay() throws Exception {
doThrow(BpmnError.class).when(vnfAdapterDeleteTasks).deleteVfModule(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteVfModuleBB", variables);
+ List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId")
+ .topic("InventoryDeleteAudit", 60L * 1000L).execute();
+ while (!tasks.isEmpty()) {
+ for (LockedExternalTask task : tasks) {
+ externalTaskService.complete(task.getId(), "externalWorkerId");
+ }
+ tasks = externalTaskService.fetchAndLock(100, "externalWorkerId")
+ .topic("InventoryDeleteAudit", 60L * 1000L).execute();
+ }
assertThat(pi).isNotNull();
assertThat(pi).isStarted()
- .hasPassedInOrder("DeleteVfModuleBB_Start", "DeleteVfModuleVnfAdapter")
- .hasNotPassed("VnfAdapter", "DeleteNetworkPolicies", "UpdateVnfIpv4OamAddress", "UpdateVnfManagementV6Address",
+ .hasPassed("DeleteVfModuleBB_Start", "DeleteVfModuleVnfAdapter")
+ .hasNotPassed("VnfAdapter", "DeleteNetworkPolicies", "UpdateVnfIpv4OamAddress", "UpdateVnfManagementV6Address",
"UpdateVfModuleContrailServiceInstanceFqdn","UpdateVfModuleHeatStackId", "UpdateVfModuleDeleteStatus",
"DeleteVfModuleBB_End");
assertThat(pi).isEnded();
diff --git a/bpmn/so-bpmn-building-blocks/src/test/resources/logback-test.xml b/bpmn/so-bpmn-building-blocks/src/test/resources/logback-test.xml
index d8f6ba3930..c080bc90f8 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/resources/logback-test.xml
+++ b/bpmn/so-bpmn-building-blocks/src/test/resources/logback-test.xml
@@ -21,7 +21,8 @@
<logger name="org.onap" level="${so.log.level:-DEBUG}" additivity="false">
<appender-ref ref="STDOUT" />
</logger>
- <root level="WARN">
+
+ <root level="INFO">
<appender-ref ref="STDOUT" />
</root>
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy
index a8da95aa7c..f4bdde5e80 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -33,14 +35,15 @@ import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.core.UrnPropertiesReader
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
/**
* This groovy class supports the <class>ActivateSDNCCNetworkResource.bpmn</class> process.
* flow for SDNC Network Resource Activate
*/
public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, ActivateSDNCNetworkResource.class);
+ private static final Logger logger = LoggerFactory.getLogger( ActivateSDNCNetworkResource.class);
String Prefix = "ACTSDNCRES_"
@@ -53,7 +56,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
MsoUtils msoUtils = new MsoUtils()
public void preProcessRequest(DelegateExecution execution) {
- msoLogger.info(" ***** Started preProcessRequest *****")
+ logger.info(" ***** Started preProcessRequest *****")
try {
//get bpmn inputs from resource request.
@@ -125,13 +128,13 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
throw e;
} catch (Exception ex){
String msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
public void prepareUpdateAfterActivateSDNCResource(DelegateExecution execution) {
- msoLogger.info("started prepareUpdateAfterActivateSDNCResource ")
+ logger.info("started prepareUpdateAfterActivateSDNCResource ")
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(execution.getVariable(Prefix + "resourceInput"), ResourceInput.class)
String operType = resourceInputObj.getOperationType()
@@ -188,7 +191,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
}
public void prepareSDNCRequest (DelegateExecution execution) {
- msoLogger.info("Started prepareSDNCRequest ")
+ logger.info("Started prepareSDNCRequest ")
try {
// get variables
@@ -397,38 +400,38 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in CreateSDNCCNetworkResource flow. prepareSDNCRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- msoLogger.info(" ***** Exit prepareSDNCRequest *****")
+ logger.info(" ***** Exit prepareSDNCRequest *****")
}
public void postActivateSDNCCall(DelegateExecution execution) {
- msoLogger.info("started postCreateSDNCCall ")
+ logger.info("started postCreateSDNCCall ")
String responseCode = execution.getVariable(Prefix + "sdncCreateReturnCode")
String responseObj = execution.getVariable(Prefix + "SuccessIndicator")
- msoLogger.info("response from sdnc, response code :" + responseCode + " response object :" + responseObj)
+ logger.info("response from sdnc, response code :" + responseCode + " response object :" + responseObj)
}
public void sendSyncResponse(DelegateExecution execution) {
- msoLogger.info("started sendsyncResp")
+ logger.info("started sendsyncResp")
try {
String operationStatus = "finished"
// RESTResponse for main flow
String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
- msoLogger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
+ logger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
sendWorkflowResponse(execution, 202, resourceOperationResp)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
String msg = "Exception in sendSyncResponse:" + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.info("exited send sync Resp")
+ logger.info("exited send sync Resp")
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy
index 880a44c1b2..608bf66da9 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -31,7 +33,8 @@ import org.onap.so.bpmn.common.scripts.VidUtils
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.domain.CompareModelsResult
import org.onap.so.bpmn.core.json.JsonUtils
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import groovy.json.*
@@ -52,7 +55,7 @@ import groovy.json.*
* @param - WorkflowException
*/
public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CompareModelofE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( CompareModelofE2EServiceInstance.class);
String Prefix="CMPMDSI_"
private static final String DebugFlag = "isDebugEnabled"
@@ -65,17 +68,17 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
execution.setVariable("prefix",Prefix)
String msg = ""
- msoLogger.trace("preProcessRequest Request ")
+ logger.trace("preProcessRequest Request ")
try {
// check for incoming json message/input
String siRequest = execution.getVariable("bpmnRequest")
- msoLogger.debug(siRequest)
+ logger.debug(siRequest)
String requestId = execution.getVariable("mso-request-id")
execution.setVariable("msoRequestId", requestId)
- msoLogger.info("Input Request:" + siRequest + " reqId:" + requestId)
+ logger.info("Input Request:" + siRequest + " reqId:" + requestId)
String serviceInstanceId = execution.getVariable("serviceInstanceId")
if (isBlank(serviceInstanceId)) {
@@ -87,7 +90,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
String globalSubscriberId = jsonUtil.getJsonValue(siRequest, "globalSubscriberId")
if (isBlank(globalSubscriberId)) {
msg = "Input globalSubscriberId' is null"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
} else {
execution.setVariable("globalSubscriberId", globalSubscriberId)
}
@@ -96,7 +99,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
String subscriptionServiceType = jsonUtil.getJsonValue(siRequest, "serviceType")
if (isBlank(subscriptionServiceType)) {
msg = "Input subscriptionServiceType is null"
- utils.log("DEBUG", msg, isDebugEnabled)
+ logger.debug( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
} else {
execution.setVariable("serviceType", subscriptionServiceType)
@@ -106,7 +109,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
String modelInvariantIdTarget = jsonUtil.getJsonValue(siRequest, "modelInvariantIdTarget")
if (isBlank(modelInvariantIdTarget)) {
msg = "Input modelInvariantIdTarget' is null"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
} else {
execution.setVariable("modelInvariantIdTarget", modelInvariantIdTarget)
@@ -116,7 +119,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
String modelVersionIdTarget = jsonUtil.getJsonValue(siRequest, "modelVersionIdTarget")
if (isBlank(modelVersionIdTarget)) {
msg = "Input modelVersionIdTarget is null"
- utils.log("DEBUG", msg, isDebugEnabled)
+ logger.debug( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
} else {
execution.setVariable("modelVersionIdTarget", modelVersionIdTarget)
@@ -128,32 +131,32 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit preProcessRequest ")
+ logger.trace("Exit preProcessRequest ")
}
public void sendSyncResponse (DelegateExecution execution) {
- msoLogger.trace("sendSyncResponse ")
+ logger.trace("sendSyncResponse ")
try {
CompareModelsResult compareModelsResult = execution.getVariable("compareModelsResult")
// RESTResponse (for API Handler(APIH) Reply Task)
String syncResponse = compareModelsResult.toJsonStringNoRootName()
- msoLogger.info(" sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse)
+ logger.info(" sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse)
sendWorkflowResponse(execution, 202, syncResponse)
} catch (Exception ex) {
String msg = "Exception in sendSyncResponse: " + ex.getMessage()
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit sendSyncResopnse ")
+ logger.trace("Exit sendSyncResopnse ")
}
public void sendSyncError (DelegateExecution execution) {
- msoLogger.trace("sendSyncError ")
+ logger.trace("sendSyncError ")
try {
String errorMessage = ""
@@ -170,17 +173,17 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
<aetgt:ErrorCode>7000</aetgt:ErrorCode>
</aetgt:WorkflowException>"""
- msoLogger.debug(buildworkflowException)
+ logger.debug(buildworkflowException)
sendWorkflowResponse(execution, 500, buildworkflowException)
} catch (Exception ex) {
- msoLogger.info(" Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
+ logger.info(" Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
}
}
public void prepareCompletionRequest (DelegateExecution execution) {
- msoLogger.trace("prepareCompletion ")
+ logger.trace("prepareCompletion ")
try {
String requestId = execution.getVariable("msoRequestId")
@@ -201,22 +204,22 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
execution.setVariable("completionRequest", xmlMsoCompletionRequest)
- msoLogger.info(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
+ logger.info(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
} catch (Exception ex) {
String msg = " Exception in prepareCompletion:" + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit prepareCompletionRequest ")
+ logger.trace("Exit prepareCompletionRequest ")
}
public void prepareFalloutRequest(DelegateExecution execution){
- msoLogger.trace("prepareFalloutRequest ")
+ logger.trace("prepareFalloutRequest ")
try {
WorkflowException wfex = execution.getVariable("WorkflowException")
- msoLogger.info(" Input Workflow Exception: " + wfex.toString())
+ logger.info(" Input Workflow Exception: " + wfex.toString())
String requestId = execution.getVariable("msoRequestId")
String source = execution.getVariable("source")
String requestInfo =
@@ -229,7 +232,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
execution.setVariable("falloutRequest", falloutRequest)
} catch (Exception ex) {
- msoLogger.info("Exception prepareFalloutRequest:" + ex.getMessage())
+ logger.info("Exception prepareFalloutRequest:" + ex.getMessage())
String errorException = " Bpmn error encountered in CompareModelofE2EServiceInstance flow. FalloutHandlerRequest, buildErrorResponse() - " + ex.getMessage()
String requestId = execution.getVariable("msoRequestId")
String falloutRequest =
@@ -249,7 +252,7 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
execution.setVariable("falloutRequest", falloutRequest)
}
- msoLogger.trace("Exit prepareFalloutRequest ")
+ logger.trace("Exit prepareFalloutRequest ")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
index 05fd517e47..c8b48c6703 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -47,7 +49,8 @@ import org.onap.so.bpmn.infrastructure.workflow.service.ServicePluginFactory
import java.util.Map
import java.util.UUID
import javax.ws.rs.core.Response
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.camunda.bpm.engine.runtime.Execution
import org.camunda.bpm.engine.delegate.BpmnError
@@ -68,19 +71,19 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
JsonUtils jsonUtil = new JsonUtils()
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, Create3rdONAPE2EServiceInstance.class)
+ private static final Logger logger = LoggerFactory.getLogger( Create3rdONAPE2EServiceInstance.class);
public void checkSPPartnerInfo (DelegateExecution execution) {
- msoLogger.info(" ***** Started checkSPPartnerInfo *****")
+ logger.info(" ***** Started checkSPPartnerInfo *****")
try {
//get bpmn inputs from resource request.
String requestId = execution.getVariable("mso-request-id")
String requestAction = execution.getVariable("requestAction")
- msoLogger.info("The requestAction is: " + requestAction)
+ logger.info("The requestAction is: " + requestAction)
String recipeParamsFromRequest = execution.getVariable("recipeParams")
- msoLogger.info("The recipeParams is: " + recipeParamsFromRequest)
+ logger.info("The recipeParams is: " + recipeParamsFromRequest)
String resourceInput = execution.getVariable("resourceInput")
- msoLogger.info("The resourceInput is: " + resourceInput)
+ logger.info("The resourceInput is: " + resourceInput)
//Get ResourceInput Object
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
String resourceInputPrameters = resourceInputObj.getResourceParameters()
@@ -102,7 +105,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
else {
is3rdONAPExist = false
String msg = "sppartner Url is blank."
- msoLogger.debug(msg)
+ logger.debug(msg)
}
}
if(inputParameters.has("sppartner_providingServiceUuid"))
@@ -114,7 +117,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
else {
is3rdONAPExist = false
String msg = "sppartner providingServiceUuid is blank."
- msoLogger.debug(msg)
+ logger.debug(msg)
}
if(inputParameters.has("sppartner_providingServiceInvariantUuid"))
{
@@ -125,7 +128,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
else {
is3rdONAPExist = false
String msg = "sppartner providingServiceInvarianteUuid is blank."
- msoLogger.debug(msg)
+ logger.debug(msg)
}
if(inputParameters.has("sppartner_handoverMode"))
@@ -137,7 +140,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
else {
is3rdONAPExist = false
String msg = "sppartner handoverMode is blank."
- msoLogger.debug(msg)
+ logger.debug(msg)
}
execution.setVariable("Is3rdONAPExist", is3rdONAPExist)
@@ -147,13 +150,13 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
} catch (Exception ex){
String msg = "Exception in checkSPPartnerInfo " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
public void checkLocallCall (DelegateExecution execution) {
- msoLogger.info(" ***** Started checkLocallCall *****")
+ logger.info(" ***** Started checkLocallCall *****")
try {
//Get ResourceInput Object
@@ -179,19 +182,19 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
}
}
execution.setVariable(Prefix + "CallSource", callSource)
- msoLogger.debug("callSource is: " + callSource )
+ logger.debug("callSource is: " + callSource )
execution.setVariable("IsLocalCall", isLocalCall)
} catch (Exception ex){
String msg = "Exception in checkLocallCall " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
public void preProcessRequest(DelegateExecution execution){
- msoLogger.info(" ***** Started preProcessRequest *****")
+ logger.info(" ***** Started preProcessRequest *****")
String msg = ""
try {
@@ -200,27 +203,27 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
String globalSubscriberId = resourceInputObj.getGlobalSubscriberId()
if (isBlank(globalSubscriberId)) {
msg = "Input globalSubscriberId is null"
- msoLogger.error(msg)
+ logger.error(msg)
}
//set local variable
execution.setVariable("globalSubscriberId", globalSubscriberId)
- msoLogger.info("globalSubscriberId:" + globalSubscriberId)
+ logger.info("globalSubscriberId:" + globalSubscriberId)
String serviceType = resourceInputObj.getServiceType()
if (isBlank(serviceType)) {
msg = "Input serviceType is null"
- msoLogger.error(msg)
+ logger.error(msg)
}
execution.setVariable("serviceType", serviceType)
- msoLogger.info("serviceType:" + serviceType)
+ logger.info("serviceType:" + serviceType)
String resourceName = resourceInputObj.getResourceInstanceName()
if (isBlank(resourceName)) {
msg = "Input resourceName is null"
- msoLogger.error(msg)
+ logger.error(msg)
}
execution.setVariable("resourceName", resourceName)
- msoLogger.info("resourceName:" + resourceName)
+ logger.info("resourceName:" + resourceName)
int beginIndex = resourceName.indexOf("_") + 1
String serviceInstanceName = resourceName.substring(beginIndex)
@@ -229,44 +232,44 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
String serviceInstanceId = resourceInputObj.getServiceInstanceId()
if (isBlank(serviceInstanceId)) {
msg = "Input serviceInstanceId is null"
- msoLogger.error(msg)
+ logger.error(msg)
}
execution.setVariable(Prefix + "ServiceInstanceId", serviceInstanceId)
- msoLogger.info("serviceInstanceId:" + serviceInstanceId)
+ logger.info("serviceInstanceId:" + serviceInstanceId)
String resourceModelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid()
if (isBlank(resourceModelInvariantUuid)) {
msg = "Input resourceModelInvariantUuid is null"
- msoLogger.error(msg)
+ logger.error(msg)
}
execution.setVariable(Prefix + "ResourceModelInvariantUuid", resourceModelInvariantUuid)
- msoLogger.info("resourceModelInvariantUuid:" + resourceModelInvariantUuid)
+ logger.info("resourceModelInvariantUuid:" + resourceModelInvariantUuid)
String resourceModelUuid = resourceInputObj.getResourceModelInfo().getModelUuid()
if (isBlank(resourceModelUuid)) {
msg = "Input resourceModelUuid is null"
- msoLogger.error(msg)
+ logger.error(msg)
}
execution.setVariable(Prefix + "ResourceModelUuid", resourceModelUuid)
- msoLogger.info("resourceModelUuid:" + resourceModelUuid)
+ logger.info("resourceModelUuid:" + resourceModelUuid)
String resourceModelCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
if (isBlank(resourceModelCustomizationUuid)) {
msg = "Input resourceModelCustomizationUuid is null"
- msoLogger.error(msg)
+ logger.error(msg)
}
execution.setVariable(Prefix + "ResourceModelCustomizationUuid", resourceModelCustomizationUuid)
- msoLogger.info("resourceModelCustomizationUuid:" + resourceModelCustomizationUuid)
+ logger.info("resourceModelCustomizationUuid:" + resourceModelCustomizationUuid)
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
public void prepareUpdateProgress(DelegateExecution execution) {
- msoLogger.info(" ***** Started prepareUpdateProgress *****")
+ logger.info(" ***** Started prepareUpdateProgress *****")
ResourceInput resourceInputObj = execution.getVariable(Prefix + "ResourceInput")
String operType = resourceInputObj.getOperationType()
String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
@@ -295,11 +298,11 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
</soapenv:Envelope>"""
setProgressUpdateVariables(execution, body)
- msoLogger.info(" ***** Exit prepareUpdateProgress *****")
+ logger.info(" ***** Exit prepareUpdateProgress *****")
}
public void allocateCrossONAPResource(DelegateExecution execution) {
- msoLogger.info(" ***** Started allocateCrossONAPResource *****")
+ logger.info(" ***** Started allocateCrossONAPResource *****")
//get TP links from AAI for SOTN handoverMode only
String handoverMode = execution.getVariable(Prefix + "HandoverMode")
@@ -333,15 +336,15 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
execution.setVariable(Prefix + "ServiceParameters", inputParameters)
}
else {
- msoLogger.error("No allocated CrossONAPResource found in ServiceParameters")
+ logger.error("No allocated CrossONAPResource found in ServiceParameters")
}
}
- msoLogger.info("Exit " + allocateCrossONAPResource)
+ logger.info("Exit " + allocateCrossONAPResource)
}
public void prepare3rdONAPRequest(DelegateExecution execution) {
- msoLogger.info(" ***** Started prepare3rdONAPRequest *****")
+ logger.info(" ***** Started prepare3rdONAPRequest *****")
String sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
String extAPIPath = sppartnerUrl + '/serviceOrder'
@@ -416,16 +419,16 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
String payload = externalAPIUtil.setTemplate(ExternalAPIUtil.PostServiceOrderRequestsTemplate, valueMap)
execution.setVariable(Prefix + "Payload", payload)
- msoLogger.info("Exit " + prepare3rdONAPRequest)
+ logger.info("Exit " + prepare3rdONAPRequest)
}
public void doCreateE2ESIin3rdONAP(DelegateExecution execution) {
- msoLogger.info(" ***** Started doCreateE2ESIin3rdONAP *****")
+ logger.info(" ***** Started doCreateE2ESIin3rdONAP *****")
try {
String extAPIPath = execution.getVariable("ExternalAPIURL")
String payload = execution.getVariable(Prefix + "Payload")
- msoLogger.debug("doCreateE2ESIin3rdONAP externalAPIURL is: " + extAPIPath)
- msoLogger.debug("doCreateE2ESIin3rdONAP payload is: " + payload)
+ logger.debug("doCreateE2ESIin3rdONAP externalAPIURL is: " + extAPIPath)
+ logger.debug("doCreateE2ESIin3rdONAP payload is: " + payload)
ExternalAPIUtil externalAPIUtil = new ExternalAPIUtilFactory().create()
execution.setVariable("ServiceOrderId", "")
@@ -434,43 +437,43 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
int responseCode = response.getStatus()
execution.setVariable(Prefix + "PostServiceOrderResponseCode", responseCode)
- msoLogger.debug("Post ServiceOrder response code is: " + responseCode)
+ logger.debug("Post ServiceOrder response code is: " + responseCode)
String extApiResponse = response.readEntity(String.class)
JSONObject responseObj = new JSONObject(extApiResponse)
execution.setVariable(Prefix + "PostServiceOrderResponse", extApiResponse)
- msoLogger.debug("doCreateE2ESIin3rdONAP response body is: " + extApiResponse)
+ logger.debug("doCreateE2ESIin3rdONAP response body is: " + extApiResponse)
//Process Response
if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
//200 OK 201 CREATED 202 ACCEPTED
{
- msoLogger.debug("Post ServiceOrder Received a Good Response")
+ logger.debug("Post ServiceOrder Received a Good Response")
String serviceOrderId = responseObj.get("id")
execution.setVariable(Prefix + "SuccessIndicator", true)
execution.setVariable("ServiceOrderId", serviceOrderId)
- msoLogger.info("Post ServiceOrderid is: " + serviceOrderId)
+ logger.info("Post ServiceOrderid is: " + serviceOrderId)
}
else{
- msoLogger.error("Post ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
+ logger.error("Post ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
// exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Post ServiceOrder Received a bad response from 3rdONAP External API")
}
}catch(Exception e){
- msoLogger.error("doCreateE2ESIin3rdONAP exception:" + e.getMessage())
+ logger.error("doCreateE2ESIin3rdONAP exception:" + e.getMessage())
}
- msoLogger.info("Exit " + doCreateE2ESIin3rdONAP)
+ logger.info("Exit " + doCreateE2ESIin3rdONAP)
}
public void getE2ESIProgressin3rdONAP(DelegateExecution execution) {
- msoLogger.info(" ***** Started getE2ESIProgressin3rdONAP *****")
+ logger.info(" ***** Started getE2ESIProgressin3rdONAP *****")
try {
String extAPIPath = execution.getVariable("ExternalAPIURL")
extAPIPath += "/" + execution.getVariable("ServiceOrderId")
- msoLogger.debug("getE2ESIProgressin3rdONAP create externalAPIURL is: " + extAPIPath)
+ logger.debug("getE2ESIProgressin3rdONAP create externalAPIURL is: " + extAPIPath)
ExternalAPIUtil externalAPIUtil = new ExternalAPIUtilFactory().create()
@@ -478,18 +481,18 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
int responseCode = response.getStatus()
execution.setVariable(Prefix + "GetServiceOrderResponseCode", responseCode)
- msoLogger.debug("Get ServiceOrder response code is: " + responseCode)
+ logger.debug("Get ServiceOrder response code is: " + responseCode)
String extApiResponse = response.readEntity(String.class)
JSONObject responseObj = new JSONObject(extApiResponse)
execution.setVariable(Prefix + "GetServiceOrderResponse", extApiResponse)
- msoLogger.debug("getE2ESIProgressin3rdONAP create response body is: " + extApiResponse)
+ logger.debug("getE2ESIProgressin3rdONAP create response body is: " + extApiResponse)
//Process Response //200 OK 201 CREATED 202 ACCEPTED
if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
{
- msoLogger.debug("Get Create ServiceOrder Received a Good Response")
+ logger.debug("Get Create ServiceOrder Received a Good Response")
String orderState = responseObj.get("state")
if("REJECTED".equalsIgnoreCase(orderState)) {
@@ -507,7 +510,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
execution.setVariable("progress", 100)
execution.setVariable("status", "error")
execution.setVariable("statusDescription", "Create Service Order Status get null sppartnerServiceId")
- msoLogger.error("null sppartnerServiceId while getting progress from externalAPI")
+ logger.error("null sppartnerServiceId while getting progress from externalAPI")
return
}
@@ -545,7 +548,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
}
}
else{
- msoLogger.debug("Get ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
+ logger.debug("Get ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
execution.setVariable("progress", 100)
execution.setVariable("status", "error")
execution.setVariable("statusDescription", "Get Create ServiceOrder Received a bad response")
@@ -556,9 +559,9 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
execution.setVariable("progress", 100)
execution.setVariable("status", "error")
execution.setVariable("statusDescription", "Get Create ServiceOrder Exception")
- msoLogger.error("getE2ESIProgressin3rdONAP exception:" + e.getMessage())
+ logger.error("getE2ESIProgressin3rdONAP exception:" + e.getMessage())
}
- msoLogger.info("Exit " + getE2ESIProgressin3rdONAP)
+ logger.info("Exit " + getE2ESIProgressin3rdONAP)
}
/**
@@ -568,12 +571,12 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
try {
Thread.sleep(5000)
} catch(InterruptedException e) {
- msoLogger.error("Time Delay exception" + e)
+ logger.error("Time Delay exception" + e)
}
}
public void saveSPPartnerInAAI(DelegateExecution execution) {
- msoLogger.info(" ***** Started saveSPPartnerInAAI *****")
+ logger.info(" ***** Started saveSPPartnerInAAI *****")
try {
String sppartnerId = execution.getVariable(Prefix + "SppartnerServiceId")
String sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
@@ -601,10 +604,10 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
client.connect(uri, siUri)
} catch (Exception ex) {
String msg = "Exception in Create3rdONAPE2EServiceInstance.saveSPPartnerInAAI. " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
// throw new BpmnError("MSOWorkflowException")
}
- msoLogger.info("Exit " + saveSPPartnerInAAI)
+ logger.info("Exit " + saveSPPartnerInAAI)
}
private void setProgressUpdateVariables(DelegateExecution execution, String body) {
@@ -614,30 +617,30 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
}
public void postProcess(DelegateExecution execution){
- msoLogger.info(" ***** Started postProcess *****")
+ logger.info(" ***** Started postProcess *****")
String responseCode = execution.getVariable(Prefix + "PutSppartnerResponseCode")
String responseObj = execution.getVariable(Prefix + "PutSppartnerResponse")
- msoLogger.info("response from AAI for put sppartner, response code :" + responseCode + " response object :" + responseObj)
- msoLogger.info(" ***** Exit postProcess *****")
+ logger.info("response from AAI for put sppartner, response code :" + responseCode + " response object :" + responseObj)
+ logger.info(" ***** Exit postProcess *****")
}
public void sendSyncResponse (DelegateExecution execution) {
- msoLogger.debug(" *** sendSyncResponse *** ")
+ logger.debug(" *** sendSyncResponse *** ")
try {
String operationStatus = "finished"
// RESTResponse for main flow
String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
- msoLogger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
+ logger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
sendWorkflowResponse(execution, 202, resourceOperationResp)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.debug(" ***** Exit sendSyncResopnse *****")
+ logger.debug(" ***** Exit sendSyncResopnse *****")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy
index 02ae6a6f48..0c8477ca20 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -34,6 +36,8 @@ import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.springframework.web.util.UriUtils
import groovy.json.*
@@ -47,27 +51,27 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String Prefix="CRESI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CreateCustomE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( CreateCustomE2EServiceInstance.class);
public void preProcessRequest (DelegateExecution execution) {
- msoLogger.trace("start preProcessRequest")
+ logger.trace("start preProcessRequest")
execution.setVariable("prefix",Prefix)
String msg = ""
try {
String siRequest = execution.getVariable("bpmnRequest")
- msoLogger.debug(siRequest)
+ logger.debug(siRequest)
String requestId = execution.getVariable("mso-request-id")
execution.setVariable("msoRequestId", requestId)
- msoLogger.debug("Input Request:" + siRequest + " reqId:" + requestId)
+ logger.debug("Input Request:" + siRequest + " reqId:" + requestId)
String serviceInstanceId = execution.getVariable("serviceInstanceId")
if (isBlank(serviceInstanceId)) {
serviceInstanceId = UUID.randomUUID().toString()
}
- msoLogger.debug("Generated new Service Instance:" + serviceInstanceId)
+ logger.debug("Generated new Service Instance:" + serviceInstanceId)
serviceInstanceId = UriUtils.encode(serviceInstanceId,"UTF-8")
execution.setVariable("serviceInstanceId", serviceInstanceId)
@@ -88,7 +92,7 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
if (isBlank(productFamilyId))
{
msg = "Input productFamilyId is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
//exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
} else {
execution.setVariable("productFamilyId", productFamilyId)
@@ -98,20 +102,20 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String serviceModelInfo = jsonUtil.getJsonValue(siRequest, "requestDetails.modelInfo")
if (isBlank(serviceModelInfo)) {
msg = "Input serviceModelInfo is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
} else
{
execution.setVariable("serviceModelInfo", serviceModelInfo)
}
- msoLogger.debug("modelInfo: " + serviceModelInfo)
+ logger.debug("modelInfo: " + serviceModelInfo)
//requestParameters
String subscriptionServiceType = jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.subscriptionServiceType")
if (isBlank(subscriptionServiceType)) {
msg = "Input subscriptionServiceType is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
} else {
execution.setVariable("subscriptionServiceType", subscriptionServiceType)
@@ -137,7 +141,7 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
}
}
- msoLogger.debug("User Input Parameters map: " + inputMap.toString())
+ logger.debug("User Input Parameters map: " + inputMap.toString())
execution.setVariable("serviceInputParams", inputMap)
execution.setVariable("uuiRequest", inputMap.get("UUIRequest"))
@@ -148,33 +152,33 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("finished preProcessRequest")
+ logger.trace("finished preProcessRequest")
}
public void sendSyncResponse (DelegateExecution execution) {
- msoLogger.trace("start sendSyncResponse")
+ logger.trace("start sendSyncResponse")
try {
String operationId = execution.getVariable("operationId")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
// RESTResponse for API Handler (APIH) Reply Task
String createServiceRestRequest = """{"service":{"serviceId":"${serviceInstanceId}","operationId":"${operationId}"}}""".trim()
- msoLogger.debug(" sendSyncResponse to APIH:" + "\n" + createServiceRestRequest)
+ logger.debug(" sendSyncResponse to APIH:" + "\n" + createServiceRestRequest)
sendWorkflowResponse(execution, 202, createServiceRestRequest)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("finished sendSyncResponse")
+ logger.trace("finished sendSyncResponse")
}
public void sendSyncError (DelegateExecution execution) {
- msoLogger.trace("start sendSyncError")
+ logger.trace("start sendSyncError")
try {
String errorMessage = ""
if (execution.getVariable("WorkflowException") instanceof WorkflowException) {
@@ -190,17 +194,17 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
<aetgt:ErrorCode>7000</aetgt:ErrorCode>
</aetgt:WorkflowException>"""
- msoLogger.debug(buildworkflowException)
+ logger.debug(buildworkflowException)
sendWorkflowResponse(execution, 500, buildworkflowException)
} catch (Exception ex) {
- msoLogger.debug("Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
+ logger.debug("Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
}
- msoLogger.trace("finished sendSyncError")
+ logger.trace("finished sendSyncError")
}
public void prepareCompletionRequest (DelegateExecution execution) {
- msoLogger.trace("start prepareCompletionRequest")
+ logger.trace("start prepareCompletionRequest")
try {
String requestId = execution.getVariable("msoRequestId")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
@@ -223,21 +227,21 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
execution.setVariable("completionRequest", xmlMsoCompletionRequest)
- msoLogger.debug("Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
+ logger.debug("Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
} catch (Exception ex) {
String msg = " Exception in prepareCompletion:" + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("finished prepareCompletionRequest")
+ logger.trace("finished prepareCompletionRequest")
}
public void prepareFalloutRequest(DelegateExecution execution){
- msoLogger.trace("start prepareFalloutRequest")
+ logger.trace("start prepareFalloutRequest")
try {
WorkflowException wfex = execution.getVariable("WorkflowException")
- msoLogger.debug("Input Workflow Exception: " + wfex.toString())
+ logger.debug("Input Workflow Exception: " + wfex.toString())
String requestId = execution.getVariable("msoRequestId")
String source = execution.getVariable("source")
String requestInfo =
@@ -250,7 +254,7 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
execution.setVariable("falloutRequest", falloutRequest)
} catch (Exception ex) {
- msoLogger.debug("Exception prepareFalloutRequest:" + ex.getMessage())
+ logger.debug("Exception prepareFalloutRequest:" + ex.getMessage())
String errorException = " Bpmn error encountered in CreateGenericALaCarteServiceInstance flow. FalloutHandlerRequest, buildErrorResponse() - " + ex.getMessage()
String requestId = execution.getVariable("msoRequestId")
String falloutRequest =
@@ -270,14 +274,14 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
execution.setVariable("falloutRequest", falloutRequest)
}
- msoLogger.trace("finished prepareFalloutRequest")
+ logger.trace("finished prepareFalloutRequest")
}
/**
* Init the service Operation Status
*/
public void prepareInitServiceOperationStatus(DelegateExecution execution){
- msoLogger.trace("start prepareInitServiceOperationStatus")
+ logger.trace("start prepareInitServiceOperationStatus")
try{
String serviceId = execution.getVariable("serviceInstanceId")
String operationId = UUID.randomUUID().toString()
@@ -287,7 +291,7 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String progress = "0"
String reason = ""
String operationContent = "Prepare service creation"
- msoLogger.debug("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId)
+ logger.debug("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId)
serviceId = UriUtils.encode(serviceId,"UTF-8")
execution.setVariable("serviceInstanceId", serviceId)
execution.setVariable("operationId", operationId)
@@ -295,7 +299,7 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint",execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
- msoLogger.debug("DB Adapter Endpoint is: " + dbAdapterEndpoint)
+ logger.debug("DB Adapter Endpoint is: " + dbAdapterEndpoint)
String payload =
"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
@@ -317,15 +321,16 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)
- msoLogger.debug("Outgoing updateServiceOperStatusRequest: \n" + payload)
- msoLogger.debug("CreateVfModuleInfra Outgoing updateServiceOperStatusRequest Request: " + payload)
+ logger.debug("Outgoing updateServiceOperStatusRequest: \n" + payload)
+ logger.debug("CreateVfModuleInfra Outgoing updateServiceOperStatusRequest Request: " + payload)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing prepareInitServiceOperationStatus.", "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing prepareInitServiceOperationStatus.", "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareInitServiceOperationStatus Method:\n" + e.getMessage())
}
- msoLogger.trace("finished prepareInitServiceOperationStatus")
+ logger.trace("finished prepareInitServiceOperationStatus")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateDeviceResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateDeviceResource.groovy
index 489e77e88e..493af2de6a 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateDeviceResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateDeviceResource.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -36,7 +38,8 @@ import org.onap.so.bpmn.core.domain.VnfResource
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder.AbstractBuilder
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
import java.util.UUID;
@@ -59,21 +62,21 @@ public class CreateDeviceResource extends AbstractServiceTaskProcessor {
JsonUtils jsonUtil = new JsonUtils()
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CreateDeviceResource.class)
+ private static final Logger logger = LoggerFactory.getLogger( CreateDeviceResource.class);
public void preProcessRequest(DelegateExecution execution){
- msoLogger.info(" ***** Started preProcessRequest *****")
+ logger.info(" ***** Started preProcessRequest *****")
String msg = ""
try {
//get bpmn inputs from resource request.
String requestId = execution.getVariable("mso-request-id")
String requestAction = execution.getVariable("requestAction")
- msoLogger.info("The requestAction is: " + requestAction)
+ logger.info("The requestAction is: " + requestAction)
String recipeParamsFromRequest = execution.getVariable("recipeParams")
- msoLogger.info("The recipeParams is: " + recipeParamsFromRequest)
+ logger.info("The recipeParams is: " + recipeParamsFromRequest)
String resourceInput = execution.getVariable("resourceInput")
- msoLogger.info("The resourceInput is: " + resourceInput)
+ logger.info("The resourceInput is: " + resourceInput)
//Get ResourceInput Object
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
execution.setVariable(Prefix + "ResourceInput", resourceInputObj)
@@ -94,47 +97,47 @@ public class CreateDeviceResource extends AbstractServiceTaskProcessor {
String resourceName = resourceInputObj.getResourceInstanceName()
if (isBlank(resourceName)) {
msg = "Input resourceName is null"
- msoLogger.error(msg)
+ logger.error(msg)
}
execution.setVariable("resourceName", resourceName)
- msoLogger.info("resourceName:" + resourceName)
+ logger.info("resourceName:" + resourceName)
String resourceModelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid()
if (isBlank(resourceModelInvariantUuid)) {
msg = "Input resourceModelInvariantUuid is null"
- msoLogger.error(msg)
+ logger.error(msg)
}
execution.setVariable(Prefix + "ResourceModelInvariantUuid", resourceModelInvariantUuid)
- msoLogger.info("resourceModelInvariantUuid:" + resourceModelInvariantUuid)
+ logger.info("resourceModelInvariantUuid:" + resourceModelInvariantUuid)
String resourceModelUuid = resourceInputObj.getResourceModelInfo().getModelUuid()
if (isBlank(resourceModelUuid)) {
msg = "Input resourceModelUuid is null"
- msoLogger.error(msg)
+ logger.error(msg)
}
execution.setVariable(Prefix + "ResourceModelUuid", resourceModelUuid)
- msoLogger.info("resourceModelUuid:" + resourceModelUuid)
+ logger.info("resourceModelUuid:" + resourceModelUuid)
String resourceModelCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
if (isBlank(resourceModelCustomizationUuid)) {
msg = "Input resourceModelCustomizationUuid is null"
- msoLogger.error(msg)
+ logger.error(msg)
}
execution.setVariable(Prefix + "ResourceModelCustomizationUuid", resourceModelCustomizationUuid)
- msoLogger.info("resourceModelCustomizationUuid:" + resourceModelCustomizationUuid)
+ logger.info("resourceModelCustomizationUuid:" + resourceModelCustomizationUuid)
execution.setVariable(Prefix + "serviceInstanceId", resourceInputObj.getServiceInstanceId())
execution.setVariable("mso-request-id", requestId)
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
public void checkDevType(DelegateExecution execution){
- msoLogger.info(" ***** Started checkDevType *****")
+ logger.info(" ***** Started checkDevType *****")
try {
JSONObject resourceInputParameters = execution.getVariable(Prefix + "ResourceRequestInputs")
@@ -148,7 +151,7 @@ public class CreateDeviceResource extends AbstractServiceTaskProcessor {
} catch (Exception ex){
String msg = "Exception in checkDevType " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -160,7 +163,7 @@ public class CreateDeviceResource extends AbstractServiceTaskProcessor {
}
public void prepareUpdateProgress(DelegateExecution execution) {
- msoLogger.info(" ***** Started prepareUpdateProgress *****")
+ logger.info(" ***** Started prepareUpdateProgress *****")
ResourceInput resourceInputObj = execution.getVariable(Prefix + "ResourceInput")
String operType = resourceInputObj.getOperationType()
String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
@@ -189,25 +192,25 @@ public class CreateDeviceResource extends AbstractServiceTaskProcessor {
</soapenv:Envelope>"""
setProgressUpdateVariables(execution, body)
- msoLogger.info(" ***** Exit prepareUpdateProgress *****")
+ logger.info(" ***** Exit prepareUpdateProgress *****")
}
private void getVNFTemplatefromSDC(DelegateExecution execution){
- msoLogger.info(" ***** Started getVNFTemplatefromSDC *****")
+ logger.info(" ***** Started getVNFTemplatefromSDC *****")
try {
// To do
} catch (Exception ex){
String msg = "Exception in getVNFTemplatefromSDC " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
public void prepareVnfAndModulesCreate(DelegateExecution execution) {
try {
- msoLogger.trace("Inside prepareVnfAndModulesCreate of CreateDeviceResource ")
+ logger.trace("Inside prepareVnfAndModulesCreate of CreateDeviceResource ")
JSONObject resourceInputParameters = execution.getVariable(Prefix + "ResourceRequestInputs")
String devType = resourceInputParameters.get("device_type")
@@ -221,30 +224,30 @@ public class CreateDeviceResource extends AbstractServiceTaskProcessor {
String vnfModelInfoString = null;
if (vnf != null) {
- msoLogger.debug("getting model info for vnf # " + vnfsCreatedCount)
+ logger.debug("getting model info for vnf # " + vnfsCreatedCount)
ModelInfo vnfModelInfo = vnf.getModelInfo()
vnfModelInfoString = vnfModelInfo.toString()
} else {
- msoLogger.debug("vnf is null")
+ logger.debug("vnf is null")
vnfModelInfoString = execution.getVariable("vnfModelInfo")
}
- msoLogger.debug(" vnfModelInfoString :" + vnfModelInfoString)
+ logger.debug(" vnfModelInfoString :" + vnfModelInfoString)
// extract cloud configuration
// String vimId = jsonUtil.getJsonValue(createVcpeServiceRequest,
// "requestDetails.cloudConfiguration.lcpCloudRegionId")
// def cloudRegion = vimId.split("_")
// execution.setVariable("cloudOwner", cloudRegion[0])
-// msoLogger.debug("cloudOwner: "+ cloudRegion[0])
+// logger.debug("cloudOwner: "+ cloudRegion[0])
// execution.setVariable("cloudRegionId", cloudRegion[1])
-// msoLogger.debug("cloudRegionId: "+ cloudRegion[1])
+// logger.debug("cloudRegionId: "+ cloudRegion[1])
// execution.setVariable("lcpCloudRegionId", cloudRegion[1])
-// msoLogger.debug("lcpCloudRegionId: "+ cloudRegion[1])
+// logger.debug("lcpCloudRegionId: "+ cloudRegion[1])
// String tenantId = jsonUtil.getJsonValue(createVcpeServiceRequest,
// "requestDetails.cloudConfiguration.tenantId")
// execution.setVariable("tenantId", tenantId)
-// msoLogger.debug("tenantId: " + tenantId)
+// logger.debug("tenantId: " + tenantId)
execution.setVariable("cloudOwner", "")
@@ -256,13 +259,13 @@ public class CreateDeviceResource extends AbstractServiceTaskProcessor {
execution.setVariable("tenantId", "")
String sdncVersion = execution.getVariable("sdncVersion")
- msoLogger.debug("sdncVersion: " + sdncVersion)
+ logger.debug("sdncVersion: " + sdncVersion)
- msoLogger.trace("Completed prepareVnfAndModulesCreate of CreateVcpeResCustService ")
+ logger.trace("Completed prepareVnfAndModulesCreate of CreateVcpeResCustService ")
} catch (Exception ex) {
// try error in method block
String exceptionMessage = "Bpmn error encountered in CreateDeviceResource flow. Unexpected Error from method prepareVnfAndModulesCreate() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
}
}
@@ -272,7 +275,7 @@ public class CreateDeviceResource extends AbstractServiceTaskProcessor {
public void validateVnfCreate(DelegateExecution execution) {
try {
- msoLogger.trace("Inside validateVnfCreate of CreateDeviceResource ")
+ logger.trace("Inside validateVnfCreate of CreateDeviceResource ")
//Update Relationship between VNF to Device
addVNFAAIRelationShip(execution)
@@ -282,45 +285,45 @@ public class CreateDeviceResource extends AbstractServiceTaskProcessor {
execution.setVariable(Prefix + "VnfsCreatedCount", vnfsCreatedCount)
- msoLogger.debug(" ***** Completed validateVnfCreate of CreateDeviceResource ***** " + " vnf # " + vnfsCreatedCount)
+ logger.debug(" ***** Completed validateVnfCreate of CreateDeviceResource ***** " + " vnf # " + vnfsCreatedCount)
} catch (Exception ex) {
// try error in method block
String exceptionMessage = "Bpmn error encountered in CreateDeviceResource flow. Unexpected Error from method validateVnfCreate() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
}
}
public void addVNFAAIRelationShip(DelegateExecution execution) {
try {
- msoLogger.trace("Inside addVNFAAIRelationShip of CreateDeviceResource ")
+ logger.trace("Inside addVNFAAIRelationShip of CreateDeviceResource ")
- msoLogger.debug(" ***** Completed addVNFAAIRelationShip of CreateDeviceResource ***** ")
+ logger.debug(" ***** Completed addVNFAAIRelationShip of CreateDeviceResource ***** ")
} catch (Exception ex) {
// try error in method block
String exceptionMessage = "Bpmn error encountered in CreateDeviceResource flow. Unexpected Error from method addVNFAAIRelationShip() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
}
}
public void sendSyncResponse (DelegateExecution execution) {
- msoLogger.debug(" *** sendSyncResponse *** ")
+ logger.debug(" *** sendSyncResponse *** ")
try {
String operationStatus = "finished"
// RESTResponse for main flow
String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
- msoLogger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
+ logger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
sendWorkflowResponse(execution, 202, resourceOperationResp)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- utils.log("DEBUG"," ***** Exit sendSyncResopnse *****")
+ logger.debug(" ***** Exit sendSyncResopnse *****")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy
index 848785e5f3..6f5f5b3290 100755
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -35,7 +37,8 @@ import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.domain.ServiceDecomposition
import org.onap.so.bpmn.core.json.JsonUtils
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.springframework.web.util.UriUtils
import groovy.json.*
@@ -49,7 +52,7 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
String Prefix="CRESI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CreateGenericALaCarteServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( CreateGenericALaCarteServiceInstance.class);
public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
@@ -59,18 +62,18 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
try {
String siRequest = execution.getVariable("bpmnRequest")
- msoLogger.debug(siRequest)
+ logger.debug(siRequest)
String requestId = execution.getVariable("mso-request-id")
execution.setVariable("msoRequestId", requestId)
- msoLogger.debug("Input Request:" + siRequest + " reqId:" + requestId)
+ logger.debug("Input Request:" + siRequest + " reqId:" + requestId)
String serviceInstanceId = execution.getVariable("serviceInstanceId")
if (isBlank(serviceInstanceId)) {
serviceInstanceId = UUID.randomUUID().toString()
- msoLogger.debug("Generated new Service Instance ID:" + serviceInstanceId)
+ logger.debug("Generated new Service Instance ID:" + serviceInstanceId)
} else {
- msoLogger.debug("Using provided Service Instance ID:" + serviceInstanceId)
+ logger.debug("Using provided Service Instance ID:" + serviceInstanceId)
}
serviceInstanceId = UriUtils.encode(serviceInstanceId,"UTF-8")
@@ -98,7 +101,7 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
if (isBlank(productFamilyId))
{
msg = "Input productFamilyId is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
//exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
} else {
execution.setVariable("productFamilyId", productFamilyId)
@@ -108,20 +111,20 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
String serviceModelInfo = jsonUtil.getJsonValue(siRequest, "requestDetails.modelInfo")
if (isBlank(serviceModelInfo)) {
msg = "Input serviceModelInfo is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
} else
{
execution.setVariable("serviceModelInfo", serviceModelInfo)
}
- msoLogger.debug("modelInfo" + serviceModelInfo)
+ logger.debug("modelInfo" + serviceModelInfo)
//requestParameters
String subscriptionServiceType = jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.subscriptionServiceType")
if (isBlank(subscriptionServiceType)) {
msg = "Input subscriptionServiceType is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
} else {
execution.setVariable("subscriptionServiceType", subscriptionServiceType)
@@ -144,7 +147,7 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
userParams.each {
userParam ->
if ("Customer_Location".equals(userParam?.name)) {
- msoLogger.debug("User Input customerLocation: " + userParam.value.toString())
+ logger.debug("User Input customerLocation: " + userParam.value.toString())
Map<String, String> customerMap = [:]
userParam.value.each {
param ->
@@ -155,14 +158,14 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
execution.setVariable("customerLocation", customerMap)
}
if ("Homing_Solution".equals(userParam?.name)) {
- msoLogger.debug("User Input Homing_Solution: " + userParam.value.toString())
+ logger.debug("User Input Homing_Solution: " + userParam.value.toString())
execution.setVariable("homingService", userParam.value)
execution.setVariable("callHoming", true)
inputMap.put("Homing_Solution", userParam.value)
}
if (!"Homing_Solution".equals(userParam?.name) && !"Customer_Location".equals(userParam?.name))
{
- msoLogger.debug("User Input Parameter " + userParam.name + ": " + userParam.value.toString())
+ logger.debug("User Input Parameter " + userParam.name + ": " + userParam.value.toString())
inputMap.put(userParam.name, userParam.value)
}
if ("Orchestrator".equalsIgnoreCase(userParam?.name)) {
@@ -172,8 +175,8 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
}
}
- msoLogger.debug("User Input Parameters map: " + userParams.toString())
- msoLogger.debug("User Input Map: " + inputMap.toString())
+ logger.debug("User Input Parameters map: " + userParams.toString())
+ logger.debug("User Input Map: " + inputMap.toString())
if (inputMap.toString() != "[:]") {
execution.setVariable("serviceInputParams", inputMap)
}
@@ -185,37 +188,37 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit preProcessRequest")
+ logger.trace("Exit preProcessRequest")
}
public void sendSyncResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("Start sendSyncResponse")
+ logger.trace("Start sendSyncResponse")
try {
String requestId = execution.getVariable("msoRequestId")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
// RESTResponse for API Handler (APIH) Reply Task
String createServiceRestRequest = """{"requestReferences":{"instanceId":"${serviceInstanceId}","requestId":"${requestId}"}}""".trim()
- msoLogger.debug(" sendSyncResponse to APIH:" + "\n" + createServiceRestRequest)
+ logger.debug(" sendSyncResponse to APIH:" + "\n" + createServiceRestRequest)
sendWorkflowResponse(execution, 202, createServiceRestRequest)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit sendSyncResopnse")
+ logger.trace("Exit sendSyncResopnse")
}
public void sendSyncError (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("Start sendSyncError")
+ logger.trace("Start sendSyncError")
try {
String errorMessage = ""
@@ -232,11 +235,11 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
<aetgt:ErrorCode>7000</aetgt:ErrorCode>
</aetgt:WorkflowException>"""
- msoLogger.debug(buildworkflowException)
+ logger.debug(buildworkflowException)
sendWorkflowResponse(execution, 500, buildworkflowException)
} catch (Exception ex) {
- msoLogger.debug(" Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
+ logger.debug(" Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
}
}
@@ -246,7 +249,7 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
// *******************************
public void prepareDecomposeService(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("Inside prepareDecomposeService of CreateGenericALaCarteServiceInstance ")
+ logger.trace("Inside prepareDecomposeService of CreateGenericALaCarteServiceInstance ")
try {
String siRequest = execution.getVariable("bpmnRequest")
String serviceModelInfo = jsonUtil.getJsonValue(siRequest, "requestDetails.modelInfo")
@@ -256,13 +259,13 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
String exceptionMessage = "Bpmn error encountered in CreateGenericALaCarteServiceInstance flow. Unexpected Error from method prepareDecomposeService() - " + ex.getMessage()
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- msoLogger.trace("Completed prepareDecomposeService of CreateGenericALaCarteServiceInstance")
+ logger.trace("Completed prepareDecomposeService of CreateGenericALaCarteServiceInstance")
}
public void processDecomposition(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("Inside processDecomposition() of CreateGenericALaCarteServiceInstance ")
+ logger.trace("Inside processDecomposition() of CreateGenericALaCarteServiceInstance ")
try {
@@ -278,7 +281,7 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
String vnfModelInfoString = ""
if (vnfList != null && vnfList.size() > 0) {
execution.setVariable(Prefix + "VNFsCount", vnfList.size())
- msoLogger.debug("vnfs to create: " + vnfList.size())
+ logger.debug("vnfs to create: " + vnfList.size())
ModelInfo vnfModelInfo = vnfList[0].getModelInfo()
vnfModelInfoString = vnfModelInfo.toString()
@@ -286,18 +289,18 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
vnfModelInfoString = jsonUtil.getJsonValue(vnfModelInfoWithRoot, "modelInfo")
} else {
execution.setVariable(Prefix + "VNFsCount", 0)
- msoLogger.debug("no vnfs to create based upon serviceDecomposition content")
+ logger.debug("no vnfs to create based upon serviceDecomposition content")
}
execution.setVariable("vnfModelInfo", vnfModelInfoString)
execution.setVariable("vnfModelInfoString", vnfModelInfoString)
- msoLogger.debug(" vnfModelInfoString :" + vnfModelInfoString)
+ logger.debug(" vnfModelInfoString :" + vnfModelInfoString)
- msoLogger.trace("Completed processDecomposition() of CreateGenericALaCarteServiceInstance ")
+ logger.trace("Completed processDecomposition() of CreateGenericALaCarteServiceInstance ")
} catch (Exception ex) {
sendSyncError(execution)
String exceptionMessage = "Bpmn error encountered in CreateGenericALaCarteServiceInstance flow. processDecomposition() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
}
@@ -309,7 +312,7 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
try {
- msoLogger.trace("Inside prepareCreateServiceInstance of CreateGenericALaCarteServiceInstance")
+ logger.trace("Inside prepareCreateServiceInstance of CreateGenericALaCarteServiceInstance")
/*
* Extracting User Parameters from incoming Request and converting into a Map
@@ -327,7 +330,7 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
userParams.each {
userParam ->
if ("Customer_Location".equals(userParam?.name)) {
- msoLogger.debug("User Input customerLocation: " + userParam.value.toString())
+ logger.debug("User Input customerLocation: " + userParam.value.toString())
Map<String, String> customerMap = [:]
userParam.value.each {
param ->
@@ -338,14 +341,14 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
execution.setVariable("customerLocation", customerMap)
}
if ("Homing_Solution".equals(userParam?.name)) {
- msoLogger.debug("User Input Homing_Solution: " + userParam.value.toString())
+ logger.debug("User Input Homing_Solution: " + userParam.value.toString())
execution.setVariable("homingService", userParam.value)
execution.setVariable("callHoming", true)
inputMap.put("Homing_Solution", userParam.value)
}
if (!"Homing_Solution".equals(userParam?.name) && !"Customer_Location".equals(userParam?.name))
{
- msoLogger.debug("User Input Parameter " + userParam.name + ": " + userParam.value.toString())
+ logger.debug("User Input Parameter " + userParam.name + ": " + userParam.value.toString())
inputMap.put(userParam.name, userParam.value)
}
if ("Orchestrator".equalsIgnoreCase(userParam?.name)) {
@@ -355,8 +358,8 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
}
}
- msoLogger.debug("User Input Parameters map: " + userParams.toString())
- msoLogger.debug("User Input Map: " + inputMap.toString())
+ logger.debug("User Input Parameters map: " + userParams.toString())
+ logger.debug("User Input Map: " + inputMap.toString())
if (inputMap.toString() != "[:]") {
execution.setVariable("serviceInputParams", inputMap)
}
@@ -370,9 +373,9 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
execution.setVariable("serviceInstanceName", serviceInstanceName)
execution.setVariable("serviceDecomposition", serviceDecomposition)
execution.setVariable("serviceDecompositionString", serviceDecomposition.toJsonString())
- msoLogger.debug("serviceDecomposition.serviceInstanceName: " + serviceDecomposition.getServiceInstance().getInstanceName())
+ logger.debug("serviceDecomposition.serviceInstanceName: " + serviceDecomposition.getServiceInstance().getInstanceName())
- msoLogger.trace("Completed prepareCreateServiceInstance of CreateGenericALaCarteServiceInstance ***** ")
+ logger.trace("Completed prepareCreateServiceInstance of CreateGenericALaCarteServiceInstance ***** ")
} catch (Exception ex) {
// try error in method block
String exceptionMessage = "Bpmn error encountered in CreateGenericALaCarteServiceInstance flow. Unexpected Error from method prepareCreateServiceInstance() - " + ex.getMessage()
@@ -383,7 +386,7 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
public void prepareCompletionRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("prepareCompletion *** ")
+ logger.trace("prepareCompletion *** ")
try {
String requestId = execution.getVariable("msoRequestId")
@@ -407,23 +410,23 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
execution.setVariable("completionRequest", xmlMsoCompletionRequest)
- msoLogger.debug(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
+ logger.debug(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
} catch (Exception ex) {
String msg = " Exception in prepareCompletion:" + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit prepareCompletionRequest")
+ logger.trace("Exit prepareCompletionRequest")
}
public void prepareFalloutRequest(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("prepareFalloutRequest")
+ logger.trace("prepareFalloutRequest")
try {
WorkflowException wfex = execution.getVariable("WorkflowException")
- msoLogger.debug(" Input Workflow Exception: " + wfex.toString())
+ logger.debug(" Input Workflow Exception: " + wfex.toString())
String requestId = execution.getVariable("msoRequestId")
String source = execution.getVariable("source")
String requestInfo =
@@ -436,7 +439,7 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
execution.setVariable("falloutRequest", falloutRequest)
} catch (Exception ex) {
- msoLogger.debug("Exception prepareFalloutRequest:" + ex.getMessage())
+ logger.debug("Exception prepareFalloutRequest:" + ex.getMessage())
String errorException = " Bpmn error encountered in CreateGenericALaCarteServiceInstance flow. FalloutHandlerRequest, buildErrorResponse() - " + ex.getMessage()
String requestId = execution.getVariable("msoRequestId")
String falloutRequest =
@@ -456,6 +459,6 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
execution.setVariable("falloutRequest", falloutRequest)
}
- msoLogger.trace("Exit prepareFalloutRequest")
+ logger.trace("Exit prepareFalloutRequest")
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateNetworkInstance.groovy
index bdb44ca3e2..16f7d53087 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateNetworkInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateNetworkInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -29,6 +31,8 @@ import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import groovy.json.*
@@ -37,7 +41,7 @@ import groovy.json.*
*
*/
public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CreateNetworkInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( CreateNetworkInstance.class);
String Prefix="CRENI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -71,7 +75,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Start preProcessRequest")
+ logger.trace("Start preProcessRequest")
try {
// initialize flow variables
@@ -87,20 +91,20 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
String disableRollback = jsonUtil.getJsonValue(bpmnRequest, "requestDetails.requestInfo.suppressRollback")
if (disableRollback != null) {
execution.setVariable("disableRollback", disableRollback)
- msoLogger.debug("Received 'suppressRollback': " + disableRollback )
+ logger.debug("Received 'suppressRollback': " + disableRollback )
} else {
execution.setVariable("disableRollback", false)
}
- msoLogger.debug(" Set 'disableRollback' : " + execution.getVariable("disableRollback") )
+ logger.debug(" Set 'disableRollback' : " + execution.getVariable("disableRollback") )
} else {
String dataErrorMessage = " Invalid 'bpmnRequest' request."
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
} else {
// 'macro' TEST ONLY, sdncVersion = '1702'
- msoLogger.debug(" 'disableRollback' : " + execution.getVariable("disableRollback") )
+ logger.debug(" 'disableRollback' : " + execution.getVariable("disableRollback") )
}
// get/set 'msoRequestId' and 'mso-request-id'
@@ -146,7 +150,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
sendSyncError(execution)
// caught exception
String exceptionMessage = "Exception Encountered in CreateNetworkInstance, PreProcessRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -156,7 +160,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Start sendSyncResponse")
+ logger.trace("Start sendSyncResponse")
try {
String requestId = execution.getVariable("mso-request-id")
@@ -164,12 +168,12 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
// RESTResponse (for API Handler (APIH) Reply Task)
String createNetworkRestRequest = """{"requestReferences":{"instanceId":"","requestId":"${requestId}"}}""".trim()
- msoLogger.debug(" sendSyncResponse to APIH - " + "\n" + createNetworkRestRequest)
+ logger.debug(" sendSyncResponse to APIH - " + "\n" + createNetworkRestRequest)
sendWorkflowResponse(execution, 202, createNetworkRestRequest)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in CreateNetworkInstance flow. sendSyncResponse() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -180,7 +184,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Start getNetworkModelInfo")
+ logger.trace("Start getNetworkModelInfo")
try {
@@ -193,7 +197,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
} catch (Exception ex) {
sendSyncError(execution)
String exceptionMessage = "Bpmn error encountered in CreateNetworkInstance flow. getNetworkModelInfo() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -205,7 +209,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Start sendSyncError")
+ logger.trace("Start sendSyncError")
try {
@@ -217,7 +221,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
sendWorkflowResponse(execution, 500, syncError)
} catch (Exception ex) {
- msoLogger.debug(" Bpmn error encountered in CreateNetworkInstance flow. sendSyncError() - " + ex.getMessage())
+ logger.debug(" Bpmn error encountered in CreateNetworkInstance flow. sendSyncError() - " + ex.getMessage())
}
}
@@ -227,7 +231,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
try {
- msoLogger.trace("Start prepareDBRequestError")
+ logger.trace("Start prepareDBRequestError")
// set DB Header Authorization
setBasicDBAuthHeader(execution, isDebugEnabled)
@@ -258,12 +262,12 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
</soapenv:Envelope>"""
execution.setVariable(Prefix + "createDBRequest", dbRequest)
- msoLogger.debug(" DB Adapter Request - " + "\n" + dbRequest)
- msoLogger.debug(dbRequest)
+ logger.debug(" DB Adapter Request - " + "\n" + dbRequest)
+ logger.debug(dbRequest)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in CreateNetworkInstance flow. prepareDBRequestError() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -274,7 +278,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Start prepareCompletion")
+ logger.trace("Start prepareCompletion")
try {
@@ -301,11 +305,11 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
// normal path
execution.setVariable(Prefix + "Success", true)
execution.setVariable(Prefix + "CompleteMsoProcessRequest", xmlMsoCompletionRequest)
- msoLogger.debug(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
+ logger.debug(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in CreateNetworkInstance flow. prepareCompletion() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -324,25 +328,25 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Start postProcessResponse")
+ logger.trace("Start postProcessResponse")
try {
if (execution.getVariable("CMSO_ResponseCode") == "200") {
execution.setVariable(Prefix + "Success", true)
- msoLogger.trace("CreateNetworkInstance Success ****")
+ logger.trace("CreateNetworkInstance Success ****")
// Place holder for additional code.
} else {
execution.setVariable(Prefix + "Success", false)
- msoLogger.trace("CreateNetworkInstance Failed in CompletionMsoProces flow!. ****")
+ logger.trace("CreateNetworkInstance Failed in CompletionMsoProces flow!. ****")
}
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in CreateNetworkInstance flow. postProcessResponse() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -358,7 +362,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Start processRollbackData")
+ logger.trace("Start processRollbackData")
try {
//execution.getVariable("orchestrationStatus")
@@ -369,7 +373,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
//rolledBack
} catch (Exception ex) {
- msoLogger.debug(" Bpmn error encountered in CreateNetworkInstance flow. callDBCatalog() - " + ex.getMessage())
+ logger.debug(" Bpmn error encountered in CreateNetworkInstance flow. callDBCatalog() - " + ex.getMessage())
}
}
@@ -379,10 +383,10 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
- msoLogger.debug("DB updateInfraRequest ResponseCode: " + execution.getVariable(Prefix + "dbReturnCode"))
- msoLogger.debug("DB updateInfraRequest Response: " + execution.getVariable(Prefix + "createDBResponse"))
+ logger.debug("DB updateInfraRequest ResponseCode: " + execution.getVariable(Prefix + "dbReturnCode"))
+ logger.debug("DB updateInfraRequest Response: " + execution.getVariable(Prefix + "createDBResponse"))
- msoLogger.trace("Prepare for FalloutHandler. FAILURE - prepare request for sub-process FalloutHandler.")
+ logger.trace("Prepare for FalloutHandler. FAILURE - prepare request for sub-process FalloutHandler.")
String falloutHandlerRequest = ""
String requestId = execution.getVariable("mso-request-id")
@@ -407,13 +411,13 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
</aetgt:WorkflowException>
</aetgt:FalloutHandlerRequest>"""
- msoLogger.debug(falloutHandlerRequest)
+ logger.debug(falloutHandlerRequest)
execution.setVariable(Prefix + "FalloutHandlerRequest", falloutHandlerRequest)
- msoLogger.debug(" Overall Error Response going to FalloutHandler: " + "\n" + falloutHandlerRequest)
+ logger.debug(" Overall Error Response going to FalloutHandler: " + "\n" + falloutHandlerRequest)
} catch (Exception ex) {
String errorException = " Bpmn error encountered in CreateNetworkInstance flow. FalloutHandlerRequest, buildErrorResponse()"
- msoLogger.debug("Exception error in CreateNetworkInstance flow, buildErrorResponse(): " + ex.getMessage())
+ logger.debug("Exception error in CreateNetworkInstance flow, buildErrorResponse(): " + ex.getMessage())
falloutHandlerRequest =
"""<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
xmlns:ns="http://org.onap/so/request/types/v1"
@@ -430,7 +434,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
</aetgt:FalloutHandlerRequest>"""
execution.setVariable(Prefix + "FalloutHandlerRequest", falloutHandlerRequest)
- msoLogger.debug(" Overall Error Response going to FalloutHandler: " + "\n" + falloutHandlerRequest)
+ logger.debug(" Overall Error Response going to FalloutHandler: " + "\n" + falloutHandlerRequest)
}
@@ -440,18 +444,18 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
try{
- msoLogger.debug("Caught a Java Exception in " + Prefix)
- msoLogger.debug("Started processJavaException Method")
- msoLogger.debug("Variables List: " + execution.getVariables())
+ logger.debug("Caught a Java Exception in " + Prefix)
+ logger.debug("Started processJavaException Method")
+ logger.debug("Variables List: " + execution.getVariables())
execution.setVariable("UnexpectedError", "Caught a Java Lang Exception - " + Prefix) // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception")
}catch(Exception e){
- msoLogger.debug("Caught Exception during processJavaException Method: " + e)
+ logger.debug("Caught Exception during processJavaException Method: " + e)
execution.setVariable("UnexpectedError", "Exception in processJavaException method - " + Prefix) // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method" + Prefix)
}
- msoLogger.debug("Completed processJavaException Method in " + Prefix)
+ logger.debug("Completed processJavaException Method in " + Prefix)
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
index 9301f3d508..bb2116acb9 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -39,7 +41,8 @@ import org.onap.so.client.aai.AAIObjectPlurals
import org.onap.so.client.aai.AAIResourcesClient
import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import static org.apache.commons.lang3.StringUtils.*
@@ -49,7 +52,7 @@ import static org.apache.commons.lang3.StringUtils.*
*/
public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CreateSDNCNetworkResource.class);
+ private static final Logger logger = LoggerFactory.getLogger( CreateSDNCNetworkResource.class);
String Prefix="CRESDNCRES_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -60,17 +63,17 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
public void preProcessRequest(DelegateExecution execution){
- msoLogger.info(" ***** Started preProcessRequest *****")
+ logger.info(" ***** Started preProcessRequest *****")
try {
//get bpmn inputs from resource request.
String requestId = execution.getVariable("mso-request-id")
String requestAction = execution.getVariable("requestAction")
- msoLogger.info("The requestAction is: " + requestAction)
+ logger.info("The requestAction is: " + requestAction)
String recipeParamsFromRequest = execution.getVariable("recipeParams")
- msoLogger.info("The recipeParams is: " + recipeParamsFromRequest)
+ logger.info("The recipeParams is: " + recipeParamsFromRequest)
String resourceInput = execution.getVariable("resourceInput")
- msoLogger.info("The resourceInput is: " + resourceInput)
+ logger.info("The resourceInput is: " + resourceInput)
//Get ResourceInput Object
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
execution.setVariable(Prefix + "resourceInput", resourceInputObj.toString())
@@ -158,7 +161,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -238,7 +241,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
* generate the nsParameters
*/
public void prepareSDNCRequest (DelegateExecution execution) {
- msoLogger.info(" ***** Started prepareSDNCRequest *****")
+ logger.info(" ***** Started prepareSDNCRequest *****")
try {
// get variables
@@ -440,15 +443,15 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
String sndcTopologyCreateRequesAsString = utils.formatXml(sdncTopologyCreateRequest)
utils.logAudit(sndcTopologyCreateRequesAsString)
execution.setVariable("sdncAdapterWorkflowRequest", sndcTopologyCreateRequesAsString)
- msoLogger.debug("sdncAdapterWorkflowRequest - " + "\n" + sndcTopologyCreateRequesAsString)
+ logger.debug("sdncAdapterWorkflowRequest - " + "\n" + sndcTopologyCreateRequesAsString)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in CreateSDNCCNetworkResource flow. prepareSDNCRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- msoLogger.info(" ***** Exit prepareSDNCRequest *****")
+ logger.info(" ***** Exit prepareSDNCRequest *****")
}
private void setProgressUpdateVariables(DelegateExecution execution, String body) {
@@ -523,7 +526,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
}
public void afterCreateSDNCCall(DelegateExecution execution){
- msoLogger.info(" ***** Started prepareSDNCRequest *****")
+ logger.info(" ***** Started prepareSDNCRequest *****")
String responseCode = execution.getVariable(Prefix + "sdncCreateReturnCode")
String responseObj = execution.getVariable(Prefix + "SuccessIndicator")
@@ -533,8 +536,8 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
execution.setVariable("networkInstanceId", instnaceId)
}
- msoLogger.info("response from sdnc, response code :" + responseCode + " response object :" + responseObj)
- msoLogger.info(" ***** Exit prepareSDNCRequest *****")
+ logger.info("response from sdnc, response code :" + responseCode + " response object :" + responseObj)
+ logger.info(" ***** Exit prepareSDNCRequest *****")
}
private def getInstnaceId(DelegateExecution execution) {
@@ -566,21 +569,21 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
}
public void sendSyncResponse (DelegateExecution execution) {
- msoLogger.debug(" *** sendSyncResponse *** ")
+ logger.debug(" *** sendSyncResponse *** ")
try {
String operationStatus = "finished"
// RESTResponse for main flow
String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
- msoLogger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
+ logger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
sendWorkflowResponse(execution, 202, resourceOperationResp)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
String msg = "Exception in sendSyncResponse:" + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.debug(" ***** Exit sendSyncResponse *****")
+ logger.debug(" ***** Exit sendSyncResponse *****")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
index 6222214108..433a8d0bb9 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -30,7 +32,8 @@ import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.client.HttpClient
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.onap.so.bpmn.core.UrnPropertiesReader
import javax.ws.rs.core.Response
@@ -41,7 +44,7 @@ import org.onap.so.utils.TargetEntity
* flow for VFC Network Service Create
*/
public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CreateVFCNSResource.class);
+ private static final Logger logger = LoggerFactory.getLogger( CreateVFCNSResource.class);
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -58,7 +61,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
JsonUtils jsonUtil = new JsonUtils()
String msg = ""
- msoLogger.trace("preProcessRequest() ")
+ logger.trace("preProcessRequest() ")
try {
//deal with nsName and Description
String resourceInput = execution.getVariable("resourceInput")
@@ -69,24 +72,24 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
execution.setVariable("nsServiceName", resourceName)
String nsServiceDescription = execution.getVariable("nsServiceDescription")
- msoLogger.info("nsServiceName:" + resourceName + " nsServiceDescription:" + nsServiceDescription)
+ logger.info("nsServiceName:" + resourceName + " nsServiceDescription:" + nsServiceDescription)
//deal with operation key
String globalSubscriberId = jsonUtil.getJsonValue(resourceInput, "globalSubscriberId")
- msoLogger.info("globalSubscriberId:" + globalSubscriberId)
+ logger.info("globalSubscriberId:" + globalSubscriberId)
//set local globalSubscriberId variable
execution.setVariable("globalSubscriberId", globalSubscriberId);
String serviceType = execution.getVariable("serviceType")
- msoLogger.info("serviceType:" + serviceType)
+ logger.info("serviceType:" + serviceType)
String serviceId = execution.getVariable("serviceInstanceId")
- msoLogger.info("serviceId:" + serviceId)
+ logger.info("serviceId:" + serviceId)
String operationId = jsonUtil.getJsonValue(resourceInput, "operationId")
- msoLogger.info("serviceType:" + serviceType)
+ logger.info("serviceType:" + serviceType)
String nodeTemplateUUID = jsonUtil.getJsonValue(resourceInput, "resourceModelInfo.modelCustomizationUuid")
String nsServiceModelUUID = jsonUtil.getJsonValue(resourceParameters, "requestInputs.nsd0_providing_service_uuid")
- msoLogger.info("nodeTemplateUUID:" + nodeTemplateUUID)
+ logger.info("nodeTemplateUUID:" + nodeTemplateUUID)
/*
* segmentInformation needed as a object of segment
* {
@@ -99,7 +102,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
* }
*/
String nsParameters = jsonUtil.getJsonValue(resourceInput, "resourceParameters")
- msoLogger.info("nsParameters:" + nsParameters)
+ logger.info("nsParameters:" + nsParameters)
String nsOperationKey = """{
"globalSubscriberId":"${globalSubscriberId}",
"serviceType":"${serviceType}",
@@ -115,7 +118,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
if (vfcAdapterUrl == null || vfcAdapterUrl.isEmpty()) {
msg = getProcessKey(execution) + ': mso:adapters:vfcc:rest:endpoint URN mapping is not defined'
- msoLogger.debug(msg)
+ logger.debug(msg)
}
while (vfcAdapterUrl.endsWith('/')) {
@@ -128,17 +131,17 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit preProcessRequest ")
+ logger.trace("Exit preProcessRequest ")
}
/**
* create NS task
*/
public void createNetworkService(DelegateExecution execution) {
- msoLogger.trace("createNetworkService ")
+ logger.trace("createNetworkService ")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
String nsOperationKey = execution.getVariable("nsOperationKey");
String nsServiceModelUUID = execution.getVariable("nsServiceModelUUID");
@@ -165,14 +168,14 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
nsInstanceId = jsonUtil.getJsonValue(aaiResponseAsString, "nsInstanceId")
}
execution.setVariable("nsInstanceId", nsInstanceId)
- msoLogger.info(" *****Exit createNetworkService *****")
+ logger.info(" *****Exit createNetworkService *****")
}
/**
* instantiate NS task
*/
public void instantiateNetworkService(DelegateExecution execution) {
- msoLogger.trace("instantiateNetworkService ")
+ logger.trace("instantiateNetworkService ")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
String nsOperationKey = execution.getVariable("nsOperationKey");
String nsParameters = execution.getVariable("nsParameters");
@@ -194,14 +197,14 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
jobId = jsonUtil.getJsonValue(aaiResponseAsString, "jobId")
}
execution.setVariable("jobId", jobId)
- msoLogger.info(" *****Exit instantiateNetworkService *****")
+ logger.info(" *****Exit instantiateNetworkService *****")
}
/**
* query NS task
*/
public void queryNSProgress(DelegateExecution execution) {
- msoLogger.trace("queryNSProgress ")
+ logger.trace("queryNSProgress ")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
String jobId = execution.getVariable("jobId")
String nsOperationKey = execution.getVariable("nsOperationKey");
@@ -214,7 +217,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
operationStatus = jsonUtil.getJsonValue(aaiResponseAsString, "responseDescriptor.status")
}
execution.setVariable("operationStatus", operationStatus)
- msoLogger.info(" *****Exit queryNSProgress *****")
+ logger.info(" *****Exit queryNSProgress *****")
}
/**
@@ -224,7 +227,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
try {
Thread.sleep(5000);
} catch(InterruptedException e) {
- msoLogger.error( "Time Delay exception" + e.getMessage());
+ logger.error("Time Delay exception" + e.getMessage());
}
}
@@ -232,10 +235,10 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
* finish NS task
*/
public void addNSRelationship(DelegateExecution execution) {
- msoLogger.trace("addNSRelationship ")
+ logger.trace("addNSRelationship ")
String nsInstanceId = execution.getVariable("nsInstanceId")
if(nsInstanceId == null || nsInstanceId == ""){
- msoLogger.info(" create NS failed, so do not need to add relationship")
+ logger.info(" create NS failed, so do not need to add relationship")
return
}
String globalSubscriberId = execution.getVariable("globalSubscriberId")
@@ -247,9 +250,9 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
try{
getAAIClient().connect(nsUri,relatedServiceUri)
- msoLogger.info("NS relationship to Service added successfully")
+ logger.info("NS relationship to Service added successfully")
}catch(Exception e){
- msoLogger.error("Exception occured while Creating NS relationship."+ e.getMessage());
+ logger.error("Exception occured while Creating NS relationship."+ e.getMessage());
throw new BpmnError("MSOWorkflowException")
}
}
@@ -260,8 +263,8 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
* requestBody: the body of the request
*/
private Response postRequest(DelegateExecution execution, String urlString, String requestBody){
- msoLogger.trace("Started Execute VFC adapter Post Process ")
- msoLogger.info("url:" + urlString +"\nrequestBody:"+ requestBody)
+ logger.trace("Started Execute VFC adapter Post Process ")
+ logger.info("url:" + urlString +"\nrequestBody:"+ requestBody)
Response apiResponse = null
try{
@@ -276,36 +279,36 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
apiResponse = httpClient.post(requestBody)
- msoLogger.debug("response code:"+ apiResponse.getStatus() +"\nresponse body:"+ apiResponse.readEntity(String.class))
+ logger.debug("response code:"+ apiResponse.getStatus() +"\nresponse body:"+ apiResponse.readEntity(String.class))
}catch(Exception e){
- msoLogger.error("VFC Aatpter Post Call Exception:" + e.getMessage());
+ logger.error("VFC Aatpter Post Call Exception:" + e.getMessage());
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "VFC Aatpter Post Call Exception")
}
- msoLogger.trace("Completed Execute VF-C adapter Post Process ")
+ logger.trace("Completed Execute VF-C adapter Post Process ")
return apiResponse
}
public void sendSyncResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled)
+ logger.debug( " *** sendSyncResponse *** ")
try {
String operationStatus = execution.getVariable("operationStatus")
// RESTResponse for main flow
String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
- utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + resourceOperationResp, isDebugEnabled)
+ logger.debug( " sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
sendWorkflowResponse(execution, 202, resourceOperationResp)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
- utils.log("DEBUG", msg, isDebugEnabled)
+ logger.debug( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- utils.log("DEBUG"," ***** Exit sendSyncResopnse *****", isDebugEnabled)
+ logger.debug(" ***** Exit sendSyncResopnse *****")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy
index ffac4c0174..e3ac04e9e3 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -36,6 +38,8 @@ import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.infrastructure.aai.AAICreateResources;
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.w3c.dom.*
import javax.xml.parsers.*
import org.xml.sax.InputSource
@@ -43,7 +47,7 @@ import groovy.json.JsonOutput
import groovy.json.JsonSlurper
public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CreateVfModuleInfra.class);
+ private static final Logger logger = LoggerFactory.getLogger( CreateVfModuleInfra.class);
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
@@ -63,7 +67,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.debug('Started ' + method)
+ logger.debug('Started ' + method)
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
execution.setVariable("CVFMI_sentSyncResponse", false)
@@ -79,8 +83,8 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
execution.setVariable("RollbackData", rollbackData)
def incomingRequest = execution.getVariable('bpmnRequest')
- msoLogger.debug("Incoming Infra Request: " + incomingRequest)
- msoLogger.debug("CreateVfModule Infra incoming Request: " + incomingRequest)
+ logger.debug("Incoming Infra Request: " + incomingRequest)
+ logger.debug("CreateVfModule Infra incoming Request: " + incomingRequest)
setBasicDBAuthHeader(execution, isDebugLogEnabled)
@@ -89,7 +93,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
def jsonSlurper = new JsonSlurper()
def jsonOutput = new JsonOutput()
Map reqMap = jsonSlurper.parseText(incomingRequest)
- msoLogger.debug(" Request is in JSON format.")
+ logger.debug(" Request is in JSON format.")
def serviceInstanceId = execution.getVariable('serviceInstanceId')
def vnfId = execution.getVariable('vnfId')
@@ -140,7 +144,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
}
}
- msoLogger.debug('Processed user params: ' + userParamsMap)
+ logger.debug('Processed user params: ' + userParamsMap)
execution.setVariable(prefix + 'vfModuleInputParams', userParamsMap)
@@ -232,24 +236,25 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
execution.setVariable(prefix + 'controllerType', controllerType)
execution.setVariable('healthCheckIndex0', 0)
- msoLogger.debug('RequestInfo: ' + execution.getVariable("CVFMI_requestInfo"))
+ logger.debug('RequestInfo: ' + execution.getVariable("CVFMI_requestInfo"))
- msoLogger.debug('rollbackEnabled: ' + execution.getVariable("CVFMI_rollbackEnabled"))
+ logger.debug('rollbackEnabled: ' + execution.getVariable("CVFMI_rollbackEnabled"))
- msoLogger.trace('Finished ' + method)
+ logger.trace('Finished ' + method)
} catch (BpmnError bpmnError) {
throw bpmnError
}
catch(groovy.json.JsonException je) {
- msoLogger.debug("Request is not in JSON format.")
+ logger.debug("Request is not in JSON format.")
exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - During PreProcessRequest")
}
catch(Exception e) {
String restFaultMessage = e.getMessage()
//execution.setVariable("CVFMODVOL2_RESTFault", restFaultMessage)
//execution.setVariable("CVFMODVOL2_isDataOk", false)
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, " Exception Encountered - " + "\n" + restFaultMessage, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ " Exception Encountered - " + "\n" + restFaultMessage, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - During PreProcessRequest")
}
@@ -278,7 +283,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Started ' + method)
+ logger.trace('Started ' + method)
try {
def requestInfo = execution.getVariable('CVFMI_requestInfo')
@@ -292,13 +297,14 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
sendWorkflowResponse(execution, 200, synchResponse)
execution.setVariable("CVFMI_sentSyncResponse", true)
- msoLogger.debug("CreateVfModule Infra Response: " + synchResponse)
- msoLogger.trace('Finished ' + method)
+ logger.debug("CreateVfModule Infra Response: " + synchResponse)
+ logger.trace('Finished ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, " Exception Encountered ", "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Encountered ", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendResponse(): ' + e.getMessage())
}
}
@@ -371,13 +377,13 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
* @param execution the execution
*/
public void postProcessResponse(DelegateExecution execution){
- msoLogger.trace("STARTED PostProcessResponse Process")
+ logger.trace("STARTED PostProcessResponse Process")
try{
def requestInfo = execution.getVariable("CVFMI_requestInfo")
def action = utils.getNodeText(requestInfo, "action")
- msoLogger.debug("requestInfo is: " + requestInfo)
- msoLogger.debug("action is: " + action)
+ logger.debug("requestInfo is: " + requestInfo)
+ logger.debug("action is: " + action)
String payload =
""" <aetgt:MsoCompletionRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
@@ -393,15 +399,16 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_SuccessFlag", true)
execution.setVariable("CVFMI_msoCompletionRequest", payload)
- msoLogger.debug("CreateVfModuleInfra completion request: " + payload)
- msoLogger.debug("Outgoing MsoCompletionRequest: \n" + payload)
+ logger.debug("CreateVfModuleInfra completion request: " + payload)
+ logger.debug("Outgoing MsoCompletionRequest: \n" + payload)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, " Exception Occured Processing PostProcessResponse - " + "\n", "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing PostProcessResponse - " + "\n", "BPMN",
+ MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
execution.setVariable("CVFMI_ErrorResponse", "Error Occured during PostProcessResponse Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED PostProcessResponse Process")
+ logger.trace("COMPLETED PostProcessResponse Process")
}
@@ -420,7 +427,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Started ' + method)
+ logger.trace('Started ' + method)
String processKey = getProcessKey(execution);
def prefix = execution.getVariable("prefix")
@@ -466,20 +473,22 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
utils.logContext(requestId, serviceInstanceId)
*/
- msoLogger.debug("CreateVfModule incoming request: " + request)
- msoLogger.debug('Incoming message: ' + System.lineSeparator() + request)
- msoLogger.trace('Finished ' + method)
+ logger.debug("CreateVfModule incoming request: " + request)
+ logger.debug('Incoming message: ' + System.lineSeparator() + request)
+ logger.trace('Finished ' + method)
return request
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Caught exception in " + method , "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Caught exception in " + method , "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Invalid Message")
}
}
public void prepareUpdateInfraRequest(DelegateExecution execution){
- msoLogger.trace("STARTED prepareUpdateInfraRequest Process")
+ logger.trace("STARTED prepareUpdateInfraRequest Process")
try{
String requestInfo = execution.getVariable("CVFMI_requestInfo")
@@ -493,7 +502,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint",execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
- msoLogger.debug("DB Adapter Endpoint is: " + dbAdapterEndpoint)
+ logger.debug("DB Adapter Endpoint is: " + dbAdapterEndpoint)
String payload =
"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
@@ -516,15 +525,16 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_updateInfraRequest", payload)
- msoLogger.debug("Outgoing UpdateInfraRequest: \n" + payload)
- msoLogger.debug("CreateVfModuleInfra Outgoing UpdateInfra Request: " + payload)
+ logger.debug("Outgoing UpdateInfraRequest: \n" + payload)
+ logger.debug("CreateVfModuleInfra Outgoing UpdateInfra Request: " + payload)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing prepareUpdateInfraRequest.", "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing prepareUpdateInfraRequest.", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareUpdateInfraRequest Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED prepareUpdateInfraRequest Process")
+ logger.trace("COMPLETED prepareUpdateInfraRequest Process")
}
/**
@@ -539,7 +549,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
', resultVar=' + resultVar +
')'
- msoLogger.trace("Started " + method)
+ logger.trace("Started " + method)
try {
@@ -565,17 +575,19 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
</aetgt:FalloutHandlerRequest>
"""
- msoLogger.debug("CONTENT before translation: " + content)
+ logger.debug("CONTENT before translation: " + content)
content = utils.formatXml(content)
- msoLogger.debug(resultVar + ' = ' + System.lineSeparator() + content)
- msoLogger.debug("CreateVfModuleInfra FallOutHander Request: " + content)
+ logger.debug(resultVar + ' = ' + System.lineSeparator() + content)
+ logger.debug("CreateVfModuleInfra FallOutHander Request: " + content)
execution.setVariable(resultVar, content)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Caught exception in " + method , "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Caught exception in " + method , "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildWorkflowException(execution, 2000, 'Internal Error')
}
}
@@ -584,7 +596,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
def method = getClass().getSimpleName() + '.validateRollbackResponse(' +
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
logWorkflowException(execution, 'CreateVfModuleInfra caught an event')
saveWorkflowException(execution, 'CVFMI_originalWorkflowException')
@@ -594,7 +606,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
def method = getClass().getSimpleName() + '.validateRollbackResponse(' +
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
def originalException = execution.getVariable("CVFMI_originalWorkflowException")
execution.setVariable("WorkflowException", originalException)
@@ -603,23 +615,23 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
}
public void sendErrorResponse(DelegateExecution execution){
- msoLogger.trace("STARTED CreateVfModulenfra sendErrorResponse Process")
+ logger.trace("STARTED CreateVfModulenfra sendErrorResponse Process")
try {
def sentSyncResponse = execution.getVariable("CVFMI_sentSyncResponse")
if(sentSyncResponse == false){
WorkflowException wfex = execution.getVariable("WorkflowException")
String response = exceptionUtil.buildErrorResponseXml(wfex)
- msoLogger.debug(response)
+ logger.debug(response)
sendWorkflowResponse(execution, 500, response)
}else{
- msoLogger.debug("Not Sending Error Response. Sync Response Already Sent")
+ logger.debug("Not Sending Error Response. Sync Response Already Sent")
}
} catch (Exception ex) {
- msoLogger.debug("Error Occured in CreateVfModuleInfra sendErrorResponse Process " + ex.getMessage())
+ logger.debug("Error Occured in CreateVfModuleInfra sendErrorResponse Process " + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVfModuleInfra sendErrorResponse Process")
}
- msoLogger.trace("COMPLETED CreateVfModuleInfra sendErrorResponse Process")
+ logger.trace("COMPLETED CreateVfModuleInfra sendErrorResponse Process")
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1.groovy
index 05c8246311..d85ea481d5 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -35,6 +37,8 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
@@ -42,7 +46,7 @@ import groovy.json.JsonSlurper
class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CreateVfModuleVolumeInfraV1.class);
+ private static final Logger logger = LoggerFactory.getLogger( CreateVfModuleVolumeInfraV1.class);
public static final String prefix='CVMVINFRAV1_'
/**
@@ -68,13 +72,13 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
execution.setVariable(prefix+'syncResponseSent', false)
String createVolumeIncoming = validateRequest(execution, 'vnfId')
- msoLogger.debug(createVolumeIncoming)
+ logger.debug(createVolumeIncoming)
try {
def jsonSlurper = new JsonSlurper()
Map reqMap = jsonSlurper.parseText(createVolumeIncoming)
setupVariables(execution, reqMap, isDebugEnabled)
- msoLogger.debug("XML request:\n" + createVolumeIncoming)
+ logger.debug("XML request:\n" + createVolumeIncoming)
}
catch(groovy.json.JsonException je) {
(new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, 'Request is not a valid JSON document')
@@ -100,7 +104,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
// volumeGroupId - is generated
String volumeGroupId = UUID.randomUUID()
execution.setVariable('volumeGroupId', volumeGroupId)
- msoLogger.debug("Generated volumeGroupId: " + volumeGroupId)
+ logger.debug("Generated volumeGroupId: " + volumeGroupId)
// volumeGroupName
def volGrpName = requestMap.requestDetails.requestInfo?.instanceName ?: ''
@@ -159,7 +163,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
// disableRollback (true or false)
def disableRollback = requestMap.requestDetails.requestInfo.suppressRollback
execution.setVariable('disableRollback', disableRollback)
- msoLogger.debug('disableRollback (suppressRollback) from request: ' + disableRollback)
+ logger.debug('disableRollback (suppressRollback) from request: ' + disableRollback)
}
@@ -172,7 +176,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
String syncResponse = """{"requestReferences":{"instanceId":"${volumeGroupId}","requestId":"${requestId}"}}""".trim()
- msoLogger.debug("Sync Response: " + "\n" + syncResponse)
+ logger.debug("Sync Response: " + "\n" + syncResponse)
sendWorkflowResponse(execution, 200, syncResponse)
execution.setVariable(prefix+'syncResponseSent', true)
@@ -194,7 +198,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
* @param isDebugEnabled
*/
public void buildWorkflowException(DelegateExecution execution, int errorCode, errorMessage, isDebugEnabled) {
- msoLogger.debug(errorMessage)
+ logger.debug(errorMessage)
(new ExceptionUtil()).buildWorkflowException(execution, 2500, errorMessage)
}
@@ -237,7 +241,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
String buildDBRequestAsString = utils.formatXml(dbRequest)
execution.setVariable(prefix+"createDBRequest", buildDBRequestAsString)
- msoLogger.debug("DB Infra Request: " + buildDBRequestAsString)
+ logger.debug("DB Infra Request: " + buildDBRequestAsString)
}
@@ -251,8 +255,8 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
def dbReturnCode = execution.getVariable(prefix+'dbReturnCode')
def createDBResponse = execution.getVariable(prefix+'createDBResponse')
- msoLogger.debug('DB return code: ' + dbReturnCode)
- msoLogger.debug('DB response: ' + createDBResponse)
+ logger.debug('DB return code: ' + dbReturnCode)
+ logger.debug('DB response: ' + createDBResponse)
def requestId = execution.getVariable("mso-request-id")
def source = execution.getVariable(prefix+'source')
@@ -273,7 +277,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
execution.setVariable(prefix+'Success', true)
execution.setVariable(prefix+'CompleteMsoProcessRequest', xmlMsoCompletionRequest)
- msoLogger.debug(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
+ logger.debug(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
}
@@ -306,7 +310,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
String xmlHandlerRequest = utils.formatXml(falloutHandlerRequest)
execution.setVariable(prefix+'FalloutHandlerRequest', xmlHandlerRequest)
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Overall Error Response going to FalloutHandler", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "\n" + xmlHandlerRequest);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "Overall Error Response going to FalloutHandler", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "\n" + xmlHandlerRequest);
}
@@ -324,10 +328,10 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
AAIResourceUri uri = AAIUriFactory.createNodesUri(AAIObjectType.SERVICE_INSTANCE,serviceInstanceId)
if(getAAIClient().exists(uri)){
- msoLogger.debug('Service instance ' + serviceInstanceId + ' found in AAI.')
+ logger.debug('Service instance ' + serviceInstanceId + ' found in AAI.')
}else{
def message = 'Service instance ' + serviceInstanceId + ' was not found in AAI. Return code: 404.'
- msoLogger.debug(message)
+ logger.debug(message)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, message)
}
}catch(BpmnError bpmnError){
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVnfInfra.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVnfInfra.groovy
index af46bf65b8..29eb47c1e7 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVnfInfra.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVnfInfra.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -41,6 +43,8 @@ import org.onap.so.bpmn.core.json.JsonUtils;
import org.onap.so.bpmn.infrastructure.aai.groovyflows.AAICreateResources;
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
/**
@@ -50,7 +54,7 @@ import org.onap.so.logger.MsoLogger
*/
class CreateVnfInfra extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CreateVnfInfra.class);
+ private static final Logger logger = LoggerFactory.getLogger( CreateVnfInfra.class);
String Prefix="CREVI_"
@@ -69,7 +73,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
public void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED CreateVnfInfra PreProcessRequest Process")
+ logger.trace("STARTED CreateVnfInfra PreProcessRequest Process")
setBasicDBAuthHeader(execution, isDebugEnabled)
execution.setVariable("CREVI_sentSyncResponse", false)
@@ -78,59 +82,59 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
// Get Variables
String createVnfRequest = execution.getVariable("bpmnRequest")
execution.setVariable("CREVI_createVnfRequest", createVnfRequest)
- msoLogger.debug("Incoming CreateVnfInfra Request is: \n" + createVnfRequest)
+ logger.debug("Incoming CreateVnfInfra Request is: \n" + createVnfRequest)
if(createVnfRequest != null){
String requestId = execution.getVariable("mso-request-id")
execution.setVariable("CREVI_requestId", requestId)
- msoLogger.debug("Incoming Request Id is: " + requestId)
+ logger.debug("Incoming Request Id is: " + requestId)
String serviceInstanceId = execution.getVariable("serviceInstanceId")
execution.setVariable("CREVI_serviceInstanceId", serviceInstanceId)
- msoLogger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
+ logger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
String vnfType = execution.getVariable("vnfType")
execution.setVariable("CREVI_vnfType", vnfType)
- msoLogger.debug("Incoming Vnf Type is: " + vnfType)
+ logger.debug("Incoming Vnf Type is: " + vnfType)
String vnfName = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.requestInfo.instanceName")
execution.setVariable("CREVI_vnfName", vnfName)
- msoLogger.debug("Incoming Vnf Name is: " + vnfName)
+ logger.debug("Incoming Vnf Name is: " + vnfName)
String serviceId = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.requestInfo.productFamilyId")
execution.setVariable("CREVI_serviceId", serviceId)
- msoLogger.debug("Incoming Service Id is: " + serviceId)
+ logger.debug("Incoming Service Id is: " + serviceId)
String source = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.requestInfo.source")
execution.setVariable("CREVI_source", source)
- msoLogger.debug("Incoming Source is: " + source)
+ logger.debug("Incoming Source is: " + source)
String suppressRollback = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.requestInfo.suppressRollback")
execution.setVariable("CREVI_suppressRollback", suppressRollback)
- msoLogger.debug("Incoming Suppress Rollback is: " + suppressRollback)
+ logger.debug("Incoming Suppress Rollback is: " + suppressRollback)
def vnfModelInfo = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.modelInfo")
execution.setVariable("CREVI_vnfModelInfo", vnfModelInfo)
String modelInvariantId = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.modelInfo.modelInvariantUuid")
execution.setVariable("CREVI_modelInvariantId", modelInvariantId)
- msoLogger.debug("Incoming Invariant Id is: " + modelInvariantId)
+ logger.debug("Incoming Invariant Id is: " + modelInvariantId)
String modelVersion = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.modelInfo.modelVersion")
execution.setVariable("CREVI_modelVersion", modelVersion)
- msoLogger.debug("Incoming Model Version is: " + modelVersion)
+ logger.debug("Incoming Model Version is: " + modelVersion)
def cloudConfiguration = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.cloudConfiguration")
execution.setVariable("CREVI_cloudConfiguration", cloudConfiguration)
String cloudSiteId = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.cloudConfiguration.lcpCloudRegionId")
execution.setVariable("CREVI_cloudSiteId", cloudSiteId)
- msoLogger.debug("Incoming Cloud Site Id is: " + cloudSiteId)
+ logger.debug("Incoming Cloud Site Id is: " + cloudSiteId)
String tenantId = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.cloudConfiguration.tenantId")
execution.setVariable("CREVI_tenantId", tenantId)
- msoLogger.debug("Incoming Tenant Id is: " + tenantId)
+ logger.debug("Incoming Tenant Id is: " + tenantId)
//For Completion Handler & Fallout Handler
String requestInfo =
@@ -153,7 +157,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
String vnfId = execution.getVariable("testVnfId") // for junits
if(isBlank(vnfId)){
vnfId = UUID.randomUUID().toString()
- msoLogger.debug("Generated Vnf Id is: " + vnfId)
+ logger.debug("Generated Vnf Id is: " + vnfId)
}
execution.setVariable("CREVI_vnfId", vnfId)
@@ -164,7 +168,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
String sdncCallbackUrl = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution)
if (sdncCallbackUrl == null || sdncCallbackUrl.trim().isEmpty()) {
def msg = 'Required variable \'mso.workflow.sdncadapter.callback\' is missing'
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, msg, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError);
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError.getValue());
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
@@ -175,31 +179,31 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
vnfInputParameters = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.requestParameters.userParams")
}
catch (Exception e) {
- msoLogger.debug("userParams are not present in the request")
+ logger.debug("userParams are not present in the request")
}
execution.setVariable("CREVI_vnfInputParameters", vnfInputParameters)
- msoLogger.debug("SDNC Callback URL: " + sdncCallbackUrl)
+ logger.debug("SDNC Callback URL: " + sdncCallbackUrl)
}else{
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Incoming Bpmn Request is Null.")
}
}catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, " Error Occurred in CreateVnfInfra PreProcessRequest method", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e)
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), " Error Occurred in CreateVnfInfra PreProcessRequest method", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occurred in CreateVnfInfra PreProcessRequest")
}
- msoLogger.trace("COMPLETED CreateVnfInfra PreProcessRequest Process")
+ logger.trace("COMPLETED CreateVnfInfra PreProcessRequest Process")
}
public void sendSyncResponse (DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED CreateVnfInfra SendSyncResponse Process")
+ logger.trace("STARTED CreateVnfInfra SendSyncResponse Process")
try {
String requestId = execution.getVariable("CREVI_requestId")
@@ -207,28 +211,28 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
String createVnfResponse = """{"requestReferences":{"instanceId":"${vnfId}","requestId":"${requestId}"}}""".trim()
- msoLogger.debug("CreateVnfInfra Sync Response is: \n" + createVnfResponse)
+ logger.debug("CreateVnfInfra Sync Response is: \n" + createVnfResponse)
sendWorkflowResponse(execution, 202, createVnfResponse)
execution.setVariable("CREVI_sentSyncResponse", true)
} catch (Exception ex) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, " Error Occurred in CreateVnfInfra SendSyncResponse Process", "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e)
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), " Error Occurred in CreateVnfInfra SendSyncResponse Process", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVnfInfra SendSyncResponse Process")
}
- msoLogger.trace("COMPLETED CreateVnfInfra SendSyncResponse Process")
+ logger.trace("COMPLETED CreateVnfInfra SendSyncResponse Process")
}
public void preProcessSDNCAssignRequest(DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessSDNCAssignRequest")
+ logger.trace("STARTED preProcessSDNCAssignRequest")
def vnfId = execution.getVariable("CREVI_vnfId")
def serviceInstanceId = execution.getVariable("CREVI_serviceInstanceId")
- msoLogger.debug("NEW VNF ID: " + vnfId)
+ logger.debug("NEW VNF ID: " + vnfId)
try{
//Build SDNC Request
@@ -237,23 +241,23 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
assignSDNCRequest = utils.formatXml(assignSDNCRequest)
execution.setVariable("CREVI_assignSDNCRequest", assignSDNCRequest)
- msoLogger.debug("Outgoing AssignSDNCRequest is: \n" + assignSDNCRequest)
+ logger.debug("Outgoing AssignSDNCRequest is: \n" + assignSDNCRequest)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occurred Processing preProcessSDNCAssignRequest", "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e)
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "Exception Occurred Processing preProcessSDNCAssignRequest", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during prepareProvision Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCAssignRequest")
+ logger.trace("COMPLETED preProcessSDNCAssignRequest")
}
public void preProcessSDNCActivateRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessSDNCActivateRequest(' +
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessSDNCActivateRequest Process")
+ logger.trace("STARTED preProcessSDNCActivateRequest Process")
try{
String vnfId = execution.getVariable("CREVI_vnfId")
String serviceInstanceId = execution.getVariable("CREVI_serviceInstanceId")
@@ -261,13 +265,13 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
String activateSDNCRequest = buildSDNCRequest(execution, serviceInstanceId, "activate")
execution.setVariable("CREVI_activateSDNCRequest", activateSDNCRequest)
- msoLogger.debug("Outgoing CommitSDNCRequest is: \n" + activateSDNCRequest)
+ logger.debug("Outgoing CommitSDNCRequest is: \n" + activateSDNCRequest)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessSDNCActivateRequest", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e)
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "Exception Occured Processing preProcessSDNCActivateRequest", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessSDNCActivateRequest Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCActivateRequest Process")
+ logger.trace("COMPLETED preProcessSDNCActivateRequest Process")
}
public String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action){
@@ -329,39 +333,39 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
</sdncadapterworkflow:SDNCRequestData>
</sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
- msoLogger.debug("sdncRequest: " + sdncRequest)
+ logger.debug("sdncRequest: " + sdncRequest)
return sdncRequest
}
public void validateSDNCResponse(DelegateExecution execution, String response, String method){
execution.setVariable("prefix",Prefix)
- msoLogger.debug("STARTED ValidateSDNCResponse Process")
+ logger.debug("STARTED ValidateSDNCResponse Process")
WorkflowException workflowException = execution.getVariable("WorkflowException")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
- msoLogger.debug("SDNCResponse: " + response)
+ logger.debug("SDNCResponse: " + response)
String sdncResponse = response
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
- msoLogger.trace("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
+ logger.trace("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
}else{
- msoLogger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
+ logger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
throw new BpmnError("MSOWorkflowException")
}
- msoLogger.trace("COMPLETED ValidateSDNCResponse Process")
+ logger.trace("COMPLETED ValidateSDNCResponse Process")
}
public void prepareCompletionHandlerRequest(DelegateExecution execution){
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED CreateVnfInfra PrepareCompletionHandlerRequest Process")
+ logger.trace("STARTED CreateVnfInfra PrepareCompletionHandlerRequest Process")
try {
String requestInfo = execution.getVariable("CREVI_requestInfo")
@@ -378,52 +382,52 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
</aetgt:MsoCompletionRequest>"""
execution.setVariable("CREVI_completionHandlerRequest", request)
- msoLogger.debug("Completion Handler Request is: " + request)
+ logger.debug("Completion Handler Request is: " + request)
execution.setVariable("WorkflowResponse", "Success") // for junits
} catch (Exception ex) {
- msoLogger.debug("Error Occured in CreateVnfInfra PrepareCompletionHandlerRequest Process " + ex.getMessage())
+ logger.debug("Error Occured in CreateVnfInfra PrepareCompletionHandlerRequest Process " + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVnfInfra PrepareCompletionHandlerRequest Process")
}
- msoLogger.trace("COMPLETED CreateVnfInfra PrepareCompletionHandlerRequest Process")
+ logger.trace("COMPLETED CreateVnfInfra PrepareCompletionHandlerRequest Process")
}
public void sendErrorResponse(DelegateExecution execution){
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED CreateVnfInfra sendErrorResponse Process")
+ logger.trace("STARTED CreateVnfInfra sendErrorResponse Process")
try {
def sentSyncResponse = execution.getVariable("CREVI_sentSyncResponse")
if(sentSyncResponse == false){
WorkflowException wfex = execution.getVariable("WorkflowException")
String response = exceptionUtil.buildErrorResponseXml(wfex)
- msoLogger.debug(response)
+ logger.debug(response)
sendWorkflowResponse(execution, 500, response)
}else{
- msoLogger.debug("Not Sending Error Response. Sync Response Already Sent")
+ logger.debug("Not Sending Error Response. Sync Response Already Sent")
}
} catch (Exception ex) {
- msoLogger.debug("Error Occured in CreateVnfInfra sendErrorResponse Process " + ex.getMessage())
+ logger.debug("Error Occured in CreateVnfInfra sendErrorResponse Process " + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVnfInfra sendErrorResponse Process")
}
- msoLogger.trace("COMPLETED CreateVnfInfra sendErrorResponse Process")
+ logger.trace("COMPLETED CreateVnfInfra sendErrorResponse Process")
}
public void prepareFalloutRequest(DelegateExecution execution){
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED CreateVnfInfra prepareFalloutRequest Process")
+ logger.trace("STARTED CreateVnfInfra prepareFalloutRequest Process")
try {
WorkflowException wfex = execution.getVariable("WorkflowException")
- msoLogger.debug(" Incoming Workflow Exception: " + wfex.toString())
+ logger.debug(" Incoming Workflow Exception: " + wfex.toString())
String requestInfo = execution.getVariable("CREVI_requestInfo")
- msoLogger.debug(" Incoming Request Info: " + requestInfo)
+ logger.debug(" Incoming Request Info: " + requestInfo)
String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
@@ -431,30 +435,30 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
} catch (Exception ex) {
- msoLogger.debug("Error Occured in CreateVnfInfra prepareFalloutRequest Process " + ex.getMessage())
+ logger.debug("Error Occured in CreateVnfInfra prepareFalloutRequest Process " + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVnfInfra prepareFalloutRequest Process")
}
- msoLogger.trace("COMPLETED CreateVnfInfra prepareFalloutRequest Process")
+ logger.trace("COMPLETED CreateVnfInfra prepareFalloutRequest Process")
}
public void queryCatalogDB (DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED CreateVnfInfra QueryCatalogDB Process")
+ logger.trace("STARTED CreateVnfInfra QueryCatalogDB Process")
try {
//Get Vnf Info
String vnfModelInfo = execution.getVariable("CREVI_vnfModelInfo")
String vnfModelCustomizationUuid = jsonUtil.getJsonValueForKey(vnfModelInfo, "modelCustomizationUuid")
- msoLogger.debug("querying Catalog DB by vnfModelCustomizationUuid: " + vnfModelCustomizationUuid)
+ logger.debug("querying Catalog DB by vnfModelCustomizationUuid: " + vnfModelCustomizationUuid)
JSONArray vnfs = catalogDbUtils.getAllVnfsByVnfModelCustomizationUuid(execution,
vnfModelCustomizationUuid, "v2")
- msoLogger.debug("obtained VNF list: " + vnfs)
+ logger.debug("obtained VNF list: " + vnfs)
if (vnfs == null) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "No matching VNFs in Catalog DB for vnfModelCustomizationUuid=" + vnfModelCustomizationUuid, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "");
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "No matching VNFs in Catalog DB for vnfModelCustomizationUuid=" + vnfModelCustomizationUuid, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "");
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "No matching VNFs in Catalog DB for vnfModelCustomizationUuid=" + vnfModelCustomizationUuid)
}
@@ -462,7 +466,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
JSONObject vnf = vnfs.get(0)
if (vnf == null) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "No matching VNF in Catalog DB for vnfModelCustomizationUuid=" + vnfModelCustomizationUuid, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "");
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "No matching VNF in Catalog DB for vnfModelCustomizationUuid=" + vnfModelCustomizationUuid, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "");
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "No matching VNF in Catalog DB for vnfModelCustomizationUuid=" + vnfModelCustomizationUuid)
}
@@ -481,63 +485,63 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
}catch(BpmnError e) {
throw e;
}catch(Exception ex) {
- msoLogger.debug("Error Occurred in CreateVnfInfra QueryCatalogDB Process " + ex.getMessage())
+ logger.debug("Error Occurred in CreateVnfInfra QueryCatalogDB Process " + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occurred in CreateVnfInfra QueryCatalogDB Process")
}
- msoLogger.trace("COMPLETED CreateVnfInfra QueryCatalogDb Process")
+ logger.trace("COMPLETED CreateVnfInfra QueryCatalogDb Process")
}
public void createPlatform (DelegateExecution execution) {
- msoLogger.trace("START createPlatform")
+ logger.trace("START createPlatform")
String request = execution.getVariable("bpmnRequest")
String platformName = jsonUtil.getJsonValue(request, "requestDetails.platform.platformName")
String vnfId = execution.getVariable("CREVI_vnfId")
- msoLogger.debug("Platform NAME: " + platformName)
- msoLogger.debug("VnfID: " + vnfId)
+ logger.debug("Platform NAME: " + platformName)
+ logger.debug("VnfID: " + vnfId)
if(platformName == null||platformName.equals("")){
String msg = "Exception in createPlatform. platformName was not found in the request.";
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}else{
- msoLogger.debug("platformName was found.")
+ logger.debug("platformName was found.")
try{
AAICreateResources aaiCR = new AAICreateResources()
aaiCR.createAAIPlatform(platformName, vnfId)
}catch(Exception ex){
String msg = "Exception in createPlatform. " + ex.getMessage();
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
- msoLogger.trace("Exit createPlatform")
+ logger.trace("Exit createPlatform")
}
public void createLineOfBusiness (DelegateExecution execution) {
- msoLogger.trace("START createLineOfBusiness")
+ logger.trace("START createLineOfBusiness")
String request = execution.getVariable("bpmnRequest")
String lineOfBusiness = jsonUtil.getJsonValue(request, "requestDetails.lineOfBusiness.lineOfBusinessName")
String vnfId = execution.getVariable("CREVI_vnfId")
- msoLogger.debug("LineOfBusiness NAME: " + lineOfBusiness)
- msoLogger.debug("VnfID: " + vnfId)
+ logger.debug("LineOfBusiness NAME: " + lineOfBusiness)
+ logger.debug("VnfID: " + vnfId)
if(lineOfBusiness == null || lineOfBusiness.equals("")){
- msoLogger.debug("LineOfBusiness was not found. Continuing on with flow...")
+ logger.debug("LineOfBusiness was not found. Continuing on with flow...")
}else{
- msoLogger.debug("LineOfBusiness was found.")
+ logger.debug("LineOfBusiness was found.")
try{
AAICreateResources aaiCR = new AAICreateResources()
aaiCR.createAAILineOfBusiness(lineOfBusiness, vnfId)
}catch(Exception ex){
String msg = "Exception in LineOfBusiness. " + ex.getMessage();
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, msg, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + ex)
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + ex)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
- msoLogger.trace("Exit createLineOfBusiness")
+ logger.trace("Exit createLineOfBusiness")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
index 66479be973..ccdb5d77cd 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -31,14 +33,15 @@ import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.core.UrnPropertiesReader
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
/**
* This groovy class supports the <class>ActivateSDNCCNetworkResource.bpmn</class> process.
* flow for SDNC Network Resource Activate
*/
public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DeActivateSDNCNetworkResource.class);
+ private static final Logger logger = LoggerFactory.getLogger( DeActivateSDNCNetworkResource.class);
String Prefix = "DEACTSDNCRES_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -51,7 +54,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
public void preProcessRequest(DelegateExecution execution) {
- msoLogger.info(" ***** Started preProcessRequest *****")
+ logger.info(" ***** Started preProcessRequest *****")
try {
@@ -126,13 +129,13 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
public void prepareSDNCRequest(DelegateExecution execution) {
- msoLogger.info(" ***** Started prepareSDNCRequest *****")
+ logger.info(" ***** Started prepareSDNCRequest *****")
try {
// get variables
@@ -327,15 +330,15 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
String sdncTopologyDeleteRequesAsString = utils.formatXml(sdncTopologyDeleteRequest)
utils.logAudit(sdncTopologyDeleteRequesAsString)
execution.setVariable("sdncAdapterWorkflowRequest", sdncTopologyDeleteRequesAsString)
- msoLogger.info("sdncAdapterWorkflowRequest - " + "\n" + sdncTopologyDeleteRequesAsString)
+ logger.info("sdncAdapterWorkflowRequest - " + "\n" + sdncTopologyDeleteRequesAsString)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DeleteSDNCCNetworkResource flow. prepareSDNCRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- msoLogger.info(" ***** Exit prepareSDNCRequest *****")
+ logger.info(" ***** Exit prepareSDNCRequest *****")
}
public void prepareUpdateAfterDeActivateSDNCResource(DelegateExecution execution) {
@@ -377,31 +380,31 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
}
public void postDeactivateSDNCCall(DelegateExecution execution) {
- msoLogger.info(" ***** Started prepareSDNCRequest *****")
+ logger.info(" ***** Started prepareSDNCRequest *****")
String responseCode = execution.getVariable(Prefix + "sdncDeleteReturnCode")
String responseObj = execution.getVariable(Prefix + "SuccessIndicator")
- msoLogger.info("response from sdnc, response code :" + responseCode + " response object :" + responseObj)
- msoLogger.info(" ***** Exit prepareSDNCRequest *****")
+ logger.info("response from sdnc, response code :" + responseCode + " response object :" + responseObj)
+ logger.info(" ***** Exit prepareSDNCRequest *****")
}
public void sendSyncResponse(DelegateExecution execution) {
- msoLogger.debug(" *** sendSyncResponse *** ")
+ logger.debug(" *** sendSyncResponse *** ")
try {
String operationStatus = "finished"
// RESTResponse for main flow
String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
- msoLogger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
+ logger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
sendWorkflowResponse(execution, 202, resourceOperationResp)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
String msg = "Exception in sendSyncResponse:" + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.debug(" ***** Exit sendSyncResponse *****")
+ logger.debug(" ***** Exit sendSyncResponse *****")
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
index b718e4a2e0..443c8f6616 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -43,7 +45,8 @@ import org.onap.so.client.aai.AAIObjectType
import org.onap.so.client.aai.AAIResourcesClient
import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
/**
* This groovy class supports the <class>Delete3rdONAPE2EServiceInstance.bpmn</class> process.
@@ -57,19 +60,19 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
JsonUtils jsonUtil = new JsonUtils()
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, Delete3rdONAPE2EServiceInstance.class)
+ private static final Logger logger = LoggerFactory.getLogger( Delete3rdONAPE2EServiceInstance.class);
public void checkSPPartnerInfoFromAAI (DelegateExecution execution) {
- msoLogger.info(" ***** Started checkSPPartnerInfo *****")
+ logger.info(" ***** Started checkSPPartnerInfo *****")
try {
//get bpmn inputs from resource request.
String requestId = execution.getVariable("mso-request-id")
String requestAction = execution.getVariable("requestAction")
- msoLogger.info("The requestAction is: " + requestAction)
+ logger.info("The requestAction is: " + requestAction)
String recipeParamsFromRequest = execution.getVariable("recipeParams")
- msoLogger.info("The recipeParams is: " + recipeParamsFromRequest)
+ logger.info("The recipeParams is: " + recipeParamsFromRequest)
String resourceInput = execution.getVariable("resourceInput")
- msoLogger.info("The resourceInput is: " + resourceInput)
+ logger.info("The resourceInput is: " + resourceInput)
//Get ResourceInput Object
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
// set local resourceInput
@@ -101,13 +104,13 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
} catch (Exception ex){
String msg = "Exception in checkSPPartnerInfoFromAAI " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
public void checkLocallCall (DelegateExecution execution) {
- msoLogger.info(" ***** Started checkLocallCall *****")
+ logger.info(" ***** Started checkLocallCall *****")
boolean isLocalCall = true
String callSource = execution.getVariable(Prefix + "CallSource")
@@ -118,7 +121,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
}
public void preProcessRequest(DelegateExecution execution){
- msoLogger.info(" ***** Started preProcessRequest *****")
+ logger.info(" ***** Started preProcessRequest *****")
String msg = ""
try {
@@ -127,53 +130,53 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
String globalSubscriberId = resourceInputObj.getGlobalSubscriberId()
if (isBlank(globalSubscriberId)) {
msg = "Input globalSubscriberId is null"
- msoLogger.error( msg)
+ logger.error(msg)
}
//set local variable
execution.setVariable("globalSubscriberId", globalSubscriberId)
- msoLogger.info( "globalSubscriberId:" + globalSubscriberId)
+ logger.info( "globalSubscriberId:" + globalSubscriberId)
String serviceType = resourceInputObj.getServiceType()
if (isBlank(serviceType)) {
msg = "Input serviceType is null"
- msoLogger.error( msg)
+ logger.error(msg)
}
execution.setVariable("serviceType", serviceType)
- msoLogger.info( "serviceType:" + serviceType)
+ logger.info( "serviceType:" + serviceType)
String operationId = resourceInputObj.getOperationId()
if (isBlank(operationId)) {
msg = "Input operationId is null"
- msoLogger.error( msg)
+ logger.error(msg)
}
execution.setVariable("operationId", operationId)
- msoLogger.info( "operationId:" + operationId)
+ logger.info( "operationId:" + operationId)
String resourceName = resourceInputObj.getResourceInstanceName()
if (isBlank(resourceName)) {
msg = "Input resourceName is null"
- msoLogger.error( msg)
+ logger.error(msg)
}
execution.setVariable("resourceName", resourceName)
- msoLogger.info("resourceName:" + resourceName)
+ logger.info("resourceName:" + resourceName)
String resourceTemplateId = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
if (isBlank(resourceTemplateId)) {
msg = "Input resourceTemplateId is null"
- msoLogger.error( msg)
+ logger.error(msg)
}
execution.setVariable("resourceTemplateId", resourceTemplateId)
- msoLogger.info( "resourceTemplateId:" + resourceTemplateId)
+ logger.info( "resourceTemplateId:" + resourceTemplateId)
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
public void prepareUpdateProgress(DelegateExecution execution) {
- msoLogger.info(" ***** Started prepareUpdateProgress *****")
+ logger.info(" ***** Started prepareUpdateProgress *****")
ResourceInput resourceInputObj = execution.getVariable(Prefix + "ResourceInput")
String operType = resourceInputObj.getOperationType()
String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
@@ -202,11 +205,11 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
</soapenv:Envelope>"""
setProgressUpdateVariables(execution, body)
- msoLogger.info(" ***** End prepareUpdateProgress *****")
+ logger.info(" ***** End prepareUpdateProgress *****")
}
public void prepare3rdONAPRequest(DelegateExecution execution) {
- msoLogger.info(" ***** Started prepare3rdONAPRequest *****")
+ logger.info(" ***** Started prepare3rdONAPRequest *****")
String sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
String extAPIPath = sppartnerUrl + '/serviceOrder'
@@ -257,12 +260,12 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
String payload = externalAPIUtil.setTemplate(ExternalAPIUtil.PostServiceOrderRequestsTemplate, valueMap)
execution.setVariable(Prefix + "Payload", payload)
- msoLogger.info( "Exit " + prepare3rdONAPRequest)
+ logger.info( "Exit " + prepare3rdONAPRequest)
}
private void queryServicefrom3rdONAP(DelegateExecution execution)
{
- msoLogger.info(" ***** Started queryServicefrom3rdONAP *****")
+ logger.info(" ***** Started queryServicefrom3rdONAP *****")
try {
String globalSubscriberId = execution.getVariable("globalSubscriberId")
@@ -271,7 +274,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
//https://{api_url}/nbi/api/v1/service?relatedParty.id=${globalSubscriberId}
String sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
String extAPIPath = sppartnerUrl + "/service?relatedParty.id=" + globalSubscriberId
- msoLogger.debug("queryServicefrom3rdONAP externalAPIURL is: " + extAPIPath)
+ logger.debug("queryServicefrom3rdONAP externalAPIURL is: " + extAPIPath)
ExternalAPIUtil externalAPIUtil = new ExternalAPIUtilFactory().create()
@@ -279,17 +282,17 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
int responseCode = response.getStatus()
execution.setVariable(Prefix + "GetServiceResponseCode", responseCode)
- msoLogger.debug("Get Service response code is: " + responseCode)
+ logger.debug("Get Service response code is: " + responseCode)
String extApiResponse = response.readEntity(String.class)
execution.setVariable(Prefix + "GetServiceResponse", extApiResponse)
- msoLogger.debug("queryServicefrom3rdONAP response body is: " + extApiResponse)
+ logger.debug("queryServicefrom3rdONAP response body is: " + extApiResponse)
//Process Response //200 OK 201 CREATED 202 ACCEPTED
if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
{
- msoLogger.debug("Get Service Received a Good Response")
+ logger.debug("Get Service Received a Good Response")
JSONArray responseList = new JSONArray(extApiResponse)
for(JSONObject obj : responseList) {
String svcId = obj.get("id")
@@ -302,22 +305,22 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
}
}
else{
- msoLogger.error("Get Service Received a Bad Response Code. Response Code is: " + responseCode)
+ logger.error("Get Service Received a Bad Response Code. Response Code is: " + responseCode)
// exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Get Service Received a bad response from 3rdONAP External API")
}
}catch(Exception e) {
- msoLogger.error("queryServicefrom3rdONAP exception:" + e.getMessage())
+ logger.error("queryServicefrom3rdONAP exception:" + e.getMessage())
}
- msoLogger.info( "Exit " + queryServicefrom3rdONAP)
+ logger.info( "Exit " + queryServicefrom3rdONAP)
}
public void doDeleteE2ESIin3rdONAP(DelegateExecution execution) {
- msoLogger.info(" ***** Started doDeleteE2ESIin3rdONAP *****")
+ logger.info(" ***** Started doDeleteE2ESIin3rdONAP *****")
try {
String extAPIPath = execution.getVariable("ExternalAPIURL")
String payload = execution.getVariable(Prefix + "Payload")
- msoLogger.debug("doDeleteE2ESIin3rdONAP externalAPIURL is: " + extAPIPath)
- msoLogger.debug("doDeleteE2ESIin3rdONAP payload is: " + payload)
+ logger.debug("doDeleteE2ESIin3rdONAP externalAPIURL is: " + extAPIPath)
+ logger.debug("doDeleteE2ESIin3rdONAP payload is: " + payload)
ExternalAPIUtil externalAPIUtil = new ExternalAPIUtilFactory().create()
execution.setVariable("ServiceOrderId", "")
@@ -326,42 +329,42 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
int responseCode = response.getStatus()
execution.setVariable(Prefix + "PostServiceOrderResponseCode", responseCode)
- msoLogger.debug("Post ServiceOrder response code is: " + responseCode)
+ logger.debug("Post ServiceOrder response code is: " + responseCode)
String extApiResponse = response.readEntity(String.class)
JSONObject responseObj = new JSONObject(extApiResponse)
execution.setVariable(Prefix + "PostServiceOrderResponse", extApiResponse)
- msoLogger.debug("doDeleteE2ESIin3rdONAP response body is: " + extApiResponse)
+ logger.debug("doDeleteE2ESIin3rdONAP response body is: " + extApiResponse)
//Process Response
if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
//200 OK 201 CREATED 202 ACCEPTED
{
- msoLogger.debug("Post ServiceOrder Received a Good Response")
+ logger.debug("Post ServiceOrder Received a Good Response")
String serviceOrderId = responseObj.get("id")
execution.setVariable(Prefix + "SuccessIndicator", true)
execution.setVariable("ServiceOrderId", serviceOrderId)
- msoLogger.info("Post ServiceOrderid is: " + serviceOrderId)
+ logger.info("Post ServiceOrderid is: " + serviceOrderId)
}
else{
- msoLogger.error("Post ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
+ logger.error("Post ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
// exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Post ServiceOrder Received a bad response from 3rdONAP External API")
}
}catch(Exception e) {
- msoLogger.error("doDeleteE2ESIin3rdONAP exception:" + e.getMessage())
+ logger.error("doDeleteE2ESIin3rdONAP exception:" + e.getMessage())
}
- msoLogger.info( "Exit " + doDeleteE2ESIin3rdONAP)
+ logger.info( "Exit " + doDeleteE2ESIin3rdONAP)
}
public void getE2ESIProgressin3rdONAP(DelegateExecution execution) {
- msoLogger.info(" ***** Started getE2ESIProgressin3rdONAP *****")
+ logger.info(" ***** Started getE2ESIProgressin3rdONAP *****")
try {
String extAPIPath = execution.getVariable("ExternalAPIURL")
extAPIPath += "/" + execution.getVariable("ServiceOrderId")
- msoLogger.debug("getE2ESIProgressin3rdONAP delete externalAPIURL is: " + extAPIPath)
+ logger.debug("getE2ESIProgressin3rdONAP delete externalAPIURL is: " + extAPIPath)
ExternalAPIUtil externalAPIUtil = new ExternalAPIUtilFactory().create()
@@ -369,18 +372,18 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
int responseCode = response.getStatus()
execution.setVariable(Prefix + "GetServiceOrderResponseCode", responseCode)
- msoLogger.debug("Get ServiceOrder response code is: " + responseCode)
+ logger.debug("Get ServiceOrder response code is: " + responseCode)
String extApiResponse = response.readEntity(String.class)
JSONObject responseObj = new JSONObject(extApiResponse)
execution.setVariable(Prefix + "GetServiceOrderResponse", extApiResponse)
- utils.log("DEBUG", "getE2ESIProgressin3rdONAP delete response body is: " + extApiResponse)
+ logger.debug( "getE2ESIProgressin3rdONAP delete response body is: " + extApiResponse)
//Process Response //200 OK 201 CREATED 202 ACCEPTED
if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
{
- msoLogger.debug("Get ServiceOrder Received a Good Response")
+ logger.debug("Get ServiceOrder Received a Good Response")
String orderState = responseObj.get("state")
if("REJECTED".equalsIgnoreCase(orderState)) {
@@ -398,7 +401,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
execution.setVariable("progress", 100)
execution.setVariable("status", "error")
execution.setVariable("statusDescription", "Delete Service Order Status get null sppartnerServiceId")
- msoLogger.error("null sppartnerServiceId while getting progress from externalAPI")
+ logger.error("null sppartnerServiceId while getting progress from externalAPI")
return
}
execution.setVariable(Prefix + "SppartnerServiceId", sppartnerServiceId)
@@ -435,7 +438,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
}
}
else{
- msoLogger.debug("Get ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
+ logger.debug("Get ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
execution.setVariable("progress", 100)
execution.setVariable("status", "error")
execution.setVariable("statusDescription", "Get Delete ServiceOrder Received a bad response")
@@ -445,9 +448,9 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
execution.setVariable("progress", 100)
execution.setVariable("status", "error")
execution.setVariable("statusDescription", "Get Delete ServiceOrder Exception")
- msoLogger.error("getE2ESIProgressin3rdONAP exception:" + e.getMessage())
+ logger.error("getE2ESIProgressin3rdONAP exception:" + e.getMessage())
}
- msoLogger.info( "Exit " + getE2ESIProgressin3rdONAP)
+ logger.info( "Exit " + getE2ESIProgressin3rdONAP)
}
/**
@@ -457,12 +460,12 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
try {
Thread.sleep(5000)
} catch(InterruptedException e) {
- msoLogger.error("Time Delay exception" + e )
+ logger.error("Time Delay exception" + e )
}
}
private void getSPPartnerInAAI(DelegateExecution execution) {
- msoLogger.info(" ***** Started getSPPartnerInAAI *****")
+ logger.info(" ***** Started getSPPartnerInAAI *****")
try {
String id = execution.getVariable(Prefix + "SppartnerId")
@@ -470,33 +473,33 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SP_PARTNER, id)
SpPartner sp = client.get(uri).asBean(SpPartner.class).get()
- msoLogger.debug("GET sppartner Received a Good Response")
+ logger.debug("GET sppartner Received a Good Response")
execution.setVariable(Prefix + "SuccessIndicator", true)
execution.setVariable(Prefix + "FoundIndicator", true)
// String sppartnerId = sp.getSpPartnerId()
// execution.setVariable(Prefix + "SppartnerId", sppartnerId)
-// msoLogger.debug(" SppartnerId is: " + sppartnerId)
+// logger.debug(" SppartnerId is: " + sppartnerId)
String sppartnerUrl = sp.getUrl()
execution.setVariable(Prefix + "SppartnerUrl", sppartnerUrl)
- msoLogger.debug(" SppartnerUrl is: " + sppartnerUrl)
+ logger.debug(" SppartnerUrl is: " + sppartnerUrl)
String callSource = sp.getCallsource()
execution.setVariable(Prefix + "CallSource", callSource)
- msoLogger.debug(" CallSource is: " + callSource)
+ logger.debug(" CallSource is: " + callSource)
String sppartnerVersion = sp.getResourceVersion()
execution.setVariable(Prefix + "SppartnerVersion", sppartnerVersion)
- msoLogger.debug(" Resource Version is: " + sppartnerVersion)
+ logger.debug(" Resource Version is: " + sppartnerVersion)
} catch (Exception ex) {
String msg = "Exception in Delete3rdONAPE2EServiceInstance.saveSPPartnerInAAI. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
// throw new BpmnError("MSOWorkflowException")
}
- msoLogger.info( "Exit " + getSPPartnerInAAI)
+ logger.info( "Exit " + getSPPartnerInAAI)
}
public void deleteSPPartnerInAAI(DelegateExecution execution) {
- msoLogger.info(" ***** Started deleteSPPartnerInAAI *****")
+ logger.info(" ***** Started deleteSPPartnerInAAI *****")
try {
String sppartnerId = execution.getVariable(Prefix + "SppartnerId")
@@ -504,16 +507,16 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
AAIResourcesClient client = new AAIResourcesClient()
AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SP_PARTNER, sppartnerId)
client.delete(uri)
- msoLogger.debug("Delete sppartner Received a Good Response")
+ logger.debug("Delete sppartner Received a Good Response")
execution.setVariable(Prefix + "SuccessIndicator", true)
} catch (Exception ex) {
String msg = "Exception in Delete3rdONAPE2EServiceInstance.deleteSPPartnerInAAI. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
// throw new BpmnError("MSOWorkflowException")
}
- msoLogger.info( "Exit " + deleteSPPartnerInAAI)
+ logger.info( "Exit " + deleteSPPartnerInAAI)
}
private void setProgressUpdateVariables(DelegateExecution execution, String body) {
@@ -523,30 +526,30 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
}
public void postProcess(DelegateExecution execution){
- msoLogger.info(" ***** Started postProcess *****")
+ logger.info(" ***** Started postProcess *****")
String responseCode = execution.getVariable(Prefix + "PutSppartnerResponseCode")
String responseObj = execution.getVariable(Prefix + "PutSppartnerResponse")
- msoLogger.info("response from AAI for put sppartner, response code :" + responseCode + " response object :" + responseObj)
- msoLogger.info(" ***** Exit postProcess *****")
+ logger.info("response from AAI for put sppartner, response code :" + responseCode + " response object :" + responseObj)
+ logger.info(" ***** Exit postProcess *****")
}
public void sendSyncResponse (DelegateExecution execution) {
- msoLogger.debug(" *** sendSyncResponse *** ")
+ logger.debug(" *** sendSyncResponse *** ")
try {
String operationStatus = "finished"
// RESTResponse for main flow
String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
- msoLogger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
+ logger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
sendWorkflowResponse(execution, 202, resourceOperationResp)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.debug(" ***** Exit sendSyncResopnse *****")
+ logger.debug(" ***** Exit sendSyncResopnse *****")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
index 5bb8c83628..a9b1fdaac3 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
@@ -6,6 +6,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -34,7 +36,8 @@ import org.onap.so.bpmn.common.scripts.VidUtils
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.core.UrnPropertiesReader
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.springframework.web.util.UriUtils;
import groovy.json.*
@@ -49,23 +52,23 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
VidUtils vidUtils = new VidUtils()
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DeleteCustomE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DeleteCustomE2EServiceInstance.class);
public void preProcessRequest (DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
String msg = ""
- msoLogger.info("Starting preProcessRequest")
+ logger.info("Starting preProcessRequest")
try {
// check for incoming json message/input
String siRequest = execution.getVariable("bpmnRequest")
- msoLogger.debug(siRequest)
+ logger.debug(siRequest)
String requestId = execution.getVariable("mso-request-id")
execution.setVariable("msoRequestId", requestId)
- msoLogger.info("Input Request:" + siRequest + " reqId:" + requestId)
+ logger.info("Input Request:" + siRequest + " reqId:" + requestId)
String serviceInstanceId = execution.getVariable("serviceInstanceId")
if (isBlank(serviceInstanceId)) {
@@ -79,7 +82,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
// if (isBlank(productFamilyId))
// {
// msg = "Input productFamilyId is null"
-// utils.log("INFO", msg, isDebugEnabled)
+// logger.info( msg)
// //exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
// } else {
// execution.setVariable("productFamilyId", productFamilyId)
@@ -91,7 +94,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String globalSubscriberId = jsonUtil.getJsonValue(siRequest, "globalSubscriberId")
if (isBlank(globalSubscriberId)) {
msg = "Input globalSubscriberId' is null"
- msoLogger.info(msg)
+ logger.info(msg)
} else {
execution.setVariable("globalSubscriberId", globalSubscriberId)
}
@@ -100,7 +103,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String subscriptionServiceType = jsonUtil.getJsonValue(siRequest, "serviceType")
if (isBlank(subscriptionServiceType)) {
msg = "Input subscriptionServiceType is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
//exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
} else {
execution.setVariable("subscriptionServiceType", subscriptionServiceType)
@@ -113,31 +116,31 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit preProcessRequest")
+ logger.trace("Exit preProcessRequest")
}
public void sendSyncResponse (DelegateExecution execution) {
- msoLogger.trace("Staring sendSyncResponse")
+ logger.trace("Staring sendSyncResponse")
try {
String operationId = execution.getVariable("operationId")
String syncResponse = """{"operationId":"${operationId}"}""".trim()
- msoLogger.info("sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse)
+ logger.info("sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse)
sendWorkflowResponse(execution, 202, syncResponse)
} catch (Exception ex) {
String msg = "Exception in sendSyncResponse: " + ex.getMessage()
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- msoLogger.trace("Exit sendSyncResopnse")
+ logger.trace("Exit sendSyncResopnse")
}
public void sendSyncError (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.info("Starting sendSyncError")
+ logger.info("Starting sendSyncError")
try {
String errorMessage = ""
@@ -154,17 +157,17 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
<aetgt:ErrorCode>7000</aetgt:ErrorCode>
</aetgt:WorkflowException>"""
- msoLogger.info(buildworkflowException)
+ logger.info(buildworkflowException)
sendWorkflowResponse(execution, 500, buildworkflowException)
} catch (Exception ex) {
- msoLogger.info("Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
+ logger.info("Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
}
}
public void prepareCompletionRequest (DelegateExecution execution) {
- msoLogger.trace("Starting prepareCompletion")
+ logger.trace("Starting prepareCompletion")
try {
String requestId = execution.getVariable("msoRequestId")
@@ -185,23 +188,23 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
execution.setVariable("completionRequest", xmlMsoCompletionRequest)
- msoLogger.info(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
+ logger.info(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
} catch (Exception ex) {
String msg = " Exception in prepareCompletion:" + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit prepareCompletionRequest")
+ logger.trace("Exit prepareCompletionRequest")
}
public void prepareFalloutRequest(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("Starting prepareFalloutRequest ")
+ logger.trace("Starting prepareFalloutRequest ")
try {
WorkflowException wfex = execution.getVariable("WorkflowException")
- msoLogger.info(" Input Workflow Exception: " + wfex.toString())
+ logger.info(" Input Workflow Exception: " + wfex.toString())
String requestId = execution.getVariable("msoRequestId")
String source = execution.getVariable("source")
String requestInfo =
@@ -214,7 +217,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
execution.setVariable("falloutRequest", falloutRequest)
} catch (Exception ex) {
- msoLogger.info("Exception prepareFalloutRequest:" + ex.getMessage())
+ logger.info("Exception prepareFalloutRequest:" + ex.getMessage())
String errorException = " Bpmn error encountered in CreateServiceInstance flow. FalloutHandlerRequest, buildErrorResponse() - " + ex.getMessage()
String requestId = execution.getVariable("msoRequestId")
String falloutRequest =
@@ -234,7 +237,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
execution.setVariable("falloutRequest", falloutRequest)
}
- msoLogger.trace("Exit prepareFalloutRequest")
+ logger.trace("Exit prepareFalloutRequest")
}
@@ -246,7 +249,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
execution.setVariable("prefix", Prefix)
try {
- msoLogger.info("Starting prepareDBRequest")
+ logger.info("Starting prepareDBRequest")
String requestId = execution.getVariable("DELSI_requestId")
String statusMessage = "E2E Service Instance successfully deleted."
@@ -269,7 +272,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String buildDeleteDBRequestAsString = utils.formatXml(dbRequest)
execution.setVariable("DELSI_createDBRequest", buildDeleteDBRequestAsString)
- msoLogger.info(buildDeleteDBRequestAsString)
+ logger.info(buildDeleteDBRequestAsString)
} catch (Exception ex) {
// try error in method block
@@ -287,7 +290,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Start prepareDBRequestError")
+ logger.trace("Start prepareDBRequestError")
try {
String requestId = execution.getVariable("DELSI_requestId")
@@ -317,7 +320,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String buildDBRequestAsString = utils.formatXml(dbRequest)
execution.setVariable("DELSI_createDBInfraErrorRequest", buildDBRequestAsString)
- msoLogger.info(buildDBRequestAsString)
+ logger.info(buildDBRequestAsString)
} catch (Exception ex) {
// try error in method block
@@ -336,7 +339,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
* Init the service Operation Status
*/
public void prepareInitServiceOperationStatus(DelegateExecution execution){
- msoLogger.debug("======== STARTED prepareInitServiceOperationStatus Process ======== ")
+ logger.debug("======== STARTED prepareInitServiceOperationStatus Process ======== ")
try{
String serviceId = execution.getVariable("serviceInstanceId")
String operationId = execution.getVariable("operationId")
@@ -345,12 +348,12 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String progress = "0"
String reason = ""
String operationContent = "Prepare service creation"
- msoLogger.debug("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId)
+ logger.debug("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId)
serviceId = UriUtils.encode(serviceId,"UTF-8")
def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
- msoLogger.debug("DB Adapter Endpoint is: " + dbAdapterEndpoint)
+ logger.debug("DB Adapter Endpoint is: " + dbAdapterEndpoint)
String payload =
"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
@@ -372,12 +375,12 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)
- msoLogger.debug("Outgoing updateServiceOperStatusRequest: \n" + payload)
+ logger.debug("Outgoing updateServiceOperStatusRequest: \n" + payload)
}catch(Exception e){
- msoLogger.error("Exception Occured Processing prepareInitServiceOperationStatus. Exception is:\n" + e)
+ logger.error("Exception Occured Processing prepareInitServiceOperationStatus. Exception is:\n" + e)
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareInitServiceOperationStatus Method:\n" + e.getMessage())
}
- msoLogger.debug("======== COMPLETED prepareInitServiceOperationStatus Process ======== ")
+ logger.debug("======== COMPLETED prepareInitServiceOperationStatus Process ======== ")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy
index 05e0f23925..7abdd49d1d 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -39,7 +41,8 @@ import org.onap.so.client.aai.AAIObjectType
import org.onap.so.client.aai.AAIResourcesClient
import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
import java.util.UUID;
@@ -64,20 +67,20 @@ public class DeleteDeviceResource extends AbstractServiceTaskProcessor {
JsonUtils jsonUtil = new JsonUtils()
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DeleteDeviceResource.class)
+ private static final Logger logger = LoggerFactory.getLogger( DeleteDeviceResource.class);
public void preProcessRequest(DelegateExecution execution){
- msoLogger.info(" ***** Started preProcessRequest *****")
+ logger.info(" ***** Started preProcessRequest *****")
try {
//get bpmn inputs from resource request.
String requestId = execution.getVariable("mso-request-id")
String requestAction = execution.getVariable("requestAction")
- msoLogger.info("The requestAction is: " + requestAction)
+ logger.info("The requestAction is: " + requestAction)
String recipeParamsFromRequest = execution.getVariable("recipeParams")
- msoLogger.info("The recipeParams is: " + recipeParamsFromRequest)
+ logger.info("The recipeParams is: " + recipeParamsFromRequest)
String resourceInput = execution.getVariable("resourceInput")
- msoLogger.info("The resourceInput is: " + resourceInput)
+ logger.info("The resourceInput is: " + resourceInput)
//Get ResourceInput Object
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
execution.setVariable(Prefix + "ResourceInput", resourceInputObj)
@@ -101,13 +104,13 @@ public class DeleteDeviceResource extends AbstractServiceTaskProcessor {
} catch (Exception ex){
String msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
private void getDeviceInAAI(DelegateExecution execution) {
- msoLogger.info(" ***** Started getDeviceInAAI *****")
+ logger.info(" ***** Started getDeviceInAAI *****")
try {
String deviceId = execution.getVariable(Prefix + "DeviceId")
@@ -117,19 +120,19 @@ public class DeleteDeviceResource extends AbstractServiceTaskProcessor {
String devClass = dev.getClass ()
execution.setVariable(Prefix + "DeviceClass", devClass)
- msoLogger.debug(" DeviceClass is: " + devClass)
+ logger.debug(" DeviceClass is: " + devClass)
} catch (Exception ex){
String msg = "Exception in getDeviceInAAI " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.info(" ***** Exit getDeviceInAAI *****")
+ logger.info(" ***** Exit getDeviceInAAI *****")
}
public void checkDevType(DelegateExecution execution){
- msoLogger.info(" ***** Started checkDevType *****")
+ logger.info(" ***** Started checkDevType *****")
try {
String devType = execution.getVariable(Prefix + "DeviceClass")
@@ -142,7 +145,7 @@ public class DeleteDeviceResource extends AbstractServiceTaskProcessor {
} catch (Exception ex){
String msg = "Exception in checkDevType " + ex.getMessage()
- msoLogger.debug( msg)
+ logger.debug( msg)
// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -154,7 +157,7 @@ public class DeleteDeviceResource extends AbstractServiceTaskProcessor {
}
public void prepareUpdateProgress(DelegateExecution execution) {
- msoLogger.info(" ***** Started prepareUpdateProgress *****")
+ logger.info(" ***** Started prepareUpdateProgress *****")
ResourceInput resourceInputObj = execution.getVariable(Prefix + "ResourceInput")
String operType = resourceInputObj.getOperationType()
String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
@@ -183,51 +186,51 @@ public class DeleteDeviceResource extends AbstractServiceTaskProcessor {
</soapenv:Envelope>"""
setProgressUpdateVariables(execution, body)
- msoLogger.info(" ***** Exit prepareUpdateProgress *****")
+ logger.info(" ***** Exit prepareUpdateProgress *****")
}
public void getVNFTemplatefromSDC(DelegateExecution execution){
- msoLogger.info(" ***** Started getVNFTemplatefromSDC *****")
+ logger.info(" ***** Started getVNFTemplatefromSDC *****")
try {
// To do
} catch (Exception ex){
String msg = "Exception in getVNFTemplatefromSDC " + ex.getMessage()
- msoLogger.debug( msg)
+ logger.debug( msg)
// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
public void postVNFInfoProcess(DelegateExecution execution){
- msoLogger.info(" ***** Started postVNFInfoProcess *****")
+ logger.info(" ***** Started postVNFInfoProcess *****")
try {
// To do
} catch (Exception ex){
String msg = "Exception in postVNFInfoProcess " + ex.getMessage()
- msoLogger.debug( msg)
+ logger.debug( msg)
// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
public void sendSyncResponse (DelegateExecution execution) {
- msoLogger.debug( " *** sendSyncResponse *** ")
+ logger.debug( " *** sendSyncResponse *** ")
try {
String operationStatus = "finished"
// RESTResponse for main flow
String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
- msoLogger.debug( " sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
+ logger.debug( " sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
sendWorkflowResponse(execution, 202, resourceOperationResp)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
- msoLogger.debug( msg)
+ logger.debug( msg)
// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.debug(" ***** Exit sendSyncResopnse *****")
+ logger.debug(" ***** Exit sendSyncResopnse *****")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteGenericALaCarteServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteGenericALaCarteServiceInstance.groovy
index ec2fed50c3..3542828a98 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteGenericALaCarteServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteGenericALaCarteServiceInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -31,7 +33,8 @@ import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.common.scripts.VidUtils
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.json.JsonUtils
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import groovy.json.*
@@ -46,14 +49,14 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
JsonUtils jsonUtil = new JsonUtils()
VidUtils vidUtils = new VidUtils()
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DeleteGenericALaCarteServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DeleteGenericALaCarteServiceInstance.class);
public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
String msg = ""
- msoLogger.trace("Start preProcessRequest")
+ logger.trace("Start preProcessRequest")
try {
// check for incoming json message/input
@@ -61,7 +64,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
String requestId = execution.getVariable("mso-request-id")
execution.setVariable("msoRequestId", requestId)
- msoLogger.debug("Input Request:" + siRequest + " reqId:" + requestId)
+ logger.debug("Input Request:" + siRequest + " reqId:" + requestId)
String serviceInstanceId = execution.getVariable("serviceInstanceId")
if (isBlank(serviceInstanceId)) {
@@ -76,11 +79,11 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
String serviceModelInfo = jsonUtil.getJsonValue(siRequest, "requestDetails.modelInfo")
if (isBlank(serviceModelInfo)) {
msg = "Input serviceModelInfo is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
} else
{
execution.setVariable("serviceModelInfo", serviceModelInfo)
- //msoLogger.debug("modelInfo" + serviceModelInfo)
+ //logger.debug("modelInfo" + serviceModelInfo)
}
//requestInfo
@@ -88,7 +91,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
if (isBlank(productFamilyId))
{
msg = "Input productFamilyId is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
//exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
} else {
execution.setVariable("productFamilyId", productFamilyId)
@@ -100,7 +103,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
String globalSubscriberId = jsonUtil.getJsonValue(siRequest, "requestDetails.subscriberInfo.globalSubscriberId")
if (isBlank(globalSubscriberId)) {
msg = "Input globalSubscriberId' is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
} else {
execution.setVariable("globalSubscriberId", globalSubscriberId)
}
@@ -109,7 +112,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
String subscriptionServiceType = jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.subscriptionServiceType")
if (isBlank(subscriptionServiceType)) {
msg = "Input subscriptionServiceType is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
//exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
} else {
execution.setVariable("subscriptionServiceType", subscriptionServiceType)
@@ -133,22 +136,22 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
}
}
- msoLogger.debug("User Input Parameters map: " + userParams.toString())
+ logger.debug("User Input Parameters map: " + userParams.toString())
execution.setVariable("serviceInputParams", inputMap)
} catch (BpmnError e) {
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit preProcessRequest")
+ logger.trace("Exit preProcessRequest")
}
public void sendSyncResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("Start sendSyncResponse")
+ logger.trace("Start sendSyncResponse")
try {
String requestId = execution.getVariable("msoRequestId")
@@ -156,19 +159,19 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
// RESTResponse (for API Handler (APIH) Reply Task)
String syncResponse = """{"requestReferences":{"instanceId":"${serviceInstanceId}","requestId":"${requestId}"}}""".trim()
- msoLogger.debug(" sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse)
+ logger.debug(" sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse)
sendWorkflowResponse(execution, 202, syncResponse)
} catch (Exception ex) {
String msg = "Exception in sendSyncResponse: " + ex.getMessage()
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- msoLogger.trace("Exit sendSyncResopnse")
+ logger.trace("Exit sendSyncResopnse")
}
public void sendSyncError (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("Start sendSyncError")
+ logger.trace("Start sendSyncError")
try {
String errorMessage = ""
@@ -185,18 +188,18 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
<aetgt:ErrorCode>7000</aetgt:ErrorCode>
</aetgt:WorkflowException>"""
- MsoLogger.info(buildworkflowException)
+ logger.info(buildworkflowException)
sendWorkflowResponse(execution, 500, buildworkflowException)
} catch (Exception ex) {
- msoLogger.debug(" Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
+ logger.debug(" Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
}
}
public void prepareCompletionRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("Start prepareCompletion")
+ logger.trace("Start prepareCompletion")
try {
String requestId = execution.getVariable("msoRequestId")
@@ -219,23 +222,23 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
execution.setVariable("completionRequest", xmlMsoCompletionRequest)
- msoLogger.debug(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
+ logger.debug(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
} catch (Exception ex) {
String msg = " Exception in prepareCompletion:" + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit prepareCompletionRequest")
+ logger.trace("Exit prepareCompletionRequest")
}
public void prepareFalloutRequest(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("Start prepareFalloutRequest")
+ logger.trace("Start prepareFalloutRequest")
try {
WorkflowException wfex = execution.getVariable("WorkflowException")
- msoLogger.debug(" Input Workflow Exception: " + wfex.toString())
+ logger.debug(" Input Workflow Exception: " + wfex.toString())
String requestId = execution.getVariable("msoRequestId")
String source = execution.getVariable("source")
String requestInfo =
@@ -248,7 +251,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
execution.setVariable("falloutRequest", falloutRequest)
} catch (Exception ex) {
- msoLogger.debug("Exception prepareFalloutRequest:" + ex.getMessage())
+ logger.debug("Exception prepareFalloutRequest:" + ex.getMessage())
String errorException = " Bpmn error encountered in CreateServiceInstance flow. FalloutHandlerRequest, buildErrorResponse() - " + ex.getMessage()
String requestId = execution.getVariable("msoRequestId")
String falloutRequest =
@@ -268,7 +271,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
execution.setVariable("falloutRequest", falloutRequest)
}
- msoLogger.trace("Exit prepareFalloutRequest ")
+ logger.trace("Exit prepareFalloutRequest ")
}
@@ -280,7 +283,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
execution.setVariable("prefix", Prefix)
try {
- msoLogger.trace("Inside prepareDBRequest of DeleteGenericALaCarteServiceInstance ")
+ logger.trace("Inside prepareDBRequest of DeleteGenericALaCarteServiceInstance ")
String requestId = execution.getVariable("DELSI_requestId")
String statusMessage = "Service Instance successfully deleted."
@@ -303,7 +306,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
String buildDeleteDBRequestAsString = utils.formatXml(dbRequest)
execution.setVariable("DELSI_createDBRequest", buildDeleteDBRequestAsString)
- msoLogger.info(buildDeleteDBRequestAsString)
+ logger.info(buildDeleteDBRequestAsString)
} catch (Exception ex) {
// try error in method block
@@ -321,7 +324,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside prepareDBRequestError of DeleteGenericALaCarteServiceInstance ")
+ logger.trace("Inside prepareDBRequestError of DeleteGenericALaCarteServiceInstance ")
try {
String requestId = execution.getVariable("DELSI_requestId")
@@ -351,7 +354,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
String buildDBRequestAsString = utils.formatXml(dbRequest)
execution.setVariable("DELSI_createDBInfraErrorRequest", buildDBRequestAsString)
- msoLogger.info(buildDBRequestAsString)
+ logger.info(buildDBRequestAsString)
} catch (Exception ex) {
// try error in method block
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteNetworkInstance.groovy
index 816ba859ee..0008f6fd65 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteNetworkInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteNetworkInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -31,6 +33,8 @@ import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.json.JsonUtils;
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import groovy.json.*
@@ -42,7 +46,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
VidUtils vidUtils = new VidUtils(this)
NetworkUtils networkUtils = new NetworkUtils()
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DeleteNetworkInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DeleteNetworkInstance.class);
public InitializeProcessVariables(DelegateExecution execution){
@@ -63,7 +67,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside preProcessRequest() of " + groovyClassName + "")
+ logger.trace("Inside preProcessRequest() of " + groovyClassName + "")
try {
// initialize flow variables
@@ -79,20 +83,20 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
String disableRollback = jsonUtil.getJsonValue(bpmnRequest, "requestDetails.requestInfo.suppressRollback")
if (disableRollback != null) {
execution.setVariable("disableRollback", disableRollback)
- msoLogger.debug("Received 'suppressRollback': " + disableRollback )
+ logger.debug("Received 'suppressRollback': " + disableRollback )
} else {
execution.setVariable("disableRollback", false)
}
- msoLogger.debug(" Set 'disableRollback' : " + execution.getVariable("disableRollback") )
+ logger.debug(" Set 'disableRollback' : " + execution.getVariable("disableRollback") )
} else {
String dataErrorMessage = " Invalid 'bpmnRequest' request."
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
} else {
// 'macro' test ONLY, sdncVersion = '1702'
- msoLogger.debug(" 'disableRollback' : " + execution.getVariable("disableRollback") )
+ logger.debug(" 'disableRollback' : " + execution.getVariable("disableRollback") )
}
// get/set 'msoRequestId' and 'mso-request-id'
@@ -138,7 +142,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
} catch (Exception ex){
sendSyncError(execution)
String exceptionMessage = "Exception Encountered in " + groovyClassName + ", PreProcessRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -149,7 +153,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside getNetworkModelInfo() of DeleteNetworkInstance")
+ logger.trace("Inside getNetworkModelInfo() of DeleteNetworkInstance")
try {
@@ -162,7 +166,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
} catch (Exception ex) {
sendSyncError(execution)
String exceptionMessage = "Bpmn error encountered in DeleteNetworkInstance flow. getNetworkModelInfo() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -173,7 +177,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside sendSyncResponse() of DeleteNetworkInstance")
+ logger.trace("Inside sendSyncResponse() of DeleteNetworkInstance")
try {
String requestId = execution.getVariable("mso-request-id")
@@ -182,14 +186,14 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
// RESTResponse (for API Handler (APIH) Reply Task)
String deleteNetworkRestRequest = """{"requestReferences":{"instanceId":"${serviceInstanceId}","requestId":"${requestId}"}}""".trim()
- msoLogger.debug(" sendSyncResponse to APIH - " + "\n" + deleteNetworkRestRequest)
+ logger.debug(" sendSyncResponse to APIH - " + "\n" + deleteNetworkRestRequest)
sendWorkflowResponse(execution, 202, deleteNetworkRestRequest)
} catch (Exception ex) {
// caught exception
String exceptionMessage = "Exception Encountered in DeleteNetworkInstance, sendSyncResponse() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -200,7 +204,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareCompletion() of CreateNetworkInstance")
+ logger.trace("Inside prepareCompletion() of CreateNetworkInstance")
try {
@@ -224,11 +228,11 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
// normal path
execution.setVariable(Prefix + "CompleteMsoProcessRequest", xmlMsoCompletionRequest)
- msoLogger.debug(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
+ logger.debug(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in CreateNetworkInstance flow. prepareCompletion() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -241,7 +245,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
try {
- msoLogger.trace("Inside prepareDBRequestError of DeleteNetworkInstance")
+ logger.trace("Inside prepareDBRequestError of DeleteNetworkInstance")
// set DB Header Authorization
setBasicDBAuthHeader(execution, isDebugEnabled)
@@ -267,12 +271,12 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
</soapenv:Envelope>"""
execution.setVariable(Prefix + "deleteDBRequest", dbRequest)
- msoLogger.debug(" DB Adapter Request - " + "\n" + dbRequest)
+ logger.debug(" DB Adapter Request - " + "\n" + dbRequest)
} catch (Exception ex) {
// caught exception
String exceptionMessage = "Bpmn error encountered in DeleteNetworkInstance, prepareDBRequestError() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -287,24 +291,24 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside postProcessResponse() of DeleteNetworkInstance")
+ logger.trace("Inside postProcessResponse() of DeleteNetworkInstance")
try {
if (execution.getVariable("CMSO_ResponseCode") == "200") {
execution.setVariable(Prefix + "Success", true)
- msoLogger.trace("DeleteNetworkInstance Success")
+ logger.trace("DeleteNetworkInstance Success")
// Place holder for additional code.
} else {
execution.setVariable(Prefix + "Success", false)
- msoLogger.trace("DeleteNetworkInstance Failed in CompletionMsoProces flow!.")
+ logger.trace("DeleteNetworkInstance Failed in CompletionMsoProces flow!.")
}
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DeleteNetworkInstance flow. postProcessResponse() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -321,11 +325,11 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Prepare for FalloutHandler. FAILURE - prepare request for sub-process FalloutHandler.")
+ logger.trace("Prepare for FalloutHandler. FAILURE - prepare request for sub-process FalloutHandler.")
String dbReturnCode = execution.getVariable(Prefix + "dbReturnCode")
- msoLogger.debug("DB Update Response Code : " + dbReturnCode)
- msoLogger.debug("DB Update Response String: " + '\n' + execution.getVariable(Prefix + "deleteDBResponse"))
+ logger.debug("DB Update Response Code : " + dbReturnCode)
+ logger.debug("DB Update Response String: " + '\n' + execution.getVariable(Prefix + "deleteDBResponse"))
String falloutHandlerRequest = ""
String requestId = execution.getVariable("mso-request-id")
@@ -351,14 +355,16 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
</aetgt:WorkflowException>
</aetgt:FalloutHandlerRequest>"""
- msoLogger.debug(falloutHandlerRequest)
+ logger.debug(falloutHandlerRequest)
execution.setVariable(Prefix + "FalloutHandlerRequest", falloutHandlerRequest)
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG,"Overall Error Response going to FalloutHandler: " + "\n" + falloutHandlerRequest,"BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "")
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Overall Error Response going to FalloutHandler: " + "\n" + falloutHandlerRequest, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue())
} catch (Exception ex) {
// caught exception
String exceptionMessage = "Bpmn error encountered in DeleteNetworkInstance, buildErrorResponse() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
falloutHandlerRequest =
"""<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
xmlns:ns="http://org.onap/so/request/types/v1"
@@ -374,7 +380,9 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
</aetgt:WorkflowException>
</aetgt:FalloutHandlerRequest>"""
execution.setVariable(Prefix + "FalloutHandlerRequest", falloutHandlerRequest)
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG,"Overall Error Response going to FalloutHandler: " + "\n" + falloutHandlerRequest,"BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + ex)
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Overall Error Response going to FalloutHandler: " + "\n" + falloutHandlerRequest,"BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + ex)
}
}
@@ -390,12 +398,12 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
// RESTResponse (for API Handler (APIH) Reply Task)
String deleteNetworkRestError = """{"requestReferences":{"instanceId":"${serviceInstanceId}","requestId":"${requestId}"}}""".trim()
- msoLogger.debug(" sendSyncResponse to APIH - " + "\n" + deleteNetworkRestError)
+ logger.debug(" sendSyncResponse to APIH - " + "\n" + deleteNetworkRestError)
sendWorkflowResponse(execution, 500, deleteNetworkRestError)
} catch (Exception ex) {
- msoLogger.debug(" Sending Sync Error Activity Failed - DeleteNetworkInstance, sendSyncError(): " + "\n" + ex.getMessage())
+ logger.debug(" Sending Sync Error Activity Failed - DeleteNetworkInstance, sendSyncError(): " + "\n" + ex.getMessage())
}
}
@@ -403,18 +411,18 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
try{
- msoLogger.debug("Caught a Java Exception")
- msoLogger.debug("Started processJavaException Method")
- msoLogger.debug("Variables List: " + execution.getVariables())
+ logger.debug("Caught a Java Exception")
+ logger.debug("Started processJavaException Method")
+ logger.debug("Variables List: " + execution.getVariables())
execution.setVariable("UnexpectedError", "Caught a Java Lang Exception") // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception")
}catch(Exception e){
- msoLogger.debug("Caught Exception during processJavaException Method: " + e)
+ logger.debug("Caught Exception during processJavaException Method: " + e)
execution.setVariable("UnexpectedError", "Exception in processJavaException method") // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method")
}
- msoLogger.debug("Completed processJavaException Method of " + Prefix)
+ logger.debug("Completed processJavaException Method of " + Prefix)
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
index cf781933f6..0dc86632e2 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -31,7 +33,8 @@ import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.core.UrnPropertiesReader
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import static org.apache.commons.lang3.StringUtils.*
@@ -40,7 +43,7 @@ import static org.apache.commons.lang3.StringUtils.*
* flow for SDNC Network Resource
*/
public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DeleteSDNCNetworkResource.class);
+ private static final Logger logger = LoggerFactory.getLogger( DeleteSDNCNetworkResource.class);
String Prefix="DELSDNCRES_"
@@ -53,17 +56,17 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
MsoUtils msoUtils = new MsoUtils()
public void preProcessRequest(DelegateExecution execution){
- msoLogger.info(" ***** Started preProcessRequest *****")
+ logger.info(" ***** Started preProcessRequest *****")
try {
//get bpmn inputs from resource request.
String requestId = execution.getVariable("mso-request-id")
String requestAction = execution.getVariable("requestAction")
- msoLogger.info("The requestAction is: " + requestAction)
+ logger.info("The requestAction is: " + requestAction)
String recipeParamsFromRequest = execution.getVariable("recipeParams")
- msoLogger.info("The recipeParams is: " + recipeParamsFromRequest)
+ logger.info("The recipeParams is: " + recipeParamsFromRequest)
String resourceInput = execution.getVariable("resourceInput")
- msoLogger.info("The resourceInput is: " + resourceInput)
+ logger.info("The resourceInput is: " + resourceInput)
//Get ResourceInput Object
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
execution.setVariable(Prefix + "resourceInput", resourceInputObj)
@@ -146,7 +149,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug( msg)
+ logger.debug( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -158,7 +161,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
* generate the nsParameters
*/
public void prepareSDNCRequest (DelegateExecution execution) {
- msoLogger.info(" ***** Started prepareSDNCRequest *****")
+ logger.info(" ***** Started prepareSDNCRequest *****")
try {
// get variables
@@ -353,15 +356,15 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
String sdncTopologyDeleteRequesAsString = utils.formatXml(sdncTopologyDeleteRequest)
utils.logAudit(sdncTopologyDeleteRequesAsString)
execution.setVariable("sdncAdapterWorkflowRequest", sdncTopologyDeleteRequesAsString)
- msoLogger.info("sdncAdapterWorkflowRequest - " + "\n" + sdncTopologyDeleteRequesAsString)
+ logger.info("sdncAdapterWorkflowRequest - " + "\n" + sdncTopologyDeleteRequesAsString)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DeleteSDNCCNetworkResource flow. prepareSDNCRequest() - " + ex.getMessage()
- msoLogger.debug( exceptionMessage)
+ logger.debug( exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- msoLogger.info(" ***** Exit prepareSDNCRequest *****")
+ logger.info(" ***** Exit prepareSDNCRequest *****")
}
private void setProgressUpdateVariables(DelegateExecution execution, String body) {
@@ -436,30 +439,30 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
}
public void postDeleteSDNCCall(DelegateExecution execution){
- msoLogger.info(" ***** Started prepareSDNCRequest *****")
+ logger.info(" ***** Started prepareSDNCRequest *****")
String responseCode = execution.getVariable(Prefix + "sdncDeleteReturnCode")
String responseObj = execution.getVariable(Prefix + "SuccessIndicator")
- msoLogger.info("response from sdnc, response code :" + responseCode + " response object :" + responseObj)
- msoLogger.info(" ***** Exit prepareSDNCRequest *****")
+ logger.info("response from sdnc, response code :" + responseCode + " response object :" + responseObj)
+ logger.info(" ***** Exit prepareSDNCRequest *****")
}
public void sendSyncResponse (DelegateExecution execution) {
- msoLogger.debug( " *** sendSyncResponse *** ")
+ logger.debug( " *** sendSyncResponse *** ")
try {
String operationStatus = "finished"
// RESTResponse for main flow
String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
- msoLogger.debug( " sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
+ logger.debug( " sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
sendWorkflowResponse(execution, 202, resourceOperationResp)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
String msg = "Exception in sendSyncResponse:" + ex.getMessage()
- msoLogger.debug( msg)
+ logger.debug( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.debug(" ***** Exit sendSyncResponse *****")
+ logger.debug(" ***** Exit sendSyncResponse *****")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy
index 536783bc33..9b269c734f 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy
@@ -5,6 +5,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -26,6 +28,8 @@ import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.common.scripts.ExceptionUtil
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
public class DeleteVFCNSResource extends AbstractServiceTaskProcessor {
@@ -34,9 +38,11 @@ public class DeleteVFCNSResource extends AbstractServiceTaskProcessor {
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
+ private static final Logger logger = LoggerFactory.getLogger( DeleteVFCNSResource.class);
+
public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** start preProcessRequest *****", isDebugEnabled)
+ logger.info(" ***** start preProcessRequest *****")
String resourceInputStr = execution.getVariable("resourceInput")
ResourceInput resourceInput = new ObjectMapper().readValue(resourceInputStr, ResourceInput.class)
@@ -54,34 +60,34 @@ public class DeleteVFCNSResource extends AbstractServiceTaskProcessor {
execution.setVariable("resourceTemplateId", resourceModeluuid)
execution.setVariable("resourceInstanceId", resourceInstanceId)
- utils.log("INFO"," ***** end preProcessRequest *****", isDebugEnabled)
+ logger.info(" ***** end preProcessRequest *****")
}
public void postProcessRequest (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** start postProcessRequest *****", isDebugEnabled)
+ logger.info(" ***** start postProcessRequest *****")
- utils.log("INFO"," ***** end postProcessRequest *****", isDebugEnabled)
+ logger.info(" ***** end postProcessRequest *****")
}
public void sendSyncResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled)
+ logger.debug( " *** sendSyncResponse *** ")
try {
String nsInstanceId = execution.getVariable("nsInstanceId")
String operationStatus = execution.getVariable("operationStatus")
// RESTResponse for main flow
String createVFCResourceRestRsp = """{"nsInstanceId":"${nsInstanceId}","operationStatus":"${operationStatus}"}""".trim()
- utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + createVFCResourceRestRsp, isDebugEnabled)
+ logger.debug( " sendSyncResponse to APIH:" + "\n" + createVFCResourceRestRsp)
sendWorkflowResponse(execution, 202, createVFCResourceRestRsp)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
- utils.log("DEBUG", msg, isDebugEnabled)
+ logger.debug( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- utils.log("DEBUG"," ***** Exit sendSyncResopnse *****", isDebugEnabled)
+ logger.debug(" ***** Exit sendSyncResopnse *****")
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleInfra.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleInfra.groovy
index 682421e806..357ce69d50 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleInfra.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleInfra.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -30,6 +32,8 @@ import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.json.JsonUtils;
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import groovy.json.JsonSlurper
@@ -37,7 +41,7 @@ import groovy.json.JsonSlurper
public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DeleteVfModuleInfra.class);
+ private static final Logger logger = LoggerFactory.getLogger( DeleteVfModuleInfra.class);
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
/**
@@ -70,7 +74,7 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
def method = getClass().getSimpleName() + '.preProcessRequest(' +
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("isVidRequest", "false")
initProcessVariables(execution)
@@ -79,25 +83,25 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
def incomingRequest = execution.getVariable('bpmnRequest')
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- msoLogger.debug("Incoming Infra Request: " + incomingRequest)
+ logger.debug("Incoming Infra Request: " + incomingRequest)
// check if request is xml or json
try {
def jsonSlurper = new JsonSlurper()
Map reqMap = jsonSlurper.parseText(incomingRequest)
- msoLogger.debug(" Request is in JSON format.")
+ logger.debug(" Request is in JSON format.")
def serviceInstanceId = execution.getVariable('serviceInstanceId')
- msoLogger.debug("serviceInstanceId is: " + serviceInstanceId)
+ logger.debug("serviceInstanceId is: " + serviceInstanceId)
def vnfId = execution.getVariable('vnfId')
- msoLogger.debug("vnfId is: " + vnfId)
+ logger.debug("vnfId is: " + vnfId)
def cloudConfiguration = jsonUtil.getJsonValue(incomingRequest, "requestDetails.cloudConfiguration")
execution.setVariable("cloudConfiguration", cloudConfiguration)
- msoLogger.debug("CloudConfiguration is: " + cloudConfiguration)
+ logger.debug("CloudConfiguration is: " + cloudConfiguration)
def vfModuleModelInfo = jsonUtil.getJsonValue(incomingRequest, "requestDetails.modelInfo")
execution.setVariable("vfModuleModelInfo", vfModuleModelInfo)
- msoLogger.debug("VfModuleModelInfo is: " + vfModuleModelInfo)
+ logger.debug("VfModuleModelInfo is: " + vfModuleModelInfo)
// This is aLaCarte flow, so aLaCarte flag is always on
execution.setVariable('aLaCarte', true)
@@ -106,7 +110,7 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
String requestInXmlFormat = vidUtils.createXmlVfModuleRequest(execution, reqMap, 'DELETE_VF_MODULE', serviceInstanceId)
- msoLogger.debug(" Request in XML format: " + requestInXmlFormat)
+ logger.debug(" Request in XML format: " + requestInXmlFormat)
setBasicDBAuthHeader(execution, isDebugLogEnabled)
@@ -116,13 +120,15 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
}
catch(groovy.json.JsonException je) {
- msoLogger.debug(" Request is not in JSON format.")
+ logger.debug(" Request is not in JSON format.")
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Internal Error - During PreProcess Request")
}
catch(Exception e) {
String restFaultMessage = e.getMessage()
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG,"Caught exception", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "Caught exception",
+ "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(),
+ "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Internal Error - During PreProcess Request")
}
@@ -131,7 +137,7 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
String request = validateRequest(execution)
execution.setVariable('DeleteVfModuleRequest', request)
- msoLogger.debug("DeleteVfModuleInfra Request: " + request)
+ logger.debug("DeleteVfModuleInfra Request: " + request)
def requestInfo = getRequiredNodeXml(execution, request, 'request-info')
execution.setVariable('DELVfModI_requestInfo', requestInfo)
@@ -149,11 +155,13 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
def vnfParams = utils.getNodeXml(request, 'vnf-params')
execution.setVariable('DELVfModI_vnfParams', vnfParams)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG,"Caught exception in "+method, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Caught exception in " + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in preProcessRequest(): ' + e.getMessage())
}
}
@@ -168,7 +176,7 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def requestInfo = execution.getVariable('DELVfModI_requestInfo')
@@ -187,14 +195,16 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
def vfModuleId = execution.getVariable('DELVfModI_vfModuleId')
String synchResponse = """{"requestReferences":{"instanceId":"${vfModuleId}","requestId":"${requestId}"}}""".trim()
- msoLogger.debug("DeleteVfModuleInfra Synch Response: " + synchResponse)
+ logger.debug("DeleteVfModuleInfra Synch Response: " + synchResponse)
sendWorkflowResponse(execution, 200, synchResponse)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG,"Caught exception in "+method, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Caught exception in " + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendResponse(): ' + e.getMessage())
}
}
@@ -211,15 +221,15 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepDoDeleteVfModule(): ' + e.getMessage())
}
}
@@ -234,7 +244,7 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def requestId = execution.getVariable('DELVfModI_requestId')
@@ -260,13 +270,15 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
updateInfraRequest = utils.formatXml(updateInfraRequest)
execution.setVariable('DELVfModI_updateInfraRequest', updateInfraRequest)
- msoLogger.debug('Request for Update Infra Request:\n' + updateInfraRequest)
+ logger.debug('Request for Update Infra Request:\n' + updateInfraRequest)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepInfraRequest(): ' + e.getMessage())
}
}
@@ -283,7 +295,7 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
', resultVar=' + resultVar +
')'
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def request = execution.getVariable("DeleteVfModuleRequest")
@@ -302,14 +314,16 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
</aetgt:MsoCompletionRequest>"""
content = utils.formatXml(content)
- msoLogger.debug(resultVar + ' = ' + System.lineSeparator() + content)
+ logger.debug(resultVar + ' = ' + System.lineSeparator() + content)
execution.setVariable(resultVar, content)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, 'Internal Error')
}
}
@@ -326,7 +340,7 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
', resultVar=' + resultVar +
')'
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def prefix = execution.getVariable('prefix')
@@ -353,14 +367,16 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
</sdncadapterworkflow:FalloutHandlerRequest>
"""
content = utils.formatXml(content)
- msoLogger.debug(resultVar + ' = ' + System.lineSeparator() + content)
+ logger.debug(resultVar + ' = ' + System.lineSeparator() + content)
execution.setVariable(resultVar, content)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildWorkflowException(execution, 2000, 'Internal Error')
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1.groovy
index 8c9ab3fe45..9675e89249 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -39,6 +41,8 @@ import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.constants.Defaults
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.springframework.web.util.UriUtils
@@ -50,7 +54,7 @@ import javax.ws.rs.NotFoundException
* This groovy class supports the <class>DeleteVfModuleVolume.bpmn</class> process.
*/
public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DeleteVfModuleVolumeInfraV1.class);
+ private static final Logger logger = LoggerFactory.getLogger( DeleteVfModuleVolumeInfraV1.class);
private XmlParser xmlParser = new XmlParser()
/**
@@ -107,7 +111,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
try {
def jsonSlurper = new JsonSlurper()
Map reqMap = jsonSlurper.parseText(createVolumeIncoming)
- msoLogger.debug(" Request is in JSON format.")
+ logger.debug(" Request is in JSON format.")
def serviceInstanceId = execution.getVariable('serviceInstanceId')
def volumeGroupId = execution.getVariable('volumeGroupId')
@@ -116,7 +120,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
execution.setVariable("DELVfModVol_isVidRequest", true)
}
catch(groovy.json.JsonException je) {
- msoLogger.debug(" Request is in XML format.")
+ logger.debug(" Request is in XML format.")
// assume request is in XML format - proceed as usual to process XML request
}
@@ -145,13 +149,13 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
setBasicDBAuthHeader(execution, isDebugLogEnabled)
- msoLogger.debug('Request: ' + createVolumeIncoming)
+ logger.debug('Request: ' + createVolumeIncoming)
}
public void sendSyncResponse (DelegateExecution execution, isDebugEnabled) {
String volumeRequest = execution.getVariable("DELVfModVol_volumeRequest")
- msoLogger.debug(" DELVfModVol_volumeRequest - " + "\n" + volumeRequest)
+ logger.debug(" DELVfModVol_volumeRequest - " + "\n" + volumeRequest)
// RESTResponse (for API Handler (APIH) Reply Task)
String deleteVolumeRequest =
"""<rest:RESTResponse xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd" statusCode="200">
@@ -214,12 +218,12 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
execution.setVariable("DELVfModVol_isCloudRegionGood", true)
} else {
- msoLogger.debug("AAI Query Cloud Region Unsuccessful.")
+ logger.debug("AAI Query Cloud Region Unsuccessful.")
execution.setVariable("DELVfModVol_isCloudRegionGood", false)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "AAI Query Cloud Region Unsuccessful. Return Code: " + execution.getVariable("DELVfModVol_queryCloudRegionReturnCode"))
}
- msoLogger.debug(" is Cloud Region Good: " + execution.getVariable("DELVfModVol_isCloudRegionGood"))
+ logger.debug(" is Cloud Region Good: " + execution.getVariable("DELVfModVol_isCloudRegionGood"))
}
/**
@@ -248,20 +252,20 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
execution.setVariable('DELVfModVol_volumeGroupHeatStackId', heatStackId)
if ( volumeGroupWrapper.getRelationships().isPresent() && !volumeGroupWrapper.getRelationships().get().getRelatedAAIUris(AAIObjectType.VF_MODULE).isEmpty()) {
- msoLogger.debug('Volume Group ' + volumeGroupId + ' currently in use')
+ logger.debug('Volume Group ' + volumeGroupId + ' currently in use')
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Volume Group ${volumeGroupId} currently in use - found vf-module relationship.")
}
def volumeGroupTenantId = getTenantIdFromVolumeGroup(volumeGroupWrapper)
if (volumeGroupTenantId == null) {
- msoLogger.debug("Could not find Tenant Id element in Volume Group with Volume Group Id ${volumeGroupId}")
+ logger.debug("Could not find Tenant Id element in Volume Group with Volume Group Id ${volumeGroupId}")
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Could not find Tenant Id element in Volume Group with Volume Group Id ${volumeGroupId}")
}
execution.setVariable('DELVfModVol_volumeGroupTenantId', volumeGroupTenantId)
- msoLogger.debug('Received Tenant Id ' + volumeGroupTenantId + ' from AAI for Volume Group with Volume Group Id ' + volumeGroupId)
+ logger.debug('Received Tenant Id ' + volumeGroupTenantId + ' from AAI for Volume Group with Volume Group Id ' + volumeGroupId)
} else {
- msoLogger.debug("Volume Group ${volumeGroupId} not found in AAI")
+ logger.debug("Volume Group ${volumeGroupId} not found in AAI")
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Volume Group ${volumeGroupId} not found in AAI. Response code: 404")
}
}catch (BpmnError e){
@@ -339,7 +343,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
"""
vnfAdapterRestRequest = utils.formatXml(vnfAdapterRestRequest)
execution.setVariable('DELVfModVol_deleteVnfARequest', vnfAdapterRestRequest)
- msoLogger.debug('Request for VNFAdapter Rest:\n' + vnfAdapterRestRequest)
+ logger.debug('Request for VNFAdapter Rest:\n' + vnfAdapterRestRequest)
}
@@ -354,7 +358,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
try {
AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP, Defaults.CLOUD_OWNER.toString(), cloudRegion, groupId)
getAAIClient().delete(uri)
- msoLogger.debug("Volume group $groupId deleted.")
+ logger.debug("Volume group $groupId deleted.")
}catch(NotFoundException e){
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Volume group $groupId not found for delete in AAI Response code: 404")
}catch(Exception e1){
@@ -401,7 +405,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
updateInfraRequest = utils.formatXml(updateInfraRequest)
execution.setVariable('DELVfModVol_updateInfraRequest', updateInfraRequest)
- msoLogger.debug('Request for Update Infra Request:\n' + updateInfraRequest)
+ logger.debug('Request for Update Infra Request:\n' + updateInfraRequest)
}
@@ -424,13 +428,13 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
execution.setVariable('DELVfModVol_CompleteMsoProcessRequest', xmlMsoCompletionRequest)
- msoLogger.debug(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
+ logger.debug(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
}
- public void prepareFalloutHandler (DelegateExecution execution, isDebugEnabled) {
+ public void prepareFalloutHandler (DelegateExecution execution) {
execution.setVariable("DELVfModVol_Success", false)
String requestId = execution.getVariable("DELVfModVol_requestId")
@@ -457,11 +461,12 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
// Format Response
String xmlHandlerRequest = utils.formatXml(falloutHandlerRequest)
- msoLogger.debug(xmlHandlerRequest)
+ logger.debug(xmlHandlerRequest)
execution.setVariable("DELVfModVol_FalloutHandlerRequest", xmlHandlerRequest)
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, " Overall Error Response going to FalloutHandler", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "\n" + xmlHandlerRequest);
-
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Overall Error Response going to FalloutHandler", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "\n" + xmlHandlerRequest);
}
@@ -480,7 +485,9 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
def String errorMessage = 'TenantId ' + tenantId + ' in incoming request does not match Tenant Id ' + volumeGroupTenantId +
' retrieved from AAI for Volume Group Id ' + volumeGroupId
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Error in DeleteVfModuleVolume: " + "\n" + errorMessage, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError);
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Error in DeleteVfModuleVolume: " + "\n" + errorMessage, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
ExceptionUtil exceptionUtil = new ExceptionUtil()
exceptionUtil.buildWorkflowException(execution, 5000, errorMessage)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVnfInfra.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVnfInfra.groovy
index 9dfb9107b2..f22b11c44a 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVnfInfra.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVnfInfra.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -30,7 +32,8 @@ import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.common.scripts.VidUtils;
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.json.JsonUtils;
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
/**
@@ -40,7 +43,7 @@ import org.onap.so.logger.MsoLogger
*/
class DeleteVnfInfra extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DeleteVnfInfra.class);
+ private static final Logger logger = LoggerFactory.getLogger( DeleteVnfInfra.class);
String Prefix="DELVI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -55,7 +58,7 @@ class DeleteVnfInfra extends AbstractServiceTaskProcessor {
*/
public void preProcessRequest(DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED DeleteVnfInfra PreProcessRequest Process")
+ logger.trace("STARTED DeleteVnfInfra PreProcessRequest Process")
execution.setVariable("DELVI_SuccessIndicator", false)
execution.setVariable("DELVI_vnfInUse", false)
@@ -64,7 +67,7 @@ class DeleteVnfInfra extends AbstractServiceTaskProcessor {
// Get Variables
String deleteVnfRequest = execution.getVariable("bpmnRequest")
execution.setVariable("DELVI_DeleteVnfRequest", deleteVnfRequest)
- msoLogger.debug("Incoming DeleteVnfInfra Request is: \n" + deleteVnfRequest)
+ logger.debug("Incoming DeleteVnfInfra Request is: \n" + deleteVnfRequest)
if(deleteVnfRequest != null){
@@ -73,15 +76,15 @@ class DeleteVnfInfra extends AbstractServiceTaskProcessor {
String serviceInstanceId = execution.getVariable("serviceInstanceId")
execution.setVariable("DELVI_serviceInstanceId", serviceInstanceId)
- msoLogger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
+ logger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
String vnfId = execution.getVariable("vnfId")
execution.setVariable("DELVI_vnfId", vnfId)
- msoLogger.debug("Incoming Vnf(Instance) Id is: " + vnfId)
+ logger.debug("Incoming Vnf(Instance) Id is: " + vnfId)
String source = jsonUtil.getJsonValue(deleteVnfRequest, "requestDetails.requestInfo.source")
execution.setVariable("DELVI_source", source)
- msoLogger.debug("Incoming Source is: " + source)
+ logger.debug("Incoming Source is: " + source)
def cloudConfiguration = jsonUtil.getJsonValue(deleteVnfRequest, "requestDetails.cloudConfiguration")
execution.setVariable("DELVI_cloudConfiguration", cloudConfiguration)
@@ -92,7 +95,7 @@ class DeleteVnfInfra extends AbstractServiceTaskProcessor {
cascadeDelete = cascadeDeleteObj.booleanValue()
}
execution.setVariable("DELVI_cascadeDelete", cascadeDelete)
- msoLogger.debug("Incoming cascadeDelete is: " + cascadeDelete)
+ logger.debug("Incoming cascadeDelete is: " + cascadeDelete)
//For Completion Handler & Fallout Handler
String requestInfo =
@@ -112,20 +115,20 @@ class DeleteVnfInfra extends AbstractServiceTaskProcessor {
}
}catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
}catch(Exception e){
- msoLogger.debug(" Error Occured in DeleteVnfInfra PreProcessRequest method!" + e)
+ logger.debug(" Error Occured in DeleteVnfInfra PreProcessRequest method!" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DeleteVnfInfra PreProcessRequest")
}
- msoLogger.trace("COMPLETED DeleteVnfInfra PreProcessRequest Process")
+ logger.trace("COMPLETED DeleteVnfInfra PreProcessRequest Process")
}
public void sendSyncResponse (DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED DeleteVnfInfra SendSyncResponse Process")
+ logger.trace("STARTED DeleteVnfInfra SendSyncResponse Process")
try {
String requestId = execution.getVariable("DELVI_requestId")
@@ -133,23 +136,23 @@ class DeleteVnfInfra extends AbstractServiceTaskProcessor {
String DeleteVnfResponse = """{"requestReferences":{"instanceId":"${vnfId}","requestId":"${requestId}"}}""".trim()
- msoLogger.debug("DeleteVnfInfra Sync Response is: \n" + DeleteVnfResponse)
+ logger.debug("DeleteVnfInfra Sync Response is: \n" + DeleteVnfResponse)
execution.setVariable("DELVI_sentSyncResponse", true)
sendWorkflowResponse(execution, 202, DeleteVnfResponse)
} catch (Exception ex) {
- msoLogger.debug("Error Occured in DeleteVnfInfra SendSyncResponse Process " + ex.getMessage())
+ logger.debug("Error Occured in DeleteVnfInfra SendSyncResponse Process " + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DeleteVnfInfra SendSyncResponse Process")
}
- msoLogger.trace("COMPLETED DeleteVnfInfra SendSyncResponse Process")
+ logger.trace("COMPLETED DeleteVnfInfra SendSyncResponse Process")
}
public void prepareCompletionHandlerRequest(DelegateExecution execution){
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED DeleteVnfInfra PrepareCompletionHandlerRequest Process")
+ logger.trace("STARTED DeleteVnfInfra PrepareCompletionHandlerRequest Process")
try {
String requestInfo = execution.getVariable("DELVI_requestInfo")
@@ -166,40 +169,40 @@ class DeleteVnfInfra extends AbstractServiceTaskProcessor {
</aetgt:MsoCompletionRequest>"""
execution.setVariable("DELVI_completionHandlerRequest", request)
- msoLogger.debug("Completion Handler Request is: " + request)
+ logger.debug("Completion Handler Request is: " + request)
execution.setVariable("WorkflowResponse", "Success") // for junits
} catch (Exception ex) {
- msoLogger.debug("Error Occured in DeleteVnfInfra PrepareCompletionHandlerRequest Process " + ex.getMessage())
+ logger.debug("Error Occured in DeleteVnfInfra PrepareCompletionHandlerRequest Process " + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DeleteVnfInfra PrepareCompletionHandlerRequest Process")
}
- msoLogger.trace("COMPLETED DeleteVnfInfra PrepareCompletionHandlerRequest Process")
+ logger.trace("COMPLETED DeleteVnfInfra PrepareCompletionHandlerRequest Process")
}
public void sendErrorResponse(DelegateExecution execution){
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED DeleteVnfInfra sendErrorResponse Process")
+ logger.trace("STARTED DeleteVnfInfra sendErrorResponse Process")
try {
def sentSyncResponse = execution.getVariable("DELVI_sentSyncResponse")
if(sentSyncResponse == false){
- msoLogger.debug("Sending a Sync Error Response")
+ logger.debug("Sending a Sync Error Response")
WorkflowException wfex = execution.getVariable("WorkflowException")
String response = exceptionUtil.buildErrorResponseXml(wfex)
- msoLogger.debug(response)
+ logger.debug(response)
sendWorkflowResponse(execution, 500, response)
}else{
- msoLogger.debug("A Sync Response has already been sent. Skipping Send Sync Error Response.")
+ logger.debug("A Sync Response has already been sent. Skipping Send Sync Error Response.")
}
} catch(Exception ex) {
- msoLogger.debug("Error Occured in DeleteVnfInfra sendErrorResponse Process " + ex.getMessage())
+ logger.debug("Error Occured in DeleteVnfInfra sendErrorResponse Process " + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DeleteVnfInfra sendErrorResponse Process")
}
- msoLogger.trace("COMPLETED DeleteVnfInfra sendErrorResponse Process")
+ logger.trace("COMPLETED DeleteVnfInfra sendErrorResponse Process")
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy
index 24071d38f6..fff2503308 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -26,6 +28,8 @@ import org.onap.so.bpmn.core.domain.Resource
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.onap.so.bpmn.common.scripts.ExceptionUtil
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.camunda.bpm.engine.delegate.DelegateExecution
@@ -48,11 +52,12 @@ public class DoCompareModelVersions extends AbstractServiceTaskProcessor {
String Prefix="DCMPMDV_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
+ private static final Logger logger = LoggerFactory.getLogger( DoCompareModelVersions.class);
public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
String msg = ""
- utils.log("INFO"," ***** preProcessRequest *****", isDebugEnabled)
+ logger.info(" ***** preProcessRequest *****")
try {
execution.setVariable("prefix", Prefix)
@@ -61,58 +66,58 @@ public class DoCompareModelVersions extends AbstractServiceTaskProcessor {
String modelInvariantUuid_target = execution.getVariable("model-invariant-id-target")
if (isBlank(modelInvariantUuid_target)) {
msg = "Input model-invariant-id-target is null"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
String modelUuid_target = execution.getVariable("model-version-id-target")
if (isBlank(modelUuid_target)) {
msg = "Input model-version-id-target is null"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
String modelInvariantUuid_original = execution.getVariable("model-invariant-id-original")
if (isBlank(modelInvariantUuid_original)) {
msg = "Input model-invariant-id-original is null"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
String modelUuid_original = execution.getVariable("model-version-id-original")
if (isBlank(modelUuid_original)) {
msg = "Input model-version-id-original is null"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
// Target and original modelInvariantUuid must to be the same
if(modelInvariantUuid_target != modelInvariantUuid_original){
msg = "Input model-invariant-id-target and model-invariant-id-original must to be the same"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
// Target and original modelUuid must not to be the same
if(modelUuid_target == modelUuid_original){
msg = "Input model-version-id-target and model-version-id-original must not to be the same"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- utils.log("INFO"," ***** Exit preProcessRequest *****", isDebugEnabled)
+ logger.info(" ***** Exit preProcessRequest *****")
}
public void prepareDecomposeService_Target(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
try {
- utils.log("DEBUG", " ***** Inside prepareDecomposeService_Target of update generic e2e service ***** ", isDebugEnabled)
+ logger.debug( " ***** Inside prepareDecomposeService_Target of update generic e2e service ***** ")
String modelInvariantUuid = execution.getVariable("model-invariant-id-target")
String modelUuid = execution.getVariable("model-version-id-target")
//here modelVersion is not set, we use modelUuid to decompose the service.
@@ -124,7 +129,7 @@ public class DoCompareModelVersions extends AbstractServiceTaskProcessor {
execution.setVariable("serviceModelInfo_Target", serviceModelInfo)
- utils.log("DEBUG", " ***** Completed prepareDecomposeService_Target of update generic e2e service ***** ", isDebugEnabled)
+ logger.debug( " ***** Completed prepareDecomposeService_Target of update generic e2e service ***** ")
} catch (Exception ex) {
// try error in method block
String exceptionMessage = "Bpmn error encountered in update generic e2e service flow. Unexpected Error from method prepareDecomposeService_Target() - " + ex.getMessage()
@@ -135,13 +140,13 @@ public class DoCompareModelVersions extends AbstractServiceTaskProcessor {
public void processDecomposition_Target(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("DEBUG", " ***** Inside processDecomposition_Target() of update generic e2e service flow ***** ", isDebugEnabled)
+ logger.debug( " ***** Inside processDecomposition_Target() of update generic e2e service flow ***** ")
try {
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
execution.setVariable("serviceDecomposition_Target", serviceDecomposition)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in update generic e2e service flow. Unexpected Error from method processDecomposition_Target() - " + ex.getMessage()
- utils.log("DEBUG", exceptionMessage, isDebugEnabled)
+ logger.debug( exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
}
@@ -150,7 +155,7 @@ public class DoCompareModelVersions extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
try {
- utils.log("DEBUG", " ***** Inside prepareDecomposeService_Original of update generic e2e service ***** ", isDebugEnabled)
+ logger.debug( " ***** Inside prepareDecomposeService_Original of update generic e2e service ***** ")
String modelInvariantUuid = execution.getVariable("model-invariant-id-original")
String modelUuid = execution.getVariable("model-version-id-original")
//here modelVersion is not set, we use modelUuid to decompose the service.
@@ -162,7 +167,7 @@ public class DoCompareModelVersions extends AbstractServiceTaskProcessor {
execution.setVariable("serviceModelInfo_Original", serviceModelInfo)
- utils.log("DEBUG", " ***** Completed prepareDecomposeService_Original of update generic e2e service ***** ", isDebugEnabled)
+ logger.debug( " ***** Completed prepareDecomposeService_Original of update generic e2e service ***** ")
} catch (Exception ex) {
// try error in method block
String exceptionMessage = "Bpmn error encountered in update generic e2e service flow. Unexpected Error from method prepareDecomposeService_Original() - " + ex.getMessage()
@@ -173,20 +178,20 @@ public class DoCompareModelVersions extends AbstractServiceTaskProcessor {
public void processDecomposition_Original(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("DEBUG", " ***** Inside processDecomposition_Original() of update generic e2e service flow ***** ", isDebugEnabled)
+ logger.debug( " ***** Inside processDecomposition_Original() of update generic e2e service flow ***** ")
try {
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
execution.setVariable("serviceDecomposition_Original", serviceDecomposition)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in update generic e2e service flow. processDecomposition_Original() - " + ex.getMessage()
- utils.log("DEBUG", exceptionMessage, isDebugEnabled)
+ logger.debug( exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
}
public void doCompareModelVersions(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO", "======== Start doCompareModelVersions Process ======== ", isDebugEnabled)
+ logger.info( "======== Start doCompareModelVersions Process ======== ")
ServiceDecomposition serviceDecomposition_Target = execution.getVariable("serviceDecomposition_Target")
ServiceDecomposition serviceDecomposition_Original = execution.getVariable("serviceDecomposition_Original")
@@ -217,10 +222,10 @@ public class DoCompareModelVersions extends AbstractServiceTaskProcessor {
execution.setVariable("addResourceList", addResourceList)
execution.setVariable("delResourceList", delResourceList)
- utils.log("INFO", "addResourceList: " + addResourceList, isDebugEnabled)
- utils.log("INFO", "delResourceList: " + delResourceList, isDebugEnabled)
+ logger.info( "addResourceList: " + addResourceList)
+ logger.info( "delResourceList: " + delResourceList)
- utils.log("INFO", "======== COMPLETED doCompareModelVersions Process ======== ", isDebugEnabled)
+ logger.info( "======== COMPLETED doCompareModelVersions Process ======== ")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy
index 589bbe9c4f..7ad929b1c2 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -40,6 +42,8 @@ import org.onap.so.client.aai.AAIResourcesClient
import org.onap.so.client.aai.entities.AAIResultWrapper
import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import groovy.json.*
@@ -62,6 +66,7 @@ public class DoCompareModelofE2EServiceInstance extends AbstractServiceTaskProce
String Prefix="DCMPMDSI_"
private static final String DebugFlag = "isDebugEnabled"
+ private static final Logger logger = LoggerFactory.getLogger( DeleteNetworkInstance.class);
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
@@ -70,50 +75,50 @@ public class DoCompareModelofE2EServiceInstance extends AbstractServiceTaskProce
def method = getClass().getSimpleName() + '.preProcessRequest(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO","Entered " + method, isDebugEnabled)
+ logger.info("Entered " + method)
String msg = ""
- utils.log("INFO"," ***** Enter DoCompareModelofE2EServiceInstance preProcessRequest *****", isDebugEnabled)
+ logger.info(" ***** Enter DoCompareModelofE2EServiceInstance preProcessRequest *****")
execution.setVariable("prefix", Prefix)
//Inputs
//subscriberInfo. for AAI GET
String globalSubscriberId = execution.getVariable("globalSubscriberId")
- utils.log("INFO"," ***** globalSubscriberId *****" + globalSubscriberId, isDebugEnabled)
+ logger.info(" ***** globalSubscriberId *****" + globalSubscriberId)
String serviceType = execution.getVariable("serviceType")
- utils.log("INFO"," ***** serviceType *****" + serviceType, isDebugEnabled)
+ logger.info(" ***** serviceType *****" + serviceType)
if (isBlank(globalSubscriberId)) {
msg = "Input globalSubscriberId is null"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(serviceType)) {
msg = "Input serviceType is null"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
String serviceInstanceId = execution.getVariable("serviceInstanceId")
if (isBlank(serviceInstanceId)){
msg = "Input serviceInstanceId is null"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
String modelInvariantUuid = execution.getVariable("modelInvariantIdTarget")
if (isBlank(modelInvariantUuid)){
msg = "Input modelInvariantUuid is null"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
String modelUuid = execution.getVariable("modelVersionIdTarget")
if (isBlank(modelUuid)){
msg = "Input modelUuid is null"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
@@ -122,7 +127,7 @@ public class DoCompareModelofE2EServiceInstance extends AbstractServiceTaskProce
execution.setVariable("model-version-id-target", modelUuid)
- utils.log("INFO", "Exited " + method, isDebugEnabled)
+ logger.info( "Exited " + method)
}
/**
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
index 2168dab736..aac4b72b06 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -43,6 +45,8 @@ import org.onap.so.bpmn.infrastructure.workflow.service.ServicePluginFactory
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.springframework.web.util.UriUtils
import org.onap.so.bpmn.core.UrnPropertiesReader
@@ -73,7 +77,7 @@ import org.onap.so.bpmn.core.UrnPropertiesReader
*
*/
public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateE2EServiceInstance.class);
String Prefix="DCRESI_"
@@ -82,29 +86,29 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
public void preProcessRequest (DelegateExecution execution) {
String msg = ""
- msoLogger.trace("preProcessRequest ")
+ logger.trace("preProcessRequest ")
try {
execution.setVariable("prefix", Prefix)
//Inputs
//requestDetails.subscriberInfo. for AAI GET & PUT & SDNC assignToplology
String globalSubscriberId = execution.getVariable("globalSubscriberId") //globalCustomerId
- msoLogger.info(" ***** globalSubscriberId *****" + globalSubscriberId)
+ logger.info(" ***** globalSubscriberId *****" + globalSubscriberId)
//requestDetails.requestParameters. for AAI PUT & SDNC assignTopology
String serviceType = execution.getVariable("serviceType")
- msoLogger.info(" ***** serviceType *****" + serviceType)
+ logger.info(" ***** serviceType *****" + serviceType)
//requestDetails.requestParameters. for SDNC assignTopology
String productFamilyId = execution.getVariable("productFamilyId") //AAI productFamilyId
if (isBlank(globalSubscriberId)) {
msg = "Input globalSubscriberId is null"
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(serviceType)) {
msg = "Input serviceType is null"
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
@@ -115,11 +119,11 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
String sdncCallbackUrl = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback", execution)
if (isBlank(sdncCallbackUrl)) {
msg = "URN_mso_workflow_sdncadapter_callback is null"
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
- msoLogger.info("SDNC Callback URL: " + sdncCallbackUrl)
+ logger.info("SDNC Callback URL: " + sdncCallbackUrl)
//requestDetails.modelInfo.for AAI PUT servieInstanceData
//requestDetails.requestInfo. for AAI GET/PUT serviceInstanceData
@@ -158,15 +162,15 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit preProcessRequest ")
+ logger.trace("Exit preProcessRequest ")
}
public void prepareDecomposeService(DelegateExecution execution) {
try {
- msoLogger.trace("Inside prepareDecomposeService of create generic e2e service ")
+ logger.trace("Inside prepareDecomposeService of create generic e2e service ")
String modelInvariantUuid = execution.getVariable("modelInvariantUuid")
String modelUuid = execution.getVariable("modelUuid")
//here modelVersion is not set, we use modelUuid to decompose the service.
@@ -177,7 +181,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
}"""
execution.setVariable("serviceModelInfo", serviceModelInfo)
- msoLogger.trace("Completed prepareDecomposeService of create generic e2e service ")
+ logger.trace("Completed prepareDecomposeService of create generic e2e service ")
} catch (Exception ex) {
// try error in method block
String exceptionMessage = "Bpmn error encountered in create generic e2e service flow. Unexpected Error from method prepareDecomposeService() - " + ex.getMessage()
@@ -186,12 +190,12 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
}
public void processDecomposition(DelegateExecution execution) {
- msoLogger.trace("Inside processDecomposition() of create generic e2e service flow ")
+ logger.trace("Inside processDecomposition() of create generic e2e service flow ")
try {
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in create generic e2e service flow. processDecomposition() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
}
@@ -213,23 +217,23 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
}
public void postProcessAAIGET(DelegateExecution execution) {
- msoLogger.trace("postProcessAAIGET ")
+ logger.trace("postProcessAAIGET ")
String msg = ""
try {
String serviceInstanceName = execution.getVariable("serviceInstanceName")
boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
if(!succInAAI){
- msoLogger.info("Error getting Service-instance from AAI", + serviceInstanceName)
+ logger.info("Error getting Service-instance from AAI", + serviceInstanceName)
WorkflowException workflowException = execution.getVariable("WorkflowException")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
if(workflowException != null){
exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
}
else
{
msg = "Failure in postProcessAAIGET GENGS_SuccessIndicator:" + succInAAI
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
}
}
@@ -237,9 +241,9 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
{
boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
if(foundInAAI){
- msoLogger.info("Found Service-instance in AAI")
+ logger.info("Found Service-instance in AAI")
msg = "ServiceInstance already exists in AAI:" + serviceInstanceName
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
}
}
@@ -247,15 +251,15 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
throw e;
} catch (Exception ex) {
msg = "Exception in DoCreateServiceInstance.postProcessAAIGET. " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit postProcessAAIGET ")
+ logger.trace("Exit postProcessAAIGET ")
}
//TODO use create if not exist
public void createServiceInstance(DelegateExecution execution) {
- msoLogger.trace("createServiceInstance ")
+ logger.trace("createServiceInstance ")
String msg = ""
String serviceInstanceId = execution.getVariable("serviceInstanceId")
try {
@@ -279,10 +283,10 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
execution.setVariable("rollbackData", rollbackData)
msg = "Exception in DoCreateServiceInstance.createServiceInstance. " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit createServiceInstance ")
+ logger.trace("Exit createServiceInstance ")
}
/**
@@ -310,23 +314,23 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
}
public void postProcessAAIGET2(DelegateExecution execution) {
- msoLogger.trace("postProcessAAIGET2 ")
+ logger.trace("postProcessAAIGET2 ")
String msg = ""
try {
String serviceInstanceName = execution.getVariable("serviceInstanceName")
boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
if(!succInAAI){
- msoLogger.info("Error getting Service-instance from AAI in postProcessAAIGET2", + serviceInstanceName)
+ logger.info("Error getting Service-instance from AAI in postProcessAAIGET2", + serviceInstanceName)
WorkflowException workflowException = execution.getVariable("WorkflowException")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
if(workflowException != null){
exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
}
else
{
msg = "Failure in postProcessAAIGET2 GENGS_SuccessIndicator:" + succInAAI
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
}
}
@@ -337,7 +341,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
String aaiService = execution.getVariable("GENGS_service")
if (!isBlank(aaiService) && (utils.nodeExists(aaiService, "service-instance-name"))) {
execution.setVariable("serviceInstanceName", utils.getNodeText(aaiService, "service-instance-name"))
- msoLogger.info("Found Service-instance in AAI.serviceInstanceName:" + execution.getVariable("serviceInstanceName"))
+ logger.info("Found Service-instance in AAI.serviceInstanceName:" + execution.getVariable("serviceInstanceName"))
}
}
}
@@ -345,54 +349,54 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
throw e;
} catch (Exception ex) {
msg = "Exception in DoCreateServiceInstance.postProcessAAIGET2 " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit postProcessAAIGET2 ")
+ logger.trace("Exit postProcessAAIGET2 ")
}
public void preProcessRollback (DelegateExecution execution) {
- msoLogger.trace("preProcessRollback ")
+ logger.trace("preProcessRollback ")
try {
Object workflowException = execution.getVariable("WorkflowException");
if (workflowException instanceof WorkflowException) {
- msoLogger.info("Prev workflowException: " + workflowException.getErrorMessage())
+ logger.info("Prev workflowException: " + workflowException.getErrorMessage())
execution.setVariable("prevWorkflowException", workflowException);
//execution.setVariable("WorkflowException", null);
}
} catch (BpmnError e) {
- msoLogger.info("BPMN Error during preProcessRollback")
+ logger.info("BPMN Error during preProcessRollback")
} catch(Exception ex) {
String msg = "Exception in preProcessRollback. " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
}
- msoLogger.trace("Exit preProcessRollback ")
+ logger.trace("Exit preProcessRollback ")
}
public void postProcessRollback (DelegateExecution execution) {
- msoLogger.trace("postProcessRollback ")
+ logger.trace("postProcessRollback ")
String msg = ""
try {
Object workflowException = execution.getVariable("prevWorkflowException");
if (workflowException instanceof WorkflowException) {
- msoLogger.info("Setting prevException to WorkflowException: ")
+ logger.info("Setting prevException to WorkflowException: ")
execution.setVariable("WorkflowException", workflowException);
}
execution.setVariable("rollbackData", null)
} catch (BpmnError b) {
- msoLogger.info("BPMN Error during postProcessRollback")
+ logger.info("BPMN Error during postProcessRollback")
throw b;
} catch(Exception ex) {
msg = "Exception in postProcessRollback. " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
}
- msoLogger.trace("Exit postProcessRollback ")
+ logger.trace("Exit postProcessRollback ")
}
public void preInitResourcesOperStatus(DelegateExecution execution){
- msoLogger.trace("STARTED preInitResourcesOperStatus Process ")
+ logger.trace("STARTED preInitResourcesOperStatus Process ")
try{
String serviceId = execution.getVariable("serviceInstanceId")
String operationId = execution.getVariable("operationId")
@@ -402,7 +406,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
String progress = "0"
String reason = ""
String operationContent = "Prepare service creation"
- msoLogger.info("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType)
+ logger.info("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType)
serviceId = UriUtils.encode(serviceId,"UTF-8")
execution.setVariable("serviceInstanceId", serviceId)
execution.setVariable("operationId", operationId)
@@ -416,7 +420,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.db.endpoint")
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
- msoLogger.info("DB Adapter Endpoint is: " + dbAdapterEndpoint)
+ logger.info("DB Adapter Endpoint is: " + dbAdapterEndpoint)
String payload =
"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
@@ -434,48 +438,50 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_initResOperStatusRequest", payload)
- msoLogger.info("Outgoing initResourceOperationStatus: \n" + payload)
- msoLogger.debug("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)
+ logger.info("Outgoing initResourceOperationStatus: \n" + payload)
+ logger.debug("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preInitResourcesOperStatus.", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preInitResourcesOperStatus.", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), e);
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preInitResourcesOperStatus Process ")
+ logger.trace("COMPLETED preInitResourcesOperStatus Process ")
}
// if site location is in local Operator, create all resources in local ONAP;
// if site location is in 3rd Operator, only process sp-partner to create all resources in 3rd ONAP
public void doProcessSiteLocation(DelegateExecution execution){
- msoLogger.trace("======== Start doProcessSiteLocation Process ======== ")
+ logger.trace("======== Start doProcessSiteLocation Process ======== ")
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
String uuiRequest = execution.getVariable("uuiRequest")
uuiRequest = ServicePluginFactory.getInstance().doProcessSiteLocation(serviceDecomposition, uuiRequest);
execution.setVariable("uuiRequest", uuiRequest)
execution.setVariable("serviceDecomposition", serviceDecomposition)
- msoLogger.trace("======== COMPLETED doProcessSiteLocation Process ======== ")
+ logger.trace("======== COMPLETED doProcessSiteLocation Process ======== ")
}
// Allocate cross link TPs(terminal points) for sotn network only
public void doTPResourcesAllocation(DelegateExecution execution){
- msoLogger.trace("======== Start doTPResourcesAllocation Process ======== ")
+ logger.trace("======== Start doTPResourcesAllocation Process ======== ")
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
String uuiRequest = execution.getVariable("uuiRequest")
uuiRequest = ServicePluginFactory.getInstance().doTPResourcesAllocation(execution, uuiRequest);
execution.setVariable("uuiRequest", uuiRequest)
- msoLogger.trace("======== COMPLETED doTPResourcesAllocation Process ======== ")
+ logger.trace("======== COMPLETED doTPResourcesAllocation Process ======== ")
}
// prepare input param for using DoCreateResources.bpmn
public void preProcessForAddResource(DelegateExecution execution) {
- msoLogger.trace("STARTED preProcessForAddResource Process ")
+ logger.trace("STARTED preProcessForAddResource Process ")
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
List<Resource> addResourceList = serviceDecomposition.getServiceResources()
execution.setVariable("addResourceList", addResourceList)
- msoLogger.trace("COMPLETED preProcessForAddResource Process ")
+ logger.trace("COMPLETED preProcessForAddResource Process ")
}
public void postProcessForAddResource(DelegateExecution execution) {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy
index 4f00a64ecb..ce9df87799 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -32,7 +34,8 @@ import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
import org.onap.so.bpmn.core.RollbackData
import org.onap.so.bpmn.core.WorkflowException
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.onap.so.logger.MessageEnum
import org.onap.so.bpmn.common.scripts.ExceptionUtil;
import org.onap.so.client.aai.entities.uri.AAIResourceUri
@@ -70,20 +73,20 @@ import org.springframework.web.util.UriUtils;
*/
public class DoCreateE2EServiceInstanceRollback extends AbstractServiceTaskProcessor{
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateE2EServiceInstanceRollback.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateE2EServiceInstanceRollback.class);
String Prefix="DCRESIRB_"
public void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
String msg = ""
- msoLogger.trace("Start preProcessRequest")
+ logger.trace("Start preProcessRequest")
execution.setVariable("rollbackAAI",false)
execution.setVariable("rollbackSDNC",false)
try {
def rollbackData = execution.getVariable("rollbackData")
- msoLogger.debug("RollbackData:" + rollbackData)
+ logger.debug("RollbackData:" + rollbackData)
if (rollbackData != null) {
if (rollbackData.hasType("SERVICEINSTANCE")) {
@@ -118,8 +121,8 @@ public class DoCreateE2EServiceInstanceRollback extends AbstractServiceTaskProce
execution.setVariable("sdncDelete", sdncDelete)
def sdncDeactivate = rollbackData.get("SERVICEINSTANCE", "sdncDeactivate")
execution.setVariable("sdncDeactivate", sdncDeactivate)
- msoLogger.debug("sdncDeactivate:\n" + sdncDeactivate)
- msoLogger.debug("sdncDelete:\n" + sdncDelete)
+ logger.debug("sdncDeactivate:\n" + sdncDeactivate)
+ logger.debug("sdncDelete:\n" + sdncDelete)
}
else {
execution.setVariable("skipRollback", true)
@@ -137,50 +140,50 @@ public class DoCreateE2EServiceInstanceRollback extends AbstractServiceTaskProce
throw e;
} catch (Exception ex){
msg = "Exception in Create ServiceInstance Rollback preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) //TODO how does this even compile without exceptionUtil being declared
}
- msoLogger.trace("Exit preProcessRequest ")
+ logger.trace("Exit preProcessRequest ")
}
public void validateSDNCResponse(DelegateExecution execution, String response, String method) {
- msoLogger.trace("validateSDNCResponse")
+ logger.trace("validateSDNCResponse")
String msg = ""
try {
WorkflowException workflowException = execution.getVariable("WorkflowException")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.debug("SDNCResponse: " + response)
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("SDNCResponse: " + response)
+ logger.debug("workflowException: " + workflowException)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
msg = "SDNC Adapter service-instance rollback successful for " + method
- msoLogger.debug(msg)
+ logger.debug(msg)
}else{
execution.setVariable("rolledBack", false)
msg = "Error Response from SDNC Adapter service-instance rollback for " + method
execution.setVariable("rollbackError", msg)
- msoLogger.debug(msg)
+ logger.debug(msg)
throw new BpmnError("MSOWorkflowException")
}
} catch (BpmnError e) {
throw e;
} catch (Exception ex){
msg = "Exception in Create ServiceInstance rollback for " + method + " Exception:" + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit validateSDNCResponse ")
+ logger.trace("Exit validateSDNCResponse ")
}
/**
* Deletes the service instance in aai
*/
public void deleteServiceInstance(DelegateExecution execution) {
- msoLogger.trace("Started Delete Service Instance")
+ logger.trace("Started Delete Service Instance")
try {
String globalCustId = execution.getVariable("globalSubscriberId")
String serviceType = execution.getVariable("subscriptionServiceType")
@@ -190,15 +193,15 @@ public class DoCreateE2EServiceInstanceRollback extends AbstractServiceTaskProce
AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustId, serviceType, serviceInstanceId)
resourceClient.delete(serviceInstanceUri)
- msoLogger.trace("Completed Delete Service Instance")
+ logger.trace("Completed Delete Service Instance")
}catch(Exception e){
- msoLogger.debug("Error occured within deleteServiceInstance method: " + e)
+ logger.debug("Error occured within deleteServiceInstance method: " + e)
}
}
public void postProcessRequest(DelegateExecution execution) {
- msoLogger.trace("postProcessRequest")
+ logger.trace("postProcessRequest")
String msg = ""
try {
execution.setVariable("rollbackData", null)
@@ -215,51 +218,51 @@ public class DoCreateE2EServiceInstanceRollback extends AbstractServiceTaskProce
if(!succInAAI){
execution.setVariable("rolledBack", false) //both sdnc and aai must be successful to declare rollback Succesful
execution.setVariable("rollbackError", "Error deleting service-instance in AAI for rollback")
- msoLogger.debug("Error deleting service-instance in AAI for rollback", + serviceInstanceId)
+ logger.debug("Error deleting service-instance in AAI for rollback", + serviceInstanceId)
}
}
- msoLogger.trace("Exit postProcessRequest ")
+ logger.trace("Exit postProcessRequest ")
} catch (BpmnError e) {
msg = "Exception in Create ServiceInstance Rollback postProcessRequest. " + e.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
} catch (Exception ex) {
msg = "Exception in Create ServiceInstance Rollback postProcessRequest. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
}
public void processRollbackException(DelegateExecution execution){
- msoLogger.trace("processRollbackException")
+ logger.trace("processRollbackException")
try{
- msoLogger.debug("Caught an Exception in DoCreateServiceInstanceRollback")
+ logger.debug("Caught an Exception in DoCreateServiceInstanceRollback")
execution.setVariable("rollbackData", null)
execution.setVariable("rollbackError", "Caught exception in ServiceInstance Create Rollback")
execution.setVariable("WorkflowException", null)
}catch(BpmnError b){
- msoLogger.debug("BPMN Error during processRollbackExceptions Method: ")
+ logger.debug("BPMN Error during processRollbackExceptions Method: ")
}catch(Exception e){
- msoLogger.debug("Caught Exception during processRollbackExceptions Method: " + e.getMessage())
+ logger.debug("Caught Exception during processRollbackExceptions Method: " + e.getMessage())
}
- msoLogger.trace(" Exit processRollbackException")
+ logger.trace(" Exit processRollbackException")
}
public void processRollbackJavaException(DelegateExecution execution){
- msoLogger.trace("processRollbackJavaException")
+ logger.trace("processRollbackJavaException")
try{
execution.setVariable("rollbackData", null)
execution.setVariable("rollbackError", "Caught Java exception in ServiceInstance Create Rollback")
- msoLogger.debug("Caught Exception in processRollbackJavaException")
+ logger.debug("Caught Exception in processRollbackJavaException")
}catch(Exception e){
- msoLogger.debug("Caught Exception in processRollbackJavaException " + e.getMessage())
+ logger.debug("Caught Exception in processRollbackJavaException " + e.getMessage())
}
- msoLogger.trace("Exit processRollbackJavaException")
+ logger.trace("Exit processRollbackJavaException")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy
index 1b64671163..41bae326a5 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -45,7 +47,8 @@ import org.onap.so.client.aai.entities.AAIResultWrapper
import org.onap.so.client.aai.entities.Relationships
import org.onap.so.client.graphinventory.entities.uri.Depth
import org.onap.so.constants.Defaults
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.springframework.web.util.UriUtils
import org.w3c.dom.Document
import org.w3c.dom.Element
@@ -72,7 +75,7 @@ import groovy.xml.XmlUtil
*
*/
public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateNetworkInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateNetworkInstance.class);
String Prefix="CRENWKI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -203,7 +206,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
public void preProcessRequest (DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside preProcessRequest() of " + className + ".groovy")
+ logger.trace("Inside preProcessRequest() of " + className + ".groovy")
try {
// initialize flow variables
@@ -217,12 +220,12 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
// JSON format request is sent, create xml
try {
def prettyJson = JsonOutput.prettyPrint(networkRequest.toString())
- msoLogger.debug(" Incoming message formatted . . . : " + '\n' + prettyJson)
+ logger.debug(" Incoming message formatted . . . : " + '\n' + prettyJson)
networkRequest = vidUtils.createXmlNetworkRequestInfra(execution, networkRequest)
} catch (Exception ex) {
String dataErrorMessage = " Invalid json format Request - " + ex.getMessage()
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
} else {
@@ -236,36 +239,36 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
networkRequest = utils.formatXml(networkRequest)
execution.setVariable(Prefix + "networkRequest", networkRequest)
- msoLogger.debug(Prefix + "networkRequest - " + '\n' + networkRequest)
+ logger.debug(Prefix + "networkRequest - " + '\n' + networkRequest)
// validate 'backout-on-failure' to override 'mso.rollback'
boolean rollbackEnabled = networkUtils.isRollbackEnabled(execution, networkRequest)
execution.setVariable(Prefix + "rollbackEnabled", rollbackEnabled)
- msoLogger.debug(Prefix + "rollbackEnabled - " + rollbackEnabled)
+ logger.debug(Prefix + "rollbackEnabled - " + rollbackEnabled)
String networkInputs = utils.getNodeXml(networkRequest, "network-inputs", false).replace("tag0:","").replace(":tag0","")
execution.setVariable(Prefix + "networkInputs", networkInputs)
- msoLogger.debug(Prefix + "networkInputs - " + '\n' + networkInputs)
+ logger.debug(Prefix + "networkInputs - " + '\n' + networkInputs)
// prepare messageId
String messageId = execution.getVariable("testMessageId") // for testing
if (messageId == null || messageId == "") {
messageId = UUID.randomUUID()
- msoLogger.debug(Prefix + "messageId, random generated: " + messageId)
+ logger.debug(Prefix + "messageId, random generated: " + messageId)
} else {
- msoLogger.debug(Prefix + "messageId, pre-assigned: " + messageId)
+ logger.debug(Prefix + "messageId, pre-assigned: " + messageId)
}
execution.setVariable(Prefix + "messageId", messageId)
String source = utils.getNodeText(networkRequest, "source")
execution.setVariable(Prefix + "source", source)
- msoLogger.debug(Prefix + "source - " + source)
+ logger.debug(Prefix + "source - " + source)
// validate cloud region
String lcpCloudRegionId = utils.getNodeText(networkRequest, "aic-cloud-region")
if ((lcpCloudRegionId == null) || (lcpCloudRegionId == "") || (lcpCloudRegionId == "null")) {
String dataErrorMessage = "Missing value/element: 'lcpCloudRegionId' or 'cloudConfiguration' or 'aic-cloud-region'."
- msoLogger.debug(" Invalid Request - " + dataErrorMessage)
+ logger.debug(" Invalid Request - " + dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
@@ -273,7 +276,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
String serviceInstanceId = utils.getNodeText(networkRequest, "service-instance-id")
if ((serviceInstanceId == null) || (serviceInstanceId == "") || (serviceInstanceId == "null")) {
String dataErrorMessage = "Missing value/element: 'serviceInstanceId'."
- msoLogger.debug(" Invalid Request - " + dataErrorMessage)
+ logger.debug(" Invalid Request - " + dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
@@ -288,20 +291,20 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
} catch (IOException ex) {
String exceptionMessage = "Exception Encountered in DoCreateNetworkInstance, PreProcessRequest() - "
String dataErrorMessage = exceptionMessage + " Unable to encode PO/SDNC user/password string - " + ex.getMessage()
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
// Set variables for Generic Get Sub Flow use
execution.setVariable(Prefix + "serviceInstanceId", serviceInstanceId)
- msoLogger.debug(Prefix + "serviceInstanceId - " + serviceInstanceId)
+ logger.debug(Prefix + "serviceInstanceId - " + serviceInstanceId)
execution.setVariable("GENGS_type", "service-instance")
- msoLogger.debug("GENGS_type - " + "service-instance")
- msoLogger.debug(" Url for SDNC adapter: " + UrnPropertiesReader.getVariable("mso.adapters.sdnc.endpoint",execution))
+ logger.debug("GENGS_type - " + "service-instance")
+ logger.debug(" Url for SDNC adapter: " + UrnPropertiesReader.getVariable("mso.adapters.sdnc.endpoint",execution))
String sdncVersion = execution.getVariable("sdncVersion")
- msoLogger.debug("sdncVersion? : " + sdncVersion)
+ logger.debug("sdncVersion? : " + sdncVersion)
// build 'networkOutputs'
String networkId = utils.getNodeText(networkRequest, "network-id")
@@ -318,7 +321,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
<network-name>${MsoUtils.xmlEscape(networkName)}</network-name>
</network-outputs>"""
execution.setVariable(Prefix + "networkOutputs", networkOutputs)
- msoLogger.debug(Prefix + "networkOutputs - " + '\n' + networkOutputs)
+ logger.debug(Prefix + "networkOutputs - " + '\n' + networkOutputs)
execution.setVariable(Prefix + "networkId", networkId)
execution.setVariable(Prefix + "networkName", networkName)
@@ -329,7 +332,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
sendSyncError(execution)
// caught exception
String exceptionMessage = "Exception Encountered in PreProcessRequest() of " + className + ".groovy ***** : " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -358,7 +361,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
throw e;
}catch (Exception ex){
String msg = "Exception in getServiceInstance. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -368,7 +371,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.debug(" ***** Inside callRESTQueryAAINetworkName() of DoCreateNetworkInstance ***** " )
+ logger.debug(" ***** Inside callRESTQueryAAINetworkName() of DoCreateNetworkInstance ***** " )
try{
// get variables
@@ -383,18 +386,18 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable(Prefix + "isAAIqueryNameGood", true)
String orchestrationStatus = network.getOrchestrationStatus()
execution.setVariable(Prefix + "orchestrationStatus", orchestrationStatus.toUpperCase())
- msoLogger.debug(Prefix + "orchestrationStatus - " + orchestrationStatus.toUpperCase())
+ logger.debug(Prefix + "orchestrationStatus - " + orchestrationStatus.toUpperCase())
execution.setVariable("orchestrationStatus", orchestrationStatus)
- msoLogger.debug(Prefix + "isAAIqueryNameGood? : " + execution.getVariable(Prefix + "isAAIqueryNameGood"))
+ logger.debug(Prefix + "isAAIqueryNameGood? : " + execution.getVariable(Prefix + "isAAIqueryNameGood"))
} catch (NotFoundException e) {
- msoLogger.debug(" QueryAAINetworkName return code = '404' (Not Found). Proceed with the Create !!! ")
+ logger.debug(" QueryAAINetworkName return code = '404' (Not Found). Proceed with the Create !!! ")
} catch (Exception ex) {
// try error
String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow - callRESTQueryAAINetworkName() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -405,7 +408,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.debug(" ***** Inside callRESTQueryAAICloudRegion() of DoCreateNetworkInstance ***** " )
+ logger.debug(" ***** Inside callRESTQueryAAICloudRegion() of DoCreateNetworkInstance ***** " )
try {
String networkInputs = execution.getVariable(Prefix + "networkInputs")
@@ -429,12 +432,12 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
} else {
String dataErrorMessage = "QueryAAICloudRegion Unsuccessful. Return Code: " + execution.getVariable(Prefix + "queryCloudRegionReturnCode")
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
- msoLogger.debug(" is Cloud Region Good: " + execution.getVariable(Prefix + "isCloudRegionGood"))
+ logger.debug(" is Cloud Region Good: " + execution.getVariable(Prefix + "isCloudRegionGood"))
} catch (BpmnError e) {
throw e;
@@ -442,7 +445,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
} catch (Exception ex) {
// try error
String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow - callRESTQueryAAICloudRegion() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -453,7 +456,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.debug(" ***** Inside callRESTQueryAAINetworkId() of DoCreateNetworkInstance ***** " )
+ logger.debug(" ***** Inside callRESTQueryAAINetworkId() of DoCreateNetworkInstance ***** " )
try {
// get variables
@@ -466,7 +469,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
networkId = utils.getNodeText(networkResponseInformation, "instance-id")
} catch (Exception ex) {
String dataErrorMessage = " SNDC Response network validation for 'instance-id' (network-id) failed: Empty <network-response-information>"
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
@@ -475,10 +478,10 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
if (networkId == null || networkId == "null") {
String dataErrorMessage = "SNDC Response did not contains 'instance-id' or 'network-id' element, or the value is null."
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
} else {
- msoLogger.debug(" SNDC Response network validation for 'instance-id' (network-id)' is good: " + networkId)
+ logger.debug(" SNDC Response network validation for 'instance-id' (network-id)' is good: " + networkId)
}
@@ -499,12 +502,12 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
} catch (NotFoundException e) {
String dataErrorMessage = "Response Error from QueryAAINetworkId is 404 (Not Found)."
- msoLogger.debug(" AAI Query Failed. " + dataErrorMessage)
+ logger.debug(" AAI Query Failed. " + dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTQueryAAINetworkId() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -515,7 +518,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.debug(" ***** Inside callRESTReQueryAAINetworkId() of DoCreateNetworkInstance ***** " )
+ logger.debug(" ***** Inside callRESTReQueryAAINetworkId() of DoCreateNetworkInstance ***** " )
try {
// get variables
@@ -536,17 +539,17 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
<network-name>${MsoUtils.xmlEscape(netName)}</network-name>
</network-outputs>"""
execution.setVariable(Prefix + "networkOutputs", networkOutputs)
- msoLogger.debug(" networkOutputs - " + '\n' + networkOutputs)
+ logger.debug(" networkOutputs - " + '\n' + networkOutputs)
} catch (NotFoundException e) {
String dataErrorMessage = "Response Error from ReQueryAAINetworkId is 404 (Not Found)."
- msoLogger.debug(" AAI ReQuery Failed. - " + dataErrorMessage)
+ logger.debug(" AAI ReQuery Failed. - " + dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTReQueryAAINetworkId() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -557,7 +560,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.debug(" ***** Inside callRESTQueryAAINetworkVpnBinding() of DoCreateNetworkInstance ***** " )
+ logger.debug(" ***** Inside callRESTQueryAAINetworkVpnBinding() of DoCreateNetworkInstance ***** " )
try {
@@ -567,7 +570,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
if(relationships.isPresent()){
List<AAIResourceUri> uris = relationships.get().getRelatedAAIUris(AAIObjectType.VPN_BINDING)
- msoLogger.debug(Prefix + "vpnCount - " + uris.size())
+ logger.debug(Prefix + "vpnCount - " + uris.size())
if (uris.size() > 0) {
String routeTargets = ""
@@ -593,7 +596,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
} // end loop
execution.setVariable(Prefix + "routeCollection", routeTargets)
- msoLogger.debug(Prefix + "routeCollection - " + '\n' + routeTargets)
+ logger.debug(Prefix + "routeCollection - " + '\n' + routeTargets)
} else {
// reset return code to success
@@ -609,17 +612,17 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse)
execution.setVariable(Prefix + "queryVpnBindingAAIResponse", aaiStubResponseAsXml)
execution.setVariable(Prefix + "routeCollection", "<routeTargets/>")
- msoLogger.debug(" No vpnBinding, using this stub as response - " + '\n' + aaiStubResponseAsXml)
+ logger.debug(" No vpnBinding, using this stub as response - " + '\n' + aaiStubResponseAsXml)
}
}
} catch (NotFoundException e) {
- msoLogger.debug("Response Error from AAINetworkVpnBinding is 404 (Not Found).")
+ logger.debug("Response Error from AAINetworkVpnBinding is 404 (Not Found).")
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Response Error from AAINetworkVpnBinding is 404 (Not Found).")
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTQueryAAINetworkVpnBinding() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -630,7 +633,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.debug(" ***** Inside callRESTQueryAAINetworkPolicy() of DoCreateNetworkInstance ***** " )
+ logger.debug(" ***** Inside callRESTQueryAAINetworkPolicy() of DoCreateNetworkInstance ***** " )
try {
AAIResourcesClient client = new AAIResourcesClient()
@@ -640,7 +643,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
List<AAIResourceUri> uris = relationships.get().getRelatedAAIUris(AAIObjectType.NETWORK_POLICY)
execution.setVariable(Prefix + "networkPolicyCount", uris.size())
- msoLogger.debug(Prefix + "networkPolicyCount - " + uris.size())
+ logger.debug(Prefix + "networkPolicyCount - " + uris.size())
if (uris.size() > 0) {
@@ -658,7 +661,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
} // end loop
execution.setVariable(Prefix + "networkCollection", networkPolicies)
- msoLogger.debug(Prefix + "networkCollection - " + '\n' + networkPolicies)
+ logger.debug(Prefix + "networkCollection - " + '\n' + networkPolicies)
} else {
// reset return code to success
@@ -674,18 +677,18 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse)
execution.setVariable(Prefix + "queryNetworkPolicyAAIResponse", aaiStubResponseAsXml)
execution.setVariable(Prefix + "networkCollection", "<policyFqdns/>")
- msoLogger.debug(" No net policies, using this stub as response - " + '\n' + aaiStubResponseAsXml)
+ logger.debug(" No net policies, using this stub as response - " + '\n' + aaiStubResponseAsXml)
}
}
} catch (NotFoundException e) {
String dataErrorMessage = "Response Error from QueryAAINetworkPolicy is 404 (Not Found)."
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTQueryAAINetworkPolicy() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -696,7 +699,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.debug(" ***** Inside callRESTQueryAAINetworkTableRef() of DoCreateNetworkInstance ***** " )
+ logger.debug(" ***** Inside callRESTQueryAAINetworkTableRef() of DoCreateNetworkInstance ***** " )
try {
@@ -707,7 +710,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
List<AAIResourceUri> uris = relationships.get().getRelatedAAIUris(AAIObjectType.ROUTE_TABLE_REFERENCE)
execution.setVariable(Prefix + "networkTableRefCount", uris.size())
- msoLogger.debug(Prefix + "networkTableRefCount - " + uris.size())
+ logger.debug(Prefix + "networkTableRefCount - " + uris.size())
if (uris.size() > 0) {
@@ -725,7 +728,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
} // end loop
execution.setVariable(Prefix + "tableRefCollection", networkTableRefs)
- msoLogger.debug(Prefix + "tableRefCollection - " + '\n' + networkTableRefs)
+ logger.debug(Prefix + "tableRefCollection - " + '\n' + networkTableRefs)
} else {
// reset return code to success
@@ -741,19 +744,19 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse)
execution.setVariable(Prefix + "queryNetworkTableRefAAIResponse", aaiStubResponseAsXml)
execution.setVariable(Prefix + "tableRefCollection", "<routeTableFqdns/>")
- msoLogger.debug(" No net table references, using this stub as response - " + '\n' + aaiStubResponseAsXml)
+ logger.debug(" No net table references, using this stub as response - " + '\n' + aaiStubResponseAsXml)
}
}
} catch (NotFoundException e) {
String dataErrorMessage = "Response Error from QueryAAINetworkTableRef is 404 (Not Found)."
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTQueryAAINetworkTableRef() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -765,7 +768,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace(" ***** Inside callRESTUpdateContrailAAINetwork() of DoCreateNetworkInstance ***** " )
+ logger.trace(" ***** Inside callRESTUpdateContrailAAINetwork() of DoCreateNetworkInstance ***** " )
try {
// get variables
@@ -797,7 +800,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
l3Network.setOrchestrationStatus("Active")
}
- msoLogger.debug("Updating l3-network in AAI" )
+ logger.debug("Updating l3-network in AAI" )
AAIResourcesClient client = new AAIResourcesClient()
AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId)
@@ -815,7 +818,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
subnet.setOrchestrationStatus("Active")
}
- msoLogger.debug("Updating subnet in AAI" )
+ logger.debug("Updating subnet in AAI" )
AAIResourceUri subUri = AAIUriFactory.createResourceUri(AAIObjectType.SUBNET, networkId, subnetId)
client.update(subUri, subnet)
@@ -828,17 +831,17 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
} else {
execution.setVariable(Prefix + "isPONR", true)
}
- msoLogger.debug(Prefix + "isPONR" + ": " + execution.getVariable(Prefix + "isPONR"))
+ logger.debug(Prefix + "isPONR" + ": " + execution.getVariable(Prefix + "isPONR"))
} catch (BpmnError e) {
throw e;
} catch (NotFoundException e) {
String dataErrorMessage = " Response Error from UpdateContrailAAINetwork is 404 (Not Found)."
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. callRESTUpdateContrailAAINetwork() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
}
@@ -847,7 +850,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareCreateNetworkRequest() of DoCreateNetworkInstance")
+ logger.trace("Inside prepareCreateNetworkRequest() of DoCreateNetworkInstance")
try {
@@ -874,11 +877,11 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
buildDeleteNetworkRequestAsString = buildDeleteNetworkRequestAsString.replace(":w1aac13n0", "").replace("w1aac13n0:", "")
execution.setVariable(Prefix + "createNetworkRequest", buildDeleteNetworkRequestAsString)
- msoLogger.debug(Prefix + "createNetworkRequest - " + "\n" + buildDeleteNetworkRequestAsString)
+ logger.debug(Prefix + "createNetworkRequest - " + "\n" + buildDeleteNetworkRequestAsString)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareCreateNetworkRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -889,7 +892,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareSDNCRequest() of DoCreateNetworkInstance")
+ logger.trace("Inside prepareSDNCRequest() of DoCreateNetworkInstance")
try {
// get variables
@@ -914,12 +917,12 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
String sndcTopologyCreateRequesAsString = utils.formatXml(sndcTopologyCreateRequest)
execution.setVariable(Prefix + "assignSDNCRequest", sndcTopologyCreateRequesAsString)
- msoLogger.debug(Prefix + "assignSDNCRequest - " + "\n" + sndcTopologyCreateRequesAsString)
+ logger.debug(Prefix + "assignSDNCRequest - " + "\n" + sndcTopologyCreateRequesAsString)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareSDNCRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -930,7 +933,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareRpcSDNCRequest() of DoCreateNetworkInstance")
+ logger.trace("Inside prepareRpcSDNCRequest() of DoCreateNetworkInstance")
try {
// get variables
@@ -947,11 +950,11 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
String sndcTopologyCreateRequesAsString = utils.formatXml(sndcTopologyCreateRequest)
execution.setVariable(Prefix + "assignSDNCRequest", sndcTopologyCreateRequesAsString)
- msoLogger.debug(Prefix + "assignSDNCRequest - " + "\n" + sndcTopologyCreateRequesAsString)
+ logger.debug(Prefix + "assignSDNCRequest - " + "\n" + sndcTopologyCreateRequesAsString)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareRpcSDNCRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -962,7 +965,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareRpcSDNCActivateRequest() of DoCreateNetworkInstance")
+ logger.trace("Inside prepareRpcSDNCActivateRequest() of DoCreateNetworkInstance")
try {
// get variables
@@ -977,12 +980,12 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
String sndcTopologyCreateRequesAsString = utils.formatXml(sndcTopologyCreateRequest)
execution.setVariable(Prefix + "activateSDNCRequest", sndcTopologyCreateRequesAsString)
- msoLogger.debug(Prefix + "activateSDNCRequest - " + "\n" + sndcTopologyCreateRequesAsString)
+ logger.debug(Prefix + "activateSDNCRequest - " + "\n" + sndcTopologyCreateRequesAsString)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareRpcSDNCActivateRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -1000,7 +1003,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside validateNetworkResponse() of DoCreateNetworkInstance")
+ logger.trace("Inside validateNetworkResponse() of DoCreateNetworkInstance")
try {
String returnCode = execution.getVariable(Prefix + "networkReturnCode")
@@ -1009,13 +1012,13 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
networkResponse="" // reset
}
- msoLogger.debug(" Network Adapter create responseCode: " + returnCode)
+ logger.debug(" Network Adapter create responseCode: " + returnCode)
String errorMessage = ""
if (returnCode == "200") {
execution.setVariable(Prefix + "isNetworkRollbackNeeded", true)
execution.setVariable(Prefix + "createNetworkResponse", networkResponse)
- msoLogger.debug(" Network Adapter create Success Response - " + "\n" + networkResponse)
+ logger.debug(" Network Adapter create Success Response - " + "\n" + networkResponse)
// prepare rollback data
String rollbackData = utils.getNodeXml(networkResponse, "rollback", false).replace("tag0:","").replace(":tag0","")
@@ -1026,7 +1029,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
</rollbackNetworkRequest>"""
String rollbackNetworkXml = utils.formatXml(rollbackNetwork)
execution.setVariable(Prefix + "rollbackNetworkRequest", rollbackNetworkXml)
- msoLogger.debug(" Network Adapter rollback data - " + "\n" + rollbackNetworkXml)
+ logger.debug(" Network Adapter rollback data - " + "\n" + rollbackNetworkXml)
} else { // network error
if (returnCode.toInteger() > 399 && returnCode.toInteger() < 600) { //4xx, 5xx
@@ -1060,7 +1063,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. validateCreateNetworkResponse() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -1072,7 +1075,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside validateSDNCResponse() of DoCreateNetworkInstance")
+ logger.trace("Inside validateSDNCResponse() of DoCreateNetworkInstance")
String response = execution.getVariable(Prefix + "assignSDNCResponse")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
@@ -1087,10 +1090,10 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
if (execution.getVariable(Prefix + "sdncResponseSuccess") == true) { // from sdnc util, Prefix+'sdncResponseSuccess'
execution.setVariable(Prefix + "isSdncRollbackNeeded", true)
- msoLogger.debug("Successfully Validated SDNC Response")
+ logger.debug("Successfully Validated SDNC Response")
} else {
- msoLogger.debug("Did NOT Successfully Validated SDNC Response")
+ logger.debug("Did NOT Successfully Validated SDNC Response")
throw new BpmnError("MSOWorkflowException")
}
@@ -1100,7 +1103,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside validateRpcSDNCActivateResponse() of DoCreateNetworkInstance")
+ logger.trace("Inside validateRpcSDNCActivateResponse() of DoCreateNetworkInstance")
String response = execution.getVariable(Prefix + "activateSDNCResponse")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
@@ -1115,10 +1118,10 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
if (execution.getVariable(Prefix + "sdncResponseSuccess") == true) { // from sdnc util, Prefix+'sdncResponseSuccess'
execution.setVariable(Prefix + "isSdncActivateRollbackNeeded", true)
- msoLogger.debug("Successfully Validated Rpc SDNC Activate Response")
+ logger.debug("Successfully Validated Rpc SDNC Activate Response")
} else {
- msoLogger.debug("Did NOT Successfully Validated Rpc SDNC Activate Response")
+ logger.debug("Did NOT Successfully Validated Rpc SDNC Activate Response")
throw new BpmnError("MSOWorkflowException")
}
@@ -1129,7 +1132,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareSDNCRollbackRequest() of DoCreateNetworkInstance")
+ logger.trace("Inside prepareSDNCRollbackRequest() of DoCreateNetworkInstance")
try {
// get variables
@@ -1145,12 +1148,12 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
String sndcTopologyRollbackRequest = sdncAdapterUtils.sdncTopologyRequestV2(execution, createNetworkInput, serviceInstanceId, sdncCallback, "rollback", "NetworkActivateRequest", cloudRegionId, networkId, null, null)
String sndcTopologyRollbackRequestAsString = utils.formatXml(sndcTopologyRollbackRequest)
execution.setVariable(Prefix + "rollbackSDNCRequest", sndcTopologyRollbackRequestAsString)
- msoLogger.debug(" Preparing request for SDNC Topology 'rollback-NetworkActivateRequest' rollback . . . - " + "\n" + sndcTopologyRollbackRequestAsString)
+ logger.debug(" Preparing request for SDNC Topology 'rollback-NetworkActivateRequest' rollback . . . - " + "\n" + sndcTopologyRollbackRequestAsString)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareSDNCRollbackRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -1161,7 +1164,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareRpcSDNCRollbackRequest() of DoCreateNetworkInstance")
+ logger.trace("Inside prepareRpcSDNCRollbackRequest() of DoCreateNetworkInstance")
try {
// get variables
@@ -1177,12 +1180,12 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, createNetworkInput, serviceInstanceId, sdncCallback, "unassign", "DeleteNetworkInstance", cloudRegionId, networkId, null)
String sndcTopologyRollbackRpcRequestAsString = utils.formatXml(sndcTopologyRollbackRpcRequest)
execution.setVariable(Prefix + "rollbackSDNCRequest", sndcTopologyRollbackRpcRequestAsString)
- msoLogger.debug(" Preparing request for SDNC Topology 'unassign-DeleteNetworkInstance' rollback . . . - " + "\n" + sndcTopologyRollbackRpcRequestAsString)
+ logger.debug(" Preparing request for SDNC Topology 'unassign-DeleteNetworkInstance' rollback . . . - " + "\n" + sndcTopologyRollbackRpcRequestAsString)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareRpcSDNCRollbackRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -1193,7 +1196,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareRpcSDNCActivateRollback() of DoCreateNetworkInstance")
+ logger.trace("Inside prepareRpcSDNCActivateRollback() of DoCreateNetworkInstance")
try {
@@ -1210,12 +1213,12 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, createNetworkInput, serviceInstanceId, sdncCallback, "deactivate", "DeleteNetworkInstance", cloudRegionId, networkId, null)
String sndcTopologyRollbackRpcRequestAsString = utils.formatXml(sndcTopologyRollbackRpcRequest)
execution.setVariable(Prefix + "rollbackActivateSDNCRequest", sndcTopologyRollbackRpcRequestAsString)
- msoLogger.debug(" Preparing request for RPC SDNC Topology 'deactivate-DeleteNetworkInstance' rollback . . . - " + "\n" + sndcTopologyRollbackRpcRequestAsString)
+ logger.debug(" Preparing request for RPC SDNC Topology 'deactivate-DeleteNetworkInstance' rollback . . . - " + "\n" + sndcTopologyRollbackRpcRequestAsString)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareRpcSDNCActivateRollback() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -1226,7 +1229,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareRollbackData() of DoCreateNetworkInstance")
+ logger.trace("Inside prepareRollbackData() of DoCreateNetworkInstance")
try {
@@ -1250,14 +1253,14 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
}
execution.setVariable("rollbackData", rollbackData)
- msoLogger.debug("** rollbackData : " + rollbackData)
+ logger.debug("** rollbackData : " + rollbackData)
execution.setVariable("WorkflowException", execution.getVariable(Prefix + "WorkflowException"))
- msoLogger.debug("** WorkflowException : " + execution.getVariable("WorkflowException"))
+ logger.debug("** WorkflowException : " + execution.getVariable("WorkflowException"))
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareRollbackData() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -1268,7 +1271,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside postProcessResponse() of DoCreateNetworkInstance")
+ logger.trace("Inside postProcessResponse() of DoCreateNetworkInstance")
try {
@@ -1277,7 +1280,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
// 2. Success: execution.getVariable("WorkflowException") == null (NULL)
// 3. WorkflowException: execution.getVariable("WorkflowException") != null (NOT NULL)
- msoLogger.debug(" ***** Is Exception Encountered (isException)? : " + execution.getVariable(Prefix + "isException"))
+ logger.debug(" ***** Is Exception Encountered (isException)? : " + execution.getVariable(Prefix + "isException"))
// successful flow
if (execution.getVariable(Prefix + "isException") == false) {
// set rollback data
@@ -1287,14 +1290,14 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
prepareSuccessRollbackData(execution) // populate rollbackData
execution.setVariable("WorkflowException", null)
execution.setVariable(Prefix + "Success", true)
- msoLogger.debug(" ***** postProcessResponse(), GOOD !!!")
+ logger.debug(" ***** postProcessResponse(), GOOD !!!")
} else {
// inside sub-flow logic
execution.setVariable(Prefix + "Success", false)
execution.setVariable("rollbackData", null)
String exceptionMessage = " Exception encountered in MSO Bpmn. "
if (execution.getVariable("workflowException") != null) { // Output of Rollback flow.
- msoLogger.debug(" ***** workflowException: " + execution.getVariable("workflowException"))
+ logger.debug(" ***** workflowException: " + execution.getVariable("workflowException"))
WorkflowException wfex = execution.getVariable("workflowException")
exceptionMessage = wfex.getErrorMessage()
} else {
@@ -1304,18 +1307,18 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
}
// going to the Main flow: a-la-carte or macro
- msoLogger.debug(" ***** postProcessResponse(), BAD !!!")
+ logger.debug(" ***** postProcessResponse(), BAD !!!")
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
throw new BpmnError("MSOWorkflowException")
}
} catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. postProcessResponse() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
throw new BpmnError("MSOWorkflowException")
@@ -1329,7 +1332,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareSuccessRollbackData() of DoCreateNetworkInstance")
+ logger.trace("Inside prepareSuccessRollbackData() of DoCreateNetworkInstance")
try {
@@ -1361,13 +1364,13 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
execution.setVariable("rollbackData", rollbackData)
- msoLogger.debug("** 'rollbackData' for Full Rollback : " + rollbackData)
+ logger.debug("** 'rollbackData' for Full Rollback : " + rollbackData)
execution.setVariable("WorkflowException", null)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstance flow. prepareSuccessRollbackData() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -1378,7 +1381,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside setExceptionFlag() of DoCreateNetworkInstance")
+ logger.trace("Inside setExceptionFlag() of DoCreateNetworkInstance")
try {
@@ -1389,11 +1392,11 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
} else {
execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException"))
}
- msoLogger.debug(Prefix + "WorkflowException - " +execution.getVariable(Prefix + "WorkflowException"))
+ logger.debug(Prefix + "WorkflowException - " +execution.getVariable(Prefix + "WorkflowException"))
} catch(Exception ex){
String exceptionMessage = "Bpmn error encountered in DoCreateNetworkInstance flow. setExceptionFlag(): " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -1411,18 +1414,18 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
try{
- msoLogger.debug( "Caught a Java Exception in " + Prefix)
- msoLogger.debug("Started processJavaException Method")
- msoLogger.debug("Variables List: " + execution.getVariables())
+ logger.debug( "Caught a Java Exception in " + Prefix)
+ logger.debug("Started processJavaException Method")
+ logger.debug("Variables List: " + execution.getVariables())
execution.setVariable("UnexpectedError", "Caught a Java Lang Exception - " + Prefix) // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception")
}catch(Exception e){
- msoLogger.debug("Caught Exception during processJavaException Method: " + e)
+ logger.debug("Caught Exception during processJavaException Method: " + e)
execution.setVariable("UnexpectedError", "Exception in processJavaException method - " + Prefix) // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method" + Prefix)
}
- msoLogger.debug( "Completed processJavaException Method in " + Prefix)
+ logger.debug( "Completed processJavaException Method in " + Prefix)
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy
index fd6a4a1cde..c144dc0f46 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -25,7 +27,8 @@ import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.client.HttpClient
import org.onap.so.client.HttpClientFactory
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.common.scripts.NetworkUtils
@@ -43,7 +46,7 @@ import org.camunda.bpm.engine.delegate.DelegateExecution
*
*/
public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateNetworkInstanceRollback.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateNetworkInstanceRollback.class);
String Prefix="CRENWKIR_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -96,7 +99,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside preProcessRequest() of " + className + ".groovy")
+ logger.trace("Inside preProcessRequest() of " + className + ".groovy")
try {
// initialize flow variables
@@ -128,10 +131,10 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable(Prefix + "rollbackNetworkRequest", rollbackNetworkRequest)
execution.setVariable(Prefix + "rollbackSDNCRequest", rollbackSDNCRequest)
execution.setVariable(Prefix + "rollbackActivateSDNCRequest", rollbackActivateSDNCRequest)
- msoLogger.debug("'rollbackData': " + '\n' + execution.getVariable("rollbackData"))
+ logger.debug("'rollbackData': " + '\n' + execution.getVariable("rollbackData"))
String sdncVersion = execution.getVariable("sdncVersion")
- msoLogger.debug("sdncVersion? : " + sdncVersion)
+ logger.debug("sdncVersion? : " + sdncVersion)
// PO Authorization Info / headers Authorization=
String basicAuthValuePO = UrnPropertiesReader.getVariable("mso.adapters.po.auth",execution)
@@ -143,7 +146,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
} catch (IOException ex) {
String exceptionMessage = "Exception Encountered in DoCreateNetworkInstance, PreProcessRequest() - "
String dataErrorMessage = exceptionMessage + " Unable to encode PO/SDNC user/password string - " + ex.getMessage()
- msoLogger.debug(dataErrorMessage )
+ logger.debug(dataErrorMessage )
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
@@ -152,7 +155,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
} else {
execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException"))
}
- msoLogger.debug("*** WorkflowException : " + execution.getVariable(Prefix + "WorkflowException"))
+ logger.debug("*** WorkflowException : " + execution.getVariable(Prefix + "WorkflowException"))
if(execution.getVariable(Prefix + "WorkflowException") != null) {
// called by: DoCreateNetworkInstance, partial rollback
execution.setVariable(Prefix + "fullRollback", false)
@@ -162,7 +165,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable(Prefix + "fullRollback", true)
}
- msoLogger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback"))
+ logger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback"))
} catch (BpmnError e) {
@@ -171,7 +174,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
} catch (Exception ex) {
// caught exception
String exceptionMessage = "Exception Encountered in PreProcessRequest() of " + className + ".groovy ***** : " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -182,7 +185,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside callPONetworkAdapter() of " + className + "")
+ logger.trace("Inside callPONetworkAdapter() of " + className + "")
try {
String poUrl = UrnPropertiesReader.getVariable("mso.adapters.network.rest.endpoint",execution)
@@ -192,7 +195,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
String rollbackNetworkRequest = execution.getVariable(Prefix + "rollbackNetworkRequest")
String urlRollbackPoNetwork = poUrl+ "/" + networkId + "/rollback"
- msoLogger.debug("'urlRollbackPoNetwork': " + urlRollbackPoNetwork)
+ logger.debug("'urlRollbackPoNetwork': " + urlRollbackPoNetwork)
execution.setVariable(Prefix + "urlRollbackPoNetwork", urlRollbackPoNetwork)
URL url = new URL(urlRollbackPoNetwork)
@@ -202,12 +205,12 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable(Prefix + "rollbackNetworkReturnCode", response.getStatus())
- msoLogger.debug(" Network Adapter rollback responseCode: " + response.getStatus())
+ logger.debug(" Network Adapter rollback responseCode: " + response.getStatus())
} catch (Exception ex) {
String exceptionMessage = "Exception Encountered in callPONetworkAdapter() of DoCreateNetworkInstanceRollback flow - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -218,7 +221,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside validateRollbackResponses() of DoCreateNetworkInstanceRollback")
+ logger.trace("Inside validateRollbackResponses() of DoCreateNetworkInstanceRollback")
try {
// validate PO network rollback response
@@ -226,7 +229,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
String rollbackNetworkReturnCode = "200"
if (execution.getVariable(Prefix + "rollbackNetworkRequest") != null) {
rollbackNetworkReturnCode = execution.getVariable(Prefix + "rollbackNetworkReturnCode")
- msoLogger.debug(" NetworkRollback Code - " + rollbackNetworkReturnCode)
+ logger.debug(" NetworkRollback Code - " + rollbackNetworkReturnCode)
if (rollbackNetworkReturnCode != "200") {
rollbackNetworkErrorMessages = " + PO Network rollback failed. "
} else {
@@ -258,8 +261,8 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
} else {
rollbackSdncErrorMessages = " + SDNC assign rollback failed. "
}
- msoLogger.debug(" SDNC assign rollback Code - " + rollbackSDNCReturnCode)
- msoLogger.debug(" SDNC assign rollback Response - " + rollbackSDNCResponse)
+ logger.debug(" SDNC assign rollback Code - " + rollbackSDNCReturnCode)
+ logger.debug(" SDNC assign rollback Response - " + rollbackSDNCResponse)
}
// validate SDNC activate rollback response
@@ -285,14 +288,14 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
} else {
rollbackActivateSdncErrorMessages = " + SDNC activate rollback failed. "
}
- msoLogger.debug(" SDNC activate rollback Code - " + rollbackActivateSDNCReturnCode)
- msoLogger.debug(" SDNC activate rollback Response - " + rollbackActivateSDNCResponse)
+ logger.debug(" SDNC activate rollback Code - " + rollbackActivateSDNCReturnCode)
+ logger.debug(" SDNC activate rollback Response - " + rollbackActivateSDNCResponse)
}
String statusMessage = ""
int errorCode = 7000
- msoLogger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback"))
+ logger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback"))
if (execution.getVariable(Prefix + "fullRollback") == false) {
// original WorkflowException,
WorkflowException wfe = execution.getVariable(Prefix + "WorkflowException")
@@ -316,7 +319,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
}
statusMessage = statusMessage + rollbackActivateSdncErrorMessages + rollbackNetworkErrorMessages + rollbackSdncErrorMessages
- msoLogger.debug("Final DoCreateNetworkInstanceRollback status message: " + statusMessage)
+ logger.debug("Final DoCreateNetworkInstanceRollback status message: " + statusMessage)
String processKey = getProcessKey(execution);
WorkflowException exception = new WorkflowException(processKey, errorCode, statusMessage);
execution.setVariable("workflowException", exception);
@@ -329,7 +332,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable("rollbackError", false)
} else {
String exceptionMessage = "Network Create Rollback was not Successful. "
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
execution.setVariable("rollbackSuccessful", false)
execution.setVariable("rollbackError", true)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
@@ -342,7 +345,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
} catch (Exception ex) {
String errorMessage = "See Previous Camunda flows for cause of Error: Undetermined Exception."
String exceptionMessage = " Bpmn error encountered in DoCreateNetworkInstanceRollback flow. validateRollbackResponses() - " + errorMessage + ": " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -360,18 +363,18 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable("prefix",Prefix)
try{
- msoLogger.debug("Caught a Java Exception in " + Prefix)
- msoLogger.debug("Started processJavaException Method")
- msoLogger.debug("Variables List: " + execution.getVariables())
+ logger.debug("Caught a Java Exception in " + Prefix)
+ logger.debug("Started processJavaException Method")
+ logger.debug("Variables List: " + execution.getVariables())
execution.setVariable("UnexpectedError", "Caught a Java Lang Exception - " + Prefix) // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception")
}catch(Exception e){
- msoLogger.debug("Caught Exception during processJavaException Method: " + e)
+ logger.debug("Caught Exception during processJavaException Method: " + e)
execution.setVariable("UnexpectedError", "Exception in processJavaException method - " + Prefix) // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method" + Prefix)
}
- msoLogger.debug("Completed processJavaException Method in " + Prefix)
+ logger.debug("Completed processJavaException Method in " + Prefix)
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
index 6096f16b18..98def612de 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -39,7 +41,8 @@ import org.onap.so.bpmn.core.domain.ServiceDecomposition
import org.onap.so.bpmn.core.domain.VnfResource
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.common.resource.ResourceRequestBuilder
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
@@ -61,31 +64,31 @@ import org.onap.so.logger.MsoLogger
* @param - WorkflowException
*/
public class DoCreateResources extends AbstractServiceTaskProcessor{
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateResources.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateResources.class);
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
CatalogDbUtils catalogDbUtils = new CatalogDbUtilsFactory().create()
public void preProcessRequest(DelegateExecution execution) {
- msoLogger.trace("preProcessRequest ")
+ logger.trace("preProcessRequest ")
String msg = ""
List addResourceList = execution.getVariable("addResourceList")
if (addResourceList == null) {
msg = "Input addResourceList is null"
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
else if (addResourceList.size() == 0) {
msg = "No resource in addResourceList"
- msoLogger.info(msg)
+ logger.info(msg)
}
- msoLogger.trace("Exit preProcessRequest ")
+ logger.trace("Exit preProcessRequest ")
}
public void sequenceResoure(DelegateExecution execution) {
- msoLogger.trace("Start sequenceResoure Process ")
+ logger.trace("Start sequenceResoure Process ")
String incomingRequest = execution.getVariable("uuiRequest")
String serviceModelUuid = jsonUtil.getJsonValue(incomingRequest,"service.serviceUuid")
@@ -105,7 +108,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
// get Sequence from csar(model)
if(resourceSequence == null) {
resourceSequence = ResourceRequestBuilder.getResourceSequence(serviceModelUuid)
- msoLogger.info("Get Sequence from csar : " + resourceSequence)
+ logger.info("Get Sequence from csar : " + resourceSequence)
}
if(resourceSequence != null) {
@@ -151,13 +154,13 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
execution.setVariable("isContainsWanResource", isContainsWanResource)
execution.setVariable("currentResourceIndex", 0)
execution.setVariable("sequencedResourceList", sequencedResourceList)
- msoLogger.info("sequencedResourceList: " + sequencedResourceList)
- msoLogger.trace("COMPLETED sequenceResoure Process ")
+ logger.info("sequencedResourceList: " + sequencedResourceList)
+ logger.trace("COMPLETED sequenceResoure Process ")
}
public prepareServiceTopologyRequest(DelegateExecution execution) {
- msoLogger.trace("======== Start prepareServiceTopologyRequest Process ======== ")
+ logger.trace("======== Start prepareServiceTopologyRequest Process ======== ")
String serviceDecompose = execution.getVariable("serviceDecomposition")
@@ -172,21 +175,21 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
execution.setVariable("modelUuid", serviceUuid)
execution.setVariable("serviceModelName", serviceModelName)
- msoLogger.trace("======== End prepareServiceTopologyRequest Process ======== ")
+ logger.trace("======== End prepareServiceTopologyRequest Process ======== ")
}
public void getCurrentResoure(DelegateExecution execution){
- msoLogger.trace("Start getCurrentResoure Process ")
+ logger.trace("Start getCurrentResoure Process ")
def currentIndex = execution.getVariable("currentResourceIndex")
List<Resource> sequencedResourceList = execution.getVariable("sequencedResourceList")
Resource currentResource = sequencedResourceList.get(currentIndex)
execution.setVariable("resourceType", currentResource.getModelInfo().getModelName())
- msoLogger.info("Now we deal with resouce:" + currentResource.getModelInfo().getModelName())
- msoLogger.trace("COMPLETED getCurrentResoure Process ")
+ logger.info("Now we deal with resouce:" + currentResource.getModelInfo().getModelName())
+ logger.trace("COMPLETED getCurrentResoure Process ")
}
public void parseNextResource(DelegateExecution execution){
- msoLogger.trace("Start parseNextResource Process ")
+ logger.trace("Start parseNextResource Process ")
def currentIndex = execution.getVariable("currentResourceIndex")
def nextIndex = currentIndex + 1
execution.setVariable("currentResourceIndex", nextIndex)
@@ -196,17 +199,17 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
}else{
execution.setVariable("allResourceFinished", "false")
}
- msoLogger.trace("COMPLETED parseNextResource Process ")
+ logger.trace("COMPLETED parseNextResource Process ")
}
public void prepareResourceRecipeRequest(DelegateExecution execution){
- msoLogger.trace("Start prepareResourceRecipeRequest Process ")
+ logger.trace("Start prepareResourceRecipeRequest Process ")
ResourceInput resourceInput = new ResourceInput()
String serviceInstanceName = execution.getVariable("serviceInstanceName")
String resourceType = execution.getVariable("resourceType")
String resourceInstanceName = resourceType + "_" + serviceInstanceName
resourceInput.setResourceInstanceName(resourceInstanceName)
- msoLogger.info("Prepare Resource Request resourceInstanceName:" + resourceInstanceName)
+ logger.info("Prepare Resource Request resourceInstanceName:" + resourceInstanceName)
String globalSubscriberId = execution.getVariable("globalSubscriberId")
String serviceType = execution.getVariable("serviceType")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
@@ -234,11 +237,11 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
resourceInput.setRequestsInputs(incomingRequest)
execution.setVariable("resourceInput", resourceInput.toString())
execution.setVariable("resourceModelUUID", resourceInput.getResourceModelInfo().getModelUuid())
- msoLogger.trace("COMPLETED prepareResourceRecipeRequest Process ")
+ logger.trace("COMPLETED prepareResourceRecipeRequest Process ")
}
public void executeResourceRecipe(DelegateExecution execution){
- msoLogger.trace("Start executeResourceRecipe Process ")
+ logger.trace("Start executeResourceRecipe Process ")
try {
String requestId = execution.getVariable("msoRequestId")
@@ -261,16 +264,16 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
HttpResponse resp = bpmnRestClient.post(recipeURL, requestId, recipeTimeOut, requestAction, serviceInstanceId, serviceType, resourceInput, recipeParamXsd)
} else {
String exceptionMessage = "Resource receipe is not found for resource modeluuid: " + resourceModelUUID
- msoLogger.trace(exceptionMessage)
+ logger.trace(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, exceptionMessage)
}
- msoLogger.trace("======== end executeResourceRecipe Process ======== ")
+ logger.trace("======== end executeResourceRecipe Process ======== ")
}catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
}catch(Exception e){
- msoLogger.debug("Error occured within DoCreateResources executeResourceRecipe method: " + e)
+ logger.debug("Error occured within DoCreateResources executeResourceRecipe method: " + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured during DoCreateResources executeResourceRecipe Catalog")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
index c04bbd4806..163bd0f583 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -44,7 +46,8 @@ import org.onap.so.client.aai.AAIResourcesClient
import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
/**
* This groovy class supports the <class>DoCreateServiceInstance.bpmn</class> process.
@@ -74,7 +77,7 @@ import org.onap.so.logger.MsoLogger
*/
public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateServiceInstance.class);
String Prefix="DCRESI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
@@ -83,7 +86,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
String msg = ""
- msoLogger.trace("preProcessRequest")
+ logger.trace("preProcessRequest")
try {
String requestId = execution.getVariable("msoRequestId")
@@ -108,13 +111,13 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
if (isBlank(globalSubscriberId)) {
msg = "Input globalSubscriberId is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(subscriptionServiceType)) {
msg = "Input subscriptionServiceType is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
@@ -125,11 +128,11 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
String sdncCallbackUrl = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution)
if (isBlank(sdncCallbackUrl)) {
msg = "mso.workflow.sdncadapter.callback is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
- msoLogger.debug("SDNC Callback URL: " + sdncCallbackUrl)
+ logger.debug("SDNC Callback URL: " + sdncCallbackUrl)
//requestDetails.modelInfo.for AAI PUT servieInstanceData & SDNC assignTopology
String modelInvariantUuid = ""
@@ -146,7 +149,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
if (serviceDecomp != null)
{
serviceType = serviceDecomp.getServiceType() ?: ""
- msoLogger.debug("serviceType:" + serviceType)
+ logger.debug("serviceType:" + serviceType)
serviceRole = serviceDecomp.getServiceRole() ?: ""
ServiceInstance serviceInstance = serviceDecomp.getServiceInstance()
@@ -169,7 +172,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
else
{
msg = "Input serviceModelInfo is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
}
@@ -182,7 +185,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
String serviceModelInfo = execution.getVariable("serviceModelInfo")
if (isBlank(serviceModelInfo)) {
msg = "Input serviceModelInfo is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
modelInvariantUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelInvariantUuid") ?: ""
@@ -204,7 +207,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
//alacarte SIs are NOT sent to sdnc. exceptions are listed in config variable
String svcTypes = UrnPropertiesReader.getVariable("sdnc.si.svc.types",execution) ?: ""
- msoLogger.debug("SDNC SI serviceTypes:" + svcTypes)
+ logger.debug("SDNC SI serviceTypes:" + svcTypes)
List<String> svcList = Arrays.asList(svcTypes.split("\\s*,\\s*"));
boolean isSdncService= false
for (String listEntry : svcList){
@@ -225,15 +228,15 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
if (isBlank(execution.getVariable("serviceInstanceName" )))
{
msg = "Input serviceInstanceName must be provided for alacarte"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
}
}
- msoLogger.debug("isSdncService: " + isSdncService)
- msoLogger.debug("Send To SDNC: " + execution.getVariable("sendToSDNC"))
- msoLogger.debug("Service Type: " + execution.getVariable("serviceType"))
+ logger.debug("isSdncService: " + isSdncService)
+ logger.debug("Send To SDNC: " + execution.getVariable("sendToSDNC"))
+ logger.debug("Service Type: " + execution.getVariable("serviceType"))
//macro may provide name and alacarte-portm may provide name
execution.setVariable("checkAAI", false)
@@ -244,7 +247,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
if (isBlank(serviceInstanceId)){
msg = "Input serviceInstanceId is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
@@ -277,10 +280,10 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit preProcessRequest")
+ logger.trace("Exit preProcessRequest")
}
public void getAAICustomerById (DelegateExecution execution) {
@@ -288,7 +291,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
try {
String globalCustomerId = execution.getVariable("globalSubscriberId") //VID to AAI name map
- msoLogger.debug(" ***** getAAICustomerById ***** globalCustomerId:" + globalCustomerId)
+ logger.debug(" ***** getAAICustomerById ***** globalCustomerId:" + globalCustomerId)
AAIUri uri = AAIUriFactory.createResourceUri(AAIObjectType.CUSTOMER, globalCustomerId)
if(!getAAIClient().exists(uri)){
@@ -299,13 +302,13 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "Exception in getAAICustomerById. " + ex.getMessage())
}
- msoLogger.trace("Exit getAAICustomerById")
+ logger.trace("Exit getAAICustomerById")
}
public void putServiceInstance(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("putServiceInstance")
+ logger.trace("putServiceInstance")
String msg = ""
String serviceInstanceId = execution.getVariable("serviceInstanceId")
try {
@@ -326,17 +329,17 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
try{
String json = catalogDbUtils.getServiceResourcesByServiceModelInvariantUuidString(execution,modelInvariantUuid )
- msoLogger.debug("JSON IS: "+json)
+ logger.debug("JSON IS: "+json)
environmentContext = jsonUtil.getJsonValue(json, "serviceResources.environmentContext") ?: ""
workloadContext = jsonUtil.getJsonValue(json, "serviceResources.workloadContext") ?: ""
- msoLogger.debug("Env Context is: "+ environmentContext)
- msoLogger.debug("Workload Context is: "+ workloadContext)
+ logger.debug("Env Context is: "+ environmentContext)
+ logger.debug("Workload Context is: "+ workloadContext)
}catch(BpmnError e){
throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
@@ -371,16 +374,16 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
execution.setVariable("rollbackData", rollbackData)
msg = "Exception in DoCreateServiceInstance.putServiceInstance. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit putServiceInstance")
+ logger.trace("Exit putServiceInstance")
}
public void preProcessSDNCAssignRequest(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
String msg = ""
- msoLogger.trace("preProcessSDNCAssignRequest")
+ logger.trace("preProcessSDNCAssignRequest")
try {
def serviceInstanceId = execution.getVariable("serviceInstanceId")
@@ -448,10 +451,10 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
</sdncadapterworkflow:SDNCRequestData>
</sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
- msoLogger.debug("sdncAssignRequest:\n" + sdncAssignRequest)
+ logger.debug("sdncAssignRequest:\n" + sdncAssignRequest)
sdncAssignRequest = utils.formatXml(sdncAssignRequest)
execution.setVariable("sdncAssignRequest", sdncAssignRequest)
- msoLogger.debug("sdncAssignRequest: " + sdncAssignRequest)
+ logger.debug("sdncAssignRequest: " + sdncAssignRequest)
def sdncRequestId2 = UUID.randomUUID().toString()
String sdncDelete = sdncAssignRequest.replace(">assign<", ">delete<").replace(">CreateServiceInstance<", ">DeleteServiceInstance<").replace(">${sdncRequestId}<", ">${sdncRequestId2}<")
@@ -463,36 +466,36 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
rollbackData.put("SERVICEINSTANCE", "sdncDelete", sdncDelete)
execution.setVariable("rollbackData", rollbackData)
- msoLogger.debug("rollbackData:\n" + rollbackData.toString())
+ logger.debug("rollbackData:\n" + rollbackData.toString())
}
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in preProcessSDNCAssignRequest. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit preProcessSDNCAssignRequest")
+ logger.trace("Exit preProcessSDNCAssignRequest")
}
public void postProcessSDNCAssign (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("postProcessSDNCAssign")
+ logger.trace("postProcessSDNCAssign")
try {
WorkflowException workflowException = execution.getVariable("WorkflowException")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
String response = execution.getVariable("sdncAdapterResponse")
- msoLogger.debug("SDNCResponse: " + response)
+ logger.debug("SDNCResponse: " + response)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
- msoLogger.debug("Good response from SDNC Adapter for service-instance topology assign: \n" + response)
+ logger.debug("Good response from SDNC Adapter for service-instance topology assign: \n" + response)
def rollbackData = execution.getVariable("rollbackData")
if (rollbackData != null) {
@@ -501,7 +504,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
}
}else{
- msoLogger.debug("Bad Response from SDNC Adapter for service-instance assign")
+ logger.debug("Bad Response from SDNC Adapter for service-instance assign")
throw new BpmnError("MSOWorkflowException")
}
@@ -509,31 +512,31 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
throw e;
} catch(Exception ex) {
msg = "Exception in postProcessSDNCAssign. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit postProcessSDNCAssign")
+ logger.trace("Exit postProcessSDNCAssign")
}
public void postProcessAAIGET2(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("postProcessAAIGET2")
+ logger.trace("postProcessAAIGET2")
String msg = ""
try {
String serviceInstanceName = execution.getVariable("serviceInstanceName")
boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
if(!succInAAI){
- msoLogger.debug("Error getting Service-instance from AAI in postProcessAAIGET2", + serviceInstanceName)
+ logger.debug("Error getting Service-instance from AAI in postProcessAAIGET2", + serviceInstanceName)
WorkflowException workflowException = execution.getVariable("WorkflowException")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
if(workflowException != null){
exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
}
else
{
msg = "Failure in postProcessAAIGET2 GENGS_SuccessIndicator:" + succInAAI
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
}
}
@@ -544,7 +547,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
String aaiService = execution.getVariable("GENGS_service")
if (!isBlank(aaiService) && (utils.nodeExists(aaiService, "service-instance-name"))) {
execution.setVariable("serviceInstanceName", utils.getNodeText(aaiService, "service-instance-name"))
- msoLogger.debug("Found Service-instance in AAI.serviceInstanceName:" + execution.getVariable("serviceInstanceName"))
+ logger.debug("Found Service-instance in AAI.serviceInstanceName:" + execution.getVariable("serviceInstanceName"))
}
}
}
@@ -552,94 +555,94 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
throw e;
} catch (Exception ex) {
msg = "Exception in DoCreateServiceInstance.postProcessAAIGET2 " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit postProcessAAIGET2")
+ logger.trace("Exit postProcessAAIGET2")
}
public void preProcessRollback (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("preProcessRollback")
+ logger.trace("preProcessRollback")
try {
Object workflowException = execution.getVariable("WorkflowException");
if (workflowException instanceof WorkflowException) {
- msoLogger.debug("Prev workflowException: " + workflowException.getErrorMessage())
+ logger.debug("Prev workflowException: " + workflowException.getErrorMessage())
execution.setVariable("prevWorkflowException", workflowException);
//execution.setVariable("WorkflowException", null);
}
} catch (BpmnError e) {
- msoLogger.debug("BPMN Error during preProcessRollback")
+ logger.debug("BPMN Error during preProcessRollback")
} catch(Exception ex) {
String msg = "Exception in preProcessRollback. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
- msoLogger.trace("Exit preProcessRollback")
+ logger.trace("Exit preProcessRollback")
}
public void postProcessRollback (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("postProcessRollback")
+ logger.trace("postProcessRollback")
String msg = ""
try {
Object workflowException = execution.getVariable("prevWorkflowException");
if (workflowException instanceof WorkflowException) {
- msoLogger.debug("Setting prevException to WorkflowException: ")
+ logger.debug("Setting prevException to WorkflowException: ")
execution.setVariable("WorkflowException", workflowException);
}
execution.setVariable("rollbackData", null)
} catch (BpmnError b) {
- msoLogger.debug("BPMN Error during postProcessRollback")
+ logger.debug("BPMN Error during postProcessRollback")
throw b;
} catch(Exception ex) {
msg = "Exception in postProcessRollback. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
- msoLogger.trace("Exit postProcessRollback")
+ logger.trace("Exit postProcessRollback")
}
public void createProject(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("createProject")
+ logger.trace("createProject")
String bpmnRequest = execution.getVariable("requestJson")
String projectName = jsonUtil.getJsonValue(bpmnRequest, "requestDetails.project.projectName")
String serviceInstance = execution.getVariable("serviceInstanceId")
- msoLogger.debug("BPMN REQUEST IS: "+ bpmnRequest)
- msoLogger.debug("PROJECT NAME: " + projectName)
- msoLogger.debug("Service Instance: " + serviceInstance)
+ logger.debug("BPMN REQUEST IS: "+ bpmnRequest)
+ logger.debug("PROJECT NAME: " + projectName)
+ logger.debug("Service Instance: " + serviceInstance)
if(projectName == null||projectName.equals("")){
- msoLogger.debug("Project Name was not found in input. Skipping task...")
+ logger.debug("Project Name was not found in input. Skipping task...")
}else{
try{
AAICreateResources aaiCR = new AAICreateResources()
aaiCR.createAAIProject(projectName, serviceInstance)
}catch(Exception ex){
String msg = "Exception in createProject. " + ex.getMessage();
- msoLogger.debug(msg)
- msoLogger.error(ex);
+ logger.debug(msg)
+ logger.error(ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
- msoLogger.trace("Exit createProject")
+ logger.trace("Exit createProject")
}
public void createOwningEntity(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("createOwningEntity")
+ logger.trace("createOwningEntity")
String msg = "";
String bpmnRequest = execution.getVariable("requestJson")
String owningEntityId = jsonUtil.getJsonValue(bpmnRequest, "requestDetails.owningEntity.owningEntityId")
String owningEntityName = jsonUtil.getJsonValue(bpmnRequest,"requestDetails.owningEntity.owningEntityName");
String serviceInstance = execution.getVariable("serviceInstanceId")
- msoLogger.debug("owningEntity: " + owningEntityId)
- msoLogger.debug("OwningEntityName: "+ owningEntityName)
- msoLogger.debug("Service Instance: " + serviceInstance)
+ logger.debug("owningEntity: " + owningEntityId)
+ logger.debug("OwningEntityName: "+ owningEntityName)
+ logger.debug("Service Instance: " + serviceInstance)
try{
AAICreateResources aaiCR = new AAICreateResources()
@@ -665,11 +668,11 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
}
}
}catch(Exception ex){
- msoLogger.debug(msg)
- msoLogger.error(ex);
+ logger.debug(msg)
+ logger.error(ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit createOwningEntity")
+ logger.trace("Exit createOwningEntity")
}
// *******************************
@@ -680,18 +683,18 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
try{
- msoLogger.debug("Caught a Java Exception in DoCreateServiceInstance")
- msoLogger.debug("Started processJavaException Method")
- msoLogger.debug("Variables List: " + execution.getVariables())
+ logger.debug("Caught a Java Exception in DoCreateServiceInstance")
+ logger.debug("Started processJavaException Method")
+ logger.debug("Variables List: " + execution.getVariables())
execution.setVariable("UnexpectedError", "Caught a Java Lang Exception in DoCreateServiceInstance") // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception in DoCreateServiceInstance")
}catch(Exception e){
- msoLogger.debug("Caught Exception during processJavaException Method: " + e)
+ logger.debug("Caught Exception during processJavaException Method: " + e)
execution.setVariable("UnexpectedError", "Exception in processJavaException") // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method")
}
- msoLogger.trace("Completed processJavaException Method in DoCreateServiceInstance")
+ logger.trace("Completed processJavaException Method in DoCreateServiceInstance")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy
index e80941e212..a337087105 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -30,8 +32,8 @@ import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
import org.onap.so.bpmn.core.RollbackData
import org.onap.so.bpmn.core.WorkflowException
-import org.onap.so.logger.MsoLogger
-import org.onap.so.logger.MessageEnum
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import java.util.UUID;
@@ -62,7 +64,7 @@ import org.springframework.web.util.UriUtils;
*
*/
public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcessor{
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateServiceInstanceRollback.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateServiceInstanceRollback.class);
String Prefix="DCRESIRB_"
@@ -71,13 +73,13 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
String msg = ""
- msoLogger.trace("preProcessRequest")
+ logger.trace("preProcessRequest")
execution.setVariable("rollbackAAI",false)
execution.setVariable("rollbackSDNC",false)
try {
def rollbackData = execution.getVariable("rollbackData")
- msoLogger.debug("RollbackData:" + rollbackData)
+ logger.debug("RollbackData:" + rollbackData)
if (rollbackData != null) {
if (rollbackData.hasType("SERVICEINSTANCE")) {
@@ -112,8 +114,8 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable("sdncDelete", sdncDelete)
def sdncDeactivate = rollbackData.get("SERVICEINSTANCE", "sdncDeactivate")
execution.setVariable("sdncDeactivate", sdncDeactivate)
- msoLogger.debug("sdncDeactivate:\n" + sdncDeactivate)
- msoLogger.debug("sdncDelete:\n" + sdncDelete)
+ logger.debug("sdncDeactivate:\n" + sdncDeactivate)
+ logger.debug("sdncDelete:\n" + sdncDelete)
}
else {
execution.setVariable("skipRollback", true)
@@ -131,48 +133,48 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
throw e;
} catch (Exception ex){
msg = "Exception in Create ServiceInstance Rollback preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit preProcessRequest")
+ logger.trace("Exit preProcessRequest")
}
public void validateSDNCResponse(DelegateExecution execution, String response, String method) {
- msoLogger.trace("validateSDNCResponse")
+ logger.trace("validateSDNCResponse")
String msg = ""
try {
WorkflowException workflowException = execution.getVariable("WorkflowException")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.debug("SDNCResponse: " + response)
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("SDNCResponse: " + response)
+ logger.debug("workflowException: " + workflowException)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
msg = "SDNC Adapter service-instance rollback successful for " + method
- msoLogger.debug(msg)
+ logger.debug(msg)
}else{
execution.setVariable("rolledBack", false)
msg = "Error Response from SDNC Adapter service-instance rollback for " + method
execution.setVariable("rollbackError", msg)
- msoLogger.debug(msg)
+ logger.debug(msg)
throw new BpmnError("MSOWorkflowException")
}
} catch (BpmnError e) {
throw e;
} catch (Exception ex){
msg = "Exception in Create ServiceInstance rollback for " + method + " Exception:" + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit validateSDNCResponse")
+ logger.trace("Exit validateSDNCResponse")
}
public void postProcessRequest(DelegateExecution execution) {
- msoLogger.trace("postProcessRequest")
+ logger.trace("postProcessRequest")
String msg = ""
try {
execution.setVariable("rollbackData", null)
@@ -189,51 +191,51 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
if(!succInAAI){
execution.setVariable("rolledBack", false) //both sdnc and aai must be successful to declare rollback Succesful
execution.setVariable("rollbackError", "Error deleting service-instance in AAI for rollback")
- msoLogger.debug("Error deleting service-instance in AAI for rollback", + serviceInstanceId)
+ logger.debug("Error deleting service-instance in AAI for rollback", + serviceInstanceId)
}
}
- msoLogger.trace("Exit postProcessRequest")
+ logger.trace("Exit postProcessRequest")
} catch (BpmnError e) {
msg = "Exception in Create ServiceInstance Rollback postProcessRequest. " + e.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
} catch (Exception ex) {
msg = "Exception in Create ServiceInstance Rollback postProcessRequest. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
}
public void processRollbackException(DelegateExecution execution){
- msoLogger.trace("processRollbackException")
+ logger.trace("processRollbackException")
try{
- msoLogger.debug("Caught an Exception in DoCreateServiceInstanceRollback")
+ logger.debug("Caught an Exception in DoCreateServiceInstanceRollback")
execution.setVariable("rollbackData", null)
execution.setVariable("rollbackError", "Caught exception in ServiceInstance Create Rollback")
execution.setVariable("WorkflowException", null)
}catch(BpmnError b){
- msoLogger.debug("BPMN Error during processRollbackExceptions Method: ")
+ logger.debug("BPMN Error during processRollbackExceptions Method: ")
}catch(Exception e){
- msoLogger.debug("Caught Exception during processRollbackExceptions Method: " + e.getMessage())
+ logger.debug("Caught Exception during processRollbackExceptions Method: " + e.getMessage())
}
- msoLogger.debug("Exit processRollbackException")
+ logger.debug("Exit processRollbackException")
}
public void processRollbackJavaException(DelegateExecution execution){
- msoLogger.trace("processRollbackJavaException")
+ logger.trace("processRollbackJavaException")
try{
execution.setVariable("rollbackData", null)
execution.setVariable("rollbackError", "Caught Java exception in ServiceInstance Create Rollback")
- msoLogger.debug("Caught Exception in processRollbackJavaException")
+ logger.debug("Caught Exception in processRollbackJavaException")
}catch(Exception e){
- msoLogger.debug("Caught Exception in processRollbackJavaException " + e.getMessage())
+ logger.debug("Caught Exception in processRollbackJavaException " + e.getMessage())
}
- msoLogger.trace("Exit processRollbackJavaException")
+ logger.trace("Exit processRollbackJavaException")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy
index 33d0e25d7d..b17b0a37b7 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -32,6 +34,8 @@ import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.client.HttpClient
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.utils.TargetEntity
@@ -43,7 +47,7 @@ import javax.ws.rs.core.Response
* flow for VFC Network Service Create
*/
public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateVFCNetworkServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateVFCNetworkServiceInstance.class);
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -58,23 +62,23 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
*/
public void preProcessRequest (DelegateExecution execution) {
String msg = ""
- msoLogger.trace("preProcessRequest()")
+ logger.trace("preProcessRequest()")
try {
//deal with nsName and Description
String nsServiceName = execution.getVariable("nsServiceName")
String nsServiceDescription = execution.getVariable("nsServiceDescription")
- msoLogger.debug("nsServiceName:" + nsServiceName + " nsServiceDescription:" + nsServiceDescription)
+ logger.debug("nsServiceName:" + nsServiceName + " nsServiceDescription:" + nsServiceDescription)
//deal with operation key
String globalSubscriberId = execution.getVariable("globalSubscriberId")
- msoLogger.debug("globalSubscriberId:" + globalSubscriberId)
+ logger.debug("globalSubscriberId:" + globalSubscriberId)
String serviceType = execution.getVariable("serviceType")
- msoLogger.debug("serviceType:" + serviceType)
+ logger.debug("serviceType:" + serviceType)
String serviceId = execution.getVariable("serviceId")
- msoLogger.debug("serviceId:" + serviceId)
+ logger.debug("serviceId:" + serviceId)
String operationId = execution.getVariable("operationId")
- msoLogger.debug("serviceType:" + serviceType)
+ logger.debug("serviceType:" + serviceType)
String nodeTemplateUUID = execution.getVariable("resourceUUID")
- msoLogger.debug("nodeTemplateUUID:" + nodeTemplateUUID)
+ logger.debug("nodeTemplateUUID:" + nodeTemplateUUID)
/*
* segmentInformation needed as a object of segment
* {
@@ -87,7 +91,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
* }
*/
String nsParameters = execution.getVariable("resourceParameters")
- msoLogger.debug("nsParameters:" + nsParameters)
+ logger.debug("nsParameters:" + nsParameters)
String nsOperationKey = """{
"globalSubscriberId":"${globalSubscriberId}",
"serviceType":"${serviceType}",
@@ -102,7 +106,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
if (vfcAdapterUrl == null || vfcAdapterUrl.isEmpty()) {
msg = getProcessKey(execution) + ': mso:adapters:vfcc:rest:endpoint URN mapping is not defined'
- msoLogger.debug(msg)
+ logger.debug(msg)
}
while (vfcAdapterUrl.endsWith('/')) {
@@ -116,17 +120,17 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit preProcessRequest")
+ logger.trace("Exit preProcessRequest")
}
/**
* create NS task
*/
public void createNetworkService(DelegateExecution execution) {
- msoLogger.trace("createNetworkService")
+ logger.trace("createNetworkService")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
String nsOperationKey = execution.getVariable("nsOperationKey");
String nsParameters = execution.getVariable("nsParameters");
@@ -146,14 +150,14 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
nsInstanceId = jsonUtil.getJsonValue(aaiResponseAsString, "nsInstanceId")
}
execution.setVariable("nsInstanceId", nsInstanceId)
- msoLogger.trace("Exit createNetworkService")
+ logger.trace("Exit createNetworkService")
}
/**
* instantiate NS task
*/
public void instantiateNetworkService(DelegateExecution execution) {
- msoLogger.trace("instantiateNetworkService")
+ logger.trace("instantiateNetworkService")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
String nsOperationKey = execution.getVariable("nsOperationKey");
String nsParameters = execution.getVariable("nsParameters");
@@ -175,14 +179,14 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
jobId = jsonUtil.getJsonValue(aaiResponseAsString, "jobId")
}
execution.setVariable("jobId", jobId)
- msoLogger.trace("Exit instantiateNetworkService")
+ logger.trace("Exit instantiateNetworkService")
}
/**
* query NS task
*/
public void queryNSProgress(DelegateExecution execution) {
- msoLogger.trace("queryNSProgress")
+ logger.trace("queryNSProgress")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
String jobId = execution.getVariable("jobId")
String nsOperationKey = execution.getVariable("nsOperationKey");
@@ -195,7 +199,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
operationStatus = jsonUtil.getJsonValue(aaiResponseAsString, "responseDescriptor.status")
}
execution.setVariable("operationStatus", operationStatus)
- msoLogger.trace("Exit queryNSProgress")
+ logger.trace("Exit queryNSProgress")
}
/**
@@ -205,7 +209,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
try {
Thread.sleep(5000);
} catch(InterruptedException e) {
- msoLogger.debug("Time Delay exception" + e )
+ logger.debug("Time Delay exception" + e )
}
}
@@ -213,10 +217,10 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
* finish NS task
*/
public void addNSRelationship(DelegateExecution execution) {
- msoLogger.trace("addNSRelationship")
+ logger.trace("addNSRelationship")
String nsInstanceId = execution.getVariable("nsInstanceId")
if(nsInstanceId == null || nsInstanceId == ""){
- msoLogger.debug(" create NS failed, so do not need to add relationship")
+ logger.debug(" create NS failed, so do not need to add relationship")
return
}
String globalSubscriberId = execution.getVariable("globalSubscriberId")
@@ -228,9 +232,11 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
try{
getAAIClient().connect(nsUri,relatedServiceUri)
- msoLogger.info("NS relationship to Service added successfully")
+ logger.info("NS relationship to Service added successfully")
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception occured while executing AAI Put Call", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception occured while executing AAI Put Call", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
throw new BpmnError("MSOWorkflowException")
}
}
@@ -241,8 +247,8 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
* requestBody: the body of the request
*/
private Response postRequest(DelegateExecution execution, String urlString, String requestBody){
- msoLogger.trace("Started Execute VFC adapter Post Process")
- msoLogger.debug("url:"+urlString +"\nrequestBody:"+ requestBody)
+ logger.trace("Started Execute VFC adapter Post Process")
+ logger.debug("url:"+urlString +"\nrequestBody:"+ requestBody)
Response apiResponse = null
try{
@@ -257,10 +263,10 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
apiResponse = httpClient.post(requestBody)
- msoLogger.debug("response code:"+ apiResponse.getStatus() +"\nresponse body:"+ apiResponse.readEntity(String.class))
- msoLogger.trace("Completed Execute VF-C adapter Post Process")
+ logger.debug("response code:"+ apiResponse.getStatus() +"\nresponse body:"+ apiResponse.readEntity(String.class))
+ logger.trace("Completed Execute VF-C adapter Post Process")
}catch(Exception e){
- msoLogger.error("Exception occured while executing VFC Adapter Post Call" + e.getMessage ());
+ logger.error("Exception occured while executing VFC Adapter Post Call" + e.getMessage ());
throw new BpmnError("MSOWorkflowException")
}
return apiResponse
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy
index 53e3525036..9ee8ff8b67 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -61,6 +63,8 @@ import org.onap.so.constants.Defaults
import org.onap.so.db.catalog.beans.HomingInstance
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.onap.so.utils.TargetEntity
import org.w3c.dom.Document
@@ -75,7 +79,7 @@ import com.fasterxml.jackson.databind.ObjectMapper
public class DoCreateVfModule extends VfModuleBase {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateVfModule.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateVfModule.class);
String Prefix="DCVFM_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -95,7 +99,7 @@ public class DoCreateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable('prefix', Prefix)
try{
@@ -116,9 +120,9 @@ public class DoCreateVfModule extends VfModuleBase {
String vfModuleModelInfo = execution.getVariable("vfModuleModelInfo")
def serviceModelInfo = execution.getVariable("serviceModelInfo")
- msoLogger.debug("serviceModelInfo: " + serviceModelInfo)
+ logger.debug("serviceModelInfo: " + serviceModelInfo)
String modelInvariantUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelInvariantUuid")
- msoLogger.debug("modelInvariantUuid: " + modelInvariantUuid)
+ logger.debug("modelInvariantUuid: " + modelInvariantUuid)
def vnfModelInfo = execution.getVariable("vnfModelInfo")
@@ -136,66 +140,66 @@ public class DoCreateVfModule extends VfModuleBase {
def cloudSiteId = execution.getVariable("lcpCloudRegionId")
execution.setVariable("DCVFM_cloudSiteId", cloudSiteId)
rollbackData.put("VFMODULE", "aiccloudregion", cloudSiteId)
- msoLogger.debug("cloudSiteId: " + cloudSiteId)
+ logger.debug("cloudSiteId: " + cloudSiteId)
//cloudOwner
def cloudOwner = execution.getVariable("cloudOwner")
execution.setVariable("DCVFM_cloudOwner", cloudOwner)
rollbackData.put("VFMODULE", "cloudOwner", cloudOwner)
- msoLogger.debug("cloudOwner: " + cloudOwner)
+ logger.debug("cloudOwner: " + cloudOwner)
//vnfType
def vnfType = execution.getVariable("vnfType")
execution.setVariable("DCVFM_vnfType", vnfType)
rollbackData.put("VFMODULE", "vnftype", vnfType)
- msoLogger.debug("vnfType: " + vnfType)
+ logger.debug("vnfType: " + vnfType)
//vnfName
def vnfName = execution.getVariable("vnfName")
execution.setVariable("DCVFM_vnfName", vnfName)
rollbackData.put("VFMODULE", "vnfname", vnfName)
- msoLogger.debug("vnfName: " + vnfName)
+ logger.debug("vnfName: " + vnfName)
//vnfId
def vnfId = execution.getVariable("vnfId")
execution.setVariable("DCVFM_vnfId", vnfId)
rollbackData.put("VFMODULE", "vnfid", vnfId)
- msoLogger.debug("vnfId: " + vnfId)
+ logger.debug("vnfId: " + vnfId)
//vfModuleName
def vfModuleName = execution.getVariable("vfModuleName")
execution.setVariable("DCVFM_vfModuleName", vfModuleName)
rollbackData.put("VFMODULE", "vfmodulename", vfModuleName)
- msoLogger.debug("vfModuleName: " + vfModuleName)
+ logger.debug("vfModuleName: " + vfModuleName)
//vfModuleModelName
def vfModuleModelName = jsonUtil.getJsonValue(vfModuleModelInfo, "modelName")
execution.setVariable("DCVFM_vfModuleModelName", vfModuleModelName)
rollbackData.put("VFMODULE", "vfmodulemodelname", vfModuleModelName)
- msoLogger.debug("vfModuleModelName: " + vfModuleModelName)
+ logger.debug("vfModuleModelName: " + vfModuleModelName)
//modelCustomizationUuid
def modelCustomizationUuid = jsonUtil.getJsonValue(vfModuleModelInfo, "modelCustomizationUuid")
execution.setVariable("DCVFM_modelCustomizationUuid", modelCustomizationUuid)
rollbackData.put("VFMODULE", "modelcustomizationuuid", modelCustomizationUuid)
- msoLogger.debug("modelCustomizationUuid: " + modelCustomizationUuid)
+ logger.debug("modelCustomizationUuid: " + modelCustomizationUuid)
//vfModuleId
def vfModuleId = execution.getVariable("vfModuleId")
execution.setVariable("DCVFM_vfModuleId", vfModuleId)
- msoLogger.debug("vfModuleId: " + vfModuleId)
+ logger.debug("vfModuleId: " + vfModuleId)
def requestId = execution.getVariable("msoRequestId")
execution.setVariable("DCVFM_requestId", requestId)
- msoLogger.debug("requestId: " + requestId)
+ logger.debug("requestId: " + requestId)
rollbackData.put("VFMODULE", "msorequestid", requestId)
// Set mso-request-id to request-id for VNF Adapter interface
execution.setVariable("mso-request-id", requestId)
//serviceId
def serviceId = execution.getVariable("serviceId")
execution.setVariable("DCVFM_serviceId", serviceId)
- msoLogger.debug("serviceId: " + serviceId)
+ logger.debug("serviceId: " + serviceId)
//serviceInstanceId
def serviceInstanceId = execution.getVariable("serviceInstanceId")
execution.setVariable("DCVFM_serviceInstanceId", serviceInstanceId)
rollbackData.put("VFMODULE", "serviceInstanceId", serviceInstanceId)
- msoLogger.debug("serviceInstanceId: " + serviceInstanceId)
+ logger.debug("serviceInstanceId: " + serviceInstanceId)
//source - HARDCODED
def source = "VID"
execution.setVariable("DCVFM_source", source)
rollbackData.put("VFMODULE", "source", source)
- msoLogger.debug("source: " + source)
+ logger.debug("source: " + source)
//backoutOnFailure
def disableRollback = execution.getVariable("disableRollback")
def backoutOnFailure = true
@@ -203,15 +207,15 @@ public class DoCreateVfModule extends VfModuleBase {
backoutOnFailure = false
}
execution.setVariable("DCVFM_backoutOnFailure", backoutOnFailure)
- msoLogger.debug("backoutOnFailure: " + backoutOnFailure)
+ logger.debug("backoutOnFailure: " + backoutOnFailure)
//isBaseVfModule
def isBaseVfModule = execution.getVariable("isBaseVfModule")
execution.setVariable("DCVFM_isBaseVfModule", isBaseVfModule)
- msoLogger.debug("isBaseVfModule: " + isBaseVfModule)
+ logger.debug("isBaseVfModule: " + isBaseVfModule)
//asdcServiceModelVersion
def asdcServiceModelVersion = execution.getVariable("asdcServiceModelVersion")
execution.setVariable("DCVFM_asdcServiceModelVersion", asdcServiceModelVersion)
- msoLogger.debug("asdcServiceModelVersion: " + asdcServiceModelVersion)
+ logger.debug("asdcServiceModelVersion: " + asdcServiceModelVersion)
//personaModelId
execution.setVariable("DCVFM_personaModelId", jsonUtil.getJsonValue(vfModuleModelInfo, "modelInvariantUuid"))
//personaModelVersion
@@ -220,15 +224,15 @@ public class DoCreateVfModule extends VfModuleBase {
def vfModuleLabel = execution.getVariable("vfModuleLabel")
if (vfModuleLabel != null) {
execution.setVariable("DCVFM_vfModuleLabel", vfModuleLabel)
- msoLogger.debug("vfModuleLabel: " + vfModuleLabel)
+ logger.debug("vfModuleLabel: " + vfModuleLabel)
}
//Get or Generate UUID
String uuid = execution.getVariable("DCVFM_uuid")
if(uuid == null){
uuid = UUID.randomUUID()
- msoLogger.debug("Generated messageId (UUID) is: " + uuid)
+ logger.debug("Generated messageId (UUID) is: " + uuid)
}else{
- msoLogger.debug("Found messageId (UUID) is: " + uuid)
+ logger.debug("Found messageId (UUID) is: " + uuid)
}
//isVidRequest
String isVidRequest = execution.getVariable("isVidRequest")
@@ -239,7 +243,7 @@ public class DoCreateVfModule extends VfModuleBase {
//globalSubscriberId
String globalSubscriberId = execution.getVariable("globalSubscriberId")
execution.setVariable("DCVFM_globalSubscriberId", globalSubscriberId)
- msoLogger.debug("globalSubsrciberId: " + globalSubscriberId)
+ logger.debug("globalSubsrciberId: " + globalSubscriberId)
// Set Homing Info
String oofDirectives = null
@@ -248,26 +252,26 @@ public class DoCreateVfModule extends VfModuleBase {
if (homingInstance != null) {
execution.setVariable("DCVFM_cloudSiteId", homingInstance.getCloudRegionId())
rollbackData.put("VFMODULE", "aiccloudregion", homingInstance.getCloudRegionId())
- msoLogger.debug("Overwriting cloudSiteId with homing cloudSiteId: " +
+ logger.debug("Overwriting cloudSiteId with homing cloudSiteId: " +
homingInstance.getCloudRegionId())
execution.setVariable("DCVFM_cloudOwner", homingInstance.getCloudOwner())
rollbackData.put("VFMODULE", "cloudOwner", homingInstance.getCloudOwner())
- msoLogger.debug("Overwriting cloudOwner with homing cloudOwner: " +
+ logger.debug("Overwriting cloudOwner with homing cloudOwner: " +
homingInstance.getCloudOwner())
oofDirectives = homingInstance.getOofDirectives()
execution.setVariable("DCVFM_oofDirectives", oofDirectives)
}
} catch (Exception exception) {
- msoLogger.debug("Could not find homing information for service instance: " + serviceInstanceId +
+ logger.debug("Could not find homing information for service instance: " + serviceInstanceId +
"... continuing")
- msoLogger.debug("Could not find homing information for service instance error: " + exception)
+ logger.debug("Could not find homing information for service instance error: " + exception)
}
//OofDirectives to Input Params
Map<String,String> vfModuleInputParams = execution.getVariable("vfModuleInputParams")
if (oofDirectives != null && vfModuleInputParams != null) {
vfModuleInputParams.put("oof_directives", oofDirectives)
vfModuleInputParams.put("sdnc_directives", "{}")
- msoLogger.debug("OofDirectives are: " + oofDirectives)
+ logger.debug("OofDirectives are: " + oofDirectives)
} else if (vfModuleInputParams != null) {
vfModuleInputParams.put("oof_directives", "{}")
vfModuleInputParams.put("sdnc_directives", "{}")
@@ -279,11 +283,11 @@ public class DoCreateVfModule extends VfModuleBase {
//usePreload
def usePreload = execution.getVariable("usePreload")
execution.setVariable("DCVFM_usePreload", usePreload)
- msoLogger.debug("usePreload: " + usePreload)
+ logger.debug("usePreload: " + usePreload)
//aLaCarte
def aLaCarte = execution.getVariable("aLaCarte")
execution.setVariable("DCVFM_aLaCarte", aLaCarte)
- msoLogger.debug("aLaCarte: " + aLaCarte)
+ logger.debug("aLaCarte: " + aLaCarte)
//get workload and environment context from parent SI
String environmentContext = ""
@@ -297,7 +301,7 @@ public class DoCreateVfModule extends VfModuleBase {
throw e
} catch (Exception ex){
String msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
@@ -310,7 +314,7 @@ public class DoCreateVfModule extends VfModuleBase {
workloadContext = aaiJson.getOrDefault("workload-context","")
}catch (Exception ex) {
- msoLogger.debug("Error retreiving parent service instance information")
+ logger.debug("Error retreiving parent service instance information")
}
execution.setVariable("DCVFM_environmentContext",environmentContext)
@@ -319,7 +323,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
else {
// The info is inside the request - DEAD CODE
- msoLogger.debug("DoCreateVfModule request: " + request)
+ logger.debug("DoCreateVfModule request: " + request)
//tenantId
def tenantId = ""
@@ -347,7 +351,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
execution.setVariable("DCVFM_cloudSiteId", cloudSiteId)
rollbackData.put("VFMODULE", "aiccloudregion", cloudSiteId)
- msoLogger.debug("cloudSiteId: " + cloudSiteId)
+ logger.debug("cloudSiteId: " + cloudSiteId)
//vnfType
def vnfType = ""
if (utils.nodeExists(request, "vnf-type")) {
@@ -355,7 +359,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
execution.setVariable("DCVFM_vnfType", vnfType)
rollbackData.put("VFMODULE", "vnftype", vnfType)
- msoLogger.debug("vnfType: " + vnfType)
+ logger.debug("vnfType: " + vnfType)
//vnfName
def vnfName = ""
if (utils.nodeExists(request, "vnf-name")) {
@@ -363,7 +367,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
execution.setVariable("DCVFM_vnfName", vnfName)
rollbackData.put("VFMODULE", "vnfname", vnfName)
- msoLogger.debug("vnfName: " + vnfName)
+ logger.debug("vnfName: " + vnfName)
//vnfId
def vnfId = ""
if (utils.nodeExists(request, "vnf-id")) {
@@ -371,7 +375,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
execution.setVariable("DCVFM_vnfId", vnfId)
rollbackData.put("VFMODULE", "vnfid", vnfId)
- msoLogger.debug("vnfId: " + vnfId)
+ logger.debug("vnfId: " + vnfId)
//vfModuleName
def vfModuleName = ""
if (utils.nodeExists(request, "vf-module-name")) {
@@ -379,7 +383,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
execution.setVariable("DCVFM_vfModuleName", vfModuleName)
rollbackData.put("VFMODULE", "vfmodulename", vfModuleName)
- msoLogger.debug("vfModuleName: " + vfModuleName)
+ logger.debug("vfModuleName: " + vfModuleName)
//vfModuleModelName
def vfModuleModelName = ""
if (utils.nodeExists(request, "vf-module-model-name")) {
@@ -387,7 +391,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
execution.setVariable("DCVFM_vfModuleModelName", vfModuleModelName)
rollbackData.put("VFMODULE", "vfmodulemodelname", vfModuleModelName)
- msoLogger.debug("vfModuleModelName: " + vfModuleModelName)
+ logger.debug("vfModuleModelName: " + vfModuleModelName)
//modelCustomizationUuid
def modelCustomizationUuid = ""
if (utils.nodeExists(request, "model-customization-id")) {
@@ -395,27 +399,27 @@ public class DoCreateVfModule extends VfModuleBase {
}
execution.setVariable("DCVFM_modelCustomizationUuid", modelCustomizationUuid)
rollbackData.put("VFMODULE", "modelcustomizationuuid", modelCustomizationUuid)
- msoLogger.debug("modelCustomizationUuid: " + modelCustomizationUuid)
+ logger.debug("modelCustomizationUuid: " + modelCustomizationUuid)
//vfModuleId
def vfModuleId = ""
if (utils.nodeExists(request, "vf-module-id")) {
vfModuleId = utils.getNodeText(request, "vf-module-id")
}
execution.setVariable("DCVFM_vfModuleId", vfModuleId)
- msoLogger.debug("vfModuleId: " + vfModuleId)
+ logger.debug("vfModuleId: " + vfModuleId)
def requestId = ""
if (utils.nodeExists(request, "request-id")) {
requestId = utils.getNodeText(request, "request-id")
}
execution.setVariable("DCVFM_requestId", requestId)
- msoLogger.debug("requestId: " + requestId)
+ logger.debug("requestId: " + requestId)
//serviceId
def serviceId = ""
if (utils.nodeExists(request, "service-id")) {
serviceId = utils.getNodeText(request, "service-id")
}
execution.setVariable("DCVFM_serviceId", serviceId)
- msoLogger.debug("serviceId: " + serviceId)
+ logger.debug("serviceId: " + serviceId)
//serviceInstanceId
def serviceInstanceId = ""
if (utils.nodeExists(request, "service-instance-id")) {
@@ -423,7 +427,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
execution.setVariable("DCVFM_serviceInstanceId", serviceInstanceId)
rollbackData.put("VFMODULE", "serviceInstanceId", serviceInstanceId)
- msoLogger.debug("serviceInstanceId: " + serviceInstanceId)
+ logger.debug("serviceInstanceId: " + serviceInstanceId)
//source
def source = ""
if (utils.nodeExists(request, "source")) {
@@ -431,26 +435,26 @@ public class DoCreateVfModule extends VfModuleBase {
}
execution.setVariable("DCVFM_source", source)
rollbackData.put("VFMODULE", "source", source)
- msoLogger.debug("source: " + source)
+ logger.debug("source: " + source)
//backoutOnFailure
NetworkUtils networkUtils = new NetworkUtils()
def backoutOnFailure = networkUtils.isRollbackEnabled(execution,request)
execution.setVariable("DCVFM_backoutOnFailure", backoutOnFailure)
- msoLogger.debug("backoutOnFailure: " + backoutOnFailure)
+ logger.debug("backoutOnFailure: " + backoutOnFailure)
//isBaseVfModule
def isBaseVfModule = "false"
if (utils.nodeExists(request, "is-base-vf-module")) {
isBaseVfModule = utils.getNodeText(request, "is-base-vf-module")
}
execution.setVariable("DCVFM_isBaseVfModule", isBaseVfModule)
- msoLogger.debug("isBaseVfModule: " + isBaseVfModule)
+ logger.debug("isBaseVfModule: " + isBaseVfModule)
//asdcServiceModelVersion
def asdcServiceModelVersion = ""
if (utils.nodeExists(request, "asdc-service-model-version")) {
asdcServiceModelVersion = utils.getNodeText(request, "asdc-service-model-version")
}
execution.setVariable("DCVFM_asdcServiceModelVersion", asdcServiceModelVersion)
- msoLogger.debug("asdcServiceModelVersion: " + asdcServiceModelVersion)
+ logger.debug("asdcServiceModelVersion: " + asdcServiceModelVersion)
//personaModelId
def personaModelId = ""
@@ -458,7 +462,7 @@ public class DoCreateVfModule extends VfModuleBase {
personaModelId = utils.getNodeText(request, "persona-model-id")
}
execution.setVariable("DCVFM_personaModelId", personaModelId)
- msoLogger.debug("personaModelId: " + personaModelId)
+ logger.debug("personaModelId: " + personaModelId)
//personaModelVersion
def personaModelVersion = ""
@@ -466,15 +470,15 @@ public class DoCreateVfModule extends VfModuleBase {
personaModelVersion = utils.getNodeText(request, "persona-model-version")
}
execution.setVariable("DCVFM_personaModelVersion", personaModelVersion)
- msoLogger.debug("personaModelVersion: " + personaModelVersion)
+ logger.debug("personaModelVersion: " + personaModelVersion)
// Process the parameters
String vnfParamsChildNodes = utils.getChildNodes(request, "vnf-params")
if(vnfParamsChildNodes == null || vnfParamsChildNodes.length() < 1){
- msoLogger.debug("Request contains NO VNF Params")
+ logger.debug("Request contains NO VNF Params")
}else{
- msoLogger.debug("Request does contain VNF Params")
+ logger.debug("Request does contain VNF Params")
execution.setVariable("DCVFM_vnfParamsExistFlag", true)
InputSource xmlSource = new InputSource(new StringReader(request));
@@ -503,24 +507,24 @@ public class DoCreateVfModule extends VfModuleBase {
if (homingInstance != null) {
execution.setVariable("DCVFM_cloudSiteId", homingInstance.getCloudRegionId())
rollbackData.put("VFMODULE", "aiccloudregion", homingInstance.getCloudRegionId())
- msoLogger.debug("Overwriting cloudSiteId with homing cloudSiteId: " +
+ logger.debug("Overwriting cloudSiteId with homing cloudSiteId: " +
homingInstance.getCloudRegionId())
execution.setVariable("DCVFM_cloudOwner", homingInstance.getCloudOwner())
rollbackData.put("VFMODULE", "cloudOwner", homingInstance.getCloudOwner())
- msoLogger.debug("Overwriting cloudOwner with homing cloudOwner: " +
+ logger.debug("Overwriting cloudOwner with homing cloudOwner: " +
homingInstance.getCloudOwner())
oofDirectives = homingInstance.getOofDirectives()
execution.setVariable("DCVFM_oofDirectives", oofDirectives)
}
} catch (Exception exception) {
- msoLogger.debug("Could not find homing information for service instance: " + serviceInstanceId +
+ logger.debug("Could not find homing information for service instance: " + serviceInstanceId +
"... continuing")
- msoLogger.debug("Could not find homing information for service instance error: " + exception)
+ logger.debug("Could not find homing information for service instance error: " + exception)
}
if (oofDirectives != null) {
Map<String, String> paramsMap = execution.getVariable("DCVFM_vnfParamsMap")
paramsMap.put("oofDirectives", oofDirectives)
- msoLogger.debug("OofDirectives are: " + oofDirectives)
+ logger.debug("OofDirectives are: " + oofDirectives)
execution.setVariable("DCVFM_vnfParamsMap", paramsMap)
}
}
@@ -530,16 +534,16 @@ public class DoCreateVfModule extends VfModuleBase {
String uuid = execution.getVariable("DCVFM_uuid")
if(uuid == null){
uuid = UUID.randomUUID()
- msoLogger.debug("Generated messageId (UUID) is: " + uuid)
+ logger.debug("Generated messageId (UUID) is: " + uuid)
}else{
- msoLogger.debug("Found messageId (UUID) is: " + uuid)
+ logger.debug("Found messageId (UUID) is: " + uuid)
}
// Get sdncVersion, default to empty
String sdncVersion = execution.getVariable("sdncVersion")
if (sdncVersion == null) {
sdncVersion = ""
}
- msoLogger.debug("sdncVersion: " + sdncVersion)
+ logger.debug("sdncVersion: " + sdncVersion)
execution.setVariable("DCVFM_sdncVersion", sdncVersion)
execution.setVariable("DCVFM_uuid", uuid)
@@ -564,24 +568,25 @@ public class DoCreateVfModule extends VfModuleBase {
String sdncCallbackUrl = (String) UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution)
if (sdncCallbackUrl == null || sdncCallbackUrl.trim().isEmpty()) {
def msg = 'Required variable \'mso.workflow.sdncadapter.callback\' is missing'
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, msg, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, msg);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), msg);
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
execution.setVariable("DCVFM_sdncCallbackUrl", sdncCallbackUrl)
- msoLogger.debug("SDNC Callback URL is: " + sdncCallbackUrl)
+ logger.debug("SDNC Callback URL is: " + sdncCallbackUrl)
execution.setVariable("rollbackData", rollbackData)
}catch(BpmnError b){
- msoLogger.error(b);
+ logger.error(b);
throw b
}catch(Exception e){
- msoLogger.error(e);
+ logger.error(e);
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error encountered in PreProcess method!")
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
}
/**
@@ -607,15 +612,17 @@ public class DoCreateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
sendWorkflowResponse(execution, 200, "")
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Internal Error')
}
@@ -633,28 +640,28 @@ public class DoCreateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def createResponse = execution.getVariable('DCVFM_createVfModuleResponse')
- msoLogger.debug("createVfModule Response: " + createResponse)
+ logger.debug("createVfModule Response: " + createResponse)
def rollbackData = execution.getVariable("rollbackData")
String vnfName = utils.getNodeText(createResponse, 'vnf-name')
if (vnfName != null) {
execution.setVariable('DCVFM_vnfName', vnfName)
- msoLogger.debug("vnfName retrieved from AAI is: " + vnfName)
+ logger.debug("vnfName retrieved from AAI is: " + vnfName)
rollbackData.put("VFMODULE", "vnfname", vnfName)
}
String vnfId = utils.getNodeText(createResponse, 'vnf-id')
execution.setVariable('DCVFM_vnfId', vnfId)
- msoLogger.debug("vnfId is: " + vnfId)
+ logger.debug("vnfId is: " + vnfId)
String vfModuleId = utils.getNodeText(createResponse, 'vf-module-id')
execution.setVariable('DCVFM_vfModuleId', vfModuleId)
- msoLogger.debug("vfModuleId is: " + vfModuleId)
+ logger.debug("vfModuleId is: " + vfModuleId)
String vfModuleIndex= utils.getNodeText(createResponse, 'vf-module-index')
execution.setVariable('DCVFM_vfModuleIndex', vfModuleIndex)
- msoLogger.debug("vfModuleIndex is: " + vfModuleIndex)
+ logger.debug("vfModuleIndex is: " + vfModuleIndex)
rollbackData.put("VFMODULE", "vnfid", vnfId)
rollbackData.put("VFMODULE", "vfmoduleid", vfModuleId)
rollbackData.put("VFMODULE", "rollbackCreateAAIVfModule", "true")
@@ -662,10 +669,10 @@ public class DoCreateVfModule extends VfModuleBase {
execution.setVariable("rollbackData", rollbackData)
} catch (Exception ex) {
ex.printStackTrace()
- msoLogger.debug('Exception occurred while postProcessing CreateAAIVfModule request:' + ex.getMessage())
+ logger.debug('Exception occurred while postProcessing CreateAAIVfModule request:' + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Bad response from CreateAAIVfModule' + ex.getMessage())
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
}
@@ -680,7 +687,7 @@ public class DoCreateVfModule extends VfModuleBase {
def method = getClass().getSimpleName() + '.getVfModule(' +
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def vnfId = execution.getVariable('DCVFM_vnfId')
@@ -697,22 +704,22 @@ public class DoCreateVfModule extends VfModuleBase {
client.addAdditionalHeader('Content-Type', MediaType.APPLICATION_XML)
client.addAdditionalHeader('Accept', MediaType.APPLICATION_XML)
- msoLogger.debug('sending GET to AAI endpoint \'' + endPoint + '\'')
+ logger.debug('sending GET to AAI endpoint \'' + endPoint + '\'')
Response response = client.get()
String responseData = response.readEntity(String.class)
if (responseData != null) {
- msoLogger.debug("Received generic VNF data: " + responseData)
+ logger.debug("Received generic VNF data: " + responseData)
}
execution.setVariable('DCVFM_queryAAIVfModuleResponseCode', response.getStatus())
execution.setVariable('DCVFM_queryAAIVfModuleResponse', responseData)
- msoLogger.debug('Response code:' + response.getStatus())
- msoLogger.debug('Response:' + System.lineSeparator() + responseData)
+ logger.debug('Response code:' + response.getStatus())
+ logger.debug('Response:' + System.lineSeparator() + responseData)
if (response.getStatus() == 200) {
// Parse the VNF record from A&AI to find base module info
- msoLogger.debug('Parsing the VNF data to find base module info')
+ logger.debug('Parsing the VNF data to find base module info')
if (responseData != null) {
def vfModulesText = utils.getNodeXml(responseData, "vf-modules")
def xmlVfModules= new XmlSlurper().parseText(vfModulesText)
@@ -725,24 +732,26 @@ public class DoCreateVfModule extends VfModuleBase {
if (isBaseVfModule == "true") {
String baseModuleId = utils.getNodeText(vfModuleXml, "vf-module-id")
execution.setVariable("DCVFM_baseVfModuleId", baseModuleId)
- msoLogger.debug('Received baseVfModuleId: ' + baseModuleId)
+ logger.debug('Received baseVfModuleId: ' + baseModuleId)
String baseModuleHeatStackId = utils.getNodeText(vfModuleXml, "heat-stack-id")
execution.setVariable("DCVFM_baseVfModuleHeatStackId", baseModuleHeatStackId)
- msoLogger.debug('Received baseVfModuleHeatStackId: ' + baseModuleHeatStackId)
+ logger.debug('Received baseVfModuleHeatStackId: ' + baseModuleHeatStackId)
}
}
}
}
} catch (Exception ex) {
ex.printStackTrace()
- msoLogger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
+ logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIVfModule(): ' + e.getMessage())
}
}
@@ -761,7 +770,7 @@ public class DoCreateVfModule extends VfModuleBase {
def method = getClass().getSimpleName() + '.queryAAIVfModuleForStatus(' +
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable('DCVFM_orchestrationStatus', '')
@@ -782,24 +791,24 @@ public class DoCreateVfModule extends VfModuleBase {
try {
def responseData = ''
- msoLogger.debug('sending GET to AAI endpoint \'' + endPoint + '\'')
+ logger.debug('sending GET to AAI endpoint \'' + endPoint + '\'')
Response response = client.get()
- msoLogger.debug("createVfModule - invoking httpGet() to AAI")
+ logger.debug("createVfModule - invoking httpGet() to AAI")
responseData = response.readEntity(String.class)
if (responseData != null) {
- msoLogger.debug("Received generic VNF data: " + responseData)
+ logger.debug("Received generic VNF data: " + responseData)
}
execution.setVariable('DCVFM_queryAAIVfModuleForStatusResponseCode', response.getStatus())
execution.setVariable('DCVFM_queryAAIVfModuleForStatusResponse', responseData)
- msoLogger.debug('Response code:' + response.getStatus())
- msoLogger.debug('Response:' + System.lineSeparator() + responseData)
+ logger.debug('Response code:' + response.getStatus())
+ logger.debug('Response:' + System.lineSeparator() + responseData)
// Retrieve VF Module info and its orchestration status; if not found, do nothing
if (response.getStatus() == 200) {
// Parse the VNF record from A&AI to find base module info
- msoLogger.debug('Parsing the VNF data to find orchestration status')
+ logger.debug('Parsing the VNF data to find orchestration status')
if (responseData != null) {
def vfModuleText = utils.getNodeXml(responseData, "vf-module")
//def xmlVfModule= new XmlSlurper().parseText(vfModuleText)
@@ -808,20 +817,22 @@ public class DoCreateVfModule extends VfModuleBase {
// Also retrieve vfModuleId
def vfModuleId = utils.getNodeText(vfModuleText, "vf-module-id")
execution.setVariable("DCVFM_vfModuleId", vfModuleId)
- msoLogger.debug("Received orchestration status from A&AI: " + orchestrationStatus)
+ logger.debug("Received orchestration status from A&AI: " + orchestrationStatus)
}
}
} catch (Exception ex) {
ex.printStackTrace()
- msoLogger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
+ logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIVfModuleForStatus(): ' + e.getMessage())
}
}
@@ -830,11 +841,11 @@ public class DoCreateVfModule extends VfModuleBase {
public void preProcessSDNCAssignRequest(DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessSDNCAssignRequest")
+ logger.trace("STARTED preProcessSDNCAssignRequest")
def vnfId = execution.getVariable("DCVFM_vnfId")
def vfModuleId = execution.getVariable("DCVFM_vfModuleId")
def serviceInstanceId = execution.getVariable("DCVFM_serviceInstanceId")
- msoLogger.debug("NEW VNF ID: " + vnfId)
+ logger.debug("NEW VNF ID: " + vnfId)
try{
@@ -852,20 +863,22 @@ public class DoCreateVfModule extends VfModuleBase {
assignSDNCRequest = utils.formatXml(assignSDNCRequest)
execution.setVariable("DCVFM_assignSDNCRequest", assignSDNCRequest)
- msoLogger.debug("Outgoing AssignSDNCRequest is: \n" + assignSDNCRequest)
+ logger.debug("Outgoing AssignSDNCRequest is: \n" + assignSDNCRequest)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, " Exception Occurred Processing preProcessSDNCAssignRequest", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occurred Processing preProcessSDNCAssignRequest", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during prepareProvision Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCAssignRequest")
+ logger.trace("COMPLETED preProcessSDNCAssignRequest")
}
public void preProcessSDNCGetRequest(DelegateExecution execution, String element){
String sdncVersion = execution.getVariable("DCVFM_sdncVersion")
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessSDNCGetRequest Process")
+ logger.trace("STARTED preProcessSDNCGetRequest Process")
try{
def serviceInstanceId = execution.getVariable('DCVFM_serviceInstanceId')
@@ -875,7 +888,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
def callbackUrl = execution.getVariable("DCVFM_sdncCallbackUrl")
- msoLogger.debug("callbackUrl:" + callbackUrl)
+ logger.debug("callbackUrl:" + callbackUrl)
def vfModuleId = execution.getVariable('DCVFM_vfModuleId')
@@ -907,21 +920,21 @@ public class DoCreateVfModule extends VfModuleBase {
Optional<GenericVnf> vnf = wrapper.asBean(GenericVnf.class)
serviceOperation = vnf.get().getSelflink()
- msoLogger.debug("VNF - service operation: " + serviceOperation)
+ logger.debug("VNF - service operation: " + serviceOperation)
}
else if (element.equals("vfmodule")) {
String response = execution.getVariable("DCVFM_assignSDNCAdapterResponse")
- msoLogger.debug("DCVFM_assignSDNCAdapterResponse is: \n" + response)
+ logger.debug("DCVFM_assignSDNCAdapterResponse is: \n" + response)
if (!sdncVersion.equals("1707")) {
serviceOperation = "/VNF-API:vnfs/vnf-list/" + vfModuleId
- msoLogger.debug("VF Module with sdncVersion before 1707 - service operation: " + serviceOperation)
+ logger.debug("VF Module with sdncVersion before 1707 - service operation: " + serviceOperation)
}
else {
String data = utils.getNodeXml(response, "response-data")
- msoLogger.debug("responseData: " + data)
+ logger.debug("responseData: " + data)
serviceOperation = utils.getNodeText(data, "object-path")
- msoLogger.debug("VF Module with sdncVersion of 1707 - service operation: " + serviceOperation)
+ logger.debug("VF Module with sdncVersion of 1707 - service operation: " + serviceOperation)
}
}
@@ -944,13 +957,15 @@ public class DoCreateVfModule extends VfModuleBase {
</sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
execution.setVariable("DCVFM_getSDNCRequest", SDNCGetRequest)
- msoLogger.debug("Outgoing GetSDNCRequest is: \n" + SDNCGetRequest)
+ logger.debug("Outgoing GetSDNCRequest is: \n" + SDNCGetRequest)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occurred Processing preProcessSDNCGetRequest", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occurred Processing preProcessSDNCGetRequest", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during prepareProvision Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCGetRequest Process")
+ logger.trace("COMPLETED preProcessSDNCGetRequest Process")
}
@@ -959,10 +974,10 @@ public class DoCreateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
//def xml = execution.getVariable("DoCreateVfModuleRequest")
- //msoLogger.debug('VNF REQUEST is: ' + xml)
+ //logger.debug('VNF REQUEST is: ' + xml)
//Get variables
//cloudSiteId
@@ -1007,8 +1022,8 @@ public class DoCreateVfModule extends VfModuleBase {
String environmentContext = execution.getVariable("DCVFM_environmentContext")
//workloadContext
String workloadContext = execution.getVariable("DCVFM_workloadContext")
- msoLogger.debug("workloadContext: " + workloadContext)
- msoLogger.debug("environmentContext: " + environmentContext)
+ logger.debug("workloadContext: " + workloadContext)
+ logger.debug("environmentContext: " + environmentContext)
def messageId = execution.getVariable('mso-request-id') + '-' +
System.currentTimeMillis()
@@ -1016,8 +1031,8 @@ public class DoCreateVfModule extends VfModuleBase {
def notificationUrl = createCallbackURL(execution, "VNFAResponse", messageId)
def useQualifiedHostName = UrnPropertiesReader.getVariable("mso.use.qualified.host",execution)
- msoLogger.debug("notificationUrl: " + notificationUrl)
- msoLogger.debug("QualifiedHostName: " + useQualifiedHostName)
+ logger.debug("notificationUrl: " + notificationUrl)
+ logger.debug("QualifiedHostName: " + useQualifiedHostName)
if ('true'.equals(useQualifiedHostName)) {
notificationUrl = utils.getQualifiedHostNameForCallback(notificationUrl)
@@ -1027,7 +1042,7 @@ public class DoCreateVfModule extends VfModuleBase {
String vfModuleParams = ""
//Get SDNC Response Data for VF Module Topology
String vfModuleSdncGetResponse = execution.getVariable('DCVFM_getSDNCAdapterResponse')
- msoLogger.debug("sdncGetResponse: " + vfModuleSdncGetResponse)
+ logger.debug("sdncGetResponse: " + vfModuleSdncGetResponse)
def sdncVersion = execution.getVariable("sdncVersion")
if (!sdncVersion.equals("1707")) {
@@ -1038,7 +1053,7 @@ public class DoCreateVfModule extends VfModuleBase {
else {
//Get SDNC Response Data for Vnf Topology
String vnfSdncGetResponse = execution.getVariable('DCVFM_getVnfSDNCAdapterResponse')
- msoLogger.debug("vnfSdncGetResponse: " + vnfSdncGetResponse)
+ logger.debug("vnfSdncGetResponse: " + vnfSdncGetResponse)
vfModuleParams = buildVfModuleParamsFromCombinedTopologies(vnfParamsMap, vnfSdncGetResponse, vfModuleSdncGetResponse, vnfId, vnfName,
vfModuleId, vfModuleName, vfModuleIndex, environmentContext, workloadContext)
@@ -1083,7 +1098,7 @@ public class DoCreateVfModule extends VfModuleBase {
<notificationUrl>${MsoUtils.xmlEscape(notificationUrl)}</notificationUrl>
</createVfModuleRequest>"""
- msoLogger.debug("Create VfModule Request to VNF Adapter: " + createVnfARequest)
+ logger.debug("Create VfModule Request to VNF Adapter: " + createVnfARequest)
execution.setVariable("DCVFM_createVnfARequest", createVnfARequest)
}
@@ -1099,7 +1114,7 @@ public class DoCreateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
String processKey = getProcessKey(execution);
def prefix = execution.getVariable("prefix")
@@ -1126,7 +1141,7 @@ public class DoCreateVfModule extends VfModuleBase {
if (request == null) {
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, processKey + " request is null")
}
- msoLogger.debug("DoCreateVfModule Request: " + request)
+ logger.debug("DoCreateVfModule Request: " + request)
/*
@@ -1144,13 +1159,15 @@ public class DoCreateVfModule extends VfModuleBase {
utils.logContext(requestId, serviceInstanceId)
*/
- msoLogger.debug('Incoming message: ' + System.lineSeparator() + request)
- msoLogger.trace('Exited ' + method)
+ logger.debug('Incoming message: ' + System.lineSeparator() + request)
+ logger.trace('Exited ' + method)
return request
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Invalid Message")
}
}
@@ -1161,16 +1178,16 @@ public class DoCreateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
def request = execution.getVariable('DoCreateVfModuleRequest')
String volumeGroupId = utils.getNodeText(request, "volume-group-id")
if (volumeGroupId == null || volumeGroupId.isEmpty()) {
- msoLogger.debug('No volume group id is present')
+ logger.debug('No volume group id is present')
return false
}
else {
- msoLogger.debug('Volume group id is present')
+ logger.debug('Volume group id is present')
return true
}
@@ -1182,16 +1199,16 @@ public class DoCreateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
def request = execution.getVariable('DoCreateVfModuleRequest')
String volumeGroupName = utils.getNodeText(request, "volume-group-name")
if (volumeGroupName == null || volumeGroupName.isEmpty()) {
- msoLogger.debug('No volume group name is present')
+ logger.debug('No volume group name is present')
return false
}
else {
- msoLogger.debug('Volume group name is present')
+ logger.debug('Volume group name is present')
return true
}
@@ -1386,7 +1403,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
- msoLogger.debug("sdncRequest: " + sdncRequest)
+ logger.debug("sdncRequest: " + sdncRequest)
return sdncRequest
}
@@ -1396,9 +1413,9 @@ public class DoCreateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessSDNCActivateRequest Process")
+ logger.trace("STARTED preProcessSDNCActivateRequest Process")
try{
String vnfId = execution.getVariable("DCVFM_vnfId")
String vfModuleId = execution.getVariable("DCVFM_vfModuleId")
@@ -1414,13 +1431,13 @@ public class DoCreateVfModule extends VfModuleBase {
String activateSDNCRequest = buildSDNCRequest(execution, svcInstId, "activate")
execution.setVariable("DCVFM_activateSDNCRequest", activateSDNCRequest)
- msoLogger.debug("Outgoing CommitSDNCRequest is: \n" + activateSDNCRequest)
+ logger.debug("Outgoing CommitSDNCRequest is: \n" + activateSDNCRequest)
}catch(Exception e){
- msoLogger.debug("Exception Occured Processing preProcessSDNCActivateRequest. Exception is:\n" + e)
+ logger.debug("Exception Occured Processing preProcessSDNCActivateRequest. Exception is:\n" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessSDNCActivateRequest Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCActivateRequest Process")
+ logger.trace("COMPLETED preProcessSDNCActivateRequest Process")
}
public void postProcessVNFAdapterRequest(DelegateExecution execution) {
@@ -1428,23 +1445,23 @@ public class DoCreateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix",Prefix)
try{
- msoLogger.debug("STARTED postProcessVNFAdapterRequest Process")
+ logger.debug("STARTED postProcessVNFAdapterRequest Process")
String vnfResponse = execution.getVariable("DCVFM_createVnfAResponse")
- msoLogger.debug("VNF Adapter Response is: " + vnfResponse)
+ logger.debug("VNF Adapter Response is: " + vnfResponse)
RollbackData rollbackData = execution.getVariable("rollbackData")
if(vnfResponse != null){
if(vnfResponse.contains("createVfModuleResponse")){
- msoLogger.debug("Received a Good Response from VNF Adapter for CREATE_VF_MODULE Call.")
+ logger.debug("Received a Good Response from VNF Adapter for CREATE_VF_MODULE Call.")
execution.setVariable("DCVFM_vnfVfModuleCreateCompleted", true)
String heatStackId = utils.getNodeText(vnfResponse, "vfModuleStackId")
execution.setVariable("DCVFM_heatStackId", heatStackId)
- msoLogger.debug("Received heat stack id from VNF Adapter: " + heatStackId)
+ logger.debug("Received heat stack id from VNF Adapter: " + heatStackId)
rollbackData.put("VFMODULE", "heatstackid", heatStackId)
// Parse vnfOutputs for network_fqdn
if (vnfResponse.contains("vfModuleOutputs")) {
@@ -1464,22 +1481,22 @@ public class DoCreateVfModule extends VfModuleBase {
String key = element.getElementsByTagNameNS("*", "key").item(0).getTextContent()
if (key.equals("contrail-service-instance-fqdn")) {
String contrailServiceInstanceFqdn = element.getElementsByTagNameNS("*", "value").item(0).getTextContent()
- msoLogger.debug("Obtained contrailServiceInstanceFqdn: " + contrailServiceInstanceFqdn)
+ logger.debug("Obtained contrailServiceInstanceFqdn: " + contrailServiceInstanceFqdn)
execution.setVariable("DCVFM_contrailServiceInstanceFqdn", contrailServiceInstanceFqdn)
}
else if (key.endsWith("contrail_network_policy_fqdn")) {
String contrailNetworkPolicyFqdn = element.getElementsByTagNameNS("*", "value").item(0).getTextContent()
- msoLogger.debug("Obtained contrailNetworkPolicyFqdn: " + contrailNetworkPolicyFqdn)
+ logger.debug("Obtained contrailNetworkPolicyFqdn: " + contrailNetworkPolicyFqdn)
contrailNetworkPolicyFqdnList.add(contrailNetworkPolicyFqdn)
}
else if (key.equals("oam_management_v4_address")) {
String oamManagementV4Address = element.getElementsByTagNameNS("*", "value").item(0).getTextContent()
- msoLogger.debug("Obtained oamManagementV4Address: " + oamManagementV4Address)
+ logger.debug("Obtained oamManagementV4Address: " + oamManagementV4Address)
execution.setVariable("DCVFM_oamManagementV4Address", oamManagementV4Address)
}
else if (key.equals("oam_management_v6_address")) {
String oamManagementV6Address = element.getElementsByTagNameNS("*", "value").item(0).getTextContent()
- msoLogger.debug("Obtained oamManagementV6Address: " + oamManagementV6Address)
+ logger.debug("Obtained oamManagementV6Address: " + oamManagementV6Address)
execution.setVariable("DCVFM_oamManagementV6Address", oamManagementV6Address)
}
@@ -1490,11 +1507,11 @@ public class DoCreateVfModule extends VfModuleBase {
}
}
}else{
- msoLogger.debug("Received a BAD Response from VNF Adapter for CREATE_VF_MODULE Call.")
+ logger.debug("Received a BAD Response from VNF Adapter for CREATE_VF_MODULE Call.")
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "VNF Adapter Error")
}
}else{
- msoLogger.debug("Response from VNF Adapter is Null for CREATE_VF_MODULE Call.")
+ logger.debug("Response from VNF Adapter is Null for CREATE_VF_MODULE Call.")
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Empty response from VNF Adapter")
}
@@ -1504,10 +1521,10 @@ public class DoCreateVfModule extends VfModuleBase {
}catch(BpmnError b){
throw b
}catch(Exception e){
- msoLogger.debug("Internal Error Occured in PostProcess Method")
+ logger.debug("Internal Error Occured in PostProcess Method")
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Internal Error Occured in PostProcess Method")
}
- msoLogger.trace("COMPLETED postProcessVnfAdapterResponse Process")
+ logger.trace("COMPLETED postProcessVnfAdapterResponse Process")
}
@@ -1516,9 +1533,9 @@ public class DoCreateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessUpdateAAIVfModuleRequestOrch")
+ logger.trace("STARTED preProcessUpdateAAIVfModuleRequestOrch")
try{
@@ -1535,13 +1552,15 @@ public class DoCreateVfModule extends VfModuleBase {
updateAAIVfModuleRequest = utils.formatXml(updateAAIVfModuleRequest)
execution.setVariable("DCVFM_updateAAIVfModuleRequest", updateAAIVfModuleRequest)
- msoLogger.debug("Outgoing UpdateAAIVfModuleRequest is: \n" + updateAAIVfModuleRequest)
+ logger.debug("Outgoing UpdateAAIVfModuleRequest is: \n" + updateAAIVfModuleRequest)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessUpdateAAIVfModuleRequestOrch", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preProcessUpdateAAIVfModuleRequestOrch", "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessUpdateAAIVfModuleRequestOrch Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessUpdateAAIVfModuleRequestOrch")
+ logger.trace("COMPLETED preProcessUpdateAAIVfModuleRequestOrch")
}
@@ -1550,9 +1569,9 @@ public class DoCreateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessUpdateAAIVfModuleStatus")
+ logger.trace("STARTED preProcessUpdateAAIVfModuleStatus")
try{
@@ -1563,13 +1582,15 @@ public class DoCreateVfModule extends VfModuleBase {
updateAAIVfModuleRequest = utils.formatXml(updateAAIVfModuleRequest)
execution.setVariable("DCVFM_updateAAIVfModuleRequest", updateAAIVfModuleRequest)
- msoLogger.debug("Outgoing UpdateAAIVfModuleRequest is: \n" + updateAAIVfModuleRequest)
+ logger.debug("Outgoing UpdateAAIVfModuleRequest is: \n" + updateAAIVfModuleRequest)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessUpdateAAIVfModuleStatus", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preProcessUpdateAAIVfModuleStatus", "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessUpdateAAIVfModuleStatus Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessUpdateAAIVfModuleStatus")
+ logger.trace("COMPLETED preProcessUpdateAAIVfModuleStatus")
}
@@ -1579,9 +1600,9 @@ public class DoCreateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessUpdateAAIVfModuleRequestGroup")
+ logger.trace("STARTED preProcessUpdateAAIVfModuleRequestGroup")
try{
@@ -1591,32 +1612,34 @@ public class DoCreateVfModule extends VfModuleBase {
updateAAIVfModuleRequest = utils.formatXml(updateAAIVfModuleRequest)
execution.setVariable("DCVFM_updateAAIVfModuleRequest", updateAAIVfModuleRequest)
- msoLogger.debug("Outgoing UpdateAAIVfModuleRequest is: \n" + updateAAIVfModuleRequest)
+ logger.debug("Outgoing UpdateAAIVfModuleRequest is: \n" + updateAAIVfModuleRequest)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessUpdateAAIVfModuleRequestGroup", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preProcessUpdateAAIVfModuleRequestGroup", "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessUpdateAAIVfModuleRequestGroup Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessUpdateAAIVfModuleRequestGroup")
+ logger.trace("COMPLETED preProcessUpdateAAIVfModuleRequestGroup")
}
public void validateSDNCResponse(DelegateExecution execution, String response, String method){
execution.setVariable("prefix",Prefix)
- msoLogger.debug("STARTED ValidateSDNCResponse Process")
+ logger.debug("STARTED ValidateSDNCResponse Process")
WorkflowException workflowException = execution.getVariable("WorkflowException")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
String sdncResponse = response
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
- msoLogger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
+ logger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
RollbackData rollbackData = execution.getVariable("rollbackData")
if(method.equals("assign")){
@@ -1628,19 +1651,19 @@ public class DoCreateVfModule extends VfModuleBase {
}
execution.setVariable("rollbackData", rollbackData)
}else{
- msoLogger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
+ logger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
throw new BpmnError("MSOWorkflowException")
}
- msoLogger.trace("COMPLETED ValidateSDNCResponse Process")
+ logger.trace("COMPLETED ValidateSDNCResponse Process")
}
public void preProcessUpdateAfterCreateRequest(DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessRequest Process")
+ logger.trace("STARTED preProcessRequest Process")
try{
String response = execution.getVariable("DCVFM_assignSDNCAdapterResponse")
- msoLogger.debug("DCVFM_assignSDNCAdapterResponse: " + response)
+ logger.debug("DCVFM_assignSDNCAdapterResponse: " + response)
String data = utils.getNodeXml(response, "response-data")
String vnfId = utils.getNodeText(data, "vnf-id")
@@ -1652,7 +1675,7 @@ public class DoCreateVfModule extends VfModuleBase {
String serviceOperation = "/VNF-API:vnfs/vnf-list/" + vnfId
def callbackUrl = execution.getVariable("DCVFM_sdncCallbackUrl")
- msoLogger.debug("callbackUrl: " + callbackUrl)
+ logger.debug("callbackUrl: " + callbackUrl)
String SDNCGetRequest =
"""<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.onap/so/request/types/v1"
@@ -1669,13 +1692,15 @@ public class DoCreateVfModule extends VfModuleBase {
</sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
execution.setVariable("DCVFM_getSDNCRequest", SDNCGetRequest)
- msoLogger.debug("Outgoing GetSDNCRequest is: \n" + SDNCGetRequest)
+ logger.debug("Outgoing GetSDNCRequest is: \n" + SDNCGetRequest)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessSDNCGetRequest", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preProcessSDNCGetRequest", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during prepareProvision Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCGetRequest Process")
+ logger.trace("COMPLETED preProcessSDNCGetRequest Process")
}
public String buildUpdateAAIVfModuleRequest(DelegateExecution execution, boolean updateVolumeGroupId,
@@ -1712,7 +1737,7 @@ public class DoCreateVfModule extends VfModuleBase {
${contrailFqdnString}
</UpdateAAIVfModuleRequest>"""
- msoLogger.trace("updateAAIVfModule Request: " + updateAAIVfModuleRequest)
+ logger.trace("updateAAIVfModule Request: " + updateAAIVfModuleRequest)
return updateAAIVfModuleRequest
}
@@ -1761,7 +1786,7 @@ public class DoCreateVfModule extends VfModuleBase {
public void queryCloudRegion (DelegateExecution execution) {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED queryCloudRegion")
+ logger.trace("STARTED queryCloudRegion")
try {
String cloudRegion = execution.getVariable("DCVFM_cloudSiteId")
@@ -1785,19 +1810,23 @@ public class DoCreateVfModule extends VfModuleBase {
execution.setVariable("DCVFM_isCloudRegionGood", true)
} else {
String errorMessage = "AAI Query Cloud Region Unsuccessful. AAI Response Code: " + execution.getVariable("DCVFM_queryCloudRegionReturnCode")
- msoLogger.debug(errorMessage)
+ logger.debug(errorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, errorMessage)
execution.setVariable("DCVFM_isCloudRegionGood", false)
}
- msoLogger.debug(" is Cloud Region Good: " + execution.getVariable("DCVFM_isCloudRegionGood"))
+ logger.debug(" is Cloud Region Good: " + execution.getVariable("DCVFM_isCloudRegionGood"))
} catch(BpmnError b){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Rethrowing MSOWorkflowException", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + b.getMessage());
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Rethrowing MSOWorkflowException", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + b.getMessage());
throw b
}catch (Exception ex) {
// try error
String errorMessage = "Bpmn error encountered in CreateVfModule flow. Unexpected Response from AAI - " + ex.getMessage()
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "AAI Query Cloud Region Failed "+errorMessage, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + ex);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "AAI Query Cloud Region Failed " + errorMessage, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Exception occured during queryCloudRegion method")
}
}
@@ -1812,17 +1841,17 @@ public class DoCreateVfModule extends VfModuleBase {
execution.setVariable("prefix",Prefix)
try{
- msoLogger.debug("Caught a BPMN Exception")
- msoLogger.debug("Started processBPMNException Method")
- msoLogger.debug("Variables List: " + execution.getVariables())
+ logger.debug("Caught a BPMN Exception")
+ logger.debug("Started processBPMNException Method")
+ logger.debug("Variables List: " + execution.getVariables())
if(execution.getVariable("WorkflowException") == null){
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Exception occured during DoCreateVfModule Sub Process")
}
}catch(Exception e){
- msoLogger.debug("Caught Exception during processBPMNException Method: " + e)
+ logger.debug("Caught Exception during processBPMNException Method: " + e)
}
- msoLogger.debug("Completed processBPMNException Method")
+ logger.debug("Completed processBPMNException Method")
}
public void prepareCreateAAIVfModuleVolumeGroupRequest(DelegateExecution execution) {
@@ -1830,9 +1859,9 @@ public class DoCreateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED prepareCreateAAIVfModuleVolumeGroupRequest")
+ logger.trace("STARTED prepareCreateAAIVfModuleVolumeGroupRequest")
try{
@@ -1855,13 +1884,15 @@ public class DoCreateVfModule extends VfModuleBase {
createAAIVfModuleVolumeGroupRequest = utils.formatXml(createAAIVfModuleVolumeGroupRequest)
execution.setVariable("DCVFM_createAAIVfModuleVolumeGroupRequest", createAAIVfModuleVolumeGroupRequest)
- msoLogger.debug("Outgoing CreateAAIVfModuleVolumeGroupRequest is: \n" + createAAIVfModuleVolumeGroupRequest)
+ logger.debug("Outgoing CreateAAIVfModuleVolumeGroupRequest is: \n" + createAAIVfModuleVolumeGroupRequest)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Exception Occured Processing prepareCreateAAIVfModuleVolumeGroupRequest', "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Exception Occured Processing prepareCreateAAIVfModuleVolumeGroupRequest', "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during prepareCreateAAIVfModuleVolumeGroupRequest Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED prepareCreateAAIVfModuleVolumeGroupRequest")
+ logger.trace("COMPLETED prepareCreateAAIVfModuleVolumeGroupRequest")
}
@@ -1870,9 +1901,9 @@ public class DoCreateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED createNetworkPoliciesInAAI")
+ logger.trace("STARTED createNetworkPoliciesInAAI")
try {
// get variables
@@ -1881,7 +1912,7 @@ public class DoCreateVfModule extends VfModuleBase {
def rollbackData = execution.getVariable("rollbackData")
execution.setVariable("DCVFM_networkPolicyFqdnCount", fqdnCount)
- msoLogger.debug("DCVFM_networkPolicyFqdnCount - " + fqdnCount)
+ logger.debug("DCVFM_networkPolicyFqdnCount - " + fqdnCount)
AaiUtil aaiUriUtil = new AaiUtil(this)
@@ -1902,14 +1933,14 @@ public class DoCreateVfModule extends VfModuleBase {
if (resourceClient.exists(uri)) {
- msoLogger.debug(" QueryAAINetworkPolicyByFQDN Success REST Response, , NetworkPolicy #" + counting)
+ logger.debug(" QueryAAINetworkPolicyByFQDN Success REST Response, , NetworkPolicy #" + counting)
} else {
// This network policy FQDN is not in AAI yet. Add it now
- msoLogger.debug("This network policy FQDN is not in AAI yet: " + fqdn)
+ logger.debug("This network policy FQDN is not in AAI yet: " + fqdn)
// Add the network policy with this FQDN to AAI
def networkPolicyId = UUID.randomUUID().toString()
- msoLogger.debug("Adding network-policy with network-policy-id " + networkPolicyId)
+ logger.debug("Adding network-policy with network-policy-id " + networkPolicyId)
NetworkPolicy policy = new NetworkPolicy()
policy.setNetworkPolicyId(networkPolicyId)
@@ -1928,7 +1959,7 @@ public class DoCreateVfModule extends VfModuleBase {
} else {
- msoLogger.debug("No contrail network policies to query/create")
+ logger.debug("No contrail network policies to query/create")
}
@@ -1936,7 +1967,7 @@ public class DoCreateVfModule extends VfModuleBase {
throw e;
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DoCreateVfModule flow. createNetworkPoliciesInAAI() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -1952,7 +1983,7 @@ public class DoCreateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def rollbackData = execution.getVariable("rollbackData")
@@ -1982,14 +2013,16 @@ public class DoCreateVfModule extends VfModuleBase {
"""
updateAAIGenericVnfRequest = utils.formatXml(updateAAIGenericVnfRequest)
execution.setVariable('DCVM_updateAAIGenericVnfRequest', updateAAIGenericVnfRequest)
- msoLogger.debug('Request for UpdateAAIGenericVnf:\n' + updateAAIGenericVnfRequest)
+ logger.debug('Request for UpdateAAIGenericVnf:\n' + updateAAIGenericVnfRequest)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, " Exception Encountered in " + method, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Encountered in " + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepUpdateAAIGenericVnf(): ' + e.getMessage())
}
@@ -2005,7 +2038,7 @@ public class DoCreateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def rollbackData = execution.getVariable("rollbackData")
@@ -2028,11 +2061,13 @@ public class DoCreateVfModule extends VfModuleBase {
execution.setVariable("rollbackData", rollbackData)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in postProcessUpdateAAIGenericVnf(): ' + e.getMessage())
}
}
@@ -2040,22 +2075,22 @@ public class DoCreateVfModule extends VfModuleBase {
public void queryCatalogDB (DelegateExecution execution) {
String msg = ""
- msoLogger.trace("queryCatalogDB ")
+ logger.trace("queryCatalogDB ")
try {
boolean twoPhaseDesign = false
// check for input
String vfModuleModelName = execution.getVariable("DCVFM_vfModuleModelName")
- msoLogger.debug("vfModuleModelName: " + vfModuleModelName)
+ logger.debug("vfModuleModelName: " + vfModuleModelName)
def vnfModelInfo = execution.getVariable("vnfModelInfo")
def vnfModelCustomizationUuid = jsonUtil.getJsonValue(vnfModelInfo, "modelCustomizationUuid")
- msoLogger.debug("vnfModelCustomizationUuid: " + vnfModelCustomizationUuid)
+ logger.debug("vnfModelCustomizationUuid: " + vnfModelCustomizationUuid)
JSONArray vnfs = catalogDbUtils.getAllVnfsByVnfModelCustomizationUuid(execution, vnfModelCustomizationUuid, "v2")
- msoLogger.debug("Incoming Query Catalog DB for Vnf Response is: " + vnfModelCustomizationUuid)
+ logger.debug("Incoming Query Catalog DB for Vnf Response is: " + vnfModelCustomizationUuid)
// Only one match here
if (vnfs != null) {
JSONObject vnfObject = vnfs.get(0)
@@ -2068,7 +2103,7 @@ public class DoCreateVfModule extends VfModuleBase {
// Get multiStageDesign flag
String multiStageDesignValue = vnf.getMultiStageDesign()
- msoLogger.debug("multiStageDesign value from Catalog DB is: " + multiStageDesignValue)
+ logger.debug("multiStageDesign value from Catalog DB is: " + multiStageDesignValue)
if (multiStageDesignValue != null) {
if (multiStageDesignValue.equalsIgnoreCase("true")) {
twoPhaseDesign = true
@@ -2077,13 +2112,15 @@ public class DoCreateVfModule extends VfModuleBase {
}
}
- msoLogger.debug("setting twoPhaseDesign flag to: " + twoPhaseDesign)
+ logger.debug("setting twoPhaseDesign flag to: " + twoPhaseDesign)
execution.setVariable("DCVFM_twoPhaseDesign", twoPhaseDesign)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in queryCatalogDB', "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in queryCatalogDB', "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryCatalogDB(): ' + e.getMessage())
}
}
@@ -2091,44 +2128,44 @@ public class DoCreateVfModule extends VfModuleBase {
public void preProcessRollback (DelegateExecution execution) {
- msoLogger.trace("preProcessRollback")
+ logger.trace("preProcessRollback")
try {
Object workflowException = execution.getVariable("WorkflowException");
if (workflowException instanceof WorkflowException) {
- msoLogger.debug("Prev workflowException: " + workflowException.getErrorMessage())
+ logger.debug("Prev workflowException: " + workflowException.getErrorMessage())
execution.setVariable("prevWorkflowException", workflowException);
//execution.setVariable("WorkflowException", null);
}
} catch (BpmnError e) {
- msoLogger.debug("BPMN Error during preProcessRollback")
+ logger.debug("BPMN Error during preProcessRollback")
} catch(Exception ex) {
String msg = "Exception in preProcessRollback. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
- msoLogger.trace("Exit preProcessRollback")
+ logger.trace("Exit preProcessRollback")
}
public void postProcessRollback (DelegateExecution execution) {
- msoLogger.trace("postProcessRollback")
+ logger.trace("postProcessRollback")
String msg = ""
try {
Object workflowException = execution.getVariable("prevWorkflowException");
if (workflowException instanceof WorkflowException) {
- msoLogger.debug("Setting prevException to WorkflowException: ")
+ logger.debug("Setting prevException to WorkflowException: ")
execution.setVariable("WorkflowException", workflowException);
}
execution.setVariable("rollbackData", null)
} catch (BpmnError b) {
- msoLogger.debug("BPMN Error during postProcessRollback")
+ logger.debug("BPMN Error during postProcessRollback")
throw b;
} catch(Exception ex) {
msg = "Exception in postProcessRollback. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
- msoLogger.trace("Exit postProcessRollback")
+ logger.trace("Exit postProcessRollback")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy
index 55a84575f4..d9989606e0 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -36,6 +38,8 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.springframework.web.util.UriUtils
@@ -43,7 +47,7 @@ import javax.ws.rs.NotFoundException
public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateVfModuleRollback.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateVfModuleRollback.class);
def Prefix="DCVFMR_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -65,7 +69,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
execution.setVariable("rollbackError", null)
def rollbackData = execution.getVariable("rollbackData")
- msoLogger.debug("RollbackData:" + rollbackData)
+ logger.debug("RollbackData:" + rollbackData)
if (rollbackData != null) {
String vnfId = rollbackData.get("VFMODULE", "vnfid")
@@ -104,7 +108,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
break
}
createdNetworkPolicyFqdnList.add(fqdn)
- msoLogger.debug("got fqdn # " + i + ": " + fqdn)
+ logger.debug("got fqdn # " + i + ": " + fqdn)
i = i + 1
}
@@ -131,7 +135,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
<vf-module-id>${MsoUtils.xmlEscape(vfModuleId)}</vf-module-id>
<orchestration-status>pending-delete</orchestration-status>
</PrepareUpdateAAIVfModuleRequest>""" as String
- msoLogger.debug("PrepareUpdateAAIVfModuleRequest :" + request)
+ logger.debug("PrepareUpdateAAIVfModuleRequest :" + request)
execution.setVariable("PrepareUpdateAAIVfModuleRequest", request)
} else {
execution.setVariable("skipRollback", true)
@@ -145,7 +149,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
throw e;
} catch (Exception ex){
def msg = "Exception in DoCreateVfModuleRollback preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -238,14 +242,14 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
</sdncadapterworkflow:SDNCRequestData>
</sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
- msoLogger.debug("sdncAdapterWorkflowRequest: " + request)
+ logger.debug("sdncAdapterWorkflowRequest: " + request)
execution.setVariable("sdncAdapterWorkflowRequest", request)
}
public void preProcessSDNCDeactivateRequest(DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessSDNCDeactivateRequest")
+ logger.trace("STARTED preProcessSDNCDeactivateRequest")
def serviceInstanceId = execution.getVariable("DCVFMR_serviceInstanceId")
@@ -256,13 +260,15 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
deactivateSDNCRequest = utils.formatXml(deactivateSDNCRequest)
execution.setVariable("DCVFMR_deactivateSDNCRequest", deactivateSDNCRequest)
- msoLogger.debug("Outgoing DeactivateSDNCRequest is: \n" + deactivateSDNCRequest)
+ logger.debug("Outgoing DeactivateSDNCRequest is: \n" + deactivateSDNCRequest)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessSDNCDeactivateRequest.", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preProcessSDNCDeactivateRequest.", "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessSDNCDeactivateRequest Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCDeactivateRequest")
+ logger.trace("COMPLETED preProcessSDNCDeactivateRequest")
}
public void preProcessSDNCUnassignRequest(DelegateExecution execution) {
@@ -270,22 +276,22 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
'execution=' + execution.getId() +
')'
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessSDNCUnassignRequest Process")
+ logger.trace("STARTED preProcessSDNCUnassignRequest Process")
try{
String serviceInstanceId = execution.getVariable("DCVFMR_serviceInstanceId")
String unassignSDNCRequest = buildSDNCRequest(execution, serviceInstanceId, "unassign")
execution.setVariable("DCVFMR_unassignSDNCRequest", unassignSDNCRequest)
- msoLogger.debug("Outgoing UnassignSDNCRequest is: \n" + unassignSDNCRequest)
+ logger.debug("Outgoing UnassignSDNCRequest is: \n" + unassignSDNCRequest)
}catch(Exception e){
- msoLogger.debug("Exception Occured Processing preProcessSDNCUnassignRequest. Exception is:\n" + e)
+ logger.debug("Exception Occured Processing preProcessSDNCUnassignRequest. Exception is:\n" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessSDNCUnassignRequest Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCUnassignRequest Process")
+ logger.trace("COMPLETED preProcessSDNCUnassignRequest Process")
}
public String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action){
@@ -342,7 +348,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
</sdncadapterworkflow:SDNCRequestData>
</sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
- msoLogger.debug("sdncRequest: " + sdncRequest)
+ logger.debug("sdncRequest: " + sdncRequest)
return sdncRequest
}
@@ -383,7 +389,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
</deleteVfModuleRequest>
""" as String
- msoLogger.debug("vnfAdapterRestV1Request: " + request)
+ logger.debug("vnfAdapterRestV1Request: " + request)
execution.setVariable("vnfAdapterRestV1Request", request)
}
@@ -400,7 +406,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
<heat-stack-id>DELETE</heat-stack-id>
<orchestration-status>deleted</orchestration-status>
</UpdateAAIVfModuleRequest>""" as String
- msoLogger.debug("UpdateAAIVfModuleRequest :" + request)
+ logger.debug("UpdateAAIVfModuleRequest :" + request)
execution.setVariable("UpdateAAIVfModuleRequest", request)
}
@@ -417,7 +423,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
<heat-stack-id></heat-stack-id>
<orchestration-status>Assigned</orchestration-status>
</UpdateAAIVfModuleRequest>""" as String
- msoLogger.debug("UpdateAAIVfModuleRequest :" + request)
+ logger.debug("UpdateAAIVfModuleRequest :" + request)
execution.setVariable("UpdateAAIVfModuleRequest", request)
}
@@ -432,7 +438,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
<vnf-id>${MsoUtils.xmlEscape(vnfId)}</vnf-id>
<vf-module-id>${MsoUtils.xmlEscape(vfModuleId)}</vf-module-id>
</DeleteAAIVfModuleRequest>""" as String
- msoLogger.debug("DeleteAAIVfModuleRequest :" + request)
+ logger.debug("DeleteAAIVfModuleRequest :" + request)
execution.setVariable("DeleteAAIVfModuleRequest", request)
}
@@ -440,7 +446,9 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
// -
public void handleDoDeleteVfModuleFailure(DelegateExecution execution) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "AAI error occurred deleting the Generic Vnf"+ execution.getVariable("DoDVfMod_deleteGenericVnfResponse"), "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "AAI error occurred deleting the Generic Vnf" + execution.getVariable("DoDVfMod_deleteGenericVnfResponse"),
+ "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
String processKey = getProcessKey(execution);
exceptionUtil.buildWorkflowException(execution, 5000, "Failure in DoDeleteVfModule")
@@ -457,7 +465,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
- msoLogger.debug("Successfully Validated SDNC Response")
+ logger.debug("Successfully Validated SDNC Response")
}else{
throw new BpmnError("MSOWorkflowException")
}
@@ -468,21 +476,21 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
'execution=' + execution.getId() +
')'
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED deleteNetworkPoliciesFromAAI")
+ logger.trace("STARTED deleteNetworkPoliciesFromAAI")
try {
// get variables
List fqdnList = execution.getVariable(Prefix + "createdNetworkPolicyFqdnList")
if (fqdnList == null) {
- msoLogger.debug("No network policies to delete")
+ logger.debug("No network policies to delete")
return
}
int fqdnCount = fqdnList.size()
execution.setVariable(Prefix + "networkPolicyFqdnCount", fqdnCount)
- msoLogger.debug("networkPolicyFqdnCount - " + fqdnCount)
+ logger.debug("networkPolicyFqdnCount - " + fqdnCount)
AaiUtil aaiUriUtil = new AaiUtil(this)
@@ -507,24 +515,24 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
AAIResourceUri delUri = AAIUriFactory.createResourceUri(AAIObjectType.NETWORK_POLICY, networkPolicy.getNetworkPolicyId())
getAAIClient().delete(delUri)
execution.setVariable(Prefix + "aaiDeleteNetworkPolicyReturnCode", 200)
- msoLogger.debug("AAI delete network policy Response Code, NetworkPolicy #" + counting + " : " + 200)
- msoLogger.debug("The return code from deleting network policy is: " + 200)
+ logger.debug("AAI delete network policy Response Code, NetworkPolicy #" + counting + " : " + 200)
+ logger.debug("The return code from deleting network policy is: " + 200)
// This network policy was deleted from AAI successfully
- msoLogger.debug(" DelAAINetworkPolicy Success REST Response, , NetworkPolicy #" + counting + " : ")
+ logger.debug(" DelAAINetworkPolicy Success REST Response, , NetworkPolicy #" + counting + " : ")
}catch(NotFoundException ne){
// This network policy FQDN is not in AAI. No need to delete.
execution.setVariable(Prefix + "aaiDeleteNetworkPolicyReturnCode", 404)
- msoLogger.debug("The return code is: " + 404)
- msoLogger.debug("This network policy FQDN is not in AAI: " + fqdn)
+ logger.debug("The return code is: " + 404)
+ logger.debug("This network policy FQDN is not in AAI: " + fqdn)
}catch(Exception e){
// aai all errors
String delErrorMessage = "Unable to delete network-policy to AAI deleteNetworkPoliciesFromAAI - " + e.getMessage()
- msoLogger.debug(delErrorMessage)
+ logger.debug(delErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, delErrorMessage)
}
} else {
// This network policy FQDN is not in AAI. No need to delete.
- msoLogger.debug("This network policy FQDN is not in AAI: " + fqdn)
+ logger.debug("This network policy FQDN is not in AAI: " + fqdn)
}
}catch (BpmnError e){
throw e
@@ -532,14 +540,14 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
catch (Exception e) {
// aai all errors
String dataErrorMessage = "Unexpected Response from deleteNetworkPoliciesFromAAI - " + e.getMessage()
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
} // end loop
} else {
- msoLogger.debug("No contrail network policies to query/create")
+ logger.debug("No contrail network policies to query/create")
}
@@ -548,7 +556,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DoCreateVfModuleRollback flow. deleteNetworkPoliciesFromAAI() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -565,7 +573,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
'execution=' + execution.getId() +
')'
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def vnfId = execution.getVariable('DCVFMR_vnfId')
@@ -592,14 +600,16 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
"""
updateAAIGenericVnfRequest = utils.formatXml(updateAAIGenericVnfRequest)
execution.setVariable(Prefix + 'updateAAIGenericVnfRequest', updateAAIGenericVnfRequest)
- msoLogger.debug('Request for UpdateAAIGenericVnf:\n' + updateAAIGenericVnfRequest)
+ logger.debug('Request for UpdateAAIGenericVnf:\n' + updateAAIGenericVnfRequest)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in preProcessUpdateAAIGenericVnf((): ' + e.getMessage())
}
}
@@ -607,7 +617,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
public void setSuccessfulRollbackStatus (DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED setSuccessfulRollbackStatus")
+ logger.trace("STARTED setSuccessfulRollbackStatus")
try{
// Set rolledBack to true, rollbackError to null
@@ -615,16 +625,18 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
execution.setVariable("rollbackError", null)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing setSuccessfulRollbackStatus.", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing setSuccessfulRollbackStatus.", "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during setSuccessfulRollbackStatus Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED setSuccessfulRollbackStatus")
+ logger.trace("COMPLETED setSuccessfulRollbackStatus")
}
public void setFailedRollbackStatus (DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED setFailedRollbackStatus")
+ logger.trace("STARTED setFailedRollbackStatus")
try{
// Set rolledBack to false, rollbackError to actual value, rollbackData to null
@@ -633,9 +645,11 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
execution.setVariable("rollbackData", null)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing setFailedRollbackStatus.", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing setFailedRollbackStatus.", "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during setFailedRollbackStatus Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED setFailedRollbackStatus")
+ logger.trace("COMPLETED setFailedRollbackStatus")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeRollback.groovy
index f61d2b98e3..a233a0a02e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeRollback.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -33,12 +35,13 @@ import org.onap.so.client.aai.AAIObjectType
import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.constants.Defaults
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import javax.ws.rs.NotFoundException
public class DoCreateVfModuleVolumeRollback extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateVfModuleVolumeRollback.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateVfModuleVolumeRollback.class);
String Prefix="DCVFMODVOLRBK_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -171,18 +174,18 @@ public class DoCreateVfModuleVolumeRollback extends AbstractServiceTaskProcessor
execution.setVariable("prefix",Prefix)
try{
- msoLogger.debug("Caught a Java Exception in " + Prefix)
- msoLogger.debug("Started processJavaException Method")
- msoLogger.debug("Variables List: " + execution.getVariables())
+ logger.debug("Caught a Java Exception in " + Prefix)
+ logger.debug("Started processJavaException Method")
+ logger.debug("Variables List: " + execution.getVariables())
execution.setVariable("UnexpectedError", "Caught a Java Lang Exception - " + Prefix) // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception")
}catch(Exception e){
- msoLogger.debug("Caught Exception during processJavaException Method: " + e)
+ logger.debug("Caught Exception during processJavaException Method: " + e)
execution.setVariable("UnexpectedError", "Exception in processJavaException method - " + Prefix) // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method" + Prefix)
}
- msoLogger.debug("Completed processJavaException Method in " + Prefix)
+ logger.debug("Completed processJavaException Method in " + Prefix)
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2.groovy
index 87f598db5d..b2006c45d7 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -40,13 +42,14 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.constants.Defaults
import org.onap.so.db.catalog.beans.OrchestrationStatus
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import javax.ws.rs.NotFoundException
class DoCreateVfModuleVolumeV2 extends VfModuleBase {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateVfModuleVolumeV2.class)
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateVfModuleVolumeV2.class);
String prefix='DCVFMODVOLV2_'
JsonUtils jsonUtil = new JsonUtils()
private ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -94,12 +97,12 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
//modelCustomizationUuid
def modelCustomizationUuid = jsonUtil.getJsonValue(vfModuleModelInfo, "modelCustomizationUuid")
execution.setVariable("modelCustomizationId", modelCustomizationUuid)
- msoLogger.debug("modelCustomizationId: " + modelCustomizationUuid)
+ logger.debug("modelCustomizationId: " + modelCustomizationUuid)
//modelName
def modelName = jsonUtil.getJsonValue(vfModuleModelInfo, "modelName")
execution.setVariable("modelName", modelName)
- msoLogger.debug("modelName: " + modelName)
+ logger.debug("modelName: " + modelName)
// The following is used on the get Generic Service Instance call
execution.setVariable('GENGS_type', 'service-instance')
@@ -116,11 +119,11 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
'vnfId', 'vnfName', 'tenantId', 'volumeGroupId', 'volumeGroupName', 'lcpCloudRegionId', 'vnfType', 'vfModuleModelInfo', 'asdcServiceModelVersion',
'test-volume-group-name', 'test-volume-group-id', 'vfModuleInputParams']
- msoLogger.debug('Begin input: ')
+ logger.debug('Begin input: ')
input.each {
- msoLogger.debug(it + ': ' + execution.getVariable(it))
+ logger.debug(it + ': ' + execution.getVariable(it))
}
- msoLogger.debug('End input.')
+ logger.debug('End input.')
}
@@ -158,7 +161,7 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
throw e
}catch (Exception ex){
String msg = "Exception in getServiceInstance. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
(new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, msg)
}
}
@@ -171,7 +174,7 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
public void callRESTQueryAAICloudRegion (DelegateExecution execution, isDebugEnabled) {
def cloudRegion = execution.getVariable("lcpCloudRegionId")
- msoLogger.debug('Request cloud region is: ' + cloudRegion)
+ logger.debug('Request cloud region is: ' + cloudRegion)
AaiUtil aaiUtil = new AaiUtil(this)
@@ -183,20 +186,20 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
def aaiCloudRegion = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "AAI", cloudRegion)
if ((aaiCloudRegion != "ERROR")) {
execution.setVariable("lcpCloudRegionId", aaiCloudRegion)
- msoLogger.debug("AIC Cloud Region for AAI: " + aaiCloudRegion)
+ logger.debug("AIC Cloud Region for AAI: " + aaiCloudRegion)
} else {
String errorMessage = "AAI Query Cloud Region Unsuccessful. Return Code: " + execution.getVariable(prefix+"queryCloudRegionReturnCode")
- msoLogger.debug(errorMessage)
+ logger.debug(errorMessage)
(new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, errorMessage)
}
def poCloudRegion = aaiUtil.getAAICloudReqion(execution, queryCloudRegionRequest, "PO", cloudRegion)
if ((poCloudRegion != "ERROR")) {
execution.setVariable("poLcpCloudRegionId", poCloudRegion)
- msoLogger.debug("AIC Cloud Region for PO: " + poCloudRegion)
+ logger.debug("AIC Cloud Region for PO: " + poCloudRegion)
} else {
String errorMessage = "AAI Query Cloud Region Unsuccessful. Return Code: " + execution.getVariable(prefix+"queryCloudRegionReturnCode")
- msoLogger.debug(errorMessage)
+ logger.debug(errorMessage)
(new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, errorMessage)
}
@@ -222,7 +225,7 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
VolumeGroup volumeGroup = volumeGroups.get().getVolumeGroup().get(0);
execution.setVariable(prefix+'AaiReturnCode', 200)
execution.setVariable("queriedVolumeGroupId",volumeGroup.getVolumeGroupId())
- msoLogger.debug("Volume Group Name $volumeGroupName exists in AAI.")
+ logger.debug("Volume Group Name $volumeGroupName exists in AAI.")
}else{
execution.setVariable(prefix+'AaiReturnCode', 404)
exceptionUtil.buildAndThrowWorkflowException(execution,25000, "Volume Group Name $volumeGroupName does not exist in AAI.")
@@ -241,8 +244,8 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
* @param execution
* @param isDebugEnabled
*/
- public void buildWorkflowException(DelegateExecution execution, int errorCode, errorMessage, isDebugEnabled) {
- msoLogger.debug(errorMessage)
+ public void buildWorkflowException(DelegateExecution execution, int errorCode, errorMessage) {
+ logger.debug(errorMessage)
(new ExceptionUtil()).buildWorkflowException(execution, 2500, errorMessage)
}
@@ -279,7 +282,7 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
def testGroupId = execution.getVariable('test-volume-group-id')
if (testGroupId != null && testGroupId.trim() != '') {
- msoLogger.debug("test volumeGroupId is present: " + testGroupId)
+ logger.debug("test volumeGroupId is present: " + testGroupId)
volumeGroupId = testGroupId
execution.setVariable("test-volume-group-name", "MSOTESTVOL101a-vSAMP12_base_vol_module-0")
}
@@ -291,7 +294,7 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
volumeGroup.setOrchestrationStatus(OrchestrationStatus.PENDING.toString())
volumeGroup.setModelCustomizationId(modelCustomizationId)
- msoLogger.debug("volumeGroupId to be used: " + volumeGroupId)
+ logger.debug("volumeGroupId to be used: " + volumeGroupId)
AAIResourceUri volumeGroupUri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP, cloudOwner, cloudRegion, volumeGroupId)
AAIResourceUri tenantUri = AAIUriFactory.createResourceUri(AAIObjectType.TENANT, cloudOwner, cloudRegion, tenantId)
@@ -336,14 +339,14 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
def modelCustomizationId = execution.getVariable("modelCustomizationId")
// for testing
- msoLogger.debug("volumeGroupId: " + volumeGroupId)
+ logger.debug("volumeGroupId: " + volumeGroupId)
def testGroupId = execution.getVariable('test-volume-group-id')
if (testGroupId != null && testGroupId.trim() != '') {
- msoLogger.debug("test volumeGroupId is present: " + testGroupId)
+ logger.debug("test volumeGroupId is present: " + testGroupId)
volumeGroupId = testGroupId
execution.setVariable("test-volume-group-name", "MSOTESTVOL101a-vSAMP12_base_vol_module-0")
}
- msoLogger.debug("volumeGroupId to be used: " + volumeGroupId)
+ logger.debug("volumeGroupId to be used: " + volumeGroupId)
// volume group parameters
@@ -364,10 +367,10 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
}
volumeGroupParams = sbParams.toString()
- msoLogger.debug("volumeGroupParams: "+ volumeGroupParams)
+ logger.debug("volumeGroupParams: "+ volumeGroupParams)
def backoutOnFailure = execution.getVariable(prefix+"backoutOnFailure")
- msoLogger.debug("backoutOnFailure: "+ backoutOnFailure)
+ logger.debug("backoutOnFailure: "+ backoutOnFailure)
def failIfExists = execution.getVariable("failIfExists")
if(failIfExists == null) {
@@ -375,14 +378,14 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
}
String messageId = UUID.randomUUID()
- msoLogger.debug("messageId to be used is generated: " + messageId)
+ logger.debug("messageId to be used is generated: " + messageId)
def notificationUrl = createCallbackURL(execution, "VNFAResponse", messageId)
def useQualifiedHostName = UrnPropertiesReader.getVariable("mso.use.qualified.host",execution)
if ('true'.equals(useQualifiedHostName)) {
notificationUrl = utils.getQualifiedHostNameForCallback(notificationUrl)
}
- msoLogger.debug("CreateVfModuleVolume - notificationUrl: "+ notificationUrl)
+ logger.debug("CreateVfModuleVolume - notificationUrl: "+ notificationUrl)
// build request
String vnfSubCreateWorkflowRequest =
@@ -430,14 +433,14 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
"""
String vnfSubCreateWorkflowRequestAsString = utils.formatXml(vnfSubCreateWorkflowRequest)
- msoLogger.debug(vnfSubCreateWorkflowRequestAsString)
- msoLogger.debug(vnfSubCreateWorkflowRequestAsString)
+ logger.debug(vnfSubCreateWorkflowRequestAsString)
+ logger.debug(vnfSubCreateWorkflowRequestAsString)
execution.setVariable(prefix+"createVnfARequest", vnfSubCreateWorkflowRequestAsString)
// build rollback request for use later if needed
String vnfSubRollbackWorkflowRequest = buildRollbackVolumeGroupRequestXml(volumeGroupId, cloudSiteId, tenantId, requestId, serviceId, messageId, notificationUrl)
- msoLogger.debug("Sub Vnf flow rollback request: vnfSubRollbackWorkflowRequest " + "\n" + vnfSubRollbackWorkflowRequest)
+ logger.debug("Sub Vnf flow rollback request: vnfSubRollbackWorkflowRequest " + "\n" + vnfSubRollbackWorkflowRequest)
String vnfSubRollbackWorkflowRequestAsString = utils.formatXml(vnfSubRollbackWorkflowRequest)
execution.setVariable(prefix+"rollbackVnfARequest", vnfSubRollbackWorkflowRequestAsString)
@@ -478,13 +481,13 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
*/
public void validateVnfResponse(DelegateExecution execution, isDebugEnabled) {
def vnfSuccess = execution.getVariable('VNFREST_SuccessIndicator')
- msoLogger.debug("vnfAdapterSuccessIndicator: "+ vnfSuccess)
+ logger.debug("vnfAdapterSuccessIndicator: "+ vnfSuccess)
if(vnfSuccess==true) {
String createVnfAResponse = execution.getVariable(prefix+"createVnfAResponse")
String heatStackID = utils.getNodeText(createVnfAResponse, "volumeGroupStackId")
String vnfRollbackRequest = execution.getVariable(prefix+"rollbackVnfARequest")
String updatedVnfRollbackRequest = updateRollbackVolumeGroupRequestXml(vnfRollbackRequest, heatStackID)
- msoLogger.debug("vnfAdapter rollback request: "+ updatedVnfRollbackRequest)
+ logger.debug("vnfAdapter rollback request: "+ updatedVnfRollbackRequest)
RollbackData rollbackData = execution.getVariable("rollbackData")
rollbackData.put("DCVFMODULEVOL", "rollbackVnfARequest", updatedVnfRollbackRequest)
rollbackData.put("DCVFMODULEVOL", "isCreateVnfRollbackNeeded", "true")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy
index deb0bffaf9..2c433863aa 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -41,6 +43,8 @@ import org.onap.so.bpmn.core.domain.VnfResource
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.AAIResourcesClient
import org.onap.so.client.aai.entities.AAIResultWrapper
@@ -58,7 +62,7 @@ import org.json.JSONObject
*/
class DoCreateVnf extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateVnf.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateVnf.class);
String Prefix="DoCVNF_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
@@ -76,7 +80,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
public void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
- msoLogger.debug("STARTED DoCreateVnf PreProcessRequest Process")
+ logger.debug("STARTED DoCreateVnf PreProcessRequest Process")
// DISABLE SDNC INTERACTION FOR NOW
execution.setVariable("SDNCInteractionEnabled", false)
@@ -97,16 +101,16 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
String requestId = execution.getVariable("msoRequestId")
execution.setVariable("DoCVNF_requestId", requestId)
execution.setVariable("mso-request-id", requestId)
- msoLogger.debug("Incoming Request Id is: " + requestId)
+ logger.debug("Incoming Request Id is: " + requestId)
String serviceInstanceId = execution.getVariable("serviceInstanceId")
execution.setVariable("DoCVNF_serviceInstanceId", serviceInstanceId)
rollbackData.put("VNF", "serviceInstanceId", serviceInstanceId)
- msoLogger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
+ logger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
String vnfType = execution.getVariable("vnfType")
execution.setVariable("DoCVNF_vnfType", vnfType)
- msoLogger.debug("Incoming Vnf Type is: " + vnfType)
+ logger.debug("Incoming Vnf Type is: " + vnfType)
String vnfName = execution.getVariable("vnfName")
if (vnfName.equals("") || vnfName.equals("null")) {
@@ -119,70 +123,70 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
}
execution.setVariable("DoCVNF_vnfName", vnfName)
- msoLogger.debug("Incoming Vnf Name is: " + vnfName)
+ logger.debug("Incoming Vnf Name is: " + vnfName)
String serviceId = execution.getVariable("productFamilyId")
execution.setVariable("DoCVNF_serviceId", serviceId)
- msoLogger.debug("Incoming Service Id is: " + serviceId)
+ logger.debug("Incoming Service Id is: " + serviceId)
String source = "VID"
execution.setVariable("DoCVNF_source", source)
rollbackData.put("VNF", "source", source)
- msoLogger.debug("Incoming Source is: " + source)
+ logger.debug("Incoming Source is: " + source)
String suppressRollback = execution.getVariable("disableRollback")
execution.setVariable("DoCVNF_suppressRollback", suppressRollback)
- msoLogger.debug("Incoming Suppress Rollback is: " + suppressRollback)
+ logger.debug("Incoming Suppress Rollback is: " + suppressRollback)
String modelInvariantId = jsonUtil.getJsonValue(vnfModelInfo, "modelInvariantUuid")
execution.setVariable("DoCVNF_modelInvariantId", modelInvariantId)
- msoLogger.debug("Incoming Invariant Id is: " + modelInvariantId)
+ logger.debug("Incoming Invariant Id is: " + modelInvariantId)
String modelVersionId = jsonUtil.getJsonValue(vnfModelInfo, "modelUuid")
if (modelVersionId == null) {
modelVersionId = ""
}
execution.setVariable("DoCVNF_modelVersionId", modelVersionId)
- msoLogger.debug("Incoming Version Id is: " + modelVersionId)
+ logger.debug("Incoming Version Id is: " + modelVersionId)
String modelVersion = jsonUtil.getJsonValue(vnfModelInfo, "modelVersion")
execution.setVariable("DoCVNF_modelVersion", modelVersion)
- msoLogger.debug("Incoming Model Version is: " + modelVersion)
+ logger.debug("Incoming Model Version is: " + modelVersion)
String modelName = jsonUtil.getJsonValue(vnfModelInfo, "modelName")
execution.setVariable("DoCVNF_modelName", modelName)
- msoLogger.debug("Incoming Model Name is: " + modelName)
+ logger.debug("Incoming Model Name is: " + modelName)
String modelCustomizationId = jsonUtil.getJsonValue(vnfModelInfo, "modelCustomizationUuid")
if (modelCustomizationId == null) {
modelCustomizationId = ""
}
execution.setVariable("DoCVNF_modelCustomizationId", modelCustomizationId)
- msoLogger.debug("Incoming Model Customization Id is: " + modelCustomizationId)
+ logger.debug("Incoming Model Customization Id is: " + modelCustomizationId)
String cloudSiteId = execution.getVariable("lcpCloudRegionId")
execution.setVariable("DoCVNF_cloudSiteId", cloudSiteId)
rollbackData.put("VNF", "cloudSiteId", cloudSiteId)
- msoLogger.debug("Incoming Cloud Site Id is: " + cloudSiteId)
+ logger.debug("Incoming Cloud Site Id is: " + cloudSiteId)
String tenantId = execution.getVariable("tenantId")
execution.setVariable("DoCVNF_tenantId", tenantId)
rollbackData.put("VNF", "tenantId", tenantId)
- msoLogger.debug("Incoming Tenant Id is: " + tenantId)
+ logger.debug("Incoming Tenant Id is: " + tenantId)
String globalSubscriberId = execution.getVariable("globalSubscriberId")
if (globalSubscriberId == null) {
globalSubscriberId = ""
}
execution.setVariable("DoCVNF_globalSubscriberId", globalSubscriberId)
- msoLogger.debug("Incoming Global Subscriber Id is: " + globalSubscriberId)
+ logger.debug("Incoming Global Subscriber Id is: " + globalSubscriberId)
String sdncVersion = execution.getVariable("sdncVersion")
if (sdncVersion == null) {
sdncVersion = "1702"
}
execution.setVariable("DoCVNF_sdncVersion", sdncVersion)
- msoLogger.debug("Incoming Sdnc Version is: " + sdncVersion)
+ logger.debug("Incoming Sdnc Version is: " + sdncVersion)
//For Completion Handler & Fallout Handler
String requestInfo =
@@ -205,7 +209,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
vnfId = execution.getVariable("vnfId")
if (isBlank(vnfId)) {
vnfId = UUID.randomUUID().toString()
- msoLogger.debug("Generated Vnf Id is: " + vnfId)
+ logger.debug("Generated Vnf Id is: " + vnfId)
}
}
execution.setVariable("DoCVNF_vnfId", vnfId)
@@ -217,30 +221,31 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
String sdncCallbackUrl = (String) UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution)
if (sdncCallbackUrl == null || sdncCallbackUrl.trim().isEmpty()) {
def msg = 'Required variable \'mso.workflow.sdncadapter.callback\' is missing'
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, msg, "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError);
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
execution.setVariable("DoCVNF_sdncCallbackUrl", sdncCallbackUrl)
rollbackData.put("VNF", "sdncCallbackUrl", sdncCallbackUrl)
- msoLogger.debug("SDNC Callback URL is: " + sdncCallbackUrl)
+ logger.debug("SDNC Callback URL is: " + sdncCallbackUrl)
VnfResource vnfResource = (VnfResource) execution.getVariable((String)"vnfResourceDecomposition")
String nfRole = vnfResource.getNfRole()
execution.setVariable("DoCVNF_nfRole", nfRole)
- msoLogger.debug("NF Role is: " + nfRole)
+ logger.debug("NF Role is: " + nfRole)
String nfNamingCode = vnfResource.getNfNamingCode()
execution.setVariable("DoCVNF_nfNamingCode", nfNamingCode)
- msoLogger.debug("NF Naming Code is: " + nfNamingCode)
+ logger.debug("NF Naming Code is: " + nfNamingCode)
String nfType = vnfResource.getNfType()
execution.setVariable("DoCVNF_nfType", nfType)
- msoLogger.debug("NF Type is: " + nfType)
+ logger.debug("NF Type is: " + nfType)
String nfFunction = vnfResource.getNfFunction()
execution.setVariable("DoCVNF_nfFunction", nfFunction)
- msoLogger.debug("NF Function is: " + nfFunction)
+ logger.debug("NF Function is: " + nfFunction)
// Set Homing Info
try {
@@ -248,13 +253,13 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
if (homingInstance != null) {
execution.setVariable("DoCVNF_cloudSiteId", homingInstance.getCloudRegionId())
rollbackData.put("VNF", "cloudSiteId", homingInstance.getCloudRegionId())
- msoLogger.debug("Overwriting cloudSiteId with homing cloudSiteId: " +
+ logger.debug("Overwriting cloudSiteId with homing cloudSiteId: " +
homingInstance.getCloudRegionId())
}
} catch (Exception exception) {
- msoLogger.debug("Could not find homing information for service instance: " + serviceInstanceId +
+ logger.debug("Could not find homing information for service instance: " + serviceInstanceId +
"... continuing")
- msoLogger.debug("Could not find homing information for service instance error: " + exception)
+ logger.debug("Could not find homing information for service instance error: " + exception)
}
rollbackData.put("VNF", "rollbackSDNCAssign", "false")
@@ -264,14 +269,14 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
execution.setVariable("rollbackData", rollbackData)
}catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
}catch(Exception e){
- msoLogger.debug(" Error Occured in DoCreateVnf PreProcessRequest method!" + e.getMessage())
+ logger.debug(" Error Occured in DoCreateVnf PreProcessRequest method!" + e.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf PreProcessRequest")
}
- msoLogger.trace("COMPLETED DoCreateVnf PreProcessRequest Process")
+ logger.trace("COMPLETED DoCreateVnf PreProcessRequest Process")
}
/**
@@ -298,7 +303,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
throw e;
}catch(Exception ex) {
String msg = "Exception in getServiceInstance. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -313,14 +318,14 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
public void createGenericVnf (DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED DoCreateVnf CreateGenericVnf Process")
+ logger.trace("STARTED DoCreateVnf CreateGenericVnf Process")
try {
//Get Vnf Info
String vnfId = getVariableEnforced(execution, "DoCVNF_vnfId")
String vnfName = getVariableEnforced(execution, "DoCVNF_vnfName")
if (vnfName == null) {
vnfName = "sdncGenerated"
- msoLogger.debug("Sending a dummy VNF name to AAI - the name will be generated by SDNC: " + vnfName)
+ logger.debug("Sending a dummy VNF name to AAI - the name will be generated by SDNC: " + vnfName)
}
String vnfType = getVariableEnforced(execution, "DoCVNF_vnfType")
String serviceId = getVariableEnforced(execution, "DoCVNF_serviceId")
@@ -363,17 +368,17 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
resourceClient.connect(uri, siUri)
}catch(Exception ex) {
- msoLogger.debug("Error Occured in DoCreateVnf CreateGenericVnf Process ", ex)
+ logger.debug("Error Occured in DoCreateVnf CreateGenericVnf Process ", ex)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf CreateGenericVnf Process")
}
- msoLogger.trace("COMPLETED DoCreateVnf CreateGenericVnf Process")
+ logger.trace("COMPLETED DoCreateVnf CreateGenericVnf Process")
}
public void postProcessCreateGenericVnf (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED DoCreateVnf PostProcessCreateGenericVnf Process")
+ logger.trace("STARTED DoCreateVnf PostProcessCreateGenericVnf Process")
try {
//Get Vnf Info
String vnfId = execution.getVariable("DoCVNF_vnfId")
@@ -382,20 +387,20 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
rollbackData.put("VNF", "rollbackVnfCreate", "true")
execution.setVariable("rollbackData", rollbackData)
}catch(Exception ex) {
- msoLogger.debug("Error Occured in DoCreateVnf PostProcessCreateGenericVnf Process " + ex.getMessage())
+ logger.debug("Error Occured in DoCreateVnf PostProcessCreateGenericVnf Process " + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf PostProcessCreateGenericVnf Process")
}
- msoLogger.trace("COMPLETED DoCreateVnf PostProcessCreateGenericVnf Process")
+ logger.trace("COMPLETED DoCreateVnf PostProcessCreateGenericVnf Process")
}
public void preProcessSDNCAssignRequest(DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessSDNCAssignRequest")
+ logger.trace("STARTED preProcessSDNCAssignRequest")
def vnfId = execution.getVariable("DoCVNF_vnfId")
def serviceInstanceId = execution.getVariable("DoCVNF_serviceInstanceId")
- msoLogger.debug("NEW VNF ID: " + vnfId)
+ logger.debug("NEW VNF ID: " + vnfId)
try{
//Build SDNC Request
@@ -404,13 +409,15 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
assignSDNCRequest = utils.formatXml(assignSDNCRequest)
execution.setVariable("DoCVNF_assignSDNCRequest", assignSDNCRequest)
- msoLogger.debug("Outgoing AssignSDNCRequest is: \n" + assignSDNCRequest)
+ logger.debug("Outgoing AssignSDNCRequest is: \n" + assignSDNCRequest)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessSDNCAssignRequest" , "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e)
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preProcessSDNCAssignRequest", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessSDNCAssignRequest Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCAssignRequest")
+ logger.trace("COMPLETED preProcessSDNCAssignRequest")
}
public void preProcessSDNCActivateRequest(DelegateExecution execution) {
@@ -418,9 +425,9 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessSDNCActivateRequest Process")
+ logger.trace("STARTED preProcessSDNCActivateRequest Process")
try{
String vnfId = execution.getVariable("DoCVNF_vnfId")
String serviceInstanceId = execution.getVariable("DoCVNF_serviceInstanceId")
@@ -428,13 +435,13 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
String activateSDNCRequest = buildSDNCRequest(execution, serviceInstanceId, "activate")
execution.setVariable("DoCVNF_activateSDNCRequest", activateSDNCRequest)
- msoLogger.debug("Outgoing CommitSDNCRequest is: \n" + activateSDNCRequest)
+ logger.debug("Outgoing CommitSDNCRequest is: \n" + activateSDNCRequest)
}catch(Exception e){
- msoLogger.debug("Exception Occured Processing preProcessSDNCActivateRequest. Exception is:\n" + e)
+ logger.debug("Exception Occured Processing preProcessSDNCActivateRequest. Exception is:\n" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessSDNCActivateRequest Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCActivateRequest Process")
+ logger.trace("COMPLETED preProcessSDNCActivateRequest Process")
}
public String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action){
@@ -515,34 +522,34 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
</sdncadapterworkflow:SDNCRequestData>
</sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
- msoLogger.debug("sdncRequest: " + sdncRequest)
+ logger.debug("sdncRequest: " + sdncRequest)
return sdncRequest
}
public void validateSDNCResponse(DelegateExecution execution, String response, String method){
def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
- msoLogger.debug("STARTED ValidateSDNCResponse Process")
+ logger.debug("STARTED ValidateSDNCResponse Process")
WorkflowException workflowException = execution.getVariable("WorkflowException")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
- msoLogger.debug("SDNCResponse: " + response)
+ logger.debug("SDNCResponse: " + response)
String sdncResponse = response
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
- msoLogger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
+ logger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
if(method.equals("get")){
String topologyGetResponse = execution.getVariable("DoCVNF_getSDNCAdapterResponse")
String data = utils.getNodeXml(topologyGetResponse, "response-data")
- msoLogger.debug("topologyGetResponseData: " + data)
+ logger.debug("topologyGetResponseData: " + data)
String vnfName = utils.getNodeText(data, "vnf-name")
- msoLogger.debug("vnfName received from SDNC: " + vnfName)
+ logger.debug("vnfName received from SDNC: " + vnfName)
execution.setVariable("vnfName", vnfName)
execution.setVariable("DoCVNF_vnfName", vnfName)
}
@@ -557,16 +564,16 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
}else{
- msoLogger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
+ logger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
throw new BpmnError("MSOWorkflowException")
}
- msoLogger.debug("COMPLETED ValidateSDNCResponse Process")
+ logger.debug("COMPLETED ValidateSDNCResponse Process")
}
public void preProcessSDNCGetRequest(DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessSDNCGetRequest Process")
+ logger.trace("STARTED preProcessSDNCGetRequest Process")
try{
def serviceInstanceId = execution.getVariable('DoCVNF_serviceInstanceId')
@@ -576,7 +583,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
}
def callbackUrl = execution.getVariable("DoCVFM_sdncCallbackUrl")
- msoLogger.debug("callbackUrl:" + callbackUrl)
+ logger.debug("callbackUrl:" + callbackUrl)
def vnfId = execution.getVariable('DCVFM_vnfId')
@@ -590,14 +597,14 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
// serviceOperation will be retrieved from "object-path" element
// in SDNC Assign Response for VNF
String response = execution.getVariable("DoCVNF_assignSDNCAdapterResponse")
- msoLogger.debug("DoCVNF_assignSDNCAdapterResponse is: \n" + response)
+ logger.debug("DoCVNF_assignSDNCAdapterResponse is: \n" + response)
String serviceOperation = ""
String data = utils.getNodeXml(response, "response-data")
- msoLogger.debug("responseData: " + data)
+ logger.debug("responseData: " + data)
serviceOperation = utils.getNodeText(data, "object-path")
- msoLogger.debug("VNF with sdncVersion of 1707 or later - service operation: " + serviceOperation)
+ logger.debug("VNF with sdncVersion of 1707 or later - service operation: " + serviceOperation)
//!!!! TEMPORARY WORKAROUND FOR SDNC REPLICATION ISSUE
@@ -620,13 +627,15 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
execution.setVariable("DoCVNF_getSDNCRequest", SDNCGetRequest)
- msoLogger.debug("Outgoing GetSDNCRequest is: \n" + SDNCGetRequest)
+ logger.debug("Outgoing GetSDNCRequest is: \n" + SDNCGetRequest)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occurred Processing preProcessSDNCGetRequest. ", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occurred Processing preProcessSDNCGetRequest. ", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during prepareProvision Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCGetRequest Process")
+ logger.trace("COMPLETED preProcessSDNCGetRequest Process")
}
/**
@@ -639,11 +648,11 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def vnfId = execution.getVariable('DoCVNF_vnfId')
- msoLogger.debug("VNF ID: " + vnfId)
+ logger.debug("VNF ID: " + vnfId)
String updateAAIGenericVnfRequest = """
<UpdateAAIGenericVnfRequest>
@@ -653,14 +662,16 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
"""
updateAAIGenericVnfRequest = utils.formatXml(updateAAIGenericVnfRequest)
execution.setVariable('DoCVNF_updateAAIGenericVnfRequest', updateAAIGenericVnfRequest)
- msoLogger.debug('Request for UpdateAAIGenericVnf:\n' + updateAAIGenericVnfRequest)
+ logger.debug('Request for UpdateAAIGenericVnf:\n' + updateAAIGenericVnfRequest)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Caught exception in " + method , "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Caught exception in " + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepUpdateAAIGenericVnf(): ' + e.getMessage())
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModules.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModules.groovy
index 88e7b34dcd..4730462ac6 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModules.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModules.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -39,6 +41,8 @@ import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.onap.so.bpmn.infrastructure.aai.groovyflows.AAICreateResources;
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.onap.so.logger.MessageEnum
import static org.apache.commons.lang3.StringUtils.*;
@@ -51,7 +55,7 @@ import static org.apache.commons.lang3.StringUtils.*;
*/
class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateVnfAndModules.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateVnfAndModules.class);
String Prefix="DCVAM_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
@@ -67,7 +71,7 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
public void preProcessRequest(DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED DoCreateVnfAndModules PreProcessRequest Process")
+ logger.trace("STARTED DoCreateVnfAndModules PreProcessRequest Process")
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
setBasicDBAuthHeader(execution, isDebugLogEnabled)
@@ -81,46 +85,46 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
String requestId = execution.getVariable("msoRequestId")
execution.setVariable("requestId", requestId)
execution.setVariable("mso-request-id", requestId)
- msoLogger.debug("Incoming Request Id is: " + requestId)
+ logger.debug("Incoming Request Id is: " + requestId)
String serviceInstanceId = execution.getVariable("serviceInstanceId")
- msoLogger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
+ logger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
String vnfName = execution.getVariable("vnfName")
execution.setVariable("CREVI_vnfName", vnfName)
- msoLogger.debug("Incoming Vnf Name is: " + vnfName)
+ logger.debug("Incoming Vnf Name is: " + vnfName)
String productFamilyId = execution.getVariable("productFamilyId")
- msoLogger.debug("Incoming Product Family Id is: " + productFamilyId)
+ logger.debug("Incoming Product Family Id is: " + productFamilyId)
String source = "VID"
execution.setVariable("source", source)
- msoLogger.debug("Incoming Source is: " + source)
+ logger.debug("Incoming Source is: " + source)
String lcpCloudRegionId = execution.getVariable("lcpCloudRegionId")
- msoLogger.debug("Incoming LCP Cloud Region Id is: " + lcpCloudRegionId)
+ logger.debug("Incoming LCP Cloud Region Id is: " + lcpCloudRegionId)
String tenantId = execution.getVariable("tenantId")
- msoLogger.debug("Incoming Tenant Id is: " + tenantId)
+ logger.debug("Incoming Tenant Id is: " + tenantId)
String disableRollback = execution.getVariable("disableRollback")
- msoLogger.debug("Incoming Disable Rollback is: " + disableRollback)
+ logger.debug("Incoming Disable Rollback is: " + disableRollback)
String asdcServiceModelVersion = execution.getVariable("asdcServiceModelVersion")
- msoLogger.debug("Incoming asdcServiceModelVersion: " + asdcServiceModelVersion)
+ logger.debug("Incoming asdcServiceModelVersion: " + asdcServiceModelVersion)
String vnfId = execution.getVariable("testVnfId") // for junits
if(isBlank(vnfId)){
vnfId = execution.getVariable("vnfId")
if (isBlank(vnfId)) {
vnfId = UUID.randomUUID().toString()
- msoLogger.debug("Generated Vnf Id is: " + vnfId)
+ logger.debug("Generated Vnf Id is: " + vnfId)
}
}
execution.setVariable("vnfId", vnfId)
Map<String,String> vfModuleNames = execution.getVariable("vfModuleNames")
- msoLogger.debug("Incoming vfModuleNames: " + vfModuleNames)
+ logger.debug("Incoming vfModuleNames: " + vfModuleNames)
// Set aLaCarte to false
execution.setVariable("aLaCarte", false)
@@ -148,72 +152,72 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
}
if (longDelayMS > 0) {
- msoLogger.debug("Delaying workflow " + longDelayMS + "ms");
+ logger.debug("Delaying workflow " + longDelayMS + "ms");
sleep(longDelayMS)
}
}catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
}catch(Exception e){
- msoLogger.debug(" Error Occured in DoCreateVnfAndModules PreProcessRequest method!" + e.getMessage())
+ logger.debug(" Error Occured in DoCreateVnfAndModules PreProcessRequest method!" + e.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf PreProcessRequest")
}
- msoLogger.trace("COMPLETED DoCreateVnfAndModules PreProcessRequest Process")
+ logger.trace("COMPLETED DoCreateVnfAndModules PreProcessRequest Process")
}
public void queryCatalogDB (DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED DoCreateVnfAndModules QueryCatalogDB Process")
+ logger.trace("STARTED DoCreateVnfAndModules QueryCatalogDB Process")
try {
VnfResource vnf = null
// if serviceDecomposition is specified, get info from serviceDecomposition
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
if (serviceDecomposition != null) {
- msoLogger.debug("Getting Catalog DB data from ServiceDecomposition object: " + serviceDecomposition.toJsonString())
+ logger.debug("Getting Catalog DB data from ServiceDecomposition object: " + serviceDecomposition.toJsonString())
List<VnfResource> vnfs = serviceDecomposition.getVnfResources()
- msoLogger.debug("Read vnfs")
+ logger.debug("Read vnfs")
if (vnfs == null) {
- msoLogger.debug("Error - vnfs are empty in serviceDecomposition object")
+ logger.debug("Error - vnfs are empty in serviceDecomposition object")
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf queryCatalogDB, vnfs are empty")
}
vnf = vnfs[0]
String serviceModelName = serviceDecomposition.getModelInfo().getModelName()
vnf.constructVnfType(serviceModelName)
String vnfType = vnf.getVnfType()
- msoLogger.debug("Incoming Vnf Type is: " + vnfType)
+ logger.debug("Incoming Vnf Type is: " + vnfType)
execution.setVariable("vnfType", vnfType)
}
else {
//Get Vnf Info
String vnfModelInfo = execution.getVariable("vnfModelInfo")
- msoLogger.debug("vnfModelInfo: " + vnfModelInfo)
+ logger.debug("vnfModelInfo: " + vnfModelInfo)
String vnfModelCustomizationUuid = jsonUtil.getJsonValueForKey(vnfModelInfo, "modelCustomizationUuid")
if (vnfModelCustomizationUuid == null) {
vnfModelCustomizationUuid = ""
}
- msoLogger.debug("querying Catalog DB by vnfModelCustomizationUuid: " + vnfModelCustomizationUuid)
+ logger.debug("querying Catalog DB by vnfModelCustomizationUuid: " + vnfModelCustomizationUuid)
JSONArray vnfs = catalogDbUtils.getAllVnfsByVnfModelCustomizationUuid(execution,
vnfModelCustomizationUuid, "v1")
- msoLogger.debug("obtained VNF list")
+ logger.debug("obtained VNF list")
// Only one match here
JSONObject vnfObject = vnfs[0]
vnf = DecomposeJsonUtil.jsonToVnfResource(vnfObject.toString())
}
- msoLogger.debug("Read vnfResource")
+ logger.debug("Read vnfResource")
if (vnf == null) {
- msoLogger.debug("Error - vnf is empty in serviceDecomposition object")
+ logger.debug("Error - vnf is empty in serviceDecomposition object")
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf queryCatalogDB, vnf is null")
}
execution.setVariable("vnfResourceDecomposition", vnf)
List<ModuleResource> vfModules = vnf.getAllVfModuleObjects()
- msoLogger.debug("Read vfModules")
+ logger.debug("Read vfModules")
if (vfModules == null) {
- msoLogger.debug("Error - vfModules are empty in serviceDecomposition object")
+ logger.debug("Error - vfModules are empty in serviceDecomposition object")
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf queryCatalogDB, vf modules are empty")
}
@@ -221,7 +225,7 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
Map<String,String> vfModuleNames = execution.getVariable("vfModuleNames")
for (int i = 0; i < vfModules.size; i++) {
- msoLogger.debug("handling VF Module ")
+ logger.debug("handling VF Module ")
ModuleResource vfModule = vfModules[i]
boolean isBase = vfModule.getIsBase()
if (isBase) {
@@ -254,7 +258,7 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
execution.setVariable("addOnModulesDeployed", 0)
}catch(Exception ex) {
- msoLogger.debug("Error Occured in DoCreateVnfAndModules QueryCatalogDB Process " + ex.getMessage())
+ logger.debug("Error Occured in DoCreateVnfAndModules QueryCatalogDB Process " + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnfAndModules QueryCatalogDB Process")
}
@@ -267,13 +271,13 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
execution.setVariable("vnfId", "skask")
}
- msoLogger.trace("COMPLETED DoCreateVnfAndModules QueryCatalogDB Process")
+ logger.trace("COMPLETED DoCreateVnfAndModules QueryCatalogDB Process")
}
public void preProcessAddOnModule(DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.debug("STARTED preProcessAddOnModule")
+ logger.debug("STARTED preProcessAddOnModule")
try {
List<ModuleResource>addOnModules = execution.getVariable("addOnModules")
@@ -281,7 +285,7 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
ModuleResource addOnModule = addOnModules[addOnIndex]
- msoLogger.debug("Got addon module")
+ logger.debug("Got addon module")
def newVfModuleId = UUID.randomUUID().toString()
execution.setVariable("addOnVfModuleId", newVfModuleId)
@@ -304,32 +308,36 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessAddOnModule ", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preProcessAddOnModule ", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessAddOnModule Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessAddOnModule")
+ logger.trace("COMPLETED preProcessAddOnModule")
}
public void postProcessAddOnModule(DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED postProcessAddOnModule")
+ logger.trace("STARTED postProcessAddOnModule")
try {
int addOnModulesDeployed = execution.getVariable("addOnModulesDeployed")
execution.setVariable("addOnModulesDeployed", addOnModulesDeployed + 1)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing postProcessAddOnModule ", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing postProcessAddOnModule ", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during postProcessAddOnModule Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED postProcessAddOnModule")
+ logger.trace("COMPLETED postProcessAddOnModule")
}
public void validateBaseModule(DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED validateBaseModule")
+ logger.trace("STARTED validateBaseModule")
try {
def baseRollbackData = execution.getVariable("DCVAM_baseRollbackData")
@@ -338,26 +346,28 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
def baseModuleMap = baseRollbackData.get("VFMODULE")
baseModuleMap.each{ k, v -> rollbackData.put("VFMODULE_BASE", "${k}","${v}") }
execution.setVariable("rollbackData", rollbackData)
- msoLogger.debug("addOnModulesDeployed: " + execution.getVariable("addOnModulesDeployed"))
- msoLogger.debug("addOnModulesToDeploy: " + execution.getVariable("addOnModulesToDeploy"))
+ logger.debug("addOnModulesDeployed: " + execution.getVariable("addOnModulesDeployed"))
+ logger.debug("addOnModulesToDeploy: " + execution.getVariable("addOnModulesToDeploy"))
if (execution.getVariable("addOnModulesDeployed") < execution.getVariable("addOnModulesToDeploy")) {
- msoLogger.debug("More add on modules to deploy")
+ logger.debug("More add on modules to deploy")
}
else {
- msoLogger.debug("No more add on modules to deploy")
+ logger.debug("No more add on modules to deploy")
}
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing validateBaseModule ", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing validateBaseModule ", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during validateBaseModule Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED validateBaseModule")
+ logger.trace("COMPLETED validateBaseModule")
}
public void validateAddOnModule(DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED validateAddOnModule")
+ logger.trace("STARTED validateAddOnModule")
try {
int instancesOfThisModuleDeployed = execution.getVariable("instancesOfThisModuleDeployed")
@@ -377,102 +387,104 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
rollbackData.put("VNFANDMODULES", "numOfCreatedAddOnModules", "${numOfCreatedAddOnModules}")
execution.setVariable("rollbackData", rollbackData)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessAddOnModule ", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preProcessAddOnModule ", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessAddOnModule Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED validateAddOnModule")
+ logger.trace("COMPLETED validateAddOnModule")
}
public void preProcessRollback (DelegateExecution execution) {
- msoLogger.trace("preProcessRollback")
+ logger.trace("preProcessRollback")
try {
Object workflowException = execution.getVariable("WorkflowException");
if (workflowException instanceof WorkflowException) {
- msoLogger.debug("Prev workflowException: " + workflowException.getErrorMessage())
+ logger.debug("Prev workflowException: " + workflowException.getErrorMessage())
execution.setVariable("prevWorkflowException", workflowException);
//execution.setVariable("WorkflowException", null);
}
} catch (BpmnError e) {
- msoLogger.debug("BPMN Error during preProcessRollback")
+ logger.debug("BPMN Error during preProcessRollback")
} catch(Exception ex) {
String msg = "Exception in preProcessRollback. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
- msoLogger.trace("Exit preProcessRollback")
+ logger.trace("Exit preProcessRollback")
}
public void postProcessRollback (DelegateExecution execution) {
- msoLogger.trace("postProcessRollback")
+ logger.trace("postProcessRollback")
String msg = ""
try {
Object workflowException = execution.getVariable("prevWorkflowException");
if (workflowException instanceof WorkflowException) {
- msoLogger.debug("Setting prevException to WorkflowException: ")
+ logger.debug("Setting prevException to WorkflowException: ")
execution.setVariable("WorkflowException", workflowException);
}
execution.setVariable("rollbackData", null)
} catch (BpmnError b) {
- msoLogger.debug("BPMN Error during postProcessRollback")
+ logger.debug("BPMN Error during postProcessRollback")
throw b;
} catch(Exception ex) {
msg = "Exception in postProcessRollback. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
- msoLogger.trace("Exit postProcessRollback")
+ logger.trace("Exit postProcessRollback")
}
public void createPlatform (DelegateExecution execution) {
- msoLogger.trace("START createPlatform")
+ logger.trace("START createPlatform")
String platformName = execution.getVariable("platformName")
String vnfId = execution.getVariable("vnfId")
- msoLogger.debug("Platform NAME: " + platformName)
- msoLogger.debug("VnfID: " + vnfId)
+ logger.debug("Platform NAME: " + platformName)
+ logger.debug("VnfID: " + vnfId)
if(isBlank(platformName)){
- msoLogger.debug("platformName was not found. Continuing on with flow...")
+ logger.debug("platformName was not found. Continuing on with flow...")
}else{
- msoLogger.debug("platformName was found.")
+ logger.debug("platformName was found.")
try{
AAICreateResources aaiCR = new AAICreateResources()
aaiCR.createAAIPlatform(platformName, vnfId)
}catch(Exception ex){
String msg = "Exception in createPlatform. " + ex.getMessage();
- msoLogger.debug(msg)
+ logger.debug(msg)
}
}
- msoLogger.trace("Exit createPlatform")
+ logger.trace("Exit createPlatform")
}
public void createLineOfBusiness (DelegateExecution execution) {
- msoLogger.trace("START createLineOfBusiness")
+ logger.trace("START createLineOfBusiness")
String lineOfBusiness = execution.getVariable("lineOfBusiness")
String vnfId = execution.getVariable("vnfId")
- msoLogger.debug("LineOfBusiness NAME: " + lineOfBusiness)
- msoLogger.debug("VnfID: " + vnfId)
+ logger.debug("LineOfBusiness NAME: " + lineOfBusiness)
+ logger.debug("VnfID: " + vnfId)
if(isBlank(lineOfBusiness)){
- msoLogger.debug("LineOfBusiness was not found. Continuing on with flow...")
+ logger.debug("LineOfBusiness was not found. Continuing on with flow...")
}else{
- msoLogger.debug("LineOfBusiness was found.")
+ logger.debug("LineOfBusiness was found.")
try{
AAICreateResources aaiCR = new AAICreateResources()
aaiCR.createAAILineOfBusiness(lineOfBusiness, vnfId)
}catch(Exception ex){
String msg = "Exception in LineOfBusiness. " + ex.getMessage();
- msoLogger.debug(msg)
+ logger.debug(msg)
}
}
- msoLogger.trace("Exit createLineOfBusiness")
+ logger.trace("Exit createLineOfBusiness")
}
public String getPredefinedVfModuleName(DelegateExecution execution, String vfModuleModelInvariantUuid) {
@@ -485,7 +497,7 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
String vfModuleName = vfModuleNames.get(vfModuleModelInvariantUuid)
if (vfModuleName != null) {
- msoLogger.debug("Using vfModuleName='" + vfModuleName + "' for vfModuleModelInvariantUuid=" + vfModuleModelInvariantUuid)
+ logger.debug("Using vfModuleName='" + vfModuleName + "' for vfModuleModelInvariantUuid=" + vfModuleModelInvariantUuid)
}
return vfModuleName
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy
index eafc39b1dd..2de7314a98 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -33,6 +35,8 @@ import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
/**
* This class supports the macro VID Flow
@@ -40,7 +44,7 @@ import org.onap.so.logger.MsoLogger
*/
class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateVnfAndModulesRollback.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCreateVnfAndModulesRollback.class);
String Prefix="DCVAMR_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
@@ -56,13 +60,13 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
public void preProcessRequest(DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
- msoLogger.debug("STARTED DoCreateVnfAndModulesRollback PreProcessRequest Process")
+ logger.debug("STARTED DoCreateVnfAndModulesRollback PreProcessRequest Process")
try{
// Get Rollback Variables
def rollbackData = execution.getVariable("rollbackData")
- msoLogger.debug("Incoming RollbackData is: " + rollbackData.toString())
+ logger.debug("Incoming RollbackData is: " + rollbackData.toString())
execution.setVariable("rolledBack", null)
execution.setVariable("rollbackError", null)
@@ -72,7 +76,7 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
}
String vnfId = rollbackData.get("VNF", "vnfId")
- msoLogger.debug("Rollback vnfId is: " + vnfId)
+ logger.debug("Rollback vnfId is: " + vnfId)
execution.setVariable("DCVAMR_vnfId", vnfId)
execution.setVariable("mso-request-id", execution.getVariable("msoRequestId"))
@@ -82,23 +86,23 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
execution.setVariable("DCVAMR_rollbackVnfCreate", rollbackData.get("VNF", "rollbackVnfCreate"))
String sdncCallbackUrl = rollbackData.get("VNF", "sdncCallbackUrl")
- msoLogger.debug("Rollback sdncCallbackUrl is: " + sdncCallbackUrl)
+ logger.debug("Rollback sdncCallbackUrl is: " + sdncCallbackUrl)
execution.setVariable("DCVAMR_sdncCallbackUrl", sdncCallbackUrl)
String tenantId= rollbackData.get("VNF", "tenantId")
- msoLogger.debug("Rollback tenantId is: " + tenantId)
+ logger.debug("Rollback tenantId is: " + tenantId)
execution.setVariable("DCVAMR_tenantId", tenantId)
String source= rollbackData.get("VNF", "source")
- msoLogger.debug("Rollback source is: " + source)
+ logger.debug("Rollback source is: " + source)
execution.setVariable("DCVAMR_source", source)
String serviceInstanceId = rollbackData.get("VNF", "serviceInstanceId")
- msoLogger.debug("Rollback serviceInstanceId is: " + serviceInstanceId)
+ logger.debug("Rollback serviceInstanceId is: " + serviceInstanceId)
execution.setVariable("DCVAMR_serviceInstanceId", serviceInstanceId)
String cloudSiteId = rollbackData.get("VNF", "cloudSiteId")
- msoLogger.debug("Rollback cloudSiteId is: " + cloudSiteId)
+ logger.debug("Rollback cloudSiteId is: " + cloudSiteId)
execution.setVariable("DCVAMR_cloudSiteId", cloudSiteId)
def numOfAddOnModulesString = rollbackData.get("VNFANDMODULES", "numOfCreatedAddOnModules")
@@ -121,14 +125,14 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
execution.setVariable("DCVAMR_aLaCarte", false)
}catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
}catch(Exception e){
- msoLogger.debug(" Error Occured in DoCreateVnfAndModulesRollback PreProcessRequest method!" + e.getMessage())
+ logger.debug(" Error Occured in DoCreateVnfAndModulesRollback PreProcessRequest method!" + e.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnfAndModulesRollback PreProcessRequest")
}
- msoLogger.trace("COMPLETED DoCreateVnfAndModulesRollback PreProcessRequest Process")
+ logger.trace("COMPLETED DoCreateVnfAndModulesRollback PreProcessRequest Process")
}
@@ -136,7 +140,7 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
public void preProcessCreateVfModuleRollback(DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessCreateVfModuleRollback")
+ logger.trace("STARTED preProcessCreateVfModuleRollback")
try {
@@ -145,33 +149,35 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
def vfModuleRollbackData = new RollbackData()
def numOfModulesToDelete = execution.getVariable("DCVAMR_numOfModulesToDelete")
- msoLogger.debug("numOfModulesToDelete: " + numOfModulesToDelete)
+ logger.debug("numOfModulesToDelete: " + numOfModulesToDelete)
def moduleMap = null
if (numOfModulesToDelete > 1) {
int addOnModuleIndex = numOfModulesToDelete - 1
moduleMap = rollbackData.get("VFMODULE_ADDON_" + addOnModuleIndex)
- msoLogger.debug("Removing ADDON VF module # " + addOnModuleIndex)
+ logger.debug("Removing ADDON VF module # " + addOnModuleIndex)
}
else {
moduleMap = rollbackData.get("VFMODULE_BASE")
- msoLogger.debug("Removing BASE VF module")
+ logger.debug("Removing BASE VF module")
}
moduleMap.each{ k, v -> vfModuleRollbackData.put("VFMODULE", "${k}","${v}") }
execution.setVariable("DCVAMR_RollbackData", vfModuleRollbackData)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessCreateVfModuleRollback ", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preProcessCreateVfModuleRollback ", "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessCreateVfModuleRollback Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessCreateVfModuleRollback")
+ logger.trace("COMPLETED preProcessCreateVfModuleRollback")
}
public void postProcessCreateVfModuleRollback(DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED postProcessCreateVfModuleRollback")
+ logger.trace("STARTED postProcessCreateVfModuleRollback")
def rolledBack = false
try {
@@ -179,22 +185,26 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
def numOfModulesToDelete = execution.getVariable("DCVAMR_numOfModulesToDelete")
execution.setVariable("DCVAMR_numOfModulesToDelete", numOfModulesToDelete - 1)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing postProcessCreateVfModuleRollback ", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing postProcessCreateVfModuleRollback ", "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during postProcessCreateVfModuleRollback Method:\n" + e.getMessage())
}
if (rolledBack == false) {
- msoLogger.debug("Failure on DoCreateVfModuleRollback")
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Unsuccessful rollback of DoCreateVfModule ", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError);
+ logger.debug("Failure on DoCreateVfModuleRollback")
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Unsuccessful rollback of DoCreateVfModule ", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue());
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during rollback of DoCreateVfModule")
}
- msoLogger.trace("COMPLETED postProcessCreateVfModuleRollback")
+ logger.trace("COMPLETED postProcessCreateVfModuleRollback")
}
public void preProcessSDNCDeactivateRequest(DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessSDNCDeactivateRequest")
+ logger.trace("STARTED preProcessSDNCDeactivateRequest")
def vnfId = execution.getVariable("vnfId")
def serviceInstanceId = execution.getVariable("serviceInstanceId")
@@ -205,13 +215,15 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
deactivateSDNCRequest = utils.formatXml(deactivateSDNCRequest)
execution.setVariable(Prefix + "deactivateSDNCRequest", deactivateSDNCRequest)
- msoLogger.debug("Outgoing DeactivateSDNCRequest is: \n" + deactivateSDNCRequest)
+ logger.debug("Outgoing DeactivateSDNCRequest is: \n" + deactivateSDNCRequest)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessSDNCDeactivateRequest ", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preProcessSDNCDeactivateRequest ", "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessSDNCDeactivateRequest Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCDeactivateRequest")
+ logger.trace("COMPLETED preProcessSDNCDeactivateRequest")
}
public void preProcessSDNCUnassignRequest(DelegateExecution execution) {
@@ -219,9 +231,9 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessSDNCUnassignRequest Process")
+ logger.trace("STARTED preProcessSDNCUnassignRequest Process")
try{
String vnfId = execution.getVariable("vnfId")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
@@ -229,13 +241,13 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
String unassignSDNCRequest = buildSDNCRequest(execution, serviceInstanceId, "unassign")
execution.setVariable(Prefix + "unassignSDNCRequest", unassignSDNCRequest)
- msoLogger.debug("Outgoing UnassignSDNCRequest is: \n" + unassignSDNCRequest)
+ logger.debug("Outgoing UnassignSDNCRequest is: \n" + unassignSDNCRequest)
}catch(Exception e){
- msoLogger.debug("Exception Occured Processing preProcessSDNCUnassignRequest. Exception is:\n" + e)
+ logger.debug("Exception Occured Processing preProcessSDNCUnassignRequest. Exception is:\n" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessSDNCUnassignRequest Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCUnassignRequest Process")
+ logger.trace("COMPLETED preProcessSDNCUnassignRequest Process")
}
public String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action){
@@ -291,37 +303,37 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
</sdncadapterworkflow:SDNCRequestData>
</sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
- msoLogger.debug("sdncRequest: " + sdncRequest)
+ logger.debug("sdncRequest: " + sdncRequest)
return sdncRequest
}
public void validateSDNCResponse(DelegateExecution execution, String response, String method){
execution.setVariable("prefix",Prefix)
- msoLogger.debug("STARTED ValidateSDNCResponse Process")
+ logger.debug("STARTED ValidateSDNCResponse Process")
WorkflowException workflowException = execution.getVariable("WorkflowException")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
String sdncResponse = response
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
- msoLogger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
+ logger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
}else{
- msoLogger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
+ logger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
throw new BpmnError("MSOWorkflowException")
}
- msoLogger.debug("COMPLETED ValidateSDNCResponse Process")
+ logger.debug("COMPLETED ValidateSDNCResponse Process")
}
public void setSuccessfulRollbackStatus (DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED setSuccessfulRollbackStatus")
+ logger.trace("STARTED setSuccessfulRollbackStatus")
try{
// Set rolledBack to true, rollbackError to null
@@ -329,16 +341,16 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
execution.setVariable("rollbackError", null)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing setSuccessfulRollbackStatus ", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "Exception Occured Processing setSuccessfulRollbackStatus ", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during setSuccessfulRollbackStatus Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED setSuccessfulRollbackStatus")
+ logger.trace("COMPLETED setSuccessfulRollbackStatus")
}
public void setFailedRollbackStatus (DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED setFailedRollbackStatus")
+ logger.trace("STARTED setFailedRollbackStatus")
try{
// Set rolledBack to false, rollbackError to actual value, rollbackData to null
@@ -350,10 +362,10 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
execution.setVariable("rollbackData", null)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing setFailedRollbackStatus. ", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "Exception Occured Processing setFailedRollbackStatus. ", "BPMN", MsoLogger.getServiceName(),MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during setFailedRollbackStatus Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED setFailedRollbackStatus")
+ logger.trace("COMPLETED setFailedRollbackStatus")
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy
index b30929d6bd..5b83ca6641 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -38,6 +40,8 @@ import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.springframework.web.util.UriUtils;
import org.w3c.dom.Document
import org.w3c.dom.Element
@@ -73,7 +77,7 @@ import groovy.json.*
* Rollback - Deferred
*/
public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCustomDeleteE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCustomDeleteE2EServiceInstance.class);
String Prefix="DDELSI_"
@@ -81,7 +85,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
JsonUtils jsonUtil = new JsonUtils()
public void preProcessRequest (DelegateExecution execution) {
- msoLogger.trace("preProcessRequest ")
+ logger.trace("preProcessRequest ")
String msg = ""
try {
@@ -107,18 +111,18 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
String serviceInstanceId = execution.getVariable("serviceInstanceId")
if (isBlank(serviceInstanceId)){
msg = "Input serviceInstanceId is null"
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
String sdncCallbackUrl = UrnPropertiesReader.getVariable('mso.workflow.sdncadapter.callback',execution)
if (isBlank(sdncCallbackUrl)) {
msg = "URN_mso_workflow_sdncadapter_callback is null"
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
- msoLogger.info("SDNC Callback URL: " + sdncCallbackUrl)
+ logger.info("SDNC Callback URL: " + sdncCallbackUrl)
StringBuilder sbParams = new StringBuilder()
Map<String, String> paramsMap = execution.getVariable("serviceInputParams")
@@ -148,10 +152,10 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit preProcessRequest ")
+ logger.trace("Exit preProcessRequest ")
}
@@ -162,7 +166,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
}
public void preProcessSDNCDelete (DelegateExecution execution) {
- msoLogger.trace("preProcessSDNCDelete ")
+ logger.trace("preProcessSDNCDelete ")
String msg = ""
try {
@@ -261,52 +265,52 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
String sdncDeactivate = sdncDelete.replace(">delete<", ">deactivate<").replace(">${sdncRequestId}<", ">${sdncRequestId2}<")
execution.setVariable("sdncDelete", sdncDelete)
execution.setVariable("sdncDeactivate", sdncDeactivate)
- msoLogger.info("sdncDeactivate:\n" + sdncDeactivate)
- msoLogger.info("sdncDelete:\n" + sdncDelete)
+ logger.info("sdncDeactivate:\n" + sdncDeactivate)
+ logger.info("sdncDelete:\n" + sdncDelete)
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in preProcessSDNCDelete. " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "Exception Occured in preProcessSDNCDelete.\n" + ex.getMessage())
}
- msoLogger.info(" *****Exit preProcessSDNCDelete *****")
+ logger.info(" *****Exit preProcessSDNCDelete *****")
}
public void postProcessSDNCDelete(DelegateExecution execution, String response, String method) {
- msoLogger.trace("postProcessSDNC " + method + " ")
+ logger.trace("postProcessSDNC " + method + " ")
String msg = ""
/*try {
WorkflowException workflowException = execution.getVariable("WorkflowException")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.info("SDNCResponse: " + response)
- msoLogger.info("workflowException: " + workflowException)
+ logger.info("SDNCResponse: " + response)
+ logger.info("workflowException: " + workflowException)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == "true"){
- msoLogger.info("Good response from SDNC Adapter for service-instance " + method + "response:\n" + response)
+ logger.info("Good response from SDNC Adapter for service-instance " + method + "response:\n" + response)
}else{
msg = "Bad Response from SDNC Adapter for service-instance " + method
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 3500, msg)
}
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in postProcessSDNC " + method + " Exception:" + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}*/
- msoLogger.trace("Exit postProcessSDNC " + method + " ")
+ logger.trace("Exit postProcessSDNC " + method + " ")
}
public void postProcessAAIGET(DelegateExecution execution) {
- msoLogger.trace("postProcessAAIGET ")
+ logger.trace("postProcessAAIGET ")
String msg = ""
try {
@@ -315,22 +319,22 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
String serviceType = ""
if(foundInAAI){
- msoLogger.info("Found Service-instance in AAI")
+ logger.info("Found Service-instance in AAI")
String siData = execution.getVariable("GENGS_service")
- msoLogger.info("SI Data")
+ logger.info("SI Data")
if (isBlank(siData))
{
msg = "Could not retrive ServiceInstance data from AAI to delete id:" + serviceInstanceId
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
else
{
- msoLogger.info("SI Data" + siData)
+ logger.info("SI Data" + siData)
//Confirm there are no related service instances (vnf/network or volume)
if (utils.nodeExists(siData, "relationship-list")) {
- msoLogger.info("SI Data relationship-list exists:")
+ logger.info("SI Data relationship-list exists:")
InputSource source = new InputSource(new StringReader(siData));
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder()
@@ -346,7 +350,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
def e = eElement.getElementsByTagName("related-to").item(0).getTextContent() //for ns
if(e.equals("service-instance")){
def relatedObject = eElement.getElementsByTagName("related-link").item(0).getTextContent()
- msoLogger.info("ServiceInstance Related NS :" + relatedObject)
+ logger.info("ServiceInstance Related NS :" + relatedObject)
NodeList dataList = node.getChildNodes()
if(null != dataList) {
JSONObject jObj = new JSONObject()
@@ -369,13 +373,13 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
}
}
}
- msoLogger.info("Relationship related to Resource:" + jObj.toString())
+ logger.info("Relationship related to Resource:" + jObj.toString())
jArray.put(jObj)
}
//for overlay/underlay
}else if (e.equals("configuration")){
def relatedObject = eElement.getElementsByTagName("related-link").item(0).getTextContent()
- msoLogger.info("ServiceInstance Related Configuration :" + relatedObject)
+ logger.info("ServiceInstance Related Configuration :" + relatedObject)
NodeList dataList = node.getChildNodes()
if(null != dataList) {
JSONObject jObj = new JSONObject()
@@ -398,7 +402,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
}
}
}
- msoLogger.info("Relationship related to Resource:" + jObj.toString())
+ logger.info("Relationship related to Resource:" + jObj.toString())
jArray.put(jObj)
}
}
@@ -410,37 +414,37 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
}else{
boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
if(!succInAAI){
- msoLogger.info("Error getting Service-instance from AAI", + serviceInstanceId)
+ logger.info("Error getting Service-instance from AAI", + serviceInstanceId)
WorkflowException workflowException = execution.getVariable("WorkflowException")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
if(workflowException != null){
exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
}
else
{
msg = "Failure in postProcessAAIGET GENGS_SuccessIndicator:" + succInAAI
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
}
}
- msoLogger.info("Service-instance NOT found in AAI. Silent Success")
+ logger.info("Service-instance NOT found in AAI. Silent Success")
}
}catch (BpmnError e) {
throw e;
} catch (Exception ex) {
msg = "Exception in DoDeleteE2EServiceInstance.postProcessAAIGET. " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit postProcessAAIGET ")
+ logger.trace("Exit postProcessAAIGET ")
}
/**
* Deletes the service instance in aai
*/
public void deleteServiceInstance(DelegateExecution execution) {
- msoLogger.trace("Entered deleteServiceInstance")
+ logger.trace("Entered deleteServiceInstance")
try {
String globalCustId = execution.getVariable("globalSubscriberId")
String serviceType = execution.getVariable("serviceType")
@@ -450,15 +454,15 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustId, serviceType, serviceInstanceId)
resourceClient.delete(serviceInstanceUri)
- msoLogger.trace("Exited deleteServiceInstance")
+ logger.trace("Exited deleteServiceInstance")
}catch(Exception e){
- msoLogger.debug("Error occured within deleteServiceInstance method: " + e)
+ logger.debug("Error occured within deleteServiceInstance method: " + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Error occured during deleteServiceInstance from aai")
}
}
public void preInitResourcesOperStatus(DelegateExecution execution){
- msoLogger.trace("STARTED preInitResourcesOperStatus Process ")
+ logger.trace("STARTED preInitResourcesOperStatus Process ")
try{
String serviceId = execution.getVariable("serviceInstanceId")
String operationId = execution.getVariable("operationId")
@@ -468,7 +472,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
String progress = "0"
String reason = ""
String operationContent = "Prepare service creation"
- msoLogger.info("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType)
+ logger.info("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType)
serviceId = UriUtils.encode(serviceId,"UTF-8")
execution.setVariable("serviceInstanceId", serviceId)
execution.setVariable("operationId", operationId)
@@ -523,14 +527,16 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_initResOperStatusRequest", payload)
- msoLogger.info("Outgoing initResourceOperationStatus: \n" + payload)
- msoLogger.debug("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)
+ logger.info("Outgoing initResourceOperationStatus: \n" + payload)
+ logger.debug("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preInitResourcesOperStatus.", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preInitResourcesOperStatus.", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), e);
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preInitResourcesOperStatus Process ")
+ logger.trace("COMPLETED preInitResourcesOperStatus Process ")
}
/**
@@ -556,7 +562,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
"resourceType":"underlay"
}
]*/
- msoLogger.trace("STARTED preResourceDelete Process ")
+ logger.trace("STARTED preResourceDelete Process ")
String serviceRelationShip = execution.getVariable("serviceRelationShip")
def jsonSlurper = new JsonSlurper()
def jsonOutput = new JsonOutput()
@@ -570,15 +576,15 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
execution.setVariable("resourceTemplateId", resourceTemplateUUID)
execution.setVariable("resourceInstanceId", resourceInstanceUUID)
execution.setVariable("resourceType", resourceName)
- msoLogger.info("Delete Resource Info resourceTemplate Id :" + resourceTemplateUUID + " resourceInstanceId: " + resourceInstanceUUID + " resourceType: " + resourceName)
+ logger.info("Delete Resource Info resourceTemplate Id :" + resourceTemplateUUID + " resourceInstanceId: " + resourceInstanceUUID + " resourceType: " + resourceName)
}
}
}
- msoLogger.trace("END preResourceDelete Process ")
+ logger.trace("END preResourceDelete Process ")
}
public void sequenceResource(execution){
- msoLogger.trace("STARTED sequenceResource Process ")
+ logger.trace("STARTED sequenceResource Process ")
List<String> nsResources = new ArrayList<String>()
List<String> wanResources = new ArrayList<String>()
List<String> resourceSequence = new ArrayList<String>()
@@ -605,13 +611,13 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
execution.setVariable("isContainsWanResource", isContainsWanResource)
execution.setVariable("currentResourceIndex", 0)
execution.setVariable("resourceSequence", resourceSequence)
- msoLogger.info("resourceSequence: " + resourceSequence)
+ logger.info("resourceSequence: " + resourceSequence)
execution.setVariable("wanResources", wanResources)
- msoLogger.trace("END sequenceResource Process ")
+ logger.trace("END sequenceResource Process ")
}
public void getCurrentResource(execution){
- msoLogger.trace("Start getCurrentResoure Process ")
+ logger.trace("Start getCurrentResoure Process ")
def currentIndex = execution.getVariable("currentResourceIndex")
List<String> resourceSequence = execution.getVariable("resourceSequence")
List<String> wanResources = execution.getVariable("wanResources")
@@ -622,11 +628,11 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
}else{
execution.setVariable("controllerInfo", "VF-C")
}
- msoLogger.trace("COMPLETED getCurrentResoure Process ")
+ logger.trace("COMPLETED getCurrentResoure Process ")
}
public void parseNextResource(execution){
- msoLogger.trace("Start parseNextResource Process ")
+ logger.trace("Start parseNextResource Process ")
def currentIndex = execution.getVariable("currentResourceIndex")
def nextIndex = currentIndex + 1
execution.setVariable("currentResourceIndex", nextIndex)
@@ -636,7 +642,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
}else{
execution.setVariable("allResourceFinished", "false")
}
- msoLogger.trace("COMPLETED parseNextResource Process ")
+ logger.trace("COMPLETED parseNextResource Process ")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceV2.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceV2.groovy
index 59ea5c236f..b16ccaa8fd 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceV2.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceV2.groovy
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -38,6 +40,8 @@ import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.springframework.web.util.UriUtils;
import org.onap.so.client.aai.AAIResourcesClient
@@ -71,7 +75,7 @@ import groovy.json.*
* Rollback - Deferred
*/
public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCustomDeleteE2EServiceInstanceV2.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoCustomDeleteE2EServiceInstanceV2.class);
String Prefix="DDELSI_"
@@ -82,8 +86,8 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
public void preProcessRequest (DelegateExecution execution) {
def method = getClass().getSimpleName() + '.buildAPPCRequest(' +'execution=' + execution.getId() +')'
- msoLogger.info("Entered " + method)
- msoLogger.trace("preProcessRequest ")
+ logger.info("Entered " + method)
+ logger.trace("preProcessRequest ")
String msg = ""
try {
@@ -109,18 +113,18 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
String serviceInstanceId = execution.getVariable("serviceInstanceId")
if (isBlank(serviceInstanceId)){
msg = "Input serviceInstanceId is null"
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
String sdncCallbackUrl = execution.getVariable('URN_mso_workflow_sdncadapter_callback')
if (isBlank(sdncCallbackUrl)) {
msg = "URN_mso_workflow_sdncadapter_callback is null"
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
- msoLogger.info("SDNC Callback URL: " + sdncCallbackUrl)
+ logger.info("SDNC Callback URL: " + sdncCallbackUrl)
StringBuilder sbParams = new StringBuilder()
Map<String, String> paramsMap = execution.getVariable("serviceInputParams")
@@ -152,10 +156,10 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.info("Exited " + method)
+ logger.info("Exited " + method)
}
/**
@@ -179,7 +183,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
}catch(BpmnError e) {
throw e;
}catch(NotFoundException e) {
- msoLogger.info("SI not found in aai. Silent Success ")
+ logger.info("SI not found in aai. Silent Success ")
}catch(Exception ex) {
String msg = "Internal Error in getServiceInstance: " + ex.getMessage()
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
@@ -189,41 +193,41 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
private void loadResourcesProperties(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.loadResourcesProperties(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugEnabled")
- msoLogger.info("Entered " + method)
+ logger.info("Entered " + method)
String loadFilePath = "/etc/mso/config.d/reources.json"
try{
def jsonPayload = new File(loadFilePath).text
- msoLogger.info("jsonPayload: " + jsonPayload)
+ logger.info("jsonPayload: " + jsonPayload)
String resourcesProperties = jsonUtil.prettyJson(jsonPayload.toString())
- msoLogger.info("resourcesProperties: " + resourcesProperties)
+ logger.info("resourcesProperties: " + resourcesProperties)
String createResourceSort = jsonUtil.getJsonValue(resourcesProperties, "CreateResourceSort")
- msoLogger.info("createResourceSort: " + createResourceSort)
+ logger.info("createResourceSort: " + createResourceSort)
execution.setVariable("createResourceSort", createResourceSort)
String deleteResourceSort = jsonUtil.getJsonValue(resourcesProperties, "DeleteResourceSort")
- msoLogger.info("deleteResourceSort: " + deleteResourceSort)
+ logger.info("deleteResourceSort: " + deleteResourceSort)
execution.setVariable("deleteResourceSort", deleteResourceSort)
String resourceControllerType = jsonUtil.getJsonValue(resourcesProperties, "ResourceControllerType")
- msoLogger.info("resourceControllerType: " + resourceControllerType)
+ logger.info("resourceControllerType: " + resourceControllerType)
execution.setVariable("resourceControllerType", resourceControllerType)
}catch(Exception ex){
// try error in method block
String exceptionMessage = "Bpmn error encountered in " + method + " - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- msoLogger.info("Exited " + method)
+ logger.info("Exited " + method)
}
private void sortDeleteResource(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.sortDeleteResource(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugEnabled")
- msoLogger.info("Entered " + method)
+ logger.info("Entered " + method)
String deleteResourceSortDef = """[
{
"resourceType":"GRE_SAR"
@@ -267,7 +271,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
}
List<String> sortResourceList = jsonUtil.StringArrayToList(execution, deleteResourceSort)
- msoLogger.info("sortResourceList : " + sortResourceList)
+ logger.info("sortResourceList : " + sortResourceList)
JSONArray newResourceList = new JSONArray()
int resSortCount = sortResourceList.size()
@@ -278,14 +282,14 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
List<String> resourceList = execution.getVariable(Prefix+"resourceList")
for (String resource : resourceList) {
- msoLogger.info("resource : " + resource)
+ logger.info("resource : " + resource)
String resourceType = jsonUtil.getJsonValue(resource, "resourceType")
if (StringUtils.containsIgnoreCase(resourceType, sortResourceType)) {
JSONObject jsonObj = new JSONObject(resource)
newResourceList.put(jsonObj)
}
- msoLogger.info("Get next sort type " )
+ logger.info("Get next sort type " )
}
}
@@ -293,20 +297,20 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
List<String> newResourceListStr = jsonUtil.StringArrayToList(execution, newResourceStr)
execution.setVariable(Prefix+"resourceList", newResourceListStr)
- msoLogger.info("newResourceList : " + newResourceListStr)
+ logger.info("newResourceList : " + newResourceListStr)
}catch(Exception ex){
// try error in method block
String exceptionMessage = "Bpmn error encountered in " + method + " - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- msoLogger.info("Exited " + method)
+ logger.info("Exited " + method)
}
public void prepareServiceDeleteResource(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.prepareServiceDeleteResource(' +'execution=' + execution.getId() +')'
- msoLogger.info("Entered " + method)
+ logger.info("Entered " + method)
try {
@@ -319,9 +323,9 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
execution.setVariable(Prefix+"resourceFinish", true)
String aaiJsonRecord = execution.getVariable("serviceInstance");
- msoLogger.info("serviceInstanceAaiRecord: " +aaiJsonRecord)
+ logger.info("serviceInstanceAaiRecord: " +aaiJsonRecord)
- msoLogger.info("aaiJsonRecord: " +aaiJsonRecord)
+ logger.info("aaiJsonRecord: " +aaiJsonRecord)
def serviceInstanceName = jsonUtil.getJsonValue(aaiJsonRecord, "service-instance.service-instance-name")
execution.setVariable("serviceInstanceName",serviceInstanceName)
@@ -330,11 +334,11 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
String relationshipList = jsonUtil.getJsonValue(aaiJsonRecord, "service-instance.relationship-list")
- msoLogger.info("relationship-list:" + relationshipList)
+ logger.info("relationship-list:" + relationshipList)
if (! isBlank(relationshipList)){
- msoLogger.info("relationship-list exists" )
+ logger.info("relationship-list exists" )
String relationShip = jsonUtil.getJsonValue(relationshipList, "relationship")
- msoLogger.info("relationship: " + relationShip)
+ logger.info("relationship: " + relationShip)
JSONArray allResources = new JSONArray()
JSONArray serviceResources = new JSONArray()
JSONArray networkResources = new JSONArray()
@@ -349,32 +353,32 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
} else if (relationShip.startsWith("[") && relationShip.endsWith("]")) {
jsonArray = new JSONArray(relationShip);
} else {
- msoLogger.info("The relationShip fomart is error" )
+ logger.info("The relationShip fomart is error" )
}
List<String> relationList = jsonUtil.StringArrayToList(execution, jsonArray.toString())
- msoLogger.info("relationList: " + relationList)
+ logger.info("relationList: " + relationList)
int relationNum =relationList.size()
- msoLogger.info("**************relationList size: " + relationNum)
+ logger.info("**************relationList size: " + relationNum)
for ( int currentRelation = 0 ; currentRelation < relationNum ; currentRelation++ ) {
- msoLogger.info("current Relation num: " + currentRelation)
+ logger.info("current Relation num: " + currentRelation)
String relation = relationList[currentRelation]
- msoLogger.info("relation: " + relation)
+ logger.info("relation: " + relation)
String relatedTo = jsonUtil.getJsonValue(relation, "related-to")
- msoLogger.info("relatedTo: " + relatedTo)
+ logger.info("relatedTo: " + relatedTo)
String relatedLink = jsonUtil.getJsonValue(relation, "related-link")
- msoLogger.info("relatedLink: " + relatedLink)
+ logger.info("relatedLink: " + relatedLink)
if (StringUtils.equalsIgnoreCase(relatedTo, "allotted-resource")) {
- msoLogger.info("allotted-resource exists ")
+ logger.info("allotted-resource exists ")
Optional<AllottedResource> aaiArRsp = getAaiAr(execution, relatedLink)
- msoLogger.info("aaiArRsp: " + aaiArRsp)
+ logger.info("aaiArRsp: " + aaiArRsp)
if (aaiArRsp.isPresent()) {
JSONObject jObject = new JSONObject()
@@ -384,22 +388,22 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
jObject.put("resourceVersion", aaiArRsp.get().getResourceVersion())
allResources.put(jObject)
- msoLogger.info("allResources: " + allResources)
+ logger.info("allResources: " + allResources)
allottedResources.put(jObject)
- msoLogger.info("allottedResources: " + allottedResources)
+ logger.info("allottedResources: " + allottedResources)
}
}
else if (StringUtils.equalsIgnoreCase(relatedTo, "service-instance")){
- msoLogger.info("service-instance exists ")
+ logger.info("service-instance exists ")
JSONObject jObject = new JSONObject()
//relationship-data
String rsDataStr = jsonUtil.getJsonValue(relation, "relationship-data")
- msoLogger.info("rsDataStr: " + rsDataStr)
+ logger.info("rsDataStr: " + rsDataStr)
List<String> rsDataList = jsonUtil.StringArrayToList(execution, rsDataStr)
- msoLogger.info("rsDataList: " + rsDataList)
+ logger.info("rsDataList: " + rsDataList)
for(String rsData : rsDataList){
- msoLogger.info("rsData: " + rsData)
+ logger.info("rsData: " + rsData)
def eKey = jsonUtil.getJsonValue(rsData, "relationship-key")
def eValue = jsonUtil.getJsonValue(rsData, "relationship-value")
if(eKey.equals("service-instance.service-instance-id")){
@@ -412,11 +416,11 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
//related-to-property
String rPropertyStr = jsonUtil.getJsonValue(relation, "related-to-property")
- msoLogger.info("related-to-property: " + rPropertyStr)
+ logger.info("related-to-property: " + rPropertyStr)
if (rPropertyStr instanceof JSONArray){
List<String> rPropertyList = jsonUtil.StringArrayToList(execution, rPropertyStr)
for (String rProperty : rPropertyList) {
- msoLogger.info("rProperty: " + rProperty)
+ logger.info("rProperty: " + rProperty)
def eKey = jsonUtil.getJsonValue(rProperty, "property-key")
def eValue = jsonUtil.getJsonValue(rProperty, "property-value")
if(eKey.equals("service-instance.service-instance-name")){
@@ -426,7 +430,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
}
else {
String rProperty = rPropertyStr
- msoLogger.info("rProperty: " + rProperty)
+ logger.info("rProperty: " + rProperty)
def eKey = jsonUtil.getJsonValue(rProperty, "property-key")
def eValue = jsonUtil.getJsonValue(rProperty, "property-value")
if (eKey.equals("service-instance.service-instance-name")) {
@@ -435,22 +439,22 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
}
allResources.put(jObject)
- msoLogger.info("allResources: " + allResources)
+ logger.info("allResources: " + allResources)
serviceResources.put(jObject)
- msoLogger.info("serviceResources: " + serviceResources)
+ logger.info("serviceResources: " + serviceResources)
}
else if (StringUtils.equalsIgnoreCase(relatedTo, "configuration")) {
- msoLogger.info("configuration ")
+ logger.info("configuration ")
JSONObject jObject = new JSONObject()
//relationship-data
String rsDataStr = jsonUtil.getJsonValue(relation, "relationship-data")
- msoLogger.info("rsDataStr: " + rsDataStr)
+ logger.info("rsDataStr: " + rsDataStr)
List<String> rsDataList = jsonUtil.StringArrayToList(execution, rsDataStr)
- msoLogger.info("rsDataList: " + rsDataList)
+ logger.info("rsDataList: " + rsDataList)
for (String rsData : rsDataList) {
- msoLogger.info("rsData: " + rsData)
+ logger.info("rsData: " + rsData)
def eKey = jsonUtil.getJsonValue(rsData, "relationship-key")
def eValue = jsonUtil.getJsonValue(rsData, "relationship-value")
if(eKey.equals("configuration.configuration-id")){
@@ -461,11 +465,11 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
//related-to-property
String rPropertyStr = jsonUtil.getJsonValue(relation, "related-to-property")
- msoLogger.info("related-to-property: " + rPropertyStr)
+ logger.info("related-to-property: " + rPropertyStr)
if (rPropertyStr instanceof JSONArray){
List<String> rPropertyList = jsonUtil.StringArrayToList(execution, rPropertyStr)
for(String rProperty : rPropertyList){
- msoLogger.info("rProperty: " + rProperty)
+ logger.info("rProperty: " + rProperty)
def eKey = jsonUtil.getJsonValue(rProperty, "property-key")
def eValue = jsonUtil.getJsonValue(rProperty, "property-value")
if(eKey.equals("configuration.configuration-type")){
@@ -475,7 +479,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
}
else {
String rProperty = rPropertyStr
- msoLogger.info("rProperty: " + rProperty)
+ logger.info("rProperty: " + rProperty)
def eKey = jsonUtil.getJsonValue(rProperty, "property-key")
def eValue = jsonUtil.getJsonValue(rProperty, "property-value")
if(eKey.equals("configuration.configuration-type")){
@@ -483,34 +487,34 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
}
}
allResources.put(jObject)
- msoLogger.info("allResources: " + allResources)
+ logger.info("allResources: " + allResources)
networkResources.put(jObject)
- msoLogger.info("networkResources: " + networkResources)
+ logger.info("networkResources: " + networkResources)
}
- msoLogger.info("Get Next releation resource " )
+ logger.info("Get Next releation resource " )
}
- msoLogger.info("Get releation finished. " )
+ logger.info("Get releation finished. " )
}
execution.setVariable("serviceRelationShip", allResources.toString())
- msoLogger.info("allResources: " + allResources.toString())
+ logger.info("allResources: " + allResources.toString())
String serviceRelationShip = execution.getVariable("serviceRelationShip")
- msoLogger.info("serviceRelationShip: " + serviceRelationShip)
+ logger.info("serviceRelationShip: " + serviceRelationShip)
if ((! isBlank(serviceRelationShip)) && (! serviceRelationShip.isEmpty())) {
List<String> relationShipList = jsonUtil.StringArrayToList(execution, serviceRelationShip)
- msoLogger.info("relationShipList: " + relationShipList)
+ logger.info("relationShipList: " + relationShipList)
execution.setVariable(Prefix+"resourceList", relationShipList)
int resourceCount = relationShipList.size()
- msoLogger.info("resourceCount: " + resourceCount)
+ logger.info("resourceCount: " + resourceCount)
execution.setVariable(Prefix+"resourceCount",resourceCount )
int resourceNum = 0
execution.setVariable(Prefix+"nextResource", resourceNum)
- msoLogger.info("start sort delete resource: ")
+ logger.info("start sort delete resource: ")
sortDeleteResource(execution)
@@ -520,48 +524,48 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
else {
execution.setVariable(Prefix+"resourceFinish", true)
}
- msoLogger.info("Resource list set end : " + resourceCount)
+ logger.info("Resource list set end : " + resourceCount)
}
execution.setVariable("serviceResources", serviceResources.toString())
- msoLogger.info("serviceResources: " + serviceResources)
+ logger.info("serviceResources: " + serviceResources)
String serviceResourcesShip = execution.getVariable("serviceResources")
- msoLogger.info("serviceResourcesShip: " + serviceResourcesShip)
+ logger.info("serviceResourcesShip: " + serviceResourcesShip)
if ((! isBlank(serviceResourcesShip)) && (! serviceResourcesShip.isEmpty())) {
List<String> serviceResourcesList = jsonUtil.StringArrayToList(execution, serviceResourcesShip)
- msoLogger.info("serviceResourcesList: " + serviceResourcesList)
+ logger.info("serviceResourcesList: " + serviceResourcesList)
execution.setVariable(Prefix+"serviceResourceList", serviceResourcesList)
execution.setVariable(Prefix+"serviceResourceCount", serviceResourcesList.size())
execution.setVariable(Prefix+"nextServiceResource", 0)
- msoLogger.info("Service Resource list set end : " + serviceResourcesList.size())
+ logger.info("Service Resource list set end : " + serviceResourcesList.size())
}
execution.setVariable("allottedResources", allottedResources.toString())
- msoLogger.info("allottedResources: " + allottedResources)
+ logger.info("allottedResources: " + allottedResources)
String allottedResourcesShip = execution.getVariable("allottedResources")
- msoLogger.info("allottedResourcesShip: " + allottedResourcesShip)
+ logger.info("allottedResourcesShip: " + allottedResourcesShip)
if ((! isBlank(allottedResourcesShip)) && (! allottedResourcesShip.isEmpty())) {
List<String> allottedResourcesList = jsonUtil.StringArrayToList(execution, allottedResourcesShip)
- msoLogger.info("allottedResourcesList: " + allottedResourcesList)
+ logger.info("allottedResourcesList: " + allottedResourcesList)
execution.setVariable(Prefix+"allottedResourcesList", allottedResourcesList)
execution.setVariable(Prefix+"allottedResourcesListCount", allottedResourcesList.size())
execution.setVariable(Prefix+"nextAllottedResourcesList", 0)
- msoLogger.info("Allotted Resource list set end : " + allottedResourcesList.size())
+ logger.info("Allotted Resource list set end : " + allottedResourcesList.size())
}
execution.setVariable("networkResources", networkResources.toString())
- msoLogger.info("networkResources: " + networkResources)
+ logger.info("networkResources: " + networkResources)
String networkResourcesShip = execution.getVariable("networkResources")
- msoLogger.info("networkResourcesShip: " + networkResourcesShip)
+ logger.info("networkResourcesShip: " + networkResourcesShip)
if ((! isBlank(networkResourcesShip)) && (! networkResourcesShip.isEmpty())) {
List<String> networkResourcesList = jsonUtil.StringArrayToList(execution, networkResourcesShip)
- msoLogger.info("networkResourcesList: " + networkResourcesList)
+ logger.info("networkResourcesList: " + networkResourcesList)
execution.setVariable(Prefix+"networkResourcesList", networkResourcesList)
execution.setVariable(Prefix+"networkResourcesListCount", networkResourcesList.size())
execution.setVariable(Prefix+"nextNetworkResourcesList", 0)
- msoLogger.info("Network Resource list set end : " + networkResourcesList.size())
+ logger.info("Network Resource list set end : " + networkResourcesList.size())
}
}
@@ -569,15 +573,15 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
throw e;
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DeleteMobileAPNCustService flow. prepareServiceDeleteResource() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- msoLogger.info("Exited " + method)
+ logger.info("Exited " + method)
}
private Optional<AllottedResource> getAaiAr(DelegateExecution execution, String relink) {
def method = getClass().getSimpleName() + '.getAaiAr(' +'execution=' + execution.getId() +')'
- msoLogger.info("Entered " + method)
+ logger.info("Entered " + method)
AAIResourceUri uri = AAIUriFactory.createResourceFromExistingURI(AAIObjectType.ALLOTTED_RESOURCE, UriBuilder.fromPath(relink).build())
return getAAIClient().get(AllottedResource.class,uri)
}
@@ -586,39 +590,39 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
*/
public void preProcessDecomposeNextResource(DelegateExecution execution){
def method = getClass().getSimpleName() + '.getAaiAr(' +'execution=' + execution.getId() +')'
- msoLogger.info("Entered " + method)
- msoLogger.trace("STARTED preProcessDecomposeNextResource Process ")
+ logger.info("Entered " + method)
+ logger.trace("STARTED preProcessDecomposeNextResource Process ")
try{
int resourceNum = execution.getVariable(Prefix+"nextServiceResource")
List<String> serviceResourceList = execution.getVariable(Prefix+"serviceResourceList")
- msoLogger.info("Service Resource List : " + serviceResourceList)
+ logger.info("Service Resource List : " + serviceResourceList)
String serviceResource = serviceResourceList[resourceNum]
execution.setVariable(Prefix+"serviceResource", serviceResource)
- msoLogger.info("Current Service Resource : " + serviceResource)
+ logger.info("Current Service Resource : " + serviceResource)
String resourceType = jsonUtil.getJsonValue(serviceResource, "resourceType")
execution.setVariable("resourceType", resourceType)
- msoLogger.info("resourceType : " + resourceType)
+ logger.info("resourceType : " + resourceType)
String resourceInstanceId = jsonUtil.getJsonValue(serviceResource, "resourceInstanceId")
execution.setVariable("resourceInstanceId", resourceInstanceId)
- msoLogger.info("resourceInstanceId : " + resourceInstanceId)
+ logger.info("resourceInstanceId : " + resourceInstanceId)
String resourceRole = jsonUtil.getJsonValue(serviceResource, "resourceRole")
execution.setVariable("resourceRole", resourceRole)
- msoLogger.info("resourceRole : " + resourceRole)
+ logger.info("resourceRole : " + resourceRole)
String resourceVersion = jsonUtil.getJsonValue(serviceResource, "resourceVersion")
execution.setVariable("resourceVersion", resourceVersion)
- msoLogger.info("resourceVersion : " + resourceVersion)
+ logger.info("resourceVersion : " + resourceVersion)
String resourceName = jsonUtil.getJsonValue(serviceResource, "resourceName")
if (isBlank(resourceName)){
resourceName = resourceInstanceId
}
execution.setVariable(Prefix+"resourceName", resourceName)
- msoLogger.info("resource Name : " + resourceName)
+ logger.info("resource Name : " + resourceName)
execution.setVariable(Prefix+"nextServiceResource", resourceNum + 1)
@@ -633,25 +637,25 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
}catch(Exception e){
// try error in method block
String exceptionMessage = "Bpmn error encountered in CreateMobileAPNCustService flow. Unexpected Error from method preProcessDecomposeNextResource() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- msoLogger.info("Exited " + method)
+ logger.info("Exited " + method)
}
/**
* post Decompose next resource to create request
*/
public void postProcessDecomposeNextResource(DelegateExecution execution){
def method = getClass().getSimpleName() + '.postProcessDecomposeNextResource(' +'execution=' + execution.getId() +')'
- msoLogger.info("Entered " + method)
- msoLogger.trace("STARTED postProcessDecomposeNextResource Process ")
+ logger.info("Entered " + method)
+ logger.trace("STARTED postProcessDecomposeNextResource Process ")
try{
String resourceName = execution.getVariable(Prefix+"resourceName")
int resourceNum = execution.getVariable(Prefix+"nextServiceResource")
- msoLogger.debug("Current Resource count:"+ execution.getVariable(Prefix+"nextServiceResource"))
+ logger.debug("Current Resource count:"+ execution.getVariable(Prefix+"nextServiceResource"))
int resourceCount = execution.getVariable(Prefix+"serviceResourceCount")
- msoLogger.debug("Total Resource count:"+ execution.getVariable(Prefix+"serviceResourceCount"))
+ logger.debug("Total Resource count:"+ execution.getVariable(Prefix+"serviceResourceCount"))
if (resourceNum < resourceCount) {
execution.setVariable(Prefix+"resourceFinish", false)
@@ -660,13 +664,13 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
execution.setVariable(Prefix+"resourceFinish", true)
}
- msoLogger.debug("Resource Finished:"+ execution.getVariable(Prefix+"resourceFinish"))
+ logger.debug("Resource Finished:"+ execution.getVariable(Prefix+"resourceFinish"))
if (resourceCount >0 ){
int progress = (resourceNum*100) / resourceCount
execution.setVariable("progress", progress.toString() )
- msoLogger.trace(":"+ execution.getVariable(""))
+ logger.trace(":"+ execution.getVariable(""))
}
execution.setVariable("operationStatus", resourceName )
@@ -674,10 +678,10 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
}catch(Exception e){
// try error in method block
String exceptionMessage = "Bpmn error encountered in CreateMobileAPNCustService flow. Unexpected Error from method postProcessDecomposeNextResource() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- msoLogger.info("Exited " + method)
+ logger.info("Exited " + method)
}
/**
* prepare post Unkown Resource Type
@@ -685,7 +689,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
public void postOtherControllerType(DelegateExecution execution){
def method = getClass().getSimpleName() + '.postOtherControllerType(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugEnabled")
- msoLogger.info("Entered " + method)
+ logger.info("Entered " + method)
try{
@@ -694,15 +698,15 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
String controllerType = execution.getVariable("controllerType")
String msg = "Resource name: "+ resourceName + " resource Type: " + resourceType+ " controller Type: " + controllerType + " can not be processed n the workflow"
- msoLogger.debug(msg)
+ logger.debug(msg)
}catch(Exception e){
// try error in method block
String exceptionMessage = "Bpmn error encountered in DoCreateMobileAPNServiceInstance flow. Unexpected Error from method postOtherControllerType() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- msoLogger.info("Exited " + method)
+ logger.info("Exited " + method)
}
/**
@@ -712,9 +716,9 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
// we use resource instance ids for delete flow as resourceTemplateUUIDs
def method = getClass().getSimpleName() + '.preSDNCResourceDelete(' +'execution=' + execution.getId() +')'
- msoLogger.info("Entered " + method)
+ logger.info("Entered " + method)
- msoLogger.trace("STARTED preSDNCResourceDelete Process ")
+ logger.trace("STARTED preSDNCResourceDelete Process ")
String networkResources = execution.getVariable("networkResources")
@@ -730,16 +734,16 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
execution.setVariable("resourceInstanceId", resourceInstanceUUID)
execution.setVariable("resourceType", resourceName)
execution.setVariable("foundResource", true)
- msoLogger.info("Delete Resource Info resourceTemplate Id :" + resourceTemplateUUID + " resourceInstanceId: " + resourceInstanceUUID + " resourceType: " + resourceName)
+ logger.info("Delete Resource Info resourceTemplate Id :" + resourceTemplateUUID + " resourceInstanceId: " + resourceInstanceUUID + " resourceType: " + resourceName)
}
}
}
- msoLogger.info("Exited " + method)
+ logger.info("Exited " + method)
}
public void preProcessSDNCDelete (DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessSDNCDelete(' +'execution=' + execution.getId() +')'
- msoLogger.info("Entered " + method)
- msoLogger.trace("preProcessSDNCDelete ")
+ logger.info("Entered " + method)
+ logger.trace("preProcessSDNCDelete ")
String msg = ""
try {
@@ -838,50 +842,50 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
String sdncDeactivate = sdncDelete.replace(">delete<", ">deactivate<").replace(">${sdncRequestId}<", ">${sdncRequestId2}<")
execution.setVariable("sdncDelete", sdncDelete)
execution.setVariable("sdncDeactivate", sdncDeactivate)
- msoLogger.info("sdncDeactivate:\n" + sdncDeactivate)
- msoLogger.info("sdncDelete:\n" + sdncDelete)
+ logger.info("sdncDeactivate:\n" + sdncDeactivate)
+ logger.info("sdncDelete:\n" + sdncDelete)
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in preProcessSDNCDelete. " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "Exception Occured in preProcessSDNCDelete.\n" + ex.getMessage())
}
- msoLogger.info("Exited " + method)
+ logger.info("Exited " + method)
}
public void postProcessSDNCDelete(DelegateExecution execution, String response, String action) {
def method = getClass().getSimpleName() + '.postProcessSDNCDelete(' +'execution=' + execution.getId() +')'
- msoLogger.info("Entered " + method)
- msoLogger.trace("postProcessSDNC " + action + " ")
+ logger.info("Entered " + method)
+ logger.trace("postProcessSDNC " + action + " ")
String msg = ""
/*try {
WorkflowException workflowException = execution.getVariable("WorkflowException")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.info("SDNCResponse: " + response)
- msoLogger.info("workflowException: " + workflowException)
+ logger.info("SDNCResponse: " + response)
+ logger.info("workflowException: " + workflowException)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == "true"){
- msoLogger.info("Good response from SDNC Adapter for service-instance " + action + "response:\n" + response)
+ logger.info("Good response from SDNC Adapter for service-instance " + action + "response:\n" + response)
}else{
msg = "Bad Response from SDNC Adapter for service-instance " + action
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 3500, msg)
}
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in postProcessSDNC " + action + " Exception:" + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}*/
- msoLogger.info("Exited " + method)
+ logger.info("Exited " + method)
}
/**
@@ -889,7 +893,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
*/
public void preUpdateServiceOperationStatus(DelegateExecution execution){
def method = getClass().getSimpleName() + '.preUpdateServiceOperationStatus(' +'execution=' + execution.getId() +')'
- msoLogger.info("Entered " + method)
+ logger.info("Entered " + method)
try{
String serviceId = execution.getVariable("serviceInstanceId")
@@ -899,14 +903,14 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
String userId = ""
String result = "processing"
String progress = execution.getVariable("progress")
- msoLogger.info("progress: " + progress )
+ logger.info("progress: " + progress )
if ("100".equalsIgnoreCase(progress))
{
result = "finished"
}
String reason = ""
String operationContent = "Prepare service delete: " + execution.getVariable("operationStatus")
- msoLogger.info("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId)
+ logger.info("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId)
serviceId = UriUtils.encode(serviceId,"UTF-8")
execution.setVariable("serviceInstanceId", serviceId)
execution.setVariable("operationId", operationId)
@@ -914,7 +918,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
- msoLogger.info("DB Adapter Endpoint is: " + dbAdapterEndpoint)
+ logger.info("DB Adapter Endpoint is: " + dbAdapterEndpoint)
String payload =
"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
@@ -937,22 +941,24 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)
- msoLogger.info("Outgoing preUpdateServiceOperationStatus: \n" + payload)
+ logger.info("Outgoing preUpdateServiceOperationStatus: \n" + payload)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preUpdateServiceOperationStatus.", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preUpdateServiceOperationStatus.", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), e);
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preUpdateServiceOperationStatus Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preUpdateServiceOperationStatus Process ")
- msoLogger.info("Exited " + method)
+ logger.trace("COMPLETED preUpdateServiceOperationStatus Process ")
+ logger.info("Exited " + method)
}
public void preInitResourcesOperStatus(DelegateExecution execution){
def method = getClass().getSimpleName() + '.preInitResourcesOperStatus(' +'execution=' + execution.getId() +')'
- msoLogger.info("Entered " + method)
+ logger.info("Entered " + method)
- msoLogger.trace("STARTED preInitResourcesOperStatus Process ")
+ logger.trace("STARTED preInitResourcesOperStatus Process ")
String msg=""
try{
String serviceId = execution.getVariable("serviceInstanceId")
@@ -963,14 +969,14 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
String progress = "0"
String reason = ""
String operationContent = "Prepare service delete"
- msoLogger.info("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType)
+ logger.info("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType)
serviceId = UriUtils.encode(serviceId,"UTF-8")
execution.setVariable("serviceInstanceId", serviceId)
execution.setVariable("operationId", operationId)
execution.setVariable("operationType", operationType)
String serviceRelationShip = execution.getVariable("serviceRelationShip")
- msoLogger.info("serviceRelationShip: " + serviceRelationShip)
+ logger.info("serviceRelationShip: " + serviceRelationShip)
if (! isBlank(serviceRelationShip)) {
def jsonSlurper = new JsonSlurper()
def jsonOutput = new JsonOutput()
@@ -985,7 +991,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
- msoLogger.info("DB Adapter Endpoint is: " + dbAdapterEndpoint)
+ logger.info("DB Adapter Endpoint is: " + dbAdapterEndpoint)
String payload =
"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
@@ -1003,17 +1009,17 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_initResOperStatusRequest", payload)
- msoLogger.info("Outgoing initResourceOperationStatus: \n" + payload)
- msoLogger.debug("DoCustomDeleteE2EServiceInstanceV2 Outgoing initResourceOperationStatus Request: " + payload)
+ logger.info("Outgoing initResourceOperationStatus: \n" + payload)
+ logger.debug("DoCustomDeleteE2EServiceInstanceV2 Outgoing initResourceOperationStatus Request: " + payload)
}catch (BpmnError e) {
throw e;
} catch (Exception ex) {
msg = "Exception in DoCustomDeleteE2EServiceInstanceV2.preInitResourcesOperStatus. " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.info("Exited " + method)
+ logger.info("Exited " + method)
}
@@ -1025,21 +1031,21 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
// we use resource instance ids for delete flow as resourceTemplateUUIDs
def method = getClass().getSimpleName() + '.preProcessVFCResourceDelete(' +'execution=' + execution.getId() +')'
- msoLogger.info("Entered " + method)
+ logger.info("Entered " + method)
- msoLogger.trace("STARTED preProcessVFCResourceDelete Process ")
+ logger.trace("STARTED preProcessVFCResourceDelete Process ")
try{
String serviceResource = execution.getVariable("serviceResource")
- msoLogger.info("serviceResource : " + serviceResource)
+ logger.info("serviceResource : " + serviceResource)
String resourceInstanceId = execution.getVariable("resourceInstanceId")
- msoLogger.info("resourceInstanceId : " + resourceInstanceId)
+ logger.info("resourceInstanceId : " + resourceInstanceId)
execution.setVariable("resourceTemplateId", resourceInstanceId)
- msoLogger.info("resourceTemplateId : " + resourceInstanceId)
+ logger.info("resourceTemplateId : " + resourceInstanceId)
String resourceType = execution.getVariable("resourceType")
- msoLogger.info("resourceType : " + resourceType)
+ logger.info("resourceType : " + resourceType)
String resourceName = execution.getVariable(Prefix+"resourceName")
@@ -1047,34 +1053,34 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
resourceName = resourceInstanceId
}
execution.setVariable("resourceName", resourceName)
- msoLogger.info("resource Name : " + resourceName)
+ logger.info("resource Name : " + resourceName)
- msoLogger.info("Delete Resource Info: resourceInstanceId :" + resourceInstanceId + " resourceTemplateId: " + resourceInstanceId + " resourceType: " + resourceType)
+ logger.info("Delete Resource Info: resourceInstanceId :" + resourceInstanceId + " resourceTemplateId: " + resourceInstanceId + " resourceType: " + resourceType)
}catch (BpmnError e) {
throw e;
} catch (Exception ex) {
msg = "Exception in DoDeleteE2EServiceInstance.preProcessVFCResourceDelete. " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.info("Exited " + method)
+ logger.info("Exited " + method)
}
public void postProcessVFCDelete(DelegateExecution execution, String response, String action) {
def method = getClass().getSimpleName() + '.postProcessVFCDelete(' +'execution=' + execution.getId() +')'
- msoLogger.info("Entered " + method)
+ logger.info("Entered " + method)
- msoLogger.trace("STARTED postProcessVFCDelete Process ")
+ logger.trace("STARTED postProcessVFCDelete Process ")
try{
}catch (BpmnError e) {
throw e;
} catch (Exception ex) {
msg = "Exception in DoDeleteE2EServiceInstance.postProcessVFCDelete. " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.info("Exited " + method)
+ logger.info("Exited " + method)
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
index 48f255bf91..f2af481f66 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -36,7 +38,8 @@ import org.onap.so.bpmn.core.domain.ServiceDecomposition
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.client.HttpClient
import org.onap.so.client.HttpClientFactory
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.onap.so.utils.TargetEntity
import org.springframework.web.util.UriUtils
import org.w3c.dom.Document
@@ -76,11 +79,11 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
String Prefix="DDEESI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoDeleteE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoDeleteE2EServiceInstance.class);
public void preProcessRequest (DelegateExecution execution) {
- msoLogger.debug(" ***** preProcessRequest *****")
+ logger.debug(" ***** preProcessRequest *****")
String msg = ""
try {
@@ -106,18 +109,18 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
String serviceInstanceId = execution.getVariable("serviceInstanceId")
if (isBlank(serviceInstanceId)){
msg = "Input serviceInstanceId is null"
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
String sdncCallbackUrl = UrnPropertiesReader.getVariable('URN_mso_workflow_sdncadapter_callback', execution)
if (isBlank(sdncCallbackUrl)) {
msg = "URN_mso_workflow_sdncadapter_callback is null"
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
- msoLogger.info("SDNC Callback URL: " + sdncCallbackUrl)
+ logger.info("SDNC Callback URL: " + sdncCallbackUrl)
StringBuilder sbParams = new StringBuilder()
Map<String, String> paramsMap = execution.getVariable("serviceInputParams")
@@ -147,14 +150,14 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.error(msg)
+ logger.error(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.debug("***** Exit preProcessRequest *****")
+ logger.debug("***** Exit preProcessRequest *****")
}
public void postProcessAAIGET(DelegateExecution execution) {
- msoLogger.debug(" ***** postProcessAAIGET ***** ")
+ logger.debug(" ***** postProcessAAIGET ***** ")
String msg = ""
try {
@@ -163,14 +166,14 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
String serviceType = ""
if(foundInAAI){
- msoLogger.debug("Found Service-instance in AAI")
+ logger.debug("Found Service-instance in AAI")
String siData = execution.getVariable("GENGS_service")
- msoLogger.debug("SI Data")
+ logger.debug("SI Data")
if (isBlank(siData))
{
msg = "Could not retrive ServiceInstance data from AAI to delete id:" + serviceInstanceId
- msoLogger.error(msg)
+ logger.error(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
else
@@ -183,7 +186,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
// get model invariant id
// Get Template uuid and version
if (utils.nodeExists(siData, "model-invariant-id") && utils.nodeExists(siData, "model-version-id") ) {
- msoLogger.debug("SI Data model-invariant-id and model-version-id exist")
+ logger.debug("SI Data model-invariant-id and model-version-id exist")
def modelInvariantId = serviceXml.getElementsByTagName("model-invariant-id").item(0).getTextContent()
def modelVersionId = serviceXml.getElementsByTagName("model-version-id").item(0).getTextContent()
@@ -192,10 +195,10 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
execution.setVariable("model-version-id-original", modelVersionId)
}
- msoLogger.debug("SI Data" + siData)
+ logger.debug("SI Data" + siData)
//Confirm there are no related service instances (vnf/network or volume)
if (utils.nodeExists(siData, "relationship-list")) {
- msoLogger.debug("SI Data relationship-list exists")
+ logger.debug("SI Data relationship-list exists")
JSONArray jArray = new JSONArray()
XmlParser xmlParser = new XmlParser()
@@ -215,29 +218,29 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
}else{
boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
if(!succInAAI){
- msoLogger.debug("Error getting Service-instance from AAI :" + serviceInstanceId)
+ logger.debug("Error getting Service-instance from AAI :" + serviceInstanceId)
WorkflowException workflowException = execution.getVariable("WorkflowException")
if(workflowException != null){
- msoLogger.error("workflowException: " + workflowException)
+ logger.error("workflowException: " + workflowException)
exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
}
else {
msg = "Failure in postProcessAAIGET GENGS_SuccessIndicator:" + succInAAI
- msoLogger.error(msg)
+ logger.error(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
}
}
- msoLogger.debug("Service-instance NOT found in AAI. Silent Success")
+ logger.debug("Service-instance NOT found in AAI. Silent Success")
}
}catch (BpmnError e) {
throw e
} catch (Exception ex) {
msg = "Exception in DoDeleteE2EServiceInstance.postProcessAAIGET. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.debug(" *** Exit postProcessAAIGET *** ")
+ logger.debug(" *** Exit postProcessAAIGET *** ")
}
private JSONObject getRelationShipData(node, isDebugEnabled){
@@ -247,7 +250,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
def rt = utils.getNodeText(relation, "related-to")
def rl = utils.getNodeText(relation, "related-link")
- msoLogger.debug("ServiceInstance Related NS/Configuration :" + rl)
+ logger.debug("ServiceInstance Related NS/Configuration :" + rl)
def rl_datas = utils.getIdenticalChildren(node, "relationship-data")
for(def rl_data : rl_datas) {
@@ -281,12 +284,12 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
}
}
- msoLogger.debug("Relationship related to Resource:" + jObj.toString())
+ logger.debug("Relationship related to Resource:" + jObj.toString())
return jObj
}
public void getCurrentNS(DelegateExecution execution){
- utils.log("INFO", "======== Start getCurrentNS Process ======== ", isDebugEnabled)
+ logger.info( "======== Start getCurrentNS Process ======== ")
def currentIndex = execution.getVariable("currentNSIndex")
List<String> nsSequence = execution.getVariable("nsSequence")
@@ -297,12 +300,12 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
execution.setVariable("GENGS_serviceInstanceId", "")
execution.setVariable("GENGS_serviceInstanceName", nsResourceType)
- msoLogger.debug("======== COMPLETED getCurrentNS Process ======== ")
+ logger.debug("======== COMPLETED getCurrentNS Process ======== ")
}
public void prepareDecomposeService(DelegateExecution execution) {
try {
- msoLogger.debug(" ***** Inside prepareDecomposeService of create generic e2e service ***** ")
+ logger.debug(" ***** Inside prepareDecomposeService of create generic e2e service ***** ")
String modelInvariantUuid = execution.getVariable("model-invariant-id-original")
String modelVersionId = execution.getVariable("model-version-id-original")
@@ -313,11 +316,11 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
}"""
execution.setVariable("serviceModelInfo", serviceModelInfo)
- msoLogger.debug(" ***** Completed prepareDecomposeService of create generic e2e service ***** ")
+ logger.debug(" ***** Completed prepareDecomposeService of create generic e2e service ***** ")
} catch (Exception ex) {
// try error in method block
String exceptionMessage = "Bpmn error encountered in create generic e2e service flow. Unexpected Error from method prepareDecomposeService() - " + ex.getMessage()
- msoLogger.error(exceptionMessage)
+ logger.error(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
}
@@ -336,7 +339,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
private JSONObject getRelatedResourceInAAI (DelegateExecution execution, JSONObject jObj)
{
- msoLogger.debug(" ***** Started getRelatedResourceInAAI *****")
+ logger.debug(" ***** Started getRelatedResourceInAAI *****")
String aai_endpoint = UrnPropertiesReader.getVariable("aai.endpoint", execution)
String urlLink = jObj.get("resourceLinkUrl")
@@ -349,7 +352,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
Response response = client.get()
int responseCode = response.getStatus()
execution.setVariable(Prefix + "GeRelatedResourceResponseCode", responseCode)
- msoLogger.debug(" Get RelatedResource code is: " + responseCode)
+ logger.debug(" Get RelatedResource code is: " + responseCode)
String aaiResponse = response.readEntity(String.class)
execution.setVariable(Prefix + "GetRelatedResourceResponse", aaiResponse)
@@ -358,7 +361,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
//200 OK 201 CREATED 202 ACCEPTED
{
- msoLogger.debug("GET RelatedResource Received a Good Response")
+ logger.debug("GET RelatedResource Received a Good Response")
execution.setVariable(Prefix + "SuccessIndicator", true)
execution.setVariable(Prefix + "FoundIndicator", true)
@@ -380,16 +383,16 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
}
else {
String exceptionMessage = "Get RelatedResource Received a Bad Response Code. Response Code is: " + responseCode
- msoLogger.error(exceptionMessage)
+ logger.error(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- msoLogger.debug(" ***** Exit getRelatedResourceInAAI *****")
+ logger.debug(" ***** Exit getRelatedResourceInAAI *****")
return jObj
}
public void postDecomposeService(DelegateExecution execution) {
- msoLogger.debug(" ***** Inside processDecomposition() of delete generic e2e service flow ***** ")
+ logger.debug(" ***** Inside processDecomposition() of delete generic e2e service flow ***** ")
try {
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
@@ -443,17 +446,17 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
}
execution.setVariable("isDeleteResourceListValid", isDeleteResourceListValid)
- msoLogger.debug("delete resource list : " + deleteRealResourceList)
+ logger.debug("delete resource list : " + deleteRealResourceList)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in create generic e2e service flow. processDecomposition() - " + ex.getMessage()
- msoLogger.error(exceptionMessage)
+ logger.error(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- utils.log("DEBUG", " ***** exit processDecomposition() of delete generic e2e service flow ***** ", isDebugEnabled)
+ logger.debug( " ***** exit processDecomposition() of delete generic e2e service flow ***** ")
}
public void preInitResourcesOperStatus(DelegateExecution execution){
- msoLogger.debug(" ======== STARTED preInitResourcesOperStatus Process ======== ")
+ logger.debug(" ======== STARTED preInitResourcesOperStatus Process ======== ")
try{
String serviceId = execution.getVariable("serviceInstanceId")
String operationId = execution.getVariable("operationId")
@@ -463,7 +466,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
String progress = "0"
String reason = ""
String operationContent = "Prepare service creation"
- msoLogger.debug("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType)
+ logger.debug("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType)
serviceId = UriUtils.encode(serviceId,"UTF-8")
execution.setVariable("serviceInstanceId", serviceId)
execution.setVariable("operationId", operationId)
@@ -494,18 +497,18 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_initResOperStatusRequest", payload)
- msoLogger.debug("Outgoing initResourceOperationStatus: \n" + payload)
- msoLogger.debug("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)
+ logger.debug("Outgoing initResourceOperationStatus: \n" + payload)
+ logger.debug("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)
}catch(Exception e){
- msoLogger.debug("Exception Occured Processing preInitResourcesOperStatus. Exception is:\n" + e)
+ logger.debug("Exception Occured Processing preInitResourcesOperStatus. Exception is:\n" + e)
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage())
}
- msoLogger.debug("======== COMPLETED preInitResourcesOperStatus Process ======== ")
+ logger.debug("======== COMPLETED preInitResourcesOperStatus Process ======== ")
}
public void prepareUpdateServiceOperationStatus(DelegateExecution execution){
- msoLogger.debug(" ======== STARTED prepareUpdateServiceOperationStatus Process ======== ")
+ logger.debug(" ======== STARTED prepareUpdateServiceOperationStatus Process ======== ")
try{
String serviceId = execution.getVariable("serviceInstanceId")
String operationId = execution.getVariable("operationId")
@@ -519,7 +522,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
- msoLogger.debug("DB Adapter Endpoint is: " + dbAdapterEndpoint)
+ logger.debug("DB Adapter Endpoint is: " + dbAdapterEndpoint)
String payload =
"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
@@ -541,13 +544,13 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)
- msoLogger.debug("Outgoing updateServiceOperStatusRequest: \n" + payload)
+ logger.debug("Outgoing updateServiceOperStatusRequest: \n" + payload)
}catch(Exception e){
- msoLogger.error("Exception Occured Processing prepareUpdateServiceOperationStatus. Exception is:\n" + e)
+ logger.error("Exception Occured Processing prepareUpdateServiceOperationStatus. Exception is:\n" + e)
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareUpdateServiceOperationStatus Method:\n" + e.getMessage())
}
- msoLogger.debug("======== COMPLETED prepareUpdateServiceOperationStatus Process ======== ")
+ logger.debug("======== COMPLETED prepareUpdateServiceOperationStatus Process ======== ")
}
/**
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy
index 67fbb97797..002e20e6d7 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -44,6 +46,8 @@ import org.onap.so.client.graphinventory.entities.uri.Depth
import org.onap.so.constants.Defaults
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.springframework.web.util.UriUtils
import org.onap.so.utils.TargetEntity
@@ -52,7 +56,7 @@ import groovy.json.JsonOutput
import javax.ws.rs.core.Response
public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoDeleteNetworkInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoDeleteNetworkInstance.class);
String Prefix= "DELNWKI_"
String groovyClassName = "DoDeleteNetworkInstance"
@@ -116,7 +120,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside preProcessRequest() of " + groovyClassName + " Request ")
+ logger.trace("Inside preProcessRequest() of " + groovyClassName + " Request ")
// initialize flow variables
InitializeProcessVariables(execution)
@@ -130,12 +134,12 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
// JSON format request is sent, create xml
try {
def prettyJson = JsonOutput.prettyPrint(deleteNetwork.toString())
- msoLogger.debug(" Incoming message formatted . . . : " + '\n' + prettyJson)
+ logger.debug(" Incoming message formatted . . . : " + '\n' + prettyJson)
deleteNetwork = vidUtils.createXmlNetworkRequestInfra(execution, deleteNetwork)
} catch (Exception ex) {
String dataErrorMessage = " Invalid json format Request - " + ex.getMessage()
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
} else {
@@ -148,14 +152,14 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
deleteNetwork = utils.formatXml(deleteNetwork)
- msoLogger.debug(deleteNetwork)
+ logger.debug(deleteNetwork)
execution.setVariable(Prefix + "networkRequest", deleteNetwork)
- msoLogger.debug(Prefix + "networkRequest - " + '\n' + deleteNetwork)
+ logger.debug(Prefix + "networkRequest - " + '\n' + deleteNetwork)
// validate 'backout-on-failure' to override 'mso.rollback'
boolean rollbackEnabled = networkUtils.isRollbackEnabled(execution, deleteNetwork)
execution.setVariable(Prefix + "rollbackEnabled", rollbackEnabled)
- msoLogger.debug(Prefix + "rollbackEnabled - " + rollbackEnabled)
+ logger.debug(Prefix + "rollbackEnabled - " + rollbackEnabled)
String networkInputs = utils.getNodeXml(deleteNetwork, "network-inputs", false).replace("tag0:","").replace(":tag0","")
execution.setVariable(Prefix + "networkInputs", networkInputs)
@@ -164,15 +168,15 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
String messageId = execution.getVariable("testMessageId") // for testing
if (messageId == null || messageId == "") {
messageId = UUID.randomUUID()
- msoLogger.debug(Prefix + "messageId, random generated: " + messageId)
+ logger.debug(Prefix + "messageId, random generated: " + messageId)
} else {
- msoLogger.debug(Prefix + "messageId, pre-assigned: " + messageId)
+ logger.debug(Prefix + "messageId, pre-assigned: " + messageId)
}
execution.setVariable(Prefix + "messageId", messageId)
String source = utils.getNodeText(deleteNetwork, "source")
execution.setVariable(Prefix + "source", source)
- msoLogger.debug(Prefix + "source - " + source)
+ logger.debug(Prefix + "source - " + source)
String networkId = ""
if (utils.nodeExists(networkInputs, "network-id")) {
@@ -181,7 +185,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
sendSyncError(execution)
// missing value of network-id
String dataErrorMessage = "network-request has missing 'network-id' element/value."
- msoLogger.debug(" Invalid Request - " + dataErrorMessage)
+ logger.debug(" Invalid Request - " + dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
}
@@ -195,7 +199,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
}
execution.setVariable(Prefix + "lcpCloudRegion", lcpCloudRegion)
- msoLogger.debug("lcpCloudRegion : " + lcpCloudRegion)
+ logger.debug("lcpCloudRegion : " + lcpCloudRegion)
String tenantId = null
if (utils.nodeExists(networkInputs, "tenant-id")) {
@@ -206,10 +210,10 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
execution.setVariable(Prefix + "tenantId", tenantId)
- msoLogger.debug("tenantId : " + tenantId)
+ logger.debug("tenantId : " + tenantId)
String sdncVersion = execution.getVariable("sdncVersion")
- msoLogger.debug("sdncVersion? : " + sdncVersion)
+ logger.debug("sdncVersion? : " + sdncVersion)
// PO Authorization Info / headers Authorization=
String basicAuthValuePO = UrnPropertiesReader.getVariable("mso.adapters.po.auth", execution)
@@ -221,7 +225,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
} catch (IOException ex) {
String dataErrorMessage = " Unable to encode PO/SDNC user/password string - " + ex.getMessage()
- msoLogger.debug(dataErrorMessage )
+ logger.debug(dataErrorMessage )
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
@@ -231,7 +235,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
} catch (Exception ex){
// caught exception
String exceptionMessage = "Exception Encountered in DoDeleteNetworkInstance, PreProcessRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -243,7 +247,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.debug(" ***** Inside callRESTQueryAAI() of DoDoDeleteNetworkInstance ***** " )
+ logger.debug(" ***** Inside callRESTQueryAAI() of DoDoDeleteNetworkInstance ***** " )
// get variables
String networkInputs = execution.getVariable(Prefix + "networkInputs")
@@ -273,7 +277,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
if(execution.getVariable(Prefix + "tenantId") == null) {
String tenantId = tenantURI.getURIKeys().get("tenant-id")
execution.setVariable(Prefix + "tenantId", tenantId)
- msoLogger.debug(" Get AAI getTenantId() : " + tenantId)
+ logger.debug(" Get AAI getTenantId() : " + tenantId)
}
}
List<AAIResourceUri> cloudRegionURIList = relationships.get().getRelatedAAIUris(AAIObjectType.CLOUD_REGION)
@@ -281,24 +285,24 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
if(execution.getVariable(Prefix + "lcpCloudRegion") == null) {
String lcpCloudRegion = tenantURI.getURIKeys().get("cloud-region-id")
execution.setVariable(Prefix + "lcpCloudRegion", lcpCloudRegion)
- msoLogger.debug(" Get AAI getCloudRegion() : " + lcpCloudRegion)
+ logger.debug(" Get AAI getCloudRegion() : " + lcpCloudRegion)
}
}
}
}
- msoLogger.debug(Prefix + "isVfRelationshipExist - " + isVfRelationshipExist)
+ logger.debug(Prefix + "isVfRelationshipExist - " + isVfRelationshipExist)
} else {
// not found // empty aai response
execution.setVariable(Prefix + "aaiReturnCode", 404)
execution.setVariable(Prefix + "isAAIGood", false)
execution.setVariable(Prefix + "isSilentSuccess", true)
- msoLogger.debug(" AAI Query is Silent Success")
+ logger.debug(" AAI Query is Silent Success")
}
- msoLogger.debug(" AAI Query call, isAAIGood? : " + execution.getVariable(Prefix + "isAAIGood"))
+ logger.debug(" AAI Query call, isAAIGood? : " + execution.getVariable(Prefix + "isAAIGood"))
} catch (Exception ex) {
// caught exception
String exceptionMessage = "Exception Encountered in DoDeleteNetworkInstance, callRESTQueryAAI() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -309,7 +313,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.debug(" ***** Inside callRESTQueryAAICloudRegion of DoDeleteNetworkInstance ***** " )
+ logger.debug(" ***** Inside callRESTQueryAAICloudRegion of DoDeleteNetworkInstance ***** " )
try {
String networkInputs = execution.getVariable(Prefix + "networkInputs")
@@ -332,7 +336,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
} else {
String dataErrorMessage = "QueryAAICloudRegion Unsuccessful. Return Code: " + execution.getVariable(Prefix + "queryCloudRegionReturnCode")
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
@@ -343,7 +347,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
} catch (Exception ex) {
// caught exception
String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, callRESTQueryAAICloudRegion(). Unexpected Response from AAI - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -354,7 +358,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside prepareNetworkRequest of DoDeleteNetworkInstance ")
+ logger.trace("Inside prepareNetworkRequest of DoDeleteNetworkInstance ")
ExceptionUtil exceptionUtil = new ExceptionUtil()
try {
// get variables
@@ -411,23 +415,23 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
</deleteNetworkRequest>
""".trim()
- msoLogger.debug(Prefix + "deleteNetworkRequest - " + "\n" + deleteNetworkRequest)
+ logger.debug(Prefix + "deleteNetworkRequest - " + "\n" + deleteNetworkRequest)
// Format Response
String buildDeleteNetworkRequestAsString = utils.formatXml(deleteNetworkRequest)
- msoLogger.debug(buildDeleteNetworkRequestAsString)
- msoLogger.debug(Prefix + "deleteNetworkRequestAsString - " + "\n" + buildDeleteNetworkRequestAsString)
+ logger.debug(buildDeleteNetworkRequestAsString)
+ logger.debug(Prefix + "deleteNetworkRequestAsString - " + "\n" + buildDeleteNetworkRequestAsString)
String restURL = UrnPropertiesReader.getVariable("mso.adapters.network.rest.endpoint", execution)
execution.setVariable("mso.adapters.network.rest.endpoint", restURL + "/" + networkId)
- msoLogger.debug("mso.adapters.network.rest.endpoint - " + "\n" + restURL + "/" + networkId)
+ logger.debug("mso.adapters.network.rest.endpoint - " + "\n" + restURL + "/" + networkId)
execution.setVariable(Prefix + "deleteNetworkRequest", buildDeleteNetworkRequestAsString)
- msoLogger.debug(Prefix + "deleteNetworkRequest - " + "\n" + buildDeleteNetworkRequestAsString)
+ logger.debug(Prefix + "deleteNetworkRequest - " + "\n" + buildDeleteNetworkRequestAsString)
}
catch (Exception ex) {
// caught exception
String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, prepareNetworkRequest(). Unexpected Response from AAI - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -442,7 +446,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
@@ -461,8 +465,10 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
} catch (Exception ex) {
// caught exception
String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, sendRequestToVnfAdapter() - " + ex.getMessage()
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, exceptionMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + ex);
- msoLogger.debug(exceptionMessage)
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), exceptionMessage,
+ "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(),
+ "Exception is:\n" + ex);
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -473,7 +479,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside prepareSDNCRequest of DoDeleteNetworkInstance ")
+ logger.trace("Inside prepareSDNCRequest of DoDeleteNetworkInstance ")
try {
// get variables
@@ -496,7 +502,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
requestId = execution.getVariable("mso-request-id")
}
execution.setVariable(Prefix + "requestId", requestId)
- msoLogger.debug(Prefix + "requestId " + requestId)
+ logger.debug(Prefix + "requestId " + requestId)
L3Network queryAAIResponse = execution.getVariable(Prefix + "queryAAIResponse")
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
@@ -504,15 +510,17 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
// 1. prepare delete topology via SDNC Adapter SUBFLOW call
String sndcTopologyDeleteRequest = sdncAdapterUtils.sdncTopologyRequestV2(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "delete", "DisconnectNetworkRequest", cloudRegionId, networkId, queryAAIResponse, null)
String sndcTopologyDeleteRequesAsString = utils.formatXml(sndcTopologyDeleteRequest)
- msoLogger.debug(sndcTopologyDeleteRequesAsString)
+ logger.debug(sndcTopologyDeleteRequesAsString)
execution.setVariable(Prefix + "deleteSDNCRequest", sndcTopologyDeleteRequesAsString)
- msoLogger.debug(Prefix + "deleteSDNCRequest - " + "\n" + sndcTopologyDeleteRequesAsString)
+ logger.debug(Prefix + "deleteSDNCRequest - " + "\n" + sndcTopologyDeleteRequesAsString)
} catch (Exception ex) {
// caught exception
String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, prepareSDNCRequest() - " + ex.getMessage()
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, exceptionMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + ex);
- msoLogger.debug(exceptionMessage)
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), exceptionMessage,
+ "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(),
+ "Exception is:\n" + ex);
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -523,7 +531,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside prepareRpcSDNCRequest of DoDeleteNetworkInstance ")
+ logger.trace("Inside prepareRpcSDNCRequest of DoDeleteNetworkInstance ")
try {
// get variables
@@ -543,15 +551,17 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
// 1. prepare delete topology via SDNC Adapter SUBFLOW call
String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "unassign", "DeleteNetworkInstance", cloudRegionId, networkId, null)
String sndcTopologyDeleteRequesAsString = utils.formatXml(sndcTopologyRollbackRpcRequest)
- msoLogger.debug(sndcTopologyDeleteRequesAsString)
+ logger.debug(sndcTopologyDeleteRequesAsString)
execution.setVariable(Prefix + "deleteSDNCRequest", sndcTopologyDeleteRequesAsString)
- msoLogger.debug(Prefix + "deleteSDNCRequest - " + "\n" + sndcTopologyDeleteRequesAsString)
+ logger.debug(Prefix + "deleteSDNCRequest - " + "\n" + sndcTopologyDeleteRequesAsString)
} catch (Exception ex) {
// caught exception
String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, prepareSDNCRequest() - " + ex.getMessage()
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, exceptionMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + ex);
- msoLogger.debug(exceptionMessage)
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), exceptionMessage,
+ "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(),
+ "Exception is:\n" + ex);
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -563,7 +573,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareRpcSDNCDeactivate() of DoDeleteNetworkInstance ")
+ logger.trace("Inside prepareRpcSDNCDeactivate() of DoDeleteNetworkInstance ")
try {
@@ -581,12 +591,12 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "deactivate", "DeleteNetworkInstance", cloudRegionId, networkId, null)
String sndcTopologyRollbackRpcRequestAsString = utils.formatXml(sndcTopologyRollbackRpcRequest)
execution.setVariable(Prefix + "deactivateSDNCRequest", sndcTopologyRollbackRpcRequestAsString)
- msoLogger.debug(" Preparing request for RPC SDNC Topology deactivate - " + "\n" + sndcTopologyRollbackRpcRequestAsString)
+ logger.debug(" Preparing request for RPC SDNC Topology deactivate - " + "\n" + sndcTopologyRollbackRpcRequestAsString)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoDeleteNetworkInstance flow. prepareRpcSDNCActivateRollback() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -601,24 +611,24 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside validateNetworkResponse of DoDeleteNetworkInstance ")
+ logger.trace("Inside validateNetworkResponse of DoDeleteNetworkInstance ")
try {
String returnCode = execution.getVariable(Prefix + "networkReturnCode")
String networkResponse = execution.getVariable(Prefix + "deleteNetworkResponse")
- msoLogger.debug(" Network Adapter responseCode: " + returnCode)
- msoLogger.debug("Network Adapter Response - " + "\n" + networkResponse)
- msoLogger.debug(networkResponse)
+ logger.debug(" Network Adapter responseCode: " + returnCode)
+ logger.debug("Network Adapter Response - " + "\n" + networkResponse)
+ logger.debug(networkResponse)
String errorMessage = ""
if (returnCode == "200") {
- msoLogger.debug(" Network Adapter Response is successful - " + "\n" + networkResponse)
+ logger.debug(" Network Adapter Response is successful - " + "\n" + networkResponse)
// prepare rollback data
String rollbackData = utils.getNodeXml(networkResponse, "rollback", false).replace("tag0:","").replace(":tag0","")
if ((rollbackData == null) || (rollbackData.isEmpty())) {
- msoLogger.debug(" Network Adapter 'rollback' data is not Sent: " + "\n" + networkResponse)
+ logger.debug(" Network Adapter 'rollback' data is not Sent: " + "\n" + networkResponse)
execution.setVariable(Prefix + "rollbackNetworkRequest", "")
} else {
String rollbackNetwork =
@@ -627,7 +637,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
</NetworkAdapter:rollbackNetwork>"""
String rollbackNetworkXml = utils.formatXml(rollbackNetwork)
execution.setVariable(Prefix + "rollbackNetworkRequest", rollbackNetworkXml)
- msoLogger.debug(" Network Adapter rollback data - " + "\n" + rollbackNetworkXml)
+ logger.debug(" Network Adapter rollback data - " + "\n" + rollbackNetworkXml)
}
@@ -664,7 +674,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
} catch (Exception ex) {
// caught exception
String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, validateNetworkResponse() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -675,7 +685,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside validateSDNCResponse of DoDeleteNetworkInstance ")
+ logger.trace("Inside validateSDNCResponse of DoDeleteNetworkInstance ")
String response = execution.getVariable(Prefix + "deleteSDNCResponse")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
@@ -691,9 +701,9 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
if (execution.getVariable(Prefix + "sdncResponseSuccess") == true) { // from sdnc util, prefix+'sdncResponseSuccess'
execution.setVariable(Prefix + "isSdncRollbackNeeded", true) //
execution.setVariable(Prefix + "isPONR", true)
- msoLogger.debug("Successfully Validated SDNC Response")
+ logger.debug("Successfully Validated SDNC Response")
} else {
- msoLogger.debug("Did NOT Successfully Validated SDNC Response")
+ logger.debug("Did NOT Successfully Validated SDNC Response")
throw new BpmnError("MSOWorkflowException")
}
@@ -703,7 +713,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside validateRpcSDNCDeactivateResponse() of DoDeleteNetworkInstance ")
+ logger.trace("Inside validateRpcSDNCDeactivateResponse() of DoDeleteNetworkInstance ")
String response = execution.getVariable(Prefix + "deactivateSDNCResponse")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
@@ -718,10 +728,10 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
if (execution.getVariable(Prefix + "sdncResponseSuccess") == true) { // from sdnc util, Prefix+'sdncResponseSuccess'
execution.setVariable(Prefix + "isSdncDeactivateRollbackNeeded", true)
- msoLogger.debug("Successfully Validated Rpc SDNC Activate Response")
+ logger.debug("Successfully Validated Rpc SDNC Activate Response")
} else {
- msoLogger.debug("Did NOT Successfully Validated Rpc SDNC Deactivate Response")
+ logger.debug("Did NOT Successfully Validated Rpc SDNC Deactivate Response")
throw new BpmnError("MSOWorkflowException")
}
@@ -731,7 +741,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareRpcSDNCDeactivateRollback() of DoDeleteNetworkInstance ")
+ logger.trace("Inside prepareRpcSDNCDeactivateRollback() of DoDeleteNetworkInstance ")
try {
@@ -748,12 +758,12 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "activate", "CreateNetworkInstance", cloudRegionId, networkId, null)
String sndcTopologyRollbackRpcRequestAsString = utils.formatXml(sndcTopologyRollbackRpcRequest)
execution.setVariable(Prefix + "rollbackDeactivateSDNCRequest", sndcTopologyRollbackRpcRequestAsString)
- msoLogger.debug(" Preparing request for RPC SDNC Topology 'activate-CreateNetworkInstance' rollback . . . - " + "\n" + sndcTopologyRollbackRpcRequestAsString)
+ logger.debug(" Preparing request for RPC SDNC Topology 'activate-CreateNetworkInstance' rollback . . . - " + "\n" + sndcTopologyRollbackRpcRequestAsString)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoDeleteNetworkInstance flow. prepareRpcSDNCDeactivateRollback() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -764,7 +774,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareRollbackData() of DoDeleteNetworkInstance ")
+ logger.trace("Inside prepareRollbackData() of DoDeleteNetworkInstance ")
try {
@@ -782,14 +792,14 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
}
execution.setVariable("rollbackData", rollbackData)
- msoLogger.debug("** rollbackData : " + rollbackData)
+ logger.debug("** rollbackData : " + rollbackData)
execution.setVariable("WorkflowException", execution.getVariable("WorkflowException"))
- msoLogger.debug("** WorkflowException : " + execution.getVariable("WorkflowException"))
+ logger.debug("** WorkflowException : " + execution.getVariable("WorkflowException"))
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoDeleteNetworkInstance flow. prepareRollbackData() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -800,11 +810,11 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside postProcessResponse of DoDeleteNetworkInstance ")
+ logger.trace("Inside postProcessResponse of DoDeleteNetworkInstance ")
try {
- msoLogger.debug(" ***** Is Exception Encountered (isException)? : " + execution.getVariable(Prefix + "isException"))
+ logger.debug(" ***** Is Exception Encountered (isException)? : " + execution.getVariable(Prefix + "isException"))
if (execution.getVariable(Prefix + "isException") == false) {
execution.setVariable(Prefix + "Success", true)
execution.setVariable("WorkflowException", null)
@@ -820,7 +830,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("rollbackData", null)
String exceptionMessage = " Exception encountered in MSO Bpmn. "
if (execution.getVariable("workflowException") != null) { // Output of Rollback flow.
- msoLogger.debug(" ***** workflowException: " + execution.getVariable("workflowException"))
+ logger.debug(" ***** workflowException: " + execution.getVariable("workflowException"))
WorkflowException wfex = execution.getVariable("workflowException")
exceptionMessage = wfex.getErrorMessage()
} else {
@@ -836,20 +846,20 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
// going to the Main flow: a-la-carte or macro
- msoLogger.debug(" ***** postProcessResponse(), BAD !!!")
+ logger.debug(" ***** postProcessResponse(), BAD !!!")
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
throw new BpmnError("MSOWorkflowException")
}
} catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
} catch (Exception ex) {
// caught exception
String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, postProcessResponse() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
throw new BpmnError("MSOWorkflowException")
@@ -861,7 +871,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareSuccessRollbackData() of DoDeleteNetworkInstance ")
+ logger.trace("Inside prepareSuccessRollbackData() of DoDeleteNetworkInstance ")
try {
@@ -893,13 +903,13 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
execution.setVariable("rollbackData", rollbackData)
- msoLogger.debug("** rollbackData : " + rollbackData)
+ logger.debug("** rollbackData : " + rollbackData)
execution.setVariable("WorkflowException", null)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoDeleteNetworkInstance flow. prepareSuccessRollbackData() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -910,7 +920,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareRpcSDNCUnassignRollbac() of DoDeleteNetworkInstance ")
+ logger.trace("Inside prepareRpcSDNCUnassignRollbac() of DoDeleteNetworkInstance ")
try {
@@ -928,15 +938,15 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
// 1. prepare delete topology via SDNC Adapter SUBFLOW call
String sndcTopologyRollbackRpcRequest = sdncAdapterUtils.sdncTopologyRequestRsrc(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "assign", "CreateNetworkInstance", cloudRegionId, networkId, null)
String sndcTopologyDeleteRequesAsString = utils.formatXml(sndcTopologyRollbackRpcRequest)
- msoLogger.debug(sndcTopologyDeleteRequesAsString)
+ logger.debug(sndcTopologyDeleteRequesAsString)
execution.setVariable(Prefix + "rollbackSDNCRequest", sndcTopologyDeleteRequesAsString)
- msoLogger.debug(Prefix + "rollbackSDNCRequest" + "\n" + sndcTopologyDeleteRequesAsString)
- msoLogger.debug(" Preparing request for RPC SDNC Topology 'assign-CreateNetworkInstance' rollback . . . - " + "\n" + sndcTopologyDeleteRequesAsString)
+ logger.debug(Prefix + "rollbackSDNCRequest" + "\n" + sndcTopologyDeleteRequesAsString)
+ logger.debug(" Preparing request for RPC SDNC Topology 'assign-CreateNetworkInstance' rollback . . . - " + "\n" + sndcTopologyDeleteRequesAsString)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoDeleteNetworkInstance flow. prepareRpcSDNCUnassignRollback() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -947,7 +957,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside prepareSDNCRollback of DoDeleteNetworkInstance ")
+ logger.trace("Inside prepareSDNCRollback of DoDeleteNetworkInstance ")
try {
@@ -979,17 +989,19 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
// 1. prepare delete topology via SDNC Adapter SUBFLOW call
String sndcTopologyDeleteRequest = sdncAdapterUtils.sdncTopologyRequestV2(execution, deleteNetworkInput, serviceInstanceId, sdncCallback, "rollback", "DisconnectNetworkRequest", cloudRegionId, networkId, queryAAIResponse, null)
String sndcTopologyDeleteRequesAsString = utils.formatXml(sndcTopologyDeleteRequest)
- msoLogger.debug(sndcTopologyDeleteRequesAsString)
+ logger.debug(sndcTopologyDeleteRequesAsString)
execution.setVariable(Prefix + "rollbackSDNCRequest", sndcTopologyDeleteRequesAsString)
- msoLogger.debug(Prefix + "rollbackSDNCRequest - " + "\n" + sndcTopologyDeleteRequesAsString)
- msoLogger.debug(" Preparing request for RPC SDNC Topology 'rollback-DisconnectNetworkRequest' rollback . . . - " + "\n" + sndcTopologyDeleteRequesAsString)
+ logger.debug(Prefix + "rollbackSDNCRequest - " + "\n" + sndcTopologyDeleteRequesAsString)
+ logger.debug(" Preparing request for RPC SDNC Topology 'rollback-DisconnectNetworkRequest' rollback . . . - " + "\n" + sndcTopologyDeleteRequesAsString)
} catch (Exception ex) {
// caught exception
String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance, prepareSDNCRollback() - " + ex.getMessage()
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, exceptionMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + ex);
- msoLogger.debug(exceptionMessage)
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), exceptionMessage,
+ "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(),
+ "Exception is:\n" + ex);
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -1000,7 +1012,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside setExceptionFlag() of DoDeleteNetworkInstance ")
+ logger.trace("Inside setExceptionFlag() of DoDeleteNetworkInstance ")
try {
@@ -1011,11 +1023,11 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
} else {
execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException"))
}
- msoLogger.debug(Prefix + "WorkflowException - " +execution.getVariable(Prefix + "WorkflowException"))
+ logger.debug(Prefix + "WorkflowException - " +execution.getVariable(Prefix + "WorkflowException"))
} catch(Exception ex){
String exceptionMessage = "Bpmn error encountered in DoDeleteNetworkInstance flow. setExceptionFlag(): " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -1030,18 +1042,18 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
try{
- msoLogger.debug("Caught a Java Exception")
- msoLogger.debug("Started processJavaException Method")
- msoLogger.debug("Variables List: " + execution.getVariables())
+ logger.debug("Caught a Java Exception")
+ logger.debug("Started processJavaException Method")
+ logger.debug("Variables List: " + execution.getVariables())
execution.setVariable("UnexpectedError", "Caught a Java Lang Exception") // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception")
}catch(Exception e){
- msoLogger.debug("Caught Exception during processJavaException Method: " + e)
+ logger.debug("Caught Exception during processJavaException Method: " + e)
execution.setVariable("UnexpectedError", "Exception in processJavaException method") // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method")
}
- msoLogger.debug("Completed processJavaException Method of " + Prefix)
+ logger.debug("Completed processJavaException Method of " + Prefix)
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy
index 1db7475cba..d09fb03445 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -40,15 +42,15 @@ import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.util.UriUtils
-import org.onap.so.logger.MessageEnum
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
/**
* This groovy class supports the <class>DoCreateNetworkInstanceRollback.bpmn</class> process.
*
*/
public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoDeleteNetworkInstanceRollback.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoDeleteNetworkInstanceRollback.class);
String Prefix="DELNWKIR_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -96,7 +98,7 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside preProcessRequest() of " + className + ".groovy ")
+ logger.trace("Inside preProcessRequest() of " + className + ".groovy ")
try {
// initialize flow variables
@@ -126,10 +128,10 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable(Prefix + "rollbackNetworkRequest", rollbackNetworkRequest)
execution.setVariable(Prefix + "rollbackSDNCRequest", rollbackSDNCRequest)
execution.setVariable(Prefix + "rollbackDeactivateSDNCRequest", rollbackDeactivateSDNCRequest)
- msoLogger.debug("'rollbackData': " + '\n' + execution.getVariable("rollbackData"))
+ logger.debug("'rollbackData': " + '\n' + execution.getVariable("rollbackData"))
String sdncVersion = execution.getVariable("sdncVersion")
- msoLogger.debug("sdncVersion? : " + sdncVersion)
+ logger.debug("sdncVersion? : " + sdncVersion)
// PO Authorization Info / headers Authorization=
String basicAuthValuePO = UrnPropertiesReader.getVariable("mso.adapters.po.auth",execution)
@@ -141,7 +143,7 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
} catch (IOException ex) {
String exceptionMessage = "Exception Encountered in DoCreateNetworkInstance, PreProcessRequest() - "
String dataErrorMessage = exceptionMessage + " Unable to encode PO/SDNC user/password string - " + ex.getMessage()
- msoLogger.debug(dataErrorMessage )
+ logger.debug(dataErrorMessage )
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
@@ -150,7 +152,7 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
} else {
execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException"))
}
- msoLogger.debug("*** WorkflowException : " + execution.getVariable(Prefix + "WorkflowException"))
+ logger.debug("*** WorkflowException : " + execution.getVariable(Prefix + "WorkflowException"))
if(execution.getVariable(Prefix + "WorkflowException") != null) {
// called by: DoCreateNetworkInstance, partial rollback
execution.setVariable(Prefix + "fullRollback", false)
@@ -161,7 +163,7 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
}
- msoLogger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback"))
+ logger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback"))
} catch (BpmnError e) {
throw e;
@@ -170,7 +172,7 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
sendSyncError(execution)
// caught exception
String exceptionMessage = "Exception Encountered in PreProcessRequest() of " + className + ".groovy ***** : " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -181,7 +183,7 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside validateRollbackResponses() of DoDeleteNetworkInstanceRollback ")
+ logger.trace("Inside validateRollbackResponses() of DoDeleteNetworkInstanceRollback ")
try {
@@ -207,8 +209,8 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
} else {
rollbackDeactivateSDNCMessages = " + SDNC deactivate rollback failed. "
}
- msoLogger.debug(" SDNC deactivate rollback Code - " + rollbackDeactivateSDNCReturnCode)
- msoLogger.debug(" SDNC deactivate rollback Response - " + rollbackDeactivateSDNCResponse)
+ logger.debug(" SDNC deactivate rollback Code - " + rollbackDeactivateSDNCReturnCode)
+ logger.debug(" SDNC deactivate rollback Response - " + rollbackDeactivateSDNCResponse)
}
// validate SDNC rollback response
@@ -234,8 +236,8 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
} else {
rollbackSdncErrorMessages = " + SDNC unassign rollback failed. "
}
- msoLogger.debug(" SDNC assign rollback Code - " + rollbackSDNCReturnCode)
- msoLogger.debug(" SDNC assign rollback Response - " + rollbackSDNCResponse)
+ logger.debug(" SDNC assign rollback Code - " + rollbackSDNCReturnCode)
+ logger.debug(" SDNC assign rollback Response - " + rollbackSDNCResponse)
}
// validate PO network rollback response
@@ -250,13 +252,13 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
rollbackNetworkErrorMessages = " + PO Network rollback completed."
}
- msoLogger.debug(" NetworkRollback Code - " + rollbackNetworkReturnCode)
- msoLogger.debug(" NetworkRollback Response - " + rollbackNetworkResponse)
+ logger.debug(" NetworkRollback Code - " + rollbackNetworkReturnCode)
+ logger.debug(" NetworkRollback Response - " + rollbackNetworkResponse)
}
String statusMessage = ""
int errorCode = 7000
- msoLogger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback"))
+ logger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback"))
if (execution.getVariable(Prefix + "fullRollback") == false) {
WorkflowException wfe = execution.getVariable(Prefix + "WorkflowException") // original WorkflowException
if (wfe != null) {
@@ -278,7 +280,7 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
}
statusMessage = statusMessage + rollbackDeactivateSDNCMessages + rollbackNetworkErrorMessages + rollbackSdncErrorMessages
- msoLogger.debug("Final DoDeleteNetworkInstanceRollback status message: " + statusMessage)
+ logger.debug("Final DoDeleteNetworkInstanceRollback status message: " + statusMessage)
String processKey = getProcessKey(execution);
WorkflowException exception = new WorkflowException(processKey, errorCode, statusMessage);
execution.setVariable("workflowException", exception);
@@ -290,7 +292,7 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable("rollbackError", false)
} else {
String exceptionMessage = "Network Delete Rollback was not Successful. "
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
execution.setVariable("rollbackSuccessful", false)
execution.setVariable("rollbackError", true)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
@@ -301,7 +303,7 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
} catch (Exception ex) {
String errorMessage = "See Previous Camunda flows for cause of Error: Undetermined Exception."
String exceptionMessage = " Bpmn error encountered in DoDeleteNetworkInstanceRollback flow. validateRollbackResponses() - " + errorMessage + ": " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -319,18 +321,18 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable("prefix",Prefix)
try{
- msoLogger.debug("Caught a Java Exception in " + Prefix)
- msoLogger.debug("Started processJavaException Method")
- msoLogger.debug("Variables List: " + execution.getVariables())
+ logger.debug("Caught a Java Exception in " + Prefix)
+ logger.debug("Started processJavaException Method")
+ logger.debug("Variables List: " + execution.getVariables())
execution.setVariable("UnexpectedError", "Caught a Java Lang Exception - " + Prefix) // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception")
}catch(Exception e){
- msoLogger.debug("Caught Exception during processJavaException Method: " + e)
+ logger.debug("Caught Exception during processJavaException Method: " + e)
execution.setVariable("UnexpectedError", "Exception in processJavaException method - " + Prefix) // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method" + Prefix)
}
- msoLogger.debug("Completed processJavaException Method in " + Prefix)
+ logger.debug("Completed processJavaException Method in " + Prefix)
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy
index 6a31095920..7e194657fb 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy
@@ -5,6 +5,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -43,7 +45,8 @@ import org.onap.so.bpmn.core.domain.VnfResource
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.bpmn.infrastructure.properties.BPMNProperties
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
/**
* input for script :
@@ -62,7 +65,7 @@ import org.onap.so.logger.MsoLogger
*/
public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoDeleteResourcesV1.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoDeleteResourcesV1.class);
String Prefix="DDR_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -70,7 +73,7 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
CatalogDbUtils catalogDbUtils = new CatalogDbUtilsFactory().create()
public void preProcessRequest (DelegateExecution execution) {
- msoLogger.debug(" ***** preProcessRequest *****")
+ logger.debug(" ***** preProcessRequest *****")
String msg = ""
try {
@@ -95,18 +98,18 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
String serviceInstanceId = execution.getVariable("serviceInstanceId")
if (isBlank(serviceInstanceId)){
msg = "Input serviceInstanceId is null"
- msoLogger.error(msg)
+ logger.error(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
String sdncCallbackUrl = UrnPropertiesReader.getVariable('URN_mso_workflow_sdncadapter_callback', execution)
if (isBlank(sdncCallbackUrl)) {
msg = "URN_mso_workflow_sdncadapter_callback is null"
- msoLogger.error(msg)
+ logger.error(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
- msoLogger.debug("SDNC Callback URL: " + sdncCallbackUrl)
+ logger.debug("SDNC Callback URL: " + sdncCallbackUrl)
StringBuilder sbParams = new StringBuilder()
Map<String, String> paramsMap = execution.getVariable("serviceInputParams")
@@ -136,14 +139,14 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.error(msg)
+ logger.error(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.debug(" ***** Exit preProcessRequest *****",)
+ logger.debug(" ***** Exit preProcessRequest *****",)
}
public void sequenceResource(DelegateExecution execution){
- msoLogger.debug(" ======== STARTED sequenceResource Process ======== ")
+ logger.debug(" ======== STARTED sequenceResource Process ======== ")
List<Resource> sequencedResourceList = new ArrayList<Resource>()
List<Resource> wanResources = new ArrayList<Resource>()
@@ -196,15 +199,15 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
execution.setVariable("isContainsWanResource", isContainsWanResource)
execution.setVariable("currentResourceIndex", 0)
execution.setVariable("sequencedResourceList", sequencedResourceList)
- msoLogger.debug("resourceSequence: " + resourceSequence)
- msoLogger.debug(" ======== END sequenceResource Process ======== ")
+ logger.debug("resourceSequence: " + resourceSequence)
+ logger.debug(" ======== END sequenceResource Process ======== ")
}
/**
* prepare delete parameters
*/
public void preResourceDelete(DelegateExecution execution){
- msoLogger.debug(" ======== STARTED preResourceDelete Process ======== ")
+ logger.debug(" ======== STARTED preResourceDelete Process ======== ")
List<Resource> sequencedResourceList = execution.getVariable("sequencedResourceList")
@@ -216,14 +219,14 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
String resourceTemplateUUID = curResource.getModelInfo().getModelUuid()
execution.setVariable("resourceInstanceId", resourceInstanceUUID)
execution.setVariable("currentResource", curResource)
- msoLogger.debug("Delete Resource Info resourceTemplate Id :" + resourceTemplateUUID + " resourceInstanceId: "
+ logger.debug("Delete Resource Info resourceTemplate Id :" + resourceTemplateUUID + " resourceInstanceId: "
+ resourceInstanceUUID + " resourceModelName: " + curResource.getModelInfo().getModelName())
}
else {
execution.setVariable("resourceInstanceId", "")
}
- msoLogger.debug(" ======== END preResourceDelete Process ======== ")
+ logger.debug(" ======== END preResourceDelete Process ======== ")
}
@@ -231,7 +234,7 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
* Execute delete workflow for resource
*/
public void executeResourceDelete(DelegateExecution execution) {
- msoLogger.debug("======== Start executeResourceDelete Process ======== ")
+ logger.debug("======== Start executeResourceDelete Process ======== ")
try {
String requestId = execution.getVariable("msoRequestId")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
@@ -263,19 +266,19 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
String recipeURL = BPMNProperties.getProperty("bpelURL", "http://mso:8080") + recipeUri
HttpResponse resp = BpmnRestClient.post(recipeURL, requestId, recipeTimeout, action, serviceInstanceId, serviceType, resourceInput.toString(), recipeParamXsd)
- msoLogger.debug(" ======== END executeResourceDelete Process ======== ")
+ logger.debug(" ======== END executeResourceDelete Process ======== ")
}catch(BpmnError b){
- msoLogger.error("Rethrowing MSOWorkflowException")
+ logger.error("Rethrowing MSOWorkflowException")
throw b
}catch(Exception e){
- msoLogger.error("Error occured within DoDeleteResourcesV1 executeResourceDelete method: " + e)
+ logger.error("Error occured within DoDeleteResourcesV1 executeResourceDelete method: " + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured during DoDeleteResourcesV1 executeResourceDelete Catalog")
}
}
public void parseNextResource(DelegateExecution execution){
- msoLogger.debug("======== Start parseNextResource Process ======== ")
+ logger.debug("======== Start parseNextResource Process ======== ")
def currentIndex = execution.getVariable("currentResourceIndex")
def nextIndex = currentIndex + 1
execution.setVariable("currentResourceIndex", nextIndex)
@@ -285,7 +288,7 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
}else{
execution.setVariable("allResourceFinished", "false")
}
- msoLogger.debug("======== COMPLETED parseNextResource Process ======== ")
+ logger.debug("======== COMPLETED parseNextResource Process ======== ")
}
public void prepareFinishedProgressForResource(DelegateExecution execution) {
@@ -333,7 +336,7 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
}
public void prepareSDNCServiceRequest (DelegateExecution execution, String svcAction) {
- msoLogger.debug(" ***** Started prepareSDNCServiceRequest for " + svcAction + "*****")
+ logger.debug(" ***** Started prepareSDNCServiceRequest for " + svcAction + "*****")
try {
// get variables
@@ -391,16 +394,16 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
</aetgt:SDNCAdapterWorkflowRequest>""".trim()
String sndcTopologyDeleteRequesAsString = utils.formatXml(sndcTopologyDeleteRequest)
- msoLogger.debug(sndcTopologyDeleteRequesAsString)
+ logger.debug(sndcTopologyDeleteRequesAsString)
execution.setVariable("sdncAdapterWorkflowRequest", sndcTopologyDeleteRequesAsString)
- msoLogger.debug("sdncAdapterWorkflowRequest - " + "\n" + sndcTopologyDeleteRequesAsString)
+ logger.debug("sdncAdapterWorkflowRequest - " + "\n" + sndcTopologyDeleteRequesAsString)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoDeleteResourcesV1 flow. prepareSDNCServiceRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- msoLogger.debug("***** Exit prepareSDNCServiceRequest for " + svcAction + "*****")
+ logger.debug("***** Exit prepareSDNCServiceRequest for " + svcAction + "*****")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy
index eb736f8ffe..2e1cca54a6 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -38,7 +40,8 @@ import org.onap.so.client.aai.AAIResourcesClient
import org.onap.so.client.aai.entities.AAIResultWrapper
import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.springframework.web.util.UriUtils;
import groovy.json.*
@@ -65,7 +68,7 @@ import groovy.json.*
* Rollback - Deferred
*/
public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoDeleteServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoDeleteServiceInstance.class);
String Prefix="DDELSI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -73,7 +76,7 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
public void preProcessRequest (DelegateExecution execution) {
- msoLogger.trace("preProcessRequest ")
+ logger.trace("preProcessRequest ")
String msg = ""
try {
@@ -99,18 +102,18 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
String serviceInstanceId = execution.getVariable("serviceInstanceId")
if (isBlank(serviceInstanceId)){
msg = "Input serviceInstanceId is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
String sdncCallbackUrl = UrnPropertiesReader.getVariable('mso.workflow.sdncadapter.callback',execution)
if (isBlank(sdncCallbackUrl)) {
msg = "mso.workflow.sdncadapter.callback is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
- msoLogger.debug("SDNC Callback URL: " + sdncCallbackUrl)
+ logger.debug("SDNC Callback URL: " + sdncCallbackUrl)
StringBuilder sbParams = new StringBuilder()
Map<String, String> paramsMap = execution.getVariable("serviceInputParams")
@@ -140,15 +143,15 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit preProcessRequest ")
+ logger.trace("Exit preProcessRequest ")
}
public void preProcessSDNCDelete (DelegateExecution execution) {
- msoLogger.trace("preProcessSDNCDelete ")
+ logger.trace("preProcessSDNCDelete ")
String msg = ""
try {
@@ -230,57 +233,57 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
String sdncDeactivate = sdncDelete.replace(">delete<", ">deactivate<").replace(">${sdncRequestId}<", ">${sdncRequestId2}<")
execution.setVariable("sdncDelete", sdncDelete)
execution.setVariable("sdncDeactivate", sdncDeactivate)
- msoLogger.debug("sdncDeactivate:\n" + sdncDeactivate)
- msoLogger.debug("sdncDelete:\n" + sdncDelete)
+ logger.debug("sdncDeactivate:\n" + sdncDeactivate)
+ logger.debug("sdncDelete:\n" + sdncDelete)
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in preProcessSDNCDelete. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "Exception Occured in preProcessSDNCDelete.\n" + ex.getMessage())
}
- msoLogger.debug(" *****Exit preProcessSDNCDelete *****")
+ logger.debug(" *****Exit preProcessSDNCDelete *****")
}
public void postProcessSDNCDelete(DelegateExecution execution, String response, String method) {
- msoLogger.trace("postProcessSDNC " + method + " ")
+ logger.trace("postProcessSDNC " + method + " ")
String msg = ""
try {
WorkflowException workflowException = execution.getVariable("WorkflowException")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.debug("SDNCResponse: " + response)
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("SDNCResponse: " + response)
+ logger.debug("workflowException: " + workflowException)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
- msoLogger.debug("Good response from SDNC Adapter for service-instance " + method + "response:\n" + response)
+ logger.debug("Good response from SDNC Adapter for service-instance " + method + "response:\n" + response)
}else{
msg = "Bad Response from SDNC Adapter for service-instance " + method
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 3500, msg)
}
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in postProcessSDNC " + method + " Exception:" + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit postProcessSDNC " + method + " ")
+ logger.trace("Exit postProcessSDNC " + method + " ")
}
/**
* Gets the service instance uri from aai
*/
public void getServiceInstance(DelegateExecution execution) {
- msoLogger.trace("getServiceInstance ")
+ logger.trace("getServiceInstance ")
try {
String serviceInstanceId = execution.getVariable('serviceInstanceId')
@@ -343,7 +346,7 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
}else{
execution.setVariable("siInUse", true)
- msoLogger.debug("Stopped deleting Service Instance, it has dependencies")
+ logger.debug("Stopped deleting Service Instance, it has dependencies")
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Stopped deleting Service Instance, it has dependencies")
}
}
@@ -355,7 +358,7 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
throw e;
}catch (Exception ex){
String msg = "Exception in getServiceInstance. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -364,7 +367,7 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
* Deletes the service instance in aai
*/
public void deleteServiceInstance(DelegateExecution execution) {
- msoLogger.trace("Entered deleteServiceInstance")
+ logger.trace("Entered deleteServiceInstance")
try {
String globalCustId = execution.getVariable("globalSubscriberId")
String serviceType = execution.getVariable("subscriptionServiceType")
@@ -374,9 +377,9 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustId, serviceType, serviceInstanceId)
resourceClient.delete(serviceInstanceUri)
- msoLogger.trace("Exited deleteServiceInstance")
+ logger.trace("Exited deleteServiceInstance")
}catch(Exception e){
- msoLogger.debug("Error occured within deleteServiceInstance method: " + e)
+ logger.debug("Error occured within deleteServiceInstance method: " + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Error occured during deleteServiceInstance from aai")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy
index 7c8a1d70e1..00244aded0 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -30,7 +32,8 @@ import org.onap.so.client.HttpClientFactory
import org.onap.so.client.aai.AAIObjectType
import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.onap.so.utils.TargetEntity
import org.onap.so.bpmn.core.UrnPropertiesReader
@@ -40,7 +43,7 @@ import javax.ws.rs.core.Response
* flow for E2E ServiceInstance Delete
*/
public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoDeleteVFCNetworkServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoDeleteVFCNetworkServiceInstance.class);
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -55,21 +58,21 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
public void preProcessRequest (DelegateExecution execution) {
String msg = ""
- msoLogger.trace("preProcessRequest() ")
+ logger.trace("preProcessRequest() ")
try {
//deal with operation key
String globalSubscriberId = execution.getVariable("globalSubscriberId")
- msoLogger.info("globalSubscriberId:" + globalSubscriberId)
+ logger.info("globalSubscriberId:" + globalSubscriberId)
String serviceType = execution.getVariable("serviceType")
- msoLogger.info("serviceType:" + serviceType)
+ logger.info("serviceType:" + serviceType)
String serviceId = execution.getVariable("serviceId")
- msoLogger.info("serviceId:" + serviceId)
+ logger.info("serviceId:" + serviceId)
String operationId = execution.getVariable("operationId")
- msoLogger.info("serviceType:" + serviceType)
+ logger.info("serviceType:" + serviceType)
String nodeTemplateUUID = execution.getVariable("resourceTemplateId")
- msoLogger.info("nodeTemplateUUID:" + nodeTemplateUUID)
+ logger.info("nodeTemplateUUID:" + nodeTemplateUUID)
String nsInstanceId = execution.getVariable("resourceInstanceId")
- msoLogger.info("nsInstanceId:" + nsInstanceId)
+ logger.info("nsInstanceId:" + nsInstanceId)
execution.setVariable("nsInstanceId",nsInstanceId)
String nsOperationKey = """{
"globalSubscriberId":"${globalSubscriberId}",
@@ -79,13 +82,13 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
"nodeTemplateUUID":"${nodeTemplateUUID}"
}"""
execution.setVariable("nsOperationKey", nsOperationKey);
- msoLogger.info("nsOperationKey:" + nsOperationKey)
+ logger.info("nsOperationKey:" + nsOperationKey)
String vfcAdapterUrl = UrnPropertiesReader.getVariable("mso.adapters.vfc.rest.endpoint", execution)
if (vfcAdapterUrl == null || vfcAdapterUrl.isEmpty()) {
msg = getProcessKey(execution) + ': mso:adapters:vfcc:rest:endpoint URN mapping is not defined'
- msoLogger.debug(msg)
+ logger.debug(msg)
}
while (vfcAdapterUrl.endsWith('/')) {
@@ -98,10 +101,10 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit preProcessRequest ")
+ logger.trace("Exit preProcessRequest ")
}
/**
@@ -109,10 +112,10 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
*/
public void deleteNSRelationship(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** deleteNSRelationship *****", isDebugEnabled)
+ logger.info(" ***** deleteNSRelationship *****")
String nsInstanceId = execution.getVariable("resourceInstanceId")
if(nsInstanceId == null || nsInstanceId == ""){
- utils.log("INFO"," Delete NS failed", isDebugEnabled)
+ logger.info(" Delete NS failed")
return
}
String globalSubscriberId = execution.getVariable("globalSubscriberId")
@@ -125,7 +128,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
}catch(Exception e){
exceptionUtil.buildAndThrowWorkflowException(execution,25000,"Exception occured while NS disconnect call: " + e.getMessage())
}
- utils.log("INFO"," *****Exit deleteNSRelationship *****", isDebugEnabled)
+ logger.info(" *****Exit deleteNSRelationship *****")
}
/**
@@ -133,7 +136,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
*/
public void deleteNetworkService(DelegateExecution execution) {
- msoLogger.trace("deleteNetworkService start ")
+ logger.trace("deleteNetworkService start ")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
String nsOperationKey = execution.getVariable("nsOperationKey");
String url = vfcAdapterUrl + "/ns/" + execution.getVariable("nsInstanceId")
@@ -145,7 +148,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
}
execution.setVariable("operationStatus", operationStatus)
- msoLogger.trace("deleteNetworkService end ")
+ logger.trace("deleteNetworkService end ")
}
/**
@@ -153,7 +156,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
*/
public void terminateNetworkService(DelegateExecution execution) {
- msoLogger.trace("terminateNetworkService start ")
+ logger.trace("terminateNetworkService start ")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
String nsOperationKey = execution.getVariable("nsOperationKey")
String url = vfcAdapterUrl + "/ns/" + execution.getVariable("nsInstanceId") + "/terminate"
@@ -165,7 +168,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
jobId = jsonUtil.getJsonValue(aaiResponseAsString, "jobId")
}
execution.setVariable("jobId", jobId)
- msoLogger.trace("terminateNetworkService end ")
+ logger.trace("terminateNetworkService end ")
}
/**
@@ -173,7 +176,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
*/
public void queryNSProgress(DelegateExecution execution) {
- msoLogger.trace("queryNSProgress start ")
+ logger.trace("queryNSProgress start ")
String vfcAdapterUrl = execution.getVariable("vfcAdapterUrl")
String jobId = execution.getVariable("jobId")
String nsOperationKey = execution.getVariable("nsOperationKey");
@@ -186,7 +189,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
operationProgress = jsonUtil.getJsonValue(apiResponseAsString, "responseDescriptor.progress")
}
execution.setVariable("operationProgress", operationProgress)
- msoLogger.trace("queryNSProgress end ")
+ logger.trace("queryNSProgress end ")
}
/**
@@ -196,7 +199,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
try {
Thread.sleep(5000);
} catch(InterruptedException e) {
- msoLogger.info("Time Delay exception" + e)
+ logger.info("Time Delay exception" + e)
}
}
@@ -214,8 +217,8 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
*/
private Response postRequest(DelegateExecution execution, String urlString, String requestBody){
- msoLogger.trace("Started Execute VFC adapter Post Process ")
- msoLogger.info("url:"+urlString +"\nrequestBody:"+ requestBody)
+ logger.trace("Started Execute VFC adapter Post Process ")
+ logger.info("url:"+urlString +"\nrequestBody:"+ requestBody)
Response apiResponse = null
try{
URL url = new URL(urlString);
@@ -229,11 +232,11 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
apiResponse = httpClient.post(requestBody)
- msoLogger.debug("response code:"+ apiResponse.getStatus() +"\nresponse body:"+ apiResponse.readEntity(String.class))
+ logger.debug("response code:"+ apiResponse.getStatus() +"\nresponse body:"+ apiResponse.readEntity(String.class))
- msoLogger.trace("Completed Execute VF-C adapter Post Process ")
+ logger.trace("Completed Execute VF-C adapter Post Process ")
}catch(Exception e){
- msoLogger.error("Exception occured while executing VF-C Post Call. Exception is: \n" + e.getMessage());
+ logger.error("Exception occured while executing VF-C Post Call. Exception is: \n" + e.getMessage());
throw new BpmnError("MSOWorkflowException")
}
return apiResponse
@@ -245,8 +248,8 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
*/
private Response deleteRequest(DelegateExecution execution, String url, String requestBody){
- msoLogger.trace("Started Execute VFC adapter Delete Process ")
- msoLogger.info("url:"+url +"\nrequestBody:"+ requestBody)
+ logger.trace("Started Execute VFC adapter Delete Process ")
+ logger.info("url:"+url +"\nrequestBody:"+ requestBody)
Response r
try{
@@ -260,9 +263,9 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
httpClient.addAdditionalHeader("Content-Type", "application/json")
r = httpClient.delete(requestBody)
- msoLogger.trace("Completed Execute VF-C adapter Delete Process ")
+ logger.trace("Completed Execute VF-C adapter Delete Process ")
}catch(Exception e){
- msoLogger.error("Exception occured while executing VF-C Post Call. Exception is: \n" + e.getMessage());
+ logger.error("Exception occured while executing VF-C Post Call. Exception is: \n" + e.getMessage());
throw new BpmnError("MSOWorkflowException")
}
return r
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy
index 3bc481ab01..2e0b69066e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -43,6 +45,8 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.springframework.web.util.UriUtils
import org.w3c.dom.Document
import org.w3c.dom.Element
@@ -71,7 +75,7 @@ import org.xml.sax.InputSource
*
*/
public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoDeleteVfModule.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoDeleteVfModule.class);
def Prefix="DoDVfMod_"
@@ -138,9 +142,9 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
}
else {
- msoLogger.debug("DoDeleteVfModule Request: " + xml)
+ logger.debug("DoDeleteVfModule Request: " + xml)
- msoLogger.debug("input request xml: " + xml)
+ logger.debug("input request xml: " + xml)
vnfId = utils.getNodeText(xml,"vnf-id")
execution.setVariable("vnfId", vnfId)
@@ -183,8 +187,8 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
<vf-module-id>${MsoUtils.xmlEscape(vfModuleId)}</vf-module-id>
<orchestration-status>pending-delete</orchestration-status>
</PrepareUpdateAAIVfModuleRequest>""" as String
- msoLogger.debug("PrepareUpdateAAIVfModuleRequest :" + request)
- msoLogger.debug("UpdateAAIVfModule Request: " + request)
+ logger.debug("PrepareUpdateAAIVfModuleRequest :" + request)
+ logger.debug("UpdateAAIVfModule Request: " + request)
execution.setVariable("PrepareUpdateAAIVfModuleRequest", request)
execution.setVariable("vfModuleFromAAI", null)
}catch(BpmnError b){
@@ -267,8 +271,8 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
</sdncadapterworkflow:SDNCRequestData>
</sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
- msoLogger.debug("sdncAdapterWorkflowRequest: " + request)
- msoLogger.debug("DoDeleteVfModule - SDNCAdapterWorkflowRequest: " + request)
+ logger.debug("sdncAdapterWorkflowRequest: " + request)
+ logger.debug("DoDeleteVfModule - SDNCAdapterWorkflowRequest: " + request)
execution.setVariable("sdncAdapterWorkflowRequest", request)
}
@@ -309,8 +313,8 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
</deleteVfModuleRequest>
""" as String
- msoLogger.debug("vnfAdapterRestV1Request: " + request)
- msoLogger.debug("deleteVfModuleRequest: " + request)
+ logger.debug("vnfAdapterRestV1Request: " + request)
+ logger.debug("deleteVfModuleRequest: " + request)
execution.setVariable("vnfAdapterRestV1Request", request)
}
@@ -327,8 +331,8 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
<heat-stack-id>DELETE</heat-stack-id>
<orchestration-status>deleted</orchestration-status>
</UpdateAAIVfModuleRequest>""" as String
- msoLogger.debug("UpdateAAIVfModuleRequest :" + request)
- msoLogger.debug("UpdateAAIVfModuleRequest: " + request)
+ logger.debug("UpdateAAIVfModuleRequest :" + request)
+ logger.debug("UpdateAAIVfModuleRequest: " + request)
execution.setVariable("UpdateAAIVfModuleRequest", request)
}
@@ -344,15 +348,17 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
<vnf-id>${MsoUtils.xmlEscape(vnfId)}</vnf-id>
<vf-module-id>${MsoUtils.xmlEscape(vfModuleId)}</vf-module-id>
</DeleteAAIVfModuleRequest>""" as String
- msoLogger.debug("DeleteAAIVfModuleRequest :" + request)
- msoLogger.debug("DeleteAAIVfModuleRequest: " + request)
+ logger.debug("DeleteAAIVfModuleRequest :" + request)
+ logger.debug("DeleteAAIVfModuleRequest: " + request)
execution.setVariable("DeleteAAIVfModuleRequest", request)
}
// generates a WorkflowException if
// -
public void handleDoDeleteVfModuleFailure(DelegateExecution execution) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "AAI error occurred deleting the Generic Vnf: " + execution.getVariable("DoDVfMod_deleteGenericVnfResponse"), "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception");
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "AAI error occurred deleting the Generic Vnf: " + execution.getVariable("DoDVfMod_deleteGenericVnfResponse"),
+ "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception");
String processKey = getProcessKey(execution);
WorkflowException exception = new WorkflowException(processKey, 5000,
execution.getVariable("DoDVfMod_deleteGenericVnfResponse"))
@@ -370,7 +376,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
- msoLogger.debug("Successfully Validated SDNC Response")
+ logger.debug("Successfully Validated SDNC Response")
}else{
throw new BpmnError("MSOWorkflowException")
}
@@ -381,19 +387,19 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix",Prefix)
try{
- msoLogger.trace("STARTED postProcessVNFAdapterRequest Process")
+ logger.trace("STARTED postProcessVNFAdapterRequest Process")
String vnfResponse = execution.getVariable("DoDVfMod_doDeleteVfModuleResponse")
- msoLogger.debug("VNF Adapter Response is: " + vnfResponse)
- msoLogger.debug("deleteVnfAResponse is: \n" + vnfResponse)
+ logger.debug("VNF Adapter Response is: " + vnfResponse)
+ logger.debug("deleteVnfAResponse is: \n" + vnfResponse)
if(vnfResponse != null){
if(vnfResponse.contains("deleteVfModuleResponse")){
- msoLogger.debug("Received a Good Response from VNF Adapter for DELETE_VF_MODULE Call.")
+ logger.debug("Received a Good Response from VNF Adapter for DELETE_VF_MODULE Call.")
execution.setVariable("DoDVfMod_vnfVfModuleDeleteCompleted", true)
// Parse vnfOutputs for contrail network polcy FQDNs
@@ -414,43 +420,43 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
String key = element.getElementsByTagNameNS("*", "key").item(0).getTextContent()
if (key.endsWith("contrail_network_policy_fqdn")) {
String contrailNetworkPolicyFqdn = element.getElementsByTagNameNS("*", "value").item(0).getTextContent()
- msoLogger.debug("Obtained contrailNetworkPolicyFqdn: " + contrailNetworkPolicyFqdn)
+ logger.debug("Obtained contrailNetworkPolicyFqdn: " + contrailNetworkPolicyFqdn)
contrailNetworkPolicyFqdnList.add(contrailNetworkPolicyFqdn)
}
else if (key.equals("oam_management_v4_address")) {
String oamManagementV4Address = element.getElementsByTagNameNS("*", "value").item(0).getTextContent()
- msoLogger.debug("Obtained oamManagementV4Address: " + oamManagementV4Address)
+ logger.debug("Obtained oamManagementV4Address: " + oamManagementV4Address)
execution.setVariable(Prefix + "oamManagementV4Address", oamManagementV4Address)
}
else if (key.equals("oam_management_v6_address")) {
String oamManagementV6Address = element.getElementsByTagNameNS("*", "value").item(0).getTextContent()
- msoLogger.debug("Obtained oamManagementV6Address: " + oamManagementV6Address)
+ logger.debug("Obtained oamManagementV6Address: " + oamManagementV6Address)
execution.setVariable(Prefix + "oamManagementV6Address", oamManagementV6Address)
}
}
}
if (!contrailNetworkPolicyFqdnList.isEmpty()) {
- msoLogger.debug("Setting the fqdn list")
+ logger.debug("Setting the fqdn list")
execution.setVariable("DoDVfMod_contrailNetworkPolicyFqdnList", contrailNetworkPolicyFqdnList)
}
}
}else{
- msoLogger.debug("Received a BAD Response from VNF Adapter for DELETE_VF_MODULE Call.")
+ logger.debug("Received a BAD Response from VNF Adapter for DELETE_VF_MODULE Call.")
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "VNF Adapter Error")
}
}else{
- msoLogger.debug("Response from VNF Adapter is Null for DELETE_VF_MODULE Call.")
+ logger.debug("Response from VNF Adapter is Null for DELETE_VF_MODULE Call.")
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Empty response from VNF Adapter")
}
}catch(BpmnError b){
throw b
}catch(Exception e){
- msoLogger.debug("Internal Error Occured in PostProcess Method")
+ logger.debug("Internal Error Occured in PostProcess Method")
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Internal Error Occured in PostProcess Method")
}
- msoLogger.trace("COMPLETED postProcessVnfAdapterResponse Process")
+ logger.trace("COMPLETED postProcessVnfAdapterResponse Process")
}
public void deleteNetworkPoliciesFromAAI(DelegateExecution execution) {
@@ -458,21 +464,21 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED deleteNetworkPoliciesFromAAI ")
+ logger.trace("STARTED deleteNetworkPoliciesFromAAI ")
try {
// get variables
List fqdnList = execution.getVariable("DoDVfMod_contrailNetworkPolicyFqdnList")
if (fqdnList == null) {
- msoLogger.debug("No network policies to delete")
+ logger.debug("No network policies to delete")
return
}
int fqdnCount = fqdnList.size()
execution.setVariable("DoDVfMod_networkPolicyFqdnCount", fqdnCount)
- msoLogger.debug("DoDVfMod_networkPolicyFqdnCount - " + fqdnCount)
+ logger.debug("DoDVfMod_networkPolicyFqdnCount - " + fqdnCount)
if (fqdnCount > 0) {
// AII loop call over contrail network policy fqdn list
@@ -489,7 +495,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
execution.setVariable("DCVFM_aaiQueryNetworkPolicyByFqdnReturnCode", 200)
// Retrieve the network policy id for this FQDN
def networkPolicyId = networkPolicy.getNetworkPolicyId()
- msoLogger.debug("Deleting network-policy with network-policy-id " + networkPolicyId)
+ logger.debug("Deleting network-policy with network-policy-id " + networkPolicyId)
try {
AAIResourceUri delUri = AAIUriFactory.createResourceUri(AAIObjectType.NETWORK_POLICY, networkPolicyId)
getAAIClient().delete(delUri)
@@ -497,30 +503,30 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
} catch (Exception e) {
execution.setVariable("DoDVfMod_aaiDeleteNetworkPolicyReturnCode", 500)
String delErrorMessage = "Unable to delete network-policy to AAI deleteNetworkPoliciesFromAAI - " + e.getMessage()
- msoLogger.debug(delErrorMessage)
+ logger.debug(delErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, delErrorMessage)
}
} else {
execution.setVariable("DCVFM_aaiQueryNetworkPolicyByFqdnReturnCode", 404)
// This network policy FQDN is not in AAI. No need to delete.
- msoLogger.debug("The return code is: " + 404)
- msoLogger.debug("This network policy FQDN is not in AAI: " + fqdn)
- msoLogger.debug("Network policy FQDN is not in AAI")
+ logger.debug("The return code is: " + 404)
+ logger.debug("This network policy FQDN is not in AAI: " + fqdn)
+ logger.debug("Network policy FQDN is not in AAI")
}
}catch(Exception e ) {
// aai all errors
String dataErrorMessage = "Unexpected Response from deleteNetworkPoliciesFromAAI - " + e.getMessage()
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
}
} // end loop
} else {
- msoLogger.debug("No contrail network policies to query/create")
+ logger.debug("No contrail network policies to query/create")
}
} catch (BpmnError e) {
throw e;
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DoDeletVfModule flow. deleteNetworkPoliciesFromAAI() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -536,7 +542,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def vnfId = execution.getVariable('vnfId')
@@ -563,15 +569,17 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
"""
updateAAIGenericVnfRequest = utils.formatXml(updateAAIGenericVnfRequest)
execution.setVariable(Prefix + 'updateAAIGenericVnfRequest', updateAAIGenericVnfRequest)
- msoLogger.debug("updateAAIGenericVnfRequest : " + updateAAIGenericVnfRequest)
- msoLogger.debug('Request for UpdateAAIGenericVnf:\n' + updateAAIGenericVnfRequest)
+ logger.debug("updateAAIGenericVnfRequest : " + updateAAIGenericVnfRequest)
+ logger.debug('Request for UpdateAAIGenericVnf:\n' + updateAAIGenericVnfRequest)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepUpdateAAIGenericVnf(): ' + e.getMessage())
}
}
@@ -589,7 +597,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
def method = getClass().getSimpleName() + '.queryAAIVfModuleForStatus(' +
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable(Prefix + 'orchestrationStatus', '')
@@ -607,18 +615,20 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
execution.setVariable(Prefix + 'queryAAIVfModuleForStatusResponse', vfModule.get())
def orchestrationStatus = vfModule.get().getOrchestrationStatus()
execution.setVariable(Prefix + "orchestrationStatus", orchestrationStatus)
- msoLogger.debug("Received orchestration status from A&AI: " + orchestrationStatus)
+ logger.debug("Received orchestration status from A&AI: " + orchestrationStatus)
}
} catch (Exception ex) {
ex.printStackTrace()
- msoLogger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
+ logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIVfModuleForStatus(): ' + e.getMessage())
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy
index abc83b2784..655d6ec958 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -43,9 +45,11 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
public class DoDeleteVfModuleFromVnf extends VfModuleBase {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoDeleteVfModuleFromVnf.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoDeleteVfModuleFromVnf.class);
def Prefix="DDVFMV_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -69,12 +73,12 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
String requestId = execution.getVariable("msoRequestId")
execution.setVariable("mso-request-id", requestId)
execution.setVariable("requestId", requestId)
- msoLogger.debug("msoRequestId: " + requestId)
+ logger.debug("msoRequestId: " + requestId)
String tenantId = execution.getVariable("tenantId")
- msoLogger.debug("tenantId: " + tenantId)
+ logger.debug("tenantId: " + tenantId)
String cloudSiteId = execution.getVariable("lcpCloudRegionId")
execution.setVariable("cloudSiteId", cloudSiteId)
- msoLogger.debug("cloudSiteId: " + cloudSiteId)
+ logger.debug("cloudSiteId: " + cloudSiteId)
// Source is HARDCODED
String source = "VID"
execution.setVariable("source", source)
@@ -85,11 +89,11 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
// ServiceId is hardcoded to empty
execution.setVariable("serviceId", "")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
- msoLogger.debug("serviceInstanceId: " + serviceInstanceId)
+ logger.debug("serviceInstanceId: " + serviceInstanceId)
String vnfId = execution.getVariable("vnfId")
- msoLogger.debug("vnfId: " + vnfId)
+ logger.debug("vnfId: " + vnfId)
String vfModuleId = execution.getVariable("vfModuleId")
- msoLogger.debug("vfModuleId: " + vfModuleId)
+ logger.debug("vfModuleId: " + vfModuleId)
if (serviceInstanceId == null || serviceInstanceId.isEmpty()) {
execution.setVariable(Prefix + "serviceInstanceIdToSdnc", vfModuleId)
}
@@ -102,24 +106,25 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
sdncVersion = "1707"
}
execution.setVariable(Prefix + "sdncVersion", sdncVersion)
- msoLogger.debug("Incoming Sdnc Version is: " + sdncVersion)
+ logger.debug("Incoming Sdnc Version is: " + sdncVersion)
String sdncCallbackUrl = (String) UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution)
if (sdncCallbackUrl == null || sdncCallbackUrl.trim().isEmpty()) {
def msg = 'Required variable \'mso.workflow.sdncadapter.callback\' is missing'
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, msg, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception");
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception");
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
- msoLogger.debug("SDNC Callback URL: " + sdncCallbackUrl)
- msoLogger.debug("SDNC Callback URL is: " + sdncCallbackUrl)
+ logger.debug("SDNC Callback URL: " + sdncCallbackUrl)
+ logger.debug("SDNC Callback URL is: " + sdncCallbackUrl)
}catch(BpmnError b){
throw b
}catch(Exception e){
- msoLogger.debug("Exception is: " + e.getMessage())
+ logger.debug("Exception is: " + e.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error encountered in PreProcess method!")
}
}
@@ -129,7 +134,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def vnfId = execution.getVariable('vnfId')
@@ -147,15 +152,17 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
}
} catch (Exception ex) {
ex.printStackTrace()
- msoLogger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
+ logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
execution.setVariable('DDVMFV_getVnfResponseCode', 500)
execution.setVariable('DDVFMV_getVnfResponse', 'AAI GET Failed:' + ex.getMessage())
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIForVfModule(): ' + e.getMessage())
}
}
@@ -173,7 +180,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
'execution=' + execution.getId() +
')'
def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
GenericVnf genericVnf = execution.getVariable('DDVMFV_getVnfResponse')
@@ -185,28 +192,30 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
}
if (!vfModule.isPresent()) {
String msg = 'VF Module \'' + vfModuleId + '\' does not exist in Generic VNF \'' + vnfId + '\''
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, msg)
} else {
Boolean isOnlyVfModule = (genericVnf.getVfModules().getVfModule().size() == 1)
if (isDebugLogEnabled) {
- msoLogger.debug('VF Module \'' + vfModuleId + '\': isBaseVfModule=' + vfModule.get().isIsBaseVfModule() + ', isOnlyVfModule=' + isOnlyVfModule)
+ logger.debug('VF Module \'' + vfModuleId + '\': isBaseVfModule=' + vfModule.get().isIsBaseVfModule() + ', isOnlyVfModule=' + isOnlyVfModule)
}
if (vfModule.get().isIsBaseVfModule() && !isOnlyVfModule) {
String msg = 'Cannot delete VF Module \'' + vfModuleId +
'\'since it is the base VF Module and it\'s not the only VF Module in Generic VNF \'' + vnfId + '\''
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002,msg)
}
def heatStackId = vfModule.get().getHeatStackId()
execution.setVariable('DDVMFV_heatStackId', heatStackId)
- msoLogger.debug('VF Module heatStackId retrieved from AAI: ' + heatStackId)
+ logger.debug('VF Module heatStackId retrieved from AAI: ' + heatStackId)
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in validateVfModule(): ' + e.getMessage())
}
}
@@ -215,7 +224,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
public void preProcessSDNCDeactivateRequest(DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessSDNCDeactivateRequest ")
+ logger.trace("STARTED preProcessSDNCDeactivateRequest ")
def serviceInstanceId = execution.getVariable("serviceInstanceId")
@@ -226,14 +235,16 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
deactivateSDNCRequest = utils.formatXml(deactivateSDNCRequest)
execution.setVariable("DDVMFV_deactivateSDNCRequest", deactivateSDNCRequest)
- msoLogger.debug("Outgoing DeactivateSDNCRequest is: \n" + deactivateSDNCRequest)
+ logger.debug("Outgoing DeactivateSDNCRequest is: \n" + deactivateSDNCRequest)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessSDNCDeactivateRequest. Exception is:\n" + e, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preProcessSDNCDeactivateRequest. Exception is:\n" + e, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessSDNCDeactivateRequest Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCDeactivateRequest ")
+ logger.trace("COMPLETED preProcessSDNCDeactivateRequest ")
}
public void preProcessSDNCUnassignRequest(DelegateExecution execution) {
@@ -241,23 +252,23 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessSDNCUnassignRequest Process ")
+ logger.trace("STARTED preProcessSDNCUnassignRequest Process ")
try{
String serviceInstanceId = execution.getVariable("serviceInstanceId")
String unassignSDNCRequest = buildSDNCRequest(execution, serviceInstanceId, "unassign")
execution.setVariable("DDVMFV_unassignSDNCRequest", unassignSDNCRequest)
- msoLogger.debug("Outgoing UnassignSDNCRequest is: \n" + unassignSDNCRequest)
+ logger.debug("Outgoing UnassignSDNCRequest is: \n" + unassignSDNCRequest)
}catch(Exception e){
- msoLogger.debug("Exception Occured Processing preProcessSDNCUnassignRequest. Exception is:\n" + e)
+ logger.debug("Exception Occured Processing preProcessSDNCUnassignRequest. Exception is:\n" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessSDNCUnassignRequest Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCUnassignRequest Process ")
+ logger.trace("COMPLETED preProcessSDNCUnassignRequest Process ")
}
public String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action){
@@ -314,33 +325,33 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
</sdncadapterworkflow:SDNCRequestData>
</sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
- msoLogger.debug("sdncRequest: " + sdncRequest)
+ logger.debug("sdncRequest: " + sdncRequest)
return sdncRequest
}
public void validateSDNCResponse(DelegateExecution execution, String response, String method){
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED ValidateSDNCResponse Process")
+ logger.trace("STARTED ValidateSDNCResponse Process")
WorkflowException workflowException = execution.getVariable("WorkflowException")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
- msoLogger.debug("SDNCResponse: " + response)
+ logger.debug("SDNCResponse: " + response)
String sdncResponse = response
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
- msoLogger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
+ logger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
}else{
- msoLogger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
+ logger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
throw new BpmnError("MSOWorkflowException")
}
- msoLogger.trace("COMPLETED ValidateSDNCResponse Process")
+ logger.trace("COMPLETED ValidateSDNCResponse Process")
}
@@ -381,8 +392,8 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
</deleteVfModuleRequest>
""" as String
- msoLogger.debug("vnfAdapterRestV1Request: " + request)
- msoLogger.debug("deleteVfModuleRequest: " + request)
+ logger.debug("vnfAdapterRestV1Request: " + request)
+ logger.debug("deleteVfModuleRequest: " + request)
execution.setVariable("vnfAdapterRestV1Request", request)
}
@@ -390,7 +401,9 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
// generates a WorkflowException if
// -
public void handleDoDeleteVfModuleFailure(DelegateExecution execution) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "AAI error occurred deleting the Generic Vnf: " + execution.getVariable("DDVFMV_deleteGenericVnfResponse"), "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception");
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "AAI error occurred deleting the Generic Vnf: " + execution.getVariable("DDVFMV_deleteGenericVnfResponse"),
+ "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception");
String processKey = getProcessKey(execution);
WorkflowException exception = new WorkflowException(processKey, 5000,
execution.getVariable("DDVFMV_deleteGenericVnfResponse"))
@@ -402,19 +415,19 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix",Prefix)
try{
- msoLogger.trace("STARTED postProcessVNFAdapterRequest Process")
+ logger.trace("STARTED postProcessVNFAdapterRequest Process")
String vnfResponse = execution.getVariable("DDVMFV_doDeleteVfModuleResponse")
- msoLogger.debug("VNF Adapter Response is: " + vnfResponse)
- msoLogger.debug("deleteVnfAResponse is: \n" + vnfResponse)
+ logger.debug("VNF Adapter Response is: " + vnfResponse)
+ logger.debug("deleteVnfAResponse is: \n" + vnfResponse)
if(vnfResponse != null){
if(vnfResponse.contains("deleteVfModuleResponse")){
- msoLogger.debug("Received a Good Response from VNF Adapter for DELETE_VF_MODULE Call.")
+ logger.debug("Received a Good Response from VNF Adapter for DELETE_VF_MODULE Call.")
execution.setVariable("DDVFMV_vnfVfModuleDeleteCompleted", true)
// Parse vnfOutputs for contrail network polcy FQDNs
@@ -428,41 +441,41 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
} else if (key.endsWith("contrail_network_policy_fqdn")) {
String contrailNetworkPolicyFqdn = utils.getChildNodeText(node, "value")
- msoLogger.debug("Obtained contrailNetworkPolicyFqdn: " + contrailNetworkPolicyFqdn)
+ logger.debug("Obtained contrailNetworkPolicyFqdn: " + contrailNetworkPolicyFqdn)
contrailNetworkPolicyFqdnList.add(contrailNetworkPolicyFqdn)
}
else if (key.equals("oam_management_v4_address")) {
String oamManagementV4Address = utils.getChildNodeText(node, "value")
- msoLogger.debug("Obtained oamManagementV4Address: " + oamManagementV4Address)
+ logger.debug("Obtained oamManagementV4Address: " + oamManagementV4Address)
execution.setVariable(Prefix + "oamManagementV4Address", oamManagementV4Address)
}
else if (key.equals("oam_management_v6_address")) {
String oamManagementV6Address = utils.getChildNodeText(node, "value")
- msoLogger.debug("Obtained oamManagementV6Address: " + oamManagementV6Address)
+ logger.debug("Obtained oamManagementV6Address: " + oamManagementV6Address)
execution.setVariable(Prefix + "oamManagementV6Address", oamManagementV6Address)
}
}
if (!contrailNetworkPolicyFqdnList.isEmpty()) {
- msoLogger.debug("Setting the fqdn list")
+ logger.debug("Setting the fqdn list")
execution.setVariable("DDVFMV_contrailNetworkPolicyFqdnList", contrailNetworkPolicyFqdnList)
}
}
}else{
- msoLogger.debug("Received a BAD Response from VNF Adapter for DELETE_VF_MODULE Call.")
+ logger.debug("Received a BAD Response from VNF Adapter for DELETE_VF_MODULE Call.")
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "VNF Adapter Error")
}
}else{
- msoLogger.debug("Response from VNF Adapter is Null for DELETE_VF_MODULE Call.")
+ logger.debug("Response from VNF Adapter is Null for DELETE_VF_MODULE Call.")
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Empty response from VNF Adapter")
}
}catch(BpmnError b){
throw b
}catch(Exception e){
- msoLogger.debug("Internal Error Occured in PostProcess Method")
+ logger.debug("Internal Error Occured in PostProcess Method")
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Internal Error Occured in PostProcess Method")
}
- msoLogger.trace("COMPLETED postProcessVnfAdapterResponse Process")
+ logger.trace("COMPLETED postProcessVnfAdapterResponse Process")
}
public void deleteNetworkPoliciesFromAAI(DelegateExecution execution) {
@@ -470,21 +483,21 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED deleteNetworkPoliciesFromAAI ")
+ logger.trace("STARTED deleteNetworkPoliciesFromAAI ")
try {
// get variables
List fqdnList = execution.getVariable("DDVFMV_contrailNetworkPolicyFqdnList")
if (fqdnList == null) {
- msoLogger.debug("No network policies to delete")
+ logger.debug("No network policies to delete")
return
}
int fqdnCount = fqdnList.size()
execution.setVariable("DDVFMV_networkPolicyFqdnCount", fqdnCount)
- msoLogger.debug("DDVFMV_networkPolicyFqdnCount - " + fqdnCount)
+ logger.debug("DDVFMV_networkPolicyFqdnCount - " + fqdnCount)
AaiUtil aaiUriUtil = new AaiUtil(this)
@@ -509,37 +522,37 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
// This network policy FQDN exists in AAI - need to delete it now
// Retrieve the network policy id for this FQDN
def networkPolicyId = networkPolicy.getNetworkPolicyId()
- msoLogger.debug("Deleting network-policy with network-policy-id " + networkPolicyId)
+ logger.debug("Deleting network-policy with network-policy-id " + networkPolicyId)
// Retrieve the resource version for this network policy
try {
AAIResourceUri delUri = AAIUriFactory.createResourceUri(AAIObjectType.NETWORK_POLICY, networkPolicyId)
getAAIClient().delete(delUri)
execution.setVariable("DDVFMV_aaiDeleteNetworkPolicyReturnCode", 200)
- msoLogger.debug(" ***** AAI delete network policy Response Code, NetworkPolicy #" + counting + " : " + 200)
+ logger.debug(" ***** AAI delete network policy Response Code, NetworkPolicy #" + counting + " : " + 200)
// This network policy was deleted from AAI successfully
- msoLogger.debug(" DelAAINetworkPolicy Success REST Response, , NetworkPolicy #" + counting + " : ")
+ logger.debug(" DelAAINetworkPolicy Success REST Response, , NetworkPolicy #" + counting + " : ")
} catch (Exception e) {
// aai all errors
String delErrorMessage = "Unable to delete network-policy to AAI deleteNetworkPoliciesFromAAI - " + e.getMessage()
- msoLogger.debug(delErrorMessage)
+ logger.debug(delErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, delErrorMessage)
}
} else {
execution.setVariable("DCVFM_aaiQueryNetworkPolicyByFqdnReturnCode", 404)
// This network policy FQDN is not in AAI. No need to delete.
- msoLogger.debug("This network policy FQDN is not in AAI: " + fqdn)
- msoLogger.debug("Network policy FQDN is not in AAI")
+ logger.debug("This network policy FQDN is not in AAI: " + fqdn)
+ logger.debug("Network policy FQDN is not in AAI")
}
} catch (Exception e) {
// aai all errors
String dataErrorMessage = "Unexpected Response from deleteNetworkPoliciesFromAAI - " + e.getMessage()
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
} // end loop
} else {
- msoLogger.debug("No contrail network policies to query/create")
+ logger.debug("No contrail network policies to query/create")
}
@@ -548,7 +561,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DoDeletVfModule flow. deleteNetworkPoliciesFromAAI() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -565,7 +578,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
<vnf-id>${MsoUtils.xmlEscape(vnfId)}</vnf-id>
<vf-module-id>${MsoUtils.xmlEscape(vfModuleId)}</vf-module-id>
</DeleteAAIVfModuleRequest>""" as String
- msoLogger.debug("DeleteAAIVfModuleRequest :" + request)
+ logger.debug("DeleteAAIVfModuleRequest :" + request)
execution.setVariable("DeleteAAIVfModuleRequest", request)
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy
index 710d13470f..787b582808 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -39,11 +41,12 @@ import org.onap.so.client.aai.entities.Relationships
import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.constants.Defaults
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import javax.ws.rs.NotFoundException
class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor{
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoDeleteVfModuleVolumeV2.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoDeleteVfModuleVolumeV2.class);
String prefix="DDVMV_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -89,7 +92,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor{
// if tenantId or lcpCloudregionId is not passed, get it from cloudRegionConfiguration variable
if(!tenantId || !cloudSiteId) {
def cloudConfiguration = execution.getVariable("cloudConfiguration")
- msoLogger.debug("Using cloudConfiguration variable to get tenantId and lcpCloudRegionId - " + cloudConfiguration)
+ logger.debug("Using cloudConfiguration variable to get tenantId and lcpCloudRegionId - " + cloudConfiguration)
tenantId = jsonUtil.getJsonValue(cloudConfiguration, "tenantId")
execution.setVariable("tenantId", tenantId)
cloudSiteId = jsonUtil.getJsonValue(cloudConfiguration, "lcpCloudRegionId")
@@ -135,7 +138,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor{
}
}
else {
- msoLogger.debug("AAI Query Cloud Region Unsuccessful.")
+ logger.debug("AAI Query Cloud Region Unsuccessful.")
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "AAI Query Cloud Region Unsuccessful. Return Code: " + execution.getVariable(prefix+"queryCloudRegionReturnCode"))
}
}
@@ -166,14 +169,14 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor{
def heatStackId = volumeGroup.getHeatStackId()==null ? '' : volumeGroup.getHeatStackId()
execution.setVariable(prefix+'volumeGroupHeatStackId', heatStackId)
- msoLogger.debug('Heat stack id from AAI response: ' + heatStackId)
+ logger.debug('Heat stack id from AAI response: ' + heatStackId)
AAIResultWrapper wrapper = getAAIClient().get(uri);
Optional<Relationships> relationships = wrapper.getRelationships()
String volumeGroupTenantId = null
if(relationships.isPresent()){
if(relationships.get().getRelatedAAIUris(AAIObjectType.VF_MODULE)){
- msoLogger.debug('Volume Group ' + volumeGroupId + ' currently in use')
+ logger.debug('Volume Group ' + volumeGroupId + ' currently in use')
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Volume Group ${volumeGroupId} currently in use - found vf-module relationship.")
}
for(AAIResourceUri aaiResourceUri: relationships.get().getRelatedAAIUris(AAIObjectType.TENANT)){
@@ -181,22 +184,22 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor{
}
}
- msoLogger.debug('Tenant ID from AAI response: ' + volumeGroupTenantId)
+ logger.debug('Tenant ID from AAI response: ' + volumeGroupTenantId)
if (volumeGroupTenantId == null) {
- msoLogger.debug("Could not find Tenant Id element in Volume Group with Volume Group Id ${volumeGroupId}")
+ logger.debug("Could not find Tenant Id element in Volume Group with Volume Group Id ${volumeGroupId}")
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Could not find Tenant Id element in Volume Group with Volume Group Id ${volumeGroupId}")
}
if (volumeGroupTenantId != tenantId) {
def String errorMessage = 'TenantId ' + tenantId + ' in incoming request does not match Tenant Id ' + volumeGroupTenantId + ' retrieved from AAI for Volume Group Id ' + volumeGroupId
- msoLogger.debug("Error in DeleteVfModuleVolume: " + errorMessage)
+ logger.debug("Error in DeleteVfModuleVolume: " + errorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 5000, errorMessage)
}
- msoLogger.debug('Received Tenant Id ' + volumeGroupTenantId + ' from AAI for Volume Group with Volume Group Id ' + volumeGroupId )
+ logger.debug('Received Tenant Id ' + volumeGroupTenantId + ' from AAI for Volume Group with Volume Group Id ' + volumeGroupId )
}else{
execution.setVariable(prefix + "queryAAIVolGrpResponse", "Volume Group ${volumeGroupId} not found in AAI. Response code: 404")
- msoLogger.debug("Volume Group ${volumeGroupId} not found in AAI")
+ logger.debug("Volume Group ${volumeGroupId} not found in AAI")
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Volume Group ${volumeGroupId} not found in AAI. Response code: 404")
}
}catch (Exception ex) {
@@ -244,7 +247,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor{
"""
vnfAdapterRestRequest = utils.formatXml(vnfAdapterRestRequest)
execution.setVariable(prefix+'deleteVnfARequest', vnfAdapterRestRequest)
- msoLogger.debug('Request for VNFAdapter Rest:\n' + vnfAdapterRestRequest)
+ logger.debug('Request for VNFAdapter Rest:\n' + vnfAdapterRestRequest)
}
@@ -263,7 +266,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor{
try {
AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP,Defaults.CLOUD_OWNER.toString(), cloudRegion, volumeGroupId)
getAAIClient().delete(resourceUri)
- msoLogger.debug("Volume group $volumeGroupId deleted.")
+ logger.debug("Volume group $volumeGroupId deleted.")
}catch (NotFoundException ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Volume group $volumeGroupId not found for delete in AAI Response code: 404")
}catch (Exception ex) {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnf.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnf.groovy
index 47a4d55e0c..25303473c7 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnf.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnf.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -44,8 +46,8 @@ import org.w3c.dom.Node
import org.w3c.dom.NodeList
import org.xml.sax.InputSource
-import org.onap.so.logger.MessageEnum
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
/**
* This class supports the DoDeleteVnf subFlow
@@ -54,7 +56,7 @@ import org.onap.so.logger.MsoLogger
*
*/
class DoDeleteVnf extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoDeleteVnf.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoDeleteVnf.class);
String Prefix="DoDVNF_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -71,7 +73,7 @@ class DoDeleteVnf extends AbstractServiceTaskProcessor {
public void preProcessRequest(DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED DoDeleteVnf PreProcessRequest Process")
+ logger.trace("STARTED DoDeleteVnf PreProcessRequest Process")
execution.setVariable("DoDVNF_SuccessIndicator", false)
execution.setVariable("DoDVNF_vnfInUse", false)
@@ -81,24 +83,24 @@ class DoDeleteVnf extends AbstractServiceTaskProcessor {
String vnfId = execution.getVariable("vnfId")
execution.setVariable("DoDVNF_vnfId", vnfId)
- msoLogger.debug("Incoming Vnf(Instance) Id is: " + vnfId)
+ logger.debug("Incoming Vnf(Instance) Id is: " + vnfId)
}catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
}catch(Exception e){
- msoLogger.debug(" Error Occured in DoDeleteVnf PreProcessRequest method!" + e)
+ logger.debug(" Error Occured in DoDeleteVnf PreProcessRequest method!" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoDeleteVnf PreProcessRequest")
}
- msoLogger.trace("COMPLETED DoDeleteVnf PreProcessRequest Process ")
+ logger.trace("COMPLETED DoDeleteVnf PreProcessRequest Process ")
}
public void getVnf(DelegateExecution execution){
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED DoDeleteVnf getVnf Process ")
+ logger.trace("STARTED DoDeleteVnf getVnf Process ")
try {
AAIResourcesClient resourceClient = new AAIResourcesClient()
@@ -113,7 +115,7 @@ class DoDeleteVnf extends AbstractServiceTaskProcessor {
if(!relationships.isEmpty()){
execution.setVariable("DoDVNF_vnfInUse", true)
}else{
- msoLogger.debug("Relationship NOT related to OpenStack")
+ logger.debug("Relationship NOT related to OpenStack")
}
}
@@ -130,18 +132,18 @@ class DoDeleteVnf extends AbstractServiceTaskProcessor {
}
} catch (Exception ex) {
- msoLogger.debug("Error Occured in DoDeleteVnf getVnf Process " + ex.getMessage())
+ logger.debug("Error Occured in DoDeleteVnf getVnf Process " + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoDeleteVnf getVnf Process")
}
- msoLogger.trace("COMPLETED DoDeleteVnf getVnf Process ")
+ logger.trace("COMPLETED DoDeleteVnf getVnf Process ")
}
/**
* Deletes the generic vnf from aai
*/
public void deleteVnf(DelegateExecution execution) {
- msoLogger.trace("STARTED deleteVnf")
+ logger.trace("STARTED deleteVnf")
try {
String vnfId = execution.getVariable("DoDVNF_vnfId")
@@ -149,9 +151,9 @@ class DoDeleteVnf extends AbstractServiceTaskProcessor {
AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
resourceClient.delete(uri)
- msoLogger.trace("COMPLETED deleteVnf")
+ logger.trace("COMPLETED deleteVnf")
} catch (Exception ex) {
- msoLogger.debug("Error Occured in DoDeleteVnf deleteVnf Process " + ex.getMessage())
+ logger.debug("Error Occured in DoDeleteVnf deleteVnf Process " + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoDeleteVnf deleteVnf Process")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy
index 6e0c6bb002..3b23a03589 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -44,13 +46,15 @@ import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.client.aai.AAIObjectType
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
/**
* This class supports the macro VID Flow
* with the deletion of a generic vnf and related VF modules.
*/
class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoDeleteVnfAndModules.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoDeleteVnfAndModules.class);
String Prefix="DDVAM_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -68,28 +72,28 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
public void preProcessRequest(DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED DoDeleteVnfAndModules PreProcessRequest Process")
+ logger.trace("STARTED DoDeleteVnfAndModules PreProcessRequest Process")
try{
// Get Variables
String cloudConfiguration = execution.getVariable("cloudConfiguration")
- msoLogger.debug("Cloud Configuration: " + cloudConfiguration)
+ logger.debug("Cloud Configuration: " + cloudConfiguration)
String requestId = execution.getVariable("msoRequestId")
execution.setVariable("requestId", requestId)
execution.setVariable("mso-request-id", requestId)
- msoLogger.debug("Incoming Request Id is: " + requestId)
+ logger.debug("Incoming Request Id is: " + requestId)
String serviceInstanceId = execution.getVariable("serviceInstanceId")
- msoLogger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
+ logger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
String vnfId = execution.getVariable("vnfId")
- msoLogger.debug("Incoming Vnf Id is: " + vnfId)
+ logger.debug("Incoming Vnf Id is: " + vnfId)
String source = "VID"
execution.setVariable("DDVAM_source", source)
- msoLogger.debug("Incoming Source is: " + source)
+ logger.debug("Incoming Source is: " + source)
execution.setVariable("DDVAM_isVidRequest", "true")
@@ -98,7 +102,7 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
sdncVersion = "1702"
}
execution.setVariable("DDVAM_sdncVersion", sdncVersion)
- msoLogger.debug("Incoming Sdnc Version is: " + sdncVersion)
+ logger.debug("Incoming Sdnc Version is: " + sdncVersion)
// Set aLaCarte flag to false
execution.setVariable("aLaCarte", false)
@@ -106,12 +110,13 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
String sdncCallbackUrl = (String) UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback", execution)
if (sdncCallbackUrl == null || sdncCallbackUrl.trim().isEmpty()) {
def msg = 'Required variable \'mso.workflow.sdncadapter.callback\' is missing'
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, msg, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception");
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception");
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
- msoLogger.debug("SDNC Callback URL: " + sdncCallbackUrl)
- msoLogger.debug("SDNC Callback URL is: " + sdncCallbackUrl)
+ logger.debug("SDNC Callback URL: " + sdncCallbackUrl)
+ logger.debug("SDNC Callback URL is: " + sdncCallbackUrl)
if (!sdncVersion.equals("1702")) {
@@ -120,66 +125,66 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
String serviceId = execution.getVariable("productFamilyId")
execution.setVariable("DDVAM_serviceId", serviceId)
- msoLogger.debug("Incoming Service Id is: " + serviceId)
+ logger.debug("Incoming Service Id is: " + serviceId)
//String modelInvariantId = jsonUtil.getJsonValue(vnfModelInfo, "modelInvariantId")
//execution.setVariable("DDVAM_modelInvariantId", modelInvariantId)
- //msoLogger.debug("Incoming Invariant Id is: " + modelInvariantId)
+ //logger.debug("Incoming Invariant Id is: " + modelInvariantId)
//String modelVersionId = jsonUtil.getJsonValue(vnfModelInfo, "modelVersionId")
//if (modelVersionId == null) {
// modelVersionId = ""
//}
//execution.setVariable("DDVAM_modelVersionId", modelVersionId)
- //msoLogger.debug("Incoming Version Id is: " + modelVersionId)
+ //logger.debug("Incoming Version Id is: " + modelVersionId)
//String modelVersion = jsonUtil.getJsonValue(vnfModelInfo, "modelVersion")
//execution.setVariable("DDVAM_modelVersion", modelVersion)
- //msoLogger.debug("Incoming Model Version is: " + modelVersion)
+ //logger.debug("Incoming Model Version is: " + modelVersion)
//String modelName = jsonUtil.getJsonValue(vnfModelInfo, "modelName")
//execution.setVariable("DDVAM_modelName", modelName)
- //msoLogger.debug("Incoming Model Name is: " + modelName)
+ //logger.debug("Incoming Model Name is: " + modelName)
//String modelCustomizationId = jsonUtil.getJsonValue(vnfModelInfo, "modelCustomizationId")
//if (modelCustomizationId == null) {
// modelCustomizationId = ""
//}
//execution.setVariable("DDVAM_modelCustomizationId", modelCustomizationId)
- //msoLogger.debug("Incoming Model Customization Id is: " + modelCustomizationId)
+ //logger.debug("Incoming Model Customization Id is: " + modelCustomizationId)
String cloudSiteId = execution.getVariable("lcpCloudRegionId")
execution.setVariable("DDVAM_cloudSiteId", cloudSiteId)
- msoLogger.debug("Incoming Cloud Site Id is: " + cloudSiteId)
+ logger.debug("Incoming Cloud Site Id is: " + cloudSiteId)
String tenantId = execution.getVariable("tenantId")
execution.setVariable("DDVAM_tenantId", tenantId)
- msoLogger.debug("Incoming Tenant Id is: " + tenantId)
+ logger.debug("Incoming Tenant Id is: " + tenantId)
String globalSubscriberId = execution.getVariable("globalSubscriberId")
if (globalSubscriberId == null) {
globalSubscriberId = ""
}
execution.setVariable("DDVAM_globalSubscriberId", globalSubscriberId)
- msoLogger.debug("Incoming Global Subscriber Id is: " + globalSubscriberId)
+ logger.debug("Incoming Global Subscriber Id is: " + globalSubscriberId)
}
execution.setVariable("DDVAM_vfModulesFromDecomposition", null)
// Retrieve serviceDecomposition if present
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
if (serviceDecomposition != null) {
- msoLogger.debug("Getting Catalog DB data from ServiceDecomposition object: " + serviceDecomposition.toJsonString())
+ logger.debug("Getting Catalog DB data from ServiceDecomposition object: " + serviceDecomposition.toJsonString())
List<VnfResource> vnfs = serviceDecomposition.getVnfResources()
- msoLogger.debug("Read vnfs")
+ logger.debug("Read vnfs")
if (vnfs == null) {
- msoLogger.debug("Error - vnfs are empty in serviceDecomposition object")
+ logger.debug("Error - vnfs are empty in serviceDecomposition object")
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in preProcessRequest - vnfs are empty")
}
VnfResource vnf = vnfs[0]
if (vnf == null) {
- msoLogger.debug("Error - vnf is empty in serviceDecomposition object")
+ logger.debug("Error - vnf is empty in serviceDecomposition object")
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in preProcessRequest - vnf is empty")
}
@@ -193,14 +198,14 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
}catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
}catch(Exception e){
- msoLogger.debug(" Error Occured in DoCreateVnfAndModules PreProcessRequest method!" + e.getMessage())
+ logger.debug(" Error Occured in DoCreateVnfAndModules PreProcessRequest method!" + e.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf PreProcessRequest")
}
- msoLogger.trace("COMPLETED DoDeleteVnfAndModules PreProcessRequest Process ")
+ logger.trace("COMPLETED DoDeleteVnfAndModules PreProcessRequest Process ")
}
@@ -208,7 +213,7 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
public void preProcessAddOnModule(DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessAddOnModule ")
+ logger.trace("STARTED preProcessAddOnModule ")
try {
JSONArray addOnModules = (JSONArray) execution.getVariable("addOnModules")
@@ -233,10 +238,12 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessAddOnModule." + e, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preProcessAddOnModule." + e, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessAddOnModule Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCAssignRequest ")
+ logger.trace("COMPLETED preProcessSDNCAssignRequest ")
}
/**
@@ -250,7 +257,7 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
def method = getClass().getSimpleName() + '.queryAAIVfModule(' +
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def vnfId = execution.getVariable('vnfId')
@@ -279,16 +286,16 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
// Find the model for this vf module in decomposition if specified
if (vfModulesFromDecomposition != null) {
- msoLogger.debug("vfModulesFromDecomposition is not null")
+ logger.debug("vfModulesFromDecomposition is not null")
def vfModuleUuid = vfModule.getModelVersionId()
if (vfModuleUuid == null) {
vfModuleUuid = vfModule.getPersonaModelVersion()
}
- msoLogger.debug("vfModule UUID is: " + vfModuleUuid)
+ logger.debug("vfModule UUID is: " + vfModuleUuid)
for (j in 0..vfModulesFromDecomposition.size()-1) {
ModuleResource mr = vfModulesFromDecomposition[j]
if (mr.getModelInfo().getModelUuid() == vfModuleUuid) {
- msoLogger.debug("Found modelInfo")
+ logger.debug("Found modelInfo")
vfModuleModelInfo = mr.getModelInfo()
break
}
@@ -325,14 +332,16 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
execution.setVariable("DDVAM_vfModules", vfModulesList)
} catch (Exception ex) {
ex.printStackTrace()
- msoLogger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
+ logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIVfModule(): ' + e.getMessage())
}
}
@@ -340,7 +349,7 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
public void prepareNextModuleToDelete(DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED prepareNextModuleToDelete ")
+ logger.trace("STARTED prepareNextModuleToDelete ")
try {
int i = execution.getVariable("DDVAM_nextModule")
@@ -354,20 +363,22 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
execution.setVariable("DDVAM_vfModuleName", vfModuleName)
def vfModuleModelInfo = vfModule.get("vfModuleModelInfo")
- msoLogger.debug("vfModuleModelInfo for module delete: " + vfModuleModelInfo)
+ logger.debug("vfModuleModelInfo for module delete: " + vfModuleModelInfo)
execution.setVariable("DDVAM_vfModuleModelInfo", vfModuleModelInfo)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessAddOnModule." + e, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preProcessAddOnModule." + e, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during prepareNextModuleToDelete Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED prepareNextModuleToDelete ")
+ logger.trace("COMPLETED prepareNextModuleToDelete ")
}
public void preProcessSDNCDeactivateRequest(DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessSDNCDeactivateRequest ")
+ logger.trace("STARTED preProcessSDNCDeactivateRequest ")
def vnfId = execution.getVariable("vnfId")
def serviceInstanceId = execution.getVariable("serviceInstanceId")
@@ -378,14 +389,16 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
deactivateSDNCRequest = utils.formatXml(deactivateSDNCRequest)
execution.setVariable("DDVAM_deactivateSDNCRequest", deactivateSDNCRequest)
- msoLogger.debug("Outgoing DeactivateSDNCRequest is: \n" + deactivateSDNCRequest)
- msoLogger.debug("Outgoing DeactivateSDNCRequest is: \n" + deactivateSDNCRequest)
+ logger.debug("Outgoing DeactivateSDNCRequest is: \n" + deactivateSDNCRequest)
+ logger.debug("Outgoing DeactivateSDNCRequest is: \n" + deactivateSDNCRequest)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessSDNCDeactivateRequest." + e, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preProcessSDNCDeactivateRequest." + e, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessSDNCDeactivateRequest Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCDeactivateRequest ")
+ logger.trace("COMPLETED preProcessSDNCDeactivateRequest ")
}
public void preProcessSDNCUnassignRequest(DelegateExecution execution) {
@@ -393,9 +406,9 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED preProcessSDNCUnassignRequest Process ")
+ logger.trace("STARTED preProcessSDNCUnassignRequest Process ")
try{
String vnfId = execution.getVariable("vnfId")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
@@ -403,14 +416,14 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
String unassignSDNCRequest = buildSDNCRequest(execution, serviceInstanceId, "unassign")
execution.setVariable("DDVAM_unassignSDNCRequest", unassignSDNCRequest)
- msoLogger.debug("Outgoing UnassignSDNCRequest is: \n" + unassignSDNCRequest)
- msoLogger.debug("Outgoing UnassignSDNCRequest is: \n" + unassignSDNCRequest)
+ logger.debug("Outgoing UnassignSDNCRequest is: \n" + unassignSDNCRequest)
+ logger.debug("Outgoing UnassignSDNCRequest is: \n" + unassignSDNCRequest)
}catch(Exception e){
- msoLogger.debug("Exception Occured Processing preProcessSDNCUnassignRequest. Exception is:\n" + e)
+ logger.debug("Exception Occured Processing preProcessSDNCUnassignRequest. Exception is:\n" + e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessSDNCUnassignRequest Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preProcessSDNCUnassignRequest Process ")
+ logger.trace("COMPLETED preProcessSDNCUnassignRequest Process ")
}
public String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action){
@@ -474,33 +487,33 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
</sdncadapterworkflow:SDNCRequestData>
</sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
- msoLogger.debug("sdncRequest: " + sdncRequest)
+ logger.debug("sdncRequest: " + sdncRequest)
return sdncRequest
}
public void validateSDNCResponse(DelegateExecution execution, String response, String method){
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED ValidateSDNCResponse Process")
+ logger.trace("STARTED ValidateSDNCResponse Process")
WorkflowException workflowException = execution.getVariable("WorkflowException")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
- msoLogger.debug("SDNCResponse: " + response)
+ logger.debug("SDNCResponse: " + response)
String sdncResponse = response
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
- msoLogger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
+ logger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
}else{
- msoLogger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
+ logger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
throw new BpmnError("MSOWorkflowException")
}
- msoLogger.trace("COMPLETED ValidateSDNCResponse Process")
+ logger.trace("COMPLETED ValidateSDNCResponse Process")
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoScaleE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoScaleE2EServiceInstance.groovy
index 41d9384f52..e04cf35c54 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoScaleE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoScaleE2EServiceInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 CMCC All rights reserved. *
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -31,6 +33,8 @@ import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.springframework.web.util.UriUtils;
@@ -40,7 +44,7 @@ import org.springframework.web.util.UriUtils;
*
*/
public class DoScaleE2EServiceInstance extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoScaleE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoScaleE2EServiceInstance.class);
String Prefix = "DCRESI_"
@@ -49,7 +53,7 @@ public class DoScaleE2EServiceInstance extends AbstractServiceTaskProcessor {
public void preProcessRequest(DelegateExecution execution) {
String msg = ""
- msoLogger.trace("preProcessRequest ")
+ logger.trace("preProcessRequest ")
try {
String requestId = execution.getVariable("msoRequestId")
@@ -82,22 +86,22 @@ public class DoScaleE2EServiceInstance extends AbstractServiceTaskProcessor {
}
if (isBlank(serviceInstanceId)) {
msg = "Input serviceInstanceId is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
} catch (BpmnError e) {
throw e;
} catch (Exception ex) {
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit preProcessRequest ")
+ logger.trace("Exit preProcessRequest ")
}
public void preInitResourcesOperStatus(DelegateExecution execution){
- msoLogger.trace("STARTED preInitResourcesOperStatus Process ")
+ logger.trace("STARTED preInitResourcesOperStatus Process ")
try{
String serviceId = execution.getVariable("serviceInstanceId")
String operationId = execution.getVariable("operationId")
@@ -105,7 +109,7 @@ public class DoScaleE2EServiceInstance extends AbstractServiceTaskProcessor {
// resourceTemplateUUIDs should be created ??
String resourceTemplateUUIDs = execution.getVariable("resourceTemplateUUIDs")
- msoLogger.info("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType)
+ logger.info("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType)
serviceId = UriUtils.encode(serviceId,"UTF-8")
execution.setVariable("serviceInstanceId", serviceId)
execution.setVariable("operationId", operationId)
@@ -129,14 +133,16 @@ public class DoScaleE2EServiceInstance extends AbstractServiceTaskProcessor {
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_initResOperStatusRequest", payload)
- msoLogger.info("Outgoing initResourceOperationStatus: \n" + payload)
- msoLogger.debug("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)
+ logger.info("Outgoing initResourceOperationStatus: \n" + payload)
+ logger.debug("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preInitResourcesOperStatus.", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preInitResourcesOperStatus.", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), e);
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED preInitResourcesOperStatus Process ")
+ logger.trace("COMPLETED preInitResourcesOperStatus Process ")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy
index 19d30bb9b1..671eb5cdc0 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 CMCC. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -46,6 +48,8 @@ import org.onap.so.bpmn.infrastructure.vfcmodel.NsParameters
import org.onap.so.bpmn.infrastructure.vfcmodel.LocationConstraint
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.onap.so.utils.TargetEntity
@@ -56,7 +60,7 @@ import org.onap.so.utils.TargetEntity
* flow for VFC Network Service Scale
*/
public class DoScaleVFCNetworkServiceInstance extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoScaleVFCNetworkServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoScaleVFCNetworkServiceInstance.class);
String host = "http://mso.mso.testlab.openecomp.org:8080"
@@ -76,7 +80,7 @@ public class DoScaleVFCNetworkServiceInstance extends AbstractServiceTaskProcess
* generate the nsParameters
*/
public void preProcessRequest(DelegateExecution execution) {
- msoLogger.trace("preProcessRequest() ")
+ logger.trace("preProcessRequest() ")
List<NSResourceInputParameter> nsRIPList = convertScaleNsReq2NSResInputParamList(execution)
String requestJsonStr = ""
@@ -93,7 +97,7 @@ public class DoScaleVFCNetworkServiceInstance extends AbstractServiceTaskProcess
execution.setVariable("reqBody", requestJsonStr)
- msoLogger.trace("Exit preProcessRequest ")
+ logger.trace("Exit preProcessRequest ")
}
/**
@@ -122,7 +126,7 @@ public class DoScaleVFCNetworkServiceInstance extends AbstractServiceTaskProcess
if (returnCode == "200" || returnCode == "202") {
jobId = jsonUtil.getJsonValue(aaiResponseAsString, "jobId")
}
- utils.log("INFO", "scaleNetworkService get a ns scale job Id:" + jobId, isDebugEnabled)
+ logger.info( "scaleNetworkService get a ns scale job Id:" + jobId)
execution.setVariable("jobId", jobId)
execution.setVariable("nodeTemplateUUID", nodeTemplateUUID)
@@ -178,7 +182,9 @@ public class DoScaleVFCNetworkServiceInstance extends AbstractServiceTaskProcess
try {
Thread.sleep(5000)
} catch (InterruptedException e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Time Delay exception" + e, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "");
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Time Delay exception" + e, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue());
}
}
@@ -196,8 +202,8 @@ public class DoScaleVFCNetworkServiceInstance extends AbstractServiceTaskProcess
* requestBody: the body of the request
*/
private Response postRequest(DelegateExecution execution, String urlString, String requestBody){
- msoLogger.trace("Started Execute VFC adapter Post Process ")
- msoLogger.info("url:"+urlString +"\nrequestBody:"+ requestBody)
+ logger.trace("Started Execute VFC adapter Post Process ")
+ logger.info("url:"+urlString +"\nrequestBody:"+ requestBody)
Response apiResponse = null
try{
URL url = new URL(urlString);
@@ -207,10 +213,10 @@ public class DoScaleVFCNetworkServiceInstance extends AbstractServiceTaskProcess
apiResponse = httpClient.post(requestBody)
- msoLogger.info("response code:"+ apiResponse.getStatus() +"\nresponse body:"+ apiResponse.readEntity(String.class))
- msoLogger.trace("Completed Execute VF-C adapter Post Process ")
+ logger.info("response code:"+ apiResponse.getStatus() +"\nresponse body:"+ apiResponse.readEntity(String.class))
+ logger.trace("Completed Execute VF-C adapter Post Process ")
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception occured while executing VFC Post Call.", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "Exception occured while executing VFC Post Call.", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), e);
throw new BpmnError("MSOWorkflowException")
}
return apiResponse
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy
index baa695af09..4fe30803c4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -40,6 +42,8 @@ import org.onap.so.client.aai.entities.AAIResultWrapper
import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.springframework.web.util.UriUtils;
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import groovy.json.*
@@ -67,6 +71,7 @@ import groovy.json.*
* @param - WorkflowException
*/
public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
+ private static final Logger logger = LoggerFactory.getLogger( DoUpdateE2EServiceInstance.class);
String Prefix="DUPDSI_"
private static final String DebugFlag = "isDebugEnabled"
@@ -76,7 +81,7 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** Enter DoUpdateE2EServiceInstance preProcessRequest *****", isDebugEnabled)
+ logger.info(" ***** Enter DoUpdateE2EServiceInstance preProcessRequest *****")
String msg = ""
@@ -85,24 +90,24 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
//Inputs
//for AAI GET & PUT & SDNC assignToplology
String globalSubscriberId = execution.getVariable("globalSubscriberId") //globalCustomerId
- utils.log("INFO"," ***** globalSubscriberId *****" + globalSubscriberId, isDebugEnabled)
+ logger.info(" ***** globalSubscriberId *****" + globalSubscriberId)
//for AAI PUT & SDNC assignTopology
String serviceType = execution.getVariable("serviceType")
- utils.log("INFO"," ***** serviceType *****" + serviceType, isDebugEnabled)
+ logger.info(" ***** serviceType *****" + serviceType)
//for SDNC assignTopology
String productFamilyId = execution.getVariable("productFamilyId") //AAI productFamilyId
if (isBlank(globalSubscriberId)) {
msg = "Input globalSubscriberId is null"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(serviceType)) {
msg = "Input serviceType is null"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
@@ -110,7 +115,7 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
String serviceInstanceId = execution.getVariable("serviceInstanceId")
if (isBlank(serviceInstanceId)){
msg = "Input serviceInstanceId is null"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
@@ -122,29 +127,29 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
// target model Invariant uuid
String modelInvariantUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceInvariantUuid")
execution.setVariable("modelInvariantUuid", modelInvariantUuid)
- utils.log("INFO", "modelInvariantUuid: " + modelInvariantUuid, isDebugEnabled)
+ logger.info( "modelInvariantUuid: " + modelInvariantUuid)
// target model uuid
String modelUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceUuid")
execution.setVariable("modelUuid", modelUuid)
- utils.log("INFO","modelUuid: " + modelUuid, isDebugEnabled)
+ logger.info("modelUuid: " + modelUuid)
} catch (BpmnError e) {
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- utils.log("INFO", "======== COMPLETED preProcessRequest Process ======== ", isDebugEnabled)
+ logger.info( "======== COMPLETED preProcessRequest Process ======== ")
}
public void preInitResourcesOperStatus(DelegateExecution execution){
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO", " ======== STARTED preInitResourcesOperStatus Process ======== ", isDebugEnabled)
+ logger.info( " ======== STARTED preInitResourcesOperStatus Process ======== ")
try{
String serviceId = execution.getVariable("serviceInstanceId")
String operationId = execution.getVariable("operationId")
@@ -154,7 +159,7 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
String progress = "0"
String reason = ""
String operationContent = "Prepare service updating"
- utils.log("INFO", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType, isDebugEnabled)
+ logger.info( "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType)
serviceId = UriUtils.encode(serviceId,"UTF-8")
execution.setVariable("serviceInstanceId", serviceId)
execution.setVariable("operationId", operationId)
@@ -171,7 +176,7 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
- utils.log("INFO", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
+ logger.info( "DB Adapter Endpoint is: " + dbAdapterEndpoint)
String payload =
"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
@@ -189,20 +194,20 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_initResOperStatusRequest", payload)
- utils.log("INFO", "Outgoing initResourceOperationStatus: \n" + payload, isDebugEnabled)
+ logger.info( "Outgoing initResourceOperationStatus: \n" + payload)
utils.logAudit("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)
}catch(Exception e){
- utils.log("ERROR", "Exception Occured Processing preInitResourcesOperStatus. Exception is:\n" + e, isDebugEnabled)
+ logger.info( "Exception Occured Processing preInitResourcesOperStatus. Exception is:\n" + e)
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage())
}
- utils.log("INFO", "======== COMPLETED preInitResourcesOperStatus Process ======== ", isDebugEnabled)
+ logger.info( "======== COMPLETED preInitResourcesOperStatus Process ======== ")
}
public void preProcessForAddResource(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** preProcessForAddResource ***** ", isDebugEnabled)
+ logger.info(" ***** preProcessForAddResource ***** ")
execution.setVariable("operationType", "create")
@@ -212,21 +217,21 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
execution.setVariable("hasResourcetoAdd", true)
}
- utils.log("INFO"," *** Exit preProcessForAddResource *** ", isDebugEnabled)
+ logger.info(" *** Exit preProcessForAddResource *** ")
}
public void postProcessForAddResource(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** postProcessForAddResource ***** ", isDebugEnabled)
+ logger.info(" ***** postProcessForAddResource ***** ")
execution.setVariable("operationType", "update")
- utils.log("INFO"," *** Exit postProcessForAddResource *** ", isDebugEnabled)
+ logger.info(" *** Exit postProcessForAddResource *** ")
}
public void preProcessForDeleteResource(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** preProcessForDeleteResource ***** ", isDebugEnabled)
+ logger.info(" ***** preProcessForDeleteResource ***** ")
execution.setVariable("operationType", "delete")
@@ -259,22 +264,22 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
execution.setVariable("deleteResourceList", delResourceList)
- utils.log("INFO"," *** Exit preProcessForDeleteResource *** ", isDebugEnabled)
+ logger.info(" *** Exit preProcessForDeleteResource *** ")
}
public void postProcessForDeleteResource(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** postProcessForDeleteResource ***** ", isDebugEnabled)
+ logger.info(" ***** postProcessForDeleteResource ***** ")
execution.setVariable("operationType", "update")
- utils.log("INFO"," *** Exit postProcessForDeleteResource *** ", isDebugEnabled)
+ logger.info(" *** Exit postProcessForDeleteResource *** ")
}
public void preProcessAAIPUT(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessRequest(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO","Entered " + method, isDebugEnabled)
+ logger.info("Entered " + method)
String msg = ""
String serviceInstanceVersion = execution.getVariable("serviceInstanceVersion")
@@ -299,12 +304,12 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
execution.setVariable("serviceInstanceData", si)
- utils.log("INFO", "Exited " + method, isDebugEnabled)
+ logger.info( "Exited " + method)
}
public void updateServiceInstance(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** createServiceInstance ***** ", isDebugEnabled)
+ logger.info(" ***** createServiceInstance ***** ")
String msg = ""
String serviceInstanceId = execution.getVariable("serviceInstanceId")
try {
@@ -327,52 +332,52 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
execution.setVariable("rollbackData", rollbackData)
msg = "Exception in DoCreateServiceInstance.createServiceInstance. " + ex.getMessage()
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- utils.log("INFO"," *** Exit createServiceInstance *** ", isDebugEnabled)
+ logger.info(" *** Exit createServiceInstance *** ")
}
public void preProcessRollback (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** preProcessRollback ***** ", isDebugEnabled)
+ logger.info(" ***** preProcessRollback ***** ")
try {
Object workflowException = execution.getVariable("WorkflowException");
if (workflowException instanceof WorkflowException) {
- utils.log("INFO", "Prev workflowException: " + workflowException.getErrorMessage(), isDebugEnabled)
+ logger.info( "Prev workflowException: " + workflowException.getErrorMessage())
execution.setVariable("prevWorkflowException", workflowException);
//execution.setVariable("WorkflowException", null);
}
} catch (BpmnError e) {
- utils.log("INFO", "BPMN Error during preProcessRollback", isDebugEnabled)
+ logger.info( "BPMN Error during preProcessRollback")
} catch(Exception ex) {
String msg = "Exception in preProcessRollback. " + ex.getMessage()
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
}
- utils.log("INFO"," *** Exit preProcessRollback *** ", isDebugEnabled)
+ logger.info(" *** Exit preProcessRollback *** ")
}
public void postProcessRollback (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** postProcessRollback ***** ", isDebugEnabled)
+ logger.info(" ***** postProcessRollback ***** ")
String msg = ""
try {
Object workflowException = execution.getVariable("prevWorkflowException");
if (workflowException instanceof WorkflowException) {
- utils.log("INFO", "Setting prevException to WorkflowException: ", isDebugEnabled)
+ logger.info( "Setting prevException to WorkflowException: ")
execution.setVariable("WorkflowException", workflowException);
}
execution.setVariable("rollbackData", null)
} catch (BpmnError b) {
- utils.log("INFO", "BPMN Error during postProcessRollback", isDebugEnabled)
+ logger.info( "BPMN Error during postProcessRollback")
throw b;
} catch(Exception ex) {
msg = "Exception in postProcessRollback. " + ex.getMessage()
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
}
- utils.log("INFO"," *** Exit postProcessRollback *** ", isDebugEnabled)
+ logger.info(" *** Exit postProcessRollback *** ")
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstanceRollback.groovy
index 949a566711..0a635c6bc6 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstanceRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstanceRollback.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -35,7 +37,8 @@ import org.onap.so.client.aai.AAIResourcesClient
import org.onap.so.client.aai.entities.AAIResultWrapper
import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.onap.so.bpmn.common.scripts.ExceptionUtil;
import groovy.json.*
import org.onap.so.bpmn.common.scripts.AaiUtil;
@@ -61,7 +64,7 @@ import org.onap.so.bpmn.common.scripts.AaiUtil;
*
*/
public class DoUpdateE2EServiceInstanceRollback extends AbstractServiceTaskProcessor{
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoUpdateE2EServiceInstanceRollback.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoUpdateE2EServiceInstanceRollback.class);
String Prefix="DUPDSIRB_"
@@ -70,7 +73,7 @@ public class DoUpdateE2EServiceInstanceRollback extends AbstractServiceTaskProce
public void preProcessRequest(DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
String msg = ""
- msoLogger.trace("preProcessRequest ")
+ logger.trace("preProcessRequest ")
execution.setVariable("rollbackAAI",false)
execution.setVariable("rollbackAdded",false)
execution.setVariable("rollbackDeleted",false)
@@ -85,7 +88,7 @@ public class DoUpdateE2EServiceInstanceRollback extends AbstractServiceTaskProce
try {
def rollbackData = execution.getVariable("rollbackData")
- msoLogger.debug("RollbackData:" + rollbackData)
+ logger.debug("RollbackData:" + rollbackData)
if (rollbackData != null) {
if (rollbackData.hasType("SERVICEINSTANCE")) {
@@ -140,14 +143,14 @@ public class DoUpdateE2EServiceInstanceRollback extends AbstractServiceTaskProce
throw e;
} catch (Exception ex){
msg = "Exception in Update ServiceInstance Rollback preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit preProcessRequest ")
+ logger.trace("Exit preProcessRequest ")
}
public void postProcessRequest(DelegateExecution execution) {
- msoLogger.trace("postProcessRequest ")
+ logger.trace("postProcessRequest ")
String msg = ""
try {
execution.setVariable("rollbackData", null)
@@ -171,17 +174,17 @@ public class DoUpdateE2EServiceInstanceRollback extends AbstractServiceTaskProce
if(!succInAAI){
execution.setVariable("rolledBack", false) //both sdnc and aai must be successful to declare rollback Succesful
execution.setVariable("rollbackError", "Error deleting service-instance in AAI for rollback")
- msoLogger.debug("Error deleting service-instance in AAI for rollback", + serviceInstanceId)
+ logger.debug("Error deleting service-instance in AAI for rollback", + serviceInstanceId)
}
}
- msoLogger.trace("Exit postProcessRequest ")
+ logger.trace("Exit postProcessRequest ")
} catch (BpmnError e) {
msg = "Exception in Create ServiceInstance Rollback postProcessRequest. " + e.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
} catch (Exception ex) {
msg = "Exception in Create ServiceInstance Rollback postProcessRequest. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
}
@@ -200,9 +203,9 @@ public class DoUpdateE2EServiceInstanceRollback extends AbstractServiceTaskProce
public void preProcessAAIPUT(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessRequest(' +'execution=' + execution.getId() +')'
- msoLogger.info("Entered " + method)
+ logger.info("Entered " + method)
String msg = ""
- msoLogger.trace("preProcessAAIPUT ")
+ logger.trace("preProcessAAIPUT ")
String serviceInstanceVersion = execution.getVariable("serviceInstanceVersion_n")
// execution.setVariable("GENPS_serviceResourceVersion", serviceInstanceVersion)
@@ -227,11 +230,11 @@ public class DoUpdateE2EServiceInstanceRollback extends AbstractServiceTaskProce
execution.setVariable("serviceInstanceData", si)
- msoLogger.info("Exited " + method)
+ logger.info("Exited " + method)
}
public void updateServiceInstance(DelegateExecution execution) {
- msoLogger.trace("updateServiceInstance ")
+ logger.trace("updateServiceInstance ")
String msg = ""
try {
String serviceInstanceId = execution.getVariable("serviceInstanceId")
@@ -245,40 +248,40 @@ public class DoUpdateE2EServiceInstanceRollback extends AbstractServiceTaskProce
throw e;
} catch (Exception ex) {
msg = "Exception in DoCreateServiceInstance.updateServiceInstance. " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit updateServiceInstance ")
+ logger.trace("Exit updateServiceInstance ")
}
public void processRollbackException(DelegateExecution execution){
- msoLogger.trace("processRollbackException ")
+ logger.trace("processRollbackException ")
try{
- msoLogger.debug("Caught an Exception in DoUpdateE2EServiceInstanceRollback")
+ logger.debug("Caught an Exception in DoUpdateE2EServiceInstanceRollback")
execution.setVariable("rollbackData", null)
execution.setVariable("rollbackError", "Caught exception in ServiceInstance Update Rollback")
execution.setVariable("WorkflowException", null)
}catch(BpmnError b){
- msoLogger.debug("BPMN Error during processRollbackExceptions Method: ")
+ logger.debug("BPMN Error during processRollbackExceptions Method: ")
}catch(Exception e){
- msoLogger.debug("Caught Exception during processRollbackExceptions Method: " + e.getMessage())
+ logger.debug("Caught Exception during processRollbackExceptions Method: " + e.getMessage())
}
- msoLogger.debug(" Exit processRollbackException")
+ logger.debug(" Exit processRollbackException")
}
public void processRollbackJavaException(DelegateExecution execution){
- msoLogger.trace("processRollbackJavaException ")
+ logger.trace("processRollbackJavaException ")
try{
execution.setVariable("rollbackData", null)
execution.setVariable("rollbackError", "Caught Java exception in ServiceInstance Update Rollback")
- msoLogger.debug("Caught Exception in processRollbackJavaException")
+ logger.debug("Caught Exception in processRollbackJavaException")
}catch(Exception e){
- msoLogger.debug("Caught Exception in processRollbackJavaException " + e.getMessage())
+ logger.debug("Caught Exception in processRollbackJavaException " + e.getMessage())
}
- msoLogger.trace("Exit processRollbackJavaException ")
+ logger.trace("Exit processRollbackJavaException ")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy
index 6dd8085bae..ce61595680 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -43,7 +45,8 @@ import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.client.aai.entities.AAIResultWrapper
import org.onap.so.client.graphinventory.entities.uri.Depth
import org.onap.so.constants.Defaults
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.springframework.web.util.UriUtils
import org.w3c.dom.Document
@@ -68,7 +71,7 @@ import groovy.xml.XmlUtil
*
*/
public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoUpdateNetworkInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoUpdateNetworkInstance.class);
String Prefix="UPDNETI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -176,7 +179,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside preProcessRequest DoUpdateNetworkInstance Request ")
+ logger.trace("Inside preProcessRequest DoUpdateNetworkInstance Request ")
try {
// initialize flow variables
@@ -190,12 +193,12 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
// JSON format request is sent, create xml
try {
def prettyJson = JsonOutput.prettyPrint(networkRequest.toString())
- msoLogger.debug(" Incoming message formatted . . . : " + '\n' + prettyJson)
+ logger.debug(" Incoming message formatted . . . : " + '\n' + prettyJson)
networkRequest = vidUtils.createXmlNetworkRequestInfra(execution, networkRequest)
} catch (Exception ex) {
String dataErrorMessage = " Invalid json format Request - " + ex.getMessage()
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
} else {
@@ -208,32 +211,32 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
}
networkRequest = utils.formatXml(networkRequest)
- msoLogger.debug(networkRequest)
+ logger.debug(networkRequest)
execution.setVariable(Prefix + "networkRequest", networkRequest)
- msoLogger.debug(" network-request - " + '\n' + networkRequest)
+ logger.debug(" network-request - " + '\n' + networkRequest)
// validate 'disableRollback' (aka, 'suppressRollback')
boolean rollbackEnabled = networkUtils.isRollbackEnabled(execution, networkRequest)
execution.setVariable(Prefix + "rollbackEnabled", rollbackEnabled)
- msoLogger.debug(Prefix + "rollbackEnabled - " + rollbackEnabled)
+ logger.debug(Prefix + "rollbackEnabled - " + rollbackEnabled)
String networkInputs = utils.getNodeXml(networkRequest, "network-inputs", false).replace("tag0:","").replace(":tag0","")
execution.setVariable(Prefix + "networkInputs", networkInputs)
- msoLogger.debug(Prefix + "networkInputs - " + '\n' + networkInputs)
+ logger.debug(Prefix + "networkInputs - " + '\n' + networkInputs)
// prepare messageId
String messageId = execution.getVariable(Prefix + "messageId") // for testing
if (messageId == null || messageId == "") {
messageId = UUID.randomUUID()
- msoLogger.debug(" UPDNETI_messageId, random generated: " + messageId)
+ logger.debug(" UPDNETI_messageId, random generated: " + messageId)
} else {
- msoLogger.debug(" UPDNETI_messageId, pre-assigned: " + messageId)
+ logger.debug(" UPDNETI_messageId, pre-assigned: " + messageId)
}
execution.setVariable(Prefix + "messageId", messageId)
String source = utils.getNodeText(networkRequest, "source")
execution.setVariable(Prefix + "source", source)
- msoLogger.debug(Prefix + "source - " + source)
+ logger.debug(Prefix + "source - " + source)
String networkId = ""
if (utils.nodeExists(networkRequest, "network-id")) {
@@ -242,7 +245,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
sendSyncError(execution)
// missing value of networkId
String dataErrorMessage = "Variable 'network-id' value/element is missing."
- msoLogger.debug(" Invalid Request - " + dataErrorMessage)
+ logger.debug(" Invalid Request - " + dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
@@ -254,7 +257,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
if ((lcpCloudRegion == 'null') || (lcpCloudRegion == "")) {
sendSyncError(execution)
String dataErrorMessage = "requestDetails has missing 'aic-cloud-region' value/element."
- msoLogger.debug(" Invalid Request - " + dataErrorMessage)
+ logger.debug(" Invalid Request - " + dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
}
@@ -265,7 +268,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
if ((serviceInstanceId == 'null') || (lcpCloudRegion == "")) {
sendSyncError(execution)
String dataErrorMessage = "Variable 'serviceInstanceId' value/element is missing."
- msoLogger.debug(" Invalid Request - " + dataErrorMessage)
+ logger.debug(" Invalid Request - " + dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
}
@@ -282,18 +285,18 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
} catch (IOException ex) {
String exceptionMessage = "Exception Encountered in DoUpdateNetworkInstance, PreProcessRequest() - "
String dataErrorMessage = exceptionMessage + " Unable to encode PO/SDNC user/password string - " + ex.getMessage()
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
// Set variables for Generic Get Sub Flow use
execution.setVariable(Prefix + "serviceInstanceId", serviceInstanceId)
- msoLogger.debug(Prefix + "serviceInstanceId - " + serviceInstanceId)
+ logger.debug(Prefix + "serviceInstanceId - " + serviceInstanceId)
- msoLogger.debug(" Url for SDNC adapter: " + UrnPropertiesReader.getVariable("mso.adapters.sdnc.endpoint",execution))
+ logger.debug(" Url for SDNC adapter: " + UrnPropertiesReader.getVariable("mso.adapters.sdnc.endpoint",execution))
String sdncVersion = execution.getVariable("sdncVersion")
- msoLogger.debug("sdncVersion? : " + sdncVersion)
+ logger.debug("sdncVersion? : " + sdncVersion)
// build 'networkOutputs'
networkId = utils.getNodeText(networkRequest, "network-id")
@@ -310,7 +313,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
<network-name>${MsoUtils.xmlEscape(networkName)}</network-name>
</network-outputs>"""
execution.setVariable(Prefix + "networkOutputs", networkOutputs)
- msoLogger.debug(Prefix + "networkOutputs - " + '\n' + networkOutputs)
+ logger.debug(Prefix + "networkOutputs - " + '\n' + networkOutputs)
execution.setVariable(Prefix + "networkId", networkId)
execution.setVariable(Prefix + "networkName", networkName)
@@ -322,7 +325,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
sendSyncError(execution)
// caught exception
String exceptionMessage = "Exception Encountered in DoUpdateNetworkInstance, PreProcessRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -333,7 +336,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
*
*/
public void getServiceInstance(DelegateExecution execution) {
- msoLogger.trace("getServiceInstance ")
+ logger.trace("getServiceInstance ")
try {
String serviceInstanceId = execution.getVariable('serviceInstanceId')
@@ -352,7 +355,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
throw e;
}catch (Exception ex){
String msg = "Exception in getServiceInstance. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -361,7 +364,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.debug(" ***** Inside callRESTQueryAAICloudRegion of DoUpdateNetworkInstance ***** " )
+ logger.debug(" ***** Inside callRESTQueryAAICloudRegion of DoUpdateNetworkInstance ***** " )
try {
String networkInputs = execution.getVariable(Prefix + "networkInputs")
@@ -386,12 +389,12 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
} else {
String dataErrorMessage = "QueryAAICloudRegion Unsuccessful. Return Code: " + execution.getVariable(Prefix + "queryCloudRegionReturnCode")
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
- msoLogger.debug(" is Cloud Region Good: " + execution.getVariable(Prefix + "isCloudRegionGood"))
+ logger.debug(" is Cloud Region Good: " + execution.getVariable(Prefix + "isCloudRegionGood"))
} catch (BpmnError e) {
throw e;
@@ -399,7 +402,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
} catch (Exception ex) {
// try error
String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow - callRESTQueryAAICloudRegion() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -410,7 +413,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.debug(" ***** Inside callRESTQueryAAINetworkId of DoUpdateNetworkInstance ***** " )
+ logger.debug(" ***** Inside callRESTQueryAAINetworkId of DoUpdateNetworkInstance ***** " )
try {
// get variables
@@ -429,11 +432,11 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
} catch (NotFoundException e) {
String dataErrorMessage = "Response Error from QueryAAINetworkId is 404 (Not Found)."
- msoLogger.debug(" AAI Query Failed. " + dataErrorMessage)
+ logger.debug(" AAI Query Failed. " + dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTQueryAAINetworkId() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -444,7 +447,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.debug(" ***** Inside callRESTReQueryAAINetworkId of DoUpdateNetworkInstance ***** " )
+ logger.debug(" ***** Inside callRESTReQueryAAINetworkId of DoUpdateNetworkInstance ***** " )
try {
// get variables
@@ -467,15 +470,15 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
<network-name>${MsoUtils.xmlEscape(netName)}</network-name>
</network-outputs>"""
execution.setVariable(Prefix + "networkOutputs", networkOutputs)
- msoLogger.debug(" networkOutputs - " + '\n' + networkOutputs)
+ logger.debug(" networkOutputs - " + '\n' + networkOutputs)
} catch (NotFoundException e) {
String dataErrorMessage = "Response Error from ReQueryAAINetworkId is 404 (Not Found)."
- msoLogger.debug(" AAI ReQuery Failed. - " + dataErrorMessage)
+ logger.debug(" AAI ReQuery Failed. - " + dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTReQueryAAINetworkId() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -486,7 +489,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.debug(" ***** Inside callRESTQueryAAINetworkVpnBinding of DoUpdateNetworkInstance ***** " )
+ logger.debug(" ***** Inside callRESTQueryAAINetworkVpnBinding of DoUpdateNetworkInstance ***** " )
try {
@@ -495,7 +498,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
if(queryIdAAIResponse.getRelationships().isPresent()){
List<AAIResourceUri> uris = queryIdAAIResponse.getRelationships().get().getRelatedAAIUris(AAIObjectType.VPN_BINDING)
- msoLogger.debug(Prefix + "vpnCount - " + uris.size())
+ logger.debug(Prefix + "vpnCount - " + uris.size())
if (uris.size() > 0) {
String routeTargets = ""
@@ -522,7 +525,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
} // end loop
execution.setVariable(Prefix + "routeCollection", routeTargets)
- msoLogger.debug(" UPDNETI_routeCollection - " + '\n' + routeTargets)
+ logger.debug(" UPDNETI_routeCollection - " + '\n' + routeTargets)
} else {
// reset return code to success
@@ -538,17 +541,17 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse)
execution.setVariable(Prefix + "queryVpnBindingAAIResponse", aaiStubResponseAsXml)
execution.setVariable(Prefix + "routeCollection", "<routeTargets/>")
- msoLogger.debug(" No vpnBinding, using this stub as response - " + '\n' + aaiStubResponseAsXml)
+ logger.debug(" No vpnBinding, using this stub as response - " + '\n' + aaiStubResponseAsXml)
}
}
} catch (NotFoundException e) {
- msoLogger.debug("Response Error from AAINetworkVpnBinding is 404 (Not Found).")
+ logger.debug("Response Error from AAINetworkVpnBinding is 404 (Not Found).")
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Response Error from AAINetworkVpnBinding is 404 (Not Found).")
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTQueryAAINetworkVpnBinding() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -559,7 +562,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.debug(" ***** Inside callRESTQueryAAINetworkPolicy of DoUpdateNetworkInstance ***** " )
+ logger.debug(" ***** Inside callRESTQueryAAINetworkPolicy of DoUpdateNetworkInstance ***** " )
try {
// get variables
@@ -568,7 +571,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
List<AAIResourceUri> uris = queryIdAAIResponse.getRelationships().get().getRelatedAAIUris(AAIObjectType.NETWORK_POLICY)
execution.setVariable(Prefix + "networkPolicyCount", uris.size())
- msoLogger.debug(Prefix + "networkPolicyCount - " + uris.size())
+ logger.debug(Prefix + "networkPolicyCount - " + uris.size())
if (uris.size() > 0) {
@@ -587,7 +590,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
} // end loop
execution.setVariable(Prefix + "networkCollection", networkPolicies)
- msoLogger.debug(" UPDNETI_networkCollection - " + '\n' + networkPolicies)
+ logger.debug(" UPDNETI_networkCollection - " + '\n' + networkPolicies)
} else {
// reset return code to success
@@ -603,18 +606,18 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse)
execution.setVariable(Prefix + "queryNetworkPolicyAAIResponse", aaiStubResponseAsXml)
execution.setVariable(Prefix + "networkCollection", "<policyFqdns/>")
- msoLogger.debug(" No net policies, using this stub as response - " + '\n' + aaiStubResponseAsXml)
+ logger.debug(" No net policies, using this stub as response - " + '\n' + aaiStubResponseAsXml)
}
}
} catch (NotFoundException e) {
String dataErrorMessage = "Response Error from QueryAAINetworkPolicy is 404 (Not Found)."
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTQueryAAINetworkPolicy() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -625,7 +628,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.debug(" ***** Inside callRESTQueryAAINetworkTableRef of DoUpdateNetworkInstance ***** " )
+ logger.debug(" ***** Inside callRESTQueryAAINetworkTableRef of DoUpdateNetworkInstance ***** " )
try {
AAIResultWrapper queryIdAAIResponse = execution.getVariable(Prefix + "requeryIdAAIResponse")
@@ -633,9 +636,9 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
List<AAIResourceUri> uris = queryIdAAIResponse.getRelationships().get().getRelatedAAIUris(AAIObjectType.ROUTE_TABLE_REFERENCE)
execution.setVariable(Prefix + "networkTableRefCount", uris.size())
- msoLogger.debug(Prefix + "networkTableRefCount - " + uris.size())
+ logger.debug(Prefix + "networkTableRefCount - " + uris.size())
- msoLogger.debug(" UPDNETI_networkTableRefCount - " + uris.size())
+ logger.debug(" UPDNETI_networkTableRefCount - " + uris.size())
if (uris.size() > 0) {
execution.setVariable(Prefix + "aaiQqueryNetworkTableRefReturnCode", "200")
@@ -653,7 +656,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
} // end loop
execution.setVariable(Prefix + "tableRefCollection", networkTableRefs)
- msoLogger.debug(" UPDNETI_tableRefCollection - " + '\n' + networkTableRefs)
+ logger.debug(" UPDNETI_tableRefCollection - " + '\n' + networkTableRefs)
} else {
// reset return code to success
@@ -669,19 +672,19 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
String aaiStubResponseAsXml = utils.formatXml(aaiStubResponse)
execution.setVariable(Prefix + "queryNetworkTableRefAAIResponse", aaiStubResponseAsXml)
execution.setVariable(Prefix + "tableRefCollection", "<routeTableFqdns/>")
- msoLogger.debug(" No net table references, using this stub as response - " + '\n' + aaiStubResponseAsXml)
+ logger.debug(" No net table references, using this stub as response - " + '\n' + aaiStubResponseAsXml)
}
}
} catch (NotFoundException e) {
String dataErrorMessage = "Response Error from QueryAAINetworkTableRef is 404 (Not Found)."
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTQueryAAINetworkTableRef() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -690,7 +693,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
public void callRESTUpdateContrailAAINetwork(DelegateExecution execution) {
execution.setVariable("prefix", Prefix)
- msoLogger.debug(" ***** Inside callRESTUpdateContrailAAINetwork of DoUpdateNetworkInstance ***** " )
+ logger.debug(" ***** Inside callRESTUpdateContrailAAINetwork of DoUpdateNetworkInstance ***** " )
try {
// get variables
String networkRequest = execution.getVariable(Prefix + "networkRequest")
@@ -754,11 +757,11 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
throw e;
} catch (NotFoundException e) {
String dataErrorMessage = " Response Error from UpdateContrailAAINetwork is 404 (Not Found)."
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. callRESTUpdateContrailAAINetwork() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -769,7 +772,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside prepareUpdateNetworkRequest of DoUpdateNetworkInstance ")
+ logger.trace("Inside prepareUpdateNetworkRequest of DoUpdateNetworkInstance ")
try {
@@ -791,14 +794,14 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
// Format Response
String buildUpdateNetworkRequestAsString = utils.formatXml(updateNetworkRequest)
buildUpdateNetworkRequestAsString = buildUpdateNetworkRequestAsString.replace(":w1aac13n0", "").replace("w1aac13n0:", "")
- msoLogger.debug(buildUpdateNetworkRequestAsString)
+ logger.debug(buildUpdateNetworkRequestAsString)
execution.setVariable(Prefix + "updateNetworkRequest", buildUpdateNetworkRequestAsString)
- msoLogger.debug(" UPDNETI_updateNetworkRequest - " + "\n" + buildUpdateNetworkRequestAsString)
+ logger.debug(" UPDNETI_updateNetworkRequest - " + "\n" + buildUpdateNetworkRequestAsString)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. prepareUpdateNetworkRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -809,7 +812,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside prepareSDNCRequest of DoUpdateNetworkInstance ")
+ logger.trace("Inside prepareSDNCRequest of DoUpdateNetworkInstance ")
try {
// get variables
@@ -832,14 +835,14 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
String sndcTopologyCreateRequest = sdncAdapterUtils.sdncTopologyRequestV2(execution, updateNetworkInput, serviceInstanceId, sdncCallback, "changeassign", "NetworkActivateRequest", cloudRegionId, networkId, queryAAIResponse, null)
String sndcTopologyUpdateRequesAsString = utils.formatXml(sndcTopologyCreateRequest)
- msoLogger.debug(sndcTopologyUpdateRequesAsString)
+ logger.debug(sndcTopologyUpdateRequesAsString)
execution.setVariable(Prefix + "changeAssignSDNCRequest", sndcTopologyUpdateRequesAsString)
- msoLogger.debug(" UPDNETI_changeAssignSDNCRequest - " + "\n" + sndcTopologyUpdateRequesAsString)
+ logger.debug(" UPDNETI_changeAssignSDNCRequest - " + "\n" + sndcTopologyUpdateRequesAsString)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. prepareSDNCRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -857,7 +860,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside validateUpdateNetworkResponse of DoUpdateNetworkInstance ")
+ logger.trace("Inside validateUpdateNetworkResponse of DoUpdateNetworkInstance ")
try {
String returnCode = execution.getVariable(Prefix + "networkReturnCode")
@@ -866,14 +869,14 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
networkResponse="" // reset
}
- msoLogger.debug(" Network Adapter update responseCode: " + returnCode)
+ logger.debug(" Network Adapter update responseCode: " + returnCode)
String errorMessage = ""
if (returnCode == "200") {
execution.setVariable(Prefix + "isNetworkRollbackNeeded", true)
- msoLogger.debug(networkResponse)
+ logger.debug(networkResponse)
execution.setVariable(Prefix + "updateNetworkResponse", networkResponse)
- msoLogger.debug(" Network Adapter update Success Response - " + "\n" + networkResponse)
+ logger.debug(" Network Adapter update Success Response - " + "\n" + networkResponse)
// prepare rollback data
String rollbackData = utils.getNodeXml(networkResponse, "rollback", false).replace("tag0:","").replace(":tag0","")
@@ -884,7 +887,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
</rollbackNetworkRequest>"""
String rollbackNetworkXml = utils.formatXml(rollbackNetwork)
execution.setVariable(Prefix + "rollbackNetworkRequest", rollbackNetworkXml)
- msoLogger.debug(" Network Adapter rollback data - " + "\n" + rollbackNetworkXml)
+ logger.debug(" Network Adapter rollback data - " + "\n" + rollbackNetworkXml)
} else { // network error
if (returnCode.toInteger() > 399 && returnCode.toInteger() < 600) { //4xx, 5xx
@@ -918,7 +921,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. validateUpdateNetworkResponse() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -930,7 +933,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside validateSDNCResponse of DoUpdateNetworkInstance ")
+ logger.trace("Inside validateSDNCResponse of DoUpdateNetworkInstance ")
String response = execution.getVariable(Prefix + "changeAssignSDNCResponse")
WorkflowException workflowException = null
@@ -938,7 +941,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
workflowException = execution.getVariable(Prefix + "WorkflowException")
//execution.setVariable("WorkflowException", workflowException)
} catch (Exception ex) {
- msoLogger.debug(" Sdnc 'WorkflowException' object is empty or null. ")
+ logger.debug(" Sdnc 'WorkflowException' object is empty or null. ")
}
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
@@ -952,10 +955,10 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
if (execution.getVariable(Prefix + "sdncResponseSuccess") == true) { // from sdnc util, prefix+'sdncResponseSuccess'
execution.setVariable(Prefix + "isSdncRollbackNeeded", true)
- msoLogger.debug("Successfully Validated SDNC Response")
+ logger.debug("Successfully Validated SDNC Response")
} else {
- msoLogger.debug("Did NOT Successfully Validated SDNC Response")
+ logger.debug("Did NOT Successfully Validated SDNC Response")
throw new BpmnError("MSOWorkflowException")
}
@@ -966,10 +969,10 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside postProcessResponse of DoUpdateNetworkInstance ")
+ logger.trace("Inside postProcessResponse of DoUpdateNetworkInstance ")
try {
- msoLogger.debug(" ***** Is Exception Encountered (isException)? : " + execution.getVariable(Prefix + "isException"))
+ logger.debug(" ***** Is Exception Encountered (isException)? : " + execution.getVariable(Prefix + "isException"))
if (execution.getVariable(Prefix + "isException") == false) {
// set rollback data
execution.setVariable("orchestrationStatus", "")
@@ -978,13 +981,13 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
prepareSuccessRollbackData(execution) // populate rollbackData
execution.setVariable("WorkflowException", null)
execution.setVariable(Prefix + "Success", true)
- msoLogger.debug(" ***** postProcessResponse(), GOOD !!!")
+ logger.debug(" ***** postProcessResponse(), GOOD !!!")
} else {
execution.setVariable(Prefix + "Success", false)
execution.setVariable("rollbackData", null)
String exceptionMessage = " Exception encountered in MSO Bpmn. "
if (execution.getVariable("workflowException") != null) { // Output of Rollback flow.
- msoLogger.debug(" ***** workflowException: " + execution.getVariable("workflowException"))
+ logger.debug(" ***** workflowException: " + execution.getVariable("workflowException"))
WorkflowException wfex = execution.getVariable("workflowException")
exceptionMessage = wfex.getErrorMessage()
} else {
@@ -994,19 +997,19 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
}
}
// going to the Main flow: a-la-carte or macro
- msoLogger.debug(" ***** postProcessResponse(), BAD !!!")
+ logger.debug(" ***** postProcessResponse(), BAD !!!")
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
throw new BpmnError("MSOWorkflowException")
}
} catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. postProcessResponse() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -1018,7 +1021,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside prepareSDNCRollbackRequest of DoUpdateNetworkInstance ")
+ logger.trace("Inside prepareSDNCRollbackRequest of DoUpdateNetworkInstance ")
try {
// for some reason the WorkflowException object is null after the sdnc rollback call task, need to save WorkflowException.
@@ -1036,11 +1039,11 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
String sndcTopologyRollbackRequest = sdncAdapterUtils.sdncTopologyRequestV2(execution, updateNetworkInput, serviceInstanceId, sdncCallback, "rollback", "NetworkActivateRequest", cloudRegionId, networkId, null, null)
String sndcTopologyRollbackRequestAsString = utils.formatXml(sndcTopologyRollbackRequest)
execution.setVariable(Prefix + "rollbackSDNCRequest", sndcTopologyRollbackRequestAsString)
- msoLogger.debug(" Preparing request for SDNC Topology assign's rollback/compensation . . . - " + "\n" + sndcTopologyRollbackRequestAsString)
+ logger.debug(" Preparing request for SDNC Topology assign's rollback/compensation . . . - " + "\n" + sndcTopologyRollbackRequestAsString)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. prepareSDNCRollbackRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -1051,7 +1054,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareRollbackData() of DoUpdateNetworkInstance ")
+ logger.trace("Inside prepareRollbackData() of DoUpdateNetworkInstance ")
try {
@@ -1069,14 +1072,14 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
}
}
execution.setVariable("rollbackData", rollbackData)
- msoLogger.debug("** rollbackData : " + rollbackData)
+ logger.debug("** rollbackData : " + rollbackData)
execution.setVariable("WorkflowException", execution.getVariable(Prefix + "WorkflowException"))
- msoLogger.debug("** WorkflowException : " + execution.getVariable("WorkflowException"))
+ logger.debug("** WorkflowException : " + execution.getVariable("WorkflowException"))
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. prepareRollbackData() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -1087,7 +1090,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareSuccessRollbackData() of DoUpdateNetworkInstance ")
+ logger.trace("Inside prepareSuccessRollbackData() of DoUpdateNetworkInstance ")
try {
@@ -1112,13 +1115,13 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
}
execution.setVariable("rollbackData", rollbackData)
- msoLogger.debug("** 'rollbackData' for Full Rollback : " + rollbackData)
+ logger.debug("** 'rollbackData' for Full Rollback : " + rollbackData)
execution.setVariable("WorkflowException", null)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstance flow. prepareSuccessRollbackData() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -1129,7 +1132,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside setExceptionFlag() of DoUpdateNetworkInstance ")
+ logger.trace("Inside setExceptionFlag() of DoUpdateNetworkInstance ")
try {
@@ -1140,11 +1143,11 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
} else {
execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException"))
}
- msoLogger.debug(Prefix + "WorkflowException - " +execution.getVariable(Prefix + "WorkflowException"))
+ logger.debug(Prefix + "WorkflowException - " +execution.getVariable(Prefix + "WorkflowException"))
} catch(Exception ex){
String exceptionMessage = "Bpmn error encountered in DoUpdateNetworkInstance flow. setExceptionFlag(): " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
}
@@ -1159,18 +1162,18 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
try{
- msoLogger.debug("Caught a Java Exception")
- msoLogger.debug("Started processJavaException Method")
- msoLogger.debug("Variables List: " + execution.getVariables())
+ logger.debug("Caught a Java Exception")
+ logger.debug("Started processJavaException Method")
+ logger.debug("Variables List: " + execution.getVariables())
execution.setVariable("UnexpectedError", "Caught a Java Lang Exception - " + Prefix) // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception")
}catch(Exception e){
- msoLogger.debug("Caught Exception during processJavaException Method: " + e)
+ logger.debug("Caught Exception during processJavaException Method: " + e)
execution.setVariable("UnexpectedError", "Exception in processJavaException method") // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method")
}
- msoLogger.debug("Completed processJavaException Method")
+ logger.debug("Completed processJavaException Method")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollback.groovy
index eaba51ac6f..1b98451fbe 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollback.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -42,15 +44,15 @@ import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.util.UriUtils
-import org.onap.so.logger.MessageEnum
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
/**
* This groovy class supports the <class>DoCreateNetworkInstance.bpmn</class> process.
*
*/
public class DoUpdateNetworkInstanceRollback extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoUpdateNetworkInstanceRollback.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoUpdateNetworkInstanceRollback.class);
String Prefix="UPDNETIR_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -96,7 +98,7 @@ public class DoUpdateNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside preProcessRequest() of " + className + ".groovy ")
+ logger.trace("Inside preProcessRequest() of " + className + ".groovy ")
try {
// initialize flow variables
@@ -121,10 +123,10 @@ public class DoUpdateNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable(Prefix + "rollbackNetworkRequest", rollbackNetworkRequest)
execution.setVariable(Prefix + "rollbackSDNCRequest", rollbackSDNCRequest)
- msoLogger.debug("'rollbackData': " + '\n' + execution.getVariable("rollbackData"))
+ logger.debug("'rollbackData': " + '\n' + execution.getVariable("rollbackData"))
String sdncVersion = execution.getVariable("sdncVersion")
- msoLogger.debug("sdncVersion? : " + sdncVersion)
+ logger.debug("sdncVersion? : " + sdncVersion)
// PO Authorization Info / headers Authorization=
String basicAuthValuePO = UrnPropertiesReader.getVariable("mso.adapters.po.auth",execution)
@@ -137,7 +139,7 @@ public class DoUpdateNetworkInstanceRollback extends AbstractServiceTaskProcesso
} catch (IOException ex) {
String exceptionMessage = "Exception Encountered in DoCreateNetworkInstance, PreProcessRequest() - "
String dataErrorMessage = exceptionMessage + " Unable to encode PO/SDNC user/password string - " + ex.getMessage()
- msoLogger.debug(dataErrorMessage )
+ logger.debug(dataErrorMessage )
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
@@ -146,7 +148,7 @@ public class DoUpdateNetworkInstanceRollback extends AbstractServiceTaskProcesso
} else {
execution.setVariable(Prefix + "WorkflowException", execution.getVariable("WorkflowException"))
}
- msoLogger.debug("*** WorkflowException : " + execution.getVariable(Prefix + "WorkflowException"))
+ logger.debug("*** WorkflowException : " + execution.getVariable(Prefix + "WorkflowException"))
if(execution.getVariable(Prefix + "WorkflowException") != null) {
// called by: DoCreateNetworkInstance, partial rollback
execution.setVariable(Prefix + "fullRollback", false)
@@ -156,7 +158,7 @@ public class DoUpdateNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable(Prefix + "fullRollback", true)
}
- msoLogger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback"))
+ logger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback"))
} catch (BpmnError e) {
@@ -166,7 +168,7 @@ public class DoUpdateNetworkInstanceRollback extends AbstractServiceTaskProcesso
sendSyncError(execution)
// caught exception
String exceptionMessage = "Exception Encountered in PreProcessRequest() of " + className + ".groovy ***** : " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -177,7 +179,7 @@ public class DoUpdateNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside validateRollbackResponses() of DoUpdateNetworkInstanceRollback ")
+ logger.trace("Inside validateRollbackResponses() of DoUpdateNetworkInstanceRollback ")
try {
// validate PO network rollback response
@@ -186,8 +188,8 @@ public class DoUpdateNetworkInstanceRollback extends AbstractServiceTaskProcesso
if (execution.getVariable(Prefix + "rollbackNetworkRequest") != null) {
rollbackNetworkReturnCode = execution.getVariable(Prefix + "rollbackNetworkReturnCode")
String rollbackNetworkResponse = execution.getVariable(Prefix + "rollbackNetworkResponse")
- msoLogger.debug(" NetworkRollback Code - " + rollbackNetworkReturnCode)
- msoLogger.debug(" NetworkRollback Response - " + rollbackNetworkResponse)
+ logger.debug(" NetworkRollback Code - " + rollbackNetworkReturnCode)
+ logger.debug(" NetworkRollback Response - " + rollbackNetworkResponse)
if (rollbackNetworkReturnCode != "200") {
rollbackNetworkErrorMessages = " + PO Network rollback failed. "
} else {
@@ -218,13 +220,13 @@ public class DoUpdateNetworkInstanceRollback extends AbstractServiceTaskProcesso
} else {
rollbackSdncErrorMessages = " + SDNC changeassign rollback failed. "
}
- msoLogger.debug(" SDNC changeassign rollback Code - " + rollbackSDNCReturnCode)
- msoLogger.debug(" SDNC changeassign rollback Response - " + rollbackSDNCResponse)
+ logger.debug(" SDNC changeassign rollback Code - " + rollbackSDNCReturnCode)
+ logger.debug(" SDNC changeassign rollback Response - " + rollbackSDNCResponse)
}
String statusMessage = ""
int errorCode = 7000
- msoLogger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback"))
+ logger.debug("*** fullRollback? : " + execution.getVariable(Prefix + "fullRollback"))
if (execution.getVariable(Prefix + "fullRollback") == false) {
// original WorkflowException,
WorkflowException wfe = execution.getVariable(Prefix + "WorkflowException")
@@ -247,7 +249,7 @@ public class DoUpdateNetworkInstanceRollback extends AbstractServiceTaskProcesso
}
statusMessage = statusMessage + rollbackNetworkErrorMessages + rollbackSdncErrorMessages
- msoLogger.debug("Final DoUpdateNetworkInstanceRollback status message: " + statusMessage)
+ logger.debug("Final DoUpdateNetworkInstanceRollback status message: " + statusMessage)
String processKey = getProcessKey(execution);
WorkflowException exception = new WorkflowException(processKey, errorCode, statusMessage);
execution.setVariable("workflowException", exception);
@@ -260,7 +262,7 @@ public class DoUpdateNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable("rollbackError", false)
} else {
String exceptionMessage = "Network Update Rollback was not Successful. "
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
execution.setVariable("rollbackSuccessful", false)
execution.setVariable("rollbackError", true)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
@@ -274,7 +276,7 @@ public class DoUpdateNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable("WorkflowException", null)
String errorMessage = "See Previous Camunda flows for cause of Error: Undetermined Exception."
String exceptionMessage = " Bpmn error encountered in DoUpdateNetworkInstanceRollback flow. validateRollbackResponses() - " + errorMessage + ": " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildWorkflowException(execution, 7000, exceptionMessage)
execution.setVariable("WorkflowException", execution.getVariable("WorkflowException"))
@@ -293,18 +295,18 @@ public class DoUpdateNetworkInstanceRollback extends AbstractServiceTaskProcesso
execution.setVariable("prefix",Prefix)
try{
- msoLogger.debug("Caught a Java Exception in " + Prefix)
- msoLogger.debug("Started processJavaException Method")
- msoLogger.debug("Variables List: " + execution.getVariables())
+ logger.debug("Caught a Java Exception in " + Prefix)
+ logger.debug("Started processJavaException Method")
+ logger.debug("Variables List: " + execution.getVariables())
execution.setVariable("UnexpectedError", "Caught a Java Lang Exception - " + Prefix) // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception")
}catch(Exception e){
- msoLogger.debug("Caught Exception during processJavaException Method: " + e)
+ logger.debug("Caught Exception during processJavaException Method: " + e)
execution.setVariable("UnexpectedError", "Exception in processJavaException method - " + Prefix) // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method" + Prefix)
}
- msoLogger.trace("Completed processJavaException Method in " + Prefix)
+ logger.trace("Completed processJavaException Method in " + Prefix)
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModule.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModule.groovy
index 06c7002dff..641878be8e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModule.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModule.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -44,9 +46,11 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.constants.Defaults
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
public class DoUpdateVfModule extends VfModuleBase {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoUpdateVfModule.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoUpdateVfModule.class);
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
@@ -106,13 +110,13 @@ public class DoUpdateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
initProcessVariables(execution)
def xml = getVariable(execution, 'DoUpdateVfModuleRequest')
- msoLogger.debug("DoUpdateVfModule request: " + xml)
- msoLogger.debug('Received request xml:\n' + xml)
+ logger.debug("DoUpdateVfModule request: " + xml)
+ logger.debug('Received request xml:\n' + xml)
if (xml == null || xml.isEmpty()) {
// Building Block-type request
@@ -121,9 +125,9 @@ public class DoUpdateVfModule extends VfModuleBase {
String vfModuleModelInfo = execution.getVariable("vfModuleModelInfo")
def serviceModelInfo = execution.getVariable("serviceModelInfo")
- msoLogger.debug("serviceModelInfo: " + serviceModelInfo)
+ logger.debug("serviceModelInfo: " + serviceModelInfo)
String modelInvariantUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelInvariantUuid")
- msoLogger.debug("modelInvariantUuid: " + modelInvariantUuid)
+ logger.debug("modelInvariantUuid: " + modelInvariantUuid)
def vnfModelInfo = execution.getVariable("vnfModelInfo")
//tenantId
@@ -138,32 +142,32 @@ public class DoUpdateVfModule extends VfModuleBase {
def cloudSiteId = execution.getVariable("lcpCloudRegionId")
execution.setVariable("DOUPVfMod_aicCloudRegion", cloudSiteId)
- msoLogger.debug("cloudSiteId: " + cloudSiteId)
+ logger.debug("cloudSiteId: " + cloudSiteId)
//vnfType
def vnfType = execution.getVariable("vnfType")
execution.setVariable("DOUPVfMod_vnfType", vnfType)
- msoLogger.debug("vnfType: " + vnfType)
+ logger.debug("vnfType: " + vnfType)
//vnfName
def vnfName = execution.getVariable("vnfName")
execution.setVariable("DOUPVfMod_vnfName", vnfName)
- msoLogger.debug("vnfName: " + vnfName)
+ logger.debug("vnfName: " + vnfName)
//vnfId
def vnfId = execution.getVariable("vnfId")
execution.setVariable("DOUPVfMod_vnfId", vnfId)
- msoLogger.debug("vnfId: " + vnfId)
+ logger.debug("vnfId: " + vnfId)
//vfModuleName
def vfModuleName = execution.getVariable("vfModuleName")
execution.setVariable("DOUPVfMod_vfModuleName", vfModuleName)
- msoLogger.debug("vfModuleName: " + vfModuleName)
+ logger.debug("vfModuleName: " + vfModuleName)
//vfModuleModelName
def vfModuleModelName = jsonUtil.getJsonValue(vfModuleModelInfo, "modelName")
execution.setVariable("DOUPVfMod_vfModuleModelName", vfModuleModelName)
- msoLogger.debug("vfModuleModelName: " + vfModuleModelName)
+ logger.debug("vfModuleModelName: " + vfModuleModelName)
//modelCustomizationUuid
def modelCustomizationUuid = jsonUtil.getJsonValue(vfModuleModelInfo, "modelCustomizationUuid")
if (modelCustomizationUuid == null) {
@@ -171,30 +175,30 @@ public class DoUpdateVfModule extends VfModuleBase {
}
execution.setVariable("DOUPVfMod_modelCustomizationUuid", modelCustomizationUuid)
- msoLogger.debug("modelCustomizationUuid: " + modelCustomizationUuid)
+ logger.debug("modelCustomizationUuid: " + modelCustomizationUuid)
//vfModuleId
def vfModuleId = execution.getVariable("vfModuleId")
execution.setVariable("DOUPVfMod_vfModuleId", vfModuleId)
- msoLogger.debug("vfModuleId: " + vfModuleId)
+ logger.debug("vfModuleId: " + vfModuleId)
def requestId = execution.getVariable("msoRequestId")
execution.setVariable("DOUPVfMod_requestId", requestId)
- msoLogger.debug("requestId: " + requestId)
+ logger.debug("requestId: " + requestId)
// Set mso-request-id to request-id for VNF Adapter interface
execution.setVariable("mso-request-id", requestId)
//serviceId
def serviceId = execution.getVariable("serviceId")
execution.setVariable("DOUPVfMod_serviceId", serviceId)
- msoLogger.debug("serviceId: " + serviceId)
+ logger.debug("serviceId: " + serviceId)
//serviceInstanceId
def serviceInstanceId = execution.getVariable("serviceInstanceId")
execution.setVariable("DOUPVfMod_serviceInstanceId", serviceInstanceId)
- msoLogger.debug("serviceInstanceId: " + serviceInstanceId)
+ logger.debug("serviceInstanceId: " + serviceInstanceId)
//source - HARDCODED
def source = "VID"
execution.setVariable("DOUPVfMod_source", source)
- msoLogger.debug("source: " + source)
+ logger.debug("source: " + source)
//backoutOnFailure
def disableRollback = execution.getVariable("disableRollback")
def backoutOnFailure = true
@@ -202,15 +206,15 @@ public class DoUpdateVfModule extends VfModuleBase {
backoutOnFailure = false
}
execution.setVariable("DOUPVfMod_backoutOnFailure", backoutOnFailure)
- msoLogger.debug("backoutOnFailure: " + backoutOnFailure)
+ logger.debug("backoutOnFailure: " + backoutOnFailure)
//isBaseVfModule
def isBaseVfModule = execution.getVariable("isBaseVfModule")
execution.setVariable("DOUPVfMod_isBaseVfModule", isBaseVfModule)
- msoLogger.debug("isBaseVfModule: " + isBaseVfModule)
+ logger.debug("isBaseVfModule: " + isBaseVfModule)
//asdcServiceModelVersion
def asdcServiceModelVersion = execution.getVariable("asdcServiceModelVersion")
execution.setVariable("DOUPVfMod_asdcServiceModelVersion", asdcServiceModelVersion)
- msoLogger.debug("asdcServiceModelVersion: " + asdcServiceModelVersion)
+ logger.debug("asdcServiceModelVersion: " + asdcServiceModelVersion)
//personaModelId
execution.setVariable("DOUPVfMod_personaModelId", jsonUtil.getJsonValue(vfModuleModelInfo, "modelInvariantUuid"))
//personaModelVersion
@@ -219,9 +223,9 @@ public class DoUpdateVfModule extends VfModuleBase {
String uuid = execution.getVariable("DOUPVfMod_uuid")
if(uuid == null){
uuid = UUID.randomUUID()
- msoLogger.debug("Generated messageId (UUID) is: " + uuid)
+ logger.debug("Generated messageId (UUID) is: " + uuid)
}else{
- msoLogger.debug("Found messageId (UUID) is: " + uuid)
+ logger.debug("Found messageId (UUID) is: " + uuid)
}
//isVidRequest
String isVidRequest = execution.getVariable("isVidRequest")
@@ -232,15 +236,15 @@ public class DoUpdateVfModule extends VfModuleBase {
//usePreload
def usePreload = execution.getVariable("usePreload")
execution.setVariable("DOUPVfMod_usePreload", usePreload)
- msoLogger.debug("usePreload: " + usePreload)
+ logger.debug("usePreload: " + usePreload)
//globalSubscriberId
String globalSubscriberId = execution.getVariable("globalSubscriberId")
execution.setVariable("DOUPVfMod_globalSubscriberId", globalSubscriberId)
- msoLogger.debug("globalSubsrciberId: " + globalSubscriberId)
+ logger.debug("globalSubsrciberId: " + globalSubscriberId)
//vnfQueryPath
String vnfQueryPath = execution.getVariable("vnfQueryPath")
execution.setVariable("DOUPVfMod_vnfQueryPath", vnfQueryPath)
- msoLogger.debug("vnfQueryPath: " + vnfQueryPath)
+ logger.debug("vnfQueryPath: " + vnfQueryPath)
Map<String,String> vfModuleInputParams = execution.getVariable("vfModuleInputParams")
if (vfModuleInputParams != null) {
@@ -258,7 +262,7 @@ public class DoUpdateVfModule extends VfModuleBase {
throw e
} catch (Exception ex){
String msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
@@ -271,7 +275,7 @@ public class DoUpdateVfModule extends VfModuleBase {
workloadContext = aaiJson.getOrDefault("workload-context","")
}catch (Exception ex) {
- msoLogger.debug("Error retreiving parent service instance information")
+ logger.debug("Error retreiving parent service instance information")
}
execution.setVariable("DCVFM_environmentContext",environmentContext)
@@ -307,7 +311,7 @@ public class DoUpdateVfModule extends VfModuleBase {
isBaseVfModule = utils.getNodeText(xml, "is-base-vf-module")
execution.setVariable("DOUPVfMod_isBaseVfModule", isBaseVfModule)
}
- msoLogger.debug("isBaseVfModule: " + isBaseVfModule)
+ logger.debug("isBaseVfModule: " + isBaseVfModule)
NetworkUtils networkUtils = new NetworkUtils()
def backoutOnFailure = networkUtils.isRollbackEnabled(execution, xml)
@@ -322,15 +326,18 @@ public class DoUpdateVfModule extends VfModuleBase {
def sdncCallbackUrl = (String) UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution)
if (sdncCallbackUrl == null || sdncCallbackUrl.trim().isEmpty()) {
def msg = 'Required variable \'mso.workflow.sdncadapter.callback\' is missing'
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, msg, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "");
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in preProcessRequest(): ' + e.getMessage())
}
}
@@ -346,7 +353,7 @@ public class DoUpdateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def vnfId = execution.getVariable('DOUPVfMod_vnfId')
@@ -362,14 +369,16 @@ public class DoUpdateVfModule extends VfModuleBase {
"""
prepareUpdateAAIVfModuleRequest = utils.formatXml(prepareUpdateAAIVfModuleRequest)
execution.setVariable('DOUPVfMod_prepareUpdateAAIVfModuleRequest', prepareUpdateAAIVfModuleRequest)
- msoLogger.debug("DoUpdateAAIVfModule request: " + prepareUpdateAAIVfModuleRequest)
- msoLogger.debug('Request for PrepareUpdateAAIVfModule:\n' + prepareUpdateAAIVfModuleRequest)
+ logger.debug("DoUpdateAAIVfModule request: " + prepareUpdateAAIVfModuleRequest)
+ logger.debug('Request for PrepareUpdateAAIVfModule:\n' + prepareUpdateAAIVfModuleRequest)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in preparePrepareUpdateAAIVfModule(): ' + e.getMessage())
}
}
@@ -387,7 +396,7 @@ public class DoUpdateVfModule extends VfModuleBase {
def prefix = execution.getVariable("prefix")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
String cloudRegion = execution.getVariable(prefix + "aicCloudRegion")
@@ -411,22 +420,26 @@ public class DoUpdateVfModule extends VfModuleBase {
execution.setVariable(prefix + "isCloudRegionGood", true)
} else {
String errorMessage = "AAI Query Cloud Region Unsuccessful. AAI Response Code: " + execution.getVariable(prefix + "queryCloudRegionReturnCode")
- msoLogger.debug(errorMessage)
+ logger.debug(errorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, errorMessage)
execution.setVariable(prefix + "isCloudRegionGood", false)
}
- msoLogger.debug(" is Cloud Region Good: " + execution.getVariable(prefix + "isCloudRegionGood"))
+ logger.debug(" is Cloud Region Good: " + execution.getVariable(prefix + "isCloudRegionGood"))
} catch(BpmnError b){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Rethrowing MSOWorkflowException", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + b);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Rethrowing MSOWorkflowException", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + b);
throw b
}catch (Exception e) {
// try error
String errorMessage = "Bpmn error encountered in CreateVfModule flow. Unexpected Response from AAI - " + e.getMessage()
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, " AAI Query Cloud Region Failed. Exception - " + "\n" + errorMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "AAI Query Cloud Region Failed. Exception - " + "\n" + errorMessage, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Exception occured during prepConfirmVolumeGroupTenant(): " + e.getMessage())
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
}
@@ -441,7 +454,7 @@ public class DoUpdateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def requestId = execution.getVariable('DOUPVfMod_requestId')
@@ -521,14 +534,16 @@ public class DoUpdateVfModule extends VfModuleBase {
"""
sdncTopologyRequest = utils.formatXml(sdncTopologyRequest)
execution.setVariable('DOUPVfMod_sdncChangeAssignRequest', sdncTopologyRequest)
- msoLogger.debug("sdncChangeAssignRequest : " + sdncTopologyRequest)
- msoLogger.debug('Request for SDNCAdapter topology/changeassign:\n' + sdncTopologyRequest)
+ logger.debug("sdncChangeAssignRequest : " + sdncTopologyRequest)
+ logger.debug('Request for SDNCAdapter topology/changeassign:\n' + sdncTopologyRequest)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepSDNCTopologyChg(): ' + e.getMessage())
}
}
@@ -544,7 +559,7 @@ public class DoUpdateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
String uuid = execution.getVariable('testReqId') // for junits
@@ -583,14 +598,16 @@ public class DoUpdateVfModule extends VfModuleBase {
"""
sdncTopologyRequest = utils.formatXml(sdncTopologyRequest)
execution.setVariable('DOUPVfMod_sdncTopologyRequest', sdncTopologyRequest)
- msoLogger.debug("sdncTopologyRequest : " + sdncTopologyRequest)
- msoLogger.debug('Request for SDNCAdapter query:\n' + sdncTopologyRequest)
+ logger.debug("sdncTopologyRequest : " + sdncTopologyRequest)
+ logger.debug('Request for SDNCAdapter query:\n' + sdncTopologyRequest)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepSDNCTopologyQuery(): ' + e.getMessage())
}
}
@@ -605,7 +622,7 @@ public class DoUpdateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def requestId = execution.getVariable('DOUPVfMod_requestId')
@@ -641,8 +658,8 @@ public class DoUpdateVfModule extends VfModuleBase {
String environmentContext = execution.getVariable("DOUPVEnvironment_context")
String workloadContext = execution.getVariable("DOUPVWorkload_context")
- msoLogger.debug("workloadContext: " + workloadContext)
- msoLogger.debug("environmentContext: " + environmentContext)
+ logger.debug("workloadContext: " + workloadContext)
+ logger.debug("environmentContext: " + environmentContext)
Map<String, String> vnfParamsMap = execution.getVariable("DOUPVfMod_vnfParamsMap")
@@ -683,14 +700,16 @@ public class DoUpdateVfModule extends VfModuleBase {
"""
vnfAdapterRestRequest = utils.formatXml(vnfAdapterRestRequest)
execution.setVariable('DOUPVfMod_vnfAdapterRestRequest', vnfAdapterRestRequest)
- msoLogger.debug("vnfAdapterRestRequest : " + vnfAdapterRestRequest)
- msoLogger.debug('Request for VNFAdapter Rest:\n' + vnfAdapterRestRequest)
+ logger.debug("vnfAdapterRestRequest : " + vnfAdapterRestRequest)
+ logger.debug('Request for VNFAdapter Rest:\n' + vnfAdapterRestRequest)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepVnfAdapterRest(): ' + e.getMessage())
}
}
@@ -704,7 +723,7 @@ public class DoUpdateVfModule extends VfModuleBase {
def method = getClass().getSimpleName() + '.prepUpdateAAIGenericVnf(' +
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def vnfId = execution.getVariable('DOUPVfMod_vnfId')
@@ -713,7 +732,7 @@ public class DoUpdateVfModule extends VfModuleBase {
def personaModelId = utils.getNodeText(vnfInputs, 'vnf-persona-model-id')
def personaModelVersion = utils.getNodeText(vnfInputs, 'vnf-persona-model-version')
if ((personaModelId == null) || (personaModelVersion == null)) {
- msoLogger.debug("Skipping update for Generic VNF ' + vnfId + ' because either \'vnf-persona-model-id\' or \'vnf-persona-model-version\' is absent")
+ logger.debug("Skipping update for Generic VNF ' + vnfId + ' because either \'vnf-persona-model-id\' or \'vnf-persona-model-version\' is absent")
execution.setVariable('DOUPVfMod_skipUpdateGenericVnf', true)
} else {
def personaModelIdElement = '<model-invariant-id>' + personaModelId + '</model-invariant-id>'
@@ -728,15 +747,17 @@ public class DoUpdateVfModule extends VfModuleBase {
"""
updateAAIGenericVnfRequest = utils.formatXml(updateAAIGenericVnfRequest)
execution.setVariable('DOUPVfMod_updateAAIGenericVnfRequest', updateAAIGenericVnfRequest)
- msoLogger.debug("updateAAIGenericVnfRequest : " + updateAAIGenericVnfRequest)
- msoLogger.debug('Request for UpdateAAIGenericVnf:\n' + updateAAIGenericVnfRequest)
+ logger.debug("updateAAIGenericVnfRequest : " + updateAAIGenericVnfRequest)
+ logger.debug('Request for UpdateAAIGenericVnf:\n' + updateAAIGenericVnfRequest)
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepUpdateAAIGenericVnf(): ' + e.getMessage())
}
}
@@ -751,7 +772,7 @@ public class DoUpdateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def vnfId = execution.getVariable('DOUPVfMod_vnfId')
@@ -798,17 +819,19 @@ public class DoUpdateVfModule extends VfModuleBase {
</UpdateAAIVfModuleRequest>
"""
- msoLogger.debug('Unformatted updateAAIVfModuleRequest: ' + updateAAIVfModuleRequest)
+ logger.debug('Unformatted updateAAIVfModuleRequest: ' + updateAAIVfModuleRequest)
updateAAIVfModuleRequest = utils.formatXml(updateAAIVfModuleRequest)
execution.setVariable('DOUPVfMod_updateAAIVfModuleRequest', updateAAIVfModuleRequest)
- msoLogger.debug("updateAAIVfModuleRequest : " + updateAAIVfModuleRequest)
- msoLogger.debug('Request for UpdateAAIVfModule:\n' + updateAAIVfModuleRequest)
+ logger.debug("updateAAIVfModuleRequest : " + updateAAIVfModuleRequest)
+ logger.debug('Request for UpdateAAIVfModule:\n' + updateAAIVfModuleRequest)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepUpdateAAIVfModule(): ' + e.getMessage())
}
}
@@ -824,7 +847,7 @@ public class DoUpdateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
String uuid = execution.getVariable('testReqId') // for junits
@@ -901,15 +924,17 @@ public class DoUpdateVfModule extends VfModuleBase {
"""
sdncTopologyRequest = utils.formatXml(sdncTopologyRequest)
execution.setVariable('DOUPVfMod_sdncActivateRequest', sdncTopologyRequest)
- msoLogger.debug("sdncActivateRequest : " + sdncTopologyRequest)
- msoLogger.debug('Request for SDNCAdapter topology/activate:\n' + sdncTopologyRequest)
+ logger.debug("sdncActivateRequest : " + sdncTopologyRequest)
+ logger.debug('Request for SDNCAdapter topology/activate:\n' + sdncTopologyRequest)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepSDNCTopologyAct(): ' + e.getMessage())
}
}
@@ -924,17 +949,21 @@ public class DoUpdateVfModule extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def WorkflowException workflowException = (WorkflowException) execution.getVariable('WorkflowException')
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, method + ' caught WorkflowException: ' + workflowException.getErrorMessage(), "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "");
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ method + ' caught WorkflowException: ' + workflowException.getErrorMessage(), "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue());
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildWorkflowException(execution, 1002, 'Error in handleWorkflowException(): ' + e.getMessage())
}
}
@@ -943,26 +972,26 @@ public class DoUpdateVfModule extends VfModuleBase {
def prefix = execution.getVariable("prefix")
- msoLogger.trace("STARTED ValidateSDNCResponse Process")
+ logger.trace("STARTED ValidateSDNCResponse Process")
WorkflowException workflowException = execution.getVariable("WorkflowException")
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
- msoLogger.debug("SDNCResponse: " + response)
+ logger.debug("SDNCResponse: " + response)
String sdncResponse = response
if(execution.getVariable(prefix + 'sdncResponseSuccess') == true){
- msoLogger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
+ logger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
}else{
- msoLogger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
+ logger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
throw new BpmnError("MSOWorkflowException")
}
- msoLogger.trace("COMPLETED ValidateSDNCResponse Process")
+ logger.trace("COMPLETED ValidateSDNCResponse Process")
}
/**
@@ -976,7 +1005,7 @@ public class DoUpdateVfModule extends VfModuleBase {
def method = getClass().getSimpleName() + '.getVfModule(' +
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def vnfId = execution.getVariable('DOUPVfMod_vnfId')
@@ -988,30 +1017,32 @@ public class DoUpdateVfModule extends VfModuleBase {
execution.setVariable('DOUPVfMod_queryAAIVfModuleResponseCode', 200)
execution.setVariable('DOUPVfMod_queryAAIVfModuleResponse', genericVnf.get())
// Parse the VNF record from A&AI to find base module info
- msoLogger.debug('Parsing the VNF data to find base module info')
+ logger.debug('Parsing the VNF data to find base module info')
if (genericVnf.get().getVfModules()!=null && !genericVnf.get().getVfModules().getVfModule().isEmpty()) {
Optional<org.onap.aai.domain.yang.VfModule> vfmodule = genericVnf.get().getVfModules().getVfModule().stream().
filter{v-> v.isIsBaseVfModule()}.findFirst()
if (vfmodule.isPresent()) {
String baseModuleId = vfmodule.get().getVfModuleId()
execution.setVariable("DOUPVfMod_baseVfModuleId", baseModuleId)
- msoLogger.debug('Received baseVfModuleId: ' + baseModuleId)
+ logger.debug('Received baseVfModuleId: ' + baseModuleId)
String baseModuleHeatStackId = vfmodule.get().getHeatStackId()
execution.setVariable("DOUPVfMod_baseVfModuleHeatStackId", baseModuleHeatStackId)
- msoLogger.debug('Received baseVfModuleHeatStackId: ' + baseModuleHeatStackId)
+ logger.debug('Received baseVfModuleHeatStackId: ' + baseModuleHeatStackId)
}
}
}
} catch (Exception ex) {
ex.printStackTrace()
- msoLogger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
+ logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIVfModule(): ' + e.getMessage())
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy
index 9eb05cf64a..0781553879 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -40,6 +42,8 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.onap.so.utils.TargetEntity
/**
@@ -47,7 +51,7 @@ import org.onap.so.utils.TargetEntity
* with the update of a generic vnf and related VF modules.
*/
class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoUpdateVnfAndModules.class);
+ private static final Logger logger = LoggerFactory.getLogger( DoUpdateVnfAndModules.class);
String Prefix="DUVAM_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -63,7 +67,7 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
public void preProcessRequest(DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("STARTED DoUpdateVnfAndModules PreProcessRequest Process")
+ logger.trace("STARTED DoUpdateVnfAndModules PreProcessRequest Process")
try{
// Get Variables
@@ -71,24 +75,24 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
String requestId = execution.getVariable("msoRequestId")
execution.setVariable("requestId", requestId)
execution.setVariable("mso-request-id", requestId)
- msoLogger.debug("Incoming Request Id is: " + requestId)
+ logger.debug("Incoming Request Id is: " + requestId)
String serviceInstanceId = execution.getVariable("serviceInstanceId")
- msoLogger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
+ logger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
String vnfId = execution.getVariable("vnfId")
- msoLogger.debug("Incoming Vnf Id is: " + vnfId)
+ logger.debug("Incoming Vnf Id is: " + vnfId)
String source = "VID"
execution.setVariable("DUVAM_source", source)
- msoLogger.debug("Incoming Source is: " + source)
+ logger.debug("Incoming Source is: " + source)
String sdncVersion = execution.getVariable("sdncVersion")
if (sdncVersion == null) {
sdncVersion = "1702"
}
execution.setVariable("DUVAM_sdncVersion", sdncVersion)
- msoLogger.debug("Incoming Sdnc Version is: " + sdncVersion)
+ logger.debug("Incoming Sdnc Version is: " + sdncVersion)
VnfResource vnfResource = (VnfResource) execution.getVariable("vnfResourceDecomposition")
@@ -97,44 +101,44 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
String serviceId = execution.getVariable("productFamilyId")
execution.setVariable("DUVAM_serviceId", serviceId)
- msoLogger.debug("Incoming Service Id is: " + serviceId)
+ logger.debug("Incoming Service Id is: " + serviceId)
String modelUuid = jsonUtil.getJsonValue(vnfModelInfo, "modelUuid")
execution.setVariable("DUVAM_modelUuid", modelUuid)
- msoLogger.debug("Incoming modelUuid is: " + modelUuid)
+ logger.debug("Incoming modelUuid is: " + modelUuid)
String modelCustomizationUuid = jsonUtil.getJsonValue(vnfModelInfo, "modelCustomizationUuid")
execution.setVariable("DUVAM_modelCustomizationUuid", modelCustomizationUuid)
- msoLogger.debug("Incoming Model Customization Uuid is: " + modelCustomizationUuid)
+ logger.debug("Incoming Model Customization Uuid is: " + modelCustomizationUuid)
String cloudSiteId = execution.getVariable("lcpCloudRegionId")
execution.setVariable("DUVAM_cloudSiteId", cloudSiteId)
- msoLogger.debug("Incoming Cloud Site Id is: " + cloudSiteId)
+ logger.debug("Incoming Cloud Site Id is: " + cloudSiteId)
String tenantId = execution.getVariable("tenantId")
execution.setVariable("DUVAM_tenantId", tenantId)
- msoLogger.debug("Incoming Tenant Id is: " + tenantId)
+ logger.debug("Incoming Tenant Id is: " + tenantId)
String globalSubscriberId = execution.getVariable("globalSubscriberId")
if (globalSubscriberId == null) {
globalSubscriberId = ""
}
execution.setVariable("DUVAM_globalSubscriberId", globalSubscriberId)
- msoLogger.debug("Incoming Global Subscriber Id is: " + globalSubscriberId)
+ logger.debug("Incoming Global Subscriber Id is: " + globalSubscriberId)
execution.setVariable("DUVAM_moduleCount", 0)
execution.setVariable("DUVAM_nextModule", 0)
}catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
}catch(Exception e){
- msoLogger.debug(" Error Occured in DoUpdateVnfAndModules PreProcessRequest method!" + e.getMessage())
+ logger.debug(" Error Occured in DoUpdateVnfAndModules PreProcessRequest method!" + e.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoUpdateVnfAndModules PreProcessRequest")
}
- msoLogger.trace("COMPLETED DoUpdateVnfAndModules PreProcessRequest Process ")
+ logger.trace("COMPLETED DoUpdateVnfAndModules PreProcessRequest Process ")
}
/**
@@ -148,7 +152,7 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
def method = getClass().getSimpleName() + '.queryAAIVfModule(' +
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def vnfId = execution.getVariable('vnfId')
@@ -156,7 +160,7 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
AaiUtil aaiUriUtil = new AaiUtil(this)
AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId).depth(Depth.ONE)
String endPoint = aaiUriUtil.createAaiUri(uri)
- msoLogger.debug("AAI endPoint: " + endPoint)
+ logger.debug("AAI endPoint: " + endPoint)
try {
HttpClient client = new HttpClientFactory().newXmlClient(new URL(endPoint), TargetEntity.AAI)
@@ -167,33 +171,33 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
def responseData = ''
- msoLogger.debug('sending GET to AAI endpoint \'' + endPoint + '\'')
+ logger.debug('sending GET to AAI endpoint \'' + endPoint + '\'')
Response response = client.get()
- msoLogger.debug("createVfModule - invoking httpGet() to AAI")
+ logger.debug("createVfModule - invoking httpGet() to AAI")
responseData = response.readEntity(String.class)
if (responseData != null) {
- msoLogger.debug("Received generic VNF data: " + responseData)
+ logger.debug("Received generic VNF data: " + responseData)
}
- msoLogger.debug("createVfModule - queryAAIVfModule Response: " + responseData)
- msoLogger.debug("createVfModule - queryAAIVfModule ResponseCode: " + response.getStatus())
+ logger.debug("createVfModule - queryAAIVfModule Response: " + responseData)
+ logger.debug("createVfModule - queryAAIVfModule ResponseCode: " + response.getStatus())
execution.setVariable('DUVAM_queryAAIVfModuleResponseCode', response.getStatus())
execution.setVariable('DUVAM_queryAAIVfModuleResponse', responseData)
- msoLogger.debug('Response code:' + response.getStatus())
- msoLogger.debug('Response:' + System.lineSeparator() + responseData)
+ logger.debug('Response code:' + response.getStatus())
+ logger.debug('Response:' + System.lineSeparator() + responseData)
//Map<String, String>[] vfModules = new HashMap<String,String>[]
def vfModulesList = new ArrayList<Map<String,String>>()
def vfModules = null
def vfModuleBaseEntry = null
if (response.getStatus() == 200) {
// Parse the VNF record from A&AI to find base module info
- msoLogger.debug('Parsing the VNF data to find base module info')
+ logger.debug('Parsing the VNF data to find base module info')
if (responseData != null) {
def vfModulesText = utils.getNodeXml(responseData, "vf-modules")
- msoLogger.debug("vModulesText: " + vfModulesText)
+ logger.debug("vModulesText: " + vfModulesText)
if (vfModulesText != null && !vfModulesText.trim().isEmpty()) {
def xmlVfModules= new XmlSlurper().parseText(vfModulesText)
vfModules = xmlVfModules.'**'.findAll {it.name() == "vf-module"}
@@ -219,7 +223,7 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
String volumeGroupId = ''
- msoLogger.debug("Next module!")
+ logger.debug("Next module!")
def vfModuleRelationships = vfModules[i].'**'.findAll {it.name() == 'relationship-data'}
if (vfModuleRelationships.size() > 0) {
for (j in 0..vfModuleRelationships.size()-1) {
@@ -237,7 +241,7 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
}
vfModuleEntry.put("volumeGroupId", volumeGroupId)
- msoLogger.debug("volumeGroupId is: " + volumeGroupId)
+ logger.debug("volumeGroupId is: " + volumeGroupId)
// Save base vf module to add it to the start of the list later
if (isBaseVfModule == "true") {
@@ -256,20 +260,22 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
}
}
else {
- msoLogger.debug('Response code from AAI GET is: ' + response.getStatusCode())
+ logger.debug('Response code from AAI GET is: ' + response.getStatusCode())
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Response code from AAI GET is: ' + response.getStatusCode())
}
execution.setVariable("DUVAM_vfModules", vfModulesList)
} catch (Exception ex) {
ex.printStackTrace()
- msoLogger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
+ logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIVfModule(): ' + e.getMessage())
}
}
@@ -277,7 +283,7 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
public void prepareNextModuleToUpdate(DelegateExecution execution){
execution.setVariable("prefix", Prefix)
- msoLogger.trace("STARTED prepareNextModuleToUpdate ")
+ logger.trace("STARTED prepareNextModuleToUpdate ")
try {
int i = execution.getVariable("DUVAM_nextModule")
@@ -294,7 +300,7 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
execution.setVariable("DUVAM_isBaseVfModule", isBaseVfModule)
String modelInvariantUuid = vfModule.get("modelInvariantUuid")
- msoLogger.debug("ModelInvariantUuid: " + modelInvariantUuid)
+ logger.debug("ModelInvariantUuid: " + modelInvariantUuid)
def volumeGroupId = vfModule.get("volumeGroupId")
execution.setVariable("DUVAM_volumeGroupId", volumeGroupId)
@@ -309,13 +315,13 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
for (j in 0..moduleResources.size()-1) {
ModelInfo modelInfo = moduleResources[j].getModelInfo()
String modelInvariantUuidFromDecomposition = modelInfo.getModelInvariantUuid()
- msoLogger.debug("modelInvariantUuidFromDecomposition: " + modelInvariantUuidFromDecomposition)
+ logger.debug("modelInvariantUuidFromDecomposition: " + modelInvariantUuidFromDecomposition)
if (modelInvariantUuid.equals(modelInvariantUuidFromDecomposition)) {
String vfModuleModelInfo = modelInfo.toJsonString()
String vfModuleModelInfoValue = jsonUtil.getJsonValue(vfModuleModelInfo, "modelInfo")
execution.setVariable("DUVAM_vfModuleModelInfo", vfModuleModelInfoValue)
- msoLogger.debug("vfModuleModelInfo: " + vfModuleModelInfoValue)
+ logger.debug("vfModuleModelInfo: " + vfModuleModelInfoValue)
break
}
@@ -323,10 +329,12 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
}
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preProcessAddOnModule. Exception is:\n" + e, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing preProcessAddOnModule. Exception is:\n" + e, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during prepareNextModuleToUpdate Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED prepareNextModuleToUpdate ")
+ logger.trace("COMPLETED prepareNextModuleToUpdate ")
}
@@ -340,7 +348,7 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def vnfId = execution.getVariable('vnfId')
@@ -389,15 +397,17 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
"""
updateAAIGenericVnfRequest = utils.formatXml(updateAAIGenericVnfRequest)
execution.setVariable('DUVAM_updateAAIGenericVnfRequest', updateAAIGenericVnfRequest)
- msoLogger.debug("updateAAIGenericVnfRequest : " + updateAAIGenericVnfRequest)
- msoLogger.debug('Request for UpdateAAIGenericVnf:\n' + updateAAIGenericVnfRequest)
+ logger.debug("updateAAIGenericVnfRequest : " + updateAAIGenericVnfRequest)
+ logger.debug('Request for UpdateAAIGenericVnf:\n' + updateAAIGenericVnfRequest)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepUpdateAAIGenericVnf(): ' + e.getMessage())
}
}
@@ -412,6 +422,6 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HealchCheckActivate.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HealchCheckActivate.groovy
index 4deb53f0ce..dfd021702a 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HealchCheckActivate.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HealchCheckActivate.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -24,15 +26,11 @@ import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor;
import org.apache.commons.lang3.*
-import org.onap.so.logger.MessageEnum
-import org.onap.so.logger.MsoLogger
public class HealthCheckActivate extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, HealthCheckActivate.class);
-
/**
* Validates the request message and sets up the workflow.
* @param execution the execution
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ReplaceVnfInfra.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ReplaceVnfInfra.groovy
index 671796f27f..0454bb4876 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ReplaceVnfInfra.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ReplaceVnfInfra.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -34,12 +36,14 @@ import org.onap.so.client.appc.ApplicationControllerOrchestrator
import org.onap.so.client.appc.ApplicationControllerSupport
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
public class ReplaceVnfInfra extends VnfCmBase {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, ReplaceVnfInfra.class);
+ private static final Logger logger = LoggerFactory.getLogger( ReplaceVnfInfra.class);
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtils = new JsonUtils()
@@ -93,18 +97,18 @@ public class ReplaceVnfInfra extends VnfCmBase {
')'
initProcessVariables(execution)
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
initProcessVariables(execution)
def incomingRequest = execution.getVariable('bpmnRequest')
- msoLogger.debug("Incoming Infra Request: " + incomingRequest)
+ logger.debug("Incoming Infra Request: " + incomingRequest)
try {
def jsonSlurper = new JsonSlurper()
def jsonOutput = new JsonOutput()
Map reqMap = jsonSlurper.parseText(incomingRequest)
- msoLogger.debug(" Request is in JSON format.")
+ logger.debug(" Request is in JSON format.")
def serviceInstanceId = execution.getVariable('serviceInstanceId')
def vnfId = execution.getVariable('vnfId')
@@ -129,12 +133,12 @@ public class ReplaceVnfInfra extends VnfCmBase {
if (relatedInstanceList != null) {
relatedInstanceList.each {
if (it.relatedInstance.modelInfo?.modelType == 'service') {
- msoLogger.debug("PROCESSING SERVICE INFO")
+ logger.debug("PROCESSING SERVICE INFO")
asdcServiceModelVersion = it.relatedInstance.modelInfo?.modelVersion
serviceModelInfo = jsonOutput.toJson(it.relatedInstance.modelInfo)
- msoLogger.debug("ServiceModelInfo: " + serviceModelInfo)
+ logger.debug("ServiceModelInfo: " + serviceModelInfo)
def modelInvariant = jsonUtils.getJsonValue(serviceModelInfo, "modelInvariantUuid")
- msoLogger.debug("modelInvariant: " + modelInvariant)
+ logger.debug("modelInvariant: " + modelInvariant)
}
}
@@ -146,7 +150,7 @@ public class ReplaceVnfInfra extends VnfCmBase {
execution.setVariable('vnfModelInfo', vnfModelInfo)
def vnfModelInvariantUuid = jsonUtils.getJsonValue(vnfModelInfo, "modelInvariantUuid")
execution.setVariable('vnfModelInvariantUuid', vnfModelInvariantUuid)
- msoLogger.debug("vnfModelInvariantUuid: " + vnfModelInvariantUuid)
+ logger.debug("vnfModelInvariantUuid: " + vnfModelInvariantUuid)
def vnfType = execution.getVariable('vnfType')
execution.setVariable('vnfType', vnfType)
@@ -155,7 +159,7 @@ public class ReplaceVnfInfra extends VnfCmBase {
def controllerType = reqMap.requestDetails?.requestParameters?.controllerType
execution.setVariable('controllerType', controllerType)
- msoLogger.debug('Controller Type: ' + controllerType)
+ logger.debug('Controller Type: ' + controllerType)
def userParams = reqMap.requestDetails?.requestParameters?.userParams
@@ -166,13 +170,13 @@ public class ReplaceVnfInfra extends VnfCmBase {
}
}
- msoLogger.debug('Processed user params: ' + userParamsMap)
+ logger.debug('Processed user params: ' + userParamsMap)
execution.setVariable('vfModuleInputParams', userParamsMap)
def requestId = execution.getVariable("requestId")
execution.setVariable('msoRequestId', requestId)
- msoLogger.debug("requestId is: " + requestId)
+ logger.debug("requestId is: " + requestId)
def vnfName = reqMap.requestDetails?.requestInfo?.instanceName ?: null
execution.setVariable('vnfName', vnfName)
@@ -217,19 +221,21 @@ public class ReplaceVnfInfra extends VnfCmBase {
execution.setVariable("requestInfo", requestInfo)
- msoLogger.debug('RequestInfo: ' + execution.getVariable("requestInfo"))
+ logger.debug('RequestInfo: ' + execution.getVariable("requestInfo"))
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
}
catch(groovy.json.JsonException je) {
- msoLogger.debug(" Request is not in JSON format.")
+ logger.debug(" Request is not in JSON format.")
exceptionUtil.buildAndThrowWorkflowException(execution, 5000, "Invalid request format")
}
catch(Exception e) {
String restFaultMessage = e.getMessage()
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, " Exception Encountered - " + "\n" + restFaultMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Encountered - " + "\n" + restFaultMessage, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 5000, restFaultMessage)
}
}
@@ -244,7 +250,7 @@ public class ReplaceVnfInfra extends VnfCmBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
@@ -266,11 +272,13 @@ public class ReplaceVnfInfra extends VnfCmBase {
sendWorkflowResponse(execution, 200, synchResponse)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendResponse(): ' + e.getMessage())
}
}
@@ -288,25 +296,25 @@ public class ReplaceVnfInfra extends VnfCmBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
String vnfModelInvariantUuid = execution.getVariable('vnfModelInvariantUuid')
- msoLogger.debug("vnfModelInvariantUuid: " + vnfModelInvariantUuid)
+ logger.debug("vnfModelInvariantUuid: " + vnfModelInvariantUuid)
List<VnfResource> vnfResources = serviceDecomposition.getVnfResources()
for (i in 0..vnfResources.size()-1) {
ModelInfo modelInfo = vnfResources[i].getModelInfo()
String modelInvariantUuidFromDecomposition = modelInfo.getModelInvariantUuid()
- msoLogger.debug("modelInvariantUuidFromDecomposition: " + modelInvariantUuidFromDecomposition)
+ logger.debug("modelInvariantUuidFromDecomposition: " + modelInvariantUuidFromDecomposition)
if (vnfModelInvariantUuid.equals(modelInvariantUuidFromDecomposition)) {
VnfResource vnfResourceDecomposition = vnfResources[i]
execution.setVariable('vnfResourceDecomposition', vnfResourceDecomposition)
def nfRole = vnfResourceDecomposition.getNfRole()
execution.setVariable('nfRole', nfRole)
- msoLogger.debug("vnfResourceDecomposition: " + vnfResourceDecomposition.toJsonString())
+ logger.debug("vnfResourceDecomposition: " + vnfResourceDecomposition.toJsonString())
break
}
else {
@@ -315,11 +323,13 @@ public class ReplaceVnfInfra extends VnfCmBase {
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in getVnfResourceDecomposition(): ' + e.getMessage())
}
}
@@ -338,7 +348,7 @@ public class ReplaceVnfInfra extends VnfCmBase {
execution.setVariable('errorCode', "0")
execution.setVariable("workStep", "checkIfVnfInMaintInAAI")
execution.setVariable("failedActivity", "AAI")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
AAIRestClientImpl client = new AAIRestClientImpl()
@@ -346,7 +356,7 @@ public class ReplaceVnfInfra extends VnfCmBase {
aaiValidator.setClient(client)
def vnfId = execution.getVariable("vnfId")
boolean isInMaint = aaiValidator.isVNFLocked(vnfId)
- msoLogger.debug("isInMaint result: " + isInMaint)
+ logger.debug("isInMaint result: " + isInMaint)
execution.setVariable('isVnfInMaintenance', isInMaint)
if (isInMaint) {
@@ -355,11 +365,13 @@ public class ReplaceVnfInfra extends VnfCmBase {
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
//exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfVnfInMaintInAAI(): ' + e.getMessage())
@@ -379,7 +391,7 @@ public class ReplaceVnfInfra extends VnfCmBase {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("workStep", "checkIfPserversInMaintInAAI")
execution.setVariable("failedActivity", "AAI")
@@ -389,7 +401,7 @@ public class ReplaceVnfInfra extends VnfCmBase {
aaiValidator.setClient(client)
def vnfId = execution.getVariable("vnfId")
boolean areLocked = aaiValidator.isPhysicalServerLocked(vnfId)
- msoLogger.debug("areLocked result: " + areLocked)
+ logger.debug("areLocked result: " + areLocked)
execution.setVariable('arePserversLocked', areLocked)
if (areLocked) {
@@ -397,11 +409,13 @@ public class ReplaceVnfInfra extends VnfCmBase {
execution.setVariable("errorText", "pServers are locked in A&AI")
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
//exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfPserversInMaintInAAI(): ' + e.getMessage())
@@ -421,7 +435,7 @@ public class ReplaceVnfInfra extends VnfCmBase {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
if (inMaint) {
execution.setVariable("workStep", "setVnfInMaintFlagInAAI")
}
@@ -443,11 +457,13 @@ public class ReplaceVnfInfra extends VnfCmBase {
aaiUpdator.updateVnfToUnLocked(vnfId)
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
}
@@ -466,10 +482,10 @@ public class ReplaceVnfInfra extends VnfCmBase {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
- msoLogger.debug("Running APP-C action: " + action.toString())
+ logger.debug("Running APP-C action: " + action.toString())
String vnfId = execution.getVariable('vnfId')
String msoRequestId = execution.getVariable('requestId')
execution.setVariable('msoRequestId', msoRequestId)
@@ -504,26 +520,32 @@ public class ReplaceVnfInfra extends VnfCmBase {
default:
break
}
- msoLogger.debug("Completed AppC request")
+ logger.debug("Completed AppC request")
int appcCode = appcStatus.getCode()
- msoLogger.debug("AppC status code is: " + appcCode)
- msoLogger.debug("AppC status message is: " + appcStatus.getMessage())
+ logger.debug("AppC status code is: " + appcCode)
+ logger.debug("AppC status message is: " + appcStatus.getMessage())
if (support.getCategoryOf(appcStatus) == ApplicationControllerSupport.StatusCategory.ERROR) {
execution.setVariable("errorCode", Integer.toString(appcCode))
execution.setVariable("errorText", appcStatus.getMessage())
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
} catch (java.lang.NoSuchMethodError e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
}
@@ -543,10 +565,10 @@ public class ReplaceVnfInfra extends VnfCmBase {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("workStep", "doDeleteVnfAndModules")
execution.setVariable("failedActivity", "MSO Delete VNF")
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
}
@@ -562,10 +584,10 @@ public class ReplaceVnfInfra extends VnfCmBase {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("workStep", "doCreateVnfAndModules")
execution.setVariable("failedActivity", "MSO Create VNF")
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
}
@@ -580,7 +602,7 @@ public class ReplaceVnfInfra extends VnfCmBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
def errorText = execution.getVariable("errorText")
def errorCode = execution.getVariable("errorCode")
@@ -598,7 +620,7 @@ public class ReplaceVnfInfra extends VnfCmBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
def taskId = execution.getVariable("taskId")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/RollbackVnf.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/RollbackVnf.groovy
index 22b44c9ead..5b0b92415d 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/RollbackVnf.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/RollbackVnf.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -54,9 +56,11 @@ import org.onap.appc.client.lcm.model.Action;
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
public class RollbackVnf extends VnfCmBase {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, RollbackVnf.class);
+ private static final Logger logger = LoggerFactory.getLogger( RollbackVnf.class);
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtils = new JsonUtils()
@@ -92,7 +96,7 @@ public class RollbackVnf extends VnfCmBase {
')'
initProcessVariables(execution)
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
initProcessVariables(execution)
@@ -101,16 +105,18 @@ public class RollbackVnf extends VnfCmBase {
execution.setVariable("rollbackErrorCode", "0")
if (execution.getVariable("rollbackSetClosedLoopDisabledFlag") == true) {
- msoLogger.debug("Will call setClosedLoopDisabledFlag")
+ logger.debug("Will call setClosedLoopDisabledFlag")
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
}
catch(Exception e) {
String restFaultMessage = e.getMessage()
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, " Exception Encountered - " + "\n" + restFaultMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Encountered - " + "\n" + restFaultMessage, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
execution.setVariable("rollbackErrorCode", "1")
exceptionUtil.buildAndThrowWorkflowException(execution, 5000, restFaultMessage)
}
@@ -127,19 +133,19 @@ public class RollbackVnf extends VnfCmBase {
')'
initProcessVariables(execution)
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
def rollbackErrorCode = execution.getVariable('rollbackErrorCode')
if (rollbackErrorCode == "0") {
execution.setVariable('rollbackSuccessful', true)
- msoLogger.debug("rollback successful")
+ logger.debug("rollback successful")
}
else {
execution.setVariable('rollbackSuccessful', false)
- msoLogger.debug("rollback unsuccessful")
+ logger.debug("rollback unsuccessful")
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstance.groovy
index 687ac215a5..010f3d77f3 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 CMCC. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -32,6 +34,8 @@ import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.onap.so.utils.UUIDChecker
import org.springframework.web.util.UriUtils
@@ -41,7 +45,7 @@ import org.springframework.web.util.UriUtils
*
*/
public class ScaleCustomE2EServiceInstance extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, ScaleCustomE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( ScaleCustomE2EServiceInstance.class);
String Prefix = "CRESI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -50,22 +54,22 @@ public class ScaleCustomE2EServiceInstance extends AbstractServiceTaskProcessor
public void preProcessRequest(DelegateExecution execution) {
execution.setVariable("prefix", Prefix)
String msg = ""
- msoLogger.trace("preProcessRequest() ")
+ logger.trace("preProcessRequest() ")
try {
String siRequest = execution.getVariable("bpmnRequest")
- msoLogger.debug(siRequest)
+ logger.debug(siRequest)
String requestId = execution.getVariable("mso-request-id")
execution.setVariable("msoRequestId", requestId)
- msoLogger.debug("Input Request:" + siRequest + " reqId:" + requestId)
+ logger.debug("Input Request:" + siRequest + " reqId:" + requestId)
String serviceInstanceId = execution.getVariable("serviceInstanceId")
if (isBlank(serviceInstanceId)) {
serviceInstanceId = "NULL".toString()
}
- msoLogger.debug("Generated new Service Instance:" + serviceInstanceId)
+ logger.debug("Generated new Service Instance:" + serviceInstanceId)
serviceInstanceId = UriUtils.encode(serviceInstanceId, "UTF-8")
execution.setVariable("serviceInstanceId", serviceInstanceId)
@@ -83,7 +87,7 @@ public class ScaleCustomE2EServiceInstance extends AbstractServiceTaskProcessor
//String operationKey = UUIDChecker.generateUUID(msoLogger)
String operationId = jsonUtil.getJsonValue(siRequest, "operationId")
execution.setVariable("operationId", operationId)
- msoLogger.debug("Input Request:" + siRequest + " operationId:" + operationId)
+ logger.debug("Input Request:" + siRequest + " operationId:" + operationId)
String resources = jsonUtil.getJsonValue(siRequest, "service.resources")
@@ -110,35 +114,35 @@ public class ScaleCustomE2EServiceInstance extends AbstractServiceTaskProcessor
throw e;
} catch (Exception ex) {
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit preProcessRequest ")
+ logger.trace("Exit preProcessRequest ")
}
public void sendSyncResponse(DelegateExecution execution) {
- msoLogger.trace("sendSyncResponse ")
+ logger.trace("sendSyncResponse ")
try {
String operationId = execution.getVariable("operationId")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
// RESTResponse for API Handler (APIH) Reply Task
String scaleServiceRestRequest = """{"operationId":"${operationId}"}""".trim()
- msoLogger.debug(" sendSyncResponse to APIH:" + "\n" + scaleServiceRestRequest)
+ logger.debug(" sendSyncResponse to APIH:" + "\n" + scaleServiceRestRequest)
sendWorkflowResponse(execution, 202, scaleServiceRestRequest)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit sendSyncResopnse ")
+ logger.trace("Exit sendSyncResopnse ")
}
public void sendSyncError(DelegateExecution execution) {
- msoLogger.trace("sendSyncError ")
+ logger.trace("sendSyncError ")
try {
String errorMessage = ""
@@ -155,17 +159,17 @@ public class ScaleCustomE2EServiceInstance extends AbstractServiceTaskProcessor
<aetgt:ErrorCode>7000</aetgt:ErrorCode>
</aetgt:WorkflowException>"""
- msoLogger.debug(buildworkflowException)
+ logger.debug(buildworkflowException)
sendWorkflowResponse(execution, 500, buildworkflowException)
} catch (Exception ex) {
- msoLogger.debug(" Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
+ logger.debug(" Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
}
}
public void prepareCompletionRequest(DelegateExecution execution) {
- msoLogger.trace("prepareCompletion ")
+ logger.trace("prepareCompletion ")
try {
String requestId = execution.getVariable("msoRequestId")
@@ -189,22 +193,22 @@ public class ScaleCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
execution.setVariable("CompleteMsoProcessRequest", xmlMsoCompletionRequest)
- msoLogger.debug(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
+ logger.debug(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
} catch (Exception ex) {
String msg = " Exception in prepareCompletion:" + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit prepareCompletionRequest ")
+ logger.trace("Exit prepareCompletionRequest ")
}
public void prepareFalloutRequest(DelegateExecution execution) {
- msoLogger.trace("prepareFalloutRequest ")
+ logger.trace("prepareFalloutRequest ")
try {
WorkflowException wfex = execution.getVariable("WorkflowException")
- msoLogger.debug(" Input Workflow Exception: " + wfex.toString())
+ logger.debug(" Input Workflow Exception: " + wfex.toString())
String requestId = execution.getVariable("msoRequestId")
String source = execution.getVariable("source")
String requestInfo =
@@ -217,7 +221,7 @@ public class ScaleCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
execution.setVariable("falloutRequest", falloutRequest)
} catch (Exception ex) {
- msoLogger.debug("Exception prepareFalloutRequest:" + ex.getMessage())
+ logger.debug("Exception prepareFalloutRequest:" + ex.getMessage())
String errorException = " Bpmn error encountered in ScaleGenericALaCarteServiceInstance flow. FalloutHandlerRequest, buildErrorResponse() - " + ex.getMessage()
String requestId = execution.getVariable("msoRequestId")
String falloutRequest =
@@ -237,7 +241,7 @@ public class ScaleCustomE2EServiceInstance extends AbstractServiceTaskProcessor
execution.setVariable("falloutRequest", falloutRequest)
}
- msoLogger.trace("Exit prepareFalloutRequest ")
+ logger.trace("Exit prepareFalloutRequest ")
}
@@ -245,7 +249,7 @@ public class ScaleCustomE2EServiceInstance extends AbstractServiceTaskProcessor
* Init the service Operation Status
*/
public void prepareInitServiceOperationStatus(DelegateExecution execution){
- msoLogger.trace("STARTED prepareInitServiceOperationStatus Process ")
+ logger.trace("STARTED prepareInitServiceOperationStatus Process ")
try{
String serviceId = execution.getVariable("serviceInstanceId")
//String serviceName = execution.getVariable("serviceInstanceName")
@@ -262,7 +266,7 @@ public class ScaleCustomE2EServiceInstance extends AbstractServiceTaskProcessor
def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
- msoLogger.info("DB Adapter Endpoint is: " + dbAdapterEndpoint)
+ logger.info("DB Adapter Endpoint is: " + dbAdapterEndpoint)
String payload =
"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
@@ -285,13 +289,15 @@ public class ScaleCustomE2EServiceInstance extends AbstractServiceTaskProcessor
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)
- msoLogger.info("Outgoing updateServiceOperStatusRequest: \n" + payload)
- msoLogger.debug("Scale network service updateServiceOperStatusRequest Request: " + payload)
+ logger.info("Outgoing updateServiceOperStatusRequest: \n" + payload)
+ logger.debug("Scale network service updateServiceOperStatusRequest Request: " + payload)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing prepareInitServiceOperationStatus.", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occured Processing prepareInitServiceOperationStatus.", "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), e);
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareInitServiceOperationStatus Method:\n" + e.getMessage())
}
- msoLogger.trace("COMPLETED prepareInitServiceOperationStatus Process ")
+ logger.trace("COMPLETED prepareInitServiceOperationStatus Process ")
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy
index 4127c3a913..4e3517e5b5 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -43,6 +45,8 @@ import org.onap.so.client.aai.entities.AAIResultWrapper
import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.springframework.web.util.UriUtils
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import groovy.json.*
@@ -52,6 +56,8 @@ import groovy.json.*
*
*/
public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor {
+ private static final Logger logger = LoggerFactory.getLogger( UpdateCustomE2EServiceInstance.class);
+
String Prefix="UPDSI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
@@ -61,7 +67,7 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
String msg = ""
- utils.log("INFO", " *** preProcessRequest() *** ", isDebugEnabled)
+ logger.info( " *** preProcessRequest() *** ")
try {
@@ -70,7 +76,7 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String requestId = execution.getVariable("mso-request-id")
execution.setVariable("msoRequestId", requestId)
- utils.log("INFO", "Input Request:" + siRequest + " reqId:" + requestId, isDebugEnabled)
+ logger.info( "Input Request:" + siRequest + " reqId:" + requestId)
String serviceInstanceId = execution.getVariable("serviceInstanceId")
if (isBlank(serviceInstanceId)) {
@@ -95,32 +101,32 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
if (isBlank(productFamilyId))
{
msg = "Input productFamilyId is null"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
} else {
execution.setVariable("productFamilyId", productFamilyId)
}
//user params
String userParams = jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.userParams")
- utils.log("INFO", "userParams:" + userParams, isDebugEnabled)
+ logger.info( "userParams:" + userParams)
List<String> paramList = jsonUtil.StringArrayToList(execution, userParams)
String uuiRequest = jsonUtil.getJsonValue(paramList.get(0), "UUIRequest")
if (isBlank(uuiRequest)) {
msg = "Input uuiRequest is null"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
} else
{
execution.setVariable("uuiRequest", uuiRequest)
}
- utils.log("INFO", "uuiRequest:\n" + uuiRequest, isDebugEnabled)
+ logger.info( "uuiRequest:\n" + uuiRequest)
//serviceType for aai
String serviceType = jsonUtil.getJsonValue(uuiRequest, "service.serviceType")
if (isBlank(serviceType)) {
msg = "Input serviceType is null"
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
} else {
execution.setVariable("serviceType", serviceType)
@@ -128,17 +134,17 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
// target model info
String modelInvariantUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceInvariantUuid")
- utils.log("INFO","modelInvariantUuid: " + modelInvariantUuid, isDebugEnabled)
+ logger.info("modelInvariantUuid: " + modelInvariantUuid)
execution.setVariable("modelInvariantUuid", modelInvariantUuid)
execution.setVariable("model-invariant-id-target", modelInvariantUuid)
String modelUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceUuid")
- utils.log("INFO","modelUuid: " + modelUuid, isDebugEnabled)
+ logger.info("modelUuid: " + modelUuid)
execution.setVariable("modelUuid", modelUuid)
execution.setVariable("model-version-id-target", modelUuid)
String serviceModelName = jsonUtil.getJsonValue(uuiRequest, "service.parameters.templateName")
- utils.log("INFO","serviceModelName: " + serviceModelName, isDebugEnabled)
+ logger.info("serviceModelName: " + serviceModelName)
if(serviceModelName == null) {
serviceModelName = ""
}
@@ -157,10 +163,10 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- utils.log("INFO"," ***** Exit preProcessRequest *****", isDebugEnabled)
+ logger.info(" ***** Exit preProcessRequest *****")
}
/**
@@ -203,7 +209,7 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
public void postCompareModelVersions(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("DEBUG", " ======== STARTED postCompareModelVersions Process ======== ", isDebugEnabled)
+ logger.debug( " ======== STARTED postCompareModelVersions Process ======== ")
def hasResourcetoUpdate = false
def hasResourcetoAdd = false
@@ -222,7 +228,7 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
hasResourcetoUpdate = hasResourcetoAdd || hasResourcetoDelete
execution.setVariable("hasResourcetoUpdate", hasResourcetoUpdate)
- utils.log("DEBUG", "======== COMPLETED postCompareModelVersions Process ======== ", isDebugEnabled)
+ logger.debug( "======== COMPLETED postCompareModelVersions Process ======== ")
}
/**
@@ -230,7 +236,7 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
*/
public void prepareInitServiceOperationStatus(DelegateExecution execution){
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("DEBUG", " ======== STARTED prepareInitServiceOperationStatus Process ======== ", isDebugEnabled)
+ logger.debug( " ======== STARTED prepareInitServiceOperationStatus Process ======== ")
try{
String serviceId = execution.getVariable("serviceInstanceId")
String operationId = execution.getVariable("operationId")
@@ -240,7 +246,7 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String progress = "0"
String reason = ""
String operationContent = "Prepare service updating"
- utils.log("DEBUG", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId, isDebugEnabled)
+ logger.debug( "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId)
serviceId = UriUtils.encode(serviceId,"UTF-8")
execution.setVariable("serviceInstanceId", serviceId)
execution.setVariable("operationId", operationId)
@@ -248,7 +254,7 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
- utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
+ logger.debug( "DB Adapter Endpoint is: " + dbAdapterEndpoint)
String payload =
"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
@@ -270,14 +276,14 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)
- utils.log("DEBUG", "Outgoing updateServiceOperStatusRequest: \n" + payload, isDebugEnabled)
+ logger.error( "Outgoing updateServiceOperStatusRequest: \n" + payload)
utils.logAudit("CreateVfModuleInfra Outgoing updateServiceOperStatusRequest Request: " + payload)
}catch(Exception e){
- utils.log("ERROR", "Exception Occured Processing prepareInitServiceOperationStatus. Exception is:\n" + e, isDebugEnabled)
+ logger.debug( "Exception Occured Processing prepareInitServiceOperationStatus. Exception is:\n" + e)
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareInitServiceOperationStatus Method:\n" + e.getMessage())
}
- utils.log("DEBUG", "======== COMPLETED prepareInitServiceOperationStatus Process ======== ", isDebugEnabled)
+ logger.debug( "======== COMPLETED prepareInitServiceOperationStatus Process ======== ")
}
/**
@@ -286,7 +292,7 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
public void preUpdateServiceOperationStatus(DelegateExecution execution){
def method = getClass().getSimpleName() + '.preUpdateServiceOperationStatus(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO","Entered " + method, isDebugEnabled)
+ logger.info("Entered " + method)
try{
String serviceId = execution.getVariable("serviceInstanceId")
@@ -297,11 +303,11 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String progress = execution.getVariable("progress")
String reason = execution.getVariable("operationReason")
String userId = ""
- utils.log("INFO", "progress: " + progress , isDebugEnabled)
+ logger.info( "progress: " + progress )
String operationContent = "Prepare service : " + execution.getVariable("operationStatus")
- utils.log("INFO", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId, isDebugEnabled)
+ logger.info( "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId)
serviceId = UriUtils.encode(serviceId,"UTF-8")
execution.setVariable("serviceInstanceId", serviceId)
execution.setVariable("operationId", operationId)
@@ -309,7 +315,7 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
- utils.log("INFO", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
+ logger.info( "DB Adapter Endpoint is: " + dbAdapterEndpoint)
String payload =
"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
@@ -331,20 +337,20 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)
- utils.log("INFO", "Outgoing preUpdateServiceOperationStatus: \n" + payload, isDebugEnabled)
+ logger.error( "Outgoing preUpdateServiceOperationStatus: \n" + payload)
}catch(Exception e){
- utils.log("ERROR", "Exception Occured Processing preUpdateServiceOperationStatus. Exception is:\n" + e, isDebugEnabled)
+ logger.info( "Exception Occured Processing preUpdateServiceOperationStatus. Exception is:\n" + e)
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preUpdateServiceOperationStatus Method:\n" + e.getMessage())
}
- utils.log("INFO", "======== COMPLETED preUpdateServiceOperationStatus Process ======== ", isDebugEnabled)
- utils.log("INFO", "Exited " + method, isDebugEnabled)
+ logger.info( "======== COMPLETED preUpdateServiceOperationStatus Process ======== ")
+ logger.info( "Exited " + method)
}
public void sendSyncResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO", " *** sendSyncResponse *** ", isDebugEnabled)
+ logger.info( " *** sendSyncResponse *** ")
try {
String operationId = execution.getVariable("operationId")
@@ -359,21 +365,21 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
updateServiceResp = """{"OperationResult":"No Resource to Add or Delete or Service Instance not found in AAI."}"""
}
- utils.log("INFO", " sendSyncResponse to APIH:" + "\n" + updateServiceResp, isDebugEnabled)
+ logger.info( " sendSyncResponse to APIH:" + "\n" + updateServiceResp)
sendWorkflowResponse(execution, 202, updateServiceResp)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- utils.log("INFO"," ***** Exit sendSyncResopnse *****", isDebugEnabled)
+ logger.info(" ***** Exit sendSyncResopnse *****")
}
public void sendSyncError (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO", " *** sendSyncError *** ", isDebugEnabled)
+ logger.info( " *** sendSyncError *** ")
try {
String errorMessage = ""
@@ -396,14 +402,14 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
sendWorkflowResponse(execution, 500, buildworkflowException)
} catch (Exception ex) {
- utils.log("INFO", " Sending Sync Error Activity Failed. " + "\n" + ex.getMessage(), isDebugEnabled)
+ logger.info( " Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
}
}
public void prepareCompletionRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO", " *** prepareCompletion *** ", isDebugEnabled)
+ logger.info( " *** prepareCompletion *** ")
try {
String requestId = execution.getVariable("msoRequestId")
@@ -427,23 +433,23 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
execution.setVariable("completionRequest", xmlMsoCompletionRequest)
- utils.log("INFO", " Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest, isDebugEnabled)
+ logger.info( " Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
} catch (Exception ex) {
String msg = " Exception in prepareCompletion:" + ex.getMessage()
- utils.log("INFO", msg, isDebugEnabled)
+ logger.info( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- utils.log("INFO", "*** Exit prepareCompletionRequest ***", isDebugEnabled)
+ logger.info( "*** Exit prepareCompletionRequest ***")
}
public void prepareFalloutRequest(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO", " *** prepareFalloutRequest *** ", isDebugEnabled)
+ logger.info( " *** prepareFalloutRequest *** ")
try {
WorkflowException wfex = execution.getVariable("WorkflowException")
- utils.log("INFO", " Input Workflow Exception: " + wfex.toString(), isDebugEnabled)
+ logger.info( " Input Workflow Exception: " + wfex.toString())
String requestId = execution.getVariable("msoRequestId")
String source = execution.getVariable("source")
String requestInfo =
@@ -456,7 +462,7 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
execution.setVariable("falloutRequest", falloutRequest)
} catch (Exception ex) {
- utils.log("INFO", "Exception prepareFalloutRequest:" + ex.getMessage(), isDebugEnabled)
+ logger.info( "Exception prepareFalloutRequest:" + ex.getMessage())
String errorException = " Bpmn error encountered in UpdateCustomE2EServiceInstance flow. FalloutHandlerRequest, buildErrorResponse() - " + ex.getMessage()
String requestId = execution.getVariable("msoRequestId")
String falloutRequest =
@@ -476,6 +482,6 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
execution.setVariable("falloutRequest", falloutRequest)
}
- utils.log("INFO", "*** Exit prepareFalloutRequest ***", isDebugEnabled)
+ logger.info( "*** Exit prepareFalloutRequest ***")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstance.groovy
index 329d58aa58..0b46a5a849 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstance.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -28,7 +30,8 @@ import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.json.JsonUtils
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import groovy.json.*
@@ -37,7 +40,7 @@ import groovy.json.*
*
*/
public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, UpdateNetworkInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( UpdateNetworkInstance.class);
String Prefix="UPDNI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -70,7 +73,7 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside preProcessRequest() of UpdateNetworkInstance Request")
+ logger.trace("Inside preProcessRequest() of UpdateNetworkInstance Request")
try {
// initialize flow variables
@@ -85,20 +88,20 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
String disableRollback = jsonUtil.getJsonValue(bpmnRequest, "requestDetails.requestInfo.suppressRollback")
if (disableRollback != null) {
execution.setVariable("disableRollback", disableRollback)
- msoLogger.debug("Received 'suppressRollback': " + disableRollback )
+ logger.debug("Received 'suppressRollback': " + disableRollback )
} else {
execution.setVariable("disableRollback", false)
}
- msoLogger.debug(" Set 'disableRollback' : " + execution.getVariable("disableRollback") )
+ logger.debug(" Set 'disableRollback' : " + execution.getVariable("disableRollback") )
} else {
String dataErrorMessage = " Invalid 'bpmnRequest' request."
- msoLogger.debug(dataErrorMessage)
+ logger.debug(dataErrorMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)
}
} else {
// 'macro' TEST ONLY, sdncVersion = '1702'
- msoLogger.debug(" \'disableRollback\' : " + execution.getVariable("disableRollback") )
+ logger.debug(" \'disableRollback\' : " + execution.getVariable("disableRollback") )
}
String requestId = execution.getVariable("msoRequestId")
@@ -143,7 +146,7 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
sendSyncError(execution)
// caught exception
String exceptionMessage = "Exception Encountered in UpdateNetworkInstance, PreProcessRequest() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -153,7 +156,7 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside sendSyncResponse() of UpdateNetworkInstance")
+ logger.trace("Inside sendSyncResponse() of UpdateNetworkInstance")
try {
String requestId = execution.getVariable("mso-request-id")
@@ -162,12 +165,12 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
// RESTResponse (for API Handler (APIH) Reply Task)
String updateNetworkRestRequest = """{"requestReferences":{"instanceId":"${serviceInstanceId}","requestId":"${requestId}"}}""".trim()
- msoLogger.debug(" sendSyncResponse to APIH - " + "\n" + updateNetworkRestRequest)
+ logger.debug(" sendSyncResponse to APIH - " + "\n" + updateNetworkRestRequest)
sendWorkflowResponse(execution, 202, updateNetworkRestRequest)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in UpdateNetworkInstance flow. sendSyncResponse() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -178,7 +181,7 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside getNetworkModelInfo() of UpdateNetworkInstance")
+ logger.trace("Inside getNetworkModelInfo() of UpdateNetworkInstance")
try {
@@ -191,7 +194,7 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
} catch (Exception ex) {
sendSyncError(execution)
String exceptionMessage = "Bpmn error encountered in UpdateNetworkInstance flow. getNetworkModelInfo() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -203,7 +206,7 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside sendSyncError() of UpdateNetworkInstance")
+ logger.trace("Inside sendSyncError() of UpdateNetworkInstance")
try {
@@ -216,7 +219,7 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
sendWorkflowResponse(execution, 500, syncError)
} catch (Exception ex) {
- msoLogger.debug(" Bpmn error encountered in UpdateNetworkInstance flow. sendSyncError() - " + ex.getMessage())
+ logger.debug(" Bpmn error encountered in UpdateNetworkInstance flow. sendSyncError() - " + ex.getMessage())
}
}
@@ -225,7 +228,7 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside prepareCompletion() of UpdateNetworkInstance")
+ logger.trace("Inside prepareCompletion() of UpdateNetworkInstance")
try {
@@ -250,11 +253,11 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
// normal path
execution.setVariable(Prefix + "Success", true)
execution.setVariable(Prefix + "CompleteMsoProcessRequest", xmlMsoCompletionRequest)
- msoLogger.debug(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
+ logger.debug(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in UpdateNetworkInstance flow. prepareCompletion() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -273,25 +276,25 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside postProcessResponse() of UpdateNetworkInstance")
+ logger.trace("Inside postProcessResponse() of UpdateNetworkInstance")
try {
if (execution.getVariable("CMSO_ResponseCode") == "200") {
execution.setVariable(Prefix + "Success", true)
- msoLogger.trace("UpdateNetworkInstance Success ")
+ logger.trace("UpdateNetworkInstance Success ")
// Place holder for additional code.
} else {
execution.setVariable(Prefix + "Success", false)
- msoLogger.trace("UpdateNetworkInstance Failed in CompletionMsoProces flow!. ")
+ logger.trace("UpdateNetworkInstance Failed in CompletionMsoProces flow!. ")
}
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in UpdateNetworkInstance flow. postProcessResponse() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -307,7 +310,7 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside processRollbackData() of UpdateNetworkInstance")
+ logger.trace("Inside processRollbackData() of UpdateNetworkInstance")
try {
//execution.getVariable("orchestrationStatus")
@@ -318,7 +321,7 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
//rolledBack
} catch (Exception ex) {
- msoLogger.debug(" Bpmn error encountered in UpdateNetworkInstance flow. callDBCatalog() - " + ex.getMessage())
+ logger.debug(" Bpmn error encountered in UpdateNetworkInstance flow. callDBCatalog() - " + ex.getMessage())
}
}
@@ -328,7 +331,7 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Prepare for FalloutHandler. FAILURE - prepare request for sub-process FalloutHandler. ")
+ logger.trace("Prepare for FalloutHandler. FAILURE - prepare request for sub-process FalloutHandler. ")
String falloutHandlerRequest = ""
String requestId = execution.getVariable("mso-request-id")
@@ -353,13 +356,13 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
</aetgt:WorkflowException>
</aetgt:FalloutHandlerRequest>"""
- msoLogger.debug(falloutHandlerRequest)
+ logger.debug(falloutHandlerRequest)
execution.setVariable(Prefix + "FalloutHandlerRequest", falloutHandlerRequest)
- msoLogger.debug(" Overall Error Response going to FalloutHandler: " + "\n" + falloutHandlerRequest)
+ logger.debug(" Overall Error Response going to FalloutHandler: " + "\n" + falloutHandlerRequest)
} catch (Exception ex) {
String errorException = " Bpmn error encountered in UpdateNetworkInstance flow. FalloutHandlerRequest, buildErrorResponse() - "
- msoLogger.debug("Exception error in UpdateNetworkInstance flow, buildErrorResponse(): " + ex.getMessage())
+ logger.debug("Exception error in UpdateNetworkInstance flow, buildErrorResponse(): " + ex.getMessage())
falloutHandlerRequest =
"""<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
xmlns:ns="http://org.onap/so/request/types/v1"
@@ -376,7 +379,7 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
</aetgt:FalloutHandlerRequest>"""
execution.setVariable(Prefix + "FalloutHandlerRequest", falloutHandlerRequest)
- msoLogger.debug(" Overall Error Response going to FalloutHandler: " + "\n" + falloutHandlerRequest)
+ logger.debug(" Overall Error Response going to FalloutHandler: " + "\n" + falloutHandlerRequest)
}
@@ -386,18 +389,18 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable("prefix",Prefix)
try{
- msoLogger.debug("Caught a Java Exception in " + Prefix)
- msoLogger.debug("Started processJavaException Method")
- msoLogger.debug("Variables List: " + execution.getVariables())
+ logger.debug("Caught a Java Exception in " + Prefix)
+ logger.debug("Started processJavaException Method")
+ logger.debug("Variables List: " + execution.getVariables())
execution.setVariable("UnexpectedError", "Caught a Java Lang Exception - " + Prefix) // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception")
}catch(Exception e){
- msoLogger.debug("Caught Exception during processJavaException Method: " + e)
+ logger.debug("Caught Exception during processJavaException Method: " + e)
execution.setVariable("UnexpectedError", "Exception in processJavaException method - " + Prefix) // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method" + Prefix)
}
- msoLogger.debug("Completed processJavaException Method in " + Prefix)
+ logger.debug("Completed processJavaException Method in " + Prefix)
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModule.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModule.groovy
index b1aaf5ea5f..35947ee4da 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModule.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModule.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -28,10 +30,12 @@ import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
public class UpdateVfModule extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, UpdateVfModule.class);
+ private static final Logger logger = LoggerFactory.getLogger( UpdateVfModule.class);
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -66,13 +70,13 @@ public class UpdateVfModule extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
initProcessVariables(execution)
String request = validateRequest(execution)
- msoLogger.debug("UpdateVfModule request: " + request)
+ logger.debug("UpdateVfModule request: " + request)
def requestInfo = getRequiredNodeXml(execution, request, 'request-info')
execution.setVariable('UPDVfMod_requestInfo', requestInfo)
execution.setVariable('UPDVfMod_requestId', getRequiredNodeText(execution, requestInfo, 'request-id'))
@@ -88,11 +92,13 @@ public class UpdateVfModule extends AbstractServiceTaskProcessor {
def vnfParams = utils.getNodeXml(request, 'vnf-params')
execution.setVariable('UPDVfMod_vnfParams', vnfParams)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in preProcessRequest(): ' + e.getMessage())
}
}
@@ -107,7 +113,7 @@ public class UpdateVfModule extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def requestInfo = execution.getVariable('UPDVfMod_requestInfo')
@@ -140,12 +146,14 @@ public class UpdateVfModule extends AbstractServiceTaskProcessor {
synchResponse = utils.formatXml(synchResponse)
sendWorkflowResponse(execution, 200, synchResponse)
- msoLogger.debug("UpdateVfModule Synch Response: " + synchResponse)
- msoLogger.trace('Exited ' + method)
+ logger.debug("UpdateVfModule Synch Response: " + synchResponse)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendSynchResponse(): ' + e.getMessage())
}
}
@@ -165,15 +173,17 @@ public class UpdateVfModule extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepDoUpdateVfModule(): ' + e.getMessage())
}
}
@@ -188,7 +198,7 @@ public class UpdateVfModule extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def requestId = execution.getVariable('UPDVfMod_requestId')
@@ -220,14 +230,16 @@ public class UpdateVfModule extends AbstractServiceTaskProcessor {
updateInfraRequest = utils.formatXml(updateInfraRequest)
execution.setVariable('UPDVfMod_updateInfraRequest', updateInfraRequest)
- msoLogger.debug('Request for Update Infra Request:\n' + updateInfraRequest)
+ logger.debug('Request for Update Infra Request:\n' + updateInfraRequest)
- msoLogger.debug("UpdateVfModule Infra Request: " + updateInfraRequest)
- msoLogger.trace('Exited ' + method)
+ logger.debug("UpdateVfModule Infra Request: " + updateInfraRequest)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepUpdateInfraRequest(): ' + e.getMessage())
}
}
@@ -244,7 +256,7 @@ public class UpdateVfModule extends AbstractServiceTaskProcessor {
', resultVar=' + resultVar +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def requestInfo = getVariable(execution, 'UPDVfMod_requestInfo')
@@ -258,15 +270,17 @@ public class UpdateVfModule extends AbstractServiceTaskProcessor {
"""
content = utils.formatXml(content)
- msoLogger.debug(resultVar + ' = ' + System.lineSeparator() + content)
+ logger.debug(resultVar + ' = ' + System.lineSeparator() + content)
execution.setVariable(resultVar, content)
- msoLogger.debug("UpdateVfModule CompletionHandler Request: " + content)
- msoLogger.trace('Exited ' + method)
+ logger.debug("UpdateVfModule CompletionHandler Request: " + content)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, 'Internal Error')
}
}
@@ -283,7 +297,7 @@ public class UpdateVfModule extends AbstractServiceTaskProcessor {
', resultVar=' + resultVar +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def prefix = execution.getVariable('prefix')
@@ -311,15 +325,17 @@ public class UpdateVfModule extends AbstractServiceTaskProcessor {
</sdncadapterworkflow:FalloutHandlerRequest>
"""
content = utils.formatXml(content)
- msoLogger.debug(resultVar + ' = ' + System.lineSeparator() + content)
+ logger.debug(resultVar + ' = ' + System.lineSeparator() + content)
execution.setVariable(resultVar, content)
- msoLogger.debug("UpdateVfModule fallOutHandler Request: " + content)
- msoLogger.trace('Exited ' + method)
+ logger.debug("UpdateVfModule fallOutHandler Request: " + content)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildWorkflowException(execution, 2000, 'Internal Error')
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleInfra.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleInfra.groovy
index 566afb0d9c..b4914c8cd5 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleInfra.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleInfra.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -20,20 +22,21 @@
package org.onap.so.bpmn.infrastructure.scripts
+import groovy.json.JsonOutput
+import groovy.json.JsonSlurper
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor;
+import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
-
-import groovy.json.JsonOutput
-import groovy.json.JsonSlurper
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
public class UpdateVfModuleInfra extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, UpdateVfModuleInfra.class);
+ private static final Logger logger = LoggerFactory.getLogger(UpdateVfModuleInfra.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -69,7 +72,7 @@ public class UpdateVfModuleInfra extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
initProcessVariables(execution)
@@ -77,12 +80,12 @@ public class UpdateVfModuleInfra extends AbstractServiceTaskProcessor {
def incomingRequest = execution.getVariable('bpmnRequest')
- msoLogger.debug("Incoming Infra Request: " + incomingRequest)
+ logger.debug("Incoming Infra Request: {}", incomingRequest)
try {
def jsonSlurper = new JsonSlurper()
def jsonOutput = new JsonOutput()
Map reqMap = jsonSlurper.parseText(incomingRequest)
- msoLogger.debug(" Request is in JSON format.")
+ logger.debug(" Request is in JSON format.")
def serviceInstanceId = execution.getVariable('serviceInstanceId')
def vnfId = execution.getVariable('vnfId')
@@ -130,9 +133,9 @@ public class UpdateVfModuleInfra extends AbstractServiceTaskProcessor {
userParams.each { userParam ->
userParamsMap.put(userParam.name, userParam.value.toString())
}
- }
-
- msoLogger.debug('Processed user params: ' + userParamsMap)
+ }
+
+ logger.debug('Processed user params: {}', userParamsMap)
execution.setVariable(prefix + 'vfModuleInputParams', userParamsMap)
@@ -207,19 +210,20 @@ public class UpdateVfModuleInfra extends AbstractServiceTaskProcessor {
//backoutOnFailure
- msoLogger.debug('RequestInfo: ' + execution.getVariable(prefix + "requestInfo"))
-
- msoLogger.trace('Exited ' + method)
+ logger.debug('RequestInfo: {}', execution.getVariable(prefix + "requestInfo"))
+
+ logger.trace('Exited {}', method)
}
catch(groovy.json.JsonException je) {
- msoLogger.debug(" Request is not in JSON format.")
+ logger.debug(" Request is not in JSON format.")
exceptionUtil.buildAndThrowWorkflowException(execution, 5000, "Invalid request format")
}
catch(Exception e) {
String restFaultMessage = e.getMessage()
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, " Exception Encountered - " + "\n" + restFaultMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Exception Encountered - \n{}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), restFaultMessage, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 5000, restFaultMessage)
}
}
@@ -234,8 +238,7 @@ public class UpdateVfModuleInfra extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
-
+ logger.trace('Entered {}', method)
try {
def requestInfo = execution.getVariable('UPDVfModI_requestInfo')
@@ -256,11 +259,12 @@ public class UpdateVfModuleInfra extends AbstractServiceTaskProcessor {
sendWorkflowResponse(execution, 200, synchResponse)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendResponse(): ' + e.getMessage())
}
}
@@ -280,15 +284,16 @@ public class UpdateVfModuleInfra extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepDoUpdateVfModule(): ' + e.getMessage())
}
}
@@ -303,7 +308,7 @@ public class UpdateVfModuleInfra extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
def requestId = execution.getVariable('UPDVfModI_requestId')
@@ -335,13 +340,14 @@ public class UpdateVfModuleInfra extends AbstractServiceTaskProcessor {
updateInfraRequest = utils.formatXml(updateInfraRequest)
execution.setVariable('UPDVfModI_updateInfraRequest', updateInfraRequest)
- msoLogger.debug('Request for Update Infra Request:\n' + updateInfraRequest)
+ logger.debug('Request for Update Infra Request:\n{}', updateInfraRequest)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepUpdateInfraRequest(): ' + e.getMessage())
}
}
@@ -358,7 +364,7 @@ public class UpdateVfModuleInfra extends AbstractServiceTaskProcessor {
', resultVar=' + resultVar +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
def requestInfo = getVariable(execution, 'UPDVfModI_requestInfo')
@@ -372,14 +378,15 @@ public class UpdateVfModuleInfra extends AbstractServiceTaskProcessor {
"""
content = utils.formatXml(content)
- msoLogger.debug(resultVar + ' = ' + System.lineSeparator() + content)
+ logger.debug('{} = {}{}', resultVar, System.lineSeparator(), content)
execution.setVariable(resultVar, content)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, 'Internal Error')
}
}
@@ -396,7 +403,7 @@ public class UpdateVfModuleInfra extends AbstractServiceTaskProcessor {
', resultVar=' + resultVar +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
def prefix = execution.getVariable('prefix')
@@ -424,14 +431,15 @@ public class UpdateVfModuleInfra extends AbstractServiceTaskProcessor {
</sdncadapterworkflow:FalloutHandlerRequest>
"""
content = utils.formatXml(content)
- msoLogger.debug(resultVar + ' = ' + System.lineSeparator() + content)
+ logger.debug('{} = {}{}', resultVar, System.lineSeparator(), content)
execution.setVariable(resultVar, content)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildWorkflowException(execution, 2000, 'Internal Error')
}
}
@@ -448,7 +456,7 @@ public class UpdateVfModuleInfra extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
String processKey = getProcessKey(execution);
def prefix = execution.getVariable("prefix")
@@ -494,13 +502,14 @@ public class UpdateVfModuleInfra extends AbstractServiceTaskProcessor {
utils.logContext(requestId, serviceInstanceId)
*/
- msoLogger.debug('Incoming message: ' + System.lineSeparator() + request)
- msoLogger.trace('Exited ' + method)
+ logger.debug('Incoming message: {}{}', System.lineSeparator(), request)
+ logger.trace('Exited {}', method)
return request
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Invalid Message")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleInfraV2.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleInfraV2.groovy
index 1a8df1664f..f04fa002fe 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleInfraV2.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleInfraV2.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -19,8 +21,9 @@
*/
package org.onap.so.bpmn.infrastructure.scripts
-
+import groovy.json.JsonOutput
+import groovy.json.JsonSlurper
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.onap.so.bpmn.common.scripts.ExceptionUtil
@@ -28,13 +31,11 @@ import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.client.aai.AAIValidatorImpl
import org.onap.so.client.appc.ApplicationControllerClient
-import org.onap.so.logger.MsoLogger
-
-import groovy.json.JsonOutput
-import groovy.json.JsonSlurper
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
public class UpdateVfModuleInfraV2 {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, UpdateVfModuleInfraV2.class);
+ private static final Logger logger = LoggerFactory.getLogger(UpdateVfModuleInfraV2.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -79,13 +80,13 @@ public class UpdateVfModuleInfraV2 {
* @param execution The flow's execution instance.
*/
public void preProcessRequest(DelegateExecution execution) {
- System.out.print("*****************************PreProcessRequest**************************")
+ logger.debug("*****************************PreProcessRequest**************************")
def method = getClass().getSimpleName() + '.preProcessRequest(' +
'execution=' + execution.getId() +
')'
- //msoLogger.trace('Entered ' + method)
+ //logger.trace('Entered ' + method)
initProcessVariables(execution)
@@ -93,12 +94,12 @@ public class UpdateVfModuleInfraV2 {
def incomingRequest = execution.getVariable('bpmnRequest')
- //msoLogger.debug("Incoming Infra Request: " + incomingRequest)
+ //logger.debug("Incoming Infra Request: " + incomingRequest)
try {
def jsonSlurper = new JsonSlurper()
def jsonOutput = new JsonOutput()
Map reqMap = jsonSlurper.parseText(incomingRequest)
- //msoLogger.debug(" Request is in JSON format.")
+ //logger.debug(" Request is in JSON format.")
def serviceInstanceId = execution.getVariable('serviceInstanceId')
def vnfId = execution.getVariable('vnfId')
@@ -148,7 +149,7 @@ public class UpdateVfModuleInfraV2 {
}
}
- //msoLogger.debug('Processed user params: ' + userParamsMap)
+ //logger.debug('Processed user params: ' + userParamsMap)
execution.setVariable(prefix + 'vfModuleInputParams', userParamsMap)
@@ -223,18 +224,18 @@ public class UpdateVfModuleInfraV2 {
//backoutOnFailure
- //msoLogger.debug('RequestInfo: ' + execution.getVariable(prefix + "requestInfo"))
+ //logger.debug('RequestInfo: ' + execution.getVariable(prefix + "requestInfo"))
- //msoLogger.trace('Exited ' + method)
+ //logger.trace('Exited ' + method)
}
catch(groovy.json.JsonException je) {
- //msoLogger.debug(" Request is not in JSON format.")
+ //logger.debug(" Request is not in JSON format.")
exceptionUtil.buildAndThrowWorkflowException(execution, 5000, "Invalid request format")
}
catch(Exception e) {
String restFaultMessage = e.getMessage()
- //msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, " Exception Encountered - " + "\n" + restFaultMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ //logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), " Exception Encountered - " + "\n" + restFaultMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 5000, restFaultMessage)
}
}
@@ -245,13 +246,13 @@ public class UpdateVfModuleInfraV2 {
* @param execution The flow's execution instance.
*/
public void sendSynchResponse(DelegateExecution execution) {
- System.out.print("*****************************SendSynchResponse**************************")
+ logger.debug("*****************************SendSynchResponse**************************")
def method = getClass().getSimpleName() + '.sendSynchResponse(' +
'execution=' + execution.getId() +
')'
- //msoLogger.trace('Entered ' + method)
+ //logger.trace('Entered ' + method)
try {
@@ -271,11 +272,11 @@ public class UpdateVfModuleInfraV2 {
def vfModuleId = execution.getVariable("vfModuleId")
String synchResponse = """{"requestReferences":{"instanceId":"${vfModuleId}","requestId":"${requestId}"}}""".trim()
sendWorkflowResponse(execution, 200, synchResponse)
- //msoLogger.trace('Exited ' + method)
+ //logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- //msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ //logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendResponse(): ' + e.getMessage())
}
}
@@ -283,7 +284,7 @@ public class UpdateVfModuleInfraV2 {
//check to see if the Pserver Flag is locked
public void checkPserverFlag(DelegateExecution execution) {
- System.out.println("*****************************CheckingPserverFlag*************************")
+ logger.debug("*****************************CheckingPserverFlag*************************")
String vnfId = (String)execution.getVariable('vnfId')
AAIValidatorImpl aaiVI = new AAIValidatorImpl()
boolean flag = aaiVI.isPhysicalServerLocked(vnfId)
@@ -292,7 +293,7 @@ public class UpdateVfModuleInfraV2 {
//check to see if the VFFlag is locked
public void vfFlagCheck(DelegateExecution execution) {
- System.out.print("*****************************VfFlagCheck*************************")
+ logger.debug("*****************************VfFlagCheck*************************")
String vnfId = (String)execution.getVariable('vnfId')
AAIValidatorImpl aaiVI = new AAIValidatorImpl()
boolean flag = aaiVI.isVNFLocked(vnfId)
@@ -301,7 +302,7 @@ public class UpdateVfModuleInfraV2 {
//lock the VF Flag
public void vfFlagSet(DelegateExecution execution) {
- System.out.print("*****************************VfFlagSet*************************")
+ logger.debug("*****************************VfFlagSet*************************")
String vnfId = (String)execution.getVariable('vnfId')
String uuid = (String)execution.getVariable('moduleUuid')
AAIValidatorImpl aaiVI = new AAIValidatorImpl()
@@ -312,7 +313,7 @@ public class UpdateVfModuleInfraV2 {
//Lock AppC
public void lockAppC(DelegateExecution execution) {
- System.out.print("*****************************lockAppC*************************")
+ logger.debug("*****************************lockAppC*************************")
def vfModuleId = ""
ApplicationControllerClient aCC = new ApplicationControllerClient(getLCMProperties())
def status = aCC.runCommand("Lock",vfModuleId)
@@ -322,7 +323,7 @@ public class UpdateVfModuleInfraV2 {
//run health check
public void healthCheckAppC(DelegateExecution execution) {
- System.out.print("*****************************healthCheckAppC*************************")
+ logger.debug("*****************************healthCheckAppC*************************")
def vfModuleId = ""
ApplicationControllerClient aCC = new ApplicationControllerClient(getLCMProperties())
def status = aCC.runCommand("HealthCheck",vfModuleId)
@@ -331,14 +332,14 @@ public class UpdateVfModuleInfraV2 {
//SDNO health diagnostic
public void healthDiagnosticSDNO(DelegateExecution execution) {
- System.out.print("*****************************healthDiagnosticSDNO is currently ignored*************************")
+ logger.debug("*****************************healthDiagnosticSDNO is currently ignored*************************")
//SDNOValidatorImpl.healthDiagnostic("","");
}
//stop VF module controller
public void stopVfModuleController(DelegateExecution execution) {
- System.out.print("*****************************stopVfModuleController*************************")
+ logger.debug("*****************************stopVfModuleController*************************")
def vfModuleId = ""
ApplicationControllerClient aCC = new ApplicationControllerClient(getLCMProperties())
def status = aCC.runCommand("Stop",vfModuleId)
@@ -348,20 +349,20 @@ public class UpdateVfModuleInfraV2 {
public void doUpdateVfModulePrep(DelegateExecution execution) {
- System.out.print("*****************************doUpdateVfModulePrep*************************")
+ logger.debug("*****************************doUpdateVfModulePrep*************************")
def method = getClass().getSimpleName() + '.prepDoUpdateVfModule(' +
'execution=' + execution.getId() +
')'
- //msoLogger.trace('Entered ' + method)
+ //logger.trace('Entered ' + method)
try {
- //msoLogger.trace('Exited ' + method)
+ //logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- //msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ //logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepDoUpdateVfModule(): ' + e.getMessage())
}
@@ -370,13 +371,13 @@ public class UpdateVfModuleInfraV2 {
public void completionHandlerPrep(DelegateExecution execution,String resultVar) {
- System.out.print("*****************************completionHandlerPrep*************************")
+ logger.debug("*****************************completionHandlerPrep*************************")
def method = getClass().getSimpleName() + '.completionHandlerPrep(' +
'execution=' + execution.getId() +
', resultVar=' + resultVar +
')'
- //msoLogger.trace('Entered ' + method)
+ //logger.trace('Entered ' + method)
try {
def requestInfo = getVariable(execution, 'UPDVfModI_requestInfo')
@@ -390,14 +391,14 @@ public class UpdateVfModuleInfraV2 {
"""
content = utils.formatXml(content)
- //msoLogger.debug(resultVar + ' = ' + System.lineSeparator() + content)
+ //logger.debug(resultVar + ' = ' + System.lineSeparator() + content)
execution.setVariable(resultVar, content)
- //msoLogger.trace('Exited ' + method)
+ //logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- //msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ //logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, 'Internal Error')
}
@@ -406,7 +407,7 @@ public class UpdateVfModuleInfraV2 {
public void healthCheckController(DelegateExecution execution) {
- System.out.print("*****************************healthCheckController*************************")
+ logger.debug("*****************************healthCheckController*************************")
def vfModuleId = ""
ApplicationControllerClient aCC = new ApplicationControllerClient(getLCMProperties())
def status = aCC.runCommand("HealthCheck",vfModuleId)
@@ -415,7 +416,7 @@ public class UpdateVfModuleInfraV2 {
public void startVfModuleController(DelegateExecution execution) {
- System.out.print("*****************************startVfModuleController*************************")
+ logger.debug("*****************************startVfModuleController*************************")
def vfModuleId = ""
ApplicationControllerClient aCC = new ApplicationControllerClient(getLCMProperties())
def status = aCC.runCommand("Start",vfModuleId)
@@ -424,7 +425,7 @@ public class UpdateVfModuleInfraV2 {
public void vFFlagUnset(DelegateExecution execution) {
- System.out.print("*****************************vFFlagUnset*************************")
+ logger.debug("*****************************vFFlagUnset*************************")
String vnfId = (String)execution.getVariable('vnfId')
String uuid = (String)execution.getVariable('moduleUuid')
AAIValidatorImpl aaiVI = new AAIValidatorImpl()
@@ -435,7 +436,7 @@ public class UpdateVfModuleInfraV2 {
public void unlockAppC(DelegateExecution execution) {
- System.out.print("*****************************unlockAppC*************************")
+ logger.debug("*****************************unlockAppC*************************")
def vfModuleId = ""
ApplicationControllerClient aCC = new ApplicationControllerClient(getLCMProperties())
def status = aCC.runCommand("Unlock",vfModuleId)
@@ -444,7 +445,7 @@ public class UpdateVfModuleInfraV2 {
public void postUpgradeHealthCheckController(DelegateExecution execution) {
- System.out.print("*****************************postUpgradeHealthCheckController*************************")
+ logger.debug("*****************************postUpgradeHealthCheckController*************************")
def vfModuleId = ""
ApplicationControllerClient aCC = new ApplicationControllerClient(getLCMProperties())
def status = aCC.runCommand("HealthCheck",vfModuleId)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy
index 5b1270a947..69bb4fd0c4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -37,10 +39,13 @@ import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.constants.Defaults
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
-import static org.apache.commons.lang.StringUtils.isEmpty
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
+
+import static org.apache.commons.lang.StringUtils.isEmpty
class UpdateVfModuleVolume extends VfModuleBase {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, UpdateVfModuleVolume.class)
+ private static final Logger logger = LoggerFactory.getLogger(UpdateVfModuleVolume.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -78,7 +83,7 @@ class UpdateVfModuleVolume extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
initProcessVariables(execution)
@@ -100,12 +105,13 @@ class UpdateVfModuleVolume extends VfModuleBase {
def volumeParams = utils.getNodeXml(request, 'volume-params')
execution.setVariable('UPDVfModVol_volumeParams', volumeParams)
- msoLogger.trace('Exited ' + method)
- msoLogger.debug("UpdateVfModuleVolume request: " + request)
+ logger.trace('Exited {}', method)
+ logger.debug("UpdateVfModuleVolume request: {}", request)
} catch (BpmnError bpmnError) {
throw bpmnError
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e)
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in preProcessRequest(): ' + e.getMessage())
}
}
@@ -120,7 +126,7 @@ class UpdateVfModuleVolume extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
def requestInfo = execution.getVariable('UPDVfModVol_requestInfo')
@@ -152,11 +158,12 @@ class UpdateVfModuleVolume extends VfModuleBase {
synchResponse = utils.formatXml(synchResponse)
sendWorkflowResponse(execution, 200, synchResponse)
- msoLogger.debug("UpdateVfModuleVolume Synch Response: " + synchResponse)
+ logger.debug("UpdateVfModuleVolume Synch Response: {}", synchResponse)
} catch (BpmnError e) {
throw e
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e)
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendSynchResponse(): ' + e.getMessage())
}
}
@@ -172,7 +179,7 @@ class UpdateVfModuleVolume extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
def volumeGroupId = execution.getVariable('UPDVfModVol_volumeGroupId')
@@ -193,7 +200,8 @@ class UpdateVfModuleVolume extends VfModuleBase {
exceptionUtil.buildAndThrowWorkflowException(execution,2500,"Could not find Tenant Id element in Volume Group with Volume Group Id" + volumeGroupId + ", AIC Cloud Region" + aicCloudRegion)
}
execution.setVariable('UPDVfModVol_volumeGroupTenantId', volumeGroupTenantId)
- msoLogger.debug("Received Tenant Id: " + volumeGroupTenantId + "from AAI for Volume Group with Volume Group Id: " + volumeGroupId + ", AIC Cloud Region" + aicCloudRegion)
+ logger.debug("Received Tenant Id: {} from AAI for Volume Group with Volume Group Id: {}, AIC Cloud Region",
+ volumeGroupTenantId, volumeGroupId, aicCloudRegion)
}else{
exceptionUtil.buildAndThrowWorkflowException(execution,2500,"Could not find Tenant Id element in Volume Group with Volume Group Id" + volumeGroupId + ", AIC Cloud Region" + aicCloudRegion)
}
@@ -201,11 +209,12 @@ class UpdateVfModuleVolume extends VfModuleBase {
}else{
exceptionUtil.buildAndThrowWorkflowException(execution,2500,"Volume Group" + volumeGroupId + " not found at AAI")
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e)
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIForVolumeGroup(): ' + e.getMessage())
}
}
@@ -221,7 +230,7 @@ class UpdateVfModuleVolume extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
def aicCloudRegion = execution.getVariable('UPDVfModVol_aicCloudRegion')
@@ -266,14 +275,15 @@ class UpdateVfModuleVolume extends VfModuleBase {
"""
vnfAdapterRestRequest = utils.formatXml(vnfAdapterRestRequest)
execution.setVariable('UPDVfModVol_vnfAdapterRestRequest', vnfAdapterRestRequest)
- msoLogger.debug('Request for VNFAdapter Rest:\n' + vnfAdapterRestRequest)
+ logger.debug('Request for VNFAdapter Rest:\n{}', vnfAdapterRestRequest)
- msoLogger.debug("UpdateVfModuleVolume Request for VNFAdapter Rest: " + vnfAdapterRestRequest)
- msoLogger.trace('Exited ' + method)
+ logger.debug("UpdateVfModuleVolume Request for VNFAdapter Rest: {}", vnfAdapterRestRequest)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e)
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepVnfAdapterRest(): ' + e.getMessage())
}
}
@@ -288,7 +298,7 @@ class UpdateVfModuleVolume extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
def requestId = execution.getVariable('UPDVfMod_requestId')
@@ -310,14 +320,15 @@ class UpdateVfModuleVolume extends VfModuleBase {
updateInfraRequest = utils.formatXml(updateInfraRequest)
execution.setVariable('UPDVfModVol_updateInfraRequest', updateInfraRequest)
- msoLogger.debug('Request for Update Infra Request:\n' + updateInfraRequest)
+ logger.debug('Request for Update Infra Request:\n{}', updateInfraRequest)
- msoLogger.debug("UpdateVfModuleVolume Request for Updating DB for Infra: " + updateInfraRequest)
- msoLogger.trace('Exited ' + method)
+ logger.debug("UpdateVfModuleVolume Request for Updating DB for Infra: {}", updateInfraRequest)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e)
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildWorkflowException(execution, 1002, 'Error in prepDbInfraDbRequest(): ' + e.getMessage())
}
}
@@ -332,7 +343,7 @@ class UpdateVfModuleVolume extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
def requestInfo = execution.getVariable('UPDVfModVol_requestInfo')
@@ -346,15 +357,16 @@ class UpdateVfModuleVolume extends VfModuleBase {
"""
content = utils.formatXml(content)
- msoLogger.debug('Request for Completion Handler:\n' + content)
- msoLogger.debug("UpdateVfModuleVolume Completion Handler request: " + content)
+ logger.debug('Request for Completion Handler:\n{}', content)
+ logger.debug("UpdateVfModuleVolume Completion Handler request: {}", content)
execution.setVariable('UPDVfModVol_CompletionHandlerRequest', content)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e)
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepCompletionHandlerRequest(): ' + e.getMessage())
}
}
@@ -369,7 +381,7 @@ class UpdateVfModuleVolume extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
def requestInfo = execution.getVariable('UPDVfModVol_requestInfo')
@@ -395,15 +407,16 @@ class UpdateVfModuleVolume extends VfModuleBase {
</sdncadapterworkflow:FalloutHandlerRequest>
"""
content = utils.formatXml(content)
- msoLogger.debug('Request for Fallout Handler:\n' + content)
- msoLogger.debug("UpdateVfModuleVolume Fallout request: " + content)
+ logger.debug('Request for Fallout Handler:\n{}', content)
+ logger.debug("UpdateVfModuleVolume Fallout request: {}", content)
execution.setVariable('UPDVfModVol_FalloutHandlerRequest', content)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e)
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildWorkflowException(execution, 1002, 'Error in prepFalloutHandler(): ' + e.getMessage())
}
}
@@ -419,7 +432,7 @@ class UpdateVfModuleVolume extends VfModuleBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
String processKey = getProcessKey(execution)
def volumeGroupId = execution.getVariable('UPDVfModVol_volumeGroupId')
@@ -430,12 +443,13 @@ class UpdateVfModuleVolume extends VfModuleBase {
def String errorMessage = 'TenantId \'' + tenantId + '\' in incoming request does not match Tenant Id \'' + volumeGroupTenantId +
'\' retrieved from AAI for Volume Group Id \'' + volumeGroupId + '\', AIC Cloud Region \'' + aicCloudRegion + '\''
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Error in UpdateVfModuleVol: ' + errorMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception")
+ logger.error("{} {} {} Error in UpdateVfModuleVol: {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), errorMessage)
WorkflowException exception = new WorkflowException(processKey, 5000, errorMessage)
execution.setVariable("WorkflowException", exception)
- msoLogger.trace('Exited ' + method)
- msoLogger.debug("UpdateVfModuleVolume workflowException in Tenant Mismatch: " + errorMessage)
+ logger.trace('Exited ' + method)
+ logger.debug("UpdateVfModuleVolume workflowException in Tenant Mismatch: " + errorMessage)
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy
index 49da398a87..e9121aa420 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -21,6 +23,7 @@
package org.onap.so.bpmn.infrastructure.scripts
import groovy.json.JsonException
+import groovy.json.JsonSlurper
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.onap.aai.domain.yang.GenericVnf
@@ -40,14 +43,15 @@ import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.constants.Defaults
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
-import static org.apache.cxf.common.util.CollectionUtils.isEmpty
-
-import groovy.json.JsonSlurper
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import javax.ws.rs.core.UriBuilder
+import static org.apache.cxf.common.util.CollectionUtils.isEmpty
+
class UpdateVfModuleVolumeInfraV1 extends VfModuleBase {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, UpdateVfModuleVolumeInfraV1.class)
+ private static final Logger logger = LoggerFactory.getLogger(UpdateVfModuleVolumeInfraV1.class)
private ExceptionUtil exceptionUtil = new ExceptionUtil()
/**
@@ -108,11 +112,11 @@ class UpdateVfModuleVolumeInfraV1 extends VfModuleBase {
def modelInvariantId = reqMap.requestDetails.modelInfo.modelInvariantUuid ?: ''
execution.setVariable('UPDVfModVol_modelInvariantId', modelInvariantId)
- msoLogger.debug("modelInvariantId from request: " + modelInvariantId)
- msoLogger.debug("XML request:\n" + request)
+ logger.debug("modelInvariantId from request: {}", modelInvariantId)
+ logger.debug("XML request:\n{}", request)
}
catch (JsonException je) {
- msoLogger.debug(" Request is in XML format.")
+ logger.debug(" Request is in XML format.")
// assume request is in XML format - proceed as usual to process XML request
}
@@ -186,7 +190,7 @@ class UpdateVfModuleVolumeInfraV1 extends VfModuleBase {
syncResponse = utils.formatXml(xmlSyncResponse)
}
- msoLogger.debug('Sync response: ' + syncResponse)
+ logger.debug('Sync response: {}', syncResponse)
execution.setVariable('UPDVfModVol_syncResponseSent', true)
sendWorkflowResponse(execution, 200, syncResponse)
}
@@ -213,7 +217,8 @@ class UpdateVfModuleVolumeInfraV1 extends VfModuleBase {
if (!isEmpty(tenantURIList)) {
String volumeGroupTenantId = tenantURIList.get(0).getURIKeys().get("tenant-id")
execution.setVariable('UPDVfModVol_volumeGroupTenantId', volumeGroupTenantId)
- msoLogger.debug("Received Tenant Id " + volumeGroupTenantId + " from AAI for Volume Group with Volume Group Id " + volumeGroupId + ", AIC Cloud Region " + aicCloudRegion)
+ logger.debug("Received Tenant Id {} from AAI for Volume Group with Volume Group Id {}, AIC Cloud Region ",
+ volumeGroupTenantId, volumeGroupId, aicCloudRegion)
} else {
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Could not find Tenant Id element in Volume Group with Volume Group Id " + volumeGroupId
+ ", AIC Cloud Region " + aicCloudRegion)
@@ -363,7 +368,7 @@ class UpdateVfModuleVolumeInfraV1 extends VfModuleBase {
"""
vnfAdapterRestRequest = utils.formatXml(vnfAdapterRestRequest)
execution.setVariable('UPDVfModVol_vnfAdapterRestRequest', vnfAdapterRestRequest)
- msoLogger.debug('Request for VNFAdapter Rest:\n' + vnfAdapterRestRequest)
+ logger.debug('Request for VNFAdapter Rest:\n' + vnfAdapterRestRequest)
}
/**
@@ -392,7 +397,7 @@ class UpdateVfModuleVolumeInfraV1 extends VfModuleBase {
updateInfraRequest = utils.formatXml(updateInfraRequest)
execution.setVariable('UPDVfModVol_updateInfraRequest', updateInfraRequest)
- msoLogger.debug('Request for Update Infra Request:\n' + updateInfraRequest)
+ logger.debug('Request for Update Infra Request:\n' + updateInfraRequest)
}
/**
@@ -414,7 +419,7 @@ class UpdateVfModuleVolumeInfraV1 extends VfModuleBase {
"""
content = utils.formatXml(content)
- msoLogger.debug('Request for Completion Handler:\n' + content)
+ logger.debug('Request for Completion Handler:\n' + content)
execution.setVariable('UPDVfModVol_CompletionHandlerRequest', content)
}
@@ -454,7 +459,7 @@ class UpdateVfModuleVolumeInfraV1 extends VfModuleBase {
</sdncadapterworkflow:FalloutHandlerRequest>
"""
content = utils.formatXml(content)
- msoLogger.debug('Request for Fallout Handler:\n' + content)
+ logger.debug('Request for Fallout Handler:\n' + content)
execution.setVariable('UPDVfModVol_FalloutHandlerRequest', content)
}
@@ -474,7 +479,7 @@ class UpdateVfModuleVolumeInfraV1 extends VfModuleBase {
" retrieved from AAI for Volume Group Id " + volumeGroupId + ", AIC Cloud Region " + aicCloudRegion
ExceptionUtil exceptionUtil = new ExceptionUtil()
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Error in UpdateVfModuleVol: ' + errorMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception")
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), 'Error in UpdateVfModuleVol: ' + errorMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception")
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, errorMessage)
}
@@ -492,7 +497,7 @@ class UpdateVfModuleVolumeInfraV1 extends VfModuleBase {
" retrieved from AAI for Volume Group Id "
ExceptionUtil exceptionUtil = new ExceptionUtil()
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Error in UpdateVfModuleVol: ' + errorMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception")
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), 'Error in UpdateVfModuleVol: ' + errorMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception")
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, errorMessage)
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVnfInfra.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVnfInfra.groovy
index f8d73ce020..1a62ad60f9 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVnfInfra.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVnfInfra.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -19,24 +21,27 @@
package org.onap.so.bpmn.infrastructure.scripts
+import groovy.json.JsonOutput
+import groovy.json.JsonSlurper
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.onap.appc.client.lcm.model.Action;
+import org.onap.appc.client.lcm.model.Action
import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.core.domain.ModelInfo
import org.onap.so.bpmn.core.domain.ServiceDecomposition
import org.onap.so.bpmn.core.domain.VnfResource
import org.onap.so.bpmn.core.json.JsonUtils
-import org.onap.so.client.aai.*
+import org.onap.so.client.aai.AAIRestClientImpl
+import org.onap.so.client.aai.AAIUpdatorImpl
+import org.onap.so.client.aai.AAIValidatorImpl
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
-
-import groovy.json.JsonOutput
-import groovy.json.JsonSlurper
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
public class UpdateVnfInfra extends VnfCmBase {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, UpdateVnfInfra.class);
+ private static final Logger logger = LoggerFactory.getLogger(UpdateVnfInfra.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtils = new JsonUtils()
@@ -83,18 +88,18 @@ public class UpdateVnfInfra extends VnfCmBase {
')'
initProcessVariables(execution)
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
initProcessVariables(execution)
def incomingRequest = execution.getVariable('bpmnRequest')
- msoLogger.debug("Incoming Infra Request: " + incomingRequest)
+ logger.debug("Incoming Infra Request: {}", incomingRequest)
try {
def jsonSlurper = new JsonSlurper()
def jsonOutput = new JsonOutput()
Map reqMap = jsonSlurper.parseText(incomingRequest)
- msoLogger.debug(" Request is in JSON format.")
+ logger.debug(" Request is in JSON format.")
execution.setVariable("isVidRequest", "true")
execution.setVariable('serviceType', 'Mobility')
@@ -112,12 +117,12 @@ public class UpdateVnfInfra extends VnfCmBase {
if (relatedInstanceList != null) {
relatedInstanceList.each {
if (it.relatedInstance.modelInfo?.modelType == 'service') {
- msoLogger.debug("PROCESSING SERVICE INFO")
+ logger.debug("PROCESSING SERVICE INFO")
asdcServiceModelVersion = it.relatedInstance.modelInfo?.modelVersion
serviceModelInfo = jsonOutput.toJson(it.relatedInstance.modelInfo)
- msoLogger.debug("ServiceModelInfo: " + serviceModelInfo)
+ logger.debug("ServiceModelInfo: {}", serviceModelInfo)
def modelInvariant = jsonUtils.getJsonValue(serviceModelInfo, "modelInvariantUuid")
- msoLogger.debug("modelInvariant: " + modelInvariant)
+ logger.debug("modelInvariant: {}", modelInvariant)
}
}
@@ -128,8 +133,8 @@ public class UpdateVnfInfra extends VnfCmBase {
def vnfModelInfo = jsonOutput.toJson(reqMap.requestDetails?.modelInfo)
execution.setVariable('vnfModelInfo', vnfModelInfo)
def vnfModelInvariantUuid = jsonUtils.getJsonValue(vnfModelInfo, "modelInvariantUuid")
- execution.setVariable('vnfModelInvariantUuid', vnfModelInvariantUuid)
- msoLogger.debug("vnfModelInvariantUuid: " + vnfModelInvariantUuid)
+ execution.setVariable('vnfModelInvariantUuid', vnfModelInvariantUuid)
+ logger.debug("vnfModelInvariantUuid: {}", vnfModelInvariantUuid)
def vnfType = execution.getVariable('vnfType')
execution.setVariable('vnfType', vnfType)
@@ -137,8 +142,8 @@ public class UpdateVnfInfra extends VnfCmBase {
def controllerType = reqMap.requestDetails?.requestParameters?.controllerType
execution.setVariable('controllerType', controllerType)
-
- msoLogger.debug('Controller Type: ' + controllerType)
+
+ logger.debug('Controller Type: {}', controllerType)
def userParams = reqMap.requestDetails?.requestParameters?.userParams
@@ -147,9 +152,9 @@ public class UpdateVnfInfra extends VnfCmBase {
userParams.each { userParam ->
userParamsMap.put(userParam.name, userParam.value.toString())
}
- }
-
- msoLogger.debug('Processed user params: ' + userParamsMap)
+ }
+
+ logger.debug('Processed user params: {}', userParamsMap)
execution.setVariable('vfModuleInputParams', userParamsMap)
@@ -195,21 +200,21 @@ public class UpdateVnfInfra extends VnfCmBase {
<source>${MsoUtils.xmlEscape(source)}</source>
</request-info>"""
- execution.setVariable("requestInfo", requestInfo)
-
- msoLogger.debug('RequestInfo: ' + execution.getVariable("requestInfo"))
-
- msoLogger.trace('Exited ' + method)
+ execution.setVariable("requestInfo", requestInfo)
+
+ logger.debug('RequestInfo: {}', execution.getVariable("requestInfo"))
+ logger.trace('Exited {}', method)
}
catch(groovy.json.JsonException je) {
- msoLogger.debug(" Request is not in JSON format.")
+ logger.debug(" Request is not in JSON format.")
exceptionUtil.buildAndThrowWorkflowException(execution, 5000, "Invalid request format")
}
catch(Exception e) {
String restFaultMessage = e.getMessage()
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, " Exception Encountered - " + "\n" + restFaultMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Exception Encountered - \n{}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), restFaultMessage, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 5000, restFaultMessage)
}
}
@@ -224,8 +229,7 @@ public class UpdateVnfInfra extends VnfCmBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
-
+ logger.trace('Entered {}', method)
try {
def requestInfo = execution.getVariable('requestInfo')
@@ -246,11 +250,12 @@ public class UpdateVnfInfra extends VnfCmBase {
sendWorkflowResponse(execution, 200, synchResponse)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendResponse(): ' + e.getMessage())
}
}
@@ -268,25 +273,25 @@ public class UpdateVnfInfra extends VnfCmBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
String vnfModelInvariantUuid = execution.getVariable('vnfModelInvariantUuid')
- msoLogger.debug("vnfModelInvariantUuid: " + vnfModelInvariantUuid)
+ logger.debug("vnfModelInvariantUuid: {}", vnfModelInvariantUuid)
List<VnfResource> vnfResources = serviceDecomposition.getVnfResources()
for (i in 0..vnfResources.size()-1) {
ModelInfo modelInfo = vnfResources[i].getModelInfo()
String modelInvariantUuidFromDecomposition = modelInfo.getModelInvariantUuid()
- msoLogger.debug("modelInvariantUuidFromDecomposition: " + modelInvariantUuidFromDecomposition)
-
+ logger.debug("modelInvariantUuidFromDecomposition: {}", modelInvariantUuidFromDecomposition)
+
if (vnfModelInvariantUuid.equals(modelInvariantUuidFromDecomposition)) {
VnfResource vnfResourceDecomposition = vnfResources[i]
execution.setVariable('vnfResourceDecomposition', vnfResourceDecomposition)
def nfRole = vnfResourceDecomposition.getNfRole()
execution.setVariable('nfRole', nfRole)
- msoLogger.debug("vnfResourceDecomposition: " + vnfResourceDecomposition.toJsonString())
+ logger.debug("vnfResourceDecomposition: {}", vnfResourceDecomposition.toJsonString())
break
}
else {
@@ -295,11 +300,12 @@ public class UpdateVnfInfra extends VnfCmBase {
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in getVnfResourceDecomposition(): ' + e.getMessage())
}
}
@@ -318,7 +324,7 @@ public class UpdateVnfInfra extends VnfCmBase {
execution.setVariable('errorCode', "0")
execution.setVariable("workStep", "checkIfVnfInMaintInAAI")
execution.setVariable("failedActivity", "AAI")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
AAIRestClientImpl client = new AAIRestClientImpl()
@@ -326,7 +332,7 @@ public class UpdateVnfInfra extends VnfCmBase {
aaiValidator.setClient(client)
def vnfId = execution.getVariable("vnfId")
boolean isInMaint = aaiValidator.isVNFLocked(vnfId)
- msoLogger.debug("isInMaint result: " + isInMaint)
+ logger.debug("isInMaint result: {}", isInMaint)
execution.setVariable('isVnfInMaintenance', isInMaint)
if (isInMaint) {
@@ -335,11 +341,12 @@ public class UpdateVnfInfra extends VnfCmBase {
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
//exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfVnfInMaintInAAI(): ' + e.getMessage())
@@ -359,7 +366,7 @@ public class UpdateVnfInfra extends VnfCmBase {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
execution.setVariable("workStep", "checkIfPserversInMaintInAAI")
execution.setVariable("failedActivity", "AAI")
@@ -369,7 +376,7 @@ public class UpdateVnfInfra extends VnfCmBase {
aaiValidator.setClient(client)
def vnfId = execution.getVariable("vnfId")
boolean areLocked = aaiValidator.isPhysicalServerLocked(vnfId)
- msoLogger.debug("areLocked result: " + areLocked)
+ logger.debug("areLocked result: {}", areLocked)
execution.setVariable('arePserversLocked', areLocked)
if (areLocked) {
@@ -377,11 +384,12 @@ public class UpdateVnfInfra extends VnfCmBase {
execution.setVariable("errorText", "pServers are locked in A&AI")
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
//exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfPserversInMaintInAAI(): ' + e.getMessage())
@@ -401,7 +409,7 @@ public class UpdateVnfInfra extends VnfCmBase {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
if (inMaint) {
execution.setVariable("workStep", "setVnfInMaintFlagInAAI")
}
@@ -422,12 +430,13 @@ public class UpdateVnfInfra extends VnfCmBase {
else {
aaiUpdator.updateVnfToUnLocked(vnfId)
}
-
- msoLogger.trace('Exited ' + method)
+
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
}
@@ -447,11 +456,10 @@ public class UpdateVnfInfra extends VnfCmBase {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
execution.setVariable("workStep", "doUpdateVnfAndModules")
execution.setVariable("failedActivity", "MSO Update VNF")
- msoLogger.trace('Exited ' + method)
-
+ logger.trace('Exited {}', method)
}
@@ -465,7 +473,7 @@ public class UpdateVnfInfra extends VnfCmBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
def errorText = execution.getVariable("errorText")
def errorCode = execution.getVariable("errorCode")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfCmBase.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfCmBase.groovy
index 32fc46a84f..01f0e246af 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfCmBase.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfCmBase.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -19,15 +21,16 @@
package org.onap.so.bpmn.infrastructure.scripts
+import groovy.json.JsonSlurper
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.json.JSONArray
import org.json.JSONObject
-import org.onap.appc.client.lcm.model.Action;
+import org.onap.appc.client.lcm.model.Action
import org.onap.appc.client.lcm.model.ActionIdentifiers
import org.onap.appc.client.lcm.model.Flags
import org.onap.appc.client.lcm.model.Status
-import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor;
+import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.core.WorkflowException
@@ -41,18 +44,18 @@ import org.onap.so.client.aai.entities.Relationships
import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
-import org.onap.so.client.appc.ApplicationControllerClient;
-import org.onap.so.client.appc.ApplicationControllerSupport;
+import org.onap.so.client.appc.ApplicationControllerClient
+import org.onap.so.client.appc.ApplicationControllerSupport
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
-
-import groovy.json.JsonSlurper
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VnfCmBase.class);
+ private static final Logger logger = LoggerFactory.getLogger(VnfCmBase.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
- JsonUtils jsonUtils = new JsonUtils()
+ JsonUtils jsonUtils = new JsonUtils()
def prefix = "VnfIPU_"
/**
@@ -71,8 +74,7 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
-
+ logger.trace('Entered {}', method)
try {
def requestInfo = execution.getVariable('requestInfo')
@@ -93,11 +95,12 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
sendWorkflowResponse(execution, 200, synchResponse)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendResponse(): ' + e.getMessage())
}
}
@@ -114,25 +117,25 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
def method = getClass().getSimpleName() + '.getVnfResourceDecomposition(' +
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
String vnfModelInvariantUuid = execution.getVariable('vnfModelInvariantUuid')
- msoLogger.debug("vnfModelInvariantUuid: " + vnfModelInvariantUuid)
+ logger.debug("vnfModelInvariantUuid: {}", vnfModelInvariantUuid)
List<VnfResource> vnfResources = serviceDecomposition.getVnfResources()
for (i in 0..vnfResources.size()-1) {
ModelInfo modelInfo = vnfResources[i].getModelInfo()
String modelInvariantUuidFromDecomposition = modelInfo.getModelInvariantUuid()
- msoLogger.debug("modelInvariantUuidFromDecomposition: " + modelInvariantUuidFromDecomposition)
+ logger.debug("modelInvariantUuidFromDecomposition: {}", modelInvariantUuidFromDecomposition)
if (vnfModelInvariantUuid.equals(modelInvariantUuidFromDecomposition)) {
VnfResource vnfResourceDecomposition = vnfResources[i]
execution.setVariable('vnfResourceDecomposition', vnfResourceDecomposition)
- def nfRole = vnfResourceDecomposition.getNfRole()
+ def nfRole = vnfResourceDecomposition.getNfRole()
execution.setVariable('nfRole', nfRole)
- msoLogger.debug("vnfResourceDecomposition: " + vnfResourceDecomposition.toJsonString())
+ logger.debug("vnfResourceDecomposition: {}", vnfResourceDecomposition.toJsonString())
break
}
else {
@@ -141,11 +144,12 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in getVnfResourceDecomposition(): ' + e.getMessage())
}
}
@@ -164,7 +168,7 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
execution.setVariable('errorCode', "0")
execution.setVariable("workStep", "checkIfVnfInMaintInAAI")
execution.setVariable("failedActivity", "AAI")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
AAIRestClientImpl client = new AAIRestClientImpl()
@@ -172,7 +176,7 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
aaiValidator.setClient(client)
def vnfId = execution.getVariable("vnfId")
boolean isInMaint = aaiValidator.isVNFLocked(vnfId)
- msoLogger.debug("isInMaint result: " + isInMaint)
+ logger.debug("isInMaint result: {}", isInMaint)
execution.setVariable('isVnfInMaintenance', isInMaint)
if (isInMaint) {
@@ -181,11 +185,12 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
//exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfVnfInMaintInAAI(): ' + e.getMessage())
@@ -203,20 +208,20 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
def transactionLoggingUuid = UUID.randomUUID().toString()
def vnfId = execution.getVariable("vnfId")
- msoLogger.debug("vnfId is: " + vnfId)
+ logger.debug("vnfId is: {}", vnfId)
def cloudRegionId = execution.getVariable("lcpCloudRegionId")
- msoLogger.debug("cloudRegionId is: " + cloudRegionId)
+ logger.debug("cloudRegionId is: {}", cloudRegionId)
AAIResourcesClient client = new AAIResourcesClient()
AAIUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
// Check if this VNF exists
if (!client.exists(genericVnfUri)) {
- msoLogger.debug("VNF with vnfId " + vnfId + " does not exist in A&AI")
+ logger.debug("VNF with vnfId {} does not exist in A&AI", vnfId)
exceptionUtil.buildAndThrowWorkflowException(execution, 404, "VNF with vnfId " + vnfId + " does not exist in A&AI")
}
@@ -225,13 +230,13 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
Map<String, Object> result = aaiRW.asMap()
String vnfName = result.get("vnf-name")
- msoLogger.debug("vnfName from A&AI is: " + vnfName)
+ logger.debug("vnfName from A&AI is: {}", vnfName)
execution.setVariable("vnfName", vnfName)
String nfRole = result.get("nf-role")
- msoLogger.debug("nfRole from A&AI is: " + nfRole)
+ logger.debug("nfRole from A&AI is: {}", nfRole)
execution.setVariable("nfRole", nfRole)
String vnfHostIpAddress = result.get("ipv4-oam-address")
- msoLogger.debug("vnfHostIpAddress from A&AI is: " + vnfHostIpAddress)
+ logger.debug("vnfHostIpAddress from A&AI is: {}", vnfHostIpAddress)
execution.setVariable("vnfHostIpAddress", vnfHostIpAddress)
execution.setVariable("vmIdList", null)
if (aaiRW.getRelationships() != null) {
@@ -246,8 +251,8 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
String vserverId = j.getURIKeys().get('vserver-id')
String vserverJson = client.get(j).getJson()
- msoLogger.debug("Retrieved vserverJson from AAI: " + vserverJson)
- String vserverSelfLink = jsonUtils.getJsonValue(vserverJson, "vserver-selflink")
+ logger.debug("Retrieved vserverJson from AAI: {}", vserverJson)
+ String vserverSelfLink = jsonUtils.getJsonValue(vserverJson, "vserver-selflink")
vserverIds.put(vserverId)
vserverSelfLinks.put(vserverSelfLink)
@@ -256,10 +261,10 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
JSONObject vmidsArray = new JSONObject()
JSONObject vserveridsArray = new JSONObject()
vmidsArray.put("vmIds", vserverSelfLinks.toString())
- vserveridsArray.put("vserverIds", vserverIds.toString())
-
- msoLogger.debug("vmidsArray is: " + vmidsArray.toString())
- msoLogger.debug("vserveridsArray is: " + vserveridsArray.toString())
+ vserveridsArray.put("vserverIds", vserverIds.toString())
+
+ logger.debug("vmidsArray is: {}", vmidsArray.toString())
+ logger.debug("vserveridsArray is: {}", vserveridsArray.toString())
execution.setVariable("vmIdList", vmidsArray.toString())
execution.setVariable("vserverIdList", vserveridsArray.toString())
@@ -270,7 +275,7 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
Optional<Relationships> relationships = aaiRW.getRelationships()
if(relationships.isPresent()) {
- msoLogger.debug("relationships are present")
+ logger.debug("relationships are present")
String rs = relationships.get().getJson()
def jsonSlurper = new JsonSlurper()
def map = jsonSlurper.parseText(rs)
@@ -280,25 +285,25 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
final String relatedTo = (String)relationship.get("related-to");
if (relatedTo.equals("platform")) {
List<Map<String, Object>> relationshipDataList = (List<Map<String, Object>>)relationship.get("relationship-data")
- msoLogger.debug("Found platform entry")
+ logger.debug("Found platform entry")
for (Map<String, Object> relationshipData : relationshipDataList) {
String relationshipKey = (String)relationshipData.get("relationship-key");
if (relationshipKey.equals("platform.platform-name")) {
String platformName = (String) relationshipData.get("relationship-value")
- msoLogger.debug("platform from A&AI is: " + platformName)
+ logger.debug("platform from A&AI is: {}", platformName)
execution.setVariable("platform", platformName)
- break
+ break
}
- }
+ }
}
if (relatedTo.equals("line-of-business")) {
List<Map<String, Object>> relationshipDataList = (List<Map<String, Object>>)relationship.get("relationship-data")
- msoLogger.debug("Found line-of-business entry")
+ logger.debug("Found line-of-business entry")
for (Map<String, Object> relationshipData : relationshipDataList) {
String relationshipKey = (String)relationshipData.get("relationship-key");
if (relationshipKey.equals("line-of-business.line-of-business-name")) {
String lineOfBusinessName = (String) relationshipData.get("relationship-value")
- msoLogger.debug("lineOfBusiness from A&AI is: " + lineOfBusinessName)
+ logger.debug("lineOfBusiness from A&AI is: {}", lineOfBusinessName)
execution.setVariable("lineOfBusiness", lineOfBusinessName)
break
}
@@ -310,11 +315,12 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIForVnf(): ' + e.getMessage())
}
}
@@ -333,7 +339,7 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
execution.setVariable("workStep", "checkIfPserversInMaintInAAI")
execution.setVariable("failedActivity", "AAI")
@@ -341,21 +347,22 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
AAIRestClientImpl client = new AAIRestClientImpl()
AAIValidatorImpl aaiValidator = new AAIValidatorImpl()
aaiValidator.setClient(client)
- def vnfId = execution.getVariable("vnfId")
+ def vnfId = execution.getVariable("vnfId")
boolean areLocked = aaiValidator.isPhysicalServerLocked(vnfId)
- msoLogger.debug("areLocked result: " + areLocked)
+ logger.debug("areLocked result: {}", areLocked)
execution.setVariable('arePserversLocked', areLocked)
if (areLocked) {
execution.setVariable("errorCode", "1003")
execution.setVariable("errorText", "pServers are locked in A&AI")
- }
+ }
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
//exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfPserversInMaintInAAI(): ' + e.getMessage())
@@ -375,7 +382,7 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
if (inMaint) {
execution.setVariable("workStep", "setVnfInMaintFlagInAAI")
}
@@ -396,12 +403,13 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
else {
aaiUpdator.updateVnfToUnLocked(vnfId)
}
-
- msoLogger.trace('Exited ' + method)
+
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
}
@@ -421,19 +429,19 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
execution.setVariable('errorCode', "0")
execution.setVariable("workStep", "checkClosedLoopDisabledFlagInAAI")
execution.setVariable("failedActivity", "AAI")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
- def transactionLoggingUuid = UUID.randomUUID().toString()
+ def transactionLoggingUuid = UUID.randomUUID().toString()
def vnfId = execution.getVariable("vnfId")
- msoLogger.debug("vnfId is: " + vnfId)
- AAIResourcesClient client = new AAIResourcesClient()
+ logger.debug("vnfId is: {}", vnfId)
+ AAIResourcesClient client = new AAIResourcesClient()
AAIUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
AAIResultWrapper aaiRW = client.get(genericVnfUri)
Map<String, Object> result = aaiRW.asMap()
boolean isClosedLoopDisabled = result.getOrDefault("is-closed-loop-disabled", false)
-
- msoLogger.debug("isClosedLoopDisabled result: " + isClosedLoopDisabled)
+
+ logger.debug("isClosedLoopDisabled result: {}", isClosedLoopDisabled)
execution.setVariable('isClosedLoopDisabled', isClosedLoopDisabled)
if (isClosedLoopDisabled) {
@@ -441,11 +449,12 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
execution.setVariable("errorText", "closedLoop is disabled in A&AI")
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
}
@@ -473,26 +482,27 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
}
execution.setVariable("failedActivity", "AAI")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
def transactionLoggingUuid = UUID.randomUUID().toString()
def vnfId = execution.getVariable("vnfId")
- AAIResourcesClient client = new AAIResourcesClient()
+ AAIResourcesClient client = new AAIResourcesClient()
AAIUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
Map<String, Boolean> request = new HashMap<>()
request.put("is-closed-loop-disabled", setDisabled)
client.update(genericVnfUri, request)
- msoLogger.debug("set isClosedLoop to: " + setDisabled)
+ logger.debug("set isClosedLoop to: {}", setDisabled)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
- execution.setVariable("errorText", e.getMessage())
+ execution.setVariable("errorText", e.getMessage())
}
}
@@ -512,12 +522,12 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
ApplicationControllerClient appcClient = null
try {
- msoLogger.debug("Running APP-C action: " + action.toString())
+ logger.debug("Running APP-C action: {}", action.toString())
String vnfId = execution.getVariable('vnfId')
String msoRequestId = execution.getVariable('requestId')
execution.setVariable('msoRequestId', msoRequestId)
@@ -557,28 +567,31 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
default:
break
}
- msoLogger.debug("Completed AppC request")
+ logger.debug("Completed AppC request")
int appcCode = appcStatus.getCode()
- msoLogger.debug("AppC status code is: " + appcCode)
- msoLogger.debug("AppC status message is: " + appcStatus.getMessage())
+ logger.debug("AppC status code is: {}", appcCode)
+ logger.debug("AppC status message is: {}", appcStatus.getMessage())
if (support.getCategoryOf(appcStatus) == ApplicationControllerSupport.StatusCategory.ERROR) {
execution.setVariable("errorCode", Integer.toString(appcCode))
execution.setVariable("errorText", appcStatus.getMessage())
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
} catch (java.lang.NoSuchMethodError e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
@@ -598,7 +611,7 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
execution.setVariable("failedActivity", "APP-C")
execution.setVariable("workStep", action)
}
@@ -621,7 +634,7 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
', resultVar=' + resultVar +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
@@ -637,14 +650,15 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
"""
content = utils.formatXml(content)
- msoLogger.debug(resultVar + ' = ' + System.lineSeparator() + content)
+ logger.debug('{} = {}{}', resultVar, System.lineSeparator(), content)
execution.setVariable(resultVar, content)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, 'Internal Error')
}
}
@@ -661,10 +675,10 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
execution.setVariable("workStep", "doUpdateVnfAndModules")
execution.setVariable("failedActivity", "MSO Update VNF")
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
}
@@ -680,7 +694,7 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
', resultVar=' + resultVar +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
def prefix = execution.getVariable('prefix')
@@ -707,14 +721,15 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
</sdncadapterworkflow:FalloutHandlerRequest>
"""
content = utils.formatXml(content)
- msoLogger.debug(resultVar + ' = ' + System.lineSeparator() + content)
+ logger.debug('{} = {}{}', resultVar, System.lineSeparator(), content)
execution.setVariable(resultVar, content)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildWorkflowException(execution, 2000, 'Internal Error')
}
}
@@ -729,7 +744,7 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
def errorText = execution.getVariable("errorText")
def errorCode = execution.getVariable("errorCode")
@@ -747,7 +762,7 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
String retryCountVariableName = execution.getVariable("workStep") + "RetryCount"
execution.setVariable("retryCountVariableName", retryCountVariableName)
@@ -762,52 +777,48 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
retryCount += 1
execution.setVariable(retryCountVariableName, retryCount)
-
- msoLogger.debug("value of " + retryCountVariableName + " is " + retryCount)
- msoLogger.trace('Exited ' + method)
-
-
- }
+
+ logger.debug("value of {} is {}", retryCountVariableName, retryCount)
+ logger.trace('Exited {}', method)
+ }
- public void preProcessRollback (DelegateExecution execution) {
- msoLogger.trace("preProcessRollback ")
+ public void preProcessRollback (DelegateExecution execution) {
+ logger.trace("preProcessRollback ")
try {
Object workflowException = execution.getVariable("WorkflowException");
if (workflowException instanceof WorkflowException) {
- msoLogger.debug("Prev workflowException: " + workflowException.getErrorMessage())
+ logger.debug("Prev workflowException: {}", workflowException.getErrorMessage())
execution.setVariable("prevWorkflowException", workflowException);
//execution.setVariable("WorkflowException", null);
}
} catch (BpmnError e) {
- msoLogger.debug("BPMN Error during preProcessRollback")
+ logger.debug("BPMN Error during preProcessRollback")
} catch(Exception ex) {
- String msg = "Exception in preProcessRollback. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug("Exception in preProcessRollback. {}", ex.getMessage())
}
- msoLogger.trace("Exit preProcessRollback ")
+ logger.trace("Exit preProcessRollback ")
}
public void postProcessRollback (DelegateExecution execution) {
- msoLogger.trace("postProcessRollback ")
+ logger.trace("postProcessRollback ")
String msg = ""
try {
Object workflowException = execution.getVariable("prevWorkflowException");
if (workflowException instanceof WorkflowException) {
- msoLogger.debug("Setting prevException to WorkflowException: ")
+ logger.debug("Setting prevException to WorkflowException: ")
execution.setVariable("WorkflowException", workflowException);
}
} catch (BpmnError b) {
- msoLogger.debug("BPMN Error during postProcessRollback")
+ logger.debug("BPMN Error during postProcessRollback")
throw b;
} catch(Exception ex) {
- msg = "Exception in postProcessRollback. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug("Exception in postProcessRollback. {}", ex.getMessage())
}
- msoLogger.trace("Exit postProcessRollback ")
- }
-
-}
+ logger.trace("Exit postProcessRollback ")
+ }
+
+} \ No newline at end of file
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfConfigUpdate.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfConfigUpdate.groovy
index 89f40ed680..6075f0df96 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfConfigUpdate.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfConfigUpdate.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -19,9 +21,11 @@
package org.onap.so.bpmn.infrastructure.scripts
+import groovy.json.JsonOutput
+import groovy.json.JsonSlurper
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.onap.appc.client.lcm.model.Action;
+import org.onap.appc.client.lcm.model.Action
import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.core.json.JsonUtils
@@ -31,15 +35,14 @@ import org.onap.so.client.aai.entities.uri.AAIUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
-
-import groovy.json.JsonOutput
-import groovy.json.JsonSlurper
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
public class VnfConfigUpdate extends VnfCmBase {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VnfConfigUpdate.class);
+ private static final Logger logger = LoggerFactory.getLogger( VnfConfigUpdate.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
- JsonUtils jsonUtils = new JsonUtils()
+ JsonUtils jsonUtils = new JsonUtils()
def prefix = "VnfIPU_"
/**
@@ -49,9 +52,9 @@ public class VnfConfigUpdate extends VnfCmBase {
*/
public void initProcessVariables(DelegateExecution execution) {
execution.setVariable('prefix', 'VnfCU_')
- execution.setVariable('Request', null)
- execution.setVariable('source', null)
- execution.setVariable('controllerType', null)
+ execution.setVariable('Request', null)
+ execution.setVariable('source', null)
+ execution.setVariable('controllerType', null)
execution.setVariable('UpdateVnfSuccessIndicator', false)
execution.setVariable('serviceType', null)
execution.setVariable('nfRole', null)
@@ -83,56 +86,56 @@ public class VnfConfigUpdate extends VnfCmBase {
')'
initProcessVariables(execution)
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
- initProcessVariables(execution)
+ initProcessVariables(execution)
def incomingRequest = execution.getVariable('bpmnRequest')
- msoLogger.debug("Incoming Infra Request: " + incomingRequest)
+ logger.debug("Incoming Infra Request: {}", incomingRequest)
try {
def jsonSlurper = new JsonSlurper()
def jsonOutput = new JsonOutput()
Map reqMap = jsonSlurper.parseText(incomingRequest)
- msoLogger.debug(" Request is in JSON format.")
+ logger.debug(" Request is in JSON format.")
def serviceInstanceId = execution.getVariable('serviceInstanceId')
def vnfId = execution.getVariable('vnfId')
-
+
execution.setVariable('serviceInstanceId', serviceInstanceId)
- execution.setVariable('vnfId', vnfId)
+ execution.setVariable('vnfId', vnfId)
execution.setVariable('serviceType', 'Mobility')
execution.setVariable('payload', "")
execution.setVariable('actionHealthCheck', Action.HealthCheck)
- execution.setVariable('actionConfigModify', Action.ConfigModify)
-
+ execution.setVariable('actionConfigModify', Action.ConfigModify)
+
def controllerType = reqMap.requestDetails?.requestParameters?.controllerType
execution.setVariable('controllerType', controllerType)
-
- msoLogger.debug('Controller Type: ' + controllerType)
-
+
+ logger.debug('Controller Type: {}', controllerType)
+
def payload = reqMap.requestDetails?.requestParameters?.payload
execution.setVariable('payload', payload)
-
- msoLogger.debug('Processed payload: ' + payload)
-
+
+ logger.debug('Processed payload: {}', payload)
+
def requestId = execution.getVariable("mso-request-id")
execution.setVariable('requestId', requestId)
- execution.setVariable('msoRequestId', requestId)
-
+ execution.setVariable('msoRequestId', requestId)
+
def requestorId = reqMap.requestDetails?.requestInfo?.requestorId ?: null
execution.setVariable('requestorId', requestorId)
-
+
execution.setVariable('sdncVersion', '1702')
execution.setVariable("UpdateVnfInfraSuccessIndicator", false)
-
-
+
+
def source = reqMap.requestDetails?.requestInfo?.source
execution.setVariable("source", source)
-
+
//For Completion Handler & Fallout Handler
String requestInfo =
"""<request-info xmlns="http://org.onap/so/infra/vnf-request/v1">
@@ -140,24 +143,25 @@ public class VnfConfigUpdate extends VnfCmBase {
<action>UPDATE</action>
<source>${MsoUtils.xmlEscape(source)}</source>
</request-info>"""
-
- execution.setVariable("requestInfo", requestInfo)
-
- msoLogger.debug('RequestInfo: ' + execution.getVariable("requestInfo"))
-
- msoLogger.trace('Exited ' + method)
+
+ execution.setVariable("requestInfo", requestInfo)
+
+ logger.debug('RequestInfo: {}', execution.getVariable("requestInfo"))
+
+ logger.trace('Exited {}', method)
}
catch(groovy.json.JsonException je) {
- msoLogger.debug(" Request is not in JSON format.")
+ logger.debug(" Request is not in JSON format.")
exceptionUtil.buildAndThrowWorkflowException(execution, 5000, "Invalid request format")
}
catch(Exception e) {
String restFaultMessage = e.getMessage()
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, " Exception Encountered - " + "\n" + restFaultMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Exception Encountered - \n {} \n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), restFaultMessage, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 5000, restFaultMessage)
- }
+ }
}
/**
@@ -170,7 +174,7 @@ public class VnfConfigUpdate extends VnfCmBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
@@ -192,16 +196,17 @@ public class VnfConfigUpdate extends VnfCmBase {
sendWorkflowResponse(execution, 200, synchResponse)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendResponse(): ' + e.getMessage())
}
- }
-
-
+ }
+
+
/**
* Check if this VNF is already in maintenance in A&AI.
*
@@ -216,7 +221,7 @@ public class VnfConfigUpdate extends VnfCmBase {
execution.setVariable('errorCode', "0")
execution.setVariable("workStep", "checkIfVnfInMaintInAAI")
execution.setVariable("failedActivity", "AAI")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
AAIRestClientImpl client = new AAIRestClientImpl()
@@ -224,26 +229,27 @@ public class VnfConfigUpdate extends VnfCmBase {
aaiValidator.setClient(client)
def vnfId = execution.getVariable("vnfId")
boolean isInMaint = aaiValidator.isVNFLocked(vnfId)
- msoLogger.debug("isInMaint result: " + isInMaint)
+ logger.debug("isInMaint result: {}", isInMaint)
execution.setVariable('isVnfInMaintenance', isInMaint)
-
+
if (isInMaint) {
execution.setVariable("errorCode", "1003")
execution.setVariable("errorText", "VNF is in maintenance in A&AI")
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
//exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfVnfInMaintInAAI(): ' + e.getMessage())
}
}
-
-
+
+
/**
* Check if this VNF's pservers are locked in A&AI.
*
@@ -256,7 +262,7 @@ public class VnfConfigUpdate extends VnfCmBase {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
execution.setVariable("workStep", "checkIfPserversInMaintInAAI")
execution.setVariable("failedActivity", "AAI")
@@ -264,28 +270,28 @@ public class VnfConfigUpdate extends VnfCmBase {
AAIRestClientImpl client = new AAIRestClientImpl()
AAIValidatorImpl aaiValidator = new AAIValidatorImpl()
aaiValidator.setClient(client)
- def vnfId = execution.getVariable("vnfId")
+ def vnfId = execution.getVariable("vnfId")
boolean areLocked = aaiValidator.isPhysicalServerLocked(vnfId)
- msoLogger.debug("areLocked result: " + areLocked)
+ logger.debug("areLocked result: {}", areLocked)
execution.setVariable('arePserversLocked', areLocked)
-
+
if (areLocked) {
execution.setVariable("errorCode", "1003")
execution.setVariable("errorText", "pServers are locked in A&AI")
}
-
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
//exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfPserversInMaintInAAI(): ' + e.getMessage())
}
}
-
+
/**
* Set inMaint flag for this VNF to the specified value in A&AI.
*
@@ -299,7 +305,7 @@ public class VnfConfigUpdate extends VnfCmBase {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
if (inMaint) {
execution.setVariable("workStep", "setVnfInMaintFlagInAAI")
execution.setVariable("rollbackSetVnfInMaintenanceFlag", true)
@@ -321,17 +327,18 @@ public class VnfConfigUpdate extends VnfCmBase {
else {
aaiUpdator.updateVnfToUnLocked(vnfId)
}
-
- msoLogger.trace('Exited ' + method)
+
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
}
}
-
+
/**
* Check if VF Closed Loop Disabled in A&AI.
*
@@ -346,37 +353,38 @@ public class VnfConfigUpdate extends VnfCmBase {
execution.setVariable('errorCode', "0")
execution.setVariable("workStep", "checkClosedLoopDisabledFlagInAAI")
execution.setVariable("failedActivity", "AAI")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
def transactionLoggingUuid = UUID.randomUUID().toString()
def vnfId = execution.getVariable("vnfId")
- msoLogger.debug("vnfId is: " + vnfId)
- AAIResourcesClient client = new AAIResourcesClient()
+ logger.debug("vnfId is: {}", vnfId)
+ AAIResourcesClient client = new AAIResourcesClient()
AAIUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
AAIResultWrapper aaiRW = client.get(genericVnfUri)
Map<String, Object> result = aaiRW.asMap()
boolean isClosedLoopDisabled = result.getOrDefault("is-closed-loop-disabled", false)
-
- msoLogger.debug("isClosedLoopDisabled result: " + isClosedLoopDisabled)
+
+ logger.debug("isClosedLoopDisabled result: {}", isClosedLoopDisabled)
execution.setVariable('isClosedLoopDisabled', isClosedLoopDisabled)
-
+
if (isClosedLoopDisabled) {
execution.setVariable("errorCode", "1004")
execution.setVariable("errorText", "closedLoop is disabled in A&AI")
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
//exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfVnfInMaintInAAI(): ' + e.getMessage())
}
}
-
+
/**
* Set VF Closed Loop Disabled Flag in A&AI.
*
@@ -396,52 +404,52 @@ public class VnfConfigUpdate extends VnfCmBase {
else {
execution.setVariable("workStep", "unsetClosedLoopDisabledFlagInAAI")
}
-
+
execution.setVariable("failedActivity", "AAI")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
def transactionLoggingUuid = UUID.randomUUID().toString()
def vnfId = execution.getVariable("vnfId")
- AAIResourcesClient client = new AAIResourcesClient()
+ AAIResourcesClient client = new AAIResourcesClient()
AAIUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
-
+
Map<String, Boolean> request = new HashMap<>()
request.put("is-closed-loop-disabled", setDisabled)
client.update(genericVnfUri, request)
- msoLogger.debug("set isClosedLoop to: " + setDisabled)
+ logger.debug("set isClosedLoop to: {}", setDisabled)
-
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {}\n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
//exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfVnfInMaintInAAI(): ' + e.getMessage())
}
- }
+ }
+
-
/**
* Handle Abort disposition from RainyDayHandler
*
- * @param execution The flow's execution instance.
+ * @param execution The flow's execution instance.
*/
public void abortProcessing(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.abortProcessing(' +
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
-
+ logger.trace('Entered {}', method)
+
def errorText = execution.getVariable("errorText")
def errorCode = execution.getVariable("errorCode")
-
+
exceptionUtil.buildAndThrowWorkflowException(execution, errorCode as Integer, errorText)
}
-
+
/**
* Increment Retry Count for Current Work Step
*
@@ -452,28 +460,24 @@ public class VnfConfigUpdate extends VnfCmBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
-
+ logger.trace('Entered {}', method)
+
String retryCountVariableName = execution.getVariable("workStep") + "RetryCount"
execution.setVariable("retryCountVariableName", retryCountVariableName)
-
+
def retryCountVariable = execution.getVariable(retryCountVariableName)
int retryCount = 0
-
+
if (retryCountVariable != null) {
retryCount = (int) retryCountVariable
- }
-
+ }
+
retryCount += 1
-
+
execution.setVariable(retryCountVariableName, retryCount)
-
- msoLogger.debug("value of " + retryCountVariableName + " is " + retryCount)
- msoLogger.trace('Exited ' + method)
-
-
- }
-
-
-
+
+ logger.debug("value of {} is {}", retryCountVariableName, retryCount)
+ logger.trace('Exited {}', method)
+ }
+
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfInPlaceUpdate.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfInPlaceUpdate.groovy
index 84668a5c61..cd89d2a2ef 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfInPlaceUpdate.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfInPlaceUpdate.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -19,6 +21,8 @@
package org.onap.so.bpmn.infrastructure.scripts
+import groovy.json.JsonOutput
+import groovy.json.JsonSlurper
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.onap.appc.client.lcm.model.Action
@@ -32,16 +36,15 @@ import org.onap.so.client.aai.*
import org.onap.so.client.aai.entities.AAIResultWrapper
import org.onap.so.client.aai.entities.uri.AAIUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
-import org.onap.so.client.appc.ApplicationControllerClient;
-import org.onap.so.client.appc.ApplicationControllerSupport;
+import org.onap.so.client.appc.ApplicationControllerClient
+import org.onap.so.client.appc.ApplicationControllerSupport
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
-
-import groovy.json.JsonOutput
-import groovy.json.JsonSlurper
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
public class VnfInPlaceUpdate extends VnfCmBase {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VnfInPlaceUpdate.class);
+ private static final Logger logger = LoggerFactory.getLogger(VnfInPlaceUpdate.class)
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtils = new JsonUtils()
@@ -90,18 +93,18 @@ public class VnfInPlaceUpdate extends VnfCmBase {
')'
initProcessVariables(execution)
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
initProcessVariables(execution)
def incomingRequest = execution.getVariable('bpmnRequest')
- msoLogger.debug("Incoming Infra Request: " + incomingRequest)
+ logger.debug("Incoming Infra Request: {}", incomingRequest)
try {
def jsonSlurper = new JsonSlurper()
def jsonOutput = new JsonOutput()
Map reqMap = jsonSlurper.parseText(incomingRequest)
- msoLogger.debug(" Request is in JSON format.")
+ logger.debug(" Request is in JSON format.")
def serviceInstanceId = execution.getVariable('serviceInstanceId')
def vnfId = execution.getVariable('vnfId')
@@ -124,14 +127,13 @@ public class VnfInPlaceUpdate extends VnfCmBase {
def controllerType = reqMap.requestDetails?.requestParameters?.controllerType
execution.setVariable('controllerType', controllerType)
-
- msoLogger.debug('Controller Type: ' + controllerType)
+
+ logger.debug('Controller Type: {}', controllerType)
def payload = reqMap.requestDetails?.requestParameters?.payload
execution.setVariable('payload', payload)
- msoLogger.debug('Processed payload: ' + payload)
-
+ logger.debug('Processed payload: {}', payload)
def requestId = execution.getVariable("mso-request-id")
execution.setVariable('requestId', requestId)
@@ -165,18 +167,19 @@ public class VnfInPlaceUpdate extends VnfCmBase {
execution.setVariable("requestInfo", requestInfo)
- msoLogger.debug('RequestInfo: ' + execution.getVariable("requestInfo"))
+ logger.debug('RequestInfo: {}', execution.getVariable("requestInfo"))
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
}
catch(groovy.json.JsonException je) {
- msoLogger.debug(" Request is not in JSON format.")
+ logger.debug(" Request is not in JSON format.")
exceptionUtil.buildAndThrowWorkflowException(execution, 5000, "Invalid request format")
}
catch(Exception e) {
String restFaultMessage = e.getMessage()
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, " Exception Encountered - " + "\n" + restFaultMessage, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Exception Encountered - {} \n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), restFaultMessage, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 5000, restFaultMessage)
}
}
@@ -191,8 +194,7 @@ public class VnfInPlaceUpdate extends VnfCmBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
-
+ logger.trace('Entered {}', method)
try {
def requestInfo = execution.getVariable('requestInfo')
@@ -213,11 +215,12 @@ public class VnfInPlaceUpdate extends VnfCmBase {
sendWorkflowResponse(execution, 200, synchResponse)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {} \n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendResponse(): ' + e.getMessage())
}
}
@@ -237,7 +240,7 @@ public class VnfInPlaceUpdate extends VnfCmBase {
execution.setVariable('errorCode', "0")
execution.setVariable("workStep", "checkIfVnfInMaintInAAI")
execution.setVariable("failedActivity", "AAI")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
try {
AAIRestClientImpl client = new AAIRestClientImpl()
@@ -245,7 +248,7 @@ public class VnfInPlaceUpdate extends VnfCmBase {
aaiValidator.setClient(client)
def vnfId = execution.getVariable("vnfId")
boolean isInMaint = aaiValidator.isVNFLocked(vnfId)
- msoLogger.debug("isInMaint result: " + isInMaint)
+ logger.debug("isInMaint result: {}", isInMaint)
execution.setVariable('isVnfInMaintenance', isInMaint)
if (isInMaint) {
@@ -254,11 +257,12 @@ public class VnfInPlaceUpdate extends VnfCmBase {
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {} \n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
//exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfVnfInMaintInAAI(): ' + e.getMessage())
@@ -278,7 +282,7 @@ public class VnfInPlaceUpdate extends VnfCmBase {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
execution.setVariable("workStep", "checkIfPserversInMaintInAAI")
execution.setVariable("failedActivity", "AAI")
@@ -288,7 +292,7 @@ public class VnfInPlaceUpdate extends VnfCmBase {
aaiValidator.setClient(client)
def vnfId = execution.getVariable("vnfId")
boolean areLocked = aaiValidator.isPhysicalServerLocked(vnfId)
- msoLogger.debug("areLocked result: " + areLocked)
+ logger.debug("areLocked result: {}", areLocked)
execution.setVariable('arePserversLocked', areLocked)
if (areLocked) {
@@ -296,11 +300,12 @@ public class VnfInPlaceUpdate extends VnfCmBase {
execution.setVariable("errorText", "pServers are locked in A&AI")
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} Caught exception in {} \n ", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), method, e)
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
//exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in checkIfPserversInMaintInAAI(): ' + e.getMessage())
@@ -320,7 +325,7 @@ public class VnfInPlaceUpdate extends VnfCmBase {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered {}', method)
if (inMaint) {
execution.setVariable("workStep", "setVnfInMaintFlagInAAI")
}
@@ -342,11 +347,11 @@ public class VnfInPlaceUpdate extends VnfCmBase {
aaiUpdator.updateVnfToUnLocked(vnfId)
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited {}', method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
}
@@ -366,19 +371,19 @@ public class VnfInPlaceUpdate extends VnfCmBase {
execution.setVariable('errorCode', "0")
execution.setVariable("workStep", "checkClosedLoopDisabledFlagInAAI")
execution.setVariable("failedActivity", "AAI")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def transactionLoggingUuid = UUID.randomUUID().toString()
def vnfId = execution.getVariable("vnfId")
- msoLogger.debug("vnfId is: " + vnfId)
+ logger.debug("vnfId is: " + vnfId)
AAIResourcesClient client = new AAIResourcesClient()
AAIUri genericVnfUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
AAIResultWrapper aaiRW = client.get(genericVnfUri)
Map<String, Object> result = aaiRW.asMap()
boolean isClosedLoopDisabled = result.getOrDefault("is-closed-loop-disabled", false)
- msoLogger.debug("isClosedLoopDisabled result: " + isClosedLoopDisabled)
+ logger.debug("isClosedLoopDisabled result: " + isClosedLoopDisabled)
execution.setVariable('isClosedLoopDisabled', isClosedLoopDisabled)
if (isClosedLoopDisabled) {
@@ -386,11 +391,11 @@ public class VnfInPlaceUpdate extends VnfCmBase {
execution.setVariable("errorText", "closedLoop is disabled in A&AI")
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
}
@@ -417,7 +422,7 @@ public class VnfInPlaceUpdate extends VnfCmBase {
}
execution.setVariable("failedActivity", "AAI")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
try {
def transactionLoggingUuid = UUID.randomUUID().toString()
@@ -428,13 +433,13 @@ public class VnfInPlaceUpdate extends VnfCmBase {
Map<String, Boolean> request = new HashMap<>()
request.put("is-closed-loop-disabled", setDisabled)
client.update(genericVnfUri, request)
- msoLogger.debug("set isClosedLoop to: " + setDisabled)
+ logger.debug("set isClosedLoop to: " + setDisabled)
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
}
@@ -456,12 +461,12 @@ public class VnfInPlaceUpdate extends VnfCmBase {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
ApplicationControllerClient appcClient = null
try {
- msoLogger.debug("Running APP-C action: " + action.toString())
+ logger.debug("Running APP-C action: " + action.toString())
String vnfId = execution.getVariable('vnfId')
String msoRequestId = execution.getVariable('requestId')
execution.setVariable('msoRequestId', msoRequestId)
@@ -501,26 +506,26 @@ public class VnfInPlaceUpdate extends VnfCmBase {
default:
break
}
- msoLogger.debug("Completed AppC request")
+ logger.debug("Completed AppC request")
int appcCode = appcStatus.getCode()
- msoLogger.debug("AppC status code is: " + appcCode)
- msoLogger.debug("AppC status message is: " + appcStatus.getMessage())
+ logger.debug("AppC status code is: " + appcCode)
+ logger.debug("AppC status message is: " + appcStatus.getMessage())
if (support.getCategoryOf(appcStatus) == ApplicationControllerSupport.StatusCategory.ERROR) {
execution.setVariable("errorCode", Integer.toString(appcCode))
execution.setVariable("errorText", appcStatus.getMessage())
}
- msoLogger.trace('Exited ' + method)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
} catch (java.lang.NoSuchMethodError e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
}
@@ -539,7 +544,7 @@ public class VnfInPlaceUpdate extends VnfCmBase {
')'
execution.setVariable('errorCode', "0")
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
execution.setVariable("failedActivity", "APP-C")
execution.setVariable("workStep", action)
}
@@ -556,7 +561,7 @@ public class VnfInPlaceUpdate extends VnfCmBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
def errorText = execution.getVariable("errorText")
def errorCode = execution.getVariable("errorCode")
@@ -574,7 +579,7 @@ public class VnfInPlaceUpdate extends VnfCmBase {
'execution=' + execution.getId() +
')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
String retryCountVariableName = execution.getVariable("workStep") + "RetryCount"
execution.setVariable("retryCountVariableName", retryCountVariableName)
@@ -590,8 +595,8 @@ public class VnfInPlaceUpdate extends VnfCmBase {
execution.setVariable(retryCountVariableName, retryCount)
- msoLogger.debug("value of " + retryCountVariableName + " is " + retryCount)
- msoLogger.trace('Exited ' + method)
+ logger.debug("value of " + retryCountVariableName + " is " + retryCount)
+ logger.trace('Exited ' + method)
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
index 13d5aad2b0..0af1bcb00e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -33,7 +35,9 @@ import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
-import org.springframework.web.util.UriUtils;
+import org.springframework.web.util.UriUtils
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import groovy.json.*
@@ -46,7 +50,7 @@ import groovy.json.*
*
*/
public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CreateVcpeResCustService.class);
+ private static final Logger logger = LoggerFactory.getLogger(CreateVcpeResCustService.class);
private static final String DebugFlag = "isDebugLogEnabled"
@@ -90,7 +94,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
def isDebugEnabled = execution.getVariable(DebugFlag)
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside preProcessRequest CreateVcpeResCustService Request ")
+ logger.trace("Inside preProcessRequest CreateVcpeResCustService Request ")
try {
// initialize flow variables
@@ -100,15 +104,15 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
String aaiDistDelay = UrnPropertiesReader.getVariable("aai.workflowAaiDistributionDelay", execution)
if (isBlank(aaiDistDelay)) {
String msg = "workflowAaiDistributionDelay is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("aaiDistDelay", aaiDistDelay)
- msoLogger.debug("AAI distribution delay: " + aaiDistDelay)
+ logger.debug("AAI distribution delay: " + aaiDistDelay)
// check for incoming json message/input
String createVcpeServiceRequest = execution.getVariable("bpmnRequest")
- msoLogger.debug(createVcpeServiceRequest)
+ logger.debug(createVcpeServiceRequest)
execution.setVariable("createVcpeServiceRequest", createVcpeServiceRequest);
println 'createVcpeServiceRequest - ' + createVcpeServiceRequest
@@ -120,18 +124,18 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
if ((serviceInstanceId == null) || (serviceInstanceId.isEmpty())) {
serviceInstanceId = UUID.randomUUID().toString()
- msoLogger.debug(" Generated new Service Instance: " + serviceInstanceId)
+ logger.debug(" Generated new Service Instance: " + serviceInstanceId)
} else {
- msoLogger.debug("Using provided Service Instance ID: " + serviceInstanceId)
+ logger.debug("Using provided Service Instance ID: " + serviceInstanceId)
}
serviceInstanceId = UriUtils.encode(serviceInstanceId, "UTF-8")
execution.setVariable("serviceInstanceId", serviceInstanceId)
- utils.log("DEBUG", "Incoming serviceInstanceId is: " + serviceInstanceId, isDebugEnabled)
+ logger.debug("Incoming serviceInstanceId is: " + serviceInstanceId)
String serviceInstanceName = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.requestInfo.instanceName")
execution.setVariable("serviceInstanceName", serviceInstanceName)
- utils.log("DEBUG", "Incoming serviceInstanceName is: " + serviceInstanceName, isDebugEnabled)
+ logger.debug("Incoming serviceInstanceName is: " + serviceInstanceName)
String requestAction = execution.getVariable("requestAction")
execution.setVariable("requestAction", requestAction)
@@ -160,19 +164,19 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
// extract subscriptionServiceType
String subscriptionServiceType = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.requestParameters.subscriptionServiceType")
execution.setVariable("subscriptionServiceType", subscriptionServiceType)
- msoLogger.debug("Incoming subscriptionServiceType is: " + subscriptionServiceType)
+ logger.debug("Incoming subscriptionServiceType is: " + subscriptionServiceType)
String suppressRollback = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.requestInfo.suppressRollback")
execution.setVariable("disableRollback", suppressRollback)
- msoLogger.debug("Incoming Suppress/Disable Rollback is: " + suppressRollback)
+ logger.debug("Incoming Suppress/Disable Rollback is: " + suppressRollback)
String productFamilyId = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.requestInfo.productFamilyId")
execution.setVariable("productFamilyId", productFamilyId)
- msoLogger.debug("Incoming productFamilyId is: " + productFamilyId)
+ logger.debug("Incoming productFamilyId is: " + productFamilyId)
String subscriberInfo = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.subscriberInfo")
execution.setVariable("subscriberInfo", subscriberInfo)
- msoLogger.debug("Incoming subscriberInfo is: " + subscriberInfo)
+ logger.debug("Incoming subscriberInfo is: " + subscriberInfo)
// extract cloud configuration - if underscore "_" is present treat as vimId else it's a cloudRegion
String vimId = jsonUtil.getJsonValue(createVcpeServiceRequest,
@@ -182,21 +186,21 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
def cloudOwner = cloudRegion[0]
def cloudRegionId = cloudRegion[1]
execution.setVariable("cloudOwner", cloudOwner)
- msoLogger.debug("cloudOwner: " + cloudOwner)
+ logger.debug("cloudOwner: " + cloudOwner)
execution.setVariable("cloudRegionId", cloudRegionId)
- msoLogger.debug("cloudRegionId: " + cloudRegionId)
+ logger.debug("cloudRegionId: " + cloudRegionId)
} else {
- msoLogger.debug("vimId is not present - setting cloudRegion/cloudOwner from request.")
+ logger.debug("vimId is not present - setting cloudRegion/cloudOwner from request.")
String cloudOwner = jsonUtil.getJsonValue(createVcpeServiceRequest,
"requestDetails.cloudConfiguration.cloudOwner")
if (!cloudOwner?.empty && cloudOwner != "")
{
execution.setVariable("cloudOwner", cloudOwner)
- msoLogger.debug("cloudOwner: " + cloudOwner)
+ logger.debug("cloudOwner: " + cloudOwner)
}
def cloudRegionId = vimId
execution.setVariable("cloudRegionId", cloudRegionId)
- msoLogger.debug("cloudRegionId: " + cloudRegionId)
+ logger.debug("cloudRegionId: " + cloudRegionId)
}
/*
* Extracting User Parameters from incoming Request and converting into a Map
@@ -222,8 +226,8 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
execution.setVariable("customerLocation", customerMap)
}
if ("Homing_Model_Ids".equals(userParam?.name)) {
- utils.log("DEBUG", "Homing_Model_Ids: " + userParam.value.toString() + " ---- Type is:" +
- userParam.value.getClass() , isDebugEnabled)
+ logger.debug("Homing_Model_Ids: " + userParam.value.toString() + " ---- Type is:" +
+ userParam.value.getClass())
def modelIdLst = []
userParam.value.each {
param ->
@@ -233,8 +237,8 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
valueMap.put(entry.key, entry.value)
}
modelIdLst.add(valueMap)
- utils.log("DEBUG", "Param: " + param.toString() + " ---- Type is:" +
- param.getClass() , isDebugEnabled)
+ logger.debug("Param: " + param.toString() + " ---- Type is:" +
+ param.getClass())
}
execution.setVariable("homingModelIds", modelIdLst)
}
@@ -252,7 +256,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
inputMap.put("orchestrator", userParam.value)
}
if ("VfModuleNames".equals(userParam?.name)) {
- utils.log("DEBUG", "VfModuleNames: " + userParam.value.toString(), isDebugEnabled)
+ logger.debug("VfModuleNames: " + userParam.value.toString())
def vfModuleNames = [:]
userParam.value.each {
entry ->
@@ -269,8 +273,8 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
if (vfModuleModelInvariantUuid != null && !vfModuleModelInvariantUuid.isEmpty() && vfModuleName != null && !vfModuleName.isEmpty()) {
vfModuleNames.put(vfModuleModelInvariantUuid, vfModuleName)
- utils.log("DEBUG", "VfModuleModelInvariantUuid: " + vfModuleModelInvariantUuid + " VfModuleName: " + vfModuleName, isDebugEnabled)
- }
+ logger.debug("VfModuleModelInvariantUuid: " + vfModuleModelInvariantUuid + " VfModuleName: " + vfModuleName)
+ }
}
execution.setVariable("vfModuleNames", vfModuleNames)
}
@@ -282,10 +286,10 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
execution.setVariable("homingService", "oof")
}
- msoLogger.debug("User Input Parameters map: " + userParams.toString())
+ logger.debug("User Input Parameters map: " + userParams.toString())
execution.setVariable("serviceInputParams", inputMap) // DOES NOT SEEM TO BE USED
- msoLogger.debug("Incoming brgWanMacAddress is: " + execution.getVariable('brgWanMacAddress'))
+ logger.debug("Incoming brgWanMacAddress is: " + execution.getVariable('brgWanMacAddress'))
//For Completion Handler & Fallout Handler
String requestInfo =
@@ -297,7 +301,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
execution.setVariable(Prefix + "requestInfo", requestInfo)
- msoLogger.trace("Completed preProcessRequest CreateVcpeResCustService Request ")
+ logger.trace("Completed preProcessRequest CreateVcpeResCustService Request ")
} catch (BpmnError e) {
throw e;
@@ -310,7 +314,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
public void sendSyncResponse(DelegateExecution execution) {
- msoLogger.trace("Inside sendSyncResponse of CreateVcpeResCustService ")
+ logger.trace("Inside sendSyncResponse of CreateVcpeResCustService ")
try {
String serviceInstanceId = execution.getVariable("serviceInstanceId")
@@ -321,7 +325,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
requestId
}"}}""".trim()
- msoLogger.debug(" sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse)
+ logger.debug(" sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse)
sendWorkflowResponse(execution, 202, syncResponse)
} catch (Exception ex) {
@@ -336,7 +340,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
public void prepareDecomposeService(DelegateExecution execution) {
try {
- msoLogger.trace("Inside prepareDecomposeService of CreateVcpeResCustService ")
+ logger.trace("Inside prepareDecomposeService of CreateVcpeResCustService ")
String createVcpeServiceRequest = execution.getVariable("createVcpeServiceRequest")
@@ -344,7 +348,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
String serviceModelInfo = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.modelInfo")
execution.setVariable("serviceModelInfo", serviceModelInfo)
- msoLogger.trace("Completed prepareDecomposeService of CreateVcpeResCustService ")
+ logger.trace("Completed prepareDecomposeService of CreateVcpeResCustService ")
} catch (Exception ex) {
// try error in method block
String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. Unexpected Error from method prepareDecomposeService() - " + ex.getMessage()
@@ -358,7 +362,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
public void prepareCreateServiceInstance(DelegateExecution execution) {
try {
- msoLogger.trace("Inside prepareCreateServiceInstance of CreateVcpeResCustService ")
+ logger.trace("Inside prepareCreateServiceInstance of CreateVcpeResCustService ")
/*
* Service modelInfo is created in earlier step. This flow can use it as-is ... or, extract from DecompositionObject
@@ -377,7 +381,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
execution.setVariable("serviceDecompositionString", serviceDecomposition.toJsonStringNoRootName())
- msoLogger.trace("Completed prepareCreateServiceInstance of CreateVcpeResCustService ")
+ logger.trace("Completed prepareCreateServiceInstance of CreateVcpeResCustService ")
} catch (Exception ex) {
// try error in method block
String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. Unexpected Error from method prepareCreateServiceInstance() - " + ex.getMessage()
@@ -387,7 +391,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
public void postProcessServiceInstanceCreate(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.postProcessServiceInstanceCreate(' + 'execution=' + execution.getId() + ')'
- msoLogger.trace('Entered ' + method)
+ logger.trace('Entered ' + method)
String requestId = execution.getVariable("mso-request-id")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
@@ -409,13 +413,15 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
</soapenv:Envelope>
"""
execution.setVariable(Prefix + "setUpdateDbInstancePayload", payload)
- msoLogger.debug(Prefix + "setUpdateDbInstancePayload: " + payload)
- msoLogger.trace('Exited ' + method)
+ logger.debug(Prefix + "setUpdateDbInstancePayload: " + payload)
+ logger.trace('Exited ' + method)
} catch (BpmnError e) {
throw e;
} catch (Exception e) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error - Occured in" + method)
}
}
@@ -423,7 +429,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
public void processDecomposition(DelegateExecution execution) {
- msoLogger.trace("Inside processDecomposition() of CreateVcpeResCustService ")
+ logger.trace("Inside processDecomposition() of CreateVcpeResCustService ")
try {
@@ -440,7 +446,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
String vnfModelInfoString = ""
if (vnfList != null && vnfList.size() > 0) {
execution.setVariable(Prefix + "VNFsCount", vnfList.size())
- msoLogger.debug("vnfs to create: " + vnfList.size())
+ logger.debug("vnfs to create: " + vnfList.size())
ModelInfo vnfModelInfo = vnfList[0].getModelInfo()
vnfModelInfoString = vnfModelInfo.toString()
@@ -448,18 +454,18 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
vnfModelInfoString = jsonUtil.getJsonValue(vnfModelInfoWithRoot, "modelInfo")
} else {
execution.setVariable(Prefix + "VNFsCount", 0)
- msoLogger.debug("no vnfs to create based upon serviceDecomposition content")
+ logger.debug("no vnfs to create based upon serviceDecomposition content")
}
execution.setVariable("vnfModelInfo", vnfModelInfoString)
execution.setVariable("vnfModelInfoString", vnfModelInfoString)
- msoLogger.debug(" vnfModelInfoString :" + vnfModelInfoString)
+ logger.debug(" vnfModelInfoString :" + vnfModelInfoString)
- msoLogger.trace("Completed processDecomposition() of CreateVcpeResCustService ")
+ logger.trace("Completed processDecomposition() of CreateVcpeResCustService ")
} catch (Exception ex) {
sendSyncError(execution)
String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. processDecomposition() - " + ex.getMessage()
- msoLogger.debug(exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
}
@@ -486,7 +492,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
public void prepareCreateAllottedResourceTXC(DelegateExecution execution) {
try {
- msoLogger.trace("Inside prepareCreateAllottedResourceTXC of CreateVcpeResCustService ")
+ logger.trace("Inside prepareCreateAllottedResourceTXC of CreateVcpeResCustService ")
/*
* Service modelInfo is created in earlier step. This flow can use it as-is ... or, extract from DecompositionObject
@@ -506,8 +512,8 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
while (iter.hasNext()) {
AllottedResource allottedResource = (AllottedResource) iter.next();
- msoLogger.debug(" getting model info for AllottedResource # :" + allottedResource.toJsonStringNoRootName())
- msoLogger.debug(" allottedResource.getAllottedResourceType() :" + allottedResource.getAllottedResourceType())
+ logger.debug(" getting model info for AllottedResource # :" + allottedResource.toJsonStringNoRootName())
+ logger.debug(" allottedResource.getAllottedResourceType() :" + allottedResource.getAllottedResourceType())
if ("TunnelXConn".equalsIgnoreCase(allottedResource.getAllottedResourceType()) || "Tunnel XConn".equalsIgnoreCase(allottedResource.getAllottedResourceType())) {
//set create flag to true
execution.setVariable("createTXCAR", true)
@@ -525,9 +531,9 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
//unit test only
String allottedResourceId = execution.getVariable("allottedResourceId")
execution.setVariable("allottedResourceIdTXC", allottedResourceId)
- msoLogger.debug("setting allottedResourceId CreateVcpeResCustService " + allottedResourceId)
+ logger.debug("setting allottedResourceId CreateVcpeResCustService " + allottedResourceId)
- msoLogger.trace("Completed prepareCreateAllottedResourceTXC of CreateVcpeResCustService ")
+ logger.trace("Completed prepareCreateAllottedResourceTXC of CreateVcpeResCustService ")
} catch (Exception ex) {
// try error in method block
String exceptionMessage = "Bpmn error encountered in prepareCreateAllottedResourceTXC flow. Unexpected Error from method prepareCreateServiceInstance() - " + ex.getMessage()
@@ -538,7 +544,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
public void prepareCreateAllottedResourceBRG(DelegateExecution execution) {
try {
- msoLogger.trace("Inside prepareCreateAllottedResourceBRG of CreateVcpeResCustService ")
+ logger.trace("Inside prepareCreateAllottedResourceBRG of CreateVcpeResCustService ")
/*
* Service modelInfo is created in earlier step. This flow can use it as-is ... or, extract from DecompositionObject
@@ -558,8 +564,8 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
while (iter.hasNext()) {
AllottedResource allottedResource = (AllottedResource) iter.next();
- msoLogger.debug(" getting model info for AllottedResource # :" + allottedResource.toJsonStringNoRootName())
- msoLogger.debug(" allottedResource.getAllottedResourceType() :" + allottedResource.getAllottedResourceType())
+ logger.debug(" getting model info for AllottedResource # :" + allottedResource.toJsonStringNoRootName())
+ logger.debug(" allottedResource.getAllottedResourceType() :" + allottedResource.getAllottedResourceType())
if ("BRG".equalsIgnoreCase(allottedResource.getAllottedResourceType())) {
//set create flag to true
execution.setVariable("createBRGAR", true)
@@ -577,9 +583,9 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
//unit test only
String allottedResourceId = execution.getVariable("allottedResourceId")
execution.setVariable("allottedResourceIdBRG", allottedResourceId)
- msoLogger.debug("setting allottedResourceId CreateVcpeResCustService " + allottedResourceId)
+ logger.debug("setting allottedResourceId CreateVcpeResCustService " + allottedResourceId)
- msoLogger.trace("Completed prepareCreateAllottedResourceBRG of CreateVcpeResCustService ")
+ logger.trace("Completed prepareCreateAllottedResourceBRG of CreateVcpeResCustService ")
} catch (Exception ex) {
// try error in method block
String exceptionMessage = "Bpmn error encountered in prepareCreateAllottedResourceBRG flow. Unexpected Error from method prepareCreateServiceInstance() - " + ex.getMessage()
@@ -593,7 +599,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
public void prepareVnfAndModulesCreate(DelegateExecution execution) {
try {
- msoLogger.trace("Inside prepareVnfAndModulesCreate of CreateVcpeResCustService ")
+ logger.trace("Inside prepareVnfAndModulesCreate of CreateVcpeResCustService ")
// String disableRollback = execution.getVariable("disableRollback")
// def backoutOnFailure = ""
@@ -609,7 +615,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
String createVcpeServiceRequest = execution.getVariable("createVcpeServiceRequest")
String productFamilyId = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.requestInfo.productFamilyId")
execution.setVariable("productFamilyId", productFamilyId)
- msoLogger.debug("productFamilyId: " + productFamilyId)
+ logger.debug("productFamilyId: " + productFamilyId)
List<VnfResource> vnfList = execution.getVariable("vnfList")
@@ -617,9 +623,9 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
String vnfModelInfoString = null;
if (vnfList != null && vnfList.size() > 0) {
- msoLogger.debug("getting model info for vnf # " + vnfsCreatedCount)
+ logger.debug("getting model info for vnf # " + vnfsCreatedCount)
ModelInfo vnfModelInfo1 = vnfList[0].getModelInfo()
- msoLogger.debug("got 0 ")
+ logger.debug("got 0 ")
ModelInfo vnfModelInfo = vnfList[vnfsCreatedCount.intValue()].getModelInfo()
vnfModelInfoString = vnfModelInfo.toString()
} else {
@@ -627,7 +633,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
vnfModelInfoString = execution.getVariable("vnfModelInfo")
}
- msoLogger.debug(" vnfModelInfoString :" + vnfModelInfoString)
+ logger.debug(" vnfModelInfoString :" + vnfModelInfoString)
// extract cloud configuration - if underscore "_" is present treat as vimId else it's a cloudRegion
String vimId = jsonUtil.getJsonValue(createVcpeServiceRequest,
@@ -635,35 +641,35 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
if (vimId.contains("_") && vimId.split("_").length == 2 ) {
def cloudRegion = vimId.split("_")
execution.setVariable("cloudOwner", cloudRegion[0])
- msoLogger.debug("cloudOwner: " + cloudRegion[0])
+ logger.debug("cloudOwner: " + cloudRegion[0])
execution.setVariable("cloudRegionId", cloudRegion[1])
- msoLogger.debug("cloudRegionId: " + cloudRegion[1])
+ logger.debug("cloudRegionId: " + cloudRegion[1])
execution.setVariable("lcpCloudRegionId", cloudRegion[1])
- msoLogger.debug("lcpCloudRegionId: " + cloudRegion[1])
+ logger.debug("lcpCloudRegionId: " + cloudRegion[1])
} else {
- msoLogger.debug("vimId is not present - setting cloudRegion/cloudOwner from request.")
+ logger.debug("vimId is not present - setting cloudRegion/cloudOwner from request.")
String cloudOwner = jsonUtil.getJsonValue(createVcpeServiceRequest,
"requestDetails.cloudConfiguration.cloudOwner")
if (!cloudOwner?.empty && cloudOwner != "")
{
execution.setVariable("cloudOwner", cloudOwner)
- msoLogger.debug("cloudOwner: " + cloudOwner)
+ logger.debug("cloudOwner: " + cloudOwner)
}
execution.setVariable("cloudRegionId", vimId)
- msoLogger.debug("cloudRegionId: " + vimId)
+ logger.debug("cloudRegionId: " + vimId)
execution.setVariable("lcpCloudRegionId", vimId)
- msoLogger.debug("lcpCloudRegionId: " + vimId)
+ logger.debug("lcpCloudRegionId: " + vimId)
}
String tenantId = jsonUtil.getJsonValue(createVcpeServiceRequest,
"requestDetails.cloudConfiguration.tenantId")
execution.setVariable("tenantId", tenantId)
- msoLogger.debug("tenantId: " + tenantId)
+ logger.debug("tenantId: " + tenantId)
String sdncVersion = execution.getVariable("sdncVersion")
- msoLogger.debug("sdncVersion: " + sdncVersion)
+ logger.debug("sdncVersion: " + sdncVersion)
- msoLogger.trace("Completed prepareVnfAndModulesCreate of CreateVcpeResCustService ")
+ logger.trace("Completed prepareVnfAndModulesCreate of CreateVcpeResCustService ")
} catch (Exception ex) {
// try error in method block
String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. Unexpected Error from method prepareVnfAndModulesCreate() - " + ex.getMessage()
@@ -677,14 +683,14 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
public void validateVnfCreate(DelegateExecution execution) {
try {
- msoLogger.trace("Inside validateVnfCreate of CreateVcpeResCustService ")
+ logger.trace("Inside validateVnfCreate of CreateVcpeResCustService ")
Integer vnfsCreatedCount = execution.getVariable(Prefix + "VnfsCreatedCount")
vnfsCreatedCount++
execution.setVariable(Prefix + "VnfsCreatedCount", vnfsCreatedCount)
- msoLogger.debug(" ***** Completed validateVnfCreate of CreateVcpeResCustService ***** " + " vnf # " + vnfsCreatedCount)
+ logger.debug(" ***** Completed validateVnfCreate of CreateVcpeResCustService ***** " + " vnf # " + vnfsCreatedCount)
} catch (Exception ex) {
// try error in method block
String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. Unexpected Error from method validateVnfCreate() - " + ex.getMessage()
@@ -697,7 +703,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
// *****************************************
public void postProcessResponse(DelegateExecution execution) {
- msoLogger.trace("Inside postProcessResponse of CreateVcpeResCustService ")
+ logger.trace("Inside postProcessResponse of CreateVcpeResCustService ")
try {
String source = execution.getVariable("source")
@@ -720,10 +726,10 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
// Format Response
String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
- msoLogger.debug(xmlMsoCompletionRequest)
+ logger.debug(xmlMsoCompletionRequest)
execution.setVariable(Prefix + "Success", true)
execution.setVariable(Prefix + "CompleteMsoProcessRequest", xmlMsoCompletionRequest)
- msoLogger.debug(" SUCCESS flow, going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
+ logger.debug(" SUCCESS flow, going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
} catch (BpmnError e) {
throw e;
} catch (Exception ex) {
@@ -734,53 +740,53 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
}
public void preProcessRollback(DelegateExecution execution) {
- msoLogger.trace("preProcessRollback of CreateVcpeResCustService ")
+ logger.trace("preProcessRollback of CreateVcpeResCustService ")
try {
Object workflowException = execution.getVariable("WorkflowException");
if (workflowException instanceof WorkflowException) {
- msoLogger.debug("Prev workflowException: " + workflowException.getErrorMessage())
+ logger.debug("Prev workflowException: " + workflowException.getErrorMessage())
execution.setVariable("prevWorkflowException", workflowException);
//execution.setVariable("WorkflowException", null);
}
} catch (BpmnError e) {
- msoLogger.debug("BPMN Error during preProcessRollback")
+ logger.debug("BPMN Error during preProcessRollback")
} catch (Exception ex) {
String msg = "Exception in preProcessRollback. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
- msoLogger.trace("Exit preProcessRollback of CreateVcpeResCustService ")
+ logger.trace("Exit preProcessRollback of CreateVcpeResCustService ")
}
public void postProcessRollback(DelegateExecution execution) {
- msoLogger.trace("postProcessRollback of CreateVcpeResCustService ")
+ logger.trace("postProcessRollback of CreateVcpeResCustService ")
String msg = ""
try {
Object workflowException = execution.getVariable("prevWorkflowException");
if (workflowException instanceof WorkflowException) {
- msoLogger.debug("Setting prevException to WorkflowException: ")
+ logger.debug("Setting prevException to WorkflowException: ")
execution.setVariable("WorkflowException", workflowException);
}
} catch (BpmnError b) {
- msoLogger.debug("BPMN Error during postProcessRollback")
+ logger.debug("BPMN Error during postProcessRollback")
throw b;
} catch (Exception ex) {
msg = "Exception in postProcessRollback. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
- msoLogger.trace("Exit postProcessRollback of CreateVcpeResCustService ")
+ logger.trace("Exit postProcessRollback of CreateVcpeResCustService ")
}
public void prepareFalloutRequest(DelegateExecution execution) {
- msoLogger.trace("STARTED CreateVcpeResCustService prepareFalloutRequest Process ")
+ logger.trace("STARTED CreateVcpeResCustService prepareFalloutRequest Process ")
try {
WorkflowException wfex = execution.getVariable("WorkflowException")
- msoLogger.debug(" Incoming Workflow Exception: " + wfex.toString())
+ logger.debug(" Incoming Workflow Exception: " + wfex.toString())
String requestInfo = execution.getVariable(Prefix + "requestInfo")
- msoLogger.debug(" Incoming Request Info: " + requestInfo)
+ logger.debug(" Incoming Request Info: " + requestInfo)
//TODO. hmmm. there is no way to UPDATE error message.
// String errorMessage = wfex.getErrorMessage()
@@ -796,17 +802,17 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
execution.setVariable(Prefix + "falloutRequest", falloutRequest)
} catch (Exception ex) {
- msoLogger.debug("Error Occured in CreateVcpeResCustService prepareFalloutRequest Process " + ex.getMessage())
+ logger.debug("Error Occured in CreateVcpeResCustService prepareFalloutRequest Process " + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVcpeResCustService prepareFalloutRequest Process")
}
- msoLogger.trace("COMPLETED CreateVcpeResCustService prepareFalloutRequest Process ")
+ logger.trace("COMPLETED CreateVcpeResCustService prepareFalloutRequest Process ")
}
public void sendSyncError(DelegateExecution execution) {
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Inside sendSyncError() of CreateVcpeResCustService ")
+ logger.trace("Inside sendSyncError() of CreateVcpeResCustService ")
try {
String errorMessage = ""
@@ -823,31 +829,33 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
<aetgt:ErrorCode>7000</aetgt:ErrorCode>
</aetgt:WorkflowException>"""
- msoLogger.debug(buildworkflowException)
+ logger.debug(buildworkflowException)
sendWorkflowResponse(execution, 500, buildworkflowException)
} catch (Exception ex) {
- msoLogger.debug(" Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
+ logger.debug(" Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
}
}
public void processJavaException(DelegateExecution execution) {
execution.setVariable("prefix", Prefix)
try {
- msoLogger.debug("Caught a Java Exception")
- msoLogger.debug("Started processJavaException Method")
- msoLogger.debug("Variables List: " + execution.getVariables())
+ logger.debug("Caught a Java Exception")
+ logger.debug("Started processJavaException Method")
+ logger.debug("Variables List: " + execution.getVariables())
execution.setVariable(Prefix + "unexpectedError", "Caught a Java Lang Exception")
// Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Caught a Java Lang Exception")
} catch (BpmnError b) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Rethrowing MSOWorkflowException", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "");
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Rethrowing MSOWorkflowException", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue());
throw b
} catch (Exception e) {
- msoLogger.debug("Caught Exception during processJavaException Method: " + e)
+ logger.debug("Caught Exception during processJavaException Method: " + e)
execution.setVariable(Prefix + "unexpectedError", "Exception in processJavaException method")
// Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Exception in processJavaException method")
}
- msoLogger.debug("Completed processJavaException Method")
+ logger.debug("Completed processJavaException Method")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy
index 7a40ef978b..75f5ec9161 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -29,6 +31,8 @@ import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import org.onap.so.client.aai.AAIResourcesClient
import org.onap.so.client.aai.AAIObjectType
@@ -45,7 +49,7 @@ import javax.ws.rs.NotFoundException
*
*/
public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DeleteVcpeResCustService.class);
+ private static final Logger logger = LoggerFactory.getLogger(DeleteVcpeResCustService.class);
private static final String DebugFlag = "isDebugLogEnabled"
@@ -79,7 +83,7 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable(DebugFlag)
execution.setVariable("prefix",Prefix)
- msoLogger.trace("Inside preProcessRequest DeleteVcpeResCustService Request ")
+ logger.trace("Inside preProcessRequest DeleteVcpeResCustService Request ")
try {
// initialize flow variables
@@ -87,7 +91,7 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
// check for incoming json message/input
String DeleteVcpeResCustServiceRequest = execution.getVariable("bpmnRequest")
- msoLogger.debug(DeleteVcpeResCustServiceRequest)
+ logger.debug(DeleteVcpeResCustServiceRequest)
execution.setVariable("DeleteVcpeResCustServiceRequest", DeleteVcpeResCustServiceRequest);
println 'DeleteVcpeResCustServiceRequest - ' + DeleteVcpeResCustServiceRequest
@@ -120,34 +124,34 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
String suppressRollback = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.requestInfo.suppressRollback")
execution.setVariable("disableRollback", suppressRollback)
- msoLogger.debug("Incoming Suppress/Disable Rollback is: " + suppressRollback)
+ logger.debug("Incoming Suppress/Disable Rollback is: " + suppressRollback)
String productFamilyId = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.requestInfo.productFamilyId")
execution.setVariable("productFamilyId", productFamilyId)
- msoLogger.debug("Incoming productFamilyId is: " + productFamilyId)
+ logger.debug("Incoming productFamilyId is: " + productFamilyId)
// extract subscriptionServiceType
String subscriptionServiceType = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.requestParameters.subscriptionServiceType")
execution.setVariable("subscriptionServiceType", subscriptionServiceType)
- msoLogger.debug("Incoming subscriptionServiceType is: " + subscriptionServiceType)
+ logger.debug("Incoming subscriptionServiceType is: " + subscriptionServiceType)
// extract cloud configuration
String cloudConfiguration = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.cloudConfiguration")
execution.setVariable("cloudConfiguration", cloudConfiguration)
- msoLogger.debug("cloudConfiguration: "+ cloudConfiguration)
+ logger.debug("cloudConfiguration: "+ cloudConfiguration)
String lcpCloudRegionId = jsonUtil.getJsonValue(cloudConfiguration, "lcpCloudRegionId")
execution.setVariable("lcpCloudRegionId", lcpCloudRegionId)
- msoLogger.debug("lcpCloudRegionId: "+ lcpCloudRegionId)
+ logger.debug("lcpCloudRegionId: "+ lcpCloudRegionId)
String cloudOwner = jsonUtil.getJsonValue(cloudConfiguration, "cloudOwner")
execution.setVariable("cloudOwner", cloudOwner)
- msoLogger.debug("cloudOwner: "+ cloudOwner)
+ logger.debug("cloudOwner: "+ cloudOwner)
String tenantId = jsonUtil.getJsonValue(cloudConfiguration, "tenantId")
execution.setVariable("tenantId", tenantId)
- msoLogger.debug("tenantId: "+ tenantId)
+ logger.debug("tenantId: "+ tenantId)
String sdncVersion = "1707"
execution.setVariable("sdncVersion", sdncVersion)
- msoLogger.debug("sdncVersion: "+ sdncVersion)
+ logger.debug("sdncVersion: "+ sdncVersion)
//For Completion Handler & Fallout Handler
String requestInfo =
@@ -159,7 +163,7 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
execution.setVariable(Prefix+"requestInfo", requestInfo)
- msoLogger.trace("Completed preProcessRequest DeleteVcpeResCustServiceRequest Request ")
+ logger.trace("Completed preProcessRequest DeleteVcpeResCustServiceRequest Request ")
} catch (BpmnError e) {
throw e;
@@ -172,7 +176,7 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
public void sendSyncResponse(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable(DebugFlag)
- msoLogger.trace("Inside sendSyncResponse of DeleteVcpeResCustService ")
+ logger.trace("Inside sendSyncResponse of DeleteVcpeResCustService ")
try {
String serviceInstanceId = execution.getVariable("serviceInstanceId")
@@ -181,7 +185,7 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
// RESTResponse (for API Handler (APIH) Reply Task)
String syncResponse ="""{"requestReferences":{"instanceId":"${serviceInstanceId}","requestId":"${requestId}"}}""".trim()
- msoLogger.debug(" sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse)
+ logger.debug(" sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse)
sendWorkflowResponse(execution, 202, syncResponse)
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in DeleteVcpeResCustService flow. Unexpected from method preProcessRequest() - " + ex.getMessage()
@@ -225,23 +229,23 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
def id = jsonUtil.getJsonValue(ar, "id")
if(type == "TunnelXConn" || type == "Tunnel XConn") {
- msoLogger.debug("TunnelXConn AR found")
+ logger.debug("TunnelXConn AR found")
TXC_found = true
TXC_id = id
}else if(type == "BRG") {
- msoLogger.debug("BRG AR found")
+ logger.debug("BRG AR found")
BRG_found = true
BRG_id = id
}
execution.setVariable(Prefix+"TunnelXConn", TXC_found)
execution.setVariable("TXC_allottedResourceId", TXC_id)
- msoLogger.debug("TXC_allottedResourceId: " + TXC_id)
+ logger.debug("TXC_allottedResourceId: " + TXC_id)
execution.setVariable(Prefix+"BRG", BRG_found)
execution.setVariable("BRG_allottedResourceId", BRG_id)
- msoLogger.debug("BRG_allottedResourceId: " + BRG_id)
+ logger.debug("BRG_allottedResourceId: " + BRG_id)
}
}
@@ -258,11 +262,11 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
}catch(BpmnError e) {
throw e;
}catch(NotFoundException e) {
- msoLogger.debug("Service Instance does not exist AAI")
+ logger.debug("Service Instance does not exist AAI")
exceptionUtil.buildAndThrowWorkflowException(execution, 404, "Service Instance was not found in aai")
}catch(Exception ex) {
String msg = "Internal Error in getServiceInstance: " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -273,7 +277,7 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
// *******************************
public void prepareVnfAndModulesDelete (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable(DebugFlag)
- msoLogger.trace("Inside prepareVnfAndModulesDelete of DeleteVcpeResCustService ")
+ logger.trace("Inside prepareVnfAndModulesDelete of DeleteVcpeResCustService ")
try {
List vnfList = execution.getVariable(Prefix+"relatedVnfIdList")
@@ -285,9 +289,9 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
}
execution.setVariable("vnfId", vnfId)
- msoLogger.debug("need to delete vnfId:" + vnfId)
+ logger.debug("need to delete vnfId:" + vnfId)
- msoLogger.trace("Completed prepareVnfAndModulesDelete of DeleteVcpeResCustService ")
+ logger.trace("Completed prepareVnfAndModulesDelete of DeleteVcpeResCustService ")
} catch (Exception ex) {
// try error in method block
String exceptionMessage = "Bpmn error encountered in DeleteVcpeResCustService flow. Unexpected Error from method prepareVnfAndModulesDelete() - " + ex.getMessage()
@@ -300,7 +304,7 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
// *******************************
public void validateVnfDelete (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable(DebugFlag)
- msoLogger.trace("Inside validateVnfDelete of DeleteVcpeResCustService ")
+ logger.trace("Inside validateVnfDelete of DeleteVcpeResCustService ")
try {
int vnfsDeletedCount = execution.getVariable(Prefix+"vnfsDeletedCount")
@@ -308,7 +312,7 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
execution.setVariable(Prefix+"vnfsDeletedCount", vnfsDeletedCount)
- msoLogger.debug(" ***** Completed validateVnfDelete of DeleteVcpeResCustService ***** "+" vnf # "+vnfsDeletedCount)
+ logger.debug(" ***** Completed validateVnfDelete of DeleteVcpeResCustService ***** "+" vnf # "+vnfsDeletedCount)
} catch (Exception ex) {
// try error in method block
String exceptionMessage = "Bpmn error encountered in DeleteVcpeResCustService flow. Unexpected Error from method validateVnfDelete() - " + ex.getMessage()
@@ -322,7 +326,7 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
// *****************************************
public void postProcessResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable(DebugFlag)
- msoLogger.trace("Inside postProcessResponse of DeleteVcpeResCustService ")
+ logger.trace("Inside postProcessResponse of DeleteVcpeResCustService ")
try {
String source = execution.getVariable("source")
@@ -343,10 +347,10 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
// Format Response
String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
- msoLogger.debug(xmlMsoCompletionRequest)
+ logger.debug(xmlMsoCompletionRequest)
execution.setVariable(Prefix+"Success", true)
execution.setVariable(Prefix+"CompleteMsoProcessRequest", xmlMsoCompletionRequest)
- msoLogger.debug(" SUCCESS flow, going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
+ logger.debug(" SUCCESS flow, going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
} catch (BpmnError e) {
throw e;
@@ -359,28 +363,28 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
public void prepareFalloutRequest(DelegateExecution execution){
def isDebugEnabled=execution.getVariable(DebugFlag)
- msoLogger.trace("STARTED DeleteVcpeResCustService prepareFalloutRequest Process ")
+ logger.trace("STARTED DeleteVcpeResCustService prepareFalloutRequest Process ")
try {
WorkflowException wfex = execution.getVariable("WorkflowException")
- msoLogger.debug(" Incoming Workflow Exception: " + wfex.toString())
+ logger.debug(" Incoming Workflow Exception: " + wfex.toString())
String requestInfo = execution.getVariable(Prefix+"requestInfo")
- msoLogger.debug(" Incoming Request Info: " + requestInfo)
+ logger.debug(" Incoming Request Info: " + requestInfo)
String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
execution.setVariable(Prefix+"falloutRequest", falloutRequest)
} catch (Exception ex) {
- msoLogger.debug("Error Occured in DeleteVcpeResCustService prepareFalloutRequest Process " + ex.getMessage())
+ logger.debug("Error Occured in DeleteVcpeResCustService prepareFalloutRequest Process " + ex.getMessage())
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DeleteVcpeResCustService prepareFalloutRequest Process")
}
- msoLogger.trace("COMPLETED DeleteVcpeResCustService prepareFalloutRequest Process ")
+ logger.trace("COMPLETED DeleteVcpeResCustService prepareFalloutRequest Process ")
}
public void sendSyncError (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable(DebugFlag)
- msoLogger.trace("Inside sendSyncError() of DeleteVcpeResCustService ")
+ logger.trace("Inside sendSyncError() of DeleteVcpeResCustService ")
try {
String errorMessage = ""
@@ -397,10 +401,10 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
<aetgt:ErrorCode>7000</aetgt:ErrorCode>
</aetgt:WorkflowException>"""
- msoLogger.debug(buildworkflowException)
+ logger.debug(buildworkflowException)
sendWorkflowResponse(execution, 500, buildworkflowException)
} catch (Exception ex) {
- msoLogger.debug(" Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
+ logger.debug(" Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
}
}
@@ -408,20 +412,22 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable(DebugFlag)
execution.setVariable("prefix",Prefix)
try{
- msoLogger.debug("Caught a Java Exception")
- msoLogger.debug("Started processJavaException Method")
- msoLogger.debug("Variables List: " + execution.getVariables())
+ logger.debug("Caught a Java Exception")
+ logger.debug("Started processJavaException Method")
+ logger.debug("Variables List: " + execution.getVariables())
execution.setVariable(Prefix+"unexpectedError", "Caught a Java Lang Exception") // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Caught a Java Lang Exception")
}catch(BpmnError b){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Rethrowing MSOWorkflowException", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "");
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Rethrowing MSOWorkflowException", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue());
throw b
}catch(Exception e){
- msoLogger.debug("Caught Exception during processJavaException Method: " + e)
+ logger.debug("Caught Exception during processJavaException Method: " + e)
execution.setVariable(Prefix+"unexpectedError", "Exception in processJavaException method") // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Exception in processJavaException method")
}
- msoLogger.debug("Completed processJavaException Method")
+ logger.debug("Completed processJavaException Method")
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy
index e7baccd460..db8c993533 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -34,6 +36,8 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import javax.ws.rs.NotFoundException
import javax.ws.rs.core.UriBuilder
@@ -71,7 +75,7 @@ import static org.apache.commons.lang3.StringUtils.isBlank
*
*/
public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateAllottedResourceBRG.class);
+ private static final Logger logger = LoggerFactory.getLogger(DoCreateAllottedResourceBRG.class);
String Prefix="DCARBRG_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -81,7 +85,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
String msg = ""
- msoLogger.trace("start preProcessRequest")
+ logger.trace("start preProcessRequest")
try {
execution.setVariable("prefix", Prefix)
@@ -90,78 +94,78 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
String sdncCallbackUrl = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution)
if (isBlank(sdncCallbackUrl)) {
msg = "mso.workflow.sdncadapter.callback is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
- msoLogger.debug("SDNC Callback URL: " + sdncCallbackUrl)
+ logger.debug("SDNC Callback URL: " + sdncCallbackUrl)
String sdncReplDelay = UrnPropertiesReader.getVariable("mso.workflow.sdnc.replication.delay",execution)
if (isBlank(sdncReplDelay)) {
msg = "mso.workflow.sdnc.replication.delay is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("sdncReplDelay", sdncReplDelay)
- msoLogger.debug("SDNC replication delay: " + sdncReplDelay)
+ logger.debug("SDNC replication delay: " + sdncReplDelay)
//Request Inputs
if (isBlank(execution.getVariable("serviceInstanceId"))){
msg = "Input serviceInstanceId is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(execution.getVariable("parentServiceInstanceId"))) {
msg = "Input parentServiceInstanceId is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(execution.getVariable("allottedResourceModelInfo"))) {
msg = "Input allottedResourceModelInfo is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(execution.getVariable("vni"))) {
msg = "Input vni is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(execution.getVariable("vgmuxBearerIP"))) {
msg = "Input vgmuxBearerIP is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(execution.getVariable("brgWanMacAddress"))) {
msg = "Input brgWanMacAddress is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(execution.getVariable("allottedResourceRole"))) {
msg = "Input allottedResourceRole is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(execution.getVariable("allottedResourceType"))) {
msg = "Input allottedResourceType is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
}catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end preProcessRequest")
+ logger.trace("end preProcessRequest")
}
/**
* Gets the service instance uri from aai
*/
public void getServiceInstance(DelegateExecution execution) {
- msoLogger.trace("getServiceInstance ")
+ logger.trace("getServiceInstance ")
try {
String serviceInstanceId = execution.getVariable('serviceInstanceId')
@@ -178,16 +182,16 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
throw e;
}catch (Exception ex){
String msg = "Exception in getServiceInstance. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit getServiceInstance ")
+ logger.trace("Exit getServiceInstance ")
}
public void getAaiAR (DelegateExecution execution) {
- msoLogger.trace("start getAaiAR")
+ logger.trace("start getAaiAR")
String arType = execution.getVariable("allottedResourceType")
String arRole = execution.getVariable("allottedResourceRole")
@@ -216,14 +220,14 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
}
}
if (!isBlank(errorMsg)) {
- msoLogger.debug(errorMsg)
+ logger.debug(errorMsg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, errorMsg)
}
- msoLogger.trace("end getAaiAR")
+ logger.trace("end getAaiAR")
}
public void getParentServiceInstance(DelegateExecution execution) {
- msoLogger.trace("getParentServiceInstance ")
+ logger.trace("getParentServiceInstance ")
try {
String serviceInstanceId = execution.getVariable('parentServiceInstanceId')
@@ -242,17 +246,17 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
throw e;
}catch (Exception ex){
String msg = "Exception in getParentServiceInstance. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit getParentServiceInstance ")
+ logger.trace("Exit getParentServiceInstance ")
}
public void createAaiAR(DelegateExecution execution) {
- msoLogger.trace("start createAaiAR")
+ logger.trace("start createAaiAR")
String allottedResourceId = execution.getVariable("allottedResourceId")
if (isBlank(allottedResourceId))
@@ -297,14 +301,14 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
rollbackData.put(Prefix, "serviceInstanceId", execution.getVariable("serviceInstanceId"))
rollbackData.put(Prefix, "parentServiceInstanceId", execution.getVariable("parentServiceInstanceId"))
execution.setVariable("rollbackData", rollbackData)
- msoLogger.trace("end createAaiAR")
+ logger.trace("end createAaiAR")
}
public String buildSDNCRequest(DelegateExecution execution, String action, String sdncRequestId) {
String msg = ""
- msoLogger.trace("start buildSDNCRequest")
+ logger.trace("start buildSDNCRequest")
String sdncReq = null
try {
@@ -392,15 +396,15 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
</sdncadapterworkflow:SDNCRequestData>
</sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
- msoLogger.debug("sdncRequest:\n" + sdncReq)
+ logger.debug("sdncRequest:\n" + sdncReq)
sdncReq = utils.formatXml(sdncReq)
} catch(Exception ex) {
msg = "Exception in buildSDNCRequest. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end buildSDNCRequest")
+ logger.trace("end buildSDNCRequest")
return sdncReq
}
@@ -408,110 +412,110 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
String msg = ""
- msoLogger.trace("start preProcessSDNCAssign")
+ logger.trace("start preProcessSDNCAssign")
try {
String sdncRequestId = UUID.randomUUID().toString()
String sdncAssignReq = buildSDNCRequest(execution, "assign", sdncRequestId)
execution.setVariable("sdncAssignRequest", sdncAssignReq)
- msoLogger.debug("sdncAssignRequest: " + sdncAssignReq)
+ logger.debug("sdncAssignRequest: " + sdncAssignReq)
def sdncRequestId2 = UUID.randomUUID().toString()
String sdncAssignRollbackReq = sdncAssignReq.replace(">assign<", ">unassign<").replace(">CreateBRGInstance<", ">DeleteBRGInstance<").replace(">${sdncRequestId}<", ">${sdncRequestId2}<")
def rollbackData = execution.getVariable("rollbackData")
rollbackData.put(Prefix, "sdncAssignRollbackReq", sdncAssignRollbackReq)
execution.setVariable("rollbackData", rollbackData)
- msoLogger.debug("sdncAssignRollbackReq:\n" + sdncAssignRollbackReq)
- msoLogger.debug("rollbackData:\n" + rollbackData.toString())
+ logger.debug("sdncAssignRollbackReq:\n" + sdncAssignRollbackReq)
+ logger.debug("rollbackData:\n" + rollbackData.toString())
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in preProcessSDNCAssign. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end preProcessSDNCAssign")
+ logger.trace("end preProcessSDNCAssign")
}
public void preProcessSDNCCreate(DelegateExecution execution) {
String msg = ""
- msoLogger.trace("start preProcessSDNCCreate")
+ logger.trace("start preProcessSDNCCreate")
try {
String sdncRequestId = UUID.randomUUID().toString()
String sdncCreateReq = buildSDNCRequest(execution, "create", sdncRequestId)
execution.setVariable("sdncCreateRequest", sdncCreateReq)
- msoLogger.debug("sdncCreateReq: " + sdncCreateReq)
+ logger.debug("sdncCreateReq: " + sdncCreateReq)
def sdncRequestId2 = UUID.randomUUID().toString()
String sdncCreateRollbackReq = sdncCreateReq.replace(">create<", ">delete<").replace(">CreateBRGInstance<", ">DeleteBRGInstance<").replace(">${sdncRequestId}<", ">${sdncRequestId2}<")
def rollbackData = execution.getVariable("rollbackData")
rollbackData.put(Prefix, "sdncCreateRollbackReq", sdncCreateRollbackReq)
execution.setVariable("rollbackData", rollbackData)
- msoLogger.debug("sdncCreateRollbackReq:\n" + sdncCreateRollbackReq)
- msoLogger.debug("rollbackData:\n" + rollbackData.toString())
+ logger.debug("sdncCreateRollbackReq:\n" + sdncCreateRollbackReq)
+ logger.debug("rollbackData:\n" + rollbackData.toString())
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in preProcessSDNCCreate. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end preProcessSDNCCreate")
+ logger.trace("end preProcessSDNCCreate")
}
public void preProcessSDNCActivate(DelegateExecution execution) {
String msg = ""
- msoLogger.trace("start preProcessSDNCActivate")
+ logger.trace("start preProcessSDNCActivate")
try {
String sdncRequestId = UUID.randomUUID().toString()
String sdncActivateReq = buildSDNCRequest(execution, "activate", sdncRequestId)
execution.setVariable("sdncActivateRequest", sdncActivateReq)
- msoLogger.debug("sdncActivateReq: " + sdncActivateReq)
+ logger.debug("sdncActivateReq: " + sdncActivateReq)
def sdncRequestId2 = UUID.randomUUID().toString()
String sdncActivateRollbackReq = sdncActivateReq.replace(">activate<", ">deactivate<").replace(">CreateBRGInstance<", ">DeleteBRGInstance<").replace(">${sdncRequestId}<", ">${sdncRequestId2}<")
def rollbackData = execution.getVariable("rollbackData")
rollbackData.put(Prefix, "sdncActivateRollbackReq", sdncActivateRollbackReq)
execution.setVariable("rollbackData", rollbackData)
- msoLogger.debug("sdncActivateRollbackReq:\n" + sdncActivateRollbackReq)
- msoLogger.debug("rollbackData:\n" + rollbackData.toString())
+ logger.debug("sdncActivateRollbackReq:\n" + sdncActivateRollbackReq)
+ logger.debug("rollbackData:\n" + rollbackData.toString())
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in preProcessSDNCActivate. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end preProcessSDNCActivate")
+ logger.trace("end preProcessSDNCActivate")
}
public void validateSDNCResp(DelegateExecution execution, String response, String method){
- msoLogger.trace("ValidateSDNCResponse Process")
+ logger.trace("ValidateSDNCResponse Process")
String msg = ""
try {
WorkflowException workflowException = execution.getVariable("WorkflowException")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.debug("SDNCResponse: " + response)
+ logger.debug("SDNCResponse: " + response)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
- msoLogger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + response)
+ logger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + response)
if (!"get".equals(method))
{
@@ -521,22 +525,22 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
}
}else{
- msoLogger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
+ logger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
throw new BpmnError("MSOWorkflowException")
}
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in validateSDNCResp. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("End ValidateSDNCResp Process")
+ logger.trace("End ValidateSDNCResp Process")
}
public void preProcessSDNCGet(DelegateExecution execution){
- msoLogger.trace("start preProcessSDNCGet")
+ logger.trace("start preProcessSDNCGet")
try{
def callbackUrl = execution.getVariable("sdncCallbackUrl")
@@ -548,15 +552,15 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
if (execution.getVariable("foundActiveAR")) {
def aaiQueryResponse = execution.getVariable("aaiARGetResponse")
serviceOperation = utils.getNodeText(aaiQueryResponse, "selflink")
- msoLogger.debug("AR service operation/aaiARSelfLink: " + serviceOperation)
+ logger.debug("AR service operation/aaiARSelfLink: " + serviceOperation)
}
else
{
String response = execution.getVariable("sdncAssignResponse")
String data = utils.getNodeXml(response, "response-data")
- msoLogger.debug("Assign responseData: " + data)
+ logger.debug("Assign responseData: " + data)
serviceOperation = utils.getNodeText(data, "object-path")
- msoLogger.debug("AR service operation:" + serviceOperation)
+ logger.debug("AR service operation:" + serviceOperation)
}
String serviceInstanceId = execution.getVariable("serviceInstanceId")
@@ -581,28 +585,30 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
execution.setVariable("sdncGetRequest", SDNCGetRequest)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occurred Processing preProcessSDNCGetRequest.", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occurred Processing preProcessSDNCGetRequest.", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during SDNC GET Method:\n" + e.getMessage())
}
- msoLogger.trace("end preProcessSDNCGet")
+ logger.trace("end preProcessSDNCGet")
}
public void updateAaiAROrchStatus(DelegateExecution execution, String status){
- msoLogger.trace("start updateAaiAROrchStatus")
+ logger.trace("start updateAaiAROrchStatus")
String aaiARPath = execution.getVariable("aaiARPath") //set during query (existing AR) or create
AllottedResourceUtils arUtils = new AllottedResourceUtils(this)
String orchStatus = arUtils.updateAROrchStatus(execution, status, aaiARPath)
- msoLogger.trace("end updateAaiAROrchStatus")
+ logger.trace("end updateAaiAROrchStatus")
}
public void generateOutputs(DelegateExecution execution)
{
- msoLogger.trace("start generateOutputs")
+ logger.trace("start generateOutputs")
try {
String sdncGetResponse = execution.getVariable("enhancedCallbackRequestData") //unescaped
- msoLogger.debug("resp:" + sdncGetResponse)
+ logger.debug("resp:" + sdncGetResponse)
String arData = utils.getNodeXml(sdncGetResponse, "brg-topology")
arData = utils.removeXmlNamespaces(arData)
@@ -610,55 +616,55 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
String ari = utils.getNodeXml(arData, "allotted-resource-identifiers")
execution.setVariable("allotedResourceName", utils.getNodeText(ari, "allotted-resource-name"))
} catch (BpmnError e) {
- msoLogger.debug("BPMN Error in generateOutputs ")
+ logger.debug("BPMN Error in generateOutputs ")
} catch(Exception ex) {
String msg = "Exception in generateOutputs " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
- msoLogger.trace("end generateOutputs")
+ logger.trace("end generateOutputs")
}
public void preProcessRollback (DelegateExecution execution) {
- msoLogger.trace("start preProcessRollback")
+ logger.trace("start preProcessRollback")
try {
Object workflowException = execution.getVariable("WorkflowException");
if (workflowException instanceof WorkflowException) {
- msoLogger.debug("Prev workflowException: " + workflowException.getErrorMessage())
+ logger.debug("Prev workflowException: " + workflowException.getErrorMessage())
execution.setVariable("prevWorkflowException", workflowException);
//execution.setVariable("WorkflowException", null);
}
} catch (BpmnError e) {
- msoLogger.debug("BPMN Error during preProcessRollback")
+ logger.debug("BPMN Error during preProcessRollback")
} catch(Exception ex) {
String msg = "Exception in preProcessRollback. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
- msoLogger.trace("end preProcessRollback")
+ logger.trace("end preProcessRollback")
}
public void postProcessRollback (DelegateExecution execution) {
- msoLogger.trace("start postProcessRollback")
+ logger.trace("start postProcessRollback")
String msg = ""
try {
Object workflowException = execution.getVariable("prevWorkflowException");
if (workflowException instanceof WorkflowException) {
- msoLogger.debug("Setting prevException to WorkflowException: ")
+ logger.debug("Setting prevException to WorkflowException: ")
execution.setVariable("WorkflowException", workflowException);
}
execution.setVariable("rollbackData", null)
} catch (BpmnError b) {
- msoLogger.debug("BPMN Error during postProcessRollback")
+ logger.debug("BPMN Error during postProcessRollback")
throw b;
} catch(Exception ex) {
msg = "Exception in postProcessRollback. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
- msoLogger.trace("end postProcessRollback")
+ logger.trace("end postProcessRollback")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy
index 856c893b47..03f795cadf 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -30,6 +32,8 @@ import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import static org.apache.commons.lang3.StringUtils.isBlank
@@ -50,7 +54,7 @@ import static org.apache.commons.lang3.StringUtils.isBlank
*
*/
public class DoCreateAllottedResourceBRGRollback extends AbstractServiceTaskProcessor{
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateAllottedResourceBRGRollback.class);
+ private static final Logger logger = LoggerFactory.getLogger(DoCreateAllottedResourceBRGRollback.class);
String Prefix="DCARBRGRB_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -59,13 +63,13 @@ public class DoCreateAllottedResourceBRGRollback extends AbstractServiceTaskProc
String msg = ""
- msoLogger.trace("start preProcessRequest")
+ logger.trace("start preProcessRequest")
execution.setVariable("prefix", Prefix)
String rbType = "DCARBRG_"
try {
def rollbackData = execution.getVariable("rollbackData")
- msoLogger.debug("RollbackData:" + rollbackData)
+ logger.debug("RollbackData:" + rollbackData)
if (rollbackData != null) {
if (rollbackData.hasType(rbType)) {
@@ -90,9 +94,9 @@ public class DoCreateAllottedResourceBRGRollback extends AbstractServiceTaskProc
execution.setVariable("deleteSdnc", rollbackData.get(rbType, "rollbackSDNCcreate"))
execution.setVariable("unassignSdnc", rollbackData.get(rbType, "rollbackSDNCassign"))
- msoLogger.debug("sdncDeactivate:\n" + execution.getVariable("deactivateSdnc") )
- msoLogger.debug("sdncDelete:\n" + execution.getVariable("deleteSdnc"))
- msoLogger.debug("sdncUnassign:\n" + execution.getVariable("unassignSdnc"))
+ logger.debug("sdncDeactivate:\n" + execution.getVariable("deactivateSdnc") )
+ logger.debug("sdncDelete:\n" + execution.getVariable("deleteSdnc"))
+ logger.debug("sdncUnassign:\n" + execution.getVariable("unassignSdnc"))
execution.setVariable("sdncDeactivateRequest", rollbackData.get(rbType, "sdncActivateRollbackReq"))
execution.setVariable("sdncDeleteRequest", rollbackData.get(rbType, "sdncCreateRollbackReq"))
@@ -117,24 +121,24 @@ public class DoCreateAllottedResourceBRGRollback extends AbstractServiceTaskProc
}
}catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end preProcessRequest")
+ logger.trace("end preProcessRequest")
}
// aaiARPath set during query (existing AR)
public void updateAaiAROrchStatus(DelegateExecution execution, String status){
String msg = null;
- msoLogger.trace("start updateAaiAROrchStatus")
+ logger.trace("start updateAaiAROrchStatus")
AllottedResourceUtils arUtils = new AllottedResourceUtils(this)
String aaiARPath = execution.getVariable("aaiARPath")
- msoLogger.debug(" aaiARPath:" + aaiARPath)
+ logger.debug(" aaiARPath:" + aaiARPath)
Optional<AllottedResource> ar = Optional.empty(); //need this for getting resourceVersion for delete
if (!isBlank(aaiARPath))
{
@@ -143,73 +147,75 @@ public class DoCreateAllottedResourceBRGRollback extends AbstractServiceTaskProc
if(!ar.isPresent())
{
msg = "AR not found in AAI at:" + aaiARPath
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
String orchStatus = arUtils.updateAROrchStatus(execution, status, aaiARPath)
- msoLogger.trace("end updateAaiAROrchStatus")
+ logger.trace("end updateAaiAROrchStatus")
}
public void validateSDNCResp(DelegateExecution execution, String response, String method){
- msoLogger.trace("start ValidateSDNCResponse Process")
+ logger.trace("start ValidateSDNCResponse Process")
String msg = ""
try {
WorkflowException workflowException = execution.getVariable("WorkflowException")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.debug("SDNCResponse: " + response)
+ logger.debug("SDNCResponse: " + response)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
- msoLogger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + response)
+ logger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + response)
}else{
- msoLogger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
+ logger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
throw new BpmnError("MSOWorkflowException")
}
} catch (BpmnError e) {
if ("404".contentEquals(e.getErrorCode()))
{
msg = "SDNC rollback " + method + " returned a 404. Proceding with rollback"
- msoLogger.debug(msg)
+ logger.debug(msg)
}
else {
throw e;
}
} catch(Exception ex) {
msg = "Exception in validateSDNCResp. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end ValidateSDNCResp Process")
+ logger.trace("end ValidateSDNCResp Process")
}
public void deleteAaiAR(DelegateExecution execution){
try{
- msoLogger.trace("start deleteAaiAR")
+ logger.trace("start deleteAaiAR")
AllottedResourceUtils arUtils = new AllottedResourceUtils(this)
String arLink = execution.getVariable("aaiARPath")
arUtils.deleteAR(execution, arLink )
} catch (BpmnError e) {
throw e;
}catch(Exception ex){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occurred Processing preProcessSDNCGetRequest.", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + ex);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occurred Processing preProcessSDNCGetRequest.", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during SDNC GET Method:\n" + ex.getMessage())
}
- msoLogger.trace("end deleteAaiAR")
+ logger.trace("end deleteAaiAR")
}
public void postProcessRequest(DelegateExecution execution) {
- msoLogger.trace("start postProcessRequest")
+ logger.trace("start postProcessRequest")
String msg = ""
try {
execution.setVariable("rollbackData", null)
@@ -217,52 +223,52 @@ public class DoCreateAllottedResourceBRGRollback extends AbstractServiceTaskProc
if (skipRollback != true)
{
execution.setVariable("rolledBack", true)
- msoLogger.debug("rolledBack")
+ logger.debug("rolledBack")
}
- msoLogger.trace("end postProcessRequest")
+ logger.trace("end postProcessRequest")
} catch (BpmnError e) {
msg = "Bpmn Exception in postProcessRequest. "
- msoLogger.debug(msg)
+ logger.debug(msg)
} catch (Exception ex) {
msg = "Exception in postProcessRequest. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
}
public void processRollbackException(DelegateExecution execution){
- msoLogger.trace("start processRollbackException")
+ logger.trace("start processRollbackException")
try{
- msoLogger.debug("Caught an Exception in DoCreateAllottedResourceRollback")
+ logger.debug("Caught an Exception in DoCreateAllottedResourceRollback")
execution.setVariable("rollbackData", null)
execution.setVariable("rolledBack", false)
execution.setVariable("rollbackError", "Caught exception in AllottedResource Create Rollback")
execution.setVariable("WorkflowException", null)
}catch(BpmnError b){
- msoLogger.debug("BPMN Error during processRollbackExceptions Method: ")
+ logger.debug("BPMN Error during processRollbackExceptions Method: ")
}catch(Exception e){
- msoLogger.debug("Caught Exception during processRollbackExceptions Method: " + e.getMessage())
+ logger.debug("Caught Exception during processRollbackExceptions Method: " + e.getMessage())
}
- msoLogger.trace("end processRollbackException")
+ logger.trace("end processRollbackException")
}
public void processRollbackJavaException(DelegateExecution execution){
- msoLogger.trace("start processRollbackJavaException")
+ logger.trace("start processRollbackJavaException")
try{
execution.setVariable("rollbackData", null)
execution.setVariable("rolledBack", false)
execution.setVariable("rollbackError", "Caught Java exception in AllottedResource Create Rollback")
- msoLogger.debug("Caught Exception in processRollbackJavaException")
+ logger.debug("Caught Exception in processRollbackJavaException")
}catch(Exception e){
- msoLogger.debug("Caught Exception in processRollbackJavaException " + e.getMessage())
+ logger.debug("Caught Exception in processRollbackJavaException " + e.getMessage())
}
- msoLogger.trace("end processRollbackJavaException")
+ logger.trace("end processRollbackJavaException")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy
index 56fa3a6730..a5f0d7dc30 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -33,6 +35,8 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import javax.ws.rs.core.UriBuilder
import static org.apache.commons.lang3.StringUtils.isBlank
@@ -69,7 +73,7 @@ import static org.apache.commons.lang3.StringUtils.isBlank
*
*/
public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateAllottedResourceTXC.class);
+ private static final Logger logger = LoggerFactory.getLogger(DoCreateAllottedResourceTXC.class);
String Prefix="DCARTXC_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -79,11 +83,11 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
String msg = ""
- msoLogger.trace("start preProcessRequest")
+ logger.trace("start preProcessRequest")
try {
String msoRequestId = execution.getVariable("msoRequestId")
- msoLogger.debug(" msoRequestId = " + msoRequestId)
+ logger.debug(" msoRequestId = " + msoRequestId)
execution.setVariable("prefix", Prefix)
@@ -91,67 +95,67 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
String sdncCallbackUrl = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution)
if (isBlank(sdncCallbackUrl)) {
msg = "mso.workflow.sdncadapter.callback is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
- msoLogger.debug("SDNC Callback URL: " + sdncCallbackUrl)
+ logger.debug("SDNC Callback URL: " + sdncCallbackUrl)
String sdncReplDelay = UrnPropertiesReader.getVariable("mso.workflow.sdnc.replication.delay",execution)
if (isBlank(sdncReplDelay)) {
msg = "mso.workflow.sdnc.replication.delay is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("sdncReplDelay", sdncReplDelay)
- msoLogger.debug("SDNC replication delay: " + sdncReplDelay)
+ logger.debug("SDNC replication delay: " + sdncReplDelay)
//Request Inputs
if (isBlank(execution.getVariable("serviceInstanceId"))){
msg = "Input serviceInstanceId is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(execution.getVariable("parentServiceInstanceId"))) {
msg = "Input parentServiceInstanceId is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(execution.getVariable("allottedResourceModelInfo"))) {
msg = "Input allottedResourceModelInfo is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(execution.getVariable("brgWanMacAddress"))) {
msg = "Input brgWanMacAddress is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(execution.getVariable("allottedResourceRole"))) {
msg = "Input allottedResourceRole is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(execution.getVariable("allottedResourceType"))) {
msg = "Input allottedResourceType is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
}catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end preProcessRequest")
+ logger.trace("end preProcessRequest")
}
public void getAaiAR (DelegateExecution execution) {
- msoLogger.trace("start getAaiAR")
+ logger.trace("start getAaiAR")
String arType = execution.getVariable("allottedResourceType")
String arRole = execution.getVariable("allottedResourceRole")
@@ -180,16 +184,16 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
}
}
if (!isBlank(errorMsg)) {
- msoLogger.debug(errorMsg)
+ logger.debug(errorMsg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, errorMsg)
}
- msoLogger.trace("end getAaiAR")
+ logger.trace("end getAaiAR")
}
public void createAaiAR(DelegateExecution execution) {
- msoLogger.trace("start createAaiAR")
+ logger.trace("start createAaiAR")
String allottedResourceId = execution.getVariable("allottedResourceId")
if (isBlank(allottedResourceId))
@@ -208,7 +212,7 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
String arRole = execution.getVariable("allottedResourceRole")
String CSI_resourceLink = execution.getVariable("CSI_resourceLink")
String arModelInfo = execution.getVariable("allottedResourceModelInfo")
- msoLogger.debug("arModelInfo is:\n" + arModelInfo)
+ logger.debug("arModelInfo is:\n" + arModelInfo)
String modelInvariantId = jsonUtil.getJsonValue(arModelInfo, "modelInvariantUuid")
String modelVersionId = jsonUtil.getJsonValue(arModelInfo, "modelUuid")
@@ -235,14 +239,14 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
rollbackData.put(Prefix, "serviceInstanceId", execution.getVariable("serviceInstanceId"))
rollbackData.put(Prefix, "parentServiceInstanceId", execution.getVariable("parentServiceInstanceId"))
execution.setVariable("rollbackData", rollbackData)
- msoLogger.trace("end createAaiAR")
+ logger.trace("end createAaiAR")
}
public String buildSDNCRequest(DelegateExecution execution, String action, String sdncRequestId) {
String msg = ""
- msoLogger.trace("start buildSDNCRequest")
+ logger.trace("start buildSDNCRequest")
String sdncReq = null
try {
@@ -327,15 +331,15 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
</sdncadapterworkflow:SDNCRequestData>
</sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
- msoLogger.debug("sdncRequest:\n" + sdncReq)
+ logger.debug("sdncRequest:\n" + sdncReq)
sdncReq = utils.formatXml(sdncReq)
} catch(Exception ex) {
msg = "Exception in buildSDNCRequest. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end buildSDNCRequest")
+ logger.trace("end buildSDNCRequest")
return sdncReq
}
@@ -343,110 +347,110 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
String msg = ""
- msoLogger.trace("start preProcessSDNCAssign")
+ logger.trace("start preProcessSDNCAssign")
try {
String sdncRequestId = UUID.randomUUID().toString()
String sdncAssignReq = buildSDNCRequest(execution, "assign", sdncRequestId)
execution.setVariable("sdncAssignRequest", sdncAssignReq)
- msoLogger.debug("sdncAssignRequest: " + sdncAssignReq)
+ logger.debug("sdncAssignRequest: " + sdncAssignReq)
def sdncRequestId2 = UUID.randomUUID().toString()
String sdncAssignRollbackReq = sdncAssignReq.replace(">assign<", ">unassign<").replace(">CreateTunnelXConnInstance<", ">DeleteTunnelXConnInstance<").replace(">${sdncRequestId}<", ">${sdncRequestId2}<")
def rollbackData = execution.getVariable("rollbackData")
rollbackData.put(Prefix, "sdncAssignRollbackReq", sdncAssignRollbackReq)
execution.setVariable("rollbackData", rollbackData)
- msoLogger.debug("sdncAssignRollbackReq:\n" + sdncAssignRollbackReq)
- msoLogger.debug("rollbackData:\n" + rollbackData.toString())
+ logger.debug("sdncAssignRollbackReq:\n" + sdncAssignRollbackReq)
+ logger.debug("rollbackData:\n" + rollbackData.toString())
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in preProcessSDNCAssign. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.debug("end preProcessSDNCAssign")
+ logger.debug("end preProcessSDNCAssign")
}
public void preProcessSDNCCreate(DelegateExecution execution) {
String msg = ""
- msoLogger.trace("start preProcessSDNCCreate")
+ logger.trace("start preProcessSDNCCreate")
try {
String sdncRequestId = UUID.randomUUID().toString()
String sdncCreateReq = buildSDNCRequest(execution, "create", sdncRequestId)
execution.setVariable("sdncCreateRequest", sdncCreateReq)
- msoLogger.debug("sdncCreateReq: " + sdncCreateReq)
+ logger.debug("sdncCreateReq: " + sdncCreateReq)
def sdncRequestId2 = UUID.randomUUID().toString()
String sdncCreateRollbackReq = sdncCreateReq.replace(">create<", ">delete<").replace(">CreateTunnelXConnInstance<", ">DeleteTunnelXConnInstance<").replace(">${sdncRequestId}<", ">${sdncRequestId2}<")
def rollbackData = execution.getVariable("rollbackData")
rollbackData.put(Prefix, "sdncCreateRollbackReq", sdncCreateRollbackReq)
execution.setVariable("rollbackData", rollbackData)
- msoLogger.debug("sdncCreateRollbackReq:\n" + sdncCreateRollbackReq)
- msoLogger.debug("rollbackData:\n" + rollbackData.toString())
+ logger.debug("sdncCreateRollbackReq:\n" + sdncCreateRollbackReq)
+ logger.debug("rollbackData:\n" + rollbackData.toString())
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in preProcessSDNCCreate. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end preProcessSDNCCreate")
+ logger.trace("end preProcessSDNCCreate")
}
public void preProcessSDNCActivate(DelegateExecution execution) {
String msg = ""
- msoLogger.trace("start preProcessSDNCActivate")
+ logger.trace("start preProcessSDNCActivate")
try {
String sdncRequestId = UUID.randomUUID().toString()
String sdncActivateReq = buildSDNCRequest(execution, "activate", sdncRequestId)
execution.setVariable("sdncActivateRequest", sdncActivateReq)
- msoLogger.debug("sdncActivateReq: " + sdncActivateReq)
+ logger.debug("sdncActivateReq: " + sdncActivateReq)
def sdncRequestId2 = UUID.randomUUID().toString()
String sdncActivateRollbackReq = sdncActivateReq.replace(">activate<", ">deactivate<").replace(">CreateTunnelXConnInstance<", ">DeleteTunnelXConnInstance<").replace(">${sdncRequestId}<", ">${sdncRequestId2}<")
def rollbackData = execution.getVariable("rollbackData")
rollbackData.put(Prefix, "sdncActivateRollbackReq", sdncActivateRollbackReq)
execution.setVariable("rollbackData", rollbackData)
- msoLogger.debug("sdncActivateRollbackReq:\n" + sdncActivateRollbackReq)
- msoLogger.debug("rollbackData:\n" + rollbackData.toString())
+ logger.debug("sdncActivateRollbackReq:\n" + sdncActivateRollbackReq)
+ logger.debug("rollbackData:\n" + rollbackData.toString())
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in preProcessSDNCActivate. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end preProcessSDNCActivate")
+ logger.trace("end preProcessSDNCActivate")
}
public void validateSDNCResp(DelegateExecution execution, String response, String method){
- msoLogger.trace("start ValidateSDNCResponse Process")
+ logger.trace("start ValidateSDNCResponse Process")
String msg = ""
try {
WorkflowException workflowException = execution.getVariable("WorkflowException")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.debug("SDNCResponse: " + response)
+ logger.debug("SDNCResponse: " + response)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
- msoLogger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + response)
+ logger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + response)
if (!"get".equals(method))
{
@@ -456,22 +460,22 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
}
}else{
- msoLogger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
+ logger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
throw new BpmnError("MSOWorkflowException")
}
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in validateSDNCResp. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end ValidateSDNCResp Process")
+ logger.trace("end ValidateSDNCResp Process")
}
public void preProcessSDNCGet(DelegateExecution execution){
- msoLogger.trace("start preProcessSDNCGet")
+ logger.trace("start preProcessSDNCGet")
try{
def callbackUrl = execution.getVariable("sdncCallbackUrl")
@@ -483,15 +487,15 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
if (execution.getVariable("foundActiveAR")) {
def aaiQueryResponse = execution.getVariable("aaiARGetResponse")
serviceOperation = utils.getNodeText(aaiQueryResponse, "selflink")
- msoLogger.debug("AR service operation/aaiARSelfLink: " + serviceOperation)
+ logger.debug("AR service operation/aaiARSelfLink: " + serviceOperation)
}
else
{
String response = execution.getVariable("sdncAssignResponse")
String data = utils.getNodeXml(response, "response-data")
- msoLogger.debug("Assign responseData: " + data)
+ logger.debug("Assign responseData: " + data)
serviceOperation = utils.getNodeText(data, "object-path")
- msoLogger.debug("AR service operation:" + serviceOperation)
+ logger.debug("AR service operation:" + serviceOperation)
}
String serviceInstanceId = execution.getVariable("serviceInstanceId")
@@ -516,28 +520,30 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
execution.setVariable("sdncGetRequest", SDNCGetRequest)
}catch(Exception e){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occurred Processing preProcessSDNCGetRequest.", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occurred Processing preProcessSDNCGetRequest.", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during SDNC GET Method:\n" + e.getMessage())
}
- msoLogger.trace("end preProcessSDNCGet")
+ logger.trace("end preProcessSDNCGet")
}
public void updateAaiAROrchStatus(DelegateExecution execution, String status){
- msoLogger.trace("start updateAaiAROrchStatus")
+ logger.trace("start updateAaiAROrchStatus")
String aaiARPath = execution.getVariable("aaiARPath") //set during query (existing AR) or create
AllottedResourceUtils arUtils = new AllottedResourceUtils(this)
String orchStatus = arUtils.updateAROrchStatus(execution, status, aaiARPath)
- msoLogger.trace("end updateAaiAROrchStatus")
+ logger.trace("end updateAaiAROrchStatus")
}
public void generateOutputs(DelegateExecution execution)
{
- msoLogger.trace("start generateOutputs")
+ logger.trace("start generateOutputs")
try {
String sdncGetResponse = execution.getVariable("enhancedCallbackRequestData") //unescaped
- msoLogger.debug("resp:" + sdncGetResponse)
+ logger.debug("resp:" + sdncGetResponse)
String arData = utils.getNodeXml(sdncGetResponse, "tunnelxconn-topology")
arData = utils.removeXmlNamespaces(arData)
@@ -549,55 +555,55 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
String ari = utils.getNodeXml(arData, "allotted-resource-identifiers")
execution.setVariable("allotedResourceName", utils.getNodeText(ari, "allotted-resource-name"))
} catch (BpmnError e) {
- msoLogger.debug("BPMN Error in generateOutputs ")
+ logger.debug("BPMN Error in generateOutputs ")
} catch(Exception ex) {
String msg = "Exception in generateOutputs " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
- msoLogger.trace("end generateOutputs")
+ logger.trace("end generateOutputs")
}
public void preProcessRollback (DelegateExecution execution) {
- msoLogger.trace("start preProcessRollback")
+ logger.trace("start preProcessRollback")
try {
Object workflowException = execution.getVariable("WorkflowException");
if (workflowException instanceof WorkflowException) {
- msoLogger.debug("Prev workflowException: " + workflowException.getErrorMessage())
+ logger.debug("Prev workflowException: " + workflowException.getErrorMessage())
execution.setVariable("prevWorkflowException", workflowException);
//execution.setVariable("WorkflowException", null);
}
} catch (BpmnError e) {
- msoLogger.debug("BPMN Error during preProcessRollback")
+ logger.debug("BPMN Error during preProcessRollback")
} catch(Exception ex) {
String msg = "Exception in preProcessRollback. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
- msoLogger.trace("end preProcessRollback")
+ logger.trace("end preProcessRollback")
}
public void postProcessRollback (DelegateExecution execution) {
- msoLogger.trace("start postProcessRollback")
+ logger.trace("start postProcessRollback")
String msg = ""
try {
Object workflowException = execution.getVariable("prevWorkflowException");
if (workflowException instanceof WorkflowException) {
- msoLogger.debug("Setting prevException to WorkflowException: ")
+ logger.debug("Setting prevException to WorkflowException: ")
execution.setVariable("WorkflowException", workflowException);
}
execution.setVariable("rollbackData", null)
} catch (BpmnError b) {
- msoLogger.debug("BPMN Error during postProcessRollback")
+ logger.debug("BPMN Error during postProcessRollback")
throw b;
} catch(Exception ex) {
msg = "Exception in postProcessRollback. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
- msoLogger.trace("end postProcessRollback")
+ logger.trace("end postProcessRollback")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy
index 06d557532b..3d34e2de94 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -39,6 +41,8 @@ import static org.apache.commons.lang3.StringUtils.*
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
/**
* This groovy class supports the <class>CreateAllottedResourceTXCRollback.bpmn</class> process.
@@ -57,7 +61,7 @@ import org.onap.so.logger.MsoLogger
*
*/
public class DoCreateAllottedResourceTXCRollback extends AbstractServiceTaskProcessor{
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateAllottedResourceTXCRollback.class);
+ private static final Logger logger = LoggerFactory.getLogger(DoCreateAllottedResourceTXCRollback.class);
String Prefix="DCARTXCRB_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -66,13 +70,13 @@ public class DoCreateAllottedResourceTXCRollback extends AbstractServiceTaskProc
String msg = ""
- msoLogger.trace("start preProcessRequest")
+ logger.trace("start preProcessRequest")
execution.setVariable("prefix", Prefix)
String rbType = "DCARTXC_"
try {
def rollbackData = execution.getVariable("rollbackData")
- msoLogger.debug("RollbackData:" + rollbackData)
+ logger.debug("RollbackData:" + rollbackData)
if (rollbackData != null) {
if (rollbackData.hasType(rbType)) {
@@ -97,9 +101,9 @@ public class DoCreateAllottedResourceTXCRollback extends AbstractServiceTaskProc
execution.setVariable("deleteSdnc", rollbackData.get(rbType, "rollbackSDNCcreate"))
execution.setVariable("unassignSdnc", rollbackData.get(rbType, "rollbackSDNCassign"))
- msoLogger.debug("sdncDeactivate:\n" + execution.getVariable("deactivateSdnc") )
- msoLogger.debug("sdncDelete:\n" + execution.getVariable("deleteSdnc"))
- msoLogger.debug("sdncUnassign:\n" + execution.getVariable("unassignSdnc"))
+ logger.debug("sdncDeactivate:\n" + execution.getVariable("deactivateSdnc") )
+ logger.debug("sdncDelete:\n" + execution.getVariable("deleteSdnc"))
+ logger.debug("sdncUnassign:\n" + execution.getVariable("unassignSdnc"))
execution.setVariable("sdncDeactivateRequest", rollbackData.get(rbType, "sdncActivateRollbackReq"))
execution.setVariable("sdncDeleteRequest", rollbackData.get(rbType, "sdncCreateRollbackReq"))
@@ -124,24 +128,24 @@ public class DoCreateAllottedResourceTXCRollback extends AbstractServiceTaskProc
}
}catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end preProcessRequest")
+ logger.trace("end preProcessRequest")
}
// aaiARPath set during query (existing AR)
public void updateAaiAROrchStatus(DelegateExecution execution, String status){
String msg = null;
- msoLogger.trace("start updateAaiAROrchStatus")
+ logger.trace("start updateAaiAROrchStatus")
AllottedResourceUtils arUtils = new AllottedResourceUtils(this)
String aaiARPath = execution.getVariable("aaiARPath")
- msoLogger.debug(" aaiARPath:" + aaiARPath)
+ logger.debug(" aaiARPath:" + aaiARPath)
Optional<AllottedResource> ar = Optional.empty(); //need this for getting resourceVersion for delete
if (!isBlank(aaiARPath))
{
@@ -150,73 +154,75 @@ public class DoCreateAllottedResourceTXCRollback extends AbstractServiceTaskProc
if (!ar.isPresent())
{
msg = "AR not found in AAI at:" + aaiARPath
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
String orchStatus = arUtils.updateAROrchStatus(execution, status, aaiARPath)
- msoLogger.trace("end updateAaiAROrchStatus")
+ logger.trace("end updateAaiAROrchStatus")
}
public void validateSDNCResp(DelegateExecution execution, String response, String method){
- msoLogger.trace("start ValidateSDNCResponse Process")
+ logger.trace("start ValidateSDNCResponse Process")
String msg = ""
try {
WorkflowException workflowException = execution.getVariable("WorkflowException")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.debug("SDNCResponse: " + response)
+ logger.debug("SDNCResponse: " + response)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
- msoLogger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + response)
+ logger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + response)
}else{
- msoLogger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
+ logger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
throw new BpmnError("MSOWorkflowException")
}
} catch (BpmnError e) {
if ("404".contentEquals(e.getErrorCode()))
{
msg = "SDNC rollback " + method + " returned a 404. Proceding with rollback"
- msoLogger.debug(msg)
+ logger.debug(msg)
}
else {
throw e;
}
} catch(Exception ex) {
msg = "Exception in validateSDNCResp. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit ValidateSDNCResp Process")
+ logger.trace("Exit ValidateSDNCResp Process")
}
public void deleteAaiAR(DelegateExecution execution){
try{
- msoLogger.trace("start deleteAaiAR")
+ logger.trace("start deleteAaiAR")
AllottedResourceUtils arUtils = new AllottedResourceUtils(this)
String arLink = execution.getVariable("aaiARPath")
arUtils.deleteAR(execution, arLink)
} catch (BpmnError e) {
throw e;
}catch(Exception ex){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occurred Processing preProcessSDNCGetRequest.", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + ex);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occurred Processing preProcessSDNCGetRequest.", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during SDNC GET Method:\n" + ex.getMessage())
}
- msoLogger.trace("end deleteAaiAR")
+ logger.trace("end deleteAaiAR")
}
public void postProcessRequest(DelegateExecution execution) {
- msoLogger.trace("start postProcessRequest")
+ logger.trace("start postProcessRequest")
String msg = ""
try {
execution.setVariable("rollbackData", null)
@@ -224,51 +230,51 @@ public class DoCreateAllottedResourceTXCRollback extends AbstractServiceTaskProc
if (skipRollback != true)
{
execution.setVariable("rolledBack", true)
- msoLogger.debug("rolledBack")
+ logger.debug("rolledBack")
}
- msoLogger.trace("end postProcessRequest")
+ logger.trace("end postProcessRequest")
} catch (BpmnError e) {
- msoLogger.debug(msg)
+ logger.debug(msg)
} catch (Exception ex) {
msg = "Exception in postProcessRequest. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
}
}
public void processRollbackException(DelegateExecution execution){
- msoLogger.trace("start processRollbackException")
+ logger.trace("start processRollbackException")
try{
- msoLogger.debug("Caught an Exception in DoCreateAllottedResourceRollback")
+ logger.debug("Caught an Exception in DoCreateAllottedResourceRollback")
execution.setVariable("rollbackData", null)
execution.setVariable("rolledBack", false)
execution.setVariable("rollbackError", "Caught exception in AllottedResource Create Rollback")
execution.setVariable("WorkflowException", null)
}catch(BpmnError b){
- msoLogger.debug("BPMN Error during processRollbackExceptions Method: ")
+ logger.debug("BPMN Error during processRollbackExceptions Method: ")
}catch(Exception e){
- msoLogger.debug("Caught Exception during processRollbackExceptions Method: " + e.getMessage())
+ logger.debug("Caught Exception during processRollbackExceptions Method: " + e.getMessage())
}
- msoLogger.trace("end processRollbackException")
+ logger.trace("end processRollbackException")
}
public void processRollbackJavaException(DelegateExecution execution){
- msoLogger.trace("start processRollbackJavaException")
+ logger.trace("start processRollbackJavaException")
try{
execution.setVariable("rollbackData", null)
execution.setVariable("rolledBack", false)
execution.setVariable("rollbackError", "Caught Java exception in AllottedResource Create Rollback")
- msoLogger.debug("Caught Exception in processRollbackJavaException")
+ logger.debug("Caught Exception in processRollbackJavaException")
}catch(Exception e){
- msoLogger.debug("Caught Exception in processRollbackJavaException " + e.getMessage())
+ logger.debug("Caught Exception in processRollbackJavaException " + e.getMessage())
}
- msoLogger.trace("end processRollbackJavaException")
+ logger.trace("end processRollbackJavaException")
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy
index e39edffe68..3b80f3c468 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -31,6 +33,8 @@ import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
import static org.apache.commons.lang3.StringUtils.isBlank
@@ -58,7 +62,7 @@ import static org.apache.commons.lang3.StringUtils.isBlank
*
*/
public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoDeleteAllottedResourceBRG.class);
+ private static final Logger logger = LoggerFactory.getLogger(DoDeleteAllottedResourceBRG.class);
String Prefix="DDARBRG_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -66,7 +70,7 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{
public void preProcessRequest (DelegateExecution execution) {
String msg = ""
- msoLogger.trace("start preProcessRequest")
+ logger.trace("start preProcessRequest")
try {
execution.setVariable("prefix", Prefix)
@@ -75,38 +79,38 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{
String sdncCallbackUrl = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution)
if (isBlank(sdncCallbackUrl)) {
msg = "mso.workflow.sdncadapter.callback is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
- msoLogger.debug("SDNC Callback URL: " + sdncCallbackUrl)
+ logger.debug("SDNC Callback URL: " + sdncCallbackUrl)
//Request Inputs
if (isBlank(execution.getVariable("serviceInstanceId"))){
msg = "Input serviceInstanceId is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(execution.getVariable("allottedResourceId"))){
msg = "Input allottedResourceId is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
}catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end preProcessRequest")
+ logger.trace("end preProcessRequest")
}
public void getAaiAR (DelegateExecution execution) {
- msoLogger.trace("start getAaiAR end")
+ logger.trace("start getAaiAR end")
String allottedResourceId = execution.getVariable("allottedResourceId")
@@ -123,26 +127,26 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{
errorMsg = "Allotted resource not found in AAI with AllottedResourceId:" + allottedResourceId
}
if (!isBlank(errorMsg)) {
- msoLogger.debug(errorMsg)
+ logger.debug(errorMsg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, errorMsg)
}
- msoLogger.trace("end getAaiAR")
+ logger.trace("end getAaiAR")
}
// aaiARPath set during query (existing AR)
public void updateAaiAROrchStatus(DelegateExecution execution, String status){
- msoLogger.trace("start updateAaiAROrchStatus")
+ logger.trace("start updateAaiAROrchStatus")
AllottedResourceUtils arUtils = new AllottedResourceUtils(this)
String aaiARPath = execution.getVariable("aaiARPath") //set during query (existing AR)
String orchStatus = arUtils.updateAROrchStatus(execution, status, aaiARPath)
- msoLogger.trace("end updateAaiAROrchStatus")
+ logger.trace("end updateAaiAROrchStatus")
}
public String buildSDNCRequest(DelegateExecution execution, String action, String sdncRequestId) {
String msg = ""
- msoLogger.trace("start buildSDNCRequest")
+ logger.trace("start buildSDNCRequest")
String sdncReq = null
try {
@@ -214,106 +218,107 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{
</sdncadapterworkflow:SDNCRequestData>
</sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
- msoLogger.debug("sdncRequest:\n" + sdncReq)
+ logger.debug("sdncRequest:\n" + sdncReq)
sdncReq = utils.formatXml(sdncReq)
} catch(Exception ex) {
msg = "Exception in buildSDNCRequest. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end buildSDNCRequest")
+ logger.trace("end buildSDNCRequest")
return sdncReq
}
public void preProcessSDNCUnassign(DelegateExecution execution) {
String msg = ""
- msoLogger.trace("start preProcessSDNCUnassign")
+ logger.trace("start preProcessSDNCUnassign")
try {
String sdncRequestId = UUID.randomUUID().toString()
String sdncUnassignReq = buildSDNCRequest(execution, "unassign", sdncRequestId)
execution.setVariable("sdncUnassignRequest", sdncUnassignReq)
- msoLogger.debug("sdncUnassignRequest: " + sdncUnassignReq)
+ logger.debug("sdncUnassignRequest: " + sdncUnassignReq)
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in preProcessSDNCUnassign. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end preProcessSDNCUnassign")
+ logger.trace("end preProcessSDNCUnassign")
}
public void preProcessSDNCDelete(DelegateExecution execution) {
String msg = ""
- msoLogger.trace("start preProcessSDNCDelete")
+ logger.trace("start preProcessSDNCDelete")
try {
String sdncRequestId = UUID.randomUUID().toString()
String sdncDeleteReq = buildSDNCRequest(execution, "delete", sdncRequestId)
execution.setVariable("sdncDeleteRequest", sdncDeleteReq)
- msoLogger.debug("sdncDeleteReq: " + sdncDeleteReq)
+ logger.debug("sdncDeleteReq: " + sdncDeleteReq)
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in preProcessSDNCDelete. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end preProcessSDNCDelete")
+ logger.trace("end preProcessSDNCDelete")
}
public void preProcessSDNCDeactivate(DelegateExecution execution) {
String msg = ""
- msoLogger.trace("start preProcessSDNCDeactivate")
+ logger.trace("start preProcessSDNCDeactivate")
try {
String sdncRequestId = UUID.randomUUID().toString()
String sdncDeactivateReq = buildSDNCRequest(execution, "deactivate", sdncRequestId)
execution.setVariable("sdncDeactivateRequest", sdncDeactivateReq)
- msoLogger.debug("sdncDeactivateReq: " + sdncDeactivateReq)
+ logger.debug("sdncDeactivateReq: " + sdncDeactivateReq)
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in preProcessSDNCDeactivate. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end preProcessSDNCDeactivate")
+ logger.trace("end preProcessSDNCDeactivate")
}
public void validateSDNCResp(DelegateExecution execution, String response, String method){
- msoLogger.trace("start ValidateSDNCResponse Process")
+ logger.trace("start ValidateSDNCResponse Process")
String msg = ""
try {
WorkflowException workflowException = execution.getVariable("WorkflowException")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.debug("SDNCResponse: " + response)
+ logger.debug("SDNCResponse: " + response)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
- msoLogger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + response)
-
+ logger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n"
+ + response)
}else{
String sdncRespCode = execution.getVariable(Prefix + 'sdncRequestDataResponseCode')
- msoLogger.debug(method + " AllottedResource received error response from SDNC. ResponseCode:" + sdncRespCode)
+ logger.debug(method + " AllottedResource received error response from SDNC. ResponseCode:"
+ + sdncRespCode)
if (sdncRespCode.equals("404") && "deactivate".equals(method))
{
execution.setVariable("ARNotFoundInSDNC", true)
if ("true".equals(execution.getVariable("failNotFound")))
{
msg = "Allotted Resource Not found in SDNC"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
else
@@ -330,14 +335,14 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{
throw e;
} catch(Exception ex) {
msg = "Exception in validateSDNCResp. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end ValidateSDNCResp Process")
+ logger.trace("end ValidateSDNCResp Process")
}
public void deleteAaiAR(DelegateExecution execution){
- msoLogger.trace("start deleteAaiAR")
+ logger.trace("start deleteAaiAR")
try{
AllottedResourceUtils arUtils = new AllottedResourceUtils(this)
@@ -346,10 +351,12 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{
} catch (BpmnError e) {
throw e;
}catch(Exception ex){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occurred Processing preProcessSDNCGetRequest." + ex, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:" + ex);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occurred Processing preProcessSDNCGetRequest." + ex, "BPMN",
+ MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:" + ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during SDNC GET Method:\n" + ex.getMessage())
}
- msoLogger.trace("end deleteAaiAR")
+ logger.trace("end deleteAaiAR")
}
public AllottedResourceUtils getAllottedResourceUtils(){
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy
index f305a7ad0d..9b9f9f0388 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -31,6 +33,9 @@ import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
+
import static org.apache.commons.lang3.StringUtils.isBlank
/**
@@ -57,7 +62,7 @@ import static org.apache.commons.lang3.StringUtils.isBlank
*
*/
public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoDeleteAllottedResourceTXC.class);
+ private static final Logger logger = LoggerFactory.getLogger(DoDeleteAllottedResourceTXC.class);
String Prefix="DDARTXC_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -65,7 +70,7 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{
public void preProcessRequest (DelegateExecution execution) {
String msg = ""
- msoLogger.trace("start preProcessRequest")
+ logger.trace("start preProcessRequest")
try {
execution.setVariable("prefix", Prefix)
@@ -74,38 +79,38 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{
String sdncCallbackUrl = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution)
if (isBlank(sdncCallbackUrl)) {
msg = "mso.workflow.sdncadapter.callback is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
- msoLogger.debug("SDNC Callback URL: " + sdncCallbackUrl)
+ logger.debug("SDNC Callback URL: " + sdncCallbackUrl)
//Request Inputs
if (isBlank(execution.getVariable("serviceInstanceId"))){
msg = "Input serviceInstanceId is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
if (isBlank(execution.getVariable("allottedResourceId"))){
msg = "Input allottedResourceId is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
}catch(BpmnError b){
- msoLogger.debug("Rethrowing MSOWorkflowException")
+ logger.debug("Rethrowing MSOWorkflowException")
throw b
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end preProcessRequest")
+ logger.trace("end preProcessRequest")
}
public void getAaiAR (DelegateExecution execution) {
- msoLogger.trace("start getAaiAR")
+ logger.trace("start getAaiAR")
String allottedResourceId = execution.getVariable("allottedResourceId")
@@ -122,10 +127,10 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{
errorMsg = "Allotted resource not found in AAI with AllottedResourceId:" + allottedResourceId
}
if (!isBlank(errorMsg)) {
- msoLogger.debug(errorMsg)
+ logger.debug(errorMsg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, errorMsg)
}
- msoLogger.trace("end getAaiAR")
+ logger.trace("end getAaiAR")
}
@@ -135,17 +140,17 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{
// aaiARPath set during query (existing AR)
public void updateAaiAROrchStatus(DelegateExecution execution, String status){
- msoLogger.trace("start updateAaiAROrchStatus")
+ logger.trace("start updateAaiAROrchStatus")
AllottedResourceUtils arUtils = new AllottedResourceUtils(this)
String aaiARPath = execution.getVariable("aaiARPath") //set during query (existing AR)
String orchStatus = arUtils.updateAROrchStatus(execution, status, aaiARPath)
- msoLogger.trace("end updateAaiAROrchStatus")
+ logger.trace("end updateAaiAROrchStatus")
}
public String buildSDNCRequest(DelegateExecution execution, String action, String sdncRequestId) {
String msg = ""
- msoLogger.trace("start buildSDNCRequest")
+ logger.trace("start buildSDNCRequest")
String sdncReq = null
try {
@@ -217,106 +222,107 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{
</sdncadapterworkflow:SDNCRequestData>
</sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
- msoLogger.debug("sdncRequest:\n" + sdncReq)
+ logger.debug("sdncRequest:\n" + sdncReq)
sdncReq = utils.formatXml(sdncReq)
} catch(Exception ex) {
msg = "Exception in buildSDNCRequest. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end buildSDNCRequest")
+ logger.trace("end buildSDNCRequest")
return sdncReq
}
public void preProcessSDNCUnassign(DelegateExecution execution) {
String msg = ""
- msoLogger.trace("start preProcessSDNCUnassign")
+ logger.trace("start preProcessSDNCUnassign")
try {
String sdncRequestId = UUID.randomUUID().toString()
String sdncUnassignReq = buildSDNCRequest(execution, "unassign", sdncRequestId)
execution.setVariable("sdncUnassignRequest", sdncUnassignReq)
- msoLogger.debug("sdncUnassignRequest: " + sdncUnassignReq)
+ logger.debug("sdncUnassignRequest: " + sdncUnassignReq)
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in preProcessSDNCUnassign. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end preProcessSDNCUnassign")
+ logger.trace("end preProcessSDNCUnassign")
}
public void preProcessSDNCDelete(DelegateExecution execution) {
String msg = ""
- msoLogger.trace("start preProcessSDNCDelete")
+ logger.trace("start preProcessSDNCDelete")
try {
String sdncRequestId = UUID.randomUUID().toString()
String sdncDeleteReq = buildSDNCRequest(execution, "delete", sdncRequestId)
execution.setVariable("sdncDeleteRequest", sdncDeleteReq)
- msoLogger.debug("sdncDeleteReq: " + sdncDeleteReq)
+ logger.debug("sdncDeleteReq: " + sdncDeleteReq)
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in preProcessSDNCDelete. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end preProcessSDNCDelete")
+ logger.trace("end preProcessSDNCDelete")
}
public void preProcessSDNCDeactivate(DelegateExecution execution) {
String msg = ""
- msoLogger.trace("start preProcessSDNCDeactivate")
+ logger.trace("start preProcessSDNCDeactivate")
try {
String sdncRequestId = UUID.randomUUID().toString()
String sdncDeactivateReq = buildSDNCRequest(execution, "deactivate", sdncRequestId)
execution.setVariable("sdncDeactivateRequest", sdncDeactivateReq)
- msoLogger.debug("sdncDeactivateReq: " + sdncDeactivateReq)
+ logger.debug("sdncDeactivateReq: " + sdncDeactivateReq)
} catch (BpmnError e) {
throw e;
} catch(Exception ex) {
msg = "Exception in preProcessSDNCDeactivate. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end preProcessSDNCDeactivate")
+ logger.trace("end preProcessSDNCDeactivate")
}
public void validateSDNCResp(DelegateExecution execution, String response, String method){
- msoLogger.trace("start ValidateSDNCResponse Process")
+ logger.trace("start ValidateSDNCResponse Process")
String msg = ""
try {
WorkflowException workflowException = execution.getVariable("WorkflowException")
- msoLogger.debug("workflowException: " + workflowException)
+ logger.debug("workflowException: " + workflowException)
boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
- msoLogger.debug("SDNCResponse: " + response)
+ logger.debug("SDNCResponse: " + response)
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
- msoLogger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + response)
-
+ logger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n"
+ + response)
}else{
String sdncRespCode = execution.getVariable(Prefix + 'sdncRequestDataResponseCode')
- msoLogger.debug(method + " AllottedResource received error response from SDNC. ResponseCode:" + sdncRespCode)
+ logger.debug(method + " AllottedResource received error response from SDNC. ResponseCode:"
+ + sdncRespCode)
if (sdncRespCode.equals("404") && "deactivate".equals(method))
{
execution.setVariable("ARNotFoundInSDNC", true)
if ("true".equals(execution.getVariable("failNotFound")))
{
msg = "Allotted Resource Not found in SDNC"
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
else
@@ -333,14 +339,14 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{
throw e;
} catch(Exception ex) {
msg = "Exception in validateSDNCResp. " + ex.getMessage()
- msoLogger.debug(msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("end Exit ValidateSDNCResp Process")
+ logger.trace("end Exit ValidateSDNCResp Process")
}
public void deleteAaiAR(DelegateExecution execution){
- msoLogger.trace("start deleteAaiAR")
+ logger.trace("start deleteAaiAR")
try{
AllottedResourceUtils arUtils = new AllottedResourceUtils(this)
@@ -349,11 +355,12 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{
} catch (BpmnError e) {
throw e;
}catch(Exception ex){
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occurred Processing preProcessSDNCGetRequest.", "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + ex);
+ logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
+ "Exception Occurred Processing preProcessSDNCGetRequest.", "BPMN", MsoLogger.getServiceName(),
+ MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during SDNC GET Method:\n" + ex.getMessage())
}
- msoLogger.trace("end deleteAaiAR")
+ logger.trace("end deleteAaiAR")
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
index 8711f965fd..5534a39685 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
@@ -55,6 +55,7 @@ import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.exception.BBObjectNotFoundException;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.AAIConfigurationResources;
+import org.onap.so.client.orchestration.AAIInstanceGroupResources;
import org.onap.so.client.orchestration.AAINetworkResources;
import org.onap.so.client.orchestration.AAIServiceInstanceResources;
import org.onap.so.client.orchestration.AAIVfModuleResources;
@@ -97,6 +98,8 @@ public class AAICreateTasks {
@Autowired
private AAIConfigurationResources aaiConfigurationResources;
@Autowired
+ private AAIInstanceGroupResources aaiInstanceGroupResources;
+ @Autowired
private Environment env;
public void createServiceInstance(BuildingBlockExecution execution) {
@@ -450,6 +453,16 @@ public class AAICreateTasks {
}
}
+ public void createInstanceGroupVnf(BuildingBlockExecution execution){
+ try{
+ ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
+ InstanceGroup instanceGroup = extractPojosForBB.extractByKey(execution, ResourceKey.INSTANCE_GROUP_ID, execution.getLookupMap().get(ResourceKey.INSTANCE_GROUP_ID));
+ aaiInstanceGroupResources.createInstanceGroupandConnectServiceInstance(instanceGroup, serviceInstance);
+ } catch (Exception ex) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
+ }
+ }
+
public void createNetworkPolicies(BuildingBlockExecution execution) {
try{
String fqdns = execution.getVariable(CONTRAIL_NETWORK_POLICY_FQDN_LIST);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java
index 4908cda26a..6e4a5f3d15 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java
@@ -32,6 +32,7 @@ import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup;
import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
@@ -43,6 +44,7 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.AAIConfigurationResources;
+import org.onap.so.client.orchestration.AAIInstanceGroupResources;
import org.onap.so.client.orchestration.AAINetworkResources;
import org.onap.so.client.orchestration.AAIServiceInstanceResources;
import org.onap.so.client.orchestration.AAIVfModuleResources;
@@ -76,6 +78,8 @@ public class AAIDeleteTasks {
private AAIVolumeGroupResources aaiVolumeGroupResources;
@Autowired
private AAIConfigurationResources aaiConfigurationResources;
+ @Autowired
+ private AAIInstanceGroupResources aaiInstanceGroupResources;
public void deleteVfModule(BuildingBlockExecution execution) throws Exception {
GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
@@ -162,6 +166,15 @@ public class AAIDeleteTasks {
}
}
+ public void deleteInstanceGroupVnf(BuildingBlockExecution execution) {
+ try {
+ InstanceGroup instanceGroup = extractPojosForBB.extractByKey(execution, ResourceKey.INSTANCE_GROUP_ID, execution.getLookupMap().get(ResourceKey.INSTANCE_GROUP_ID));
+ aaiInstanceGroupResources.deleteInstanceGroup(instanceGroup);
+ } catch (Exception ex) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
+ }
+ }
+
public void deleteNetworkPolicies(BuildingBlockExecution execution) {
try{
String fqdns = execution.getVariable(CONTRAIL_NETWORK_POLICY_FQDN_LIST);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
index 932558d8ad..1815fcd827 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
@@ -9,9 +9,9 @@
* 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.
@@ -43,6 +43,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import static org.apache.commons.lang3.StringUtils.*;
@Component
public class VnfAdapterCreateTasks {
@@ -91,25 +92,27 @@ public class VnfAdapterCreateTasks {
public void createVfModule(BuildingBlockExecution execution) {
try {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
-
+
ServiceInstance serviceInstance = gBBInput.getCustomer().getServiceSubscription().getServiceInstances().get(0);
VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID, execution.getLookupMap().get(ResourceKey.VF_MODULE_ID));
GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
VolumeGroup volumeGroup = null;
try {
volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID, execution.getLookupMap().get(ResourceKey.VOLUME_GROUP_ID));
- } catch(BBObjectNotFoundException bbException) {
+ } catch(BBObjectNotFoundException bbException) {
}
CloudRegion cloudRegion = gBBInput.getCloudRegion();
RequestContext requestContext = gBBInput.getRequestContext();
OrchestrationContext orchestrationContext = gBBInput.getOrchContext();
String sdncVfModuleQueryResponse = execution.getVariable("SDNCQueryResponse_" + vfModule.getVfModuleId());
String sdncVnfQueryResponse = execution.getVariable("SDNCQueryResponse_" + genericVnf.getVnfId());
-
+
CreateVfModuleRequest createVfModuleRequest = vnfAdapterVfModuleResources.createVfModuleRequest(requestContext, cloudRegion, orchestrationContext, serviceInstance, genericVnf, vfModule, volumeGroup, sdncVnfQueryResponse, sdncVfModuleQueryResponse);
execution.setVariable(VNFREST_REQUEST, createVfModuleRequest.toXmlString());
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
+
+
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/audit/AuditTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/audit/AuditTasks.java
index aaa9e51d15..8cb7cbbe91 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/audit/AuditTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/audit/AuditTasks.java
@@ -7,9 +7,9 @@
* 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.
@@ -38,22 +38,22 @@ import org.springframework.stereotype.Component;
@Component
public class AuditTasks {
-
+
private static final Logger logger = LoggerFactory.getLogger(AuditTasks.class);
@Autowired
private ExceptionBuilder exceptionUtil;
-
+
@Autowired
private ExtractPojosForBB extractPojosForBB;
-
+
@Autowired
private Environment env;
-
+
public void isAuditNeeded(BuildingBlockExecution execution) {
- try {
+ try {
logger.debug("auditInventoryNeeded Value: {}", env.getProperty("mso.infra.auditInventory"));
- execution.setVariable("auditInventoryNeeded",env.getProperty("mso.infra.auditInventory"));
+ execution.setVariable("auditInventoryNeeded", Boolean.parseBoolean(env.getProperty("mso.infra.auditInventory")));
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
@@ -66,14 +66,14 @@ public class AuditTasks {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
-
+
private AuditInventory createAuditInventory(BuildingBlockExecution execution) throws BBObjectNotFoundException {
AuditInventory auditInventory = new AuditInventory();
-
+
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID, execution.getLookupMap().get(ResourceKey.VF_MODULE_ID));
CloudRegion cloudRegion = gBBInput.getCloudRegion();
-
+
auditInventory.setCloudOwner(cloudRegion.getCloudOwner());
auditInventory.setCloudRegion(cloudRegion.getLcpCloudRegionId());
auditInventory.setTenantId(cloudRegion.getTenantId());
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CloudSiteCatalogUtils.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CloudSiteCatalogUtils.java
index bba883e727..752c39a0a6 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CloudSiteCatalogUtils.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CloudSiteCatalogUtils.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -25,14 +27,15 @@ import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.db.catalog.beans.CloudSite;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class CloudSiteCatalogUtils {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CloudSiteCatalogUtils.class);
+ private static final Logger logger = LoggerFactory.getLogger(CloudSiteCatalogUtils.class);
@Autowired
private ExceptionBuilder exceptionUtil;
@@ -46,17 +49,17 @@ public class CloudSiteCatalogUtils {
if (cloudRegionId != null) {
Optional<CloudSite> cloudSite = getCloudSite(cloudRegionId);
if (!cloudSite.isPresent()) {
- msoLogger.debug("Cloud Region with cloudRegionId " + cloudRegionId + " not found in Catalog DB");
+ logger.debug("Cloud Region with cloudRegionId {} not found in Catalog DB", cloudRegionId);
exceptionUtil.buildAndThrowWorkflowException(execution, 404, "Cloud Region with cloudRegionId " + cloudRegionId + " not found in Catalog DB");
}
if (cloudSite.get().getIdentityService() == null) {
- msoLogger.debug("No identityService found for Cloud Region with cloudRegionId " + cloudRegionId + " in Catalog DB");
+ logger.debug("No identityService found for Cloud Region with cloudRegionId {} in Catalog DB", cloudRegionId);
exceptionUtil.buildAndThrowWorkflowException(execution, 404, "No identityService found for Cloud Region with cloudRegionId " + cloudRegionId + " in Catalog DB");
}
String identityUrl = cloudSite.get().getIdentityService().getIdentityUrl();
- msoLogger.debug("identityUrl from Catalog DB is: " + identityUrl);
+ logger.debug("identityUrl from Catalog DB is: {}", identityUrl);
execution.setVariable("identityUrl", identityUrl);
}
}
@@ -73,4 +76,4 @@ public class CloudSiteCatalogUtils {
return(Optional.of(catalogDbClient.getCloudSiteByClliAndAicVersion(id,"2.5")));
}
}
-} \ No newline at end of file
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java
index 75f293655f..a622520a71 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java
@@ -108,6 +108,10 @@ public class OrchestrationStatusValidator {
org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID, execution.getLookupMap().get(ResourceKey.CONFIGURATION_ID));
orchestrationStatus = configuration.getOrchestrationStatus();
break;
+ case INSTANCE_GROUP:
+ org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup instanceGroup = extractPojosForBB.extractByKey(execution, ResourceKey.INSTANCE_GROUP_ID, execution.getLookupMap().get(ResourceKey.INSTANCE_GROUP_ID));
+ orchestrationStatus = instanceGroup.getOrchestrationStatus();
+ break;
case NO_VALIDATE:
//short circuit and exit method
execution.setVariable(ORCHESTRATION_STATUS_VALIDATION_RESULT, OrchestrationStatusValidationDirective.VALIDATION_SKIPPED);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
index 8a3a778b06..d87b11a1a6 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
@@ -108,7 +108,7 @@ public class WorkflowAction {
private static final String ASSIGNINSTANCE = "assignInstance";
private static final String CREATEINSTANCE = "createInstance";
private static final String USERPARAMSERVICE = "service";
- private static final String supportedTypes = "vnfs|vfModules|networks|networkCollections|volumeGroups|serviceInstances";
+ private static final String supportedTypes = "vnfs|vfModules|networks|networkCollections|volumeGroups|serviceInstances|instanceGroups";
private static final String HOMINGSOLUTION = "Homing_Solution";
private static final String FABRIC_CONFIGURATION = "FabricConfiguration";
private static final String G_SERVICE_TYPE = "serviceType";
@@ -202,17 +202,25 @@ public class WorkflowAction {
orchFlows = filterOrchFlows(sIRequest, orchFlows, resourceType, execution);
String key = "";
ModelInfo modelInfo = sIRequest.getRequestDetails().getModelInfo();
- if(modelInfo.getModelType().equals(ModelType.service)) {
- key = modelInfo.getModelVersionId();
- } else {
- key = modelInfo.getModelCustomizationId();
+ if(modelInfo != null) {
+ if(modelInfo.getModelType().equals(ModelType.service)) {
+ key = modelInfo.getModelVersionId();
+ } else {
+ key = modelInfo.getModelCustomizationId();
+ }
}
+ boolean isConfiguration = isConfiguration(orchFlows);
Resource resourceKey = new Resource(resourceType, key, aLaCarte);
+ List<ExecuteBuildingBlock> configBuildingBlocks = getConfigBuildingBlocks(sIRequest, orchFlows, requestId, resourceKey, apiVersion, resourceId, requestAction, aLaCarte, vnfType,
+ workflowResourceIds, requestDetails, isConfiguration);
for (OrchestrationFlow orchFlow : orchFlows) {
- ExecuteBuildingBlock ebb = buildExecuteBuildingBlock(orchFlow, requestId, resourceKey, apiVersion, resourceId,
- requestAction, aLaCarte, vnfType, workflowResourceIds, requestDetails, false, null, false);
- flowsToExecute.add(ebb);
+ if(!orchFlow.getFlowName().contains("Configuration")) {
+ ExecuteBuildingBlock ebb = buildExecuteBuildingBlock(orchFlow, requestId, resourceKey, apiVersion, resourceId,
+ requestAction, aLaCarte, vnfType, workflowResourceIds, requestDetails, false, null, false);
+ flowsToExecute.add(ebb);
+ }
}
+ flowsToExecute.addAll(configBuildingBlocks);
} else {
boolean foundRelated = false;
boolean containsService = false;
@@ -339,6 +347,53 @@ public class WorkflowAction {
buildAndThrowException(execution, "Exception in create execution list " + ex.getMessage(), ex);
}
}
+
+ protected boolean isConfiguration(List<OrchestrationFlow> orchFlows) {
+ for(OrchestrationFlow flow : orchFlows) {
+ if(flow.getFlowName().contains("Configuration")) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ protected List<ExecuteBuildingBlock> getConfigBuildingBlocks(ServiceInstancesRequest sIRequest, List<OrchestrationFlow> orchFlows, String requestId, Resource resourceKey,
+ String apiVersion, String resourceId, String requestAction, boolean aLaCarte, String vnfType,
+ WorkflowResourceIds workflowResourceIds, RequestDetails requestDetails, boolean isConfiguration) {
+ List<OrchestrationFlow> result = new ArrayList<>(orchFlows);
+ result = orchFlows.stream().filter(item -> item.getFlowName().contains(FABRIC_CONFIGURATION)).collect(Collectors.toList());
+ String vnfCustomizationUUID = "";
+ String vfModuleCustomizationUUID = sIRequest.getRequestDetails().getModelInfo().getModelCustomizationUuid();
+ RelatedInstanceList[] relatedInstanceList = sIRequest.getRequestDetails().getRelatedInstanceList();
+ if (relatedInstanceList != null) {
+ for (RelatedInstanceList relatedInstList : relatedInstanceList) {
+ RelatedInstance relatedInstance = relatedInstList.getRelatedInstance();
+ if (relatedInstance.getModelInfo().getModelType().equals(ModelType.vnf)) {
+ vnfCustomizationUUID = relatedInstance.getModelInfo().getModelCustomizationUuid();
+ }
+ }
+ }
+
+ List<VnfVfmoduleCvnfcConfigurationCustomization> fabricCustomizations = traverseCatalogDbForConfiguration(vnfCustomizationUUID, vfModuleCustomizationUUID);
+ List<ExecuteBuildingBlock> flowsToExecuteConfigs = new ArrayList<>();
+ for(VnfVfmoduleCvnfcConfigurationCustomization fabricConfig : fabricCustomizations) {
+
+ if (requestAction.equals(CREATEINSTANCE)) {
+ workflowResourceIds.setConfigurationId(UUID.randomUUID().toString());
+ } else {
+ //TODO AAI lookup for configuration update/delete
+ }
+ for(OrchestrationFlow orchFlow : result) {
+ resourceKey.setVfModuleCustomizationId(vfModuleCustomizationUUID);
+ resourceKey.setCvnfModuleCustomizationId(fabricConfig.getCvnfcCustomization().getModelCustomizationUUID());
+ resourceKey.setVnfCustomizationId(vnfCustomizationUUID);
+ ExecuteBuildingBlock ebb = buildExecuteBuildingBlock(orchFlow, requestId, resourceKey, apiVersion, resourceId,
+ requestAction, aLaCarte, vnfType, workflowResourceIds, requestDetails, false, null, true);
+ flowsToExecuteConfigs.add(ebb);
+ }
+ }
+ return flowsToExecuteConfigs;
+ }
protected List<Resource> sortVfModulesByBaseFirst(List<Resource> vfModuleResources) {
int count = 0;
@@ -698,9 +753,9 @@ public class WorkflowAction {
vfModuleCustomizationUUID = vfModule.getModelInfo().getModelCustomizationUuid();
}
if(!vnfCustomizationUUID.equals("")&&!vfModuleCustomizationUUID.equals("")){
- List<String> configs = traverseCatalogDbForConfiguration(vnfCustomizationUUID,vfModuleCustomizationUUID);
- for(String config : configs){
- Resource configResource = new Resource(WorkflowType.CONFIGURATION,config,false);
+ List<VnfVfmoduleCvnfcConfigurationCustomization> configs = traverseCatalogDbForConfiguration(vnfCustomizationUUID,vfModuleCustomizationUUID);
+ for(VnfVfmoduleCvnfcConfigurationCustomization config : configs){
+ Resource configResource = new Resource(WorkflowType.CONFIGURATION,config.getConfigurationResource().getModelUUID(),false);
resource.setVnfCustomizationId(vnf.getModelInfo().getModelCustomizationId());
resource.setVfModuleCustomizationId(vfModule.getModelInfo().getModelCustomizationId());
resourceCounter.add(configResource);
@@ -734,20 +789,19 @@ public class WorkflowAction {
}
return foundRelated;
}
-
- protected List<String> traverseCatalogDbForConfiguration(String vnfCustomizationUUID, String vfModuleCustomizationUUID) {
- List<String> configurations = new ArrayList<>();
+ protected List<VnfVfmoduleCvnfcConfigurationCustomization> traverseCatalogDbForConfiguration(String vnfCustomizationUUID, String vfModuleCustomizationUUID) {
+ List<VnfVfmoduleCvnfcConfigurationCustomization> configurations = new ArrayList<>();
try{
List<CvnfcCustomization> cvnfcCustomizations = catalogDbClient.getCvnfcCustomizationByVnfCustomizationUUIDAndVfModuleCustomizationUUID(vnfCustomizationUUID, vfModuleCustomizationUUID);
for(CvnfcCustomization cvnfc : cvnfcCustomizations){
for(VnfVfmoduleCvnfcConfigurationCustomization customization : cvnfc.getVnfVfmoduleCvnfcConfigurationCustomization()){
if(customization.getConfigurationResource().getToscaNodeType().contains(FABRIC_CONFIGURATION)){
- configurations.add(customization.getConfigurationResource().getModelUUID());
+ configurations.add(customization);
}
}
}
- logger.debug("found {} configurations" , configurations.size() );
+ logger.debug("found {} configuration(s)" , configurations.size() );
return configurations;
} catch (Exception ex){
logger.error("Error in finding configurations", ex);
@@ -774,6 +828,7 @@ public class WorkflowAction {
workflowResourceIds.setVfModuleId((String) execution.getVariable("vfModuleId"));
workflowResourceIds.setVnfId((String) execution.getVariable("vnfId"));
workflowResourceIds.setVolumeGroupId((String) execution.getVariable("volumeGroupId"));
+ workflowResourceIds.setInstanceGroupId((String) execution.getVariable("instanceGroupId"));
return workflowResourceIds;
}
@@ -1048,7 +1103,7 @@ public class WorkflowAction {
executeBuildingBlock.setRequestId(requestId);
executeBuildingBlock.setBuildingBlock(buildingBlock);
executeBuildingBlock.setRequestDetails(requestDetails);
- if(isConfiguration){
+ if(resource != null && (isConfiguration || resource.getResourceType().equals(WorkflowType.CONFIGURATION))){
ConfigurationResourceKeys configurationResourceKeys = new ConfigurationResourceKeys();
if (resource != null){
configurationResourceKeys.setCvnfcCustomizationUUID(resource.getCvnfModuleCustomizationId());
@@ -1120,7 +1175,7 @@ public class WorkflowAction {
}
if (resourceType.equals(WorkflowType.VFMODULE)) {
- List<String> fabricCustomizations = traverseCatalogDbForConfiguration(vnfCustomizationUUID, vfModuleCustomizationUUID);
+ List<VnfVfmoduleCvnfcConfigurationCustomization> fabricCustomizations = traverseCatalogDbForConfiguration(vnfCustomizationUUID, vfModuleCustomizationUUID);
if (fabricCustomizations.isEmpty()) {
result = orchFlows.stream().filter(item -> !item.getFlowName().contains(FABRIC_CONFIGURATION)).collect(Collectors.toList());
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
index 2e91a52f65..33a89e0b82 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
@@ -161,6 +161,7 @@ public class WorkflowActionBBTasks {
WorkflowContextHolder.getInstance().processCallback(processKey, execution.getProcessInstanceId(), requestId,
callbackResponse);
logger.info("Successfully sent sync ack.");
+ updateInstanceId(execution);
}
public void sendErrorSyncAck(DelegateExecution execution) {
@@ -303,100 +304,31 @@ public class WorkflowActionBBTasks {
workflowAction.buildAndThrowException(execution, "Rollback has already been called. Cannot rollback a request that is currently in the rollback state.");
}
}
-
- protected void updateRequestErrorStatusMessage(DelegateExecution execution) {
- try {
- String requestId = (String) execution.getVariable(G_REQUEST_ID);
- InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId);
- String errorMsg = retrieveErrorMessage(execution);
- if(errorMsg == null || errorMsg.equals("")){
- errorMsg = "Failed to determine error message";
- }
- request.setStatusMessage(errorMsg);
- logger.debug("Updating RequestDB to failed: errorMsg = " + errorMsg);
- requestDbclient.updateInfraActiveRequests(request);
- } catch (Exception e) {
- logger.error("Failed to update Request db with the status message after retry or rollback has been initialized.",e);
- }
- }
-
- public void abortCallErrorHandling(DelegateExecution execution) {
- String msg = "Flow has failed. Rainy day handler has decided to abort the process.";
- logger.error(msg);
- throw new BpmnError(msg);
- }
- public void updateRequestStatusToFailed(DelegateExecution execution) {
- try {
+ protected void updateInstanceId(DelegateExecution execution){
+ try{
String requestId = (String) execution.getVariable(G_REQUEST_ID);
+ String resourceId = (String) execution.getVariable("resourceId");
+ WorkflowType resourceType = (WorkflowType) execution.getVariable("resourceType");
InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId);
- String errorMsg = null;
- String rollbackErrorMsg = null;
- boolean rollbackCompleted = (boolean) execution.getVariable("isRollbackComplete");
- boolean isRollbackFailure = (boolean) execution.getVariable("isRollback");
- ExecuteBuildingBlock ebb = (ExecuteBuildingBlock) execution.getVariable("buildingBlock");
-
- if(rollbackCompleted){
- rollbackErrorMsg = "Rollback has been completed successfully.";
- request.setRollbackStatusMessage(rollbackErrorMsg);
- logger.debug("Updating RequestDB to failed: Rollback has been completed successfully");
- }else{
- if(isRollbackFailure){
- rollbackErrorMsg = retrieveErrorMessage(execution);
- if(rollbackErrorMsg == null || rollbackErrorMsg.equals("")){
- rollbackErrorMsg = "Failed to determine rollback error message.";
- }
- request.setRollbackStatusMessage(rollbackErrorMsg);
- logger.debug("Updating RequestDB to failed: rollbackErrorMsg = " + rollbackErrorMsg);
- }else{
- errorMsg = retrieveErrorMessage(execution);
- if(errorMsg == null || errorMsg.equals("")){
- errorMsg = "Failed to determine error message";
- }
- request.setStatusMessage(errorMsg);
- logger.debug("Updating RequestDB to failed: errorMsg = " + errorMsg);
- }
- }
- if(ebb!=null && ebb.getBuildingBlock()!=null){
- String flowStatus = ebb.getBuildingBlock().getBpmnFlowName() + " has failed.";
- request.setFlowStatus(flowStatus);
- execution.setVariable("flowStatus", flowStatus);
+ if(resourceType == WorkflowType.SERVICE){
+ request.setServiceInstanceId(resourceId);
+ }else if(resourceType == WorkflowType.VNF){
+ request.setVnfId(resourceId);
+ }else if(resourceType == WorkflowType.VFMODULE){
+ request.setVfModuleId(resourceId);
+ }else if(resourceType == WorkflowType.VOLUMEGROUP){
+ request.setVolumeGroupId(resourceId);
+ }else if(resourceType == WorkflowType.NETWORK){
+ request.setNetworkId(resourceId);
+ }else if(resourceType == WorkflowType.CONFIGURATION){
+ request.setConfigurationId(resourceId);
+ }else if(resourceType == WorkflowType.INSTANCE_GROUP){
+ request.setInstanceGroupId(resourceId);
}
-
- request.setProgress(Long.valueOf(100));
- request.setRequestStatus("FAILED");
- request.setLastModifiedBy("CamundaBPMN");
requestDbclient.updateInfraActiveRequests(request);
- } catch (Exception e) {
- workflowAction.buildAndThrowException(execution, "Error Updating Request Database", e);
+ }catch(Exception ex){
+ workflowAction.buildAndThrowException(execution, "Failed to update Request db with instanceId");
}
}
-
- private String retrieveErrorMessage (DelegateExecution execution){
- String errorMsg = "";
- try {
- WorkflowException exception = (WorkflowException) execution.getVariable("WorkflowException");
- if(exception != null && (exception.getErrorMessage()!=null || !exception.getErrorMessage().equals(""))){
- errorMsg = exception.getErrorMessage();
- }
- } catch (Exception ex) {
- //log error and attempt to extact WorkflowExceptionMessage
- logger.error("Failed to extract workflow exception from execution.",ex);
- }
-
- if (errorMsg == null || errorMsg.equals("")){
- try {
- errorMsg = (String) execution.getVariable("WorkflowExceptionErrorMessage");
- } catch (Exception ex) {
- logger.error("Failed to extract workflow exception message from WorkflowException",ex);
- errorMsg = "Unexpected Error in BPMN.";
- }
- }
- return errorMsg;
- }
-
- public void updateRequestStatusToFailedWithRollback(DelegateExecution execution) {
- execution.setVariable("isRollbackComplete", true);
- updateRequestStatusToFailed(execution);
- }
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowType.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowType.java
index ff5ba152b9..304b4000bd 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowType.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowType.java
@@ -29,7 +29,8 @@ public enum WorkflowType {
NETWORK("Network"),
VIRTUAL_LINK("VirtualLink"),
NETWORKCOLLECTION("NetworkCollection"),
- CONFIGURATION("Configuration");
+ CONFIGURATION("Configuration"),
+ INSTANCE_GROUP("InstanceGroup");
private final String type;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java
index a96f01c3d0..3bb1d81e27 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java
@@ -27,6 +27,7 @@ import javax.ws.rs.core.UriBuilder;
import org.onap.so.bpmn.common.InjectionHelper;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.entities.AAIEdgeLabel;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.aai.mapper.AAIObjectMapper;
@@ -124,6 +125,20 @@ public class AAIConfigurationResources {
serviceInstanceId);
injectionHelper.getAaiClient().connect(configurationURI, serviceInstanceURI);
}
+
+ /**
+ * A&AI call to add configuration relationship with service instance
+ *
+ * @param configurationId
+ * @param serviceInstanceId
+ * @param aaiLabel
+ */
+ public void connectConfigurationToServiceInstance(String configurationId, String serviceInstanceId, AAIEdgeLabel aaiLabel) {
+ AAIResourceUri configurationURI = AAIUriFactory.createResourceUri(AAIObjectType.CONFIGURATION, configurationId);
+ AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
+ serviceInstanceId);
+ injectionHelper.getAaiClient().connect(configurationURI, serviceInstanceURI, aaiLabel);
+ }
/**
* A&AI call to add configuration relationship with generic-vnf
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIInstanceGroupResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIInstanceGroupResources.java
index 68f6e8ffa2..c325dd75ee 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIInstanceGroupResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIInstanceGroupResources.java
@@ -25,6 +25,7 @@ import java.util.Optional;
import org.onap.so.bpmn.common.InjectionHelper;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.entities.AAIEdgeLabel;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
@@ -68,5 +69,12 @@ public class AAIInstanceGroupResources {
AAIResourceUri instanceGroupUri = AAIUriFactory.createResourceUri(AAIObjectType.INSTANCE_GROUP, instanceGroup.getId());
return injectionHelper.getAaiClient().exists(instanceGroupUri);
}
-
+
+ public void createInstanceGroupandConnectServiceInstance(InstanceGroup instanceGroup, ServiceInstance serviceInstance) {
+ AAIResourceUri instanceGroupUri = AAIUriFactory.createResourceUri(AAIObjectType.INSTANCE_GROUP, instanceGroup.getId());
+ org.onap.aai.domain.yang.InstanceGroup aaiInstanceGroup = aaiObjectMapper.mapInstanceGroup(instanceGroup);
+ AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
+ serviceInstance.getServiceInstanceId());
+ injectionHelper.getAaiClient().createIfNotExists(instanceGroupUri, Optional.of(aaiInstanceGroup)).connect(instanceGroupUri, serviceInstanceURI);
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java
index 7715de9672..6dc0b1861d 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java
@@ -24,6 +24,7 @@ import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.bpmn.common.InjectionHelper;
import org.onap.so.bpmn.common.data.TestDataSetup;
+import org.onap.so.bpmn.core.UrnPropertiesReader;
import org.onap.so.bpmn.infrastructure.flowspecific.tasks.AssignNetworkBBUtils;
import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionExtractResourcesAAI;
import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup;
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java
index d8c7ebaff7..166319d32b 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java
@@ -382,7 +382,24 @@ public class TestDataSetup{
}
collection.setInstanceGroup(instanceGroup);
+
+ return instanceGroup;
+ }
+
+ public InstanceGroup setInstanceGroupVnf() {
+ InstanceGroup instanceGroup = buildInstanceGroup();
+
+ ServiceInstance serviceInstance = null;
+
+ try {
+ serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID));
+ } catch(BBObjectNotFoundException e) {
+ serviceInstance = setServiceInstance();
+ }
+
+ serviceInstance.getInstanceGroups().add(instanceGroup);
+ lookupKeyMap.put(ResourceKey.INSTANCE_GROUP_ID, instanceGroup.getId());
return instanceGroup;
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
index c48019af83..4e147a022c 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
@@ -49,6 +49,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup;
import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
import org.onap.so.bpmn.servicedecomposition.bbobjects.NetworkPolicy;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
@@ -75,6 +76,7 @@ public class AAICreateTasksTest extends BaseTaskTest{
private VfModule vfModule;
private Customer customer;
private Configuration configuration;
+ private InstanceGroup instanceGroup;
@Captor
ArgumentCaptor<NetworkPolicy> networkPolicyCaptor;
@@ -92,6 +94,7 @@ public class AAICreateTasksTest extends BaseTaskTest{
cloudRegion = setCloudRegion();
vfModule = setVfModule();
configuration = setConfiguration();
+ instanceGroup = setInstanceGroupVnf();
when(extractPojosForBB.extractByKey(any(),ArgumentMatchers.eq(ResourceKey.GENERIC_VNF_ID), any())).thenReturn(genericVnf);
when(extractPojosForBB.extractByKey(any(),ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID), any())).thenReturn(vfModule);
@@ -99,6 +102,7 @@ public class AAICreateTasksTest extends BaseTaskTest{
when(extractPojosForBB.extractByKey(any(),ArgumentMatchers.eq(ResourceKey.VOLUME_GROUP_ID), any())).thenReturn(volumeGroup);
when(extractPojosForBB.extractByKey(any(),ArgumentMatchers.eq(ResourceKey.SERVICE_INSTANCE_ID), any())).thenReturn(serviceInstance);
when(extractPojosForBB.extractByKey(any(),ArgumentMatchers.eq(ResourceKey.CONFIGURATION_ID), any())).thenReturn(configuration);
+ when(extractPojosForBB.extractByKey(any(),ArgumentMatchers.eq(ResourceKey.INSTANCE_GROUP_ID), any())).thenReturn(instanceGroup);
doThrow(new BpmnError("BPMN Error")).when(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(Exception.class));
@@ -467,6 +471,21 @@ public class AAICreateTasksTest extends BaseTaskTest{
aaiCreateTasks.connectVnfToTenant(execution);
verify(aaiVnfResources, times(1)).connectVnfToTenant(genericVnf, gBBInput.getCloudRegion());
}
+
+ @Test
+ public void createInstanceGroupVnfTest() throws Exception {
+ doNothing().when(aaiInstanceGroupResources).createInstanceGroupandConnectServiceInstance(instanceGroup, serviceInstance);
+ aaiCreateTasks.createInstanceGroupVnf(execution);
+ verify(aaiInstanceGroupResources, times(1)).createInstanceGroupandConnectServiceInstance(instanceGroup, serviceInstance);
+ }
+
+ @Test
+ public void createInstanceGroupVnfExceptionTest() throws Exception {
+ expectedException.expect(BpmnError.class);
+ doThrow(RuntimeException.class).when(aaiInstanceGroupResources).createInstanceGroupandConnectServiceInstance(instanceGroup, serviceInstance);
+ aaiCreateTasks.createInstanceGroupVnf(execution);
+ }
+
@Test
public void createNetworkPolicyNeedToCreateAllTest() throws Exception {
execution.setVariable("heatStackId", "testHeatStackId");
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasksTest.java
index 4984b2fbb5..94d886cdb5 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasksTest.java
@@ -48,6 +48,7 @@ import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup;
import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
@@ -71,6 +72,7 @@ public class AAIDeleteTasksTest extends BaseTaskTest {
private VolumeGroup volumeGroup;
private CloudRegion cloudRegion;
private Configuration configuration;
+ private InstanceGroup instanceGroup;
@Captor
ArgumentCaptor<String> stringCaptor;
@@ -84,6 +86,7 @@ public class AAIDeleteTasksTest extends BaseTaskTest {
volumeGroup = setVolumeGroup();
cloudRegion = setCloudRegion();
configuration = setConfiguration();
+ instanceGroup = setInstanceGroupVnf();
when(extractPojosForBB.extractByKey(any(),ArgumentMatchers.eq(ResourceKey.GENERIC_VNF_ID), any())).thenReturn(genericVnf);
when(extractPojosForBB.extractByKey(any(),ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID), any())).thenReturn(vfModule);
@@ -91,6 +94,7 @@ public class AAIDeleteTasksTest extends BaseTaskTest {
when(extractPojosForBB.extractByKey(any(),ArgumentMatchers.eq(ResourceKey.VOLUME_GROUP_ID), any())).thenReturn(volumeGroup);
when(extractPojosForBB.extractByKey(any(),ArgumentMatchers.eq(ResourceKey.SERVICE_INSTANCE_ID), any())).thenReturn(serviceInstance);
when(extractPojosForBB.extractByKey(any(),ArgumentMatchers.eq(ResourceKey.CONFIGURATION_ID), any())).thenReturn(configuration);
+ when(extractPojosForBB.extractByKey(any(),ArgumentMatchers.eq(ResourceKey.INSTANCE_GROUP_ID), any())).thenReturn(instanceGroup);
doThrow(new BpmnError("BPMN Error")).when(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(Exception.class));
@@ -194,6 +198,13 @@ public class AAIDeleteTasksTest extends BaseTaskTest {
}
@Test
+ public void deleteInstanceGroupVnfTest() throws Exception {
+ doNothing().when(aaiInstanceGroupResources).deleteInstanceGroup(instanceGroup);
+ aaiDeleteTasks.deleteInstanceGroupVnf(execution);
+ verify(aaiInstanceGroupResources, times(1)).deleteInstanceGroup(instanceGroup);
+ }
+
+ @Test
public void deleteNetworkPolicyNeedToDeleteAllTest() throws Exception {
execution.setVariable("contrailNetworkPolicyFqdnList", "ABC123,DEF456");
final String content0 = new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "queryAaiNetworkPoliciesForDelete0.json")));
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
index 17a37c873a..c2bca34fb6 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
@@ -137,26 +137,6 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest {
}
@Test
- public void updateRequestStatusToFailedFlowStatusTest() {
- String reqId = "reqId123";
- execution.setVariable("mso-request-id", reqId);
- execution.setVariable("isRollbackComplete", false);
- execution.setVariable("isRollback", false);
- ExecuteBuildingBlock ebb = new ExecuteBuildingBlock();
- BuildingBlock buildingBlock = new BuildingBlock();
- buildingBlock.setBpmnFlowName("CreateNetworkBB");
- ebb.setBuildingBlock(buildingBlock);
- execution.setVariable("buildingBlock", ebb);
- WorkflowException wfe = new WorkflowException("failure", 1, "failure");
- execution.setVariable("WorkflowException", wfe);
- InfraActiveRequests req = new InfraActiveRequests();
- doReturn(req).when(requestsDbClient).getInfraActiveRequestbyRequestId(reqId);
- doNothing().when(requestsDbClient).updateInfraActiveRequests(isA(InfraActiveRequests.class));
- workflowActionBBTasks.updateRequestStatusToFailed(execution);
- assertEquals("CreateNetworkBB has failed.",execution.getVariable("flowStatus"));
- }
-
- @Test
public void rollbackExecutionPathTest(){
execution.setVariable("handlingCode", "Rollback");
execution.setVariable("isRollback", false);
@@ -337,4 +317,17 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest {
workflowActionBBTasks.checkRetryStatus(execution);
assertEquals(0,execution.getVariable("retryCount"));
}
+
+ @Test
+ public void updateInstanceId(){
+ String reqId = "req123";
+ String instanceId = "123123123";
+ execution.setVariable("mso-request-id", reqId);
+ execution.setVariable("resourceId", instanceId);
+ execution.setVariable("resourceType", WorkflowType.SERVICE);
+ doReturn(reqMock).when(requestsDbClient).getInfraActiveRequestbyRequestId(reqId);
+ doNothing().when(requestsDbClient).updateInfraActiveRequests(isA(InfraActiveRequests.class));
+ workflowActionBBTasks.updateInstanceId(execution);
+ Mockito.verify( reqMock, Mockito.times(1)).setServiceInstanceId(instanceId);
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java
index 93d4b413f8..8c0792e628 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java
@@ -902,16 +902,32 @@ public class WorkflowActionTest extends BaseTaskTest {
ConfigurationResource configurationResource = new ConfigurationResource();
configurationResource.setToscaNodeType("FabricConfiguration");
vnfVfmoduleCvnfcConfigurationCustomization.setConfigurationResource(configurationResource);
+ vnfVfmoduleCvnfcConfigurationCustomization.setModelInstanceName("modelInstanceName1");
+ vnfVfmoduleCvnfcConfigurationCustomization.setCvnfcCustomization(cvnfcCustomization);
Set<VnfVfmoduleCvnfcConfigurationCustomization> custSet = new HashSet<VnfVfmoduleCvnfcConfigurationCustomization>();
custSet.add(vnfVfmoduleCvnfcConfigurationCustomization);
cvnfcCustomization.setVnfVfmoduleCvnfcConfigurationCustomization(custSet);
+ cvnfcCustomization.setDescription("description");
cvnfcCustomizations.add(cvnfcCustomization);
+ CvnfcCustomization cvnfcCustomization2 = new CvnfcCustomization();
+ VnfVfmoduleCvnfcConfigurationCustomization vnfVfmoduleCvnfcConfigurationCustomization2 = new VnfVfmoduleCvnfcConfigurationCustomization();
+ ConfigurationResource configurationResource2 = new ConfigurationResource();
+ configurationResource2.setToscaNodeType("FabricConfiguration");
+ vnfVfmoduleCvnfcConfigurationCustomization2.setConfigurationResource(configurationResource2);
+ vnfVfmoduleCvnfcConfigurationCustomization2.setModelInstanceName("modelInstanceName2");
+ vnfVfmoduleCvnfcConfigurationCustomization2.setCvnfcCustomization(cvnfcCustomization2);
+ Set<VnfVfmoduleCvnfcConfigurationCustomization> custSet2 = new HashSet<VnfVfmoduleCvnfcConfigurationCustomization>();
+ custSet2.add(vnfVfmoduleCvnfcConfigurationCustomization2);
+ cvnfcCustomization2.setVnfVfmoduleCvnfcConfigurationCustomization(custSet2);
+ cvnfcCustomization2.setDescription("description2");
+ cvnfcCustomizations.add(cvnfcCustomization2);
+
when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction,resource,true,"my-custom-cloud-owner")).thenReturn(northBoundRequest);
when(catalogDbClient.getCvnfcCustomizationByVnfCustomizationUUIDAndVfModuleCustomizationUUID("fc25201d-36d6-43a3-8d39-fdae88e526ae", "9a6d01fd-19a7-490a-9800-460830a12e0b")).thenReturn(cvnfcCustomizations);
workflowAction.selectExecutionList(execution);
List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
- assertEqualsBulkFlowName(ebbs,"AssignVfModuleBB","CreateVfModuleBB","ActivateVfModuleBB","AssignFabricConfigurationBB","ActivateFabricConfigurationBB");
+ assertEqualsBulkFlowName(ebbs,"AssignVfModuleBB","CreateVfModuleBB","ActivateVfModuleBB","AssignFabricConfigurationBB","ActivateFabricConfigurationBB", "AssignFabricConfigurationBB","ActivateFabricConfigurationBB");
}
/**
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java
index 2dd4033aa2..8195cd58c0 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java
@@ -144,9 +144,9 @@ public class WorkflowActionUnitTest {
when(catalogDbClient.getCvnfcCustomizationByVnfCustomizationUUIDAndVfModuleCustomizationUUID(any(String.class), any(String.class)))
.thenReturn(cvnfcCustomizations);
- List<String> results = workflowAction.traverseCatalogDbForConfiguration("myVnfCustomizationId", "myVfModuleCustomizationId");
+ List<VnfVfmoduleCvnfcConfigurationCustomization> results = workflowAction.traverseCatalogDbForConfiguration("myVnfCustomizationId", "myVfModuleCustomizationId");
- assertThat(results, is(Arrays.asList("my-uuid")));
+ assertThat(results, is(Arrays.asList(vfModuleCustomization)));
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java
index a38c8be686..4aeed71177 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java
@@ -48,6 +48,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VpnBinding;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.entities.AAIEdgeLabel;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.aai.mapper.AAIObjectMapper;
@@ -118,6 +119,13 @@ public class AAIConfigurationResourcesTest extends TestDataSetup{
}
@Test
+ public void connectConfigurationToServiceInstanceWithEdgeTest() {
+ doNothing().when(MOCK_aaiResourcesClient).connect(isA(AAIResourceUri.class), isA(AAIResourceUri.class), any(AAIEdgeLabel.class));
+ aaiConfigurationResources.connectConfigurationToServiceInstance(configuration.getConfigurationId(), serviceInstance.getServiceInstanceId(), AAIEdgeLabel.USES);
+ verify(MOCK_aaiResourcesClient, times(1)).connect(any(AAIResourceUri.class), any(AAIResourceUri.class), any(AAIEdgeLabel.class));
+ }
+
+ @Test
public void disconnectConfigurationToServiceInstanceTest(){
doNothing().when(MOCK_aaiResourcesClient).disconnect(isA(AAIResourceUri.class), isA(AAIResourceUri.class));
aaiConfigurationResources.disconnectConfigurationToServiceInstance("TEST_CONFIGURATION_ID", "TEST_SERVICE_INSTANCE_ID");
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIInstanceGroupResourcesTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIInstanceGroupResourcesTest.java
index 10bbf39823..58bcc8b1aa 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIInstanceGroupResourcesTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIInstanceGroupResourcesTest.java
@@ -21,7 +21,10 @@
package org.onap.so.client.orchestration;
import static org.mockito.ArgumentMatchers.eq;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.isA;
+import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -38,11 +41,14 @@ import org.onap.so.bpmn.common.data.TestDataSetup;
import org.onap.so.bpmn.common.InjectionHelper;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.AAIResourcesClient;
import org.onap.so.client.aai.entities.AAIEdgeLabel;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.aai.mapper.AAIObjectMapper;
+import org.onap.so.db.catalog.beans.OrchestrationStatus;
@RunWith(MockitoJUnitRunner.Silent.class)
public class AAIInstanceGroupResourcesTest extends TestDataSetup{
@@ -51,6 +57,7 @@ public class AAIInstanceGroupResourcesTest extends TestDataSetup{
private InstanceGroup instanceGroup;
private GenericVnf vnf;
+ private ServiceInstance serviceInstance;
@Mock
protected AAIResourcesClient MOCK_aaiResourcesClient;
@@ -65,6 +72,7 @@ public class AAIInstanceGroupResourcesTest extends TestDataSetup{
public void before() {
instanceGroup = buildInstanceGroup();
vnf = buildGenericVnf();
+ serviceInstance = buildServiceInstance();
doReturn(MOCK_aaiResourcesClient).when(MOCK_injectionHelper).getAaiClient();
}
@@ -99,4 +107,17 @@ public class AAIInstanceGroupResourcesTest extends TestDataSetup{
verify(MOCK_aaiResourcesClient, times(1)).exists(eq(AAIUriFactory.createResourceUri(AAIObjectType.INSTANCE_GROUP, instanceGroup.getId())));
}
+ @Test
+ public void createInstanceGroupandConnectServiceInstanceTest() {
+ doReturn(new org.onap.aai.domain.yang.InstanceGroup()).when(MOCK_aaiObjectMapper).mapInstanceGroup(instanceGroup);
+ doReturn(MOCK_aaiResourcesClient).when(MOCK_aaiResourcesClient).createIfNotExists(isA(AAIResourceUri.class), any(Optional.class));
+ doNothing().when(MOCK_aaiResourcesClient).connect(any(AAIResourceUri.class), any(AAIResourceUri.class));
+
+ aaiInstanceGroupResources.createInstanceGroupandConnectServiceInstance(instanceGroup, serviceInstance);
+
+ verify(MOCK_aaiObjectMapper, times(1)).mapInstanceGroup(instanceGroup);
+ verify(MOCK_aaiResourcesClient, times(1)).createIfNotExists(any(AAIResourceUri.class), any(Optional.class));
+ verify(MOCK_aaiResourcesClient, times(1)).connect(any(AAIResourceUri.class), any(AAIResourceUri.class));
+ }
+
}
diff --git a/common/src/main/java/org/onap/so/client/RestClient.java b/common/src/main/java/org/onap/so/client/RestClient.java
index 76134a42f4..4284cea847 100644
--- a/common/src/main/java/org/onap/so/client/RestClient.java
+++ b/common/src/main/java/org/onap/so/client/RestClient.java
@@ -262,6 +262,10 @@ public abstract class RestClient {
public <T> T put(Object obj, Class<T> resultClass) {
return format(method("PUT", obj), resultClass).orElse(null);
}
+
+ public <T> T put(Object obj, GenericType<T> resultClass) {
+ return format(method("PUT", obj), resultClass).orElse(null);
+ }
public <T> T delete(Class<T> resultClass) {
return format(method("DELETE", null), resultClass).orElse(null);
diff --git a/common/src/main/java/org/onap/so/client/aai/AAIDSLQueryClient.java b/common/src/main/java/org/onap/so/client/aai/AAIDSLQueryClient.java
index 4cee4f3df7..5f2c623d57 100644
--- a/common/src/main/java/org/onap/so/client/aai/AAIDSLQueryClient.java
+++ b/common/src/main/java/org/onap/so/client/aai/AAIDSLQueryClient.java
@@ -20,12 +20,13 @@
package org.onap.so.client.aai;
+import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.graphinventory.GraphInventoryQueryClient;
import org.onap.so.client.graphinventory.entities.DSLQuery;
import org.onap.so.client.graphinventory.entities.uri.GraphInventoryUri;
-public class AAIDSLQueryClient extends GraphInventoryQueryClient<AAIDSLQueryClient, DSLQuery> {
+public class AAIDSLQueryClient extends GraphInventoryQueryClient<AAIDSLQueryClient, DSLQuery, AAIResultWrapper, AAIObjectType> {
public AAIDSLQueryClient() {
super(new AAIClient());
@@ -40,4 +41,15 @@ public class AAIDSLQueryClient extends GraphInventoryQueryClient<AAIDSLQueryClie
return AAIUriFactory.createResourceUri(AAIObjectType.DSL);
}
+
+ @Override
+ public AAIResultWrapper createWrapper(String json) {
+ return new AAIResultWrapper(json);
+ }
+
+ @Override
+ public AAIObjectType createType(String name) {
+ return AAIObjectType.fromTypeName(name);
+ }
+
}
diff --git a/common/src/main/java/org/onap/so/client/aai/AAIQueryClient.java b/common/src/main/java/org/onap/so/client/aai/AAIQueryClient.java
index 66d5d1f5cb..cc855e444a 100644
--- a/common/src/main/java/org/onap/so/client/aai/AAIQueryClient.java
+++ b/common/src/main/java/org/onap/so/client/aai/AAIQueryClient.java
@@ -20,12 +20,13 @@
package org.onap.so.client.aai;
+import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.aai.entities.CustomQuery;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.graphinventory.GraphInventoryQueryClient;
import org.onap.so.client.graphinventory.entities.uri.GraphInventoryUri;
-public class AAIQueryClient extends GraphInventoryQueryClient<AAIQueryClient, CustomQuery> {
+public class AAIQueryClient extends GraphInventoryQueryClient<AAIQueryClient, CustomQuery, AAIResultWrapper, AAIObjectType> {
public AAIQueryClient() {
super(new AAIClient());
@@ -44,5 +45,15 @@ public class AAIQueryClient extends GraphInventoryQueryClient<AAIQueryClient, Cu
protected GraphInventoryUri setupQueryParams(GraphInventoryUri uri) {
return super.setupQueryParams(uri);
}
+
+ @Override
+ public AAIResultWrapper createWrapper(String json) {
+ return new AAIResultWrapper(json);
+ }
+
+ @Override
+ public AAIObjectType createType(String name) {
+ return AAIObjectType.fromTypeName(name);
+ }
}
diff --git a/common/src/main/java/org/onap/so/client/aai/entities/AAIEdgeLabel.java b/common/src/main/java/org/onap/so/client/aai/entities/AAIEdgeLabel.java
index 434dbf946b..eb6d0d0b43 100644
--- a/common/src/main/java/org/onap/so/client/aai/entities/AAIEdgeLabel.java
+++ b/common/src/main/java/org/onap/so/client/aai/entities/AAIEdgeLabel.java
@@ -25,8 +25,8 @@ import org.onap.so.client.graphinventory.entities.GraphInventoryEdgeLabel;
public enum AAIEdgeLabel implements GraphInventoryEdgeLabel {
BELONGS_TO("org.onap.relationships.inventory.BelongsTo"),
- USES("org.onap.relationships.inventory.Uses");
-
+ USES("org.onap.relationships.inventory.Uses"),
+ COMPOSED_OF("org.onap.relationships.inventory.ComposedOf");
private final String label;
private AAIEdgeLabel(String label) {
diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/HttpLookupUri.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/HttpLookupUri.java
index 324bb8abad..a627480d5d 100644
--- a/common/src/main/java/org/onap/so/client/aai/entities/uri/HttpLookupUri.java
+++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/HttpLookupUri.java
@@ -33,6 +33,7 @@ import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.AAIResourcesClient;
import org.onap.so.client.aai.entities.Results;
import org.onap.so.client.graphinventory.Format;
+import org.onap.so.client.graphinventory.entities.Pathed;
import org.onap.so.client.graphinventory.entities.uri.HttpAwareUri;
import org.onap.so.client.graphinventory.exceptions.GraphInventoryPayloadException;
import org.onap.so.client.graphinventory.exceptions.GraphInventoryUriComputationException;
@@ -82,9 +83,9 @@ public abstract class HttpLookupUri extends AAISimpleUri implements HttpAwareUri
Optional<String> result;
ObjectMapper mapper = new ObjectMapper();
- Results<Map<String, String>> results = mapper.readValue(jsonString, new TypeReference<Results<Map<String, String>>>(){});
+ Results<Pathed> results = mapper.readValue(jsonString, new TypeReference<Results<Pathed>>(){});
if (results.getResult().size() == 1) {
- String uriString = results.getResult().get(0).get("resource-link");
+ String uriString = results.getResult().get(0).getResourceLink();
URI uri = UriBuilder.fromUri(uriString).build();
String rawPath = uri.getRawPath();
result = Optional.of(rawPath.replaceAll("/aai/v\\d+", ""));
diff --git a/common/src/main/java/org/onap/so/client/cds/BasicAuthClientInterceptor.java b/common/src/main/java/org/onap/so/client/cds/BasicAuthClientInterceptor.java
new file mode 100644
index 0000000000..384d479501
--- /dev/null
+++ b/common/src/main/java/org/onap/so/client/cds/BasicAuthClientInterceptor.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2019 Bell Canada.
+ *
+ * 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.
+ */
+package org.onap.so.client.cds;
+
+import io.grpc.CallOptions;
+import io.grpc.Channel;
+import io.grpc.ClientCall;
+import io.grpc.ClientCall.Listener;
+import io.grpc.ClientInterceptor;
+import io.grpc.ForwardingClientCall;
+import io.grpc.Metadata;
+import io.grpc.Metadata.Key;
+import io.grpc.MethodDescriptor;
+
+public class BasicAuthClientInterceptor implements ClientInterceptor {
+
+ private CDSProperties props;
+
+ public BasicAuthClientInterceptor(CDSProperties props) {
+ this.props = props;
+ }
+
+ @Override
+ public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall(
+ MethodDescriptor<ReqT, RespT> method,
+ CallOptions callOptions,
+ Channel channel) {
+
+ Key<String> authHeader = Key.of("Authorization", Metadata.ASCII_STRING_MARSHALLER);
+
+ return new ForwardingClientCall.SimpleForwardingClientCall<ReqT, RespT>(
+ channel.newCall(method, callOptions)) {
+ @Override
+ public void start(Listener<RespT> responseListener, Metadata headers) {
+ headers.put(authHeader, props.getBasicAuth());
+ super.start(responseListener, headers);
+ }
+ };
+ }
+}
diff --git a/common/src/main/java/org/onap/so/client/cds/CDSProcessingClient.java b/common/src/main/java/org/onap/so/client/cds/CDSProcessingClient.java
index 0901cf589b..1e372112f1 100644
--- a/common/src/main/java/org/onap/so/client/cds/CDSProcessingClient.java
+++ b/common/src/main/java/org/onap/so/client/cds/CDSProcessingClient.java
@@ -73,6 +73,7 @@ public class CDSProcessingClient implements AutoCloseable {
.forAddress(props.getHost(), props.getPort())
.nameResolverFactory(new DnsNameResolverProvider())
.loadBalancerFactory(new PickFirstLoadBalancerProvider())
+ .intercept(new BasicAuthClientInterceptor(props))
.usePlaintext()
.build();
this.handler = new CDSProcessingHandler(listener);
diff --git a/common/src/main/java/org/onap/so/client/cds/CDSProperties.java b/common/src/main/java/org/onap/so/client/cds/CDSProperties.java
index bb2a54ec98..52d1d614ed 100644
--- a/common/src/main/java/org/onap/so/client/cds/CDSProperties.java
+++ b/common/src/main/java/org/onap/so/client/cds/CDSProperties.java
@@ -21,5 +21,8 @@ import org.onap.so.client.RestProperties;
public interface CDSProperties extends RestProperties {
String getHost();
+
int getPort();
+
+ String getBasicAuth();
}
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryQueryClient.java b/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryQueryClient.java
index c4bf0f0beb..152e9d7a36 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryQueryClient.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryQueryClient.java
@@ -20,17 +20,33 @@
package org.onap.so.client.graphinventory;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
import java.util.Optional;
+import java.util.stream.Collectors;
-import org.onap.so.client.aai.entities.CustomQuery;
+import javax.ws.rs.core.GenericType;
+
+import org.onap.so.client.aai.entities.Results;
+import org.onap.so.client.graphinventory.entities.GraphInventoryResultWrapper;
+import org.onap.so.client.graphinventory.entities.Pathed;
+import org.onap.so.client.graphinventory.entities.ResourceAndUrl;
import org.onap.so.client.graphinventory.entities.uri.GraphInventoryUri;
-public abstract class GraphInventoryQueryClient<S, I> {
+import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public abstract class GraphInventoryQueryClient<S, I, Wrapper extends GraphInventoryResultWrapper<?>, Type extends GraphInventoryObjectType> {
private Optional<String> depth = Optional.empty();
private boolean nodesOnly = false;
private Optional<GraphInventorySubgraphType> subgraph = Optional.empty();
private GraphInventoryClient client;
+ private GraphInventoryCommonObjectMapperProvider mapperProvider = new GraphInventoryCommonObjectMapperProvider();
public GraphInventoryQueryClient(GraphInventoryClient client) {
this.client = client;
@@ -42,6 +58,58 @@ public abstract class GraphInventoryQueryClient<S, I> {
return client.createClient(setupQueryParams(getQueryUri().queryParam("format", format.toString()))).put(query, String.class);
}
+ protected <R> List<R> querySingleType(Format format, I query, Class<R> clazz) {
+ return client.createClient(
+ setupQueryParams(getQueryUri().queryParam("format", format.toString()))).put(
+ query, new GenericType<Results<Object>>(){}).getResult()
+ .stream().map(item -> {
+ try {
+ return mapperProvider.getMapper().readValue(mapperProvider.getMapper().writeValueAsString(item), clazz);
+ } catch (IOException e) {
+ throw new IllegalArgumentException("could not map values from json", e);
+ }
+ }).collect(Collectors.toList());
+ }
+
+ public List<Pathed> queryPathed(I query) {
+ return querySingleType(Format.PATHED, query, Pathed.class);
+ }
+
+ public List<Id> queryId(I query) {
+ return querySingleType(Format.ID, query, Id.class);
+ }
+
+ public <R> List<R> querySingleResource(I query, Class<R> clazz) {
+ try {
+ return getResourceAndUrl(query).stream().map(item -> item.getWrapper().asBean(clazz).get()).collect(Collectors.toList());
+ } catch (IOException e) {
+ throw new IllegalArgumentException("could not map values from json", e);
+ }
+ }
+
+ public List<ResourceAndUrl<Wrapper>> getResourceAndUrl(I query) throws IOException {
+ List<ResourceAndUrl<Wrapper>> result = new ArrayList<>();
+ ObjectMapper mapper = mapperProvider.getMapper();
+ Results<Map<String, Object>> resultsFromJson = mapper.readValue(query(Format.RESOURCE_AND_URL, query),
+ new TypeReference<Results<Map<String, Object>>>() {
+ });
+ for (Map<String, Object> m : resultsFromJson.getResult()) {
+ for(Entry<String, Object> entrySet : m.entrySet()) {
+ if (!entrySet.getKey().equals("url")) {
+ String url = (String)m.get("url");
+ String stringJson = mapper.writeValueAsString(entrySet.getValue());
+ result.add(new ResourceAndUrl<Wrapper>(url, createType(entrySet.getKey()), createWrapper(stringJson)));
+ }
+ }
+ }
+
+ return result;
+ }
+
+ public abstract Wrapper createWrapper(String json);
+
+ public abstract Type createType(String name);
+
public S depth (String depth) {
this.depth = Optional.of(depth);
return (S) this;
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNode.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNode.java
index 7da1408f2d..1e4750d2cf 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNode.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNode.java
@@ -64,13 +64,14 @@ public class DSLNode implements QueryStep {
@Override
public String build() {
+ StringBuilder result = new StringBuilder(query);
if (output) {
- query.append("*");
+ result.append("*");
}
for (DSLNodeKey key : nodeKeys) {
- query.append(key.build());
+ result.append(key.build());
}
- return query.toString();
+ return result.toString();
}
}
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNodeKey.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNodeKey.java
index 159bfb1c29..c40a3e6f96 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNodeKey.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLNodeKey.java
@@ -49,11 +49,12 @@ public class DSLNodeKey implements QueryStep {
@Override
public String build() {
-
+ StringBuilder result = new StringBuilder(query);
+
if (not) {
- query.append(" !");
+ result.append(" !");
}
- query.append("('").append(keyName).append("', ");
+ result.append("('").append(keyName).append("', ");
List<String> temp = new ArrayList<>();
for (String item : values) {
if (item.equals("null")) {
@@ -64,8 +65,8 @@ public class DSLNodeKey implements QueryStep {
temp.add(String.format("'%s'", item));
}
}
- query.append(Joiner.on(", ").join(temp)).append(")");
+ result.append(Joiner.on(", ").join(temp)).append(")");
- return query.toString();
+ return result.toString();
}
}
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java
index 73dccea8e6..3a47c38444 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java
@@ -26,6 +26,7 @@ import java.util.List;
import java.util.stream.Collectors;
import org.onap.so.client.aai.entities.QueryStep;
+import org.onap.so.client.graphinventory.GraphInventoryObjectName;
import com.google.common.base.Joiner;
@@ -33,7 +34,7 @@ import com.google.common.base.Joiner;
public class DSLQueryBuilder<S, E> implements QueryStep {
private List<QueryStep> steps = new ArrayList<>();
-
+ private String suffix = "";
public DSLQueryBuilder() {
@@ -94,8 +95,17 @@ public class DSLQueryBuilder<S, E> implements QueryStep {
return this;
}
- public String limit(int limit) {
- return compile() + " LIMIT " + limit;
+ public DSLQueryBuilder<S, E> to(GraphInventoryObjectName name) {
+ return to(__.node(name));
+ }
+
+ public DSLQueryBuilder<S, E> to(GraphInventoryObjectName name, DSLNodeKey... key) {
+ return to(__.node(name, key));
+ }
+
+ public DSLQueryBuilder<S, E> limit(int limit) {
+ suffix = " LIMIT " + limit;
+ return this;
}
@Override
@@ -103,8 +113,31 @@ public class DSLQueryBuilder<S, E> implements QueryStep {
return compile();
}
+ @Override
+ public String toString() {
+ return build();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o != null) {
+ if (o instanceof QueryStep) {
+ return ((QueryStep)o).build().equals(this.build());
+ } else if (o instanceof String) {
+ return o.equals(this.build());
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+
+ return build().hashCode();
+ }
+
private String compile() {
- return Joiner.on(" ").join(steps.stream().map(item -> item.build()).collect(Collectors.toList()));
+ return Joiner.on(" ").join(steps.stream().map(item -> item.build()).collect(Collectors.toList())) + suffix;
}
protected QueryStep getFirst() {
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/GraphInventoryRelationships.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/GraphInventoryRelationships.java
index 759fad7e54..752a743247 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/entities/GraphInventoryRelationships.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/GraphInventoryRelationships.java
@@ -126,7 +126,7 @@ public abstract class GraphInventoryRelationships<Wrapper extends GraphInventory
protected List<String> getRelatedLinks(Optional<GraphInventoryObjectName> type) {
String matcher = "";
if (type.isPresent()) {
- matcher = "[?(@.related-to=='" + type.get() + "')]";
+ matcher = "[?(@.related-to=='" + type.get().typeName() + "')]";
}
return JsonPathUtil.getInstance().locateResultList(this.jsonBody, String.format("$.relationship%s.related-link", matcher));
}
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/GraphInventoryResultWrapper.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/GraphInventoryResultWrapper.java
index c5651c0d26..c0b29e46c2 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/entities/GraphInventoryResultWrapper.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/GraphInventoryResultWrapper.java
@@ -86,22 +86,27 @@ public abstract class GraphInventoryResultWrapper<R extends GraphInventoryRelati
}
public Map<String, Object> asMap() {
+
+ return asBean(new TypeReference<Map<String, Object>>(){}).orElse(new HashMap<>());
+ }
+
+ public <T> Optional<T> asBean(Class<T> clazz) {
if (isEmpty()) {
- return new HashMap<>();
+ return Optional.empty();
}
try {
- return mapper.readValue(this.jsonBody, new TypeReference<Map<String, Object>>(){});
+ return Optional.of(mapper.readValue(this.jsonBody, clazz));
} catch (IOException e) {
- return new HashMap<>();
+ return Optional.empty();
}
}
- public <T> Optional<T> asBean(Class<T> clazz) {
+ public <T> Optional<T> asBean(TypeReference<T> reference) {
if (isEmpty()) {
return Optional.empty();
}
try {
- return Optional.of(mapper.readValue(this.jsonBody, clazz));
+ return Optional.of(mapper.readValue(this.jsonBody, reference));
} catch (IOException e) {
return Optional.empty();
}
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/Id.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/Id.java
new file mode 100644
index 0000000000..76492dc38b
--- /dev/null
+++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/Id.java
@@ -0,0 +1,5 @@
+package org.onap.so.client.graphinventory.entities;
+
+public class Id extends Resource {
+
+}
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/Pathed.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/Pathed.java
new file mode 100644
index 0000000000..a53bdc0259
--- /dev/null
+++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/Pathed.java
@@ -0,0 +1,5 @@
+package org.onap.so.client.graphinventory.entities;
+
+public class Pathed extends Resource {
+
+}
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/Resource.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/Resource.java
new file mode 100644
index 0000000000..5c53f2cbf1
--- /dev/null
+++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/Resource.java
@@ -0,0 +1,40 @@
+package org.onap.so.client.graphinventory.entities;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+ "resource-type",
+ "resource-link"
+})
+public class Resource {
+
+ @JsonProperty("resource-type")
+ private String resourceType;
+ @JsonProperty("resource-link")
+ private String resourceLink;
+
+ @JsonProperty("resource-type")
+ public String getResourceType() {
+ return resourceType;
+ }
+
+ @JsonProperty("resource-type")
+ public void setResourceType(String resourceType) {
+ this.resourceType = resourceType;
+ }
+
+ @JsonProperty("resource-link")
+ public String getResourceLink() {
+ return resourceLink;
+ }
+
+ @JsonProperty("resource-link")
+ public void setResourceLink(String resourceLink) {
+ this.resourceLink = resourceLink;
+ }
+
+}
+
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/ResourceAndUrl.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/ResourceAndUrl.java
new file mode 100644
index 0000000000..e53fc02da7
--- /dev/null
+++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/ResourceAndUrl.java
@@ -0,0 +1,36 @@
+package org.onap.so.client.graphinventory.entities;
+
+import org.onap.so.client.graphinventory.GraphInventoryObjectType;
+
+public class ResourceAndUrl<Wrapper extends GraphInventoryResultWrapper> {
+
+ private String url;
+ private GraphInventoryObjectType type;
+ private Wrapper wrapper;
+
+ public ResourceAndUrl(String url, GraphInventoryObjectType type, Wrapper wrapper) {
+ this.url = url;
+ this.type = type;
+ this.wrapper = wrapper;
+ }
+ public String getUrl() {
+ return url;
+ }
+ public void setUrl(String url) {
+ this.url = url;
+ }
+ public Wrapper getWrapper() {
+ return wrapper;
+ }
+ public void setWrapper(Wrapper wrapper) {
+ this.wrapper = wrapper;
+ }
+ public GraphInventoryObjectType getType() {
+ return type;
+ }
+
+ public void setType(GraphInventoryObjectType type) {
+ this.type = type;
+ }
+
+}
diff --git a/common/src/main/java/org/onap/so/logger/MsoLogger.java b/common/src/main/java/org/onap/so/logger/MsoLogger.java
index 39a23b5c3e..341d7996a9 100644
--- a/common/src/main/java/org/onap/so/logger/MsoLogger.java
+++ b/common/src/main/java/org/onap/so/logger/MsoLogger.java
@@ -96,12 +96,6 @@ public class MsoLogger {
public static final String PARTNER_NAME = "PartnerName";
-
-
-
-
-
-
// Audit/Metric log specific
public static final String BEGINTIME = "BeginTimestamp";
public static final String STARTTIME = "StartTimeMilis";
@@ -184,9 +178,7 @@ public class MsoLogger {
this.value = value;
}
}
-
- public static final Marker ENTRY = MarkerFactory.getMarker("ENTRY");
- public static final Marker EXIT = MarkerFactory.getMarker("EXIT");
+
private Logger logger;
private Logger metricsLogger;
@@ -194,9 +186,6 @@ public class MsoLogger {
private static String instanceUUID, serverIP, serverName;
private MessageEnum exceptionArg, defaultException, defaultWarning, defaultAudit, defaultMetrics;
- // For internal logging of the initialization of MSO logs
- private static final Logger initLOGGER = LoggerFactory.getLogger(MsoLogger.class.getName());
-
private MsoLogger() {
this(MsoLogger.Catalog.GENERAL);
}
@@ -236,12 +225,6 @@ public class MsoLogger {
* @param targetVEntity
* Target VNF or VM acted opon by the component, if available
*/
- public void recordMetricEvent() {
- metricsLogger.info("");
- MDC.remove(TIMER);
- MDC.remove(TARGETENTITY);
- MDC.remove(TARGETSERVICENAME);
- }
public void recordMetricEvent(Long startTime, StatusCode statusCode, ResponseCode responseCode, String responseDesc,
String targetEntity, String targetServiceName, String targetVEntity) {
@@ -266,10 +249,7 @@ public class MsoLogger {
* @param responseDesc
* Human redable description of the application response code
*/
- public void recordAuditEvent(){
- auditLogger.info("");
- }
-
+
public void recordAuditEvent(Long startTime, StatusCode statusCode, ResponseCode responseCode,
String responseDesc) {
if (StringUtils.isEmpty(MDC.get(MsoLogger.PARTNERNAME))) {
@@ -1060,15 +1040,6 @@ public class MsoLogger {
return classArr[0].getMethodName();
}
- // Based on the discussion with Adrian, instanceUUID is used to identifiy
- // the mso instance,
- // it is generated during mso instance initialization period
- // The same mso instnace will use the same instanceUUID value, even after
- // restart
- private static String getInstanceUUID() {
- return System.getProperty("mso-instance-id");
- }
-
/**
* Set the requestId and serviceInstanceId
*
@@ -1088,36 +1059,6 @@ public class MsoLogger {
}
/**
- * Set the remoteIp and the basic HTTP Authentication user
- *
- * @param remoteIpp
- * The remote ip address
- * @param userp
- * The basic http authencitation user
- */
- public static void setLoggerParameters(String remoteIpp, String userp) {
- if (null != remoteIpp) {
- MDC.put(REMOTE_HOST, remoteIpp);
- }
- if (null != userp) {
- MDC.put(USER, userp);
- }
- }
-
- /**
- * Set the serviceName
- *
- * @param serviceNamep
- * The service name
- */
- public static void setServiceName(String serviceNamep) {
- if (null != serviceNamep) {
- MDC.put(SERVICE_NAME, serviceNamep);
- MDC.remove(SERVICE_NAME_IS_METHOD_NAME);
- }
- }
-
- /**
* Get the serviceName
*
* @return The service name
@@ -1127,13 +1068,6 @@ public class MsoLogger {
}
/**
- * Reset the serviceName
- */
- public static void resetServiceName() {
- MDC.remove(SERVICE_NAME);
- }
-
- /**
* Set the requestId and serviceInstanceId based on the mso request
*
* @param msoRequest
@@ -1191,14 +1125,4 @@ public class MsoLogger {
defaultMetrics = MessageEnum.GENERAL_METRICS;
}
}
-
- public void warnSimple(String message, Exception e) {
- logger.warn(message,e);
-
- }
-
-
-
-
-
}
diff --git a/common/src/test/java/org/onap/so/client/aai/AAIQueryClientTest.java b/common/src/test/java/org/onap/so/client/aai/AAIQueryClientTest.java
index 84c3cad0f9..e648ea38da 100644
--- a/common/src/test/java/org/onap/so/client/aai/AAIQueryClientTest.java
+++ b/common/src/test/java/org/onap/so/client/aai/AAIQueryClientTest.java
@@ -20,47 +20,65 @@
package org.onap.so.client.aai;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isA;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
+import java.util.Map;
-import javax.ws.rs.core.Response;
+import javax.ws.rs.core.GenericType;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
+import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.aai.domain.yang.Complex;
import org.onap.so.client.RestClient;
+import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.aai.entities.CustomQuery;
+import org.onap.so.client.aai.entities.Results;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.graphinventory.Format;
import org.onap.so.client.graphinventory.GraphInventoryClient;
import org.onap.so.client.graphinventory.GraphInventorySubgraphType;
+import org.onap.so.client.graphinventory.entities.Pathed;
+import org.onap.so.client.graphinventory.entities.ResourceAndUrl;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
@RunWith(MockitoJUnitRunner.class)
public class AAIQueryClientTest {
@Mock
- Response response;
-
- @Mock
- RestClient restClient;
+ private RestClient restClient;
@Mock
- GraphInventoryClient client;
+ private GraphInventoryClient client;
@InjectMocks
- AAIQueryClient aaiQueryClient = new AAIQueryClient();
+ @Spy
+ private AAIQueryClient aaiQueryClient = new AAIQueryClient();
+ private String AAI_JSON_FILE_LOCATION = "src/test/resources/__files/aai/query/";
+
+ private ObjectMapper mapper = new ObjectMapper();
@Test
public void testQuery() {
List<AAIResourceUri> uris = Arrays.asList(AAIUriFactory.createResourceUri(AAIObjectType.CUSTOM_QUERY));
@@ -91,4 +109,37 @@ public class AAIQueryClientTest {
verify(aaiUri, times(1)).queryParam("nodesOnly", "");
verify(aaiUri, times(1)).queryParam("subgraph", subgraph.toString());
}
+
+ @Test
+ public void querySingleResourceTest() throws IOException {
+ doReturn(getJson("single-query-result.json")).when(aaiQueryClient).query(eq(Format.RESOURCE_AND_URL), any(CustomQuery.class));
+ List<Complex> result = aaiQueryClient.querySingleResource(new CustomQuery(Arrays.asList(AAIUriFactory.createNodesUri(AAIObjectType.COMPLEX, "test"))), Complex.class);
+ assertEquals(2, result.size());
+ assertEquals("complex-id-15100-jc689q2", result.get(1).getPhysicalLocationId());
+ }
+
+ @Test
+ public void getResourceAndUrlTest() throws IOException {
+ doReturn(getJson("single-query-result.json")).when(aaiQueryClient).query(eq(Format.RESOURCE_AND_URL), any(CustomQuery.class));
+ List<ResourceAndUrl<AAIResultWrapper>> result = aaiQueryClient.getResourceAndUrl(new CustomQuery(Arrays.asList(AAIUriFactory.createNodesUri(AAIObjectType.COMPLEX, "test"))));
+ assertEquals(2, result.size());
+
+ assertEquals(1, result.get(1).getWrapper().getRelationships().get().getRelatedUris(AAIObjectType.PSERVER).size());
+ }
+
+ @Test
+ public void querySingleTypeTest() throws IOException {
+ when(client.createClient(isA(AAIUri.class))).thenReturn(restClient);
+ when(restClient.put(any(Object.class), any(GenericType.class))).thenReturn(mapper.readValue(getJson("pathed-result.json"), new TypeReference<Results<Map<String, Object>>>(){}));
+
+
+ List<Pathed> results = aaiQueryClient.queryPathed(new CustomQuery(Arrays.asList(AAIUriFactory.createNodesUri(AAIObjectType.COMPLEX, "test"))));
+
+ assertEquals(2, results.size());
+ assertEquals("service-instance", results.get(1).getResourceType());
+ }
+
+ private String getJson(String filename) throws IOException {
+ return new String(Files.readAllBytes(Paths.get(AAI_JSON_FILE_LOCATION + filename)));
+ }
}
diff --git a/common/src/test/java/org/onap/so/client/aai/AAIResourcesClientTest.java b/common/src/test/java/org/onap/so/client/aai/AAIResourcesClientTest.java
index 73fbff6e4f..174c76b1ef 100644
--- a/common/src/test/java/org/onap/so/client/aai/AAIResourcesClientTest.java
+++ b/common/src/test/java/org/onap/so/client/aai/AAIResourcesClientTest.java
@@ -33,9 +33,9 @@ import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.spy;
import javax.ws.rs.BadRequestException;
+
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -50,7 +50,6 @@ import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
import org.onap.so.client.defaultproperties.DefaultAAIPropertiesImpl;
-import org.onap.so.client.graphinventory.GraphInventoryClient;
import com.github.tomakehurst.wiremock.admin.NotFoundException;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
@@ -60,7 +59,7 @@ public class AAIResourcesClientTest {
@Rule
- public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().port(8443));
+ public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort());
@Rule
public ExpectedException thrown = ExpectedException.none();
@@ -72,9 +71,11 @@ public class AAIResourcesClientTest {
@InjectMocks
public AAIResourcesClient aaiClient = new AAIResourcesClient();
+ private String AAI_JSON_FILE_LOCATION = "src/test/resources/__files/aai/query/";
+
@Before
public void beforeTest() {
- doReturn(new DefaultAAIPropertiesImpl()).when(client).getRestProperties();
+ doReturn(new DefaultAAIPropertiesImpl(wireMockRule.port())).when(client).getRestProperties();
}
@Test
diff --git a/common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java b/common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java
index 69d46de96a..a5bbc64eb9 100644
--- a/common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java
+++ b/common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java
@@ -21,6 +21,7 @@
package org.onap.so.client.aai;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.onap.so.client.graphinventory.entities.DSLNode;
@@ -80,4 +81,32 @@ public class DSLQueryBuilderTest {
assertEquals("cloud-region* !('cloud-owner', ' ', ' null ')", builder.build());
}
+
+ @Test
+ public void shortCutToTest() {
+ DSLQueryBuilder<DSLNode, DSLNode> builder = new DSLQueryBuilder<>(new DSLNode(AAIObjectType.PSERVER,
+ __.key("hostname", "my-hostname")).output());
+
+ builder.to(AAIObjectType.P_INTERFACE).to(AAIObjectType.SRIOV_PF, __.key("pf-pci-id", "my-id"));
+ assertEquals("pserver*('hostname', 'my-hostname') > p-interface > sriov-pf('pf-pci-id', 'my-id')", builder.build());
+ }
+
+ @Test
+ public void limitTest() {
+ DSLQueryBuilder<DSLNode, DSLNode> builder = new DSLQueryBuilder<>(new DSLNode(AAIObjectType.PSERVER,
+ __.key("hostname", "my-hostname")).output());
+
+ builder.to(AAIObjectType.P_INTERFACE).limit(2).to(AAIObjectType.SRIOV_PF, __.key("pf-pci-id", "my-id"));
+ assertEquals("pserver*('hostname', 'my-hostname') > p-interface > sriov-pf('pf-pci-id', 'my-id') LIMIT 2", builder.build());
+ }
+
+ @Test
+ public void equalsTest() {
+ DSLQueryBuilder<DSLNode, DSLNode> builder = new DSLQueryBuilder<>(new DSLNode(AAIObjectType.PSERVER,
+ __.key("hostname", "my-hostname")).output());
+
+ builder.to(AAIObjectType.P_INTERFACE).to(AAIObjectType.SRIOV_PF, __.key("pf-pci-id", "my-id"));
+ assertTrue(builder.equals("pserver*('hostname', 'my-hostname') > p-interface > sriov-pf('pf-pci-id', 'my-id')"));
+ assertTrue(builder.equals(builder));
+ }
}
diff --git a/common/src/test/java/org/onap/so/client/aai/entities/RelationshipsTest.java b/common/src/test/java/org/onap/so/client/aai/entities/RelationshipsTest.java
index 1ce6e4377c..8d11f69308 100644
--- a/common/src/test/java/org/onap/so/client/aai/entities/RelationshipsTest.java
+++ b/common/src/test/java/org/onap/so/client/aai/entities/RelationshipsTest.java
@@ -44,7 +44,7 @@ public class RelationshipsTest {
AAIResultWrapper wrapper = new AAIResultWrapper(content);
Relationships relationships = wrapper.getRelationships().get();
- List<AAIResourceUri> test = relationships.getRelatedAAIUris(AAIObjectType.VCE);
+ List<AAIResourceUri> test = relationships.getRelatedUris(AAIObjectType.VCE);
System.out.println(test.get(0).build());
List<AAIResourceUri> uris = Arrays.asList(
diff --git a/common/src/test/java/org/onap/so/client/aai/entities/uri/ServiceInstanceUriTest.java b/common/src/test/java/org/onap/so/client/aai/entities/uri/ServiceInstanceUriTest.java
index 15c1c24ae2..979ca39489 100644
--- a/common/src/test/java/org/onap/so/client/aai/entities/uri/ServiceInstanceUriTest.java
+++ b/common/src/test/java/org/onap/so/client/aai/entities/uri/ServiceInstanceUriTest.java
@@ -69,7 +69,7 @@ public class ServiceInstanceUriTest {
private final static String AAI_JSON_FILE_LOCATION = "src/test/resources/__files/aai/resources/";
@Rule
- public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().port(8443));
+ public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort());
@Rule
public final ExpectedException exception = ExpectedException.none();
@@ -82,7 +82,7 @@ public class ServiceInstanceUriTest {
@Before
public void beforeTest() {
- doReturn(new DefaultAAIPropertiesImpl()).when(client).getRestProperties();
+ doReturn(new DefaultAAIPropertiesImpl(wireMockRule.port())).when(client).getRestProperties();
}
@Test
public void found() throws IOException {
diff --git a/common/src/test/java/org/onap/so/client/cds/TestCDSPropertiesImpl.java b/common/src/test/java/org/onap/so/client/cds/TestCDSPropertiesImpl.java
index efb9b07871..a2937869c8 100644
--- a/common/src/test/java/org/onap/so/client/cds/TestCDSPropertiesImpl.java
+++ b/common/src/test/java/org/onap/so/client/cds/TestCDSPropertiesImpl.java
@@ -26,12 +26,17 @@ public class TestCDSPropertiesImpl implements CDSProperties {
@Override
public String getHost() {
- return "endpoint";
+ return "localhost";
}
@Override
public int getPort() {
- return 9999;
+ return 9111;
+ }
+
+ @Override
+ public String getBasicAuth() {
+ return "Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==";
}
@Override
diff --git a/common/src/test/java/org/onap/so/client/defaultproperties/DefaultAAIPropertiesImpl.java b/common/src/test/java/org/onap/so/client/defaultproperties/DefaultAAIPropertiesImpl.java
index 77e1dfee7d..65c76561dc 100644
--- a/common/src/test/java/org/onap/so/client/defaultproperties/DefaultAAIPropertiesImpl.java
+++ b/common/src/test/java/org/onap/so/client/defaultproperties/DefaultAAIPropertiesImpl.java
@@ -50,6 +50,21 @@ public class DefaultAAIPropertiesImpl implements AAIProperties {
this.props = temp;
}
+
+ public DefaultAAIPropertiesImpl(int port) {
+ File initialFile = new File("src/test/resources/aai.properties");
+ Map<Object, Object> temp;
+ try (InputStream targetStream = new FileInputStream(initialFile)) {
+ Properties properties = new Properties();
+ properties.load(targetStream);
+ temp = properties;
+ } catch (IOException e) {
+ temp = new HashMap<>();
+ }
+ this.props = temp;
+ this.props.put("aai.endpoint", this.props.get("aai.endpoint").toString().replaceFirst(":\\d+", ":" + port));
+
+ }
@Override
public URL getEndpoint() throws MalformedURLException {
return new URL(props.get("aai.endpoint").toString());
diff --git a/common/src/test/resources/__files/aai/query/pathed-result.json b/common/src/test/resources/__files/aai/query/pathed-result.json
new file mode 100644
index 0000000000..e9a3e65c73
--- /dev/null
+++ b/common/src/test/resources/__files/aai/query/pathed-result.json
@@ -0,0 +1,12 @@
+{
+ "results": [
+ {
+ "resource-type": "service-instance",
+ "resource-link": "https://localhost:8443/aai/v9/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3"
+ },
+ {
+ "resource-type": "service-instance",
+ "resource-link": "https://localhost:8443/aai/v9/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3"
+ }
+ ]
+} \ No newline at end of file
diff --git a/common/src/test/resources/__files/aai/query/single-query-result.json b/common/src/test/resources/__files/aai/query/single-query-result.json
new file mode 100644
index 0000000000..eb12deae80
--- /dev/null
+++ b/common/src/test/resources/__files/aai/query/single-query-result.json
@@ -0,0 +1,80 @@
+{
+ "results": [
+ {
+ "url": "/aai/v14/cloud-infrastructure/complexes/complex/complex-id-15100-jc689q",
+ "complex": {
+ "physical-location-id": "complex-id-15100-jc689q",
+ "resource-version": "1541786379243",
+ "physical-location-type": "lvXHWJC",
+ "street1": "uAAi5qjc1",
+ "street2": "vkK6XQjc2",
+ "city": "3Ec8JSW0JC",
+ "state": "COczHmeJC",
+ "postal-code": "D4J1",
+ "country": "K0JC1",
+ "region": "JzHqJC1",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "pserver",
+ "relationship-label": "org.onap.relationships.inventory.LocatedIn",
+ "related-link": "/aai/v14/cloud-infrastructure/pservers/pserver/pserver-15100-jc689q",
+ "relationship-data": [
+ {
+ "relationship-key": "pserver.hostname",
+ "relationship-value": "pserver-15100-jc689q"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "pserver.pserver-name2"
+ },
+ {
+ "property-key": "pserver.fqdn"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ },
+ {
+ "url": "/aai/v14/cloud-infrastructure/complexes/complex/complex-id-15100-jc689q2",
+ "complex": {
+ "physical-location-id": "complex-id-15100-jc689q2",
+ "resource-version": "1541786379243",
+ "physical-location-type": "lvXHWJC",
+ "street1": "uAAi5qjc1",
+ "street2": "vkK6XQjc2",
+ "city": "3Ec8JSW0JC",
+ "state": "COczHmeJC",
+ "postal-code": "D4J1",
+ "country": "K0JC1",
+ "region": "JzHqJC1",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "pserver",
+ "relationship-label": "org.onap.relationships.inventory.LocatedIn",
+ "related-link": "/aai/v14/cloud-infrastructure/pservers/pserver/pserver-15100-jc689q",
+ "relationship-data": [
+ {
+ "relationship-key": "pserver.hostname",
+ "relationship-value": "pserver-15100-jc689q"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "pserver.pserver-name2"
+ },
+ {
+ "property-key": "pserver.fqdn"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+ ]
+} \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java
index 24fb0e0d20..1dece5c341 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandler/common/CommonConstants.java
@@ -80,6 +80,7 @@ public final class CommonConstants {
public static final String X_PATCH_VERSION = "X-PatchVersion";
public static final String X_LATEST_VERSION = "X-LatestVersion";
public static final String INSTANCE_GROUP_ID = "instanceGroupId";
+ public static final String INSTANCE_GROUP_INSTANCE_ID = "instanceGroupInstanceId";
private CommonConstants () {
// prevent creating an instance of this class
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java
index be1131ed78..84cac6ce5c 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -25,6 +27,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.UUID;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
@@ -69,7 +72,8 @@ import org.onap.so.serviceinstancebeans.RequestInfo;
import org.onap.so.serviceinstancebeans.RequestParameters;
import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
import org.onap.so.serviceinstancebeans.SubscriberInfo;
-import org.onap.so.utils.UUIDChecker;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -85,8 +89,7 @@ import io.swagger.annotations.ApiOperation;
public class E2EServiceInstances {
private HashMap<String, String> instanceIdMap = new HashMap<>();
- private static final MsoLogger msoLogger = MsoLogger
- .getMsoLogger(MsoLogger.Catalog.APIH, E2EServiceInstances.class);
+ private static final Logger logger = LoggerFactory.getLogger(E2EServiceInstances.class);
private static final String MSO_PROP_APIHANDLER_INFRA = "MSO_PROP_APIHANDLER_INFRA";
@@ -190,7 +193,7 @@ public class E2EServiceInstances {
@PathParam("version") String version,
@PathParam("serviceId") String serviceId) throws ApiException {
- msoLogger.debug("------------------scale begin------------------");
+ logger.debug("------------------scale begin------------------");
instanceIdMap.put("serviceId", serviceId);
return scaleE2EserviceInstances(request, Action.scaleInstance, instanceIdMap, version);
}
@@ -216,9 +219,8 @@ public class E2EServiceInstances {
private Response compareModelwithTargetVersion(String requestJSON, Action action,
HashMap<String, String> instanceIdMap, String version) throws ApiException {
- String requestId = UUIDChecker.generateUUID(msoLogger);
+ String requestId = UUID.randomUUID().toString();
long startTime = System.currentTimeMillis();
- msoLogger.debug("requestId is: " + requestId);
CompareModelsRequest e2eCompareModelReq;
@@ -228,15 +230,13 @@ public class E2EServiceInstances {
} catch (Exception e) {
- msoLogger.debug("Mapping of request to JSON object failed : ", e);
+ logger.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, version);
- 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 + response.getEntity().toString());
+ logger.error("{} {} {} {}", MessageEnum.APIH_REQUEST_VALIDATION_ERROR.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.SchemaError.getValue(), requestJSON, e);
+ logger.debug(END_OF_THE_TRANSACTION + response.getEntity().toString());
return response;
}
@@ -264,7 +264,7 @@ public class E2EServiceInstances {
String bpmnRequest = jjo.toString();
// Capture audit event
- msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
+ logger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
String serviceId = instanceIdMap.get("serviceId");
String serviceType = e2eCompareModelReq.getServiceType();
RequestClientParameter postParam = new RequestClientParameter.Builder()
@@ -277,32 +277,22 @@ public class E2EServiceInstances {
.setRequestDetails(bpmnRequest)
.setALaCarte(false).build();
response = requestClient.post(postParam);
-
- msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
- "Successfully received response from BPMN engine", "BPMN", workflowUrl, null);
} catch (Exception e) {
- msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.ERROR,
- MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine", "BPMN",
- workflowUrl, null);
Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
MsoException.ServiceException, "Failed calling bpmn " + e.getMessage(),
ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
- msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+ logger.error("", MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine",e);
- msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
- "Exception while communicate with BPMN engine");
- msoLogger.debug(END_OF_THE_TRANSACTION + resp.getEntity().toString());
+ logger.debug(END_OF_THE_TRANSACTION + resp.getEntity().toString());
return resp;
}
if (response == null) {
Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
"bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
- 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 + resp.getEntity().toString());
+ logger.error("{} {} {} {}", MessageEnum.APIH_BPEL_COMMUNICATE_ERROR.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Null response from BPEL");
+ logger.debug(END_OF_THE_TRANSACTION + resp.getEntity().toString());
return resp;
}
@@ -327,24 +317,14 @@ public class E2EServiceInstances {
operationStatus = requestsDbClient.getOneByServiceIdAndOperationId(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);
+ logger.error("{} {} {} {}", MessageEnum.APIH_DB_ACCESS_EXC.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.AvailabilityError.getValue(),
+ "Exception while communciate with Request DB - Infra Request Lookup", e);
Response response = msoRequest.buildServiceErrorResponse(
HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
e.getMessage(),
ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB, null, version);
-
- msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
- MsoLogger.ResponseCode.DBAccessError,
- "Exception while communciate with Request DB");
- msoLogger.debug(END_OF_THE_TRANSACTION
- + response.getEntity());
+ logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
@@ -354,15 +334,10 @@ public class E2EServiceInstances {
HttpStatus.SC_NO_CONTENT, MsoException.ServiceException,
"E2E serviceId " + serviceId + " is not found in DB",
ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null, version);
- 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
- + resp.getEntity());
+ logger.error("{} {} {} {}", MessageEnum.APIH_BPEL_COMMUNICATE_ERROR.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+ "Null response from RequestDB when searching by serviceId");
+ logger.debug(END_OF_THE_TRANSACTION + resp.getEntity());
return resp;
}
@@ -375,9 +350,7 @@ public class E2EServiceInstances {
private Response deleteE2EserviceInstances(String requestJSON,
Action action, HashMap<String, String> instanceIdMap, String version) throws ApiException {
// TODO should be a new one or the same service instance Id
- String requestId = UUIDChecker.generateUUID(msoLogger);
long startTime = System.currentTimeMillis();
- msoLogger.debug("requestId is: " + requestId);
E2EServiceInstanceDeleteRequest e2eDelReq;
ObjectMapper mapper = new ObjectMapper();
@@ -387,63 +360,49 @@ public class E2EServiceInstances {
} catch (Exception e) {
- msoLogger.debug("Mapping of request to JSON object failed : ", e);
+ logger.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, version);
- 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
- + response.getEntity());
+ logger.error("{} {} {} {}", MessageEnum.APIH_REQUEST_VALIDATION_ERROR.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.SchemaError.getValue(), requestJSON, e);
+ logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
+ String requestId = UUID.randomUUID().toString();
RecipeLookupResult recipeLookupResult;
try {
//TODO Get the service template model version uuid from AAI.
recipeLookupResult = getServiceInstanceOrchestrationURI(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);
+ logger.error(MessageEnum.APIH_DB_ACCESS_EXC.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.AvailabilityError.getValue(), "Exception while communciate with Catalog DB", e);
Response response = msoRequest.buildServiceErrorResponse(
HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
"No communication to catalog DB " + e.getMessage(),
ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
- msoRequest.createErrorRequestRecord(Status.FAILED, requestId, "Exception while communciate with Catalog DB", action, ModelType.service.name(), requestJSON);
- msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
- MsoLogger.ResponseCode.DBAccessError,
- "Exception while communciate with DB");
- msoLogger.debug(END_OF_THE_TRANSACTION
- + response.getEntity());
+ msoRequest.createErrorRequestRecord(Status.FAILED, requestId, "Exception while communciate with "
+ + "Catalog DB", action,
+ ModelType.service.name(), requestJSON);
+ logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
if (recipeLookupResult == null) {
- msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND,
- MSO_PROP_APIHANDLER_INFRA, "", "",
- MsoLogger.ErrorCode.DataError, "No recipe found in DB");
+ logger.error("{} {} {} {}", MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.DataError.getValue(), "No recipe found in DB");
Response response = msoRequest.buildServiceErrorResponse(
HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
"Recipe does not exist in catalog DB",
ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null, version);
msoRequest.createErrorRequestRecord(Status.FAILED, requestId,"Recipe does not exist in catalog DB", action, ModelType.service.name(), requestJSON);
-
- msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
- MsoLogger.ResponseCode.DataNotFound,
- "No recipe found in DB");
- msoLogger.debug(END_OF_THE_TRANSACTION
- + response.getEntity());
+ logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
@@ -455,14 +414,12 @@ public class E2EServiceInstances {
requestClient = requestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI());
JSONObject jjo = new JSONObject(requestJSON);
- jjo.put("operationId", UUIDChecker.generateUUID(msoLogger));
+ jjo.put("operationId", requestId);
String bpmnRequest = jjo.toString();
// Capture audit event
- msoLogger
- .debug("MSO API Handler Posting call to BPEL engine for url: "
- + requestClient.getUrl());
+ logger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
String serviceId = instanceIdMap.get("serviceId");
String serviceInstanceType = e2eDelReq.getServiceType();
RequestClientParameter clientParam = new RequestClientParameter.Builder()
@@ -478,29 +435,14 @@ public class E2EServiceInstances {
.setRecipeParamXsd(recipeLookupResult.getRecipeParamXsd()).build();
response = requestClient.post(clientParam);
- 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, version);
- 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: "
- + resp.getEntity());
+ logger.error("{} {} {} {}", MessageEnum.APIH_BPEL_COMMUNICATE_ERROR.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.AvailabilityError.getValue(), "Exception while communicate with BPMN engine");
+ logger.debug("End of the transaction, the final response is: " + resp.getEntity());
return resp;
}
@@ -509,14 +451,9 @@ public class E2EServiceInstances {
HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
"bpelResponse is null",
ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
- 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 + resp.getEntity());
+ logger.error("{} {} {} {}", MessageEnum.APIH_BPEL_COMMUNICATE_ERROR.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Null response from BPEL");
+ logger.debug(END_OF_THE_TRANSACTION + resp.getEntity());
return resp;
}
@@ -531,9 +468,8 @@ public class E2EServiceInstances {
private Response updateE2EserviceInstances(String requestJSON, Action action,
HashMap<String, String> instanceIdMap, String version) throws ApiException {
- String requestId = UUIDChecker.generateUUID(msoLogger);
+ String requestId = UUID.randomUUID().toString();
long startTime = System.currentTimeMillis();
- msoLogger.debug("requestId is: " + requestId);
E2EServiceInstanceRequest e2eSir;
String serviceId = instanceIdMap.get("serviceId");
@@ -543,15 +479,13 @@ public class E2EServiceInstances {
} catch (Exception e) {
- msoLogger.debug("Mapping of request to JSON object failed : ", e);
+ logger.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, version);
- 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 + response.getEntity());
+ logger.error("{} {} {} {}", MessageEnum.APIH_REQUEST_VALIDATION_ERROR.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.SchemaError.getValue(), requestJSON, e);
+ logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
@@ -560,18 +494,16 @@ public class E2EServiceInstances {
try {
parseRequest(sir, instanceIdMap, action, version, requestJSON, false, requestId);
} catch (Exception e) {
- msoLogger.debug("Validation failed: ", e);
+ logger.debug("Validation failed: ", e);
Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,
MsoException.ServiceException, "Error parsing request. " + e.getMessage(),
ErrorNumbers.SVC_BAD_PARAMETER, null, version);
if (requestId != null) {
- msoLogger.debug("Logging failed message to the database");
+ logger.debug("Logging failed message to the database");
}
- 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 + response.getEntity());
+ logger.error("{} {} {} {}", MessageEnum.APIH_REQUEST_VALIDATION_ERROR.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.SchemaError.getValue(), requestJSON, e);
+ logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
@@ -579,30 +511,24 @@ public class E2EServiceInstances {
try {
recipeLookupResult = getServiceInstanceOrchestrationURI(e2eSir.getService().getServiceUuid(), 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);
+ logger.error("{} {} {} {}", MessageEnum.APIH_DB_ACCESS_EXC.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.AvailabilityError.getValue(), "Exception while communciate with Catalog DB", e);
Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
MsoException.ServiceException, "No communication to catalog DB " + e.getMessage(),
ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
-
-
- msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
- "Exception while communciate with DB");
- msoLogger.debug(END_OF_THE_TRANSACTION + response.getEntity());
+
+ logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
if (recipeLookupResult == null) {
- msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, MSO_PROP_APIHANDLER_INFRA, "", "",
- MsoLogger.ErrorCode.DataError, "No recipe found in DB");
+ logger.error("{} {} {} {}", MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.DataError.getValue(), "No recipe found in DB");
Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
MsoException.ServiceException, "Recipe does not exist in catalog DB",
ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null, version);
-
- msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
- "No recipe found in DB");
- msoLogger.debug(END_OF_THE_TRANSACTION + response.getEntity());
+ logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
@@ -619,7 +545,7 @@ public class E2EServiceInstances {
requestClient = requestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI());
// Capture audit event
- msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
+ logger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
RequestClientParameter postParam = new RequestClientParameter.Builder()
.setRequestId(requestId)
.setBaseVfModule(false)
@@ -632,24 +558,15 @@ public class E2EServiceInstances {
.setALaCarte(false)
.setRecipeParamXsd(recipeLookupResult.getRecipeParamXsd()).build();
response = requestClient.post(postParam);
-
- msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
- "Successfully received response from BPMN engine", "BPMN", recipeLookupResult.getOrchestrationURI(),
- null);
} catch (Exception e) {
- msoLogger.debug("Exception while communicate with BPMN engine", e);
- msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.ERROR,
- MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine", "BPMN",
- recipeLookupResult.getOrchestrationURI(), null);
+ logger.debug("Exception while communicate with BPMN engine", e);
Response getBPMNResp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
MsoException.ServiceException, "Failed calling bpmn " + e.getMessage(),
ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
- 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 + getBPMNResp.getEntity());
+ logger.error("{} {} {} {}", MessageEnum.APIH_BPEL_COMMUNICATE_ERROR.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.AvailabilityError.getValue(), "Exception while communicate with BPMN engine");
+ logger.debug(END_OF_THE_TRANSACTION + getBPMNResp.getEntity());
return getBPMNResp;
}
@@ -657,11 +574,9 @@ public class E2EServiceInstances {
if (response == null) {
Response getBPMNResp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
MsoException.ServiceException, "bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
- 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 + getBPMNResp.getEntity());
+ logger.error("{} {} {} {}", MessageEnum.APIH_BPEL_COMMUNICATE_ERROR.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Null response from BPEL");
+ logger.debug(END_OF_THE_TRANSACTION + getBPMNResp.getEntity());
return getBPMNResp;
}
@@ -675,9 +590,8 @@ public class E2EServiceInstances {
private Response processE2EserviceInstances(String requestJSON, Action action,
HashMap<String, String> instanceIdMap, String version) throws ApiException {
- String requestId = UUIDChecker.generateUUID(msoLogger);
+ String requestId = UUID.randomUUID().toString();
long startTime = System.currentTimeMillis();
- msoLogger.debug("requestId is: " + requestId);
E2EServiceInstanceRequest e2eSir;
MsoRequest msoRequest = new MsoRequest();
@@ -687,15 +601,13 @@ public class E2EServiceInstances {
} catch (Exception e) {
- msoLogger.debug("Mapping of request to JSON object failed : ", e);
+ logger.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, version);
- 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 + response.getEntity());
+ logger.error("{} {} {} {}", MessageEnum.APIH_REQUEST_VALIDATION_ERROR.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.SchemaError.getValue(), requestJSON, e);
+ logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
@@ -704,18 +616,16 @@ public class E2EServiceInstances {
try {
parseRequest(sir, instanceIdMap, action, version, requestJSON, false, requestId);
} catch (Exception e) {
- msoLogger.debug("Validation failed: ", e);
+ logger.debug("Validation failed: ", e);
Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,
MsoException.ServiceException, "Error parsing request. " + e.getMessage(),
ErrorNumbers.SVC_BAD_PARAMETER, null, version);
if (requestId != null) {
- msoLogger.debug("Logging failed message to the database");
+ logger.debug("Logging failed message to the database");
}
- 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 + response.getEntity());
+ logger.error("{} {} {} {}", MessageEnum.APIH_REQUEST_VALIDATION_ERROR.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.SchemaError.getValue(), requestJSON, e);
+ logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
@@ -723,28 +633,22 @@ public class E2EServiceInstances {
try {
recipeLookupResult = getServiceInstanceOrchestrationURI(e2eSir.getService().getServiceUuid(), 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);
+ logger.error("{} {} {} {}", MessageEnum.APIH_DB_ACCESS_EXC.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.AvailabilityError.getValue(), "Exception while communciate with Catalog DB", e);
Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
MsoException.ServiceException, "No communication to catalog DB " + e.getMessage(),
ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
-
- msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
- "Exception while communciate with DB");
- msoLogger.debug(END_OF_THE_TRANSACTION + response.getEntity());
+ logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
if (recipeLookupResult == null) {
- msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, MSO_PROP_APIHANDLER_INFRA, "", "",
- MsoLogger.ErrorCode.DataError, "No recipe found in DB");
+ logger.error("{} {} {} {}", MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.DataError.getValue(), "No recipe found in DB");
Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
MsoException.ServiceException, "Recipe does not exist in catalog DB",
ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null, version);
-
- msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
- "No recipe found in DB");
- msoLogger.debug(END_OF_THE_TRANSACTION + response.getEntity());
+ logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
return response;
}
@@ -761,7 +665,7 @@ public class E2EServiceInstances {
requestClient = requestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI());
// Capture audit event
- msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
+ logger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
RequestClientParameter parameter = new RequestClientParameter.Builder()
.setRequestId(requestId)
.setBaseVfModule(false)
@@ -774,34 +678,23 @@ public class E2EServiceInstances {
.setALaCarte(false)
.setRecipeParamXsd(recipeLookupResult.getRecipeParamXsd()).build();
response = requestClient.post(parameter);
-
- 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, version);
-
- 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 + resp.getEntity());
+
+ logger.error("{} {} {} {}", MessageEnum.APIH_BPEL_COMMUNICATE_ERROR.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.AvailabilityError.getValue(), "Exception while communicate with BPMN engine");
+ logger.debug(END_OF_THE_TRANSACTION + resp.getEntity());
return resp;
}
if (response == null) {
Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
MsoException.ServiceException, "bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
- 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 + resp.getEntity());
+ logger.error("{} {} {} {}", MessageEnum.APIH_BPEL_COMMUNICATE_ERROR.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Null response from BPEL");
+ logger.debug(END_OF_THE_TRANSACTION + resp.getEntity());
return resp;
}
@@ -815,9 +708,8 @@ public class E2EServiceInstances {
private Response scaleE2EserviceInstances(String requestJSON,
Action action, HashMap<String, String> instanceIdMap, String version) throws ApiException {
- String requestId = UUIDChecker.generateUUID(msoLogger);
+ String requestId = UUID.randomUUID().toString();
long startTime = System.currentTimeMillis();
- msoLogger.debug("requestId is: " + requestId);
E2EServiceInstanceScaleRequest e2eScaleReq;
ObjectMapper mapper = new ObjectMapper();
@@ -827,22 +719,17 @@ public class E2EServiceInstances {
} catch (Exception e) {
- msoLogger.debug("Mapping of request to JSON object failed : ", e);
+ logger.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, version);
- 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
- + response.getEntity());
- return response;
+ logger.error("{} {} {} {}", MessageEnum.APIH_REQUEST_VALIDATION_ERROR.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.SchemaError.getValue(), requestJSON, e);
+ logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
+ return response;
}
RecipeLookupResult recipeLookupResult;
@@ -850,40 +737,29 @@ public class E2EServiceInstances {
//TODO Get the service template model version uuid from AAI.
recipeLookupResult = getServiceInstanceOrchestrationURI(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);
-
- Response response = msoRequest.buildServiceErrorResponse(
+ logger.error("{} {} {} {}", MessageEnum.APIH_DB_ACCESS_EXC.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.AvailabilityError.getValue(), "Exception while communciate with Catalog DB", e);
+
+ Response response = msoRequest.buildServiceErrorResponse(
HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
"No communication to catalog DB " + e.getMessage(),
ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
msoRequest.createErrorRequestRecord(Status.FAILED, requestId, "No communication to catalog DB " + e.getMessage(), action, ModelType.service.name(), requestJSON);
- msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
- MsoLogger.ResponseCode.DBAccessError,
- "Exception while communciate with DB");
- msoLogger.debug(END_OF_THE_TRANSACTION
- + response.getEntity());
- return response;
+ logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
+ return response;
}
if (recipeLookupResult == null) {
- msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND,
- MSO_PROP_APIHANDLER_INFRA, "", "",
- MsoLogger.ErrorCode.DataError, "No recipe found in DB");
-
- Response response = msoRequest.buildServiceErrorResponse(
+ logger.error("{} {} {} {}", MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.DataError.getValue(), "No recipe found in DB");
+
+ Response response = msoRequest.buildServiceErrorResponse(
HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
"Recipe does not exist in catalog DB",
ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null, version);
msoRequest.createErrorRequestRecord(Status.FAILED, requestId, "No recipe found in DB", action, ModelType.service.name(), requestJSON);
- msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
- MsoLogger.ResponseCode.DataNotFound,
- "No recipe found in DB");
- msoLogger.debug(END_OF_THE_TRANSACTION
- + response.getEntity());
- return response;
+ logger.debug(END_OF_THE_TRANSACTION + response.getEntity());
+ return response;
}
RequestClient requestClient;
@@ -894,15 +770,13 @@ public class E2EServiceInstances {
requestClient = requestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI());
JSONObject jjo = new JSONObject(requestJSON);
- jjo.put("operationId", UUIDChecker.generateUUID(msoLogger));
+ jjo.put("operationId", requestId);
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");
+ logger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
+ String serviceId = instanceIdMap.get("serviceId");
String serviceInstanceType = e2eScaleReq.getService().getServiceType();
RequestClientParameter postParam = new RequestClientParameter.Builder()
.setRequestId(requestId)
@@ -916,32 +790,16 @@ public class E2EServiceInstances {
.setALaCarte(false)
.setRecipeParamXsd(recipeLookupResult.getRecipeParamXsd()).build();
response = requestClient.post(postParam);
-
- 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);
+ } catch (Exception e) {
Response resp = msoRequest.buildServiceErrorResponse(
HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
"Failed calling bpmn " + e.getMessage(),
ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
-
- msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
- MSO_PROP_APIHANDLER_INFRA, "", "",
- MsoLogger.ErrorCode.AvailabilityError,
- "Exception while communicate with BPMN engine",e);
- msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
- MsoLogger.ResponseCode.CommunicationError,
- "Exception while communicate with BPMN engine");
- msoLogger.debug(END_OF_THE_TRANSACTION
- + resp.getEntity());
- return resp;
+
+ logger.error("{} {} {} {}", MessageEnum.APIH_BPEL_COMMUNICATE_ERROR.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.AvailabilityError.getValue(), "Exception while communicate with BPMN engine", e);
+ logger.debug(END_OF_THE_TRANSACTION + resp.getEntity());
+ return resp;
}
if (response == null) {
@@ -949,15 +807,10 @@ public class E2EServiceInstances {
HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
"bpelResponse is null",
ErrorNumbers.SVC_NO_SERVER_RESOURCES, null, version);
- 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 + resp.getEntity());
- return resp;
+ logger.error("{} {} {} {}", MessageEnum.APIH_BPEL_COMMUNICATE_ERROR.toString(), MSO_PROP_APIHANDLER_INFRA,
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(), "Null response from BPEL");
+ logger.debug(END_OF_THE_TRANSACTION + resp.getEntity());
+ return resp;
}
ResponseHandler respHandler = new ResponseHandler(response,
@@ -978,11 +831,8 @@ public class E2EServiceInstances {
// BPMN accepted the request, the request is in progress
if (bpelStatus == HttpStatus.SC_ACCEPTED) {
String camundaJSONResponseBody = respHandler.getResponseBody();
- msoLogger.debug("Received from Camunda: " + camundaJSONResponseBody);
- 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);
+ logger.debug("Received from Camunda: " + camundaJSONResponseBody);
+ logger.debug(END_OF_THE_TRANSACTION + camundaJSONResponseBody);
return builder.buildResponse(HttpStatus.SC_ACCEPTED, null, camundaJSONResponseBody, apiVersion);
} else {
List<String> variables = new ArrayList<>();
@@ -995,17 +845,10 @@ public class E2EServiceInstances {
"Request Failed due to BPEL error with HTTP Status= %1 "
+ '\n' + camundaJSONResponseBody,
ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, variables, version);
- 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
- + resp.getEntity());
+ logger.error("{} {} {} {}", MessageEnum.APIH_BPEL_RESPONSE_ERROR.toString(), requestClient.getUrl(),
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
+ "Response from BPEL engine is failed with HTTP Status=" + bpelStatus);
+ logger.debug(END_OF_THE_TRANSACTION + resp.getEntity());
return resp;
} else {
Response resp = msoRequest
@@ -1015,16 +858,10 @@ public class E2EServiceInstances {
"Request Failed due to BPEL error with HTTP Status= %1",
ErrorNumbers.SVC_DETAILED_SERVICE_ERROR,
variables, version);
- 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,
+ logger.error("", MessageEnum.APIH_BPEL_RESPONSE_ERROR.toString(), requestClient.getUrl(),
+ MsoLogger.ErrorCode.BusinessProcesssError.getValue(),
"Response from BPEL engine is empty");
- msoLogger.debug(END_OF_THE_TRANSACTION
- + resp.getEntity());
+ logger.debug(END_OF_THE_TRANSACTION + resp.getEntity());
return resp;
}
}
@@ -1042,12 +879,11 @@ public class E2EServiceInstances {
RecipeLookupResult recipeLookupResult = getServiceURI(serviceModelUUID, action);
if (recipeLookupResult != null) {
- msoLogger.debug("Orchestration URI is: "
- + recipeLookupResult.getOrchestrationURI()
- + ", recipe Timeout is: "
- + Integer.toString(recipeLookupResult.getRecipeTimeout()));
+ logger.debug(
+ "Orchestration URI is: " + recipeLookupResult.getOrchestrationURI() + ", recipe Timeout is: " + Integer
+ .toString(recipeLookupResult.getRecipeTimeout()));
} else {
- msoLogger.debug("No matching recipe record found");
+ logger.debug("No matching recipe record found");
}
return recipeLookupResult;
}
@@ -1204,9 +1040,7 @@ public class E2EServiceInstances {
try {
returnString = mapper.writeValueAsString(sir);
} catch (IOException e) {
- msoLogger
- .debug("Exception while converting ServiceInstancesRequest object to string",
- e);
+ logger.debug("Exception while converting ServiceInstancesRequest object to string", e);
}
return returnString;
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java
index b002aa9f54..07c98c19b9 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java
@@ -114,8 +114,6 @@ public class GlobalHealthcheckHandler {
HealthcheckResponse rsp = new HealthcheckResponse();
try{
- long startTime = System.currentTimeMillis ();
- MsoLogger.setServiceName ("GlobalHealthcheck");
// Generated RequestId
String requestId = requestContext.getProperty("requestId").toString();
MsoLogger.setLogContext(requestId, null);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java
index e6bbc4de4a..182e398461 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java
@@ -29,6 +29,7 @@ import org.onap.so.apihandler.filters.RequestUriFilter;
import org.onap.so.apihandlerinfra.exceptions.ApiExceptionMapper;
import org.onap.so.apihandlerinfra.tenantisolation.CloudOrchestration;
import org.onap.so.apihandlerinfra.tenantisolation.CloudResourcesOrchestration;
+import org.onap.so.apihandlerinfra.tenantisolation.ModelDistributionRequest;
import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging;
import org.onap.so.web.exceptions.RuntimeExceptionMapper;
import org.springframework.context.annotation.Configuration;
@@ -64,6 +65,7 @@ public class JerseyConfiguration extends ResourceConfig {
// this registration seems to be needed to get predictable
// execution behavior for the above JSON Exception Mappers
register(com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider.class);
+ register(ModelDistributionRequest.class);
property(ServletProperties.FILTER_FORWARD_ON_404, true);
BeanConfig beanConfig = new BeanConfig();
beanConfig.setVersion("1.0.2");
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java
index 411a5e584a..886e0d5133 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java
@@ -699,7 +699,6 @@ public class MsoRequest {
String vfModuleType = null;
String vfModuleModelName = null;
ModelInfo modelInfo = sir.getRequestDetails().getModelInfo();
- MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.APIH, MsoRequest.class);
RelatedInstanceList[] instanceList = sir.getRequestDetails().getRelatedInstanceList();
String serviceModelName = null;
String vnfModelName = null;
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/NodeHealthcheckHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/NodeHealthcheckHandler.java
index cb458a7420..351a35826d 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/NodeHealthcheckHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/NodeHealthcheckHandler.java
@@ -34,7 +34,6 @@ import javax.ws.rs.core.Response;
import org.apache.http.HttpStatus;
import org.onap.so.logger.MessageEnum;
-import org.onap.so.logger.MsoLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@@ -60,8 +59,6 @@ public class NodeHealthcheckHandler {
@ApiOperation(value="Performing node health check",response=Response.class)
@Transactional
public Response nodeHealthcheck (@Context ContainerRequestContext requestContext) throws UnknownHostException {
- long startTime = System.currentTimeMillis ();
- MsoLogger.setServiceName ("NodeHealthcheck");
// Generated RequestId
String requestId = requestContext.getProperty("requestId").toString();
logger.info("{} {}", MessageEnum.APIH_GENERATED_REQUEST_ID.toString(), requestId);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
index 1f9f5f5fbe..2dab494b07 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java
@@ -657,7 +657,7 @@ public class ServiceInstances {
public Response deleteInstanceGroups(@PathParam("version") String version, @PathParam("instanceGroupId") String instanceGroupId, @Context ContainerRequestContext requestContext) throws ApiException {
String requestId = getRequestId(requestContext);
HashMap<String, String> instanceIdMap = new HashMap<>();
- instanceIdMap.put(CommonConstants.INSTANCE_GROUP_ID, instanceGroupId);
+ instanceIdMap.put(CommonConstants.INSTANCE_GROUP_INSTANCE_ID, instanceGroupId);
return deleteInstanceGroups(Action.deleteInstance, instanceIdMap, version, requestId, getRequestUri(requestContext), requestContext);
}
@@ -670,7 +670,7 @@ public class ServiceInstances {
public Response addInstanceGroupMembers(String request, @PathParam("version") String version, @PathParam("instanceGroupId") String instanceGroupId, @Context ContainerRequestContext requestContext) throws ApiException {
String requestId = getRequestId(requestContext);
HashMap<String, String> instanceIdMap = new HashMap<>();
- instanceIdMap.put(CommonConstants.INSTANCE_GROUP_ID, instanceGroupId);
+ instanceIdMap.put(CommonConstants.INSTANCE_GROUP_INSTANCE_ID, instanceGroupId);
return serviceInstances(request, Action.addMembers, instanceIdMap, version, requestId, getRequestUri(requestContext));
}
@@ -683,7 +683,7 @@ public class ServiceInstances {
public Response removeInstanceGroupMembers(String request, @PathParam("version") String version, @PathParam("instanceGroupId") String instanceGroupId, @Context ContainerRequestContext requestContext) throws ApiException {
String requestId = getRequestId(requestContext);
HashMap<String, String> instanceIdMap = new HashMap<>();
- instanceIdMap.put(CommonConstants.INSTANCE_GROUP_ID, instanceGroupId);
+ instanceIdMap.put(CommonConstants.INSTANCE_GROUP_INSTANCE_ID, instanceGroupId);
return serviceInstances(request, Action.removeMembers, instanceIdMap, version, requestId, getRequestUri(requestContext));
}
@@ -808,16 +808,13 @@ public class ServiceInstances {
}
- serviceInstanceId = "";
+ serviceInstanceId = setServiceInstanceId(requestScope, sir);
String vnfId = "";
String vfModuleId = "";
String volumeGroupId = "";
String networkId = "";
String pnfCorrelationId = "";
String instanceGroupId = null;
- if(sir.getServiceInstanceId () != null){
- serviceInstanceId = sir.getServiceInstanceId ();
- }
if(sir.getVnfInstanceId () != null){
vnfId = sir.getVnfInstanceId ();
@@ -884,7 +881,7 @@ public class ServiceInstances {
return postBPELRequest(currentActiveReq, requestClientParameter, recipeLookupResult.getOrchestrationURI(), requestScope);
}
public Response deleteInstanceGroups(Actions action, HashMap<String, String> instanceIdMap, String version, String requestId, String requestUri, ContainerRequestContext requestContext) throws ApiException {
- String instanceGroupId = instanceIdMap.get(CommonConstants.INSTANCE_GROUP_ID);
+ String instanceGroupId = instanceIdMap.get(CommonConstants.INSTANCE_GROUP_INSTANCE_ID);
Boolean aLaCarte = true;
long startTime = System.currentTimeMillis ();
String apiVersion = version.substring(1);
@@ -1117,8 +1114,8 @@ public class ServiceInstances {
if(instanceIdMap.get("configurationInstanceId") != null){
currentActiveReq.setConfigurationId(instanceIdMap.get("configurationInstanceId"));
}
- if(instanceIdMap.get("InstanceGroupInstanceId") != null){
- currentActiveReq.setInstanceGroupId(instanceIdMap.get("InstanceGroupInstanceId"));
+ if(instanceIdMap.get(CommonConstants.INSTANCE_GROUP_INSTANCE_ID) != null){
+ currentActiveReq.setInstanceGroupId(instanceIdMap.get(CommonConstants.INSTANCE_GROUP_INSTANCE_ID));
}
}
}
@@ -1249,6 +1246,7 @@ public class ServiceInstances {
try {
msoRequest.parse(sir, instanceIdMap, action, version, requestJSON, reqVersion, aLaCarte);
} catch (Exception e) {
+ logger.error("failed to parse request", e);
ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MsoLogger.ErrorCode.SchemaError).errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
ValidateException validateException = new ValidateException.Builder("Error parsing request: " + e.getMessage(), HttpStatus.SC_BAD_REQUEST, ErrorNumbers.SVC_BAD_PARAMETER).cause(e)
.errorInfo(errorLoggerInfo).build();
@@ -1969,4 +1967,20 @@ public class ServiceInstances {
}
return serviceType;
}
+ protected String setServiceInstanceId(String requestScope, ServiceInstancesRequest sir){
+ if(sir.getServiceInstanceId () != null){
+ return sir.getServiceInstanceId ();
+ }else if(requestScope.equalsIgnoreCase(ModelType.instanceGroup.toString())){
+ RelatedInstanceList[] relatedInstances = sir.getRequestDetails().getRelatedInstanceList();
+ if(relatedInstances != null){
+ for(RelatedInstanceList relatedInstanceList : relatedInstances){
+ RelatedInstance relatedInstance = relatedInstanceList.getRelatedInstance();
+ if(relatedInstance.getModelInfo().getModelType() == ModelType.service){
+ return relatedInstance.getInstanceId();
+ }
+ }
+ }
+ }
+ return null;
+ }
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java
index 377b03c4ab..9305b80c13 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java
@@ -158,7 +158,6 @@ public class CloudResourcesOrchestration {
@ApiOperation(value="Get status of an Operational Environment based on filter criteria",response=Response.class)
@Transactional
public Response getOperationEnvironmentStatusFilter(@Context UriInfo ui, @PathParam("version") String version ) throws ApiException{
- MsoLogger.setServiceName ("getOperationEnvironmentStatusFilter");
MultivaluedMap<String, String> queryParams = ui.getQueryParameters();
List<String> requestIdKey = queryParams.get("requestId");
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java
index ace0fb664c..3ec3ade959 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java
@@ -28,7 +28,7 @@ import java.util.List;
import javax.inject.Provider;
import javax.transaction.Transactional;
import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
+import javax.ws.rs.PATCH;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
@@ -53,6 +53,7 @@ import org.onap.so.serviceinstancebeans.ServiceException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -61,7 +62,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
-
+@Component
@Path("/onap/so/infra/modelDistributions")
@Api(value="/onap/so/infra/modelDistributions",description="API Requests for Model Distributions")
public class ModelDistributionRequest {
@@ -70,7 +71,7 @@ public class ModelDistributionRequest {
@Autowired
private Provider<TenantIsolationRunnable> tenantIsolationRunnable;
- @POST
+ @PATCH
@Path("/{version:[vV][1]}/distributions/{distributionId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java
index 9303e12071..31c65e1bd2 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java
@@ -82,6 +82,7 @@ public class SDCClientHelper {
try {
String urlString = this.buildUriBuilder(serviceModelVersionId, operationalEnvironmentId);
+ logger.debug("Url ASDC Activate request: {}", urlString);
String jsonPayload = this.buildJsonWorkloadContext(workloadContext);
String basicAuthCred = getBasicAuth();
@@ -157,6 +158,7 @@ public class SDCClientHelper {
enhancedAsdcResponseJsonObj.put("statusCode", Integer.toString(statusCode));
enhancedAsdcResponseJsonObj.put("messageId", "");
enhancedAsdcResponseJsonObj.put("message", "Success");
+ logger.debug("Url ASDC Activate response: {} {}", "distributionId ", sdcResponseJsonObj.get("distributionId"));
} else { // error
if (sdcResponseJsonObj.has("requestError") ) {
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/InstanceIdMapValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/InstanceIdMapValidation.java
index f1985e9fcf..fad11a5cc6 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/InstanceIdMapValidation.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/InstanceIdMapValidation.java
@@ -77,11 +77,11 @@ public class InstanceIdMapValidation implements ValidationRule{
sir.setConfigurationId(instanceIdMap.get("configurationInstanceId"));
}
- if(instanceIdMap.get(CommonConstants.INSTANCE_GROUP_ID) != null){
- if (!UUIDChecker.isValidUUID (instanceIdMap.get (CommonConstants.INSTANCE_GROUP_ID))) {
- throw new ValidationException (CommonConstants.INSTANCE_GROUP_ID, true);
+ if(instanceIdMap.get(CommonConstants.INSTANCE_GROUP_INSTANCE_ID) != null){
+ if (!UUIDChecker.isValidUUID (instanceIdMap.get (CommonConstants.INSTANCE_GROUP_INSTANCE_ID))) {
+ throw new ValidationException (CommonConstants.INSTANCE_GROUP_INSTANCE_ID, true);
}
- sir.setInstanceGroupId(instanceIdMap.get(CommonConstants.INSTANCE_GROUP_ID));
+ sir.setInstanceGroupId(instanceIdMap.get(CommonConstants.INSTANCE_GROUP_INSTANCE_ID));
}
}
return info;
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java
index 145213fc6c..ee98accfdc 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java
@@ -430,12 +430,12 @@ public class MsoRequestTest extends BaseTest {
@Test
public void instanceGroupIdHashMapFailureTest() throws JsonParseException, JsonMappingException, IOException, ValidationException{
this.sir = mapper.readValue(inputStream("/SuccessfulValidation/InstanceIdHashMap.json"), ServiceInstancesRequest.class);
- this.instanceIdMapTest.put("instanceGroupId", "test");
+ this.instanceIdMapTest.put("instanceGroupInstanceId", "test");
this.action = Action.createInstance;
thrown.expect(ValidationException.class);
this.reqVersion = 7;
this.version = "v" + reqVersion;
- thrown.expectMessage("No valid instanceGroupId is specified");
+ thrown.expectMessage("No valid instanceGroupInstanceId is specified");
this.msoRequest = new MsoRequest();
this.msoRequest.parse(sir, instanceIdMapTest, action, version, originalRequestJSON, reqVersion, false);
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
index 83b5a49e8c..23974ef1fa 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
@@ -31,6 +31,7 @@ import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
@@ -79,8 +80,10 @@ import org.springframework.util.ResourceUtils;
import org.springframework.web.util.UriComponentsBuilder;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.tomakehurst.wiremock.http.Fault;
@@ -114,9 +117,12 @@ public class ServiceInstancesTest extends BaseTest{
// set headers
headers = new HttpHeaders();
headers.set(ONAPLogConstants.Headers.PARTNER_NAME, "test_name");
- headers.set(ONAPLogConstants.Headers.REQUEST_ID, "32807a28-1a14-4b88-b7b3-2950918aa76d");
- headers.set(MsoLogger.REQUESTOR_ID, "xxxxxx");
- try { // generate one-time port number to avoid RANDOM port number later.
+ headers.set(MsoLogger.TRANSACTION_ID, "32807a28-1a14-4b88-b7b3-2950918aa76d");
+ headers.set(MsoLogger.ONAP_REQUEST_ID, "32807a28-1a14-4b88-b7b3-2950918aa76d");
+ headers.set(ONAPLogConstants.MDCs.REQUEST_ID, "32807a28-1a14-4b88-b7b3-2950918aa76d");
+ headers.set(MsoLogger.CLIENT_ID, "VID");
+ headers.set(MsoLogger.REQUESTOR_ID, "xxxxxx");
+ try { // generate one-time port number to avoid RANDOM port number later.
initialUrl = new URL(createURLWithPort(Constants.ORCHESTRATION_REQUESTS_PATH));
initialPort = initialUrl.getPort();
} catch (MalformedURLException e) {
@@ -391,9 +397,10 @@ public class ServiceInstancesTest extends BaseTest{
}
@Test
public void activateServiceInstanceNoRecipeALaCarte() throws IOException{
+ TestAppender.events.clear();
uri = servInstanceuri + "v5" + "/serviceInstances/f7ce78bb-423b-11e7-93f8-0050569a7968/activate";
HttpHeaders requestIDheaders = new HttpHeaders();
- requestIDheaders.set("X-ECOMP-RequestID", "32807a28-1a14-4b88-b7b3-2950918aa76d");
+ requestIDheaders.set(ONAPLogConstants.Headers.REQUEST_ID, "32807a28-1a14-4b88-b7b3-2950918aa76d");
ResponseEntity<String> response = sendRequest(inputStream("/ServiceInstanceALaCarteTrueNoRecipe.json"), uri, HttpMethod.POST, requestIDheaders);
Service defaultService = new Service();
@@ -2368,7 +2375,8 @@ public class ServiceInstancesTest extends BaseTest{
if(logEvent.getLoggerName().equals("org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging") &&
logEvent.getMarker() != null && logEvent.getMarker().getName().equals("ENTRY")){
Map<String,String> mdc = logEvent.getMDCPropertyMap();
- assertEquals("32807a28-1a14-4b88-b7b3-2950918aa76d", mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
+ assertEquals("32807a28-1a14-4b88-b7b3-2950918aa76d", mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
+ assertEquals("VID",mdc.get(MsoLogger.PARTNERNAME));
}
}
}
@@ -2425,6 +2433,7 @@ public class ServiceInstancesTest extends BaseTest{
public void deleteInstanceGroupNoPartnerNameHeader() throws IOException{
HttpHeaders noPartnerHeaders = new HttpHeaders();
noPartnerHeaders.set(ONAPLogConstants.Headers.REQUEST_ID, "eca3a1b1-43ab-457e-ab1c-367263d148b4");
+ noPartnerHeaders.set(MsoLogger.REQUESTOR_ID, "xxxxxx");
uri = servInstanceuri + "/v7/instanceGroups/e05864f0-ab35-47d0-8be4-56fd9619ba3c";
ResponseEntity<String> response = sendRequest(null, uri, HttpMethod.DELETE, noPartnerHeaders);
//then
@@ -2621,6 +2630,61 @@ public class ServiceInstancesTest extends BaseTest{
assertEquals(serviceType, "networkModelName");
}
@Test
+ public void setServiceInstanceIdInstanceGroupTest() throws JsonParseException, JsonMappingException, IOException{
+ String requestScope = "instanceGroup";
+ ServiceInstancesRequest sir = mapper.readValue(inputStream("/CreateInstanceGroup.json"), ServiceInstancesRequest.class);
+ assertEquals("ddcbbf3d-f2c1-4ca0-8852-76a807285efc", servInstances.setServiceInstanceId(requestScope, sir));
+ }
+ @Test
+ public void setServiceInstanceIdTest(){
+ String requestScope = "vnf";
+ ServiceInstancesRequest sir = new ServiceInstancesRequest();
+ sir.setServiceInstanceId("f0a35706-efc4-4e27-80ea-a995d7a2a40f");
+ assertEquals("f0a35706-efc4-4e27-80ea-a995d7a2a40f", servInstances.setServiceInstanceId(requestScope, sir));
+ }
+ @Test
+ public void setServiceInstanceIdReturnNullTest(){
+ String requestScope = "vnf";
+ ServiceInstancesRequest sir = new ServiceInstancesRequest();
+ assertNull(servInstances.setServiceInstanceId(requestScope, sir));
+ }
+ @Test
+ public void camundaHistoryCheckTest() throws ContactCamundaException, RequestDbFailureException{
+ stubFor(get(("/sobpmnengine/history/process-instance?variables=mso-request-id_eq_f0a35706-efc4-4e27-80ea-a995d7a2a40f"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBodyFile("Camunda/HistoryCheckResponse.json").withStatus(org.apache.http.HttpStatus.SC_OK)));
+
+ InfraActiveRequests duplicateRecord = new InfraActiveRequests();
+ duplicateRecord.setRequestId("f0a35706-efc4-4e27-80ea-a995d7a2a40f");
+ boolean inProgress = false;
+ inProgress = servInstances.camundaHistoryCheck(duplicateRecord, null);
+ assertTrue(inProgress);
+ }
+ @Test
+ public void camundaHistoryCheckNoneFoundTest() throws ContactCamundaException, RequestDbFailureException{
+ stubFor(get(("/sobpmnengine/history/process-instance?variables=mso-request-id_eq_f0a35706-efc4-4e27-80ea-a995d7a2a40f"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBody("[]").withStatus(org.apache.http.HttpStatus.SC_OK)));
+
+ InfraActiveRequests duplicateRecord = new InfraActiveRequests();
+ duplicateRecord.setRequestId("f0a35706-efc4-4e27-80ea-a995d7a2a40f");
+ boolean inProgress = false;
+ inProgress = servInstances.camundaHistoryCheck(duplicateRecord, null);
+ assertFalse(inProgress);
+ }
+ @Test
+ public void camundaHistoryCheckNotInProgressTest()throws ContactCamundaException, RequestDbFailureException{
+ stubFor(get(("/sobpmnengine/history/process-instance?variables=mso-request-id_eq_f0a35706-efc4-4e27-80ea-a995d7a2a40f"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBodyFile("Camunda/HistoryCheckResponseCompleted.json").withStatus(org.apache.http.HttpStatus.SC_OK)));
+
+ InfraActiveRequests duplicateRecord = new InfraActiveRequests();
+ duplicateRecord.setRequestId("f0a35706-efc4-4e27-80ea-a995d7a2a40f");
+ boolean inProgress = false;
+ inProgress = servInstances.camundaHistoryCheck(duplicateRecord, null);
+ assertFalse(inProgress);
+ }
+ @Test
public void setCamundaHeadersTest()throws ContactCamundaException, RequestDbFailureException{
String encryptedAuth = "015E7ACF706C6BBF85F2079378BDD2896E226E09D13DC2784BA309E27D59AB9FAD3A5E039DF0BB8408"; // user:password
String key = "07a7159d3bf51a0e53be7a8f89699be7";
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequestTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequestTest.java
index 9a8f4880f7..4e5cfaba48 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequestTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequestTest.java
@@ -24,13 +24,15 @@ import static org.hamcrest.Matchers.hasProperty;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.contains;
import static org.mockito.Mockito.doNothing;
+import java.io.IOException;
+
import javax.inject.Provider;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.apache.http.HttpStatus;
@@ -38,21 +40,23 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.Spy;
-import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.apihandler.common.ErrorNumbers;
-import org.onap.so.apihandlerinfra.ApiHandlerApplication;
import org.onap.so.apihandlerinfra.BaseTest;
import org.onap.so.apihandlerinfra.exceptions.ApiException;
import org.onap.so.apihandlerinfra.exceptions.ValidateException;
import org.onap.so.apihandlerinfra.tenantisolationbeans.Action;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.ActiveProfiles;
+import org.onap.so.apihandlerinfra.tenantisolationbeans.Distribution;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.util.UriComponentsBuilder;
+import com.fasterxml.jackson.databind.ObjectMapper;
public class ModelDistributionRequestTest extends BaseTest{
@@ -111,4 +115,22 @@ public class ModelDistributionRequestTest extends BaseTest{
assertEquals(200, response.getStatus());
}
+ @Test
+ public void testSuccess_PATCH() throws ApiException, IOException{
+ String path = "/onap/so/infra/modelDistributions/v1/distributions/ff3514e3-5a33-55df-13ab-12abad84e7fa";
+ ObjectMapper mapper = new ObjectMapper();
+ Distribution distRequest = mapper.readValue(requestJSON, Distribution.class);
+ HttpHeaders headers = new HttpHeaders();
+ headers.set("Accept", MediaType.APPLICATION_JSON);
+ headers.set("Content-Type", MediaType.APPLICATION_JSON);
+ HttpEntity<Distribution> entity = new HttpEntity<Distribution>(distRequest, headers);
+
+ UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(createURLWithPort(path));
+ ResponseEntity<String> response = restTemplate.exchange(
+ builder.toUriString(),
+ HttpMethod.PATCH, entity, String.class);
+ assertEquals(200, response.getStatusCodeValue());
+
+ }
+
}
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java
index 761aaa1446..e3f15764d7 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java
+++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java
@@ -551,6 +551,7 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
}
try {
final CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
+
final CriteriaQuery<InfraActiveRequests> criteriaQuery =
criteriaBuilder.createQuery(InfraActiveRequests.class);
final Root<InfraActiveRequests> tableRoot = criteriaQuery.from(InfraActiveRequests.class);
@@ -558,17 +559,12 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
final Timestamp minTime = new Timestamp(startTime);
final Timestamp maxTime = new Timestamp(endTime);
- predicates.add(criteriaBuilder.greaterThanOrEqualTo(tableRoot.get(START_TIME), minTime));
- predicates.add(criteriaBuilder.lessThanOrEqualTo(tableRoot.get(END_TIME), maxTime));
-
final Predicate basePredicate = criteriaBuilder.and(predicates.toArray(new Predicate[predicates.size()]));
-
- final Predicate additionalPredicate = criteriaBuilder.and(tableRoot.get(END_TIME).isNull(),
- criteriaBuilder.greaterThanOrEqualTo(tableRoot.get(START_TIME), minTime),
- criteriaBuilder.lessThanOrEqualTo(tableRoot.get(START_TIME), maxTime));
-
- criteriaQuery.where(criteriaBuilder.or(basePredicate, additionalPredicate));
+ final Predicate additionalPredicate = criteriaBuilder.and(
+ criteriaBuilder.greaterThanOrEqualTo(tableRoot.get(START_TIME), minTime),
+ criteriaBuilder.or(tableRoot.get(END_TIME).isNull(), criteriaBuilder.lessThanOrEqualTo(tableRoot.get(END_TIME), maxTime)));
+ criteriaQuery.where(criteriaBuilder.and(basePredicate, additionalPredicate));
if (maxResult != null) {
return entityManager.createQuery(criteriaQuery).setMaxResults(maxResult).getResultList();
}
@@ -579,7 +575,7 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
}
}
- private List<Predicate> getPredicates(final Map<String, String[]> filters, final CriteriaBuilder criteriaBuilder,
+ protected List<Predicate> getPredicates(final Map<String, String[]> filters, final CriteriaBuilder criteriaBuilder,
final Root<InfraActiveRequests> tableRoot) {
final List<Predicate> predicates = new LinkedList<>();
for (final Entry<String, String[]> entry : filters.entrySet()) {
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/RequestDBConfig.java b/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/RequestDBConfig.java
index 9026571720..9c270d619b 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/RequestDBConfig.java
+++ b/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/RequestDBConfig.java
@@ -21,11 +21,15 @@
package org.onap.so.db.request;
+import java.util.TimeZone;
+
+import javax.annotation.PostConstruct;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
+
import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -73,5 +77,10 @@ public class RequestDBConfig {
) {
return new JpaTransactionManager(entityManagerFactory);
}
+
+ @PostConstruct
+ public void started() {
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+ }
}
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImplTest.java b/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImplTest.java
index def999b556..4dd500d86d 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImplTest.java
+++ b/mso-api-handlers/mso-requests-db-repositories/src/test/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImplTest.java
@@ -19,11 +19,15 @@
*/
package org.onap.so.db.request.data.repository;
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
import static org.onap.so.db.request.data.repository.InfraActiveRequestsRepositoryImpl.ACTION;
import static org.onap.so.db.request.data.repository.InfraActiveRequestsRepositoryImpl.REQUEST_ID;
import static org.onap.so.db.request.data.repository.InfraActiveRequestsRepositoryImpl.SERVICE_INSTANCE_ID;
@@ -33,6 +37,11 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -43,7 +52,6 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
-
@RunWith(SpringRunner.class)
@SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ActiveProfiles("test")
@@ -73,7 +81,7 @@ public class InfraActiveRequestsRepositoryImplTest {
private static final String SERVICE_INSTANCE_ID_VALUE = "e3b5744d-2ad1-4cdd-8390-c999a38829bc";
@Autowired
- private InfraActiveRequestsRepository objUnderTest;
+ private InfraActiveRequestsRepositoryImpl objUnderTest;
@Test
public void test_GetInfraActiveRequests_emptyFiltersMap() {
@@ -86,11 +94,9 @@ public class InfraActiveRequestsRepositoryImplTest {
public void test_GetInfraActiveRequests_invalidFiltersMap() {
final Map<String, String[]> filters = new HashMap<>();
filters.put("OverTheMoon", new String[] {"Humpty Dumpty Sat On The Wall"});
- final long startTime = START_TIME_IN_MILISEC - TimeUnit.DAYS.toMillis(20);
- final long endTime = END_TIME_IN_MILISEC - TimeUnit.DAYS.toMillis(20);
- final List<InfraActiveRequests> actualRequests =
- objUnderTest.getInfraActiveRequests(filters, startTime, endTime, null);
- assertTrue(actualRequests.isEmpty());
+ final List<Predicate> predicates =
+ objUnderTest.getPredicates(filters, mock(CriteriaBuilder.class), (Root<InfraActiveRequests>)mock(Root.class));
+ assertTrue(predicates.isEmpty());
}
@Test
@@ -218,14 +224,8 @@ public class InfraActiveRequestsRepositoryImplTest {
assertFalse(actualRequests.isEmpty());
assertEquals(3, actualRequests.size());
- final Map<String, InfraActiveRequests> result = new HashMap<>();
- for (final InfraActiveRequests actualActiveRequests : actualRequests) {
- result.put(actualActiveRequests.getRequestId(), actualActiveRequests);
-
- }
- final InfraActiveRequests actualInfraActiveRequests = result.get("9383dc81-7a6c-4673-8082-650d50a82a1a");
- assertNull(actualInfraActiveRequests.getEndTime());
- assertEquals("IN_PROGRESS", actualInfraActiveRequests.getRequestStatus());
+ assertEquals("ShouldReturnInSearchQuery_1,ShouldReturnInSearchQuery_2,ShouldReturnInSearchQuery_3",
+ actualRequests.stream().map(item -> item.getServiceInstanceName()).collect(Collectors.joining(",")));
}
}
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql
index 3358d770e2..4ff7025dee 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql
+++ b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql
@@ -112,7 +112,7 @@ INSERT INTO PUBLIC.INFRA_ACTIVE_REQUESTS(REQUEST_ID, CLIENT_REQUEST_ID, ACTION,
('a1abeab2-f8ef-43ab-b76c-9c3c2cb9980f', null, 'activateInstance', 'FAILED', '2019-01-01 13:00:00', '2019-01-01 14:00:00', 'f7712652-b516-4925-a243-64550d26fd84', 'ShouldReturnInSearchQuery_3'),
('81b8e152-ee89-49f4-b82b-08b0dcae27cd', null, 'createInstance', 'COMPLETE', '2019-01-01 14:10:00', '2019-01-01 15:00:00', 'f7712652-b516-4925-a243-64550d26fd84', 'SHOULD_NOT_RETURN_1'),
('0c28cad2-ff79-4dfa-a04a-9e44996fd7f7', null, 'createInstance', 'IN_PROGRESS', '2019-01-01 13:30:00', '2019-01-01 15:00:00', 'f7712652-b516-4925-a243-64550d26fd84', 'SHOULD_NOT_RETURN_2'),
-('d0d995a7-549b-4e7e-9101-2bab17ec24ea', null, 'createInstance', 'IN_PROGRESS', '2019-01-01 14:15:00', null, 'f7712652-b516-4925-a243-64550d26fd84', 'SHOULD_NOT_RETURN_3');
+('d0d995a7-549b-4e7e-9101-2bab17ec24ea', null, 'createInstance', 'IN_PROGRESS', '2019-01-01 11:15:00', null, 'f7712652-b516-4925-a243-64550d26fd84', 'SHOULD_NOT_RETURN_3');
CREATE CACHED TABLE PUBLIC.ARCHIVED_INFRA_REQUESTS(
REQUEST_ID VARCHAR NOT NULL SELECTIVITY 100,
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java
index d831d1ebd2..1fd254f254 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java
@@ -30,6 +30,8 @@ public enum OrchestrationAction {
CREATE("Create"),
DELETE("Delete"),
UPDATE("Update"),
+ ADD_MEMBERS("AddMembers"),
+ REMOVE_MEMBERS("RemoveMembers"),
CUSTOM("Custom");
private final String name;
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResource.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResource.java
new file mode 100644
index 0000000000..5e9a07443f
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResource.java
@@ -0,0 +1,215 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.db.catalog.beans;
+
+import com.openpojo.business.annotation.BusinessKey;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import uk.co.blackpepper.bowman.annotation.LinkedResource;
+
+@Entity
+@Table(name = "pnf_resource")
+public class PnfResource implements Serializable {
+
+ private static final long serialVersionUID = 7680261093213053483L;
+
+ @BusinessKey
+ @Id
+ @Column(name = "MODEL_UUID")
+ private String modelUUID;
+
+ @Column(name = "MODEL_INVARIANT_UUID")
+ private String modelInvariantUUID;
+
+ @Column(name = "MODEL_NAME")
+ private String modelName;
+
+ @Column(name = "MODEL_VERSION")
+ private String modelVersion;
+
+ @Column(name = "TOSCA_NODE_TYPE")
+ private String toscaNodeType;
+
+ @Column(name = "DESCRIPTION")
+ private String description;
+
+ @Column(name = "ORCHESTRATION_MODE")
+ private String orchestrationMode;
+
+ @Column(name = "RESOURCE_CATEGORY")
+ private String category;
+
+ @Column(name = "RESOURCE_SUB_CATEGORY")
+ private String subCategory;
+
+ @Column(name = "CREATION_TIMESTAMP", updatable = false)
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date created;
+
+ @OneToMany(fetch = FetchType.LAZY, mappedBy = "pnfResources")
+ private List<PnfResourceCustomization> pnfResourceCustomizations;
+
+ @PrePersist
+ protected void onCreate() {
+ this.created = new Date();
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID)
+ .append("modelName", modelName).append("modelVersion", modelVersion)
+ .append("toscaNodeType", toscaNodeType).append("description", description)
+ .append("orchestrationMode", orchestrationMode).append("created", created)
+ .append("pnfResourceCustomizations", pnfResourceCustomizations)
+ .toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof PnfResource)) {
+ return false;
+ }
+ PnfResource castOther = (PnfResource) other;
+ return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(modelUUID).toHashCode();
+ }
+
+ public String getOrchestrationMode() {
+ return orchestrationMode;
+ }
+
+ public void setOrchestrationMode(String orchestrationMode) {
+ this.orchestrationMode = orchestrationMode;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ /**
+ * @return Returns the category.
+ */
+ public String getCategory() {
+ return category;
+ }
+
+ /**
+ * @param category The category to set.
+ */
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ /**
+ * @return Returns the subCategory.
+ */
+ public String getSubCategory() {
+ return subCategory;
+ }
+
+ /**
+ * @param subCategory The subCategory to set.
+ */
+ public void setSubCategory(String subCategory) {
+ this.subCategory = subCategory;
+ }
+
+ public String getModelInvariantUUID() {
+ return this.modelInvariantUUID;
+ }
+
+ public void setModelInvariantUUID(String modelInvariantUUID) {
+ this.modelInvariantUUID = modelInvariantUUID;
+ }
+
+ public String getModelName() {
+ return modelName;
+ }
+
+ public void setModelName(String modelName) {
+ this.modelName = modelName;
+ }
+
+ public String getModelUUID() {
+ return modelUUID;
+ }
+
+ public void setModelUUID(String modelUUID) {
+ this.modelUUID = modelUUID;
+ }
+
+ public String getModelInvariantId() {
+ return this.modelInvariantUUID;
+ }
+
+ public String getToscaNodeType() {
+ return toscaNodeType;
+ }
+
+ public void setToscaNodeType(String toscaNodeType) {
+ this.toscaNodeType = toscaNodeType;
+ }
+
+ @LinkedResource
+ public List<PnfResourceCustomization> getPnfResourceCustomizations() {
+ if (pnfResourceCustomizations == null) {
+ pnfResourceCustomizations = new ArrayList<>();
+ }
+ return pnfResourceCustomizations;
+ }
+
+ public void setPnfResourceCustomizations(List<PnfResourceCustomization> pnfResourceCustomizations) {
+ this.pnfResourceCustomizations = pnfResourceCustomizations;
+ }
+
+ public String getModelVersion() {
+ return modelVersion;
+ }
+
+ public void setModelVersion(String modelVersion) {
+ this.modelVersion = modelVersion;
+ }
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java
new file mode 100644
index 0000000000..b2d40b8409
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java
@@ -0,0 +1,220 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.db.catalog.beans;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.openpojo.business.annotation.BusinessKey;
+import java.io.Serializable;
+import java.util.Date;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import uk.co.blackpepper.bowman.annotation.LinkedResource;
+
+@Entity
+@Table(name = "pnf_resource_customization")
+public class PnfResourceCustomization implements Serializable {
+
+ private static final long serialVersionUID = 768026109321305415L;
+
+ @BusinessKey
+ @Id
+ @Column(name = "MODEL_CUSTOMIZATION_UUID")
+ private String modelCustomizationUUID;
+
+ @Column(name = "MODEL_INSTANCE_NAME")
+ private String modelInstanceName;
+
+ @Column(name = "CREATION_TIMESTAMP", updatable = false)
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date created;
+
+ @Column(name = "NF_FUNCTION")
+ private String nfFunction;
+
+ @Column(name = "NF_TYPE")
+ private String nfType;
+
+ @Column(name = "NF_ROLE")
+ private String nfRole;
+
+ @Column(name = "NF_NAMING_CODE")
+ private String nfNamingCode;
+
+ @Column(name = "MULTI_STAGE_DESIGN")
+ private String multiStageDesign;
+
+ @Column(name = "RESOURCE_INPUT")
+ private String resourceInput;
+
+ @ManyToOne(cascade = CascadeType.ALL)
+ @JoinColumn(name = "PNF_RESOURCE_MODEL_UUID")
+ private PnfResource pnfResources;
+
+ @Column(name = "CDS_BLUEPRINT_NAME")
+ private String blueprintName;
+
+ @Column(name = "CDS_BLUEPRINT_VERSION")
+ private String blueprintVersion;
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
+ .append("modelInstanceName", modelInstanceName).append("created", created)
+ .append("nfFunction", nfFunction)
+ .append("nfType", nfType).append("nfRole", nfRole).append("nfNamingCode", nfNamingCode)
+ .append("multiStageDesign", multiStageDesign).append("pnfResources", pnfResources)
+ .append("blueprintName", blueprintName).append("blueprintVersion", blueprintVersion)
+ .toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof PnfResourceCustomization)) {
+ return false;
+ }
+ PnfResourceCustomization castOther = (PnfResourceCustomization) other;
+ return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();
+ }
+
+ @PrePersist
+ protected void onCreate() {
+ this.created = new Date();
+ }
+
+ public Date getCreationTimestamp() {
+ return this.created;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+ public String getModelCustomizationUUID() {
+ return modelCustomizationUUID;
+ }
+
+ public void setModelCustomizationUUID(String modelCustomizationUUID) {
+ this.modelCustomizationUUID = modelCustomizationUUID;
+ }
+
+ public String getModelInstanceName() {
+ return this.modelInstanceName;
+ }
+
+ public void setModelInstanceName(String modelInstanceName) {
+ this.modelInstanceName = modelInstanceName;
+ }
+
+ public String getNfFunction() {
+ return nfFunction;
+ }
+
+ public void setNfFunction(String nfFunction) {
+ this.nfFunction = nfFunction;
+ }
+
+ public String getNfType() {
+ return nfType;
+ }
+
+ public void setNfType(String nfType) {
+ this.nfType = nfType;
+ }
+
+ public String getNfRole() {
+ return nfRole;
+ }
+
+ public void setNfRole(String nfRole) {
+ this.nfRole = nfRole;
+ }
+
+ public String getNfNamingCode() {
+ return nfNamingCode;
+ }
+
+ public void setNfNamingCode(String nfNamingCode) {
+ this.nfNamingCode = nfNamingCode;
+ }
+
+ public String getMultiStageDesign() {
+ return this.multiStageDesign;
+ }
+
+ public void setMultiStageDesign(String multiStageDesign) {
+ this.multiStageDesign = multiStageDesign;
+ }
+
+ @LinkedResource
+ public PnfResource getPnfResources() {
+ return pnfResources;
+ }
+
+ public void setPnfResources(PnfResource pnfResources) {
+ this.pnfResources = pnfResources;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public String getResourceInput() {
+ return resourceInput;
+ }
+
+ public void setResourceInput(String resourceInput) {
+ this.resourceInput = resourceInput;
+ }
+
+
+ public String getBlueprintName() {
+ return blueprintName;
+ }
+
+ public void setBlueprintName(String blueprintName) {
+ this.blueprintName = blueprintName;
+ }
+
+ public String getBlueprintVersion() {
+ return blueprintVersion;
+ }
+
+ public void setBlueprintVersion(String blueprintVersion) {
+ this.blueprintVersion = blueprintVersion;
+ }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java
index 64eff56f97..6d5c0fd9a8 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java
@@ -28,6 +28,7 @@ public enum ResourceType {
NETWORK("Network"),
NETWORK_COLLECTION("NetworkCollection"),
CONFIGURATION("Configuration"),
+ INSTANCE_GROUP("InstanceGroup"),
NO_VALIDATE("NoValidate");
private final String name;
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java
index 28ff778d44..428736eddc 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java
@@ -7,9 +7,9 @@
* 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.
@@ -53,294 +53,315 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource;
@Table(name = "service")
public class Service implements Serializable {
- private static final long serialVersionUID = 768026109321305392L;
-
- @Column(name = "MODEL_NAME")
- private String modelName;
-
- @Column(name = "DESCRIPTION", length = 1200)
- private String description;
-
- @BusinessKey
- @Id
- @Column(name = "MODEL_UUID")
- private String modelUUID;
-
- @Column(name = "MODEL_INVARIANT_UUID")
- private String modelInvariantUUID;
-
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
- @Column(name = "CREATION_TIMESTAMP", updatable = false)
- @Temporal(TemporalType.TIMESTAMP)
- private Date created;
-
- @Column(name = "MODEL_VERSION")
- private String modelVersion;
-
- @Column(name = "SERVICE_TYPE")
- private String serviceType;
-
- @Column(name = "SERVICE_ROLE")
- private String serviceRole;
-
- @Column(name = "ENVIRONMENT_CONTEXT")
- private String environmentContext;
-
- @Column(name = "WORKLOAD_CONTEXT")
- private String workloadContext;
-
- @Column(name = "SERVICE_CATEGORY")
- private String category;
-
- @Column(name = "RESOURCE_ORDER")
- private String resourceOrder;
-
- @OneToMany(cascade = CascadeType.ALL)
- @JoinTable(name = "network_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID"))
- private List<NetworkResourceCustomization> networkCustomizations;
-
- @OneToMany(cascade = CascadeType.ALL)
- @JoinTable(name = "vnf_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID"))
- private List<VnfResourceCustomization> vnfCustomizations;
-
- @OneToMany(cascade = CascadeType.ALL)
- @JoinTable(name = "allotted_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID"))
- private List<AllottedResourceCustomization> allottedCustomizations;
-
- @OneToMany(cascade = CascadeType.ALL)
- @JoinTable(name = "collection_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID"))
- private List<CollectionResourceCustomization> collectionResourceCustomizations;
-
- @OneToMany(cascade = CascadeType.ALL)
- @JoinTable(name = "service_proxy_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID"))
- private List<ServiceProxyResourceCustomization> serviceProxyCustomizations;
-
- @OneToMany(cascade = CascadeType.ALL)
- @JoinTable(name = "configuration_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID"))
- private List<ConfigurationResourceCustomization> configurationCustomizations;
-
- @OneToMany(cascade = CascadeType.ALL)
- @MapKey(name = "action")
- @JoinColumn(name = "SERVICE_MODEL_UUID")
- private Map<String, ServiceRecipe> recipes;
-
- @ManyToOne(cascade = CascadeType.ALL)
- @JoinColumn(name = "TOSCA_CSAR_ARTIFACT_UUID")
- private ToscaCsar csar;
-
- @Override
- public String toString() {
- return new ToStringBuilder(this).append("modelName", modelName).append("description", description)
- .append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID)
- .append("created", created).append("modelVersion", modelVersion).append("serviceType", serviceType)
- .append("serviceRole", serviceRole).append("environmentContext", environmentContext)
- .append("workloadContext", workloadContext).append("category", category)
- .append("networkCustomizations", networkCustomizations).append("vnfCustomizations", vnfCustomizations)
- .append("allottedCustomizations", allottedCustomizations)
- .append("collectionResourceCustomizations", collectionResourceCustomizations)
- .append("serviceProxyCustomizations", serviceProxyCustomizations)
- .append("configurationCustomizations", configurationCustomizations).append("recipes", recipes)
- .append("csar", csar).toString();
- }
-
- @PrePersist
- protected void onCreate() {
- this.created = new Date();
- }
-
- @Override
- public boolean equals(final Object other) {
- if (!(other instanceof Service)) {
- return false;
- }
- Service castOther = (Service) other;
- return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals();
- }
-
- @Override
- public int hashCode() {
- return new HashCodeBuilder().append(modelUUID).toHashCode();
- }
-
- @LinkedResource
- public List<ServiceProxyResourceCustomization> getServiceProxyCustomizations() {
- return serviceProxyCustomizations;
- }
-
- public void setServiceProxyCustomizations(List<ServiceProxyResourceCustomization> serviceProxyCustomizations) {
- this.serviceProxyCustomizations = serviceProxyCustomizations;
- }
-
- @LinkedResource
- public List<NetworkResourceCustomization> getNetworkCustomizations() {
- if (networkCustomizations == null)
- networkCustomizations = new ArrayList<>();
- return networkCustomizations;
- }
-
- public void setNetworkCustomizations(List<NetworkResourceCustomization> networkCustomizations) {
- this.networkCustomizations = networkCustomizations;
- }
-
- @LinkedResource
- public List<VnfResourceCustomization> getVnfCustomizations() {
- if (vnfCustomizations == null)
- vnfCustomizations = new ArrayList<>();
- return vnfCustomizations;
- }
-
- public void setVnfCustomizations(List<VnfResourceCustomization> vnfCustomizations) {
- this.vnfCustomizations = vnfCustomizations;
- }
-
- @LinkedResource
- public List<AllottedResourceCustomization> getAllottedCustomizations() {
- if (allottedCustomizations == null)
- allottedCustomizations = new ArrayList<>();
- return allottedCustomizations;
- }
-
- public void setAllottedCustomizations(List<AllottedResourceCustomization> allotedCustomizations) {
- this.allottedCustomizations = allotedCustomizations;
- }
-
- @LinkedResource
- public List<CollectionResourceCustomization> getCollectionResourceCustomizations() {
- if (collectionResourceCustomizations == null)
- collectionResourceCustomizations = new ArrayList<>();
- return collectionResourceCustomizations;
- }
-
- public void setCollectionResourceCustomizations(
- List<CollectionResourceCustomization> collectionResourceCustomizations) {
- this.collectionResourceCustomizations = collectionResourceCustomizations;
- }
-
- @LinkedResource
- public List<ConfigurationResourceCustomization> getConfigurationCustomizations() {
- if(configurationCustomizations == null)
- configurationCustomizations = new ArrayList<>();
- return configurationCustomizations;
- }
-
- public void setConfigurationCustomizations(List<ConfigurationResourceCustomization> configurationCustomizations) {
- this.configurationCustomizations = configurationCustomizations;
- }
-
- public String getModelName() {
- return modelName;
- }
-
- public void setModelName(String modelName) {
- this.modelName = modelName;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- @LinkedResource
- public Map<String, ServiceRecipe> getRecipes() {
- return recipes;
- }
-
- public void setRecipes(Map<String, ServiceRecipe> recipes) {
- this.recipes = recipes;
- }
-
- public Date getCreated() {
- return created;
- }
-
- public String getModelUUID() {
- return modelUUID;
- }
-
- public void setModelUUID(String modelUUID) {
- this.modelUUID = modelUUID;
- }
-
- public String getModelInvariantUUID() {
- return modelInvariantUUID;
- }
-
- public void setModelInvariantUUID(String modelInvariantUUID) {
- this.modelInvariantUUID = modelInvariantUUID;
- }
-
- public String getModelVersion() {
- return modelVersion;
- }
-
- public void setModelVersion(String modelVersion) {
- this.modelVersion = modelVersion;
- }
-
- /**
- * @return Returns the category.
- */
- public String getCategory() {
- return category;
- }
-
- /**
- * @param category
- * The category to set.
- */
- public void setCategory(String category) {
- this.category = category;
- }
-
- public String getServiceType() {
- return serviceType;
- }
-
- public void setServiceType(String serviceType) {
- this.serviceType = serviceType;
- }
-
- public String getServiceRole() {
- return serviceRole;
- }
-
- public void setServiceRole(String serviceRole) {
- this.serviceRole = serviceRole;
- }
-
- public String getEnvironmentContext() {
- return this.environmentContext;
- }
-
- public void setEnvironmentContext(String environmentContext) {
- this.environmentContext = environmentContext;
- }
-
- @LinkedResource
- public ToscaCsar getCsar() {
- return csar;
- }
-
- public void setCsar(ToscaCsar csar) {
- this.csar = csar;
- }
-
- public String getWorkloadContext() {
- return this.workloadContext;
- }
-
- public void setWorkloadContext(String workloadContext) {
- this.workloadContext = workloadContext;
- }
-
- public String getResourceOrder() {
- return resourceOrder;
- }
-
- public void setResourceOrder(String resourceOrder) {
- this.resourceOrder = resourceOrder;
- }
+ private static final long serialVersionUID = 768026109321305392L;
+
+ @Column(name = "MODEL_NAME")
+ private String modelName;
+
+ @Column(name = "DESCRIPTION", length = 1200)
+ private String description;
+
+ @BusinessKey
+ @Id
+ @Column(name = "MODEL_UUID")
+ private String modelUUID;
+
+ @Column(name = "MODEL_INVARIANT_UUID")
+ private String modelInvariantUUID;
+
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
+ @Column(name = "CREATION_TIMESTAMP", updatable = false)
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date created;
+
+ @Column(name = "MODEL_VERSION")
+ private String modelVersion;
+
+ @Column(name = "SERVICE_TYPE")
+ private String serviceType;
+
+ @Column(name = "SERVICE_ROLE")
+ private String serviceRole;
+
+ @Column(name = "ENVIRONMENT_CONTEXT")
+ private String environmentContext;
+
+ @Column(name = "WORKLOAD_CONTEXT")
+ private String workloadContext;
+
+ @Column(name = "SERVICE_CATEGORY")
+ private String category;
+
+ @Column(name = "RESOURCE_ORDER")
+ private String resourceOrder;
+
+ @OneToMany(cascade = CascadeType.ALL)
+ @JoinTable(name = "network_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID"))
+ private List<NetworkResourceCustomization> networkCustomizations;
+
+ @OneToMany(cascade = CascadeType.ALL)
+ @JoinTable(name = "vnf_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID"))
+ private List<VnfResourceCustomization> vnfCustomizations;
+
+ @OneToMany(cascade = CascadeType.ALL)
+ @JoinTable(name = "allotted_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID"))
+ private List<AllottedResourceCustomization> allottedCustomizations;
+
+ @OneToMany(cascade = CascadeType.ALL)
+ @JoinTable(name = "collection_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID"))
+ private List<CollectionResourceCustomization> collectionResourceCustomizations;
+
+ @OneToMany(cascade = CascadeType.ALL)
+ @JoinTable(name = "service_proxy_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID"))
+ private List<ServiceProxyResourceCustomization> serviceProxyCustomizations;
+
+ @OneToMany(cascade = CascadeType.ALL)
+ @JoinTable(name = "configuration_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID"))
+ private List<ConfigurationResourceCustomization> configurationCustomizations;
+
+ @OneToMany(cascade = CascadeType.ALL)
+ @JoinTable(name = "pnf_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID"))
+ private List<PnfResourceCustomization> pnfCustomizations;
+
+ @OneToMany(cascade = CascadeType.ALL, mappedBy = "service")
+ @MapKey(name = "action")
+ private Map<String, ServiceRecipe> recipes;
+
+ @ManyToOne(cascade = CascadeType.ALL)
+ @JoinColumn(name = "TOSCA_CSAR_ARTIFACT_UUID")
+ private ToscaCsar csar;
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("modelName", modelName).append("description", description)
+ .append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID)
+ .append("created", created).append("modelVersion", modelVersion).append("serviceType", serviceType)
+ .append("serviceRole", serviceRole).append("environmentContext", environmentContext)
+ .append("workloadContext", workloadContext).append("category", category)
+ .append("networkCustomizations", networkCustomizations).append("vnfCustomizations", vnfCustomizations)
+ .append("allottedCustomizations", allottedCustomizations)
+ .append("collectionResourceCustomizations", collectionResourceCustomizations)
+ .append("serviceProxyCustomizations", serviceProxyCustomizations)
+ .append("configurationCustomizations", configurationCustomizations)
+ .append("pnfCustomizations", pnfCustomizations)
+ .append("recipes", recipes)
+ .append("csar", csar).toString();
+ }
+
+ @PrePersist
+ protected void onCreate() {
+ this.created = new Date();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof Service)) {
+ return false;
+ }
+ Service castOther = (Service) other;
+ return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(modelUUID).toHashCode();
+ }
+
+ @LinkedResource
+ public List<ServiceProxyResourceCustomization> getServiceProxyCustomizations() {
+ return serviceProxyCustomizations;
+ }
+
+ public void setServiceProxyCustomizations(List<ServiceProxyResourceCustomization> serviceProxyCustomizations) {
+ this.serviceProxyCustomizations = serviceProxyCustomizations;
+ }
+
+ @LinkedResource
+ public List<NetworkResourceCustomization> getNetworkCustomizations() {
+ if (networkCustomizations == null) {
+ networkCustomizations = new ArrayList<>();
+ }
+ return networkCustomizations;
+ }
+
+ public void setNetworkCustomizations(List<NetworkResourceCustomization> networkCustomizations) {
+ this.networkCustomizations = networkCustomizations;
+ }
+
+ @LinkedResource
+ public List<VnfResourceCustomization> getVnfCustomizations() {
+ if (vnfCustomizations == null) {
+ vnfCustomizations = new ArrayList<>();
+ }
+ return vnfCustomizations;
+ }
+
+ public void setVnfCustomizations(List<VnfResourceCustomization> vnfCustomizations) {
+ this.vnfCustomizations = vnfCustomizations;
+ }
+
+ @LinkedResource
+ public List<AllottedResourceCustomization> getAllottedCustomizations() {
+ if (allottedCustomizations == null) {
+ allottedCustomizations = new ArrayList<>();
+ }
+ return allottedCustomizations;
+ }
+
+ public void setAllottedCustomizations(List<AllottedResourceCustomization> allotedCustomizations) {
+ this.allottedCustomizations = allotedCustomizations;
+ }
+
+ @LinkedResource
+ public List<CollectionResourceCustomization> getCollectionResourceCustomizations() {
+ if (collectionResourceCustomizations == null) {
+ collectionResourceCustomizations = new ArrayList<>();
+ }
+ return collectionResourceCustomizations;
+ }
+
+ public void setCollectionResourceCustomizations(
+ List<CollectionResourceCustomization> collectionResourceCustomizations) {
+ this.collectionResourceCustomizations = collectionResourceCustomizations;
+ }
+
+ @LinkedResource
+ public List<ConfigurationResourceCustomization> getConfigurationCustomizations() {
+ if (configurationCustomizations == null) {
+ configurationCustomizations = new ArrayList<>();
+ }
+ return configurationCustomizations;
+ }
+
+ public void setConfigurationCustomizations(List<ConfigurationResourceCustomization> configurationCustomizations) {
+ this.configurationCustomizations = configurationCustomizations;
+ }
+
+ @LinkedResource
+ public List<PnfResourceCustomization> getPnfCustomizations() {
+ if (pnfCustomizations == null) {
+ pnfCustomizations = new ArrayList<>();
+ }
+ return pnfCustomizations;
+ }
+
+ public void setPnfCustomizations(List<PnfResourceCustomization> pnfCustomizations) {
+ this.pnfCustomizations = pnfCustomizations;
+ }
+
+ public String getModelName() {
+ return modelName;
+ }
+
+ public void setModelName(String modelName) {
+ this.modelName = modelName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @LinkedResource
+ public Map<String, ServiceRecipe> getRecipes() {
+ return recipes;
+ }
+
+ public void setRecipes(Map<String, ServiceRecipe> recipes) {
+ this.recipes = recipes;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public String getModelUUID() {
+ return modelUUID;
+ }
+
+ public void setModelUUID(String modelUUID) {
+ this.modelUUID = modelUUID;
+ }
+
+ public String getModelInvariantUUID() {
+ return modelInvariantUUID;
+ }
+
+ public void setModelInvariantUUID(String modelInvariantUUID) {
+ this.modelInvariantUUID = modelInvariantUUID;
+ }
+
+ public String getModelVersion() {
+ return modelVersion;
+ }
+
+ public void setModelVersion(String modelVersion) {
+ this.modelVersion = modelVersion;
+ }
+
+ /**
+ * @return Returns the category.
+ */
+ public String getCategory() {
+ return category;
+ }
+
+ /**
+ * @param category The category to set.
+ */
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public String getServiceType() {
+ return serviceType;
+ }
+
+ public void setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ }
+
+ public String getServiceRole() {
+ return serviceRole;
+ }
+
+ public void setServiceRole(String serviceRole) {
+ this.serviceRole = serviceRole;
+ }
+
+ public String getEnvironmentContext() {
+ return this.environmentContext;
+ }
+
+ public void setEnvironmentContext(String environmentContext) {
+ this.environmentContext = environmentContext;
+ }
+
+ @LinkedResource
+ public ToscaCsar getCsar() {
+ return csar;
+ }
+
+ public void setCsar(ToscaCsar csar) {
+ this.csar = csar;
+ }
+
+ public String getWorkloadContext() {
+ return this.workloadContext;
+ }
+
+ public void setWorkloadContext(String workloadContext) {
+ this.workloadContext = workloadContext;
+ }
+
+ public String getResourceOrder() {
+ return resourceOrder;
+ }
+
+ public void setResourceOrder(String resourceOrder) {
+ this.resourceOrder = resourceOrder;
+ }
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java
index d063ea4809..79b27e7deb 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java
@@ -23,9 +23,13 @@ package org.onap.so.db.catalog.beans;
import java.io.Serializable;
import java.util.Date;
+import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
+import javax.persistence.FetchType;
import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
import javax.persistence.PrePersist;
import javax.persistence.Table;
import javax.persistence.Temporal;
@@ -74,6 +78,11 @@ public class ServiceRecipe implements Serializable, Recipe {
@Column(name = "CREATION_TIMESTAMP", updatable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date created;
+
+ @BusinessKey
+ @ManyToOne(cascade = CascadeType.ALL)
+ @JoinColumn(name = "SERVICE_MODEL_UUID", referencedColumnName = "MODEL_UUID",insertable = false, updatable = false)
+ private Service service;
@PrePersist
protected void onCreate() {
@@ -177,6 +186,14 @@ public class ServiceRecipe implements Serializable, Recipe {
public void setServiceTimeoutInterim(Integer serviceTimeoutInterim) {
this.serviceTimeoutInterim = serviceTimeoutInterim;
}
+
+ public Service getService() {
+ return service;
+ }
+
+ public void setService(Service service) {
+ this.service = service;
+ }
public Date getCreated() {
return created;
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java
index 53e8c9613e..c75199ed41 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java
@@ -7,9 +7,9 @@
* 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.
@@ -54,244 +54,270 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource;
@Table(name = "vnf_resource_customization")
public class VnfResourceCustomization implements Serializable {
- private static final long serialVersionUID = 768026109321305392L;
-
- @BusinessKey
- @Id
- @Column(name = "MODEL_CUSTOMIZATION_UUID")
- private String modelCustomizationUUID;
-
- @Column(name = "MODEL_INSTANCE_NAME")
- private String modelInstanceName;
-
- @Column(name = "CREATION_TIMESTAMP", updatable = false)
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
- @Temporal(TemporalType.TIMESTAMP)
- private Date created;
-
- public void setCreated(Date created) {
- this.created = created;
- }
-
- @Column(name = "MIN_INSTANCES")
- private Integer minInstances;
-
- @Column(name = "MAX_INSTANCES")
- private Integer maxInstances;
-
- @Column(name = "AVAILABILITY_ZONE_MAX_COUNT")
- private Integer availabilityZoneMaxCount;
-
- @Column(name = "NF_FUNCTION")
- private String nfFunction;
-
- @Column(name = "NF_TYPE")
- private String nfType;
-
- @Column(name = "NF_ROLE")
- private String nfRole;
-
- @Column(name = "NF_NAMING_CODE")
- private String nfNamingCode;
-
- @Column(name = "MULTI_STAGE_DESIGN")
- private String multiStageDesign;
-
- @Column(name = "RESOURCE_INPUT")
- private String resourceInput;
-
- @ManyToOne(cascade = CascadeType.ALL)
- @JoinColumn(name = "VNF_RESOURCE_MODEL_UUID")
- private VnfResource vnfResources;
-
- @OneToMany(cascade = CascadeType.ALL)
- @JoinTable(name = "vnf_res_custom_to_vf_module_custom", joinColumns = @JoinColumn(name = "VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID", referencedColumnName = "MODEL_CUSTOMIZATION_UUID"), inverseJoinColumns = @JoinColumn(name = "VF_MODULE_CUST_MODEL_CUSTOMIZATION_UUID", referencedColumnName = "MODEL_CUSTOMIZATION_UUID"))
- private List<VfModuleCustomization> vfModuleCustomizations;
-
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "vnfResourceCust")
- private List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizations;
-
- @OneToMany(cascade = CascadeType.ALL, mappedBy = "modelCustomizationUUID")
- private Set<VnfVfmoduleCvnfcConfigurationCustomization> vnfVfmoduleCvnfcConfigurationCustomization;
-
- @OneToMany(cascade = CascadeType.ALL, mappedBy = "modelCustomizationUUID")
- private List<CvnfcCustomization> cvnfcCustomization;
-
- @Override
- public String toString() {
- return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
- .append("modelInstanceName", modelInstanceName).append("created", created)
- .append("minInstances", minInstances).append("maxInstances", maxInstances)
- .append("availabilityZoneMaxCount", availabilityZoneMaxCount).append("nfFunction", nfFunction)
- .append("nfType", nfType).append("nfRole", nfRole).append("nfNamingCode", nfNamingCode)
- .append("multiStageDesign", multiStageDesign).append("vnfResources", vnfResources)
- .append("vfModuleCustomizations", vfModuleCustomizations)
- .append("vnfcInstanceGroupCustomizations", vnfcInstanceGroupCustomizations).toString();
- }
-
- @Override
- public boolean equals(final Object other) {
- if (!(other instanceof VnfResourceCustomization)) {
- return false;
- }
- VnfResourceCustomization castOther = (VnfResourceCustomization) other;
- return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
- }
-
- @Override
- public int hashCode() {
- return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();
- }
-
- @PrePersist
- protected void onCreate() {
- this.created = new Date();
- }
-
- public String getModelCustomizationUUID() {
- return modelCustomizationUUID;
- }
-
- public void setModelCustomizationUUID(String modelCustomizationUUID) {
- this.modelCustomizationUUID = modelCustomizationUUID;
- }
-
- public String getModelInstanceName() {
- return this.modelInstanceName;
- }
-
- public void setModelInstanceName(String modelInstanceName) {
- this.modelInstanceName = modelInstanceName;
- }
-
- public Date getCreationTimestamp() {
- return this.created;
- }
-
- public Integer getMinInstances() {
- return this.minInstances;
- }
-
- public void setMinInstances(Integer minInstances) {
- this.minInstances = minInstances;
- }
-
- public Integer getMaxInstances() {
- return this.maxInstances;
- }
-
- public void setMaxInstances(Integer maxInstances) {
- this.maxInstances = maxInstances;
- }
-
- public Integer getAvailabilityZoneMaxCount() {
- return this.availabilityZoneMaxCount;
- }
-
- public void setAvailabilityZoneMaxCount(Integer availabilityZoneMaxCount) {
- this.availabilityZoneMaxCount = availabilityZoneMaxCount;
- }
-
- public String getNfFunction() {
- return nfFunction;
- }
-
- public void setNfFunction(String nfFunction) {
- this.nfFunction = nfFunction;
- }
-
- public String getNfType() {
- return nfType;
- }
-
- public void setNfType(String nfType) {
- this.nfType = nfType;
- }
-
- public String getNfRole() {
- return nfRole;
- }
-
- public void setNfRole(String nfRole) {
- this.nfRole = nfRole;
- }
-
- public String getNfNamingCode() {
- return nfNamingCode;
- }
-
- public void setNfNamingCode(String nfNamingCode) {
- this.nfNamingCode = nfNamingCode;
- }
-
- public String getMultiStageDesign() {
- return this.multiStageDesign;
- }
-
- public void setMultiStageDesign(String multiStageDesign) {
- this.multiStageDesign = multiStageDesign;
- }
-
- @LinkedResource
- public List<VfModuleCustomization> getVfModuleCustomizations() {
- if (vfModuleCustomizations == null)
- vfModuleCustomizations = new ArrayList<>();
- return vfModuleCustomizations;
- }
-
- public void setVfModuleCustomizations(List<VfModuleCustomization> vfModuleCustomizations) {
- this.vfModuleCustomizations = vfModuleCustomizations;
- }
-
- @LinkedResource
- public VnfResource getVnfResources() {
- return vnfResources;
- }
-
- public void setVnfResources(VnfResource vnfResources) {
- this.vnfResources = vnfResources;
- }
-
- public Date getCreated() {
- return created;
- }
-
- @LinkedResource
- public List<VnfcInstanceGroupCustomization> getVnfcInstanceGroupCustomizations() {
- return vnfcInstanceGroupCustomizations;
- }
-
- public void setVnfcInstanceGroupCustomizations(
- List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizations) {
- this.vnfcInstanceGroupCustomizations = vnfcInstanceGroupCustomizations;
- }
-
- @LinkedResource
- public Set<VnfVfmoduleCvnfcConfigurationCustomization> getVnfVfmoduleCvnfcConfigurationCustomization() {
- if (vnfVfmoduleCvnfcConfigurationCustomization == null)
- vnfVfmoduleCvnfcConfigurationCustomization = new HashSet<>();
- return vnfVfmoduleCvnfcConfigurationCustomization;
- }
-
- public void setVnfVfmoduleCvnfcConfigurationCustomization(
- Set<VnfVfmoduleCvnfcConfigurationCustomization> vnfVfmoduleCvnfcConfigurationCustomization) {
- this.vnfVfmoduleCvnfcConfigurationCustomization = vnfVfmoduleCvnfcConfigurationCustomization;
- }
-
- @LinkedResource
- public List<CvnfcCustomization> getCvnfcCustomization() {
- return cvnfcCustomization;
- }
-
- public void setCvnfcCustomization(List<CvnfcCustomization> cvnfcCustomization) {
- this.cvnfcCustomization = cvnfcCustomization;
- }
-
- public String getResourceInput() {
- return resourceInput;
- }
-
- public void setResourceInput(String resourceInput) {
- this.resourceInput = resourceInput;
- }
+ private static final long serialVersionUID = 768026109321305392L;
+
+ @BusinessKey
+ @Id
+ @Column(name = "MODEL_CUSTOMIZATION_UUID")
+ private String modelCustomizationUUID;
+
+ @Column(name = "MODEL_INSTANCE_NAME")
+ private String modelInstanceName;
+
+ @Column(name = "CREATION_TIMESTAMP", updatable = false)
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date created;
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+ @Column(name = "MIN_INSTANCES")
+ private Integer minInstances;
+
+ @Column(name = "MAX_INSTANCES")
+ private Integer maxInstances;
+
+ @Column(name = "AVAILABILITY_ZONE_MAX_COUNT")
+ private Integer availabilityZoneMaxCount;
+
+ @Column(name = "NF_FUNCTION")
+ private String nfFunction;
+
+ @Column(name = "NF_TYPE")
+ private String nfType;
+
+ @Column(name = "NF_ROLE")
+ private String nfRole;
+
+ @Column(name = "NF_NAMING_CODE")
+ private String nfNamingCode;
+
+ @Column(name = "MULTI_STAGE_DESIGN")
+ private String multiStageDesign;
+
+ @Column(name = "RESOURCE_INPUT")
+ private String resourceInput;
+
+ @ManyToOne(cascade = CascadeType.ALL)
+ @JoinColumn(name = "VNF_RESOURCE_MODEL_UUID")
+ private VnfResource vnfResources;
+
+ @OneToMany(cascade = CascadeType.ALL)
+ @JoinTable(name = "vnf_res_custom_to_vf_module_custom", joinColumns = @JoinColumn(name = "VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID", referencedColumnName = "MODEL_CUSTOMIZATION_UUID"), inverseJoinColumns = @JoinColumn(name = "VF_MODULE_CUST_MODEL_CUSTOMIZATION_UUID", referencedColumnName = "MODEL_CUSTOMIZATION_UUID"))
+ private List<VfModuleCustomization> vfModuleCustomizations;
+
+ @OneToMany(fetch = FetchType.LAZY, mappedBy = "vnfResourceCust")
+ private List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizations;
+
+ @OneToMany(cascade = CascadeType.ALL, mappedBy = "modelCustomizationUUID")
+ private Set<VnfVfmoduleCvnfcConfigurationCustomization> vnfVfmoduleCvnfcConfigurationCustomization;
+
+ @OneToMany(cascade = CascadeType.ALL, mappedBy = "modelCustomizationUUID")
+ private List<CvnfcCustomization> cvnfcCustomization;
+
+ @Column(name = "CDS_BLUEPRINT_NAME")
+ private String blueprintName;
+
+ @Column(name = "CDS_BLUEPRINT_VERSION")
+ private String blueprintVersion;
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
+ .append("modelInstanceName", modelInstanceName).append("created", created)
+ .append("minInstances", minInstances).append("maxInstances", maxInstances)
+ .append("availabilityZoneMaxCount", availabilityZoneMaxCount).append("nfFunction", nfFunction)
+ .append("nfType", nfType).append("nfRole", nfRole).append("nfNamingCode", nfNamingCode)
+ .append("multiStageDesign", multiStageDesign).append("vnfResources", vnfResources)
+ .append("vfModuleCustomizations", vfModuleCustomizations)
+ .append("vnfcInstanceGroupCustomizations", vnfcInstanceGroupCustomizations).toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof VnfResourceCustomization)) {
+ return false;
+ }
+ VnfResourceCustomization castOther = (VnfResourceCustomization) other;
+ return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();
+ }
+
+ @PrePersist
+ protected void onCreate() {
+ this.created = new Date();
+ }
+
+ public String getModelCustomizationUUID() {
+ return modelCustomizationUUID;
+ }
+
+ public void setModelCustomizationUUID(String modelCustomizationUUID) {
+ this.modelCustomizationUUID = modelCustomizationUUID;
+ }
+
+ public String getModelInstanceName() {
+ return this.modelInstanceName;
+ }
+
+ public void setModelInstanceName(String modelInstanceName) {
+ this.modelInstanceName = modelInstanceName;
+ }
+
+ public Date getCreationTimestamp() {
+ return this.created;
+ }
+
+ public Integer getMinInstances() {
+ return this.minInstances;
+ }
+
+ public void setMinInstances(Integer minInstances) {
+ this.minInstances = minInstances;
+ }
+
+ public Integer getMaxInstances() {
+ return this.maxInstances;
+ }
+
+ public void setMaxInstances(Integer maxInstances) {
+ this.maxInstances = maxInstances;
+ }
+
+ public Integer getAvailabilityZoneMaxCount() {
+ return this.availabilityZoneMaxCount;
+ }
+
+ public void setAvailabilityZoneMaxCount(Integer availabilityZoneMaxCount) {
+ this.availabilityZoneMaxCount = availabilityZoneMaxCount;
+ }
+
+ public String getNfFunction() {
+ return nfFunction;
+ }
+
+ public void setNfFunction(String nfFunction) {
+ this.nfFunction = nfFunction;
+ }
+
+ public String getNfType() {
+ return nfType;
+ }
+
+ public void setNfType(String nfType) {
+ this.nfType = nfType;
+ }
+
+ public String getNfRole() {
+ return nfRole;
+ }
+
+ public void setNfRole(String nfRole) {
+ this.nfRole = nfRole;
+ }
+
+ public String getNfNamingCode() {
+ return nfNamingCode;
+ }
+
+ public void setNfNamingCode(String nfNamingCode) {
+ this.nfNamingCode = nfNamingCode;
+ }
+
+ public String getMultiStageDesign() {
+ return this.multiStageDesign;
+ }
+
+ public void setMultiStageDesign(String multiStageDesign) {
+ this.multiStageDesign = multiStageDesign;
+ }
+
+ @LinkedResource
+ public List<VfModuleCustomization> getVfModuleCustomizations() {
+ if (vfModuleCustomizations == null) {
+ vfModuleCustomizations = new ArrayList<>();
+ }
+ return vfModuleCustomizations;
+ }
+
+ public void setVfModuleCustomizations(List<VfModuleCustomization> vfModuleCustomizations) {
+ this.vfModuleCustomizations = vfModuleCustomizations;
+ }
+
+ @LinkedResource
+ public VnfResource getVnfResources() {
+ return vnfResources;
+ }
+
+ public void setVnfResources(VnfResource vnfResources) {
+ this.vnfResources = vnfResources;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ @LinkedResource
+ public List<VnfcInstanceGroupCustomization> getVnfcInstanceGroupCustomizations() {
+ return vnfcInstanceGroupCustomizations;
+ }
+
+ public void setVnfcInstanceGroupCustomizations(
+ List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizations) {
+ this.vnfcInstanceGroupCustomizations = vnfcInstanceGroupCustomizations;
+ }
+
+ @LinkedResource
+ public Set<VnfVfmoduleCvnfcConfigurationCustomization> getVnfVfmoduleCvnfcConfigurationCustomization() {
+ if (vnfVfmoduleCvnfcConfigurationCustomization == null) {
+ vnfVfmoduleCvnfcConfigurationCustomization = new HashSet<>();
+ }
+ return vnfVfmoduleCvnfcConfigurationCustomization;
+ }
+
+ public void setVnfVfmoduleCvnfcConfigurationCustomization(
+ Set<VnfVfmoduleCvnfcConfigurationCustomization> vnfVfmoduleCvnfcConfigurationCustomization) {
+ this.vnfVfmoduleCvnfcConfigurationCustomization = vnfVfmoduleCvnfcConfigurationCustomization;
+ }
+
+ @LinkedResource
+ public List<CvnfcCustomization> getCvnfcCustomization() {
+ return cvnfcCustomization;
+ }
+
+ public void setCvnfcCustomization(List<CvnfcCustomization> cvnfcCustomization) {
+ this.cvnfcCustomization = cvnfcCustomization;
+ }
+
+ public String getResourceInput() {
+ return resourceInput;
+ }
+
+ public void setResourceInput(String resourceInput) {
+ this.resourceInput = resourceInput;
+ }
+
+
+ public String getBlueprintName() {
+ return blueprintName;
+ }
+
+ public void setBlueprintName(String blueprintName) {
+ this.blueprintName = blueprintName;
+ }
+
+ public String getBlueprintVersion() {
+ return blueprintVersion;
+ }
+
+ public void setBlueprintVersion(String blueprintVersion) {
+ this.blueprintVersion = blueprintVersion;
+ }
+
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfVfmoduleCvnfcConfigurationCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfVfmoduleCvnfcConfigurationCustomization.java
index f5e9b5f560..7ce657c5c7 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfVfmoduleCvnfcConfigurationCustomization.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfVfmoduleCvnfcConfigurationCustomization.java
@@ -213,6 +213,7 @@ public class VnfVfmoduleCvnfcConfigurationCustomization implements Serializable
this.configurationResource = configurationResource;
}
+ @LinkedResource
public CvnfcCustomization getCvnfcCustomization() {
return cvnfcCustomization;
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
index ac123b280d..9b888cb2ed 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
@@ -7,9 +7,9 @@
* 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.
@@ -24,10 +24,8 @@ import java.net.URI;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-
import javax.annotation.PostConstruct;
import javax.ws.rs.core.UriBuilder;
-
import org.onap.so.db.catalog.beans.BuildingBlockDetail;
import org.onap.so.db.catalog.beans.CloudSite;
import org.onap.so.db.catalog.beans.CloudifyManager;
@@ -44,6 +42,8 @@ import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
import org.onap.so.db.catalog.beans.OrchestrationAction;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
import org.onap.so.db.catalog.beans.OrchestrationStatusStateTransitionDirective;
+import org.onap.so.db.catalog.beans.PnfResource;
+import org.onap.so.db.catalog.beans.PnfResourceCustomization;
import org.onap.so.db.catalog.beans.ResourceType;
import org.onap.so.db.catalog.beans.Service;
import org.onap.so.db.catalog.beans.ServiceRecipe;
@@ -53,6 +53,7 @@ import org.onap.so.db.catalog.beans.VnfComponentsRecipe;
import org.onap.so.db.catalog.beans.VnfRecipe;
import org.onap.so.db.catalog.beans.VnfResource;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
+import org.onap.so.db.catalog.beans.VnfVfmoduleCvnfcConfigurationCustomization;
import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization;
import org.onap.so.db.catalog.beans.macro.NorthBoundRequest;
import org.onap.so.db.catalog.beans.macro.OrchestrationFlow;
@@ -65,7 +66,6 @@ import org.springframework.http.client.BufferingClientHttpRequestFactory;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.stereotype.Component;
-
import uk.co.blackpepper.bowman.Client;
import uk.co.blackpepper.bowman.ClientFactory;
import uk.co.blackpepper.bowman.Configuration;
@@ -73,633 +73,728 @@ import uk.co.blackpepper.bowman.Configuration;
@Component("CatalogDbClient")
public class CatalogDbClient {
- private static final String CLOUD_SITE = "/cloudSite";
- private static final String CLOUDIFY_MANAGER = "/cloudifyManager";
- private static final String RAINY_DAY_HANDLER_MACRO = "/rainy_day_handler_macro";
- private static final String NORTHBOUND_REQUEST_REF_LOOKUP = "/northbound_request_ref_lookup";
- private static final String NETWORK_RESOURCE_CUSTOMIZATION = "/networkResourceCustomization";
- private static final String COLLECTION_RESOURCE_INSTANCE_GROUP_CUSTOMIZATION = "/collectionResourceInstanceGroupCustomization";
- private static final String VNFC_INSTANCE_GROUP_CUSTOMIZATION = "/vnfcInstanceGroupCustomization";
- private static final String ORCHESTRATION_FLOW = "/orchestrationFlow";
- private static final String ORCHESTRATION_STATUS_STATE_TRANSITION_DIRECTIVE = "/orchestrationStatusStateTransitionDirective";
- private static final String INSTANCE_GROUP = "/instanceGroup";
- private static final String COLLECTION_NETWORK_RESOURCE_CUSTOMIZATION = "/collectionNetworkResourceCustomization";
- private static final String BUILDING_BLOCK_DETAIL = "/buildingBlockDetail";
- private static final String NETWORK_COLLECTION_RESOURCE_CUSTOMIZATION = "/networkCollectionResourceCustomization";
- private static final String VNF_RESOURCE_CUSTOMIZATION = "/vnfResourceCustomization";
- private static final String SERVICE = "/service";
- private static final String EXTERNAL_SERVICE_TO_INTERNAL_MODEL_MAPPING = "/externalServiceToInternalService";
- private static final String VNF_RESOURCE = "/vnfResource";
- private static final String VNF_RECIPE = "/vnfRecipe";
- private static final String VFMODULE = "/vfModule";
- private static final String VFMODULE_CUSTOMIZATION = "/vfModuleCustomization";
- private static final String VNF_COMPONENTS_RECIPE = "/vnfComponentsRecipe";
- private static final String SERVICE_RECIPE = "/serviceRecipe";
- private static final String NETWORK_RECIPE = "/networkRecipe";
-
- private static final String SEARCH = "/search";
- private static final String URI_SEPARATOR = "/";
-
- private static final String SERVICE_MODEL_UUID = "serviceModelUUID";
- private static final String SERVICE_NAME = "serviceName";
- private static final String MODEL_UUID = "modelUUID";
- private static final String MODEL_CUSTOMIZATION_UUID = "modelCustomizationUUID";
- private static final String ACTION = "action";
- private static final String MODEL_NAME = "modelName";
- private static final String MODEL_VERSION = "modelVersion";
- private static final String MODEL_INVARIANT_UUID = "modelInvariantUUID";
- private static final String MODEL_INSTANCE_NAME = "modelInstanceName";
- private static final String VNF_RESOURCE_MODEL_UUID = "vnfResourceModelUUID";
- private static final String NF_ROLE = "nfRole";
- private static final String VF_MODULE_MODEL_UUID = "vfModuleModelUUID";
- private static final String VNF_COMPONENT_TYPE = "vnfComponentType";
- private static final String BUILDING_BLOCK_NAME = "buildingBlockName";
- private static final String RESOURCE_TYPE = "resourceType";
- private static final String ORCHESTRATION_STATUS = "orchestrationStatus";
- private static final String TARGET_ACTION = "targetAction";
- private static final String REQUEST_SCOPE = "requestScope";
- private static final String IS_ALACARTE = "isALaCarte";
- private static final String CLOUD_OWNER = "cloudOwner";
- private static final String FLOW_NAME = "flowName";
- private static final String SERVICE_TYPE = "serviceType";
- private static final String VNF_TYPE = "vnfType";
- private static final String ERROR_CODE = "errorCode";
- private static final String WORK_STEP = "workStep";
- private static final String CLLI = "clli";
- private static final String CLOUD_VERSION = "cloudVersion";
- private static final String HOMING_INSTANCE = "/homingInstance";
-
- private static final String TARGET_ENTITY = "SO:CatalogDB";
- private static final String ASTERISK = "*";
-
- private String findExternalToInternalServiceByServiceName = "/findByServiceName";
- private String findServiceByModelName = "/findOneByModelName";
- private String findServiceRecipeByActionAndServiceModelUUID = "/findByActionAndServiceModelUUID";
- private String findServiceByModelUUID = "/findOneByModelUUID";
- private String findFirstByModelNameURI = "/findFirstByModelNameOrderByModelVersionDesc";
- private String findFirstByServiceModelUUIDAndActionURI = "/findFirstByServiceModelUUIDAndAction";
- private String findFirstByModelVersionAndModelInvariantUUIDURI = "/findFirstByModelVersionAndModelInvariantUUID";
- private String findByModelInvariantUUIDURI = "/findByModelInvariantUUIDOrderByModelVersionDesc";
- private String findFirstByModelNameAndAction = "/findFirstByModelNameAndAction";
- private String findFirstResourceByModelInvariantUUIDAndModelVersion = "/findFirstResourceByModelInvariantUUIDAndModelVersion";
- private String findByModelInstanceNameAndVnfResources = "/findByModelInstanceNameAndVnfResources";
- private String findFirstVnfRecipeByNfRoleAndAction = "/findFirstVnfRecipeByNfRoleAndAction";
- private String findByModelCustomizationUUIDAndVfModuleModelUUID = "/findByModelCustomizationUUIDAndVfModuleModelUUID";
- private String findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction = "/findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction";
- private String findFirstVnfComponentsRecipeByVnfComponentTypeAndAction = "/findFirstVnfComponentsRecipeByVnfComponentTypeAndAction";
- private String findVfModuleByModelInvariantUUIDOrderByModelVersionDesc = "/findByModelInvariantUUIDOrderByModelVersionDesc";
- private String findFirstVfModuleByModelInvariantUUIDAndModelVersion = "/findFirstVfModuleByModelInvariantUUIDAndModelVersion";
- private String findOneByBuildingBlockName = "/findOneByBuildingBlockName";
- private String findOneByResourceTypeAndOrchestrationStatusAndTargetAction = "/findOneByResourceTypeAndOrchestrationStatusAndTargetAction";
- private String findByAction = "/findByAction";
- private String findVnfcInstanceGroupCustomizationByModelCustomizationUUID = "/findByModelCustomizationUUID";
- private String findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID = "/findByModelCustomizationUUID";
- private String findOneByActionAndRequestScopeAndIsAlacarte = "/findOneByActionAndRequestScopeAndIsAlacarte";
- private String findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner = "/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner";
- private String findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType = "/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType";
- private String findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep = "/findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep";
- private String findByClliAndCloudVersion = "/findByClliAndCloudVersion";
- private String findServiceByServiceInstanceId = "/findServiceByServiceInstanceId";
-
-
- private String serviceURI;
- private String vfModuleURI;
- private String vnfResourceURI;
- private String vfModuleCustomizationURI;
- private String networkCollectionResourceCustomizationURI;
- private String networkResourceCustomizationURI;
- private String vnfResourceCustomizationURI;
- private String collectionNetworkResourceCustomizationURI;
- private String instanceGroupURI;
- private String cloudifyManagerURI;
- private String cloudSiteURI;
- private String homingInstanceURI;
-
- private final Client<Service> serviceClient;
-
- private final Client<NetworkRecipe> networkRecipeClient;
-
- private final Client<NetworkResourceCustomization> networkResourceCustomizationClient;
-
- private final Client<VnfResource> vnfResourceClient;
-
- private final Client<VnfResourceCustomization> vnfResourceCustomizationClient;
-
- private final Client<VnfRecipe> vnfRecipeClient;
-
- private final Client<VfModuleCustomization> vfModuleCustomizationClient;
-
- private final Client<VfModule> vfModuleClient;
-
- private final Client<VnfComponentsRecipe> vnfComponentsRecipeClient;
-
- private final Client<OrchestrationFlow> orchestrationClient;
-
- private final Client<NorthBoundRequest> northBoundRequestClient;
-
- private final Client<RainyDayHandlerStatus> rainyDayHandlerStatusClient;
-
- private final Client<BuildingBlockDetail> buildingBlockDetailClient;
-
- private final Client<OrchestrationStatusStateTransitionDirective> orchestrationStatusStateTransitionDirectiveClient;
-
- private final Client<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizationClient;
-
- private final Client<CollectionResourceInstanceGroupCustomization> collectionResourceInstanceGroupCustomizationClient;
-
- private final Client<InstanceGroup> instanceGroupClient;
-
- private final Client<NetworkCollectionResourceCustomization> networkCollectionResourceCustomizationClient;
-
- private final Client<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomizationClient;
-
- private final Client<ServiceRecipe> serviceRecipeClient;
-
- private final Client<ExternalServiceToInternalService> externalServiceToInternalServiceClient;
-
- private final Client<CloudSite> cloudSiteClient;
-
- private final Client<HomingInstance> homingInstanceClient;
-
- private final Client<CloudifyManager> cloudifyManagerClient;
-
- private final Client<CvnfcCustomization> cvnfcCustomizationClient;
-
- private final Client<ControllerSelectionReference> controllerSelectionReferenceClient;
-
- @Value("${mso.catalog.db.spring.endpoint}")
- private String endpoint;
-
- @Value("${mso.db.auth}")
- private String msoAdaptersAuth;
-
-
- @PostConstruct
- public void init(){
- findExternalToInternalServiceByServiceName = endpoint + EXTERNAL_SERVICE_TO_INTERNAL_MODEL_MAPPING + SEARCH + findExternalToInternalServiceByServiceName;
- findServiceByModelName = endpoint + SERVICE + SEARCH + findServiceByModelName;
- findServiceRecipeByActionAndServiceModelUUID = endpoint + SERVICE_RECIPE + SEARCH + findServiceRecipeByActionAndServiceModelUUID;
- findServiceByModelUUID = endpoint + SERVICE + SEARCH + findServiceByModelUUID;
- findFirstByModelNameURI = endpoint + SERVICE + SEARCH + findFirstByModelNameURI;
- findFirstByModelVersionAndModelInvariantUUIDURI = endpoint + SERVICE + SEARCH + findFirstByModelVersionAndModelInvariantUUIDURI;
- findByModelInvariantUUIDURI = endpoint + SERVICE + SEARCH + findByModelInvariantUUIDURI;
- findFirstByServiceModelUUIDAndActionURI = endpoint + SERVICE_RECIPE + SEARCH + findFirstByServiceModelUUIDAndActionURI;
- findFirstByModelNameAndAction = endpoint + NETWORK_RECIPE + SEARCH + findFirstByModelNameAndAction;
- findFirstResourceByModelInvariantUUIDAndModelVersion = endpoint + VNF_RESOURCE + SEARCH + findFirstResourceByModelInvariantUUIDAndModelVersion;
- findByModelInstanceNameAndVnfResources = endpoint + VNF_RESOURCE_CUSTOMIZATION + SEARCH + findByModelInstanceNameAndVnfResources;
- findFirstVnfRecipeByNfRoleAndAction = endpoint + VNF_RECIPE + SEARCH + findFirstVnfRecipeByNfRoleAndAction;
- findByModelCustomizationUUIDAndVfModuleModelUUID = endpoint + VFMODULE_CUSTOMIZATION + SEARCH + findByModelCustomizationUUIDAndVfModuleModelUUID;
- findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction = endpoint + VNF_COMPONENTS_RECIPE + SEARCH + findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction;
- findFirstVnfComponentsRecipeByVnfComponentTypeAndAction = endpoint + VNF_COMPONENTS_RECIPE + SEARCH + findFirstVnfComponentsRecipeByVnfComponentTypeAndAction;
- findVfModuleByModelInvariantUUIDOrderByModelVersionDesc = endpoint + VFMODULE + SEARCH +findVfModuleByModelInvariantUUIDOrderByModelVersionDesc;
- findFirstVfModuleByModelInvariantUUIDAndModelVersion = endpoint + VFMODULE + SEARCH + findFirstVfModuleByModelInvariantUUIDAndModelVersion;
- findOneByBuildingBlockName = endpoint + BUILDING_BLOCK_DETAIL + SEARCH + findOneByBuildingBlockName;
- findOneByResourceTypeAndOrchestrationStatusAndTargetAction = endpoint + ORCHESTRATION_STATUS_STATE_TRANSITION_DIRECTIVE + SEARCH + findOneByResourceTypeAndOrchestrationStatusAndTargetAction;
- findByAction = endpoint + ORCHESTRATION_FLOW + SEARCH + findByAction;
- findVnfcInstanceGroupCustomizationByModelCustomizationUUID = endpoint + VNFC_INSTANCE_GROUP_CUSTOMIZATION + SEARCH + findVnfcInstanceGroupCustomizationByModelCustomizationUUID;
- findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID = endpoint + COLLECTION_RESOURCE_INSTANCE_GROUP_CUSTOMIZATION + SEARCH + findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID;
- findOneByActionAndRequestScopeAndIsAlacarte = endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH + findOneByActionAndRequestScopeAndIsAlacarte;
- findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner = endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH + findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner;
- findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType = endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH + findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType;
- findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep = endpoint + RAINY_DAY_HANDLER_MACRO + SEARCH + findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep;
- findByClliAndCloudVersion = endpoint + CLOUD_SITE + SEARCH + findByClliAndCloudVersion;
-
- serviceURI = endpoint + SERVICE + URI_SEPARATOR;
- vfModuleURI = endpoint + VFMODULE + URI_SEPARATOR;
- vnfResourceURI = endpoint + VNF_RESOURCE + URI_SEPARATOR;
- vfModuleCustomizationURI = endpoint + VFMODULE_CUSTOMIZATION + URI_SEPARATOR;
- networkCollectionResourceCustomizationURI = endpoint + NETWORK_COLLECTION_RESOURCE_CUSTOMIZATION + URI_SEPARATOR;
- networkResourceCustomizationURI = endpoint + NETWORK_RESOURCE_CUSTOMIZATION + URI_SEPARATOR;
- vnfResourceCustomizationURI = endpoint + VNF_RESOURCE_CUSTOMIZATION + URI_SEPARATOR;
- collectionNetworkResourceCustomizationURI = endpoint + COLLECTION_NETWORK_RESOURCE_CUSTOMIZATION + URI_SEPARATOR;
- instanceGroupURI = endpoint + INSTANCE_GROUP + URI_SEPARATOR;
- cloudifyManagerURI = endpoint + CLOUDIFY_MANAGER + URI_SEPARATOR;
- cloudSiteURI = endpoint + CLOUD_SITE + URI_SEPARATOR;
- homingInstanceURI = endpoint + HOMING_INSTANCE + URI_SEPARATOR;
-
- }
-
- public CatalogDbClient() {
- ClientHttpRequestFactory factory = new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory());
-
- ClientFactory clientFactory = Configuration.builder().setClientHttpRequestFactory(factory).setRestTemplateConfigurer(restTemplate -> {
- restTemplate.getInterceptors().add((new SpringClientFilter()));
-
- restTemplate.getInterceptors().add((request, body, execution) -> {
-
- request.getHeaders().add(HttpHeaders.AUTHORIZATION, msoAdaptersAuth);
- request.getHeaders().add(LogConstants.TARGET_ENTITY_HEADER,TARGET_ENTITY);
- return execution.execute(request, body);
- });
- }).build().buildClientFactory();
- serviceClient = clientFactory.create(Service.class);
- networkRecipeClient = clientFactory.create(NetworkRecipe.class);
- networkResourceCustomizationClient = clientFactory.create(NetworkResourceCustomization.class);
- vnfResourceClient = clientFactory.create(VnfResource.class);
- vnfResourceCustomizationClient = clientFactory.create(VnfResourceCustomization.class);
- vnfRecipeClient = clientFactory.create(VnfRecipe.class);
- orchestrationClient = clientFactory.create(OrchestrationFlow.class);
- vfModuleCustomizationClient = clientFactory.create(VfModuleCustomization.class);
- vfModuleClient = clientFactory.create(VfModule.class);
- vnfComponentsRecipeClient = clientFactory.create(VnfComponentsRecipe.class);
- northBoundRequestClient = clientFactory.create(NorthBoundRequest.class);
- rainyDayHandlerStatusClient = clientFactory.create(RainyDayHandlerStatus.class);
- buildingBlockDetailClient = clientFactory.create(BuildingBlockDetail.class);
- orchestrationStatusStateTransitionDirectiveClient = clientFactory
- .create(OrchestrationStatusStateTransitionDirective.class);
- vnfcInstanceGroupCustomizationClient = clientFactory.create(VnfcInstanceGroupCustomization.class);
- collectionResourceInstanceGroupCustomizationClient = clientFactory
- .create(CollectionResourceInstanceGroupCustomization.class);
- instanceGroupClient = clientFactory.create(InstanceGroup.class);
- networkCollectionResourceCustomizationClient = clientFactory.create(NetworkCollectionResourceCustomization.class);
- collectionNetworkResourceCustomizationClient = clientFactory.create(CollectionNetworkResourceCustomization.class);
- cloudSiteClient = clientFactory.create(CloudSite.class);
- homingInstanceClient = clientFactory.create(HomingInstance.class);
- cloudifyManagerClient = clientFactory.create(CloudifyManager.class);
- serviceRecipeClient = clientFactory.create(ServiceRecipe.class);
- cvnfcCustomizationClient = clientFactory.create(CvnfcCustomization.class);
- controllerSelectionReferenceClient = clientFactory.create(ControllerSelectionReference.class);
- externalServiceToInternalServiceClient = clientFactory.create(ExternalServiceToInternalService.class);
- }
-
- public CatalogDbClient(String baseUri, String auth) {
- ClientHttpRequestFactory factory = new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory());
-
- ClientFactory clientFactory = Configuration.builder().setBaseUri(baseUri).setClientHttpRequestFactory(factory).setRestTemplateConfigurer(restTemplate -> {
- restTemplate.getInterceptors().add((new SpringClientFilter()));
-
- restTemplate.getInterceptors().add((request, body, execution) -> {
-
- request.getHeaders().add(HttpHeaders.AUTHORIZATION, auth);
- request.getHeaders().add(LogConstants.TARGET_ENTITY_HEADER,TARGET_ENTITY);
- return execution.execute(request, body);
- });
- }).build().buildClientFactory();
- serviceClient = clientFactory.create(Service.class);
- networkRecipeClient = clientFactory.create(NetworkRecipe.class);
- networkResourceCustomizationClient = clientFactory.create(NetworkResourceCustomization.class);
- vnfResourceClient = clientFactory.create(VnfResource.class);
- vnfResourceCustomizationClient = clientFactory.create(VnfResourceCustomization.class);
- vnfRecipeClient = clientFactory.create(VnfRecipe.class);
- orchestrationClient = clientFactory.create(OrchestrationFlow.class);
- vfModuleCustomizationClient = clientFactory.create(VfModuleCustomization.class);
- vfModuleClient = clientFactory.create(VfModule.class);
- vnfComponentsRecipeClient = clientFactory.create(VnfComponentsRecipe.class);
- northBoundRequestClient = clientFactory.create(NorthBoundRequest.class);
- rainyDayHandlerStatusClient = clientFactory.create(RainyDayHandlerStatus.class);
- buildingBlockDetailClient = clientFactory.create(BuildingBlockDetail.class);
- orchestrationStatusStateTransitionDirectiveClient = clientFactory
- .create(OrchestrationStatusStateTransitionDirective.class);
- vnfcInstanceGroupCustomizationClient = clientFactory.create(VnfcInstanceGroupCustomization.class);
- collectionResourceInstanceGroupCustomizationClient = clientFactory
- .create(CollectionResourceInstanceGroupCustomization.class);
- instanceGroupClient = clientFactory.create(InstanceGroup.class);
- networkCollectionResourceCustomizationClient = clientFactory.create(NetworkCollectionResourceCustomization.class);
- collectionNetworkResourceCustomizationClient = clientFactory.create(CollectionNetworkResourceCustomization.class);
- cloudSiteClient = clientFactory.create(CloudSite.class);
- homingInstanceClient = clientFactory.create(HomingInstance.class);
- cloudifyManagerClient = clientFactory.create(CloudifyManager.class);
- serviceRecipeClient = clientFactory.create(ServiceRecipe.class);
- cvnfcCustomizationClient = clientFactory.create(CvnfcCustomization.class);
- controllerSelectionReferenceClient = clientFactory.create(ControllerSelectionReference.class);
- externalServiceToInternalServiceClient = clientFactory.create(ExternalServiceToInternalService.class);
- }
-
- public NetworkCollectionResourceCustomization getNetworkCollectionResourceCustomizationByID(String modelCustomizationUUID) {
- NetworkCollectionResourceCustomization networkCollectionResourceCustomization =
- this.getSingleResource(networkCollectionResourceCustomizationClient, getUri(networkCollectionResourceCustomizationURI + modelCustomizationUUID));
- if (networkCollectionResourceCustomization != null) {
- networkCollectionResourceCustomization.setModelCustomizationUUID(modelCustomizationUUID);
- }
- return networkCollectionResourceCustomization;
- }
-
- public Service getServiceByID(String modelUUID) {
- Service service = getSingleResource(serviceClient,getUri(serviceURI + modelUUID));
- if (service != null) {
- service.setModelUUID(modelUUID);
- }
- return service;
- }
-
- public VfModule getVfModuleByModelUUID(String modelUUID) {
- VfModule vfModule = getSingleResource(vfModuleClient,getUri(vfModuleURI + modelUUID));
- if (vfModule != null) {
- vfModule.setModelUUID(modelUUID);
- }
- return vfModule;
- }
-
- public VnfResource getVnfResourceByModelUUID(String modelUUID){
-
- VnfResource vnfResource = this.getSingleResource(vnfResourceClient, getUri(vnfResourceURI + modelUUID));
- if (vnfResource != null) {
- vnfResource.setModelUUID(modelUUID);
- }
- return vnfResource;
- }
-
- public VnfResourceCustomization getVnfResourceCustomizationByModelCustomizationUUID(String modelCustomizationUUID){
- VnfResourceCustomization vnfResourceCustomization = getSingleResource(vnfResourceCustomizationClient, getUri(vnfResourceCustomizationURI + modelCustomizationUUID));
- if (vnfResourceCustomization != null) {
- vnfResourceCustomization.setModelCustomizationUUID(modelCustomizationUUID);
- }
- return vnfResourceCustomization;
- }
-
- public CollectionNetworkResourceCustomization getCollectionNetworkResourceCustomizationByID(String modelCustomizationUUID) {
- CollectionNetworkResourceCustomization collectionNetworkResourceCustomization =
- this.getSingleResource(collectionNetworkResourceCustomizationClient,getUri(UriBuilder
- .fromUri(collectionNetworkResourceCustomizationURI + modelCustomizationUUID).build().toString()));
- if (collectionNetworkResourceCustomization != null) {
- collectionNetworkResourceCustomization.setModelCustomizationUUID(modelCustomizationUUID);
- }
- return collectionNetworkResourceCustomization;
- }
-
- public InstanceGroup getInstanceGroupByModelUUID(String modelUUID) {
- InstanceGroup instanceGroup = this.getSingleResource(instanceGroupClient, getUri(instanceGroupURI + modelUUID));
- if (instanceGroup != null) {
- instanceGroup.setModelUUID(modelUUID);
- }
- return instanceGroup;
- }
-
- public VfModuleCustomization getVfModuleCustomizationByModelCuztomizationUUID(String modelCustomizationUUID) {
- VfModuleCustomization vfModuleCust = this.getSingleResource(vfModuleCustomizationClient, getUri(vfModuleCustomizationURI + modelCustomizationUUID));
- if (vfModuleCust != null) {
- vfModuleCust.setModelCustomizationUUID(modelCustomizationUUID);
- }
- return vfModuleCust;
- }
-
- public NetworkResourceCustomization getNetworkResourceCustomizationByModelCustomizationUUID(String modelCustomizationUUID){
- NetworkResourceCustomization networkResourceCustomization =
- this.getSingleResource(networkResourceCustomizationClient, getUri(networkResourceCustomizationURI + modelCustomizationUUID));
- if (networkResourceCustomization != null) {
- networkResourceCustomization.setModelCustomizationUUID(modelCustomizationUUID);
- }
- return networkResourceCustomization;
- }
-
- public BuildingBlockDetail getBuildingBlockDetail(String buildingBlockName) {
- BuildingBlockDetail buildingBlockDetail = getSingleResource(buildingBlockDetailClient, getUri(UriBuilder
- .fromUri(findOneByBuildingBlockName).queryParam(BUILDING_BLOCK_NAME, buildingBlockName).build().toString()));
- if (buildingBlockDetail != null) {
- buildingBlockDetail.setBuildingBlockName(buildingBlockName);
- }
- return buildingBlockDetail;
- }
-
-
- public OrchestrationStatusStateTransitionDirective getOrchestrationStatusStateTransitionDirective(
- ResourceType resourceType, OrchestrationStatus orchestrationStatus, OrchestrationAction targetAction) {
- return getSingleResource(orchestrationStatusStateTransitionDirectiveClient, UriBuilder
- .fromUri(findOneByResourceTypeAndOrchestrationStatusAndTargetAction)
- .queryParam(RESOURCE_TYPE, resourceType.name())
- .queryParam(ORCHESTRATION_STATUS, orchestrationStatus.name())
- .queryParam(TARGET_ACTION, targetAction.name()).build());
- }
-
- public List<OrchestrationFlow> getOrchestrationFlowByAction(String action) {
- return this.getMultipleResources(orchestrationClient, UriBuilder
- .fromUri(findByAction).queryParam(ACTION, action).build());
- }
-
- public List<VnfcInstanceGroupCustomization> getVnfcInstanceGroupsByVnfResourceCust(String modelCustomizationUUID) {
- return this.getMultipleResources(vnfcInstanceGroupCustomizationClient, UriBuilder
- .fromUri(findVnfcInstanceGroupCustomizationByModelCustomizationUUID)
- .queryParam(MODEL_CUSTOMIZATION_UUID, modelCustomizationUUID).build());
- }
-
- public List<CollectionResourceInstanceGroupCustomization> getCollectionResourceInstanceGroupCustomizationByModelCustUUID(
- String modelCustomizationUUID) {
- return this.getMultipleResources(collectionResourceInstanceGroupCustomizationClient, UriBuilder
- .fromUri(findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID)
- .queryParam(MODEL_CUSTOMIZATION_UUID, modelCustomizationUUID).build());
- }
-
- public VfModuleCustomization getVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUID(String modelCustomizationUUID, String vfModuleModelUUID) {
- return this.getSingleResource(vfModuleCustomizationClient, getUri(UriBuilder
- .fromUri(findByModelCustomizationUUIDAndVfModuleModelUUID)
- .queryParam(MODEL_CUSTOMIZATION_UUID,modelCustomizationUUID)
- .queryParam(VF_MODULE_MODEL_UUID,vfModuleModelUUID).build().toString()));
- }
-
- public NorthBoundRequest getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(String requestAction,
- String resourceName, boolean aLaCarte) {
- return this.getSingleResource(northBoundRequestClient, UriBuilder
- .fromUri(findOneByActionAndRequestScopeAndIsAlacarte)
- .queryParam(ACTION, requestAction).queryParam(REQUEST_SCOPE, resourceName)
- .queryParam(IS_ALACARTE, aLaCarte).build());
- }
-
- public NorthBoundRequest getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(String requestAction,
- String resourceName, boolean aLaCarte, String cloudOwner) {
- return this.getSingleResource(northBoundRequestClient, getUri(UriBuilder
- .fromUri(findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType)
- .queryParam(ACTION, requestAction).queryParam(REQUEST_SCOPE, resourceName)
- .queryParam(IS_ALACARTE, aLaCarte)
- .queryParam(CLOUD_OWNER, cloudOwner)
- .queryParam(SERVICE_TYPE, ASTERISK).build().toString()));
- }
-
- public NorthBoundRequest getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwnerAndServiceType(String requestAction,
- String resourceName, boolean aLaCarte, String cloudOwner, String serviceType) {
- return this.getSingleResource(northBoundRequestClient, getUri(UriBuilder
- .fromUri(findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType)
- .queryParam(ACTION, requestAction).queryParam(REQUEST_SCOPE, resourceName)
- .queryParam(IS_ALACARTE, aLaCarte)
- .queryParam(CLOUD_OWNER, cloudOwner)
- .queryParam(SERVICE_TYPE, serviceType).build().toString()));
- }
-
- public RainyDayHandlerStatus getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(
- String flowName, String serviceType, String vnfType, String errorCode, String workStep) {
- return this.getSingleResource(rainyDayHandlerStatusClient, getUri(UriBuilder
- .fromUri(findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep)
- .queryParam(FLOW_NAME, flowName).queryParam(SERVICE_TYPE, serviceType)
- .queryParam(VNF_TYPE, vnfType).queryParam(ERROR_CODE, errorCode).queryParam(WORK_STEP, workStep)
- .build().toString()));
- }
-
- public ServiceRecipe getFirstByServiceModelUUIDAndAction(String modelUUID, String action){
- return this.getSingleResource(serviceRecipeClient, getUri(UriBuilder
- .fromUri(findFirstByServiceModelUUIDAndActionURI)
- .queryParam(SERVICE_MODEL_UUID,modelUUID)
- .queryParam(ACTION,action).build().toString()));
- }
-
- public NetworkRecipe getFirstNetworkRecipeByModelNameAndAction(String modelName, String action){
- return this.getSingleResource(networkRecipeClient, UriBuilder
- .fromUri(findFirstByModelNameAndAction)
- .queryParam(MODEL_NAME,modelName)
- .queryParam(ACTION,action).build());
- }
-
- public ControllerSelectionReference getControllerSelectionReferenceByVnfTypeAndActionCategory(String vnfType, String actionCategory) {
- return this.getSingleResource(controllerSelectionReferenceClient, UriBuilder
- .fromUri(endpoint + "/controllerSelectionReference/search/findControllerSelectionReferenceByVnfTypeAndActionCategory")
- .queryParam("VNF_TYPE", vnfType).queryParam("ACTION_CATEGORY", actionCategory).build());
- }
-
- public Service getFirstByModelNameOrderByModelVersionDesc(String modelName){
- return this.getSingleResource(serviceClient,UriBuilder
- .fromUri(findFirstByModelNameURI)
- .queryParam(MODEL_NAME,modelName).build());
- }
-
- public ExternalServiceToInternalService findExternalToInternalServiceByServiceName(String serviceName){
- return this.getSingleResource(externalServiceToInternalServiceClient, getUri(UriBuilder
- .fromUri(findExternalToInternalServiceByServiceName)
- .queryParam(SERVICE_NAME,serviceName).build().toString()));
- }
-
- public ServiceRecipe findServiceRecipeByActionAndServiceModelUUID(String action,String modelUUID){
- return this.getSingleResource(serviceRecipeClient, getUri(UriBuilder
- .fromUri(findServiceRecipeByActionAndServiceModelUUID)
- .queryParam(ACTION,action)
- .queryParam(SERVICE_MODEL_UUID,modelUUID).build().toString()));
- }
-
- public Service getServiceByModelName(String modelName){
- return this.getSingleResource(serviceClient,getUri(UriBuilder
- .fromUri(findServiceByModelName)
- .queryParam(MODEL_NAME,modelName).build().toString()));
- }
-
- public Service getServiceByModelUUID(String modelModelUUID){
- return this.getSingleResource(serviceClient,getUri(UriBuilder
- .fromUri(findServiceByModelUUID)
- .queryParam(MODEL_UUID,modelModelUUID).build().toString()));
- }
-
- public VnfResource getFirstVnfResourceByModelInvariantUUIDAndModelVersion(String modelInvariantUUID, String modelVersion){
- return this.getSingleResource(vnfResourceClient, getUri(UriBuilder
- .fromUri(findFirstResourceByModelInvariantUUIDAndModelVersion)
- .queryParam(MODEL_INVARIANT_UUID,modelInvariantUUID)
- .queryParam(MODEL_VERSION,modelVersion).build().toString()));
- }
-
-
- public VnfResourceCustomization getFirstVnfResourceCustomizationByModelInstanceNameAndVnfResources(String modelInstanceName, VnfResource vnfResource){
- return this.getSingleResource(vnfResourceCustomizationClient, getUri(UriBuilder
- .fromUri(findByModelInstanceNameAndVnfResources)
- .queryParam(MODEL_INSTANCE_NAME,modelInstanceName)
- .queryParam(VNF_RESOURCE_MODEL_UUID,vnfResource.getModelUUID()).build().toString()));
- }
-
- public VnfRecipe getFirstVnfRecipeByNfRoleAndAction(String nfRole, String action){
- return this.getSingleResource(vnfRecipeClient,getUri(UriBuilder
- .fromUri(findFirstVnfRecipeByNfRoleAndAction)
- .queryParam(NF_ROLE,nfRole)
- .queryParam(ACTION,action).build().toString()));
- }
-
- public VnfComponentsRecipe getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(String vfModuleModelUUID, String vnfComponentType, String action){
- return this.getSingleResource(vnfComponentsRecipeClient,getUri(UriBuilder
- .fromUri(findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction)
- .queryParam(VF_MODULE_MODEL_UUID,vfModuleModelUUID)
- .queryParam(VNF_COMPONENT_TYPE,vnfComponentType)
- .queryParam(ACTION,action).build().toString()));
- }
-
- public VnfComponentsRecipe getFirstVnfComponentsRecipeByVnfComponentTypeAndAction(String vnfComponentType, String action) {
- return this.getSingleResource(vnfComponentsRecipeClient,getUri(UriBuilder
- .fromUri(findFirstVnfComponentsRecipeByVnfComponentTypeAndAction)
- .queryParam(VNF_COMPONENT_TYPE,vnfComponentType)
- .queryParam(ACTION,action).build().toString()));
- }
- protected URI getUri(String template){
- return URI.create(template);
- }
-
- public CloudifyManager getCloudifyManager(String id) {
- return this.getSingleResource(cloudifyManagerClient,getUri(cloudifyManagerURI + id));
- }
-
- public CloudSite getCloudSite(String id){
- return this.getSingleResource(cloudSiteClient,
- getUri(cloudSiteURI + id));
- }
-
- public CloudSite getCloudSite(String id, String uri){
- return this.getSingleResource(cloudSiteClient,
- getUri(uri + id));
- }
-
- public void postCloudSite(CloudSite cloudSite){
- this.postSingleResource(cloudSiteClient, cloudSite);
- }
-
- public CloudSite getCloudSiteByClliAndAicVersion (String clli, String cloudVersion){
- return this.getSingleResource(cloudSiteClient, getUri(UriBuilder
- .fromUri(findByClliAndCloudVersion)
- .queryParam(CLLI,clli).queryParam(CLOUD_VERSION,cloudVersion).build().toString()));
- }
-
- public HomingInstance getHomingInstance (String serviceInstanceId){
- return this.getSingleResource(homingInstanceClient,
- getUri(homingInstanceURI + serviceInstanceId));
- }
-
- public HomingInstance getHomingInstance (String serviceInstanceId, String uri){
- return this.getSingleResource(homingInstanceClient,
- getUri(uri + serviceInstanceId));
- }
-
- public void postHomingInstance(HomingInstance homingInstance){
- this.postSingleResource(homingInstanceClient, homingInstance);
- }
-
- public Service getServiceByModelVersionAndModelInvariantUUID(String modelVersion, String modelInvariantUUID) {
- return this.getSingleResource(serviceClient, getUri(UriBuilder
- .fromUri(findFirstByModelVersionAndModelInvariantUUIDURI)
- .queryParam(MODEL_VERSION, modelVersion)
- .queryParam(MODEL_INVARIANT_UUID, modelInvariantUUID).build().toString()));
- }
-
- public VfModule getVfModuleByModelInvariantUUIDAndModelVersion(String modelInvariantUUID, String modelVersion){
- return this.getSingleResource(vfModuleClient,getUri(UriBuilder
- .fromUri(findFirstVfModuleByModelInvariantUUIDAndModelVersion)
- .queryParam(MODEL_INVARIANT_UUID, modelInvariantUUID)
- .queryParam(MODEL_VERSION, modelVersion).build().toString()));
- }
-
- public List<Service> getServiceByModelInvariantUUIDOrderByModelVersionDesc(String modelInvariantUUID) {
- return this.getMultipleResources(serviceClient, getUri(UriBuilder
- .fromUri(findByModelInvariantUUIDURI)
- .queryParam(MODEL_INVARIANT_UUID, modelInvariantUUID).build().toString()));
- }
-
- public List<VfModule> getVfModuleByModelInvariantUUIDOrderByModelVersionDesc(String modelInvariantUUID) {
- return this.getMultipleResources(vfModuleClient, getUri(UriBuilder
- .fromUri(findVfModuleByModelInvariantUUIDOrderByModelVersionDesc)
- .queryParam(MODEL_INVARIANT_UUID, modelInvariantUUID).build().toString()));
- }
-
- private <T> T getSingleResource(Client<T> client, URI uri) {
- return client.get(uri);
- }
-
- private <T> List<T> getMultipleResources(Client<T> client, URI uri) {
- Iterable<T> iterator = client.getAll(uri);
- List<T> list = new ArrayList<>();
- Iterator<T> it = iterator.iterator();
- it.forEachRemaining(list::add);
- return list;
- }
-
- private <T> URI postSingleResource(Client<T> client, T type){
- return client.post(type);
- }
-
- public List<CvnfcCustomization> getCvnfcCustomizationByVnfCustomizationUUIDAndVfModuleCustomizationUUID(String vnfCustomizationUUID, String vfModuleCustomizationUUID){
-
- return this.getMultipleResources(cvnfcCustomizationClient,getUri(UriBuilder
- .fromUri(endpoint + "/cvnfcCustomization/search/findByVnfResourceCustomizationAndVfModuleCustomization")
- .queryParam("VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID", vnfCustomizationUUID)
- .queryParam("VF_MODULE_CUST_MODEL_CUSTOMIZATION_UUID", vfModuleCustomizationUUID).build().toString()));
- }
-
+ private static final String CLOUD_SITE = "/cloudSite";
+ private static final String CLOUDIFY_MANAGER = "/cloudifyManager";
+ private static final String RAINY_DAY_HANDLER_MACRO = "/rainy_day_handler_macro";
+ private static final String NORTHBOUND_REQUEST_REF_LOOKUP = "/northbound_request_ref_lookup";
+ private static final String NETWORK_RESOURCE_CUSTOMIZATION = "/networkResourceCustomization";
+ private static final String COLLECTION_RESOURCE_INSTANCE_GROUP_CUSTOMIZATION = "/collectionResourceInstanceGroupCustomization";
+ private static final String VNFC_INSTANCE_GROUP_CUSTOMIZATION = "/vnfcInstanceGroupCustomization";
+ private static final String ORCHESTRATION_FLOW = "/orchestrationFlow";
+ private static final String ORCHESTRATION_STATUS_STATE_TRANSITION_DIRECTIVE = "/orchestrationStatusStateTransitionDirective";
+ private static final String INSTANCE_GROUP = "/instanceGroup";
+ private static final String COLLECTION_NETWORK_RESOURCE_CUSTOMIZATION = "/collectionNetworkResourceCustomization";
+ private static final String BUILDING_BLOCK_DETAIL = "/buildingBlockDetail";
+ private static final String NETWORK_COLLECTION_RESOURCE_CUSTOMIZATION = "/networkCollectionResourceCustomization";
+ private static final String VNF_RESOURCE_CUSTOMIZATION = "/vnfResourceCustomization";
+ private static final String SERVICE = "/service";
+ private static final String EXTERNAL_SERVICE_TO_INTERNAL_MODEL_MAPPING = "/externalServiceToInternalService";
+ private static final String VNF_RESOURCE = "/vnfResource";
+ private static final String VNF_RECIPE = "/vnfRecipe";
+ private static final String VFMODULE = "/vfModule";
+ private static final String VFMODULE_CUSTOMIZATION = "/vfModuleCustomization";
+ private static final String VNF_COMPONENTS_RECIPE = "/vnfComponentsRecipe";
+ private static final String SERVICE_RECIPE = "/serviceRecipe";
+ private static final String NETWORK_RECIPE = "/networkRecipe";
+ private static final String PNF_RESOURCE = "/pnfResource";
+ private static final String PNF_RESOURCE_CUSTOMIZATION = "/pnfResourceCustomization";
+
+
+ private static final String SEARCH = "/search";
+ private static final String URI_SEPARATOR = "/";
+
+ private static final String SERVICE_MODEL_UUID = "serviceModelUUID";
+ private static final String SERVICE_NAME = "serviceName";
+ private static final String MODEL_UUID = "modelUUID";
+ private static final String MODEL_CUSTOMIZATION_UUID = "modelCustomizationUUID";
+ private static final String ACTION = "action";
+ private static final String MODEL_NAME = "modelName";
+ private static final String MODEL_VERSION = "modelVersion";
+ private static final String MODEL_INVARIANT_UUID = "modelInvariantUUID";
+ private static final String MODEL_INSTANCE_NAME = "modelInstanceName";
+ private static final String VNF_RESOURCE_MODEL_UUID = "vnfResourceModelUUID";
+ private static final String NF_ROLE = "nfRole";
+ private static final String VF_MODULE_MODEL_UUID = "vfModuleModelUUID";
+ private static final String VNF_COMPONENT_TYPE = "vnfComponentType";
+ private static final String BUILDING_BLOCK_NAME = "buildingBlockName";
+ private static final String RESOURCE_TYPE = "resourceType";
+ private static final String ORCHESTRATION_STATUS = "orchestrationStatus";
+ private static final String TARGET_ACTION = "targetAction";
+ private static final String REQUEST_SCOPE = "requestScope";
+ private static final String IS_ALACARTE = "isALaCarte";
+ private static final String CLOUD_OWNER = "cloudOwner";
+ private static final String FLOW_NAME = "flowName";
+ private static final String SERVICE_TYPE = "serviceType";
+ private static final String VNF_TYPE = "vnfType";
+ private static final String ERROR_CODE = "errorCode";
+ private static final String WORK_STEP = "workStep";
+ private static final String CLLI = "clli";
+ private static final String CLOUD_VERSION = "cloudVersion";
+ private static final String HOMING_INSTANCE = "/homingInstance";
+
+ private static final String TARGET_ENTITY = "SO:CatalogDB";
+ private static final String ASTERISK = "*";
+
+ private String findExternalToInternalServiceByServiceName = "/findByServiceName";
+ private String findServiceByModelName = "/findOneByModelName";
+ private String findServiceRecipeByActionAndServiceModelUUID = "/findByActionAndServiceModelUUID";
+ private String findServiceByModelUUID = "/findOneByModelUUID";
+ private String findFirstByModelNameURI = "/findFirstByModelNameOrderByModelVersionDesc";
+ private String findFirstByServiceModelUUIDAndActionURI = "/findFirstByServiceModelUUIDAndAction";
+ private String findFirstByModelVersionAndModelInvariantUUIDURI = "/findFirstByModelVersionAndModelInvariantUUID";
+ private String findByModelInvariantUUIDURI = "/findByModelInvariantUUIDOrderByModelVersionDesc";
+ private String findFirstByModelNameAndAction = "/findFirstByModelNameAndAction";
+ private String findFirstResourceByModelInvariantUUIDAndModelVersion = "/findFirstResourceByModelInvariantUUIDAndModelVersion";
+ private String findByModelInstanceNameAndVnfResources = "/findByModelInstanceNameAndVnfResources";
+ private String findFirstVnfRecipeByNfRoleAndAction = "/findFirstVnfRecipeByNfRoleAndAction";
+ private String findByModelCustomizationUUIDAndVfModuleModelUUID = "/findByModelCustomizationUUIDAndVfModuleModelUUID";
+ private String findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction = "/findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction";
+ private String findFirstVnfComponentsRecipeByVnfComponentTypeAndAction = "/findFirstVnfComponentsRecipeByVnfComponentTypeAndAction";
+ private String findVfModuleByModelInvariantUUIDOrderByModelVersionDesc = "/findByModelInvariantUUIDOrderByModelVersionDesc";
+ private String findFirstVfModuleByModelInvariantUUIDAndModelVersion = "/findFirstVfModuleByModelInvariantUUIDAndModelVersion";
+ private String findOneByBuildingBlockName = "/findOneByBuildingBlockName";
+ private String findOneByResourceTypeAndOrchestrationStatusAndTargetAction = "/findOneByResourceTypeAndOrchestrationStatusAndTargetAction";
+ private String findByAction = "/findByAction";
+ private String findVnfcInstanceGroupCustomizationByModelCustomizationUUID = "/findByModelCustomizationUUID";
+ private String findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID = "/findByModelCustomizationUUID";
+ private String findOneByActionAndRequestScopeAndIsAlacarte = "/findOneByActionAndRequestScopeAndIsAlacarte";
+ private String findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner = "/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner";
+ private String findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType = "/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType";
+ private String findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep = "/findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep";
+ private String findByClliAndCloudVersion = "/findByClliAndCloudVersion";
+ private String findServiceByServiceInstanceId = "/findServiceByServiceInstanceId";
+
+
+ private String serviceURI;
+ private String vfModuleURI;
+ private String vnfResourceURI;
+ private String vfModuleCustomizationURI;
+ private String networkCollectionResourceCustomizationURI;
+ private String networkResourceCustomizationURI;
+ private String vnfResourceCustomizationURI;
+ private String collectionNetworkResourceCustomizationURI;
+ private String instanceGroupURI;
+ private String cloudifyManagerURI;
+ private String cloudSiteURI;
+ private String homingInstanceURI;
+ private String pnfResourceURI;
+ private String pnfResourceCustomizationURI;
+
+ private final Client<Service> serviceClient;
+
+ private final Client<NetworkRecipe> networkRecipeClient;
+
+ private final Client<NetworkResourceCustomization> networkResourceCustomizationClient;
+
+ private final Client<VnfResource> vnfResourceClient;
+
+ private final Client<VnfResourceCustomization> vnfResourceCustomizationClient;
+
+ private final Client<VnfRecipe> vnfRecipeClient;
+
+ private final Client<VfModuleCustomization> vfModuleCustomizationClient;
+
+ private final Client<VfModule> vfModuleClient;
+
+ private final Client<VnfComponentsRecipe> vnfComponentsRecipeClient;
+
+ private final Client<OrchestrationFlow> orchestrationClient;
+
+ private final Client<NorthBoundRequest> northBoundRequestClient;
+
+ private final Client<RainyDayHandlerStatus> rainyDayHandlerStatusClient;
+
+ private final Client<BuildingBlockDetail> buildingBlockDetailClient;
+
+ private final Client<OrchestrationStatusStateTransitionDirective> orchestrationStatusStateTransitionDirectiveClient;
+
+ private final Client<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizationClient;
+
+ private final Client<CollectionResourceInstanceGroupCustomization> collectionResourceInstanceGroupCustomizationClient;
+
+ private final Client<InstanceGroup> instanceGroupClient;
+
+ private final Client<NetworkCollectionResourceCustomization> networkCollectionResourceCustomizationClient;
+
+ private final Client<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomizationClient;
+
+ private final Client<ServiceRecipe> serviceRecipeClient;
+
+ private final Client<ExternalServiceToInternalService> externalServiceToInternalServiceClient;
+
+ private final Client<CloudSite> cloudSiteClient;
+
+ private final Client<HomingInstance> homingInstanceClient;
+
+ private final Client<CloudifyManager> cloudifyManagerClient;
+
+ private final Client<CvnfcCustomization> cvnfcCustomizationClient;
+
+ private final Client<ControllerSelectionReference> controllerSelectionReferenceClient;
+
+ private final Client<VnfVfmoduleCvnfcConfigurationCustomization> vnfVfmoduleCvnfcConfigurationCustomizationClient;
+
+ private final Client<PnfResource> pnfResourceClient;
+
+ private final Client<PnfResourceCustomization> pnfResourceCustomizationClient;
+
+ @Value("${mso.catalog.db.spring.endpoint}")
+ private String endpoint;
+
+ @Value("${mso.db.auth}")
+ private String msoAdaptersAuth;
+
+
+ @PostConstruct
+ public void init() {
+ findExternalToInternalServiceByServiceName =
+ endpoint + EXTERNAL_SERVICE_TO_INTERNAL_MODEL_MAPPING + SEARCH + findExternalToInternalServiceByServiceName;
+ findServiceByModelName = endpoint + SERVICE + SEARCH + findServiceByModelName;
+ findServiceRecipeByActionAndServiceModelUUID =
+ endpoint + SERVICE_RECIPE + SEARCH + findServiceRecipeByActionAndServiceModelUUID;
+ findServiceByModelUUID = endpoint + SERVICE + SEARCH + findServiceByModelUUID;
+ findFirstByModelNameURI = endpoint + SERVICE + SEARCH + findFirstByModelNameURI;
+ findFirstByModelVersionAndModelInvariantUUIDURI =
+ endpoint + SERVICE + SEARCH + findFirstByModelVersionAndModelInvariantUUIDURI;
+ findByModelInvariantUUIDURI = endpoint + SERVICE + SEARCH + findByModelInvariantUUIDURI;
+ findFirstByServiceModelUUIDAndActionURI =
+ endpoint + SERVICE_RECIPE + SEARCH + findFirstByServiceModelUUIDAndActionURI;
+ findFirstByModelNameAndAction = endpoint + NETWORK_RECIPE + SEARCH + findFirstByModelNameAndAction;
+ findFirstResourceByModelInvariantUUIDAndModelVersion =
+ endpoint + VNF_RESOURCE + SEARCH + findFirstResourceByModelInvariantUUIDAndModelVersion;
+ findByModelInstanceNameAndVnfResources =
+ endpoint + VNF_RESOURCE_CUSTOMIZATION + SEARCH + findByModelInstanceNameAndVnfResources;
+ findFirstVnfRecipeByNfRoleAndAction = endpoint + VNF_RECIPE + SEARCH + findFirstVnfRecipeByNfRoleAndAction;
+ findByModelCustomizationUUIDAndVfModuleModelUUID =
+ endpoint + VFMODULE_CUSTOMIZATION + SEARCH + findByModelCustomizationUUIDAndVfModuleModelUUID;
+ findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction =
+ endpoint + VNF_COMPONENTS_RECIPE + SEARCH
+ + findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction;
+ findFirstVnfComponentsRecipeByVnfComponentTypeAndAction =
+ endpoint + VNF_COMPONENTS_RECIPE + SEARCH + findFirstVnfComponentsRecipeByVnfComponentTypeAndAction;
+ findVfModuleByModelInvariantUUIDOrderByModelVersionDesc =
+ endpoint + VFMODULE + SEARCH + findVfModuleByModelInvariantUUIDOrderByModelVersionDesc;
+ findFirstVfModuleByModelInvariantUUIDAndModelVersion =
+ endpoint + VFMODULE + SEARCH + findFirstVfModuleByModelInvariantUUIDAndModelVersion;
+ findOneByBuildingBlockName = endpoint + BUILDING_BLOCK_DETAIL + SEARCH + findOneByBuildingBlockName;
+ findOneByResourceTypeAndOrchestrationStatusAndTargetAction =
+ endpoint + ORCHESTRATION_STATUS_STATE_TRANSITION_DIRECTIVE + SEARCH
+ + findOneByResourceTypeAndOrchestrationStatusAndTargetAction;
+ findByAction = endpoint + ORCHESTRATION_FLOW + SEARCH + findByAction;
+ findVnfcInstanceGroupCustomizationByModelCustomizationUUID =
+ endpoint + VNFC_INSTANCE_GROUP_CUSTOMIZATION + SEARCH
+ + findVnfcInstanceGroupCustomizationByModelCustomizationUUID;
+ findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID =
+ endpoint + COLLECTION_RESOURCE_INSTANCE_GROUP_CUSTOMIZATION + SEARCH
+ + findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID;
+ findOneByActionAndRequestScopeAndIsAlacarte =
+ endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH + findOneByActionAndRequestScopeAndIsAlacarte;
+ findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner = endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH
+ + findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner;
+ findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType =
+ endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH
+ + findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType;
+ findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep = endpoint + RAINY_DAY_HANDLER_MACRO + SEARCH
+ + findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep;
+ findByClliAndCloudVersion = endpoint + CLOUD_SITE + SEARCH + findByClliAndCloudVersion;
+
+ serviceURI = endpoint + SERVICE + URI_SEPARATOR;
+ vfModuleURI = endpoint + VFMODULE + URI_SEPARATOR;
+ vnfResourceURI = endpoint + VNF_RESOURCE + URI_SEPARATOR;
+ vfModuleCustomizationURI = endpoint + VFMODULE_CUSTOMIZATION + URI_SEPARATOR;
+ networkCollectionResourceCustomizationURI =
+ endpoint + NETWORK_COLLECTION_RESOURCE_CUSTOMIZATION + URI_SEPARATOR;
+ networkResourceCustomizationURI = endpoint + NETWORK_RESOURCE_CUSTOMIZATION + URI_SEPARATOR;
+ vnfResourceCustomizationURI = endpoint + VNF_RESOURCE_CUSTOMIZATION + URI_SEPARATOR;
+ collectionNetworkResourceCustomizationURI =
+ endpoint + COLLECTION_NETWORK_RESOURCE_CUSTOMIZATION + URI_SEPARATOR;
+ instanceGroupURI = endpoint + INSTANCE_GROUP + URI_SEPARATOR;
+ cloudifyManagerURI = endpoint + CLOUDIFY_MANAGER + URI_SEPARATOR;
+ cloudSiteURI = endpoint + CLOUD_SITE + URI_SEPARATOR;
+ homingInstanceURI = endpoint + HOMING_INSTANCE + URI_SEPARATOR;
+ pnfResourceURI = endpoint + PNF_RESOURCE + URI_SEPARATOR;
+ pnfResourceCustomizationURI = endpoint + PNF_RESOURCE_CUSTOMIZATION + URI_SEPARATOR;
+
+ }
+
+ public CatalogDbClient() {
+ ClientHttpRequestFactory factory = new BufferingClientHttpRequestFactory(
+ new HttpComponentsClientHttpRequestFactory());
+
+ ClientFactory clientFactory = Configuration.builder().setClientHttpRequestFactory(factory)
+ .setRestTemplateConfigurer(restTemplate -> {
+ restTemplate.getInterceptors().add((new SpringClientFilter()));
+
+ restTemplate.getInterceptors().add((request, body, execution) -> {
+
+ request.getHeaders().add(HttpHeaders.AUTHORIZATION, msoAdaptersAuth);
+ request.getHeaders().add(LogConstants.TARGET_ENTITY_HEADER, TARGET_ENTITY);
+ return execution.execute(request, body);
+ });
+ }).build().buildClientFactory();
+ serviceClient = clientFactory.create(Service.class);
+ networkRecipeClient = clientFactory.create(NetworkRecipe.class);
+ networkResourceCustomizationClient = clientFactory.create(NetworkResourceCustomization.class);
+ vnfResourceClient = clientFactory.create(VnfResource.class);
+ vnfResourceCustomizationClient = clientFactory.create(VnfResourceCustomization.class);
+ vnfRecipeClient = clientFactory.create(VnfRecipe.class);
+ orchestrationClient = clientFactory.create(OrchestrationFlow.class);
+ vfModuleCustomizationClient = clientFactory.create(VfModuleCustomization.class);
+ vfModuleClient = clientFactory.create(VfModule.class);
+ vnfComponentsRecipeClient = clientFactory.create(VnfComponentsRecipe.class);
+ northBoundRequestClient = clientFactory.create(NorthBoundRequest.class);
+ rainyDayHandlerStatusClient = clientFactory.create(RainyDayHandlerStatus.class);
+ buildingBlockDetailClient = clientFactory.create(BuildingBlockDetail.class);
+ orchestrationStatusStateTransitionDirectiveClient = clientFactory
+ .create(OrchestrationStatusStateTransitionDirective.class);
+ vnfcInstanceGroupCustomizationClient = clientFactory.create(VnfcInstanceGroupCustomization.class);
+ collectionResourceInstanceGroupCustomizationClient = clientFactory
+ .create(CollectionResourceInstanceGroupCustomization.class);
+ instanceGroupClient = clientFactory.create(InstanceGroup.class);
+ networkCollectionResourceCustomizationClient = clientFactory
+ .create(NetworkCollectionResourceCustomization.class);
+ collectionNetworkResourceCustomizationClient = clientFactory
+ .create(CollectionNetworkResourceCustomization.class);
+ cloudSiteClient = clientFactory.create(CloudSite.class);
+ homingInstanceClient = clientFactory.create(HomingInstance.class);
+ cloudifyManagerClient = clientFactory.create(CloudifyManager.class);
+ serviceRecipeClient = clientFactory.create(ServiceRecipe.class);
+ cvnfcCustomizationClient = clientFactory.create(CvnfcCustomization.class);
+ controllerSelectionReferenceClient = clientFactory.create(ControllerSelectionReference.class);
+ externalServiceToInternalServiceClient = clientFactory.create(ExternalServiceToInternalService.class);
+ vnfVfmoduleCvnfcConfigurationCustomizationClient = clientFactory.create(VnfVfmoduleCvnfcConfigurationCustomization.class);
+ pnfResourceClient = clientFactory.create(PnfResource.class);
+ pnfResourceCustomizationClient = clientFactory.create(PnfResourceCustomization.class);
+ }
+
+ public CatalogDbClient(String baseUri, String auth) {
+ ClientHttpRequestFactory factory = new BufferingClientHttpRequestFactory(
+ new HttpComponentsClientHttpRequestFactory());
+
+ ClientFactory clientFactory = Configuration.builder().setBaseUri(baseUri).setClientHttpRequestFactory(factory)
+ .setRestTemplateConfigurer(restTemplate -> {
+ restTemplate.getInterceptors().add((new SpringClientFilter()));
+
+ restTemplate.getInterceptors().add((request, body, execution) -> {
+
+ request.getHeaders().add(HttpHeaders.AUTHORIZATION, auth);
+ request.getHeaders().add(LogConstants.TARGET_ENTITY_HEADER, TARGET_ENTITY);
+ return execution.execute(request, body);
+ });
+ }).build().buildClientFactory();
+ serviceClient = clientFactory.create(Service.class);
+ networkRecipeClient = clientFactory.create(NetworkRecipe.class);
+ networkResourceCustomizationClient = clientFactory.create(NetworkResourceCustomization.class);
+ vnfResourceClient = clientFactory.create(VnfResource.class);
+ vnfResourceCustomizationClient = clientFactory.create(VnfResourceCustomization.class);
+ vnfRecipeClient = clientFactory.create(VnfRecipe.class);
+ orchestrationClient = clientFactory.create(OrchestrationFlow.class);
+ vfModuleCustomizationClient = clientFactory.create(VfModuleCustomization.class);
+ vfModuleClient = clientFactory.create(VfModule.class);
+ vnfComponentsRecipeClient = clientFactory.create(VnfComponentsRecipe.class);
+ northBoundRequestClient = clientFactory.create(NorthBoundRequest.class);
+ rainyDayHandlerStatusClient = clientFactory.create(RainyDayHandlerStatus.class);
+ buildingBlockDetailClient = clientFactory.create(BuildingBlockDetail.class);
+ orchestrationStatusStateTransitionDirectiveClient = clientFactory
+ .create(OrchestrationStatusStateTransitionDirective.class);
+ vnfcInstanceGroupCustomizationClient = clientFactory.create(VnfcInstanceGroupCustomization.class);
+ collectionResourceInstanceGroupCustomizationClient = clientFactory
+ .create(CollectionResourceInstanceGroupCustomization.class);
+ instanceGroupClient = clientFactory.create(InstanceGroup.class);
+ networkCollectionResourceCustomizationClient = clientFactory
+ .create(NetworkCollectionResourceCustomization.class);
+ collectionNetworkResourceCustomizationClient = clientFactory
+ .create(CollectionNetworkResourceCustomization.class);
+ cloudSiteClient = clientFactory.create(CloudSite.class);
+ homingInstanceClient = clientFactory.create(HomingInstance.class);
+ cloudifyManagerClient = clientFactory.create(CloudifyManager.class);
+ serviceRecipeClient = clientFactory.create(ServiceRecipe.class);
+ cvnfcCustomizationClient = clientFactory.create(CvnfcCustomization.class);
+ controllerSelectionReferenceClient = clientFactory.create(ControllerSelectionReference.class);
+ externalServiceToInternalServiceClient = clientFactory.create(ExternalServiceToInternalService.class);
+ vnfVfmoduleCvnfcConfigurationCustomizationClient = clientFactory.create(VnfVfmoduleCvnfcConfigurationCustomization.class);
+ pnfResourceClient = clientFactory.create(PnfResource.class);
+ pnfResourceCustomizationClient = clientFactory.create(PnfResourceCustomization.class);
+ }
+
+ public NetworkCollectionResourceCustomization getNetworkCollectionResourceCustomizationByID(
+ String modelCustomizationUUID) {
+ NetworkCollectionResourceCustomization networkCollectionResourceCustomization =
+ this.getSingleResource(networkCollectionResourceCustomizationClient,
+ getUri(networkCollectionResourceCustomizationURI + modelCustomizationUUID));
+ if (networkCollectionResourceCustomization != null) {
+ networkCollectionResourceCustomization.setModelCustomizationUUID(modelCustomizationUUID);
+ }
+ return networkCollectionResourceCustomization;
+ }
+
+ public Service getServiceByID(String modelUUID) {
+ Service service = getSingleResource(serviceClient, getUri(serviceURI + modelUUID));
+ if (service != null) {
+ service.setModelUUID(modelUUID);
+ }
+ return service;
+ }
+
+ public VfModule getVfModuleByModelUUID(String modelUUID) {
+ VfModule vfModule = getSingleResource(vfModuleClient, getUri(vfModuleURI + modelUUID));
+ if (vfModule != null) {
+ vfModule.setModelUUID(modelUUID);
+ }
+ return vfModule;
+ }
+
+ public VnfResource getVnfResourceByModelUUID(String modelUUID) {
+
+ VnfResource vnfResource = this.getSingleResource(vnfResourceClient, getUri(vnfResourceURI + modelUUID));
+ if (vnfResource != null) {
+ vnfResource.setModelUUID(modelUUID);
+ }
+ return vnfResource;
+ }
+
+ public VnfResourceCustomization getVnfResourceCustomizationByModelCustomizationUUID(String modelCustomizationUUID) {
+ VnfResourceCustomization vnfResourceCustomization = getSingleResource(vnfResourceCustomizationClient,
+ getUri(vnfResourceCustomizationURI + modelCustomizationUUID));
+ if (vnfResourceCustomization != null) {
+ vnfResourceCustomization.setModelCustomizationUUID(modelCustomizationUUID);
+ }
+ return vnfResourceCustomization;
+ }
+
+ public PnfResource getPnfResourceByModelUUID(String modelUUID) {
+ PnfResource PnfResource = this.getSingleResource(pnfResourceClient, getUri(pnfResourceURI + modelUUID));
+ if (PnfResource != null) {
+ PnfResource.setModelUUID(modelUUID);
+ }
+ return PnfResource;
+ }
+
+ public PnfResourceCustomization getPnfResourceCustomizationByModelCustomizationUUID(String modelCustomizationUUID) {
+ PnfResourceCustomization pnfResourceCustomization = getSingleResource(pnfResourceCustomizationClient,
+ getUri(pnfResourceCustomizationURI + modelCustomizationUUID));
+ if (pnfResourceCustomization != null) {
+ pnfResourceCustomization.setModelCustomizationUUID(modelCustomizationUUID);
+ }
+ return pnfResourceCustomization;
+ }
+
+ public CollectionNetworkResourceCustomization getCollectionNetworkResourceCustomizationByID(
+ String modelCustomizationUUID) {
+ CollectionNetworkResourceCustomization collectionNetworkResourceCustomization =
+ this.getSingleResource(collectionNetworkResourceCustomizationClient, getUri(UriBuilder
+ .fromUri(collectionNetworkResourceCustomizationURI + modelCustomizationUUID).build().toString()));
+ if (collectionNetworkResourceCustomization != null) {
+ collectionNetworkResourceCustomization.setModelCustomizationUUID(modelCustomizationUUID);
+ }
+ return collectionNetworkResourceCustomization;
+ }
+
+ public InstanceGroup getInstanceGroupByModelUUID(String modelUUID) {
+ InstanceGroup instanceGroup = this.getSingleResource(instanceGroupClient, getUri(instanceGroupURI + modelUUID));
+ if (instanceGroup != null) {
+ instanceGroup.setModelUUID(modelUUID);
+ }
+ return instanceGroup;
+ }
+
+ public VfModuleCustomization getVfModuleCustomizationByModelCuztomizationUUID(String modelCustomizationUUID) {
+ VfModuleCustomization vfModuleCust = this
+ .getSingleResource(vfModuleCustomizationClient, getUri(vfModuleCustomizationURI + modelCustomizationUUID));
+ if (vfModuleCust != null) {
+ vfModuleCust.setModelCustomizationUUID(modelCustomizationUUID);
+ }
+ return vfModuleCust;
+ }
+
+ public NetworkResourceCustomization getNetworkResourceCustomizationByModelCustomizationUUID(
+ String modelCustomizationUUID) {
+ NetworkResourceCustomization networkResourceCustomization =
+ this.getSingleResource(networkResourceCustomizationClient,
+ getUri(networkResourceCustomizationURI + modelCustomizationUUID));
+ if (networkResourceCustomization != null) {
+ networkResourceCustomization.setModelCustomizationUUID(modelCustomizationUUID);
+ }
+ return networkResourceCustomization;
+ }
+
+ public BuildingBlockDetail getBuildingBlockDetail(String buildingBlockName) {
+ BuildingBlockDetail buildingBlockDetail = getSingleResource(buildingBlockDetailClient, getUri(UriBuilder
+ .fromUri(findOneByBuildingBlockName).queryParam(BUILDING_BLOCK_NAME, buildingBlockName).build()
+ .toString()));
+ if (buildingBlockDetail != null) {
+ buildingBlockDetail.setBuildingBlockName(buildingBlockName);
+ }
+ return buildingBlockDetail;
+ }
+
+
+ public OrchestrationStatusStateTransitionDirective getOrchestrationStatusStateTransitionDirective(
+ ResourceType resourceType, OrchestrationStatus orchestrationStatus, OrchestrationAction targetAction) {
+ return getSingleResource(orchestrationStatusStateTransitionDirectiveClient, UriBuilder
+ .fromUri(findOneByResourceTypeAndOrchestrationStatusAndTargetAction)
+ .queryParam(RESOURCE_TYPE, resourceType.name())
+ .queryParam(ORCHESTRATION_STATUS, orchestrationStatus.name())
+ .queryParam(TARGET_ACTION, targetAction.name()).build());
+ }
+
+ public List<OrchestrationFlow> getOrchestrationFlowByAction(String action) {
+ return this.getMultipleResources(orchestrationClient, UriBuilder
+ .fromUri(findByAction).queryParam(ACTION, action).build());
+ }
+
+ public List<VnfcInstanceGroupCustomization> getVnfcInstanceGroupsByVnfResourceCust(String modelCustomizationUUID) {
+ return this.getMultipleResources(vnfcInstanceGroupCustomizationClient, UriBuilder
+ .fromUri(findVnfcInstanceGroupCustomizationByModelCustomizationUUID)
+ .queryParam(MODEL_CUSTOMIZATION_UUID, modelCustomizationUUID).build());
+ }
+
+ public List<CollectionResourceInstanceGroupCustomization> getCollectionResourceInstanceGroupCustomizationByModelCustUUID(
+ String modelCustomizationUUID) {
+ return this.getMultipleResources(collectionResourceInstanceGroupCustomizationClient, UriBuilder
+ .fromUri(findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID)
+ .queryParam(MODEL_CUSTOMIZATION_UUID, modelCustomizationUUID).build());
+ }
+
+ public VfModuleCustomization getVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUID(
+ String modelCustomizationUUID, String vfModuleModelUUID) {
+ return this.getSingleResource(vfModuleCustomizationClient, getUri(UriBuilder
+ .fromUri(findByModelCustomizationUUIDAndVfModuleModelUUID)
+ .queryParam(MODEL_CUSTOMIZATION_UUID, modelCustomizationUUID)
+ .queryParam(VF_MODULE_MODEL_UUID, vfModuleModelUUID).build().toString()));
+ }
+
+ public NorthBoundRequest getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(String requestAction,
+ String resourceName, boolean aLaCarte) {
+ return this.getSingleResource(northBoundRequestClient, UriBuilder
+ .fromUri(findOneByActionAndRequestScopeAndIsAlacarte)
+ .queryParam(ACTION, requestAction).queryParam(REQUEST_SCOPE, resourceName)
+ .queryParam(IS_ALACARTE, aLaCarte).build());
+ }
+
+ public NorthBoundRequest getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(String requestAction,
+ String resourceName, boolean aLaCarte, String cloudOwner) {
+ return this.getSingleResource(northBoundRequestClient, getUri(UriBuilder
+ .fromUri(findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType)
+ .queryParam(ACTION, requestAction).queryParam(REQUEST_SCOPE, resourceName)
+ .queryParam(IS_ALACARTE, aLaCarte)
+ .queryParam(CLOUD_OWNER, cloudOwner)
+ .queryParam(SERVICE_TYPE, ASTERISK).build().toString()));
+ }
+
+ public NorthBoundRequest getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwnerAndServiceType(
+ String requestAction,
+ String resourceName, boolean aLaCarte, String cloudOwner, String serviceType) {
+ return this.getSingleResource(northBoundRequestClient, getUri(UriBuilder
+ .fromUri(findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType)
+ .queryParam(ACTION, requestAction).queryParam(REQUEST_SCOPE, resourceName)
+ .queryParam(IS_ALACARTE, aLaCarte)
+ .queryParam(CLOUD_OWNER, cloudOwner)
+ .queryParam(SERVICE_TYPE, serviceType).build().toString()));
+ }
+
+ public RainyDayHandlerStatus getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(
+ String flowName, String serviceType, String vnfType, String errorCode, String workStep) {
+ return this.getSingleResource(rainyDayHandlerStatusClient, getUri(UriBuilder
+ .fromUri(findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep)
+ .queryParam(FLOW_NAME, flowName).queryParam(SERVICE_TYPE, serviceType)
+ .queryParam(VNF_TYPE, vnfType).queryParam(ERROR_CODE, errorCode).queryParam(WORK_STEP, workStep)
+ .build().toString()));
+ }
+
+ public ServiceRecipe getFirstByServiceModelUUIDAndAction(String modelUUID, String action) {
+ return this.getSingleResource(serviceRecipeClient, getUri(UriBuilder
+ .fromUri(findFirstByServiceModelUUIDAndActionURI)
+ .queryParam(SERVICE_MODEL_UUID, modelUUID)
+ .queryParam(ACTION, action).build().toString()));
+ }
+
+ public NetworkRecipe getFirstNetworkRecipeByModelNameAndAction(String modelName, String action) {
+ return this.getSingleResource(networkRecipeClient, UriBuilder
+ .fromUri(findFirstByModelNameAndAction)
+ .queryParam(MODEL_NAME, modelName)
+ .queryParam(ACTION, action).build());
+ }
+
+ public ControllerSelectionReference getControllerSelectionReferenceByVnfTypeAndActionCategory(String vnfType,
+ String actionCategory) {
+ return this.getSingleResource(controllerSelectionReferenceClient, UriBuilder
+ .fromUri(endpoint
+ + "/controllerSelectionReference/search/findControllerSelectionReferenceByVnfTypeAndActionCategory")
+ .queryParam("VNF_TYPE", vnfType).queryParam("ACTION_CATEGORY", actionCategory).build());
+ }
+
+ public Service getFirstByModelNameOrderByModelVersionDesc(String modelName) {
+ return this.getSingleResource(serviceClient, UriBuilder
+ .fromUri(findFirstByModelNameURI)
+ .queryParam(MODEL_NAME, modelName).build());
+ }
+
+ public ExternalServiceToInternalService findExternalToInternalServiceByServiceName(String serviceName) {
+ return this.getSingleResource(externalServiceToInternalServiceClient, getUri(UriBuilder
+ .fromUri(findExternalToInternalServiceByServiceName)
+ .queryParam(SERVICE_NAME, serviceName).build().toString()));
+ }
+
+ public ServiceRecipe findServiceRecipeByActionAndServiceModelUUID(String action, String modelUUID) {
+ return this.getSingleResource(serviceRecipeClient, getUri(UriBuilder
+ .fromUri(findServiceRecipeByActionAndServiceModelUUID)
+ .queryParam(ACTION, action)
+ .queryParam(SERVICE_MODEL_UUID, modelUUID).build().toString()));
+ }
+
+ public Service getServiceByModelName(String modelName) {
+ return this.getSingleResource(serviceClient, getUri(UriBuilder
+ .fromUri(findServiceByModelName)
+ .queryParam(MODEL_NAME, modelName).build().toString()));
+ }
+
+ public Service getServiceByModelUUID(String modelModelUUID) {
+ return this.getSingleResource(serviceClient, getUri(UriBuilder
+ .fromUri(findServiceByModelUUID)
+ .queryParam(MODEL_UUID, modelModelUUID).build().toString()));
+ }
+
+ public VnfResource getFirstVnfResourceByModelInvariantUUIDAndModelVersion(String modelInvariantUUID,
+ String modelVersion) {
+ return this.getSingleResource(vnfResourceClient, getUri(UriBuilder
+ .fromUri(findFirstResourceByModelInvariantUUIDAndModelVersion)
+ .queryParam(MODEL_INVARIANT_UUID, modelInvariantUUID)
+ .queryParam(MODEL_VERSION, modelVersion).build().toString()));
+ }
+
+
+ public VnfResourceCustomization getFirstVnfResourceCustomizationByModelInstanceNameAndVnfResources(
+ String modelInstanceName, VnfResource vnfResource) {
+ return this.getSingleResource(vnfResourceCustomizationClient, getUri(UriBuilder
+ .fromUri(findByModelInstanceNameAndVnfResources)
+ .queryParam(MODEL_INSTANCE_NAME, modelInstanceName)
+ .queryParam(VNF_RESOURCE_MODEL_UUID, vnfResource.getModelUUID()).build().toString()));
+ }
+
+ public VnfRecipe getFirstVnfRecipeByNfRoleAndAction(String nfRole, String action) {
+ return this.getSingleResource(vnfRecipeClient, getUri(UriBuilder
+ .fromUri(findFirstVnfRecipeByNfRoleAndAction)
+ .queryParam(NF_ROLE, nfRole)
+ .queryParam(ACTION, action).build().toString()));
+ }
+
+ public VnfComponentsRecipe getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(
+ String vfModuleModelUUID, String vnfComponentType, String action) {
+ return this.getSingleResource(vnfComponentsRecipeClient, getUri(UriBuilder
+ .fromUri(findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction)
+ .queryParam(VF_MODULE_MODEL_UUID, vfModuleModelUUID)
+ .queryParam(VNF_COMPONENT_TYPE, vnfComponentType)
+ .queryParam(ACTION, action).build().toString()));
+ }
+
+ public VnfComponentsRecipe getFirstVnfComponentsRecipeByVnfComponentTypeAndAction(String vnfComponentType,
+ String action) {
+ return this.getSingleResource(vnfComponentsRecipeClient, getUri(UriBuilder
+ .fromUri(findFirstVnfComponentsRecipeByVnfComponentTypeAndAction)
+ .queryParam(VNF_COMPONENT_TYPE, vnfComponentType)
+ .queryParam(ACTION, action).build().toString()));
+ }
+
+ protected URI getUri(String template) {
+ return URI.create(template);
+ }
+
+ public CloudifyManager getCloudifyManager(String id) {
+ return this.getSingleResource(cloudifyManagerClient, getUri(cloudifyManagerURI + id));
+ }
+
+ public CloudSite getCloudSite(String id) {
+ return this.getSingleResource(cloudSiteClient,
+ getUri(cloudSiteURI + id));
+ }
+
+ public CloudSite getCloudSite(String id, String uri) {
+ return this.getSingleResource(cloudSiteClient,
+ getUri(uri + id));
+ }
+
+ public void postCloudSite(CloudSite cloudSite) {
+ this.postSingleResource(cloudSiteClient, cloudSite);
+ }
+
+ public CloudSite getCloudSiteByClliAndAicVersion(String clli, String cloudVersion) {
+ return this.getSingleResource(cloudSiteClient, getUri(UriBuilder
+ .fromUri(findByClliAndCloudVersion)
+ .queryParam(CLLI, clli).queryParam(CLOUD_VERSION, cloudVersion).build().toString()));
+ }
+
+ public HomingInstance getHomingInstance(String serviceInstanceId) {
+ return this.getSingleResource(homingInstanceClient,
+ getUri(homingInstanceURI + serviceInstanceId));
+ }
+
+ public HomingInstance getHomingInstance(String serviceInstanceId, String uri) {
+ return this.getSingleResource(homingInstanceClient,
+ getUri(uri + serviceInstanceId));
+ }
+
+ public void postHomingInstance(HomingInstance homingInstance) {
+ this.postSingleResource(homingInstanceClient, homingInstance);
+ }
+
+ public Service getServiceByModelVersionAndModelInvariantUUID(String modelVersion, String modelInvariantUUID) {
+ return this.getSingleResource(serviceClient, getUri(UriBuilder
+ .fromUri(findFirstByModelVersionAndModelInvariantUUIDURI)
+ .queryParam(MODEL_VERSION, modelVersion)
+ .queryParam(MODEL_INVARIANT_UUID, modelInvariantUUID).build().toString()));
+ }
+
+ public VfModule getVfModuleByModelInvariantUUIDAndModelVersion(String modelInvariantUUID, String modelVersion) {
+ return this.getSingleResource(vfModuleClient, getUri(UriBuilder
+ .fromUri(findFirstVfModuleByModelInvariantUUIDAndModelVersion)
+ .queryParam(MODEL_INVARIANT_UUID, modelInvariantUUID)
+ .queryParam(MODEL_VERSION, modelVersion).build().toString()));
+ }
+
+ public List<Service> getServiceByModelInvariantUUIDOrderByModelVersionDesc(String modelInvariantUUID) {
+ return this.getMultipleResources(serviceClient, getUri(UriBuilder
+ .fromUri(findByModelInvariantUUIDURI)
+ .queryParam(MODEL_INVARIANT_UUID, modelInvariantUUID).build().toString()));
+ }
+
+ public List<VfModule> getVfModuleByModelInvariantUUIDOrderByModelVersionDesc(String modelInvariantUUID) {
+ return this.getMultipleResources(vfModuleClient, getUri(UriBuilder
+ .fromUri(findVfModuleByModelInvariantUUIDOrderByModelVersionDesc)
+ .queryParam(MODEL_INVARIANT_UUID, modelInvariantUUID).build().toString()));
+ }
+
+ private <T> T getSingleResource(Client<T> client, URI uri) {
+ return client.get(uri);
+ }
+
+ private <T> List<T> getMultipleResources(Client<T> client, URI uri) {
+ Iterable<T> iterator = client.getAll(uri);
+ List<T> list = new ArrayList<>();
+ Iterator<T> it = iterator.iterator();
+ it.forEachRemaining(list::add);
+ return list;
+ }
+
+ private <T> URI postSingleResource(Client<T> client, T type) {
+ return client.post(type);
+ }
+
+ public List<CvnfcCustomization> getCvnfcCustomizationByVnfCustomizationUUIDAndVfModuleCustomizationUUID(
+ String vnfCustomizationUUID, String vfModuleCustomizationUUID) {
+
+ return this.getMultipleResources(cvnfcCustomizationClient, getUri(UriBuilder
+ .fromUri(endpoint + "/cvnfcCustomization/search/findByVnfResourceCustomizationAndVfModuleCustomization")
+ .queryParam("VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID", vnfCustomizationUUID)
+ .queryParam("VF_MODULE_CUST_MODEL_CUSTOMIZATION_UUID", vfModuleCustomizationUUID).build().toString()));
+ }
+
+ public VnfVfmoduleCvnfcConfigurationCustomization getVnfVfmoduleCvnfcConfigurationCustomizationByVnfCustomizationUuidAndVfModuleCustomizationUuidAndCvnfcCustomizationUuid(String vnfCustomizationUuid,
+ String vfModuleCustomizationUuid, String cvnfcCustomizationUuid) {
+ return this.getSingleResource(vnfVfmoduleCvnfcConfigurationCustomizationClient, getUri(UriBuilder
+ .fromUri(endpoint + "/vnfVfmoduleCvnfcConfigurationCustomization/search/findOneByVnfResourceCustomizationAndVfModuleCustomizationAndCvnfcCustomization")
+ .queryParam("VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID", vnfCustomizationUuid)
+ .queryParam("VF_MODULE_MODEL_CUSTOMIZATION_UUID", vfModuleCustomizationUuid)
+ .queryParam("CVNFC_MODEL_CUSTOMIZATION_UUID", cvnfcCustomizationUuid).build().toString()));
+ }
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepository.java
new file mode 100644
index 0000000000..8252b2427e
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepository.java
@@ -0,0 +1,32 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.db.catalog.data.repository;
+
+import org.onap.so.db.catalog.beans.PnfResourceCustomization;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.rest.core.annotation.RepositoryRestResource;
+
+import java.util.List;
+
+@RepositoryRestResource(collectionResourceRel = "pnfResourceCustomization", path = "pnfResourceCustomization")
+public interface PnfCustomizationRepository extends JpaRepository<PnfResourceCustomization, String> {
+
+} \ No newline at end of file
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfResourceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfResourceRepository.java
new file mode 100644
index 0000000000..bf8e83bbac
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfResourceRepository.java
@@ -0,0 +1,29 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.db.catalog.data.repository;
+
+import org.onap.so.db.catalog.beans.PnfResource;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.rest.core.annotation.RepositoryRestResource;
+
+@RepositoryRestResource(collectionResourceRel = "pnfResource", path = "pnfResource")
+public interface PnfResourceRepository extends JpaRepository<PnfResource, String> {
+
+} \ No newline at end of file
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepository.java
index f936933485..aad75a15be 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepository.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepository.java
@@ -24,9 +24,17 @@ import java.util.List;
import org.onap.so.db.catalog.beans.VnfVfmoduleCvnfcConfigurationCustomization;
import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
@RepositoryRestResource(collectionResourceRel = "vnfVfmoduleCvnfcConfigurationCustomization", path = "vnfVfmoduleCvnfcConfigurationCustomization")
public interface VnfVfmoduleCvnfcConfigurationCustomizationRepository extends JpaRepository<VnfVfmoduleCvnfcConfigurationCustomization, Integer> {
List<VnfVfmoduleCvnfcConfigurationCustomization> findByModelCustomizationUUID(String modelCustomizationUUID);
+
+ @Query(value = "SELECT * FROM vnf_vfmodule_cvnfc_configuration_customization WHERE VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID = ?1 AND VF_MODULE_MODEL_CUSTOMIZATION_UUID = ?2 AND CVNFC_MODEL_CUSTOMIZATION_UUID = ?3", nativeQuery = true)
+ VnfVfmoduleCvnfcConfigurationCustomization findOneByVnfResourceCustomizationAndVfModuleCustomizationAndCvnfcCustomization (
+ @Param("VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID") String vnfResourceCustomizationUuid,
+ @Param("VF_MODULE_MODEL_CUSTOMIZATION_UUID") String vfModuleCustomizationUuid,
+ @Param("CVNFC_MODEL_CUSTOMIZATION_UUID") String cvnfcCustomizationUuid);
} \ No newline at end of file
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/ServiceTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/ServiceTest.java
index ffa56a9ce3..7028d9161c 100644
--- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/ServiceTest.java
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/ServiceTest.java
@@ -7,9 +7,9 @@
* 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.
@@ -21,11 +21,14 @@
package org.onap.so.db.catalog;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.onap.so.db.catalog.beans.PnfResource;
+import org.onap.so.db.catalog.beans.PnfResourceCustomization;
import org.onap.so.db.catalog.beans.Service;
import org.onap.so.db.catalog.data.repository.ServiceRepository;
import org.springframework.beans.factory.annotation.Autowired;
@@ -37,42 +40,62 @@ import org.springframework.test.context.junit4.SpringRunner;
@SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ActiveProfiles("test")
public class ServiceTest {
- @Autowired
- private ServiceRepository serviceRepo;
- @Test
- public void Find_LatestService_Test() {
- Service latestVersionService = serviceRepo.findFirstByModelNameOrderByModelVersionDesc("MSOTADevInfra_vSAMP10a_Service");
- assertEquals("5df8b6de-2083-11e7-93ae-92361f002675",latestVersionService.getModelUUID());
- }
+ @Autowired
+ private ServiceRepository serviceRepo;
+ @Test
+ public void Find_LatestService_Test() {
+ Service latestVersionService = serviceRepo
+ .findFirstByModelNameOrderByModelVersionDesc("MSOTADevInfra_vSAMP10a_Service");
+ assertEquals("5df8b6de-2083-11e7-93ae-92361f002675", latestVersionService.getModelUUID());
+ }
- @Test
- public void Find_LatestService_Test_2() {
- Service latestVersionService = serviceRepo.findByModelNameOrderByModelVersionDesc("MSOTADevInfra_vSAMP10a_Service");
- assertEquals("5df8b6de-2083-11e7-93ae-92361f002675",latestVersionService.getModelUUID());
- }
+ @Test
+ public void Find_LatestService_Test_2() {
+ Service latestVersionService = serviceRepo
+ .findByModelNameOrderByModelVersionDesc("MSOTADevInfra_vSAMP10a_Service");
+ assertEquals("5df8b6de-2083-11e7-93ae-92361f002675", latestVersionService.getModelUUID());
+ }
- @Test
- public void Find_LatestService_Test_Invariant_UUID() {
- List<Service> latestVersionService = serviceRepo.findByModelInvariantUUIDOrderByModelVersionDesc("9647dfc4-2083-11e7-93ae-92361f002671");
- assertEquals("5df8b6de-2083-11e7-93ae-92361f002675",latestVersionService.get(0).getModelUUID());
- assertEquals("5df8b6de-2083-11e7-93ae-92361f002674",latestVersionService.get(1).getModelUUID());
- assertEquals("5df8b6de-2083-11e7-93ae-92361f002673",latestVersionService.get(2).getModelUUID());
- assertEquals("5df8b6de-2083-11e7-93ae-92361f002672",latestVersionService.get(3).getModelUUID());
- assertEquals("5df8b6de-2083-11e7-93ae-92361f002671",latestVersionService.get(4).getModelUUID());
- }
+ @Test
+ public void Find_LatestService_Test_Invariant_UUID() {
+ List<Service> latestVersionService = serviceRepo
+ .findByModelInvariantUUIDOrderByModelVersionDesc("9647dfc4-2083-11e7-93ae-92361f002671");
+ assertEquals("5df8b6de-2083-11e7-93ae-92361f002675", latestVersionService.get(0).getModelUUID());
+ assertEquals("5df8b6de-2083-11e7-93ae-92361f002674", latestVersionService.get(1).getModelUUID());
+ assertEquals("5df8b6de-2083-11e7-93ae-92361f002673", latestVersionService.get(2).getModelUUID());
+ assertEquals("5df8b6de-2083-11e7-93ae-92361f002672", latestVersionService.get(3).getModelUUID());
+ assertEquals("5df8b6de-2083-11e7-93ae-92361f002671", latestVersionService.get(4).getModelUUID());
+ }
- @Test
- public void Find_LatestService_Test_4() {
- Service latestVersionService = serviceRepo.findOneByModelUUIDOrderByModelVersionDesc("5df8b6de-2083-11e7-93ae-92361f002671");
- assertEquals("5df8b6de-2083-11e7-93ae-92361f002671",latestVersionService.getModelUUID());
- }
+ @Test
+ public void Find_LatestService_Test_4() {
+ Service latestVersionService = serviceRepo
+ .findOneByModelUUIDOrderByModelVersionDesc("5df8b6de-2083-11e7-93ae-92361f002671");
+ assertEquals("5df8b6de-2083-11e7-93ae-92361f002671", latestVersionService.getModelUUID());
+ }
- @Test
- public void Find_LatestService_Test_5() {
- Service latestVersionService = serviceRepo.findFirstByModelInvariantUUIDOrderByModelVersionDesc("9647dfc4-2083-11e7-93ae-92361f002671");
- assertEquals("5df8b6de-2083-11e7-93ae-92361f002675",latestVersionService.getModelUUID());
- }
+ @Test
+ public void Find_LatestService_Test_5() {
+ Service latestVersionService = serviceRepo
+ .findFirstByModelInvariantUUIDOrderByModelVersionDesc("9647dfc4-2083-11e7-93ae-92361f002671");
+ assertEquals("5df8b6de-2083-11e7-93ae-92361f002675", latestVersionService.getModelUUID());
+ }
+
+
+ @Test
+ public void findByModelNameOrderByModelVersionDesc_ValidModelName_ExpectedOutput() {
+ Service latestVersionService = serviceRepo.findByModelNameOrderByModelVersionDesc("PNF_routing_service");
+ assertEquals("5df8b6de-2083-11e7-93ae-92361f002676", latestVersionService.getModelUUID());
+ }
+
+ @Test
+ public void findByModelInvariantUUIDOrderByModelVersionDesc_ValidInvariantUuid_ExpectedOutput() {
+ List<Service> services = serviceRepo
+ .findByModelInvariantUUIDOrderByModelVersionDesc("9647dfc4-2083-11e7-93ae-92361f002676");
+ assertEquals("One PNF service found", 1, services.size());
+ assertEquals("5df8b6de-2083-11e7-93ae-92361f002676", services.get(0).getModelUUID());
+ }
}
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepositoryTest.java
new file mode 100644
index 0000000000..c5e95fcfbc
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepositoryTest.java
@@ -0,0 +1,62 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.db.catalog.data.repository;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Test;
+import org.onap.so.db.catalog.BaseTest;
+import org.onap.so.db.catalog.beans.PnfResource;
+import org.onap.so.db.catalog.beans.PnfResourceCustomization;
+import org.onap.so.db.catalog.exceptions.NoEntityFoundException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+
+public class PnfCustomizationRepositoryTest extends BaseTest {
+
+ @Autowired
+ private PnfCustomizationRepository pnfCustomizationRepository;
+
+ @Test
+ public void findById_ValidUuid_ExpectedOutput() throws Exception {
+ PnfResourceCustomization pnfResourceCustomization = pnfCustomizationRepository
+ .findById("68dc9a92-214c-11e7-93ae-92361f002680")
+ .orElseThrow(() -> new NoEntityFoundException("Cannot Find Operation"));
+ checkPnfResourceCustomization(pnfResourceCustomization);
+ }
+
+ private void checkPnfResourceCustomization(PnfResourceCustomization pnfResourceCustomization) {
+ assertEquals("modelInstanceName", "PNF routing", pnfResourceCustomization.getModelInstanceName());
+ assertEquals("blueprintName", "test_configuration_restconf", pnfResourceCustomization.getBlueprintName());
+ assertEquals("blueprintVersion", "1.0.0", pnfResourceCustomization.getBlueprintVersion());
+ PnfResource pnfResource = pnfResourceCustomization.getPnfResources();
+ assertNotNull(pnfResource);
+
+ assertEquals("PNFResource modelUUID", "ff2ae348-214a-11e7-93ae-92361f002680", pnfResource.getModelUUID());
+ assertEquals("PNFResource modelInvariantUUID", "2fff5b20-214b-11e7-93ae-92361f002680",
+ pnfResource.getModelInvariantUUID());
+ assertEquals("PNFResource modelVersion", "1.0", pnfResource.getModelVersion());
+ assertEquals("PNFResource orchestration mode", "", pnfResource.getOrchestrationMode());
+ }
+}
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/PnfResourceRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/PnfResourceRepositoryTest.java
new file mode 100644
index 0000000000..4dde3b25df
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/PnfResourceRepositoryTest.java
@@ -0,0 +1,50 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.db.catalog.data.repository;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.so.db.catalog.BaseTest;
+import org.onap.so.db.catalog.beans.PnfResource;
+import org.onap.so.db.catalog.exceptions.NoEntityFoundException;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class PnfResourceRepositoryTest extends BaseTest {
+
+ @Autowired
+ private PnfResourceRepository pnfResourceRepository;
+
+ @Test
+ public void findResourceById_validUuid_expectedOutput() throws Exception {
+
+ PnfResource pnfResource = pnfResourceRepository.findById("ff2ae348-214a-11e7-93ae-92361f002680")
+ .orElseThrow(() -> new NoEntityFoundException("Cannot Find Entity"));
+ checkPnfResource(pnfResource);
+ }
+
+ private void checkPnfResource(PnfResource pnfResource) {
+ assertEquals("PNFResource modelUUID", "ff2ae348-214a-11e7-93ae-92361f002680", pnfResource.getModelUUID());
+ assertEquals("PNFResource modelInvariantUUID", "2fff5b20-214b-11e7-93ae-92361f002680",
+ pnfResource.getModelInvariantUUID());
+ assertEquals("PNFResource modelVersion", "1.0", pnfResource.getModelVersion());
+ assertEquals("PNFResource orchestration mode", "", pnfResource.getOrchestrationMode());
+ }
+} \ No newline at end of file
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepositoryTest.java
new file mode 100644
index 0000000000..8e2e1e0446
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepositoryTest.java
@@ -0,0 +1,78 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.db.catalog.data.repository;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Test;
+import org.onap.so.db.catalog.BaseTest;
+import org.onap.so.db.catalog.beans.VnfResource;
+import org.onap.so.db.catalog.beans.VnfResourceCustomization;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+
+
+public class VnfCustomizationRepositoryTest extends BaseTest {
+
+ @Autowired
+ private VnfCustomizationRepository vnfCustomizationRepository;
+
+ @Test
+ public void findByModelCustomizationUUID_ValidUuid_ExpectedOutput() throws Exception {
+ List<VnfResourceCustomization> vnfCustomizationList = vnfCustomizationRepository
+ .findByModelCustomizationUUID("68dc9a92-214c-11e7-93ae-92361f002671");
+ assertFalse(CollectionUtils.isEmpty(vnfCustomizationList));
+ assertEquals("output contains one entity", 1, vnfCustomizationList.size());
+
+ checkVnfResourceCustomization(vnfCustomizationList.get(0));
+ }
+
+ @Test
+ public void findOneByModelCustomizationUUID_ValidUuid_ExpectedOutput() throws Exception {
+ VnfResourceCustomization vnfResourceCustomization = vnfCustomizationRepository
+ .findOneByModelCustomizationUUID("68dc9a92-214c-11e7-93ae-92361f002671");
+ checkVnfResourceCustomization(vnfResourceCustomization);
+ }
+
+ @Test
+ public void findByModelInstanceNameAndVnfResources_ValidNameAndUuid_ExpectedOutput() throws Exception {
+ VnfResourceCustomization vnfResourceCustomization = vnfCustomizationRepository
+ .findByModelInstanceNameAndVnfResources("vSAMP10a 1", "ff2ae348-214a-11e7-93ae-92361f002671");
+ checkVnfResourceCustomization(vnfResourceCustomization);
+ }
+
+ private void checkVnfResourceCustomization(VnfResourceCustomization vnfResourceCustomization) {
+ assertEquals("modelInstanceName", "vSAMP10a 1", vnfResourceCustomization.getModelInstanceName());
+ assertEquals("blueprintName", "test_configuration_restconf", vnfResourceCustomization.getBlueprintName());
+ assertEquals("blueprintVersion", "1.0.0", vnfResourceCustomization.getBlueprintVersion());
+ VnfResource vnfResource = vnfResourceCustomization.getVnfResources();
+ assertNotNull(vnfResource);
+
+ assertEquals("VNFResource modelUUID", "ff2ae348-214a-11e7-93ae-92361f002671", vnfResource.getModelUUID());
+ assertEquals("VNFResource modelInvariantUUID", "2fff5b20-214b-11e7-93ae-92361f002671",
+ vnfResource.getModelInvariantUUID());
+ assertEquals("VNFResource modelVersion", "1.0", vnfResource.getModelVersion());
+ assertEquals("VNFResource orchestration mode", "HEAT", vnfResource.getOrchestrationMode());
+ }
+}
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest.java
index 6f0e3020b1..a953fc8a3c 100644
--- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest.java
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest.java
@@ -81,7 +81,7 @@ public class VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest extends Ba
vnfVfmoduleCvnfcConfigurationCustomization.setConfigurationResource(configurationResource);
CvnfcCustomization cvnfcCustomization = setUpCvnfcCustomization();
- cvnfcCustomization.setModelCustomizationUUID("cf9f6efc-9f14-11e8-98d0-529269fb1459");
+ cvnfcCustomization.setModelCustomizationUUID("0c3a8b76-3f5b-11e9-b210-d663bd873d93");
VfModuleCustomization vfModuleCustomization = new VfModuleCustomization();
vfModuleCustomization.setModelCustomizationUUID("cf9f6efc-9f14-11e8-98d0-529269fb1459");
@@ -122,5 +122,12 @@ public class VnfVfmoduleCvnfcConfigurationCustomizationRepositoryTest extends Ba
if(foundVnfVfmoduleCvnfcConfigurationCustomization == null)
fail("should not be null");
+
+ VnfVfmoduleCvnfcConfigurationCustomization foundOneVnfVfmoduleCvnfcConfigurationCustomization =
+ vnfVfmoduleCvnfcConfigurationCustomizationRepository.findOneByVnfResourceCustomizationAndVfModuleCustomizationAndCvnfcCustomization("cf9f6efc-9f14-11e8-98d0-529269fb1459", "cf9f6efc-9f14-11e8-98d0-529269fb1459", "0c3a8b76-3f5b-11e9-b210-d663bd873d93");
+
+ if(foundOneVnfVfmoduleCvnfcConfigurationCustomization == null)
+ fail("should not be null");
+ Assert.assertTrue(foundOneVnfVfmoduleCvnfcConfigurationCustomization.getConfigurationFunction().equalsIgnoreCase("testConfigurationFunction"));
}
-}
+} \ No newline at end of file
diff --git a/mso-catalog-db/src/test/resources/data.sql b/mso-catalog-db/src/test/resources/data.sql
index 14834ea963..a59137d023 100644
--- a/mso-catalog-db/src/test/resources/data.sql
+++ b/mso-catalog-db/src/test/resources/data.sql
@@ -44,9 +44,8 @@ insert into heat_environment(artifact_uuid, name, version, description, body, ar
insert into vnf_resource(orchestration_mode, description, creation_timestamp, model_uuid, aic_version_min, aic_version_max, model_invariant_uuid, model_version, model_name, tosca_node_type, heat_template_artifact_uuid) values
('HEAT', '1607 vSAMP10a - inherent network', '2017-04-14 21:46:28', 'ff2ae348-214a-11e7-93ae-92361f002671', '', '', '2fff5b20-214b-11e7-93ae-92361f002671', '1.0', 'vSAMP10a', 'VF', null);
-insert into vnf_resource_customization(model_customization_uuid, model_instance_name, min_instances, max_instances, availability_zone_max_count, nf_type, nf_role, nf_function, nf_naming_code, creation_timestamp, vnf_resource_model_uuid, multi_stage_design) values
-('68dc9a92-214c-11e7-93ae-92361f002671', 'vSAMP10a 1', '0', '0', '0', 'vSAMP', 'vSAMP', 'vSAMP', 'vSAMP', '2017-05-26 15:08:24', 'ff2ae348-214a-11e7-93ae-92361f002671', null);
-
+insert into vnf_resource_customization(model_customization_uuid, model_instance_name, min_instances, max_instances, availability_zone_max_count, nf_type, nf_role, nf_function, nf_naming_code, creation_timestamp, vnf_resource_model_uuid, multi_stage_design, cds_blueprint_name, cds_blueprint_version) values
+('68dc9a92-214c-11e7-93ae-92361f002671', 'vSAMP10a 1', '0', '0', '0', 'vSAMP', 'vSAMP', 'vSAMP', 'vSAMP', '2017-05-26 15:08:24', 'ff2ae348-214a-11e7-93ae-92361f002671', null, "test_configuration_restconf", "1.0.0");
insert into vf_module(model_uuid, model_invariant_uuid, model_version, model_name, description, is_base, heat_template_artifact_uuid, vol_heat_template_artifact_uuid, creation_timestamp, vnf_resource_model_uuid) values
@@ -759,3 +758,15 @@ VALUES ( '1',
'testPolicyName',
'2018-07-17 14:05:08',
'c59a41ca-9b3b-11e8-98d0-529269fb1459');
+
+insert into service(model_uuid, model_name, model_invariant_uuid, model_version, description, creation_timestamp, tosca_csar_artifact_uuid, service_type, service_role, environment_context, workload_context) values
+('5df8b6de-2083-11e7-93ae-92361f002676', 'PNF_routing_service', '9647dfc4-2083-11e7-93ae-92361f002676', '1.0', 'PNF service', '2019-03-08 12:00:29', null, 'NA', 'NA', 'Luna', 'Oxygen');
+
+insert into pnf_resource(orchestration_mode, description, creation_timestamp, model_uuid, model_invariant_uuid, model_version, model_name, tosca_node_type) values
+('', 'PNF routing', '2019-03-08 12:00:28', 'ff2ae348-214a-11e7-93ae-92361f002680', '2fff5b20-214b-11e7-93ae-92361f002680', '1.0', 'PNF resource', null);
+
+insert into pnf_resource_customization(model_customization_uuid, model_instance_name, nf_type, nf_role, nf_function, nf_naming_code, creation_timestamp, pnf_resource_model_uuid, multi_stage_design, cds_blueprint_name, cds_blueprint_version) values
+('68dc9a92-214c-11e7-93ae-92361f002680', 'PNF routing', 'routing', 'routing', 'routing', 'routing', '2019-03-08 12:00:29', 'ff2ae348-214a-11e7-93ae-92361f002680', null, "test_configuration_restconf", "1.0.0");
+
+insert into pnf_resource_customization_to_service(service_model_uuid, resource_model_customization_uuid) values
+('5df8b6de-2083-11e7-93ae-92361f002676', '68dc9a92-214c-11e7-93ae-92361f002680'); \ No newline at end of file
diff --git a/mso-catalog-db/src/test/resources/schema.sql b/mso-catalog-db/src/test/resources/schema.sql
index d20a9adb7e..6bd9baee80 100644
--- a/mso-catalog-db/src/test/resources/schema.sql
+++ b/mso-catalog-db/src/test/resources/schema.sql
@@ -437,6 +437,8 @@ create table `vnf_resource_customization` (
`vnf_resource_model_uuid` varchar(200) not null,
`multi_stage_design` varchar(20) default null,
`resource_input` varchar(20000) default null,
+ `cds_blueprint_name` varchar(200) default null,
+ `cds_blueprint_version` varchar(20) default null,
primary key (`model_customization_uuid`),
key `fk_vnf_resource_customization__vnf_resource1_idx` (`vnf_resource_model_uuid`),
constraint `fk_vnf_resource_customization__vnf_resource1` foreign key (`vnf_resource_model_uuid`) references `vnf_resource` (`model_uuid`) on delete cascade on update cascade
@@ -946,3 +948,41 @@ CREATE TABLE IF NOT EXISTS vnf_vfmodule_cvnfc_configuration_customization (
REFERENCES `vnf_resource_customization` (`MODEL_CUSTOMIZATION_UUID`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=INNODB AUTO_INCREMENT=20654 DEFAULT CHARACTER SET=LATIN1;
+
+CREATE TABLE IF NOT EXISTS `pnf_resource` (
+ `ORCHESTRATION_MODE` varchar(20) NOT NULL DEFAULT 'HEAT',
+ `DESCRIPTION` varchar(1200) DEFAULT NULL,
+ `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `MODEL_UUID` varchar(200) NOT NULL,
+ `MODEL_INVARIANT_UUID` varchar(200) DEFAULT NULL,
+ `MODEL_VERSION` varchar(20) NOT NULL,
+ `MODEL_NAME` varchar(200) DEFAULT NULL,
+ `TOSCA_NODE_TYPE` varchar(200) DEFAULT NULL,
+ `RESOURCE_CATEGORY` varchar(200) DEFAULT NULL,
+ `RESOURCE_SUB_CATEGORY` varchar(200) DEFAULT NULL,
+ PRIMARY KEY (`MODEL_UUID`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE IF NOT EXISTS `pnf_resource_customization` (
+ `MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL,
+ `MODEL_INSTANCE_NAME` varchar(200) NOT NULL,
+ `NF_TYPE` varchar(200) DEFAULT NULL,
+ `NF_ROLE` varchar(200) DEFAULT NULL,
+ `NF_FUNCTION` varchar(200) DEFAULT NULL,
+ `NF_NAMING_CODE` varchar(200) DEFAULT NULL,
+ `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `PNF_RESOURCE_MODEL_UUID` varchar(200) NOT NULL,
+ `MULTI_STAGE_DESIGN` varchar(20) DEFAULT NULL,
+ `RESOURCE_INPUT` varchar(2000) DEFAULT NULL,
+ `CDS_BLUEPRINT_NAME` varchar(200) DEFAULT NULL,
+ `CDS_BLUEPRINT_VERSION` varchar(20) DEFAULT NULL,
+ PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`),
+ KEY `fk_pnf_resource_customization__pnf_resource1_idx` (`PNF_RESOURCE_MODEL_UUID`),
+ CONSTRAINT `fk_pnf_resource_customization__pnf_resource1` FOREIGN KEY (`PNF_RESOURCE_MODEL_UUID`) REFERENCES `pnf_resource` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE IF NOT EXISTS `pnf_resource_customization_to_service` (
+ `SERVICE_MODEL_UUID` varchar(200) NOT NULL,
+ `RESOURCE_MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL,
+ PRIMARY KEY (`SERVICE_MODEL_UUID`,`RESOURCE_MODEL_CUSTOMIZATION_UUID`)
+)ENGINE=InnoDB DEFAULT CHARSET=latin1; \ No newline at end of file
diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/CorsConfigurer.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/CorsConfigurer.java
index 0bcf24dbd8..4d0fd443e9 100644
--- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/CorsConfigurer.java
+++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/CorsConfigurer.java
@@ -30,17 +30,12 @@ import org.springframework.web.filter.CorsFilter;
* @author waqas.ikram@ericsson, eoin.hanan@ericsson.com
*/
@Configuration
-public class CorsConfigurer {
+public class CorsConfigurer {
@Bean
public CorsFilter corsFilter() {
final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
- final CorsConfiguration config = new CorsConfiguration();
- config.setAllowCredentials(true);
- config.addAllowedOrigin("*");
- config.addAllowedHeader("*");
- config.addAllowedMethod("*");
- source.registerCorsConfiguration("/**", config);
+ source.registerCorsConfiguration("/**", new CorsConfiguration().applyPermitDefaultValues());
return new CorsFilter(source);
}
}
diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/CamundaConfigurationTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/CamundaConfigurationTest.java
index fb56d841e4..fb56d841e4 100644
--- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/CamundaConfigurationTest.java
+++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/CamundaConfigurationTest.java
diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/CamundaRestUrlProviderTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/CamundaRestUrlProviderTest.java
index 3cd8a33d77..3cd8a33d77 100644
--- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/CamundaRestUrlProviderTest.java
+++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/CamundaRestUrlProviderTest.java
diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/HttpServiceProviderConfigurationTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/HttpServiceProviderConfigurationTest.java
index 1b3e168c12..1b3e168c12 100644
--- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/HttpServiceProviderConfigurationTest.java
+++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/HttpServiceProviderConfigurationTest.java
diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/PojoClassesTests.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/PojoClassesTests.java
index f51d4c64b1..f51d4c64b1 100644
--- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/PojoClassesTests.java
+++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/PojoClassesTests.java
diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/database/DatabaseUrlProviderTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/database/DatabaseUrlProviderTest.java
index d820e9435d..d820e9435d 100644
--- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/database/DatabaseUrlProviderTest.java
+++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/configuration/database/DatabaseUrlProviderTest.java
diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/db/api/DatabaseServiceProviderTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/db/api/DatabaseServiceProviderTest.java
index 58666671a7..58666671a7 100644
--- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/db/api/DatabaseServiceProviderTest.java
+++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/db/api/DatabaseServiceProviderTest.java
diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/rest/service/CamundaProcessDataServiceProviderTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderTest.java
index c3930df196..c3930df196 100644
--- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/rest/service/CamundaProcessDataServiceProviderTest.java
+++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderTest.java
diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/utils/ObjectEqualsUtilsTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/utils/ObjectEqualsUtilsTest.java
index dd363abe3a..dd363abe3a 100644
--- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/utils/ObjectEqualsUtilsTest.java
+++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/monitoring/utils/ObjectEqualsUtilsTest.java