From 5a6a6de6f1a26a1897e4917a0df613e25a24eb70 Mon Sep 17 00:00:00 2001
From: "Benjamin, Max (mb388a)"
Date: Mon, 30 Jul 2018 15:56:09 -0400
Subject: Containerization feature of SO
Change-Id: I95381232eeefcd247a66a5cec370a8ce1c288e18
Issue-ID: SO-670
Signed-off-by: Benjamin, Max (mb388a)
---
.../infrastructure/aai/AAICreateResources.java | 90 +++
.../aai/AAIDeleteServiceInstance.java | 49 ++
.../so/bpmn/infrastructure/aai/AAIResource.java | 40 +
.../infrastructure/aai/AAIServiceInstance.java | 94 +++
.../aai/groovyflows/AAICreateResources.java | 123 +++
.../aai/groovyflows/AAIDeleteServiceInstance.java | 49 ++
.../aai/groovyflows/AAIServiceInstance.java | 94 +++
.../generation/AAIObjectInstanceNameGenerator.java | 40 +
.../infrastructure/pnf/aai/AaiConnectionImpl.java | 44 +
.../pnf/delegate/CancelDmaapSubscription.java | 42 +
.../delegate/CheckAaiForCorrelationIdDelegate.java | 76 ++
.../delegate/CreateAaiEntryWithPnfIdDelegate.java | 55 ++
.../pnf/delegate/ExecutionVariableNames.java | 33 +
.../pnf/delegate/InformDmaapClient.java | 45 ++
.../bpmn/infrastructure/pnf/dmaap/DmaapClient.java | 28 +
.../pnf/dmaap/JsonUtilForCorrelationId.java | 71 ++
.../pnf/dmaap/PnfEventReadyDmaapClient.java | 178 ++++
.../pnf/implementation/AaiConnection.java | 32 +
.../pnf/implementation/AaiResponse.java | 48 ++
.../CheckAaiForCorrelationIdImplementation.java | 50 ++
.../infrastructure/properties/BPMNProperties.java | 46 ++
.../vfcmodel/LocationConstraint.java | 73 ++
.../vfcmodel/NSResourceInputParameter.java | 116 +++
.../infrastructure/vfcmodel/NsOperationKey.java | 141 ++++
.../bpmn/infrastructure/vfcmodel/NsParameters.java | 70 ++
.../infrastructure/vfcmodel/NsScaleParameters.java | 78 ++
.../vfcmodel/ScaleNsByStepsData.java | 91 +++
.../bpmn/infrastructure/vfcmodel/ScaleNsData.java | 34 +
.../infrastructure/vfcmodel/ScaleResource.java | 55 ++
.../bpmn/infrastructure/vfcmodel/VimLocation.java | 52 ++
.../serviceTask/AbstractSdncOperationTask.java | 350 ++++++++
.../SdncNetworkTopologyOperationTask.java | 102 +++
.../SdncServiceTopologyOperationTask.java | 101 +++
.../SdncUnderlayVpnOperationClient.java | 116 +++
.../serviceTask/SdncUnderlayVpnPreprocessTask.java | 51 ++
.../serviceTask/client/GenericResourceApi.java | 48 ++
.../workflow/serviceTask/client/HeaderUtil.java | 45 ++
.../client/builder/AbstractBuilder.java | 239 ++++++
.../builder/NetworkRpcInputEntityBuilder.java | 90 +++
.../builder/ServiceRpcInputEntityBuilder.java | 73 ++
.../client/entity/NetworkInformationEntity.java | 58 ++
.../entity/NetworkInputParametersEntity.java | 38 +
.../client/entity/NetworkRequestInputEntity.java | 80 ++
.../entity/NetworkResponseInformationEntity.java | 47 ++
.../NetworkTopologyOperationInputEntity.java | 80 ++
.../NetworkTopologyOperationOutputEntity.java | 91 +++
.../client/entity/OnapModelInformationEntity.java | 80 ++
.../serviceTask/client/entity/ParamEntity.java | 47 ++
.../client/entity/RequestInformationEntity.java | 91 +++
.../RpcNetworkTopologyOperationInputEntity.java | 36 +
.../RpcNetworkTopologyOperationOutputEntity.java | 36 +
.../RpcServiceTopologyOperationInputEntity.java | 36 +
.../RpcServiceTopologyOperationOutputEntity.java | 36 +
.../client/entity/SdncRequestHeaderEntity.java | 59 ++
.../client/entity/ServiceInformationEntity.java | 91 +++
.../entity/ServiceInputParametersEntity.java | 38 +
.../client/entity/ServiceRequestInputEntity.java | 48 ++
.../entity/ServiceResponseInformationEntity.java | 47 ++
.../ServiceTopologyOperationInputEntity.java | 69 ++
.../ServiceTopologyOperationOutputEntity.java | 80 ++
.../src/main/resources/dmaap.properties | 8 +
.../java/org/onap/so/bpmn/AllBPMNTestSuites.java | 32 +
.../org/onap/so/bpmn/AllTasksTestsTestSuite.java | 32 +
.../java/org/onap/so/bpmn/AllTestsTestSuite.java | 35 +
.../org/onap/so/bpmn/infrastructure/BeansTest.java | 72 ++
.../bpmn/infrastructure/WebSecurityConfigImpl.java | 52 ++
.../infrastructure/aai/AAICreateResourcesTest.java | 197 +++++
.../aai/AAIDeleteServiceInstanceTest.java | 84 ++
.../infrastructure/aai/AAIServiceInstanceTest.java | 114 +++
.../AAIObjectInstanceNameGeneratorTest.java | 58 ++
.../pnf/dmaap/JsonUtilForCorrelationIdTest.java | 77 ++
.../infrastructure/vfcmodel/VfcModelPojoTest.java | 45 ++
.../serviceTask/client/HeaderUtilTest.java | 34 +
.../client/builder/AbstractBuilderTest.java | 570 +++++++++++++
.../builder/NetworkRpcInputEntityBuilderTest.java | 323 ++++++++
.../builder/ServiceRpcInputEntityBuilderTest.java | 323 ++++++++
.../client/entity/ClientEntityPojoTest.java | 76 ++
.../src/test/resources/CreateSiSample.json | 72 ++
.../stubprocess/DoCreateAllottedResourceBRG.bpmn | 54 ++
.../DoCreateAllottedResourceBRGRollback.bpmn | 55 ++
.../stubprocess/DoCreateAllottedResourceTXC.bpmn | 38 +
.../DoCreateServiceInstanceRollback.bpmn | 53 ++
.../VCPE/stubprocess/DoCreateVnfAndModules.bpmn | 53 ++
.../stubprocess/DoCreateVnfAndModulesRollback.bpmn | 53 ++
.../VCPE/stubprocess/DoDeleteVnfAndModules.bpmn | 37 +
.../test/resources/VCPE/stubprocess/Homing.bpmn | 35 +
.../AAI/AAI_defaultCloudRegionByCloudRegionId.json | 12 +
.../resources/__files/AAI/AAI_genericVnfGet.json | 9 +
.../__files/AAI/AAI_genericVnfsByVnfId.json | 434 ++++++++++
.../resources/__files/AAI/AAI_pserverByVnfId.json | 72 ++
.../__files/AAI/AAI_vfModuleByVfModuleId.json | 27 +
.../src/test/resources/__files/AAI/mockObject.json | 10 +
.../test/resources/__files/APPC/appc_error.json | 21 +
.../Network/createNetworkRequest.xml | 75 ++
.../Network/createNetworkResponse.xml | 31 +
.../BuildingBlocks/Network/defaultNetwork.json | 10 +
.../BuildingBlocks/Network/l3NetworkBbObject.json | 226 ++++++
.../Network/payloadUpdateCreated.json | 216 +++++
.../Network/queryAAICloudRegion.json | 596 ++++++++++++++
.../Network/queryAAICloudRegion25.json | 596 ++++++++++++++
.../Network/queryAAICloudRegionError.json | 596 ++++++++++++++
.../Network/queryAAINetworkTestResponse.json | 141 ++++
.../BuildingBlocks/Network/queryAAIResponse.json | 166 ++++
.../Network/queryAAIResponseEmptyUri.json | 53 ++
.../Network/queryAAIVpnBindingTestResponse.json | 891 +++++++++++++++++++++
.../BuildingBlocks/Network/queryIdAAIResponse.xml | 145 ++++
.../unassignNetworkBB_queryAAIResponse_.json | 162 ++++
.../Network/updateContrailAAIPayloadRequest.xml | 149 ++++
.../__files/BuildingBlocks/sniroCallback2AR1Vnf | 107 +++
.../BuildingBlocks/sniroCallback2AR1Vnf2Net | 165 ++++
.../BuildingBlocks/sniroCallbackNoSolutionFound | 15 +
.../BuildingBlocks/sniroCallbackPolicyException | 9 +
.../BuildingBlocks/sniroCallbackServiceException | 12 +
.../cloudRegion25_AAIResponse_Success.xml | 20 +
.../cloudRegion30_AAIResponse_Success.xml | 20 +
.../CreateNetworkV2/createNetworkResponse_400.xml | 6 +
.../CreateNetworkV2/createNetworkResponse_500.xml | 80 ++
.../createNetworkResponse_Success.xml | 24 +
.../createNetwork_queryInstance_Success.xml | 4 +
...reateNetwork_queryName2_AAIResponse_Success.xml | 62 ++
...Network_queryNameActive_AAIResponse_Success.xml | 74 ++
.../createNetwork_queryName_AAIResponse_404.xml | 19 +
...createNetwork_queryName_AAIResponse_Success.xml | 62 ++
...reateNetwork_queryNetworkId_AAIResponse_404.xml | 19 +
...ueryNetworkId_AAIResponse_NoPayload_Success.xml | 73 ++
...eNetwork_queryNetworkId_AAIResponse_Success.xml | 110 +++
...work_queryNetworkPolicy_AAIResponse_Success.xml | 21 +
...k_queryNetworkTableRef1_AAIResponse_Success.xml | 20 +
...k_queryNetworkTableRef2_AAIResponse_Success.xml | 20 +
...ork_queryVpnBindingList_AAIResponse_Success.xml | 57 ++
...Network_queryVpnBinding_AAIResponse_Success.xml | 46 ++
...eNetwork_updateContrail_AAIResponse_Success.xml | 11 +
...sdncCreateNetworkTopologyRsrcAssignResponse.xml | 15 +
.../sdncCreateNetworkTopologySimResponse.xml | 17 +
.../DoCreateServiceInstanceInput.json | 42 +
.../SetupServiceDecompJson.json | 36 +
...e_createServiceInstance_AAIResponse_Success.xml | 11 +
...e_queryGlobalCustomerId_AAIResponse_Success.xml | 62 ++
.../CreateVfModuleCallbackException.xml | 7 +
.../CreateVfModuleVolumeCallbackResponse.xml | 53 ++
.../CreateVfModuleVolumeRequest.xml | 24 +
.../CreateVfModuleVolumeInfraV1/GenericVnf.xml | 38 +
.../RollbackVfModuleVolumeCallbackResponse.xml | 5 +
.../createVfModuleVolume_VID_request.json | 71 ++
...createVfModuleVolume_VID_request_noreqparm.json | 45 ++
...Volume_createVolumeName_AAIResponse_Success.xml | 49 ++
...Volume_deleteVolumeName_AAIResponse_Success.xml | 24 +
...oduleVolume_queryVolumeName_AAIResponse_404.xml | 31 +
...eVolume_queryVolumeName_AAIResponse_Success.xml | 50 ++
...Volume_updateVolumeName_AAIResponse_Success.xml | 24 +
.../CreateVfModuleVolumeInfraV1/getSIUrlById.xml | 6 +
...ryVolumeId_AAIResponse_HasVfModRelationship.xml | 62 ++
.../__files/CreateVfModule_VID_request.json | 77 ++
.../CreateVfModule_VID_request_noPreloads.json | 79 ++
.../CreateVfModule_VID_request_userParam.json | 77 ++
.../test/resources/__files/DBUpdateResponse.xml | 4 +
.../test/resources/__files/Database/DBAdapter.xml | 1 +
.../__files/Database/DBUpdateResponse.xml | 4 +
.../DeleteGenericVNFV1/sdncAdapterResponse.xml | 7 +
.../cloudRegion25_AAIResponse_Success.xml | 20 +
.../cloudRegion30_AAIResponse_Success.xml | 20 +
.../deleteAAIResponse_Failure500_RESTFault.xml | 19 +
.../deleteNetworkAAIResponse_Success.xml | 61 ++
...NetworkAAIResponse_withRelationship_Success.xml | 73 ++
.../sdncDeleteNetworkTopologySimResponse.xml | 17 +
...DeleteNetworkTopologySimResponse_noExtraTag.xml | 17 +
.../__files/DeleteVfModuleCallbackResponse.xml | 21 +
.../DeleteVfModuleVolumeCallbackResponse.xml | 5 +
.../deleteVfModuleVolume_VID_request_st.json | 17 +
.../queryVolumeId_AAIResponse_Success.xml | 42 +
.../__files/DeleteVfModule_VID_request.json | 50 ++
.../DoCreateVfModule/DoCreateVfModuleRequest.xml | 31 +
.../cloudRegion_AAIResponse_Success.xml | 20 +
.../__files/DoCreateVfModule/createVnfARequest.xml | 169 ++++
.../DoCreateVfModule/getGenericVnfResponse.xml | 28 +
.../__files/DoCreateVfModule/sdncGetResponse.xml | 195 +++++
.../DoCreateVfModuleRollback/GenericVnf.xml | 26 +
.../GenericVnfVfModule.xml | 26 +
.../deactivateSDNCRequest.xml | 36 +
.../sdncAdapterWorkflowRequest.xml | 37 +
.../vnfAdapterRestV1Request.xml | 14 +
.../CreateVfModuleVolumeCallbackResponse.xml | 53 ++
.../CreateVfModuleVolumeNoRollbackRequest.xml | 24 +
.../CreateVfModuleVolumeRequest.xml | 24 +
.../DoCreateVfModuleVolumeV1/GenericVnf.xml | 38 +
.../RollbackVfModuleVolumeCallbackResponse.xml | 5 +
.../createVfModuleVolume_VID_request.json | 104 +++
...Volume_createVolumeName_AAIResponse_Success.xml | 49 ++
...Volume_deleteVolumeName_AAIResponse_Success.xml | 24 +
...eVolume_queryVolumeName_AAIResponse_Success.xml | 49 ++
...Volume_updateVolumeName_AAIResponse_Success.xml | 24 +
.../cloudRegion_AAIResponse_Success.xml | 20 +
.../vnfAdapterDeleteRequest.xml | 13 +
.../__files/DoCreateVfModule_getVnfResponse.xml | 26 +
.../DoDeleteVfModule/getGenericVnfResponse.xml | 28 +
.../sdncAdapterWorkflowRequest.xml | 36 +
.../cloudRegion_AAIResponse_Success.xml | 20 +
.../DoUpdateVfModule/getGenericVnfResponse.xml | 28 +
.../DoUpdateVfModule/sdncActivateRequest.xml | 36 +
.../DoUpdateVfModule/sdncChangeAssignRequest.xml | 36 +
.../__files/DoUpdateVfModule/sdncGetResponse.xml | 195 +++++
.../DoUpdateVfModule/sdncTopologyRequest.xml | 11 +
.../DoUpdateVfModule/vnfAdapterRestRequest.xml | 170 ++++
.../__files/GenericFlows/MsoCompletionRequest.xml | 11 +
.../__files/GenericFlows/SDNCDeleteResponse.xml | 212 +++++
.../__files/GenericFlows/aaiGetResponse.xml | 33 +
.../__files/GenericFlows/getARUrlById.xml | 6 +
.../GenericFlows/getGenericVnfByNameResponse.xml | 23 +
.../__files/GenericFlows/getGenericVnfResponse.xml | 90 +++
.../getGenericVnfResponse_hasRelationships.xml | 90 +++
.../resources/__files/GenericFlows/getNotFound.xml | 2 +
.../__files/GenericFlows/getParentSIUrlById.xml | 6 +
.../GenericFlows/getParentServiceInstance.xml | 30 +
.../__files/GenericFlows/getSINoRelations.xml | 6 +
.../__files/GenericFlows/getSIUrlById.xml | 6 +
.../__files/GenericFlows/getSIUrlByIdVipr.xml | 7 +
.../__files/GenericFlows/getServiceInstance.xml | 30 +
.../InfrastructureFlows/ConfigVnf_VID_request.json | 39 +
.../InfrastructureFlows/CreateVnfInfraRequest.json | 46 ++
.../DeleteCustomE2EService.json | 21 +
.../DeleteVnfInfraRequestCascadeDelete.json | 39 +
.../DoCreateServiceInstance_request.json | 186 +++++
.../DoScaleE2EServiceInstance.json | 38 +
.../ReplaceVnf_VID_request.json | 49 ++
.../UpdateVfModule_VID_request.json | 62 ++
.../InfrastructureFlows/UpdateVnf_VID_request.json | 56 ++
.../VnfInPlaceUpdate_VID_request.json | 16 +
.../__files/Macro/CreateNetworkCollection.json | 70 ++
.../__files/Macro/ServiceMacroAssign.json | 125 +++
.../__files/Policy/policyAbortResponse.json | 1 +
.../__files/Policy/policySkipResponse.json | 1 +
.../__files/Schemas/ActivateServiceInstance.json | 7 +
.../__files/Schemas/ActivateVnfSchema.json | 13 +
.../Schemas/AssignServiceInstanceSchema.json | 16 +
.../resources/__files/Schemas/AssignVnfSchema.json | 13 +
.../sdncUpdateNetworkTopologySimResponse.xml | 17 +
.../UpdateNetworkV2/updateNetworkResponse_400.xml | 6 +
.../UpdateNetworkV2/updateNetworkResponse_500.xml | 80 ++
.../updateNetworkResponse_Success.xml | 24 +
.../updateNetwork_queryInstance_Success.xml | 4 +
...ueryNetworkId_AAIResponse_NoPayload_Success.xml | 73 ++
...eNetwork_queryNetworkId_AAIResponse_Success.xml | 95 +++
...work_queryNetworkPolicy_AAIResponse_Success.xml | 21 +
...k_queryNetworkTableRef1_AAIResponse_Success.xml | 20 +
...k_queryNetworkTableRef2_AAIResponse_Success.xml | 20 +
...ork_queryVpnBindingList_AAIResponse_Success.xml | 57 ++
...Network_queryVpnBinding_AAIResponse_Success.xml | 46 ++
...eNetwork_updateContrail_AAIResponse_Success.xml | 11 +
.../queryVolumeId_AAIResponse_Success.xml | 44 +
.../updateVfModuleVolume_VID_request.json | 64 ++
.../updateVfModuleVolume_VID_request_2.json | 64 ++
.../updateVolumeGroupRequest.xml | 38 +
.../vf_module_aai_response.xml | 29 +
.../SDNCTopologyQueryBRGCallback.xml | 37 +
.../SDNCTopologyQueryTXCCallback.xml | 24 +
.../VCPE/CreateVcpeResCustService/arGetById.xml | 31 +
.../getCatalogServiceResourcesData.json | 127 +++
.../getCatalogServiceResourcesNoData.json | 11 +
.../VCPE/CreateVcpeResCustService/getCustomer.xml | 7 +
.../VCPE/CreateVcpeResCustService/request.json | 40 +
.../CreateVcpeResCustService/requestNoSIName.json | 61 ++
.../requestNoSINameNoRollback.json | 39 +
.../VCPE/DeleteVcpeResCustService/arGetBRGById.xml | 31 +
.../VCPE/DeleteVcpeResCustService/arGetTXCById.xml | 31 +
.../DeleteVcpeResCustService/getBRGArUrlById.xml | 6 +
.../VCPE/DeleteVcpeResCustService/getSI.xml | 35 +
.../DeleteVcpeResCustService/getSIAfterDelArs.xml | 8 +
.../DeleteVcpeResCustService/getTXCArUrlById.xml | 6 +
.../VCPE/DeleteVcpeResCustService/request.json | 40 +
.../DeleteVcpeResCustService/serviceToDelete.xml | 36 +
.../SDNCTopologyQueryCallback.xml | 37 +
.../VCPE/DoCreateAllottedResourceBRG/getAR.xml | 8 +
.../VCPE/DoCreateAllottedResourceBRG/getArBrg.xml | 31 +
.../VCPE/DoCreateAllottedResourceBRG/getArBrg2.xml | 31 +
.../DoCreateAllottedResourceBRG/getSIandAR.xml | 38 +
.../arGetById.xml | 31 +
.../sdncActivateRollbackReq.xml | 51 ++
.../sdncAssignRollbackReq.xml | 51 ++
.../sdncCreateRollbackReq.xml | 51 ++
.../SDNCTopologyQueryCallback.xml | 24 +
.../VCPE/DoCreateAllottedResourceTXC/getAR.xml | 8 +
.../VCPE/DoCreateAllottedResourceTXC/getArTxc.xml | 31 +
.../VCPE/DoCreateAllottedResourceTXC/getArTxc2.xml | 31 +
.../DoCreateAllottedResourceTXC/getSIandAR.xml | 38 +
.../arGetById.xml | 31 +
.../sdncActivateRollbackReq.xml | 51 ++
.../sdncAssignRollbackReq.xml | 51 ++
.../sdncCreateRollbackReq.xml | 51 ++
.../VCPE/DoDeleteAllottedResourceBRG/arGetById.xml | 31 +
.../VCPE/DoDeleteAllottedResourceTXC/arGetById.xml | 31 +
.../VIPR/getCatalogServiceResourcesData.json | 94 +++
...alogServiceResourcesDataForReplaceVnfInfra.json | 98 +++
...talogServiceResourcesDataForUpdateVnfInfra.json | 110 +++
.../resources/__files/VIPR/getCatalogVnfData.json | 44 +
.../VIPR/getCatalogVnfNoTwoPhasedForVfModule.json | 44 +
.../VIPR/getCatalogVnfYesTwoPhasedForVfModule.json | 44 +
.../__files/VIPR/serviceDecompositionATMFW.json | 110 +++
.../AddNetworkPolicy_AAIResponse_Success.xml | 21 +
.../CreateVfModuleVolumeCallbackResponse.xml | 53 ++
.../__files/VfModularity/DBUpdateResponse.xml | 4 +
.../VfModularity/DoUpdateVfModuleRequest.xml | 29 +
.../GenerateVfModuleName_AAIResponse_Success.xml | 51 ++
.../resources/__files/VfModularity/GenericVnf.xml | 38 +
.../QueryNetworkPolicy_AAIResponse_Success.xml | 21 +
.../VfModularity/SDNCSITopologyAssignCallback.xml | 11 +
.../VfModularity/SDNCTopologyActivateCallback.xml | 13 +
.../VfModularity/SDNCTopologyAssignCallback.xml | 16 +
.../SDNCTopologyChangeAssignCallback.xml | 13 +
.../VfModularity/SDNCTopologyCreateCallback.xml | 16 +
.../SDNCTopologyDeactivateCallback.xml | 13 +
.../SDNCTopologyDeactivateCallbackNotFound.xml | 8 +
.../VfModularity/SDNCTopologyDeleteCallback.xml | 16 +
.../VfModularity/SDNCTopologyQueryCallback.xml | 315 ++++++++
.../SDNCTopologyQueryCallbackVfModule.xml | 141 ++++
.../SDNCTopologyQueryCallbackVfModuleNoVnf.xml | 81 ++
.../VfModularity/SDNCTopologyQueryCallbackVnf.xml | 82 ++
.../VfModularity/SDNCTopologyUnassignCallback.xml | 16 +
.../VfModularity/StandardSDNCSynchResponse.xml | 5 +
.../VfModularity/VNFAdapterRestCreateCallback.xml | 55 ++
.../VfModularity/VNFAdapterRestDeleteRequest.xml | 15 +
.../VfModularity/VNFAdapterRestDeleteResponse.xml | 56 ++
.../VfModularity/VNFAdapterRestUpdateCallback.xml | 16 +
.../VNFAdapterRestVolumeGroupCallback.xml | 15 +
.../__files/VfModularity/VfModule-lukewarm.xml | 10 +
.../VfModule-new-PendingActivation.xml | 9 +
.../__files/VfModularity/VfModule-new.xml | 9 +
.../__files/VfModularity/VfModule-supercool.xml | 27 +
.../resources/__files/VfModularity/VolumeGroup.xml | 25 +
.../__files/deleteNetworkResponse_Success.xml | 3 +
.../src/test/resources/__files/requestDetails.json | 37 +
.../src/test/resources/__files/schema.json | 16 +
.../src/test/resources/application-test.yml | 334 ++++++++
.../resources/applicationContext_forPnfTesting.xml | 70 ++
.../test/resources/catalogDBClientProps.properties | 1 +
.../src/test/resources/logback-test.xml | 44 +
.../resources/requestsDBClientProps.properties | 1 +
.../test/resources/stubprocess/GenericStub.bpmn | 35 +
337 files changed, 21219 insertions(+)
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIResource.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAICreateResources.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIDeleteServiceInstance.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIServiceInstance.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGenerator.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/aai/AaiConnectionImpl.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscription.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAaiEntryWithPnfIdDelegate.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/DmaapClient.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForCorrelationId.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/implementation/AaiConnection.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/implementation/AaiResponse.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/implementation/CheckAaiForCorrelationIdImplementation.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/properties/BPMNProperties.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/LocationConstraint.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NSResourceInputParameter.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsOperationKey.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsScaleParameters.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/ScaleNsByStepsData.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/ScaleNsData.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/ScaleResource.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/VimLocation.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/GenericResourceApi.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtil.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilder.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilder.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkInformationEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkInputParametersEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkRequestInputEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkResponseInformationEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkTopologyOperationInputEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkTopologyOperationOutputEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/OnapModelInformationEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ParamEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RequestInformationEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationInputEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationOutputEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcServiceTopologyOperationInputEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcServiceTopologyOperationOutputEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/SdncRequestHeaderEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceInformationEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceInputParametersEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceRequestInputEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceResponseInformationEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceTopologyOperationInputEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceTopologyOperationOutputEntity.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/main/resources/dmaap.properties
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllBPMNTestSuites.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllTasksTestsTestSuite.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/AllTestsTestSuite.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/BeansTest.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/WebSecurityConfigImpl.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResourcesTest.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstanceTest.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstanceTest.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGeneratorTest.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForCorrelationIdTest.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/vfcmodel/VfcModelPojoTest.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtilTest.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilderTest.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilderTest.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/entity/ClientEntityPojoTest.java
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/CreateSiSample.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/VCPE/stubprocess/DoCreateAllottedResourceBRG.bpmn
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/VCPE/stubprocess/DoCreateAllottedResourceBRGRollback.bpmn
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/VCPE/stubprocess/DoCreateAllottedResourceTXC.bpmn
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/VCPE/stubprocess/DoCreateServiceInstanceRollback.bpmn
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/VCPE/stubprocess/DoCreateVnfAndModules.bpmn
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/VCPE/stubprocess/DoCreateVnfAndModulesRollback.bpmn
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/VCPE/stubprocess/DoDeleteVnfAndModules.bpmn
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/VCPE/stubprocess/Homing.bpmn
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/AAI/AAI_defaultCloudRegionByCloudRegionId.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/AAI/AAI_genericVnfGet.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/AAI/AAI_genericVnfsByVnfId.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/AAI/AAI_pserverByVnfId.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/AAI/AAI_vfModuleByVfModuleId.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/AAI/mockObject.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/APPC/appc_error.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/createNetworkRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/createNetworkResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/defaultNetwork.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/l3NetworkBbObject.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/payloadUpdateCreated.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegion.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegion25.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/queryAAICloudRegionError.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/queryAAINetworkTestResponse.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/queryAAIResponse.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/queryAAIResponseEmptyUri.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/queryAAIVpnBindingTestResponse.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/queryIdAAIResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/unassignNetworkBB_queryAAIResponse_.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/Network/updateContrailAAIPayloadRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/sniroCallback2AR1Vnf
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/sniroCallback2AR1Vnf2Net
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/sniroCallbackNoSolutionFound
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/sniroCallbackPolicyException
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/BuildingBlocks/sniroCallbackServiceException
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/cloudRegion25_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/cloudRegion30_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/createNetworkResponse_400.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/createNetworkResponse_500.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/createNetworkResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/createNetwork_queryInstance_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/createNetwork_queryName2_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNameActive_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/createNetwork_queryName_AAIResponse_404.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/createNetwork_queryName_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_404.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_NoPayload_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkId_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkPolicy_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkTableRef1_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/createNetwork_queryNetworkTableRef2_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/createNetwork_queryVpnBindingList_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/createNetwork_queryVpnBinding_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2/createNetwork_updateContrail_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2mock/sdncCreateNetworkTopologyRsrcAssignResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateNetworkV2mock/sdncCreateNetworkTopologySimResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateServiceInstance/DoCreateServiceInstanceInput.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateServiceInstance/SetupServiceDecompJson.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateServiceInstance/createServiceInstance_createServiceInstance_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateServiceInstance/createServiceInstance_queryGlobalCustomerId_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateVfModuleVolumeInfraV1/CreateVfModuleCallbackException.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateVfModuleVolumeInfraV1/CreateVfModuleVolumeCallbackResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateVfModuleVolumeInfraV1/CreateVfModuleVolumeRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateVfModuleVolumeInfraV1/GenericVnf.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateVfModuleVolumeInfraV1/RollbackVfModuleVolumeCallbackResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_VID_request_noreqparm.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_createVolumeName_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_deleteVolumeName_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_404.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateVfModuleVolumeInfraV1/createVfModuleVolume_updateVolumeName_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateVfModuleVolumeInfraV1/getSIUrlById.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_HasVfModRelationship.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateVfModule_VID_request.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateVfModule_VID_request_noPreloads.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/CreateVfModule_VID_request_userParam.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DBUpdateResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/Database/DBAdapter.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/Database/DBUpdateResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DeleteGenericVNFV1/sdncAdapterResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DeleteNetworkV2/cloudRegion25_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DeleteNetworkV2/cloudRegion30_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DeleteNetworkV2/deleteAAIResponse_Failure500_RESTFault.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DeleteNetworkV2/deleteNetworkAAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DeleteNetworkV2/deleteNetworkAAIResponse_withRelationship_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DeleteNetworkV2mock/sdncDeleteNetworkTopologySimResponse_noExtraTag.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DeleteVfModuleCallbackResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DeleteVfModuleVolumeInfraV1/DeleteVfModuleVolumeCallbackResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DeleteVfModuleVolumeInfraV1/deleteVfModuleVolume_VID_request_st.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DeleteVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DeleteVfModule_VID_request.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModule/DoCreateVfModuleRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModule/cloudRegion_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModule/createVnfARequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModule/getGenericVnfResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModule/sdncGetResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleRollback/GenericVnf.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleRollback/GenericVnfVfModule.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleRollback/deactivateSDNCRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleRollback/sdncAdapterWorkflowRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleRollback/vnfAdapterRestV1Request.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeCallbackResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeNoRollbackRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV1/CreateVfModuleVolumeRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV1/GenericVnf.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV1/RollbackVfModuleVolumeCallbackResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_VID_request.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_createVolumeName_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_deleteVolumeName_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_queryVolumeName_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV1/createVfModuleVolume_updateVolumeName_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV2/cloudRegion_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModuleVolumeV2/vnfAdapterDeleteRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoCreateVfModule_getVnfResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoDeleteVfModule/getGenericVnfResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoDeleteVfModule/sdncAdapterWorkflowRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoUpdateVfModule/cloudRegion_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoUpdateVfModule/getGenericVnfResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoUpdateVfModule/sdncActivateRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoUpdateVfModule/sdncChangeAssignRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoUpdateVfModule/sdncGetResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoUpdateVfModule/sdncTopologyRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/DoUpdateVfModule/vnfAdapterRestRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/GenericFlows/MsoCompletionRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/GenericFlows/SDNCDeleteResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/GenericFlows/aaiGetResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/GenericFlows/getARUrlById.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/GenericFlows/getGenericVnfByNameResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/GenericFlows/getGenericVnfResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/GenericFlows/getGenericVnfResponse_hasRelationships.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/GenericFlows/getNotFound.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/GenericFlows/getParentSIUrlById.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/GenericFlows/getParentServiceInstance.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/GenericFlows/getSINoRelations.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/GenericFlows/getSIUrlById.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/GenericFlows/getSIUrlByIdVipr.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/GenericFlows/getServiceInstance.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/InfrastructureFlows/ConfigVnf_VID_request.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/InfrastructureFlows/CreateVnfInfraRequest.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/InfrastructureFlows/DeleteCustomE2EService.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/InfrastructureFlows/DeleteVnfInfraRequestCascadeDelete.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/InfrastructureFlows/DoCreateServiceInstance_request.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/InfrastructureFlows/DoScaleE2EServiceInstance.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/InfrastructureFlows/ReplaceVnf_VID_request.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/InfrastructureFlows/UpdateVfModule_VID_request.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/InfrastructureFlows/UpdateVnf_VID_request.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/InfrastructureFlows/VnfInPlaceUpdate_VID_request.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/Macro/CreateNetworkCollection.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/Macro/ServiceMacroAssign.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/Policy/policyAbortResponse.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/Policy/policySkipResponse.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/Schemas/ActivateServiceInstance.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/Schemas/ActivateVnfSchema.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/Schemas/AssignServiceInstanceSchema.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/Schemas/AssignVnfSchema.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateNetworkV2/sdncUpdateNetworkTopologySimResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateNetworkV2/updateNetworkResponse_400.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateNetworkV2/updateNetworkResponse_500.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateNetworkV2/updateNetworkResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryInstance_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_NoPayload_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkId_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkPolicy_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkTableRef1_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryNetworkTableRef2_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryVpnBindingList_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryVpnBinding_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateNetworkV2/updateNetwork_updateContrail_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/queryVolumeId_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVfModuleVolume_VID_request_2.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/updateVolumeGroupRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/UpdateVfModuleVolumeInfraV1/vf_module_aai_response.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryBRGCallback.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/CreateVcpeResCustService/arGetById.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/CreateVcpeResCustService/getCatalogServiceResourcesData.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/CreateVcpeResCustService/getCatalogServiceResourcesNoData.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/CreateVcpeResCustService/getCustomer.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/CreateVcpeResCustService/request.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSIName.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSINameNoRollback.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DeleteVcpeResCustService/arGetBRGById.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DeleteVcpeResCustService/arGetTXCById.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DeleteVcpeResCustService/getBRGArUrlById.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DeleteVcpeResCustService/getSI.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DeleteVcpeResCustService/getSIAfterDelArs.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DeleteVcpeResCustService/getTXCArUrlById.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DeleteVcpeResCustService/request.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DeleteVcpeResCustService/serviceToDelete.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/SDNCTopologyQueryCallback.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getAR.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getArBrg.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getArBrg2.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRG/getSIandAR.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/arGetById.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncActivateRollbackReq.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncAssignRollbackReq.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceBRGRollback/sdncCreateRollbackReq.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/getAR.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/getArTxc.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/getArTxc2.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/getSIandAR.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/arGetById.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncActivateRollbackReq.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncAssignRollbackReq.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXCRollback/sdncCreateRollbackReq.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoDeleteAllottedResourceBRG/arGetById.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VCPE/DoDeleteAllottedResourceTXC/arGetById.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VIPR/getCatalogServiceResourcesData.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VIPR/getCatalogServiceResourcesDataForReplaceVnfInfra.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VIPR/getCatalogServiceResourcesDataForUpdateVnfInfra.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VIPR/getCatalogVnfData.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VIPR/getCatalogVnfNoTwoPhasedForVfModule.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VIPR/getCatalogVnfYesTwoPhasedForVfModule.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VIPR/serviceDecompositionATMFW.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/AddNetworkPolicy_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/CreateVfModuleVolumeCallbackResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/DBUpdateResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/DoUpdateVfModuleRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/GenerateVfModuleName_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/GenericVnf.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/QueryNetworkPolicy_AAIResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/SDNCSITopologyAssignCallback.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/SDNCTopologyActivateCallback.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/SDNCTopologyAssignCallback.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/SDNCTopologyChangeAssignCallback.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/SDNCTopologyCreateCallback.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallback.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/SDNCTopologyDeactivateCallbackNotFound.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/SDNCTopologyDeleteCallback.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallback.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVfModule.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVfModuleNoVnf.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/SDNCTopologyQueryCallbackVnf.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/SDNCTopologyUnassignCallback.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/StandardSDNCSynchResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/VNFAdapterRestCreateCallback.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/VNFAdapterRestDeleteRequest.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/VNFAdapterRestDeleteResponse.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/VNFAdapterRestUpdateCallback.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/VNFAdapterRestVolumeGroupCallback.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/VfModule-lukewarm.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/VfModule-new-PendingActivation.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/VfModule-new.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/VfModule-supercool.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/VfModularity/VolumeGroup.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/deleteNetworkResponse_Success.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/requestDetails.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/__files/schema.json
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/application-test.yml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/applicationContext_forPnfTesting.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/catalogDBClientProps.properties
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/logback-test.xml
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/requestsDBClientProps.properties
create mode 100644 bpmn/so-bpmn-infrastructure-common/src/test/resources/stubprocess/GenericStub.bpmn
(limited to 'bpmn/so-bpmn-infrastructure-common/src')
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java
new file mode 100644
index 0000000000..a47b16fc33
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAICreateResources.java
@@ -0,0 +1,90 @@
+/*-
+ * ============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.aai;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.client.aai.AAIObjectType;
+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;
+
+public class AAICreateResources extends AAIResource {
+
+
+ public void createAAIProject (String projectName, String serviceInstance){
+ AAIResourceUri projectURI = AAIUriFactory.createResourceUri(AAIObjectType.PROJECT, projectName);
+ AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ getAaiClient().createIfNotExists(projectURI, Optional.empty()).connect(projectURI, serviceInstanceURI);
+
+ }
+
+ public void createAAIOwningEntity(String owningEntityId, String owningEntityName,String serviceInstance){
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ Map hashMap= new HashMap<>();
+ hashMap.put("owning-entity-name", owningEntityName);
+ getAaiClient().createIfNotExists(owningEntityURI, Optional.of(hashMap)).connect(owningEntityURI, serviceInstanceURI);
+ }
+
+ public boolean existsOwningEntity(String owningEntityId){
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ return getAaiClient().exists(owningEntityURI);
+ }
+
+ public void connectOwningEntityandServiceInstance (String owningEntityId, String serviceInstance){
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ getAaiClient().connect(owningEntityURI, serviceInstanceURI);
+ }
+
+ public void createAAIPlatform(String platformName,String vnfId){
+ AAIResourceUri platformURI = AAIUriFactory.createResourceUri(AAIObjectType.PLATFORM, platformName);
+ AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF,vnfId);
+ getAaiClient().createIfNotExists(platformURI, Optional.empty()).connect(platformURI, genericVnfURI);
+ }
+
+ public void createAAILineOfBusiness(String lineOfBusiness,String vnfId){
+ AAIResourceUri lineOfBusinessURI = AAIUriFactory.createResourceUri(AAIObjectType.LINE_OF_BUSINESS, lineOfBusiness);
+ AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF,vnfId);
+ getAaiClient().createIfNotExists(lineOfBusinessURI, Optional.empty()).connect(lineOfBusinessURI, genericVnfURI);
+ }
+ public void createAAIServiceInstance(String globalCustomerId, String serviceType, String serviceInstanceId){
+ AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustomerId,serviceType,serviceInstanceId);
+ getAaiClient().createIfNotExists(serviceInstanceURI, Optional.empty());
+ }
+
+ public Optional getVnfInstance(String vnfId){
+ try{
+ AAIResourceUri vnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId);
+ AAIResultWrapper aaiResponse = getAaiClient().get(vnfURI);
+ Optional vnf = aaiResponse.asBean(GenericVnf.class);
+ return vnf;
+ } catch (Exception ex){
+ return Optional.empty();
+ }
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java
new file mode 100644
index 0000000000..cea6fe740d
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java
@@ -0,0 +1,49 @@
+/*-
+ * ============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.aai;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.onap.so.bpmn.common.scripts.ExceptionUtil;
+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.springframework.stereotype.Component;
+
+public class AAIDeleteServiceInstance extends AAIResource implements JavaDelegate{
+
+ ExceptionUtil exceptionUtil = new ExceptionUtil();
+ public void execute(DelegateExecution execution) throws Exception {
+ try{
+ String serviceInstanceId = (String) execution.getVariable("serviceInstanceId");
+ AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
+ serviceInstanceId);
+ getAaiClient().delete(serviceInstanceURI);
+ execution.setVariable("GENDS_SuccessIndicator",true);
+ } catch(Exception ex){
+ String msg = "Exception in Delete Serivce Instance. Service Instance could not be deleted in AAI." + ex.getMessage();
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
+ }
+
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIResource.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIResource.java
new file mode 100644
index 0000000000..3bc02be476
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIResource.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.aai;
+
+import org.onap.so.client.aai.AAIResourcesClient;
+import org.springframework.stereotype.Component;
+
+@Component
+public abstract class AAIResource {
+ private AAIResourcesClient aaiClient;
+
+ public AAIResourcesClient getAaiClient() {
+ if(aaiClient == null)
+ return new AAIResourcesClient();
+ else
+ return aaiClient;
+ }
+
+ public void setAaiClient(AAIResourcesClient aaiClient) {
+ this.aaiClient = aaiClient;
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java
new file mode 100644
index 0000000000..67ba155336
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java
@@ -0,0 +1,94 @@
+/*-
+ * ============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.aai;
+
+public class AAIServiceInstance {
+ String serviceInstanceName;
+ String serviceType;
+ String serviceRole;
+ String orchestrationStatus;
+ String modelInvariantUuid;
+ String modelVersionId;
+ String environmentContext;
+ String workloadContext;
+ public AAIServiceInstance(String serviceInstanceName, String serviceType, String serviceRole,
+ String orchestrationStatus, String modelInvariantUuid, String modelVersionId, String environmentContext,
+ String workloadContext) {
+ this.serviceInstanceName = serviceInstanceName;
+ this.serviceType = serviceType;
+ this.serviceRole = serviceRole;
+ this.orchestrationStatus = orchestrationStatus;
+ this.modelInvariantUuid = modelInvariantUuid;
+ this.modelVersionId = modelVersionId;
+ this.environmentContext = environmentContext;
+ this.workloadContext = workloadContext;
+ }
+ public String getServiceInstanceName() {
+ return serviceInstanceName;
+ }
+ public void setServiceInstanceName(String serviceInstanceName) {
+ this.serviceInstanceName = serviceInstanceName;
+ }
+ 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 getOrchestrationStatus() {
+ return orchestrationStatus;
+ }
+ public void setOrchestrationStatus(String orchestrationStatus) {
+ this.orchestrationStatus = orchestrationStatus;
+ }
+ public String getModelInvariantUuid() {
+ return modelInvariantUuid;
+ }
+ public void setModelInvariantUuid(String modelInvariantUuid) {
+ this.modelInvariantUuid = modelInvariantUuid;
+ }
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+ public String getEnvironmentContext() {
+ return environmentContext;
+ }
+ public void setEnvironmentContext(String environmentContext) {
+ this.environmentContext = environmentContext;
+ }
+ public String getWorkloadContext() {
+ return workloadContext;
+ }
+ public void setWorkloadContext(String workloadContext) {
+ this.workloadContext = workloadContext;
+ }
+
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAICreateResources.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAICreateResources.java
new file mode 100644
index 0000000000..c04c2dc15b
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAICreateResources.java
@@ -0,0 +1,123 @@
+/*-
+ * ============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.aai.groovyflows;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+import javax.ws.rs.NotFoundException;
+
+import org.onap.aai.domain.yang.ServiceInstance;
+import org.onap.aai.domain.yang.ServiceInstances;
+import org.onap.aai.domain.yang.OwningEntities;
+import org.onap.aai.domain.yang.OwningEntity;
+import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils;
+import org.onap.so.client.aai.AAIObjectPlurals;
+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;
+
+public class AAICreateResources {
+
+ private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAICreateResources.class);
+
+ public void createAAIProject (String projectName, String serviceInstance){
+ AAIResourceUri projectURI = AAIUriFactory.createResourceUri(AAIObjectType.PROJECT, projectName);
+ AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.createIfNotExists(projectURI, Optional.empty()).connect(projectURI, serviceInstanceURI);
+
+ }
+
+ public void createAAIOwningEntity(String owningEntityId, String owningEntityName,String serviceInstance){
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ AAIResourceUri serviceInstanceURI = AAIUriFactory.createNodesUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ Map hashMap= new HashMap<>();
+ hashMap.put("owning-entity-name", owningEntityName);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.createIfNotExists(owningEntityURI, Optional.of(hashMap)).connect(owningEntityURI, serviceInstanceURI);
+ }
+
+ public boolean existsOwningEntity(String owningEntityId){
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ return aaiRC.exists(owningEntityURI);
+ }
+
+ protected OwningEntities getOwningEntityName(String owningEntityName){
+
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ return aaiRC.get(OwningEntities.class,
+ AAIUriFactory
+ .createResourceUri(AAIObjectPlurals.OWNING_ENTITIES)
+ .queryParam("owning-entity-name", owningEntityName))
+ .orElseGet(() -> {
+ msoLogger.debug("No Owning Entity matched by name");
+ return null;
+ });
+
+ }
+
+ public Optional getOwningEntityNames(String owningEntityName) throws Exception{
+ OwningEntity owningEntity = null;
+ OwningEntities owningEntities = null;
+ owningEntities = getOwningEntityName(owningEntityName);
+
+ if (owningEntities == null) {
+ return Optional.empty();
+ } else if (owningEntities.getOwningEntity().size() > 1) {
+ throw new Exception("Multiple OwningEntities Returned");
+ } else {
+ owningEntity = owningEntities.getOwningEntity().get(0);
+ }
+ return Optional.of(owningEntity);
+ }
+
+ public void connectOwningEntityandServiceInstance (String owningEntityId, String serviceInstance){
+ AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId);
+ AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.connect(owningEntityURI, serviceInstanceURI);
+ }
+
+ public void createAAIPlatform(String platformName,String vnfId){
+ AAIResourceUri platformURI = AAIUriFactory.createResourceUri(AAIObjectType.PLATFORM, platformName);
+ AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF,vnfId);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.createIfNotExists(platformURI, Optional.empty()).connect(platformURI, genericVnfURI);
+ }
+
+ public void createAAILineOfBusiness(String lineOfBusiness,String vnfId){
+ AAIResourceUri lineOfBusinessURI = AAIUriFactory.createResourceUri(AAIObjectType.LINE_OF_BUSINESS, lineOfBusiness);
+ AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF,vnfId);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.createIfNotExists(lineOfBusinessURI, Optional.empty()).connect(lineOfBusinessURI, genericVnfURI);
+ }
+ public void createAAIServiceInstance(String globalCustomerId, String serviceType, String serviceInstanceId){
+ AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustomerId,serviceType,serviceInstanceId);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.createIfNotExists(serviceInstanceURI, Optional.empty());
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIDeleteServiceInstance.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIDeleteServiceInstance.java
new file mode 100644
index 0000000000..495c77255d
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIDeleteServiceInstance.java
@@ -0,0 +1,49 @@
+/*-
+ * ============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.aai.groovyflows;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.onap.so.bpmn.common.scripts.ExceptionUtil;
+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;
+
+public class AAIDeleteServiceInstance implements JavaDelegate{
+
+ ExceptionUtil exceptionUtil = new ExceptionUtil();
+ public void execute(DelegateExecution execution) throws Exception {
+ try{
+ String serviceInstanceId = (String) execution.getVariable("serviceInstanceId");
+ AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
+ serviceInstanceId);
+ AAIResourcesClient aaiRC = new AAIResourcesClient();
+ aaiRC.delete(serviceInstanceURI);
+ execution.setVariable("GENDS_SuccessIndicator",true);
+ } catch(Exception ex){
+ String msg = "Exception in Delete Serivce Instance. Service Instance could not be deleted in AAI." + ex.getMessage();
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
+ }
+
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIServiceInstance.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIServiceInstance.java
new file mode 100644
index 0000000000..805ece9de8
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/groovyflows/AAIServiceInstance.java
@@ -0,0 +1,94 @@
+/*-
+ * ============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.aai.groovyflows;
+
+public class AAIServiceInstance {
+ String serviceInstanceName;
+ String serviceType;
+ String serviceRole;
+ String orchestrationStatus;
+ String modelInvariantUuid;
+ String modelVersionId;
+ String environmentContext;
+ String workloadContext;
+ public AAIServiceInstance(String serviceInstanceName, String serviceType, String serviceRole,
+ String orchestrationStatus, String modelInvariantUuid, String modelVersionId, String environmentContext,
+ String workloadContext) {
+ this.serviceInstanceName = serviceInstanceName;
+ this.serviceType = serviceType;
+ this.serviceRole = serviceRole;
+ this.orchestrationStatus = orchestrationStatus;
+ this.modelInvariantUuid = modelInvariantUuid;
+ this.modelVersionId = modelVersionId;
+ this.environmentContext = environmentContext;
+ this.workloadContext = workloadContext;
+ }
+ public String getServiceInstanceName() {
+ return serviceInstanceName;
+ }
+ public void setServiceInstanceName(String serviceInstanceName) {
+ this.serviceInstanceName = serviceInstanceName;
+ }
+ 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 getOrchestrationStatus() {
+ return orchestrationStatus;
+ }
+ public void setOrchestrationStatus(String orchestrationStatus) {
+ this.orchestrationStatus = orchestrationStatus;
+ }
+ public String getModelInvariantUuid() {
+ return modelInvariantUuid;
+ }
+ public void setModelInvariantUuid(String modelInvariantUuid) {
+ this.modelInvariantUuid = modelInvariantUuid;
+ }
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+ public String getEnvironmentContext() {
+ return environmentContext;
+ }
+ public void setEnvironmentContext(String environmentContext) {
+ this.environmentContext = environmentContext;
+ }
+ public String getWorkloadContext() {
+ return workloadContext;
+ }
+ public void setWorkloadContext(String workloadContext) {
+ this.workloadContext = workloadContext;
+ }
+
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGenerator.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGenerator.java
new file mode 100644
index 0000000000..3b443cbaf2
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/common/name/generation/AAIObjectInstanceNameGenerator.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.common.name.generation;
+
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup;
+import org.springframework.stereotype.Component;
+
+@Component
+public class AAIObjectInstanceNameGenerator {
+
+ public String generateInstanceGroupName(InstanceGroup instanceGroup, GenericVnf vnf) {
+ if(vnf.getVnfName() != null && instanceGroup.getModelInfoInstanceGroup().getFunction() != null) {
+ return vnf.getVnfName() + "_" + instanceGroup.getModelInfoInstanceGroup().getFunction();
+ } else {
+ throw new IllegalArgumentException("Cannot generate instance group name because either one or both fields are null: "
+ + " Vnf Instance Name: " + vnf.getVnfName()
+ + ", Instance Group Function: " + instanceGroup.getModelInfoInstanceGroup().getFunction());
+ }
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/aai/AaiConnectionImpl.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/aai/AaiConnectionImpl.java
new file mode 100644
index 0000000000..fa40e860c5
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/aai/AaiConnectionImpl.java
@@ -0,0 +1,44 @@
+/*-
+ * ============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.pnf.aai;
+
+import java.io.IOException;
+import java.util.Optional;
+import java.util.UUID;
+
+import org.onap.aai.domain.yang.Pnf;
+import org.onap.so.bpmn.infrastructure.pnf.implementation.AaiConnection;
+import org.onap.so.client.aai.AAIRestClientImpl;
+
+public class AaiConnectionImpl implements AaiConnection {
+
+ @Override
+ public Optional getEntryFor(String correlationId) throws IOException {
+ AAIRestClientImpl restClient = new AAIRestClientImpl();
+ return restClient.getPnfByName(correlationId, UUID.randomUUID().toString());
+ }
+
+ @Override
+ public void createEntry(String correlationId, Pnf entry) throws IOException {
+ AAIRestClientImpl restClient = new AAIRestClientImpl();
+ restClient.createPnf(correlationId, UUID.randomUUID().toString(), entry);
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscription.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscription.java
new file mode 100644
index 0000000000..85cbe2b024
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscription.java
@@ -0,0 +1,42 @@
+/*-
+ * ============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.pnf.delegate;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.onap.so.bpmn.infrastructure.pnf.dmaap.DmaapClient;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class CancelDmaapSubscription implements JavaDelegate {
+
+ private DmaapClient dmaapClient;
+
+ @Override
+ public void execute(DelegateExecution execution) throws Exception {
+ String correlationId = (String) execution.getVariable(ExecutionVariableNames.CORRELATION_ID);
+ dmaapClient.unregister(correlationId);
+ }
+
+ @Autowired
+ public void setDmaapClient(DmaapClient dmaapClient) {
+ this.dmaapClient = dmaapClient;
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java
new file mode 100644
index 0000000000..63db293a2e
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java
@@ -0,0 +1,76 @@
+/*-
+ * ============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.pnf.delegate;
+
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.AAI_CONTAINS_INFO_ABOUT_IP;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.AAI_CONTAINS_INFO_ABOUT_PNF;
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID;
+
+import java.io.IOException;
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.onap.so.bpmn.common.scripts.ExceptionUtil;
+import org.onap.so.bpmn.infrastructure.pnf.implementation.AaiConnection;
+import org.onap.so.bpmn.infrastructure.pnf.implementation.AaiResponse;
+import org.onap.so.bpmn.infrastructure.pnf.implementation.CheckAaiForCorrelationIdImplementation;
+import org.onap.so.logger.MsoLogger;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * Implementation of "Check AAI for correlation_id" task in CreateAndActivatePnfResource.bpmn
+ *
+ * Inputs:
+ * - correlationId - String
+ *
+ * Outputs:
+ * - AAI_CONTAINS_INFO_ABOUT_PNF - local Boolean
+ * - aaiContainsInfoAboutIp - local Boolean
+ */
+
+public class CheckAaiForCorrelationIdDelegate implements JavaDelegate {
+ private static MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL, CheckAaiForCorrelationIdDelegate.class);
+ private CheckAaiForCorrelationIdImplementation implementation = new CheckAaiForCorrelationIdImplementation();
+ private AaiConnection aaiConnection;
+
+ @Autowired
+ public void setAaiConnection(AaiConnection aaiConnection) {
+ this.aaiConnection = aaiConnection;
+ }
+
+ @Override
+ public void execute(DelegateExecution execution) throws Exception {
+ String correlationId = (String) execution.getVariable(CORRELATION_ID);
+ if (correlationId == null) {
+ new ExceptionUtil().buildAndThrowWorkflowException(execution, 500, CORRELATION_ID + " is not set");
+ }
+
+ try {
+ AaiResponse aaiResponse = implementation.check(correlationId, aaiConnection);
+
+ execution.setVariableLocal(AAI_CONTAINS_INFO_ABOUT_PNF, aaiResponse.getContainsInfoAboutPnf());
+ execution.setVariableLocal(AAI_CONTAINS_INFO_ABOUT_IP, aaiResponse.getContainsInfoAboutIp());
+ } catch (IOException e) {
+ LOGGER.error("IOException",e);
+ new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999, e.getMessage());
+ }
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAaiEntryWithPnfIdDelegate.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAaiEntryWithPnfIdDelegate.java
new file mode 100644
index 0000000000..ec1ef21028
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateAaiEntryWithPnfIdDelegate.java
@@ -0,0 +1,55 @@
+/*-
+ * ============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.pnf.delegate;
+
+import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.onap.aai.domain.yang.Pnf;
+import org.onap.so.bpmn.infrastructure.pnf.implementation.AaiConnection;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * Implementation of "Create AAI entry with pnf-id = correlation_id" task in CreateAndActivatePnfResource.bpmn
+ *
+ * Inputs:
+ * - correlationId - String
+ */
+public class CreateAaiEntryWithPnfIdDelegate implements JavaDelegate {
+
+ private AaiConnection aaiConnection;
+
+ @Autowired
+ public void setAaiConnection(AaiConnection aaiConnection) {
+ this.aaiConnection = aaiConnection;
+ }
+
+ @Override
+ public void execute(DelegateExecution execution) throws Exception {
+ String correlationId = (String) execution.getVariable(CORRELATION_ID);
+ Pnf pnf = new Pnf();
+ pnf.setInMaint(true);
+ pnf.setPnfId(correlationId);
+ pnf.setPnfName(correlationId);
+ aaiConnection.createEntry(correlationId, pnf);
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java
new file mode 100644
index 0000000000..b3f2f726a0
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java
@@ -0,0 +1,33 @@
+/*-
+ * ============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.pnf.delegate;
+
+@SuppressWarnings("ALL")
+public class ExecutionVariableNames {
+
+ private ExecutionVariableNames() {}
+
+ public final static String CORRELATION_ID = "correlationId";
+ public final static String AAI_CONTAINS_INFO_ABOUT_PNF = "aaiContainsInfoAboutPnf";
+ public final static String AAI_CONTAINS_INFO_ABOUT_IP = "aaiContainsInfoAboutIp";
+ public final static String DMAAP_MESSAGE = "dmaapMessage";
+ public final static String TIMEOUT_FOR_NOTIFICATION = "timeoutForPnfEntryNotification";
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
new file mode 100644
index 0000000000..bb490a06e4
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java
@@ -0,0 +1,45 @@
+/*-
+ * ============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.pnf.delegate;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.onap.so.bpmn.infrastructure.pnf.dmaap.DmaapClient;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class InformDmaapClient implements JavaDelegate {
+
+ private DmaapClient dmaapClient;
+
+ @Override
+ public void execute(DelegateExecution execution) throws Exception {
+ String correlationId = (String) execution.getVariable(ExecutionVariableNames.CORRELATION_ID);
+ dmaapClient.registerForUpdate(correlationId, () -> execution.getProcessEngineServices().getRuntimeService()
+ .createMessageCorrelation("WorkflowMessage")
+ .processInstanceBusinessKey(execution.getProcessBusinessKey())
+ .correlateWithResult());
+ }
+
+ @Autowired
+ public void setDmaapClient(DmaapClient dmaapClient) {
+ this.dmaapClient = dmaapClient;
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/DmaapClient.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/DmaapClient.java
new file mode 100644
index 0000000000..c7e7c7848c
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/DmaapClient.java
@@ -0,0 +1,28 @@
+/*-
+ * ============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.pnf.dmaap;
+
+public interface DmaapClient {
+
+ void registerForUpdate(String correlationId, Runnable informConsumer);
+
+ Runnable unregister(String correlationId);
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForCorrelationId.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForCorrelationId.java
new file mode 100644
index 0000000000..90b48ab2c1
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/JsonUtilForCorrelationId.java
@@ -0,0 +1,71 @@
+/*-
+ * ============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.pnf.dmaap;
+
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+import java.util.Spliterator;
+
+public final class JsonUtilForCorrelationId {
+
+ private static final String JSON_HEADER = "pnfRegistrationFields";
+ private static final String JSON_CORRELATION_ID_FIELD_NAME = "correlationId";
+
+ static List parseJsonToGelAllCorrelationId(String json) {
+ List list = new ArrayList<>();
+ JsonElement je = new JsonParser().parse(json);
+ if (je.isJsonObject()) {
+ getCorrelationIdFromJsonObject(je.getAsJsonObject()).ifPresent(corr -> list.add(corr));
+ } else {
+ JsonArray array = je.getAsJsonArray();
+ Spliterator spliterator = array.spliterator();
+ spliterator.forEachRemaining(jsonElement -> {
+ parseJsonElementToJsonObject(jsonElement)
+ .ifPresent(jsonObject -> getCorrelationIdFromJsonObject(jsonObject)
+ .ifPresent(correlationId -> list.add(correlationId)));
+ });
+ }
+ return list;
+ }
+
+ private static Optional parseJsonElementToJsonObject(JsonElement jsonElement) {
+ if (jsonElement.isJsonObject()) {
+ return Optional.ofNullable(jsonElement.getAsJsonObject());
+ }
+ return Optional.ofNullable(new JsonParser().parse(jsonElement.getAsString()).getAsJsonObject());
+ }
+
+ private static Optional getCorrelationIdFromJsonObject(JsonObject jsonObject) {
+ if (jsonObject.has(JSON_HEADER)) {
+ JsonObject jo = jsonObject.getAsJsonObject(JSON_HEADER);
+ if (jo.has(JSON_CORRELATION_ID_FIELD_NAME)) {
+ return Optional.ofNullable(jo.get(JSON_CORRELATION_ID_FIELD_NAME).getAsString());
+ }
+ }
+ return Optional.empty();
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java
new file mode 100644
index 0000000000..353b4e32c5
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java
@@ -0,0 +1,178 @@
+/*-
+ * ============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.pnf.dmaap;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+import javax.ws.rs.core.UriBuilder;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.util.EntityUtils;
+import org.onap.so.logger.MsoLogger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+
+@Component
+@Scope("prototype")
+public class PnfEventReadyDmaapClient implements DmaapClient {
+
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, PnfEventReadyDmaapClient.class);
+
+ private static final String JSON_PATH_CORRELATION_ID = "$.pnfRegistrationFields.correlationId";
+
+ @Autowired
+ private Environment env;
+ private HttpClient httpClient;
+ private String dmaapHost;
+ private int dmaapPort;
+ private String dmaapProtocol;
+ private String dmaapUriPathPrefix;
+ private String dmaapTopicName;
+ private String consumerId;
+ private String consumerGroup;
+ private Map pnfCorrelationIdToThreadMap;
+ private HttpGet getRequest;
+ private ScheduledExecutorService executor;
+ private int dmaapClientDelayInSeconds;
+ private volatile boolean dmaapThreadListenerIsRunning;
+
+ public void init() {
+ httpClient = HttpClientBuilder.create().build();
+ pnfCorrelationIdToThreadMap = new ConcurrentHashMap<>();
+ dmaapHost = env.getProperty("pnf.dmaap.host");
+ dmaapPort = env.getProperty("pnf.dmaap.port", Integer.class);
+ executor = null;
+ getRequest = new HttpGet(buildURI());
+ }
+
+ @Override
+ public synchronized void registerForUpdate(String correlationId, Runnable informConsumer) {
+ LOGGER.debug("registering for pnf ready dmaap event for correlation id: " + correlationId);
+ pnfCorrelationIdToThreadMap.put(correlationId, informConsumer);
+ if (!dmaapThreadListenerIsRunning) {
+ startDmaapThreadListener();
+ }
+ }
+
+ @Override
+ public synchronized Runnable unregister(String correlationId) {
+ LOGGER.debug("unregistering from pnf ready dmaap event for correlation id: " + correlationId);
+ Runnable runnable = pnfCorrelationIdToThreadMap.remove(correlationId);
+ if (pnfCorrelationIdToThreadMap.isEmpty()) {
+ stopDmaapThreadListener();
+ }
+ return runnable;
+ }
+
+ private synchronized void startDmaapThreadListener() {
+ if (!dmaapThreadListenerIsRunning) {
+ executor = Executors.newScheduledThreadPool(1);
+ executor.scheduleWithFixedDelay(new DmaapTopicListenerThread(), 0,
+ dmaapClientDelayInSeconds, TimeUnit.SECONDS);
+ dmaapThreadListenerIsRunning = true;
+ }
+ }
+
+ private synchronized void stopDmaapThreadListener() {
+ if (dmaapThreadListenerIsRunning) {
+ executor.shutdownNow();
+ dmaapThreadListenerIsRunning = false;
+ executor = null;
+ }
+ }
+
+ private URI buildURI() {
+ return UriBuilder.fromUri(dmaapUriPathPrefix)
+ .scheme(dmaapProtocol)
+ .host(dmaapHost)
+ .port(dmaapPort).path(dmaapTopicName)
+ .path(consumerGroup).path(consumerId).build();
+ }
+
+ public void setDmaapProtocol(String dmaapProtocol) {
+ this.dmaapProtocol = dmaapProtocol;
+ }
+
+ public void setDmaapUriPathPrefix(String dmaapUriPathPrefix) {
+ this.dmaapUriPathPrefix = dmaapUriPathPrefix;
+ }
+
+ public void setDmaapTopicName(String dmaapTopicName) {
+ this.dmaapTopicName = dmaapTopicName;
+ }
+
+ public void setConsumerId(String consumerId) {
+ this.consumerId = consumerId;
+ }
+
+ public void setConsumerGroup(String consumerGroup) {
+ this.consumerGroup = consumerGroup;
+ }
+
+ public void setDmaapClientDelayInSeconds(int dmaapClientDelayInSeconds) {
+ this.dmaapClientDelayInSeconds = dmaapClientDelayInSeconds;
+ }
+
+ class DmaapTopicListenerThread implements Runnable {
+
+ @Override
+ public void run() {
+ try {
+ HttpResponse response = httpClient.execute(getRequest);
+ getCorrelationIdListFromResponse(response).forEach(this::informAboutPnfReadyIfCorrelationIdFound);
+ } catch (IOException e) {
+ LOGGER.error("Exception caught during sending rest request to dmaap for listening event topic", e);
+ }
+ }
+
+ private List getCorrelationIdListFromResponse(HttpResponse response) throws IOException {
+ if (response.getStatusLine().getStatusCode() == 200) {
+ String responseString = EntityUtils.toString(response.getEntity(), "UTF-8");
+ if (responseString != null) {
+ return JsonUtilForCorrelationId.parseJsonToGelAllCorrelationId(responseString);
+ }
+ }
+ return Collections.emptyList();
+ }
+
+ private synchronized void informAboutPnfReadyIfCorrelationIdFound(String correlationId) {
+ Runnable runnable = unregister(correlationId);
+ if (runnable != null) {
+ LOGGER.debug("pnf ready event got from dmaap for correlationId: " + correlationId);
+ runnable.run();
+ }
+ }
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/implementation/AaiConnection.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/implementation/AaiConnection.java
new file mode 100644
index 0000000000..5165912653
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/implementation/AaiConnection.java
@@ -0,0 +1,32 @@
+/*-
+ * ============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.pnf.implementation;
+
+import java.io.IOException;
+import java.util.Optional;
+import org.onap.aai.domain.yang.Pnf;
+
+public interface AaiConnection {
+
+ Optional getEntryFor(String correlationId) throws IOException;
+
+ void createEntry(String correlationId, Pnf entry) throws IOException;
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/implementation/AaiResponse.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/implementation/AaiResponse.java
new file mode 100644
index 0000000000..32ecff102f
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/implementation/AaiResponse.java
@@ -0,0 +1,48 @@
+/*-
+ * ============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.pnf.implementation;
+
+import java.util.Optional;
+import javax.annotation.Nullable;
+import javax.validation.constraints.NotNull;
+
+public enum AaiResponse {
+ NO_ENTRY(false, false),
+ ENTRY_NO_IP(true, false),
+ ENTRY_WITH_IP(true, true);
+
+ private boolean containsInfoAboutPnf;
+ private boolean containsInfoAboutIp;
+
+ AaiResponse(boolean containsInfoAboutPnf, boolean containsInfoAboutIp) {
+ this.containsInfoAboutPnf = containsInfoAboutPnf;
+ this.containsInfoAboutIp = containsInfoAboutIp;
+ }
+
+ public boolean getContainsInfoAboutPnf() {
+ return containsInfoAboutPnf;
+ }
+
+ public boolean getContainsInfoAboutIp() {
+ return containsInfoAboutIp;
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/implementation/CheckAaiForCorrelationIdImplementation.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/implementation/CheckAaiForCorrelationIdImplementation.java
new file mode 100644
index 0000000000..e5fc87db91
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/implementation/CheckAaiForCorrelationIdImplementation.java
@@ -0,0 +1,50 @@
+/*-
+ * ============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.pnf.implementation;
+
+import java.io.IOException;
+import java.util.Optional;
+import org.onap.aai.domain.yang.Pnf;
+
+public class CheckAaiForCorrelationIdImplementation {
+
+ public AaiResponse check(String correlationId, AaiConnection aaiConnection) throws IOException {
+ Optional pnf = aaiConnection.getEntryFor(correlationId);
+ if (!pnf.isPresent()) {
+ return AaiResponse.NO_ENTRY;
+ }
+
+ if(extractIp(pnf.get()).isPresent()) {
+ return AaiResponse.ENTRY_WITH_IP;
+ } else {
+ return AaiResponse.ENTRY_NO_IP;
+ }
+ }
+
+ private Optional extractIp(Pnf pnf) {
+ if (pnf.getIpaddressV4Oam() != null) {
+ return Optional.of(pnf.getIpaddressV4Oam());
+ } else {
+ return Optional.ofNullable(pnf.getIpaddressV6Oam());
+ }
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/properties/BPMNProperties.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/properties/BPMNProperties.java
new file mode 100644
index 0000000000..60f109a81f
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/properties/BPMNProperties.java
@@ -0,0 +1,46 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Huawei 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.properties;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.onap.so.bpmn.core.UrnPropertiesReader;
+import org.onap.so.logger.MsoLogger;
+
+public class BPMNProperties {
+
+ public static String getProperty(String key, String defaultValue) {
+ String value = UrnPropertiesReader.getVariable(key);
+ if (value == null) {
+ return defaultValue;
+ } else {
+ return value;
+ }
+ }
+
+ public static List getResourceSequenceProp(String input) {
+ String resourceSequence = getProperty("mso.workflow.custom." + input + ".resource.sequence", null);
+ if (resourceSequence != null) {
+ return Arrays.asList(resourceSequence.split(","));
+ }
+ return null;
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/LocationConstraint.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/LocationConstraint.java
new file mode 100644
index 0000000000..e3c6dce2af
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/LocationConstraint.java
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 CMCC 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.vfcmodel;
+
+
+/**
+ *
+ *
+ *
+ *
+ * @author
+ * @version ONAP Amsterdam Release 2017-9-6
+ */
+public class LocationConstraint {
+
+ /**
+ * vnf profile id
+ */
+ private String vnfProfileId;
+
+ /**
+ * location constraints: vimId
+ */
+ private VimLocation locationConstraints;
+
+ /**
+ * @return Returns the vnfProfileId.
+ */
+ public String getVnfProfileId() {
+ return vnfProfileId;
+ }
+
+ /**
+ * @param vnfProfileId The vnfProfileId to set.
+ */
+ public void setVnfProfileId(String vnfProfileId) {
+ this.vnfProfileId = vnfProfileId;
+ }
+
+
+ /**
+ * @return Returns the locationConstraints.
+ */
+ public VimLocation getLocationConstraints() {
+ return locationConstraints;
+ }
+
+
+ /**
+ * @param locationConstraints The locationConstraints to set.
+ */
+ public void setLocationConstraints(VimLocation locationConstraints) {
+ this.locationConstraints = locationConstraints;
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NSResourceInputParameter.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NSResourceInputParameter.java
new file mode 100644
index 0000000000..ae320bdfb0
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NSResourceInputParameter.java
@@ -0,0 +1,116 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 CMCC 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.vfcmodel;
+
+
+import org.onap.so.logger.MsoLogger;
+
+
+/**
+ * NS Create Input Parameter For VFC Adapter
+ *
+ *
+ *
+ * @version ONAP Beijing Release 2018/2/5
+ */
+public class NSResourceInputParameter {
+
+ private NsOperationKey nsOperationKey;
+
+ private String nsServiceName;
+
+ private String nsServiceDescription;
+
+ private NsParameters nsParameters;
+
+ private NsScaleParameters nsScaleParameters;
+
+
+
+
+ /**
+ * @return Returns the nsServiceName.
+ */
+ public String getNsServiceName() {
+ return nsServiceName;
+ }
+
+
+ /**
+ * @param nsServiceName The nsServiceName to set.
+ */
+ public void setNsServiceName(String nsServiceName) {
+ this.nsServiceName = nsServiceName;
+ }
+
+
+ /**
+ * @return Returns the nsServiceDescription.
+ */
+ public String getNsServiceDescription() {
+ return nsServiceDescription;
+ }
+
+
+ /**
+ * @param nsServiceDescription The nsServiceDescription to set.
+ */
+ public void setNsServiceDescription(String nsServiceDescription) {
+ this.nsServiceDescription = nsServiceDescription;
+ }
+
+ /**
+ * @return Returns the nsParameters.
+ */
+ public NsParameters getNsParameters() {
+ return nsParameters;
+ }
+
+ /**
+ * @param nsParameters The nsParameters to set.
+ */
+ public void setNsParameters(NsParameters nsParameters) {
+ this.nsParameters = nsParameters;
+ }
+
+ public NsOperationKey getNsOperationKey() {
+ return nsOperationKey;
+ }
+
+ public void setNsOperationKey(NsOperationKey nsOperationKey) {
+ this.nsOperationKey = nsOperationKey;
+ }
+
+ /**
+ * @return Returns the nsScaleParameters.
+ */
+ public NsScaleParameters getNsScaleParameters() {
+ return nsScaleParameters;
+ }
+
+ /**
+ * @param nsScaleParameters The nsScaleParameters to set.
+ */
+ public void setNsScaleParameters(NsScaleParameters nsScaleParameters) {
+ this.nsScaleParameters = nsScaleParameters;
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsOperationKey.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsOperationKey.java
new file mode 100644
index 0000000000..81826a27eb
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsOperationKey.java
@@ -0,0 +1,141 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 CMCC 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.vfcmodel;
+
+
+/**
+ * The operation key object for NS
+ *
+ *
+ *
+ *
+ * @author
+ * @version ONAP Amsterdam Release 2017-09-15
+ */
+public class NsOperationKey {
+
+ /**
+ * The subscriber id
+ */
+ private String globalSubscriberId;
+
+ /**
+ * The serviceType
+ */
+ private String serviceType;
+
+ /**
+ * The service ID
+ */
+ private String serviceId;
+
+ /**
+ * The Operation ID
+ */
+ private String operationId;
+
+ /**
+ * the NS template uuid
+ */
+ private String nodeTemplateUUID;
+
+ /**
+ * @return Returns the globalSubscriberId.
+ */
+ public String getGlobalSubscriberId() {
+ return globalSubscriberId;
+ }
+
+ /**
+ * @param globalSubscriberId The globalSubscriberId to set.
+ */
+ public void setGlobalSubscriberId(String globalSubscriberId) {
+ this.globalSubscriberId = globalSubscriberId;
+ }
+
+ /**
+ * @return Returns the serviceType.
+ */
+ public String getServiceType() {
+ return serviceType;
+ }
+
+ /**
+ * @param serviceType The serviceType to set.
+ */
+ public void setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ }
+
+ /**
+ *
+ *
+ * @return
+ * @since ONAP Amsterdam Release
+ */
+ public String getServiceId() {
+ return serviceId;
+ }
+
+ /**
+ *
+ *
+ * @param serviceId
+ * @since ONAP Amsterdam Release
+ */
+ public void setServiceId(String serviceId) {
+ this.serviceId = serviceId;
+ }
+
+ /**
+ *
+ *
+ * @return
+ * @since ONAP Amsterdam Release
+ */
+ public String getOperationId() {
+ return operationId;
+ }
+
+ /**
+ *
+ *
+ * @param operationId
+ * @since ONAP Amsterdam Release
+ */
+ public void setOperationId(String operationId) {
+ this.operationId = operationId;
+ }
+
+ /**
+ * @return Returns the nodeTemplateUUID.
+ */
+ public String getNodeTemplateUUID() {
+ return nodeTemplateUUID;
+ }
+
+ /**
+ * @param nodeTemplateUUID The nodeTemplateUUID to set.
+ */
+ public void setNodeTemplateUUID(String nodeTemplateUUID) {
+ this.nodeTemplateUUID = nodeTemplateUUID;
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java
new file mode 100644
index 0000000000..0d8f2fcbd7
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 CMCC 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.vfcmodel;
+
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ *
+ *
+ *
+ * @author
+ * @version ONAP Amsterdam Release 2017-9-6
+ */
+public class NsParameters {
+
+ private List locationConstraints;
+
+ private Map additionalParamForNs = new HashMap();
+ /**
+ * @return Returns the locationConstraints.
+ */
+ public List getLocationConstraints() {
+ return locationConstraints;
+ }
+
+ /**
+ * @param locationConstraints The locationConstraints to set.
+ */
+ public void setLocationConstraints(List locationConstraints) {
+ this.locationConstraints = locationConstraints;
+ }
+
+
+ /**
+ * @return Returns the additionalParamForNs.
+ */
+ public Map getAdditionalParamForNs() {
+ return additionalParamForNs;
+ }
+
+
+ /**
+ * @param additionalParamForNs The additionalParamForNs to set.
+ */
+ public void setAdditionalParamForNs(Map additionalParamForNs) {
+ this.additionalParamForNs = additionalParamForNs;
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsScaleParameters.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsScaleParameters.java
new file mode 100644
index 0000000000..3340176646
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsScaleParameters.java
@@ -0,0 +1,78 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 CMCC 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.vfcmodel;
+
+import java.util.List;
+
+/**
+ *
+ *
+ *
+ *
+ * @author
+ * @version ONAP Amsterdam Release 2017-9-26
+ */
+public class NsScaleParameters {
+
+ private List scaleNsByStepsData;
+
+ private String scaleType;
+
+
+ private String nsInstanceId;
+
+ /**
+ * @return Returns the scaleNsByStepsData.
+ */
+ public List getScaleNsByStepsData() {
+ return scaleNsByStepsData;
+ }
+
+ /**
+ * @param scaleNsByStepsData The scaleNsByStepsData to set.
+ */
+ public void setScaleNsByStepsData(List scaleNsByStepsData) {
+ this.scaleNsByStepsData = scaleNsByStepsData;
+ }
+
+ /**
+ * @return Returns the scale Type.
+ */
+ public String getScaleType() {
+ return scaleType;
+ }
+
+ /**
+ * @param scaleType The scaleType to set.
+ */
+ public void setScaleType(String scaleType) {
+ this.scaleType = scaleType;
+ }
+
+ public String getNsInstanceId() {
+ return nsInstanceId;
+ }
+
+ public void setNsInstanceId(String nsInstanceId) {
+ this.nsInstanceId = nsInstanceId;
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/ScaleNsByStepsData.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/ScaleNsByStepsData.java
new file mode 100644
index 0000000000..bbf189ac7a
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/ScaleNsByStepsData.java
@@ -0,0 +1,91 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 CMCC 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.vfcmodel;
+
+
+
+/**
+ *
+ *
+ *
+ *
+ * @author
+ * @version ONAP Amsterdam Release 2017-9-26
+ */
+public class ScaleNsByStepsData {
+
+ /**
+ * scaling Direction
+ */
+ private String scalingDirection;
+
+ /**
+ * aspect ID
+ */
+ private String aspectId;
+
+ /**
+ * number of Steps
+ */
+ private int numberOfSteps;
+
+ /**
+ * @return Returns the scalingDirection.
+ */
+ public String getScalingDirection() {
+ return scalingDirection;
+ }
+
+ /**
+ * @param scalingDirection The scalingDirection to set.
+ */
+ public void setScalingDirection(String scalingDirection) {
+ this.scalingDirection = scalingDirection;
+ }
+
+ /**
+ * @return Returns the aspectId.
+ */
+ public String getAspectId() {
+ return aspectId;
+ }
+
+ /**
+ * @param aspectId The aspectId to set.
+ */
+ public void setAspectId(String aspectId) {
+ this.aspectId = aspectId;
+ }
+
+ /**
+ * @return Returns the numberofSteps.
+ */
+ public int getNumberOfSteps() {
+ return numberOfSteps;
+ }
+
+ /**
+ * @param numberOfSteps The numberofSteps to set.
+ */
+ public void setNumberOfSteps(int numberOfSteps) {
+ this.numberOfSteps = numberOfSteps;
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/ScaleNsData.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/ScaleNsData.java
new file mode 100644
index 0000000000..0f72045f4e
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/ScaleNsData.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 CMCC. 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.vfcmodel;
+
+
+public class ScaleNsData {
+
+ private ScaleNsByStepsData scaleNsByStepsData;
+
+ public ScaleNsByStepsData getScaleNsByStepsData() {
+ return scaleNsByStepsData;
+ }
+
+ public void setScaleNsByStepsData(ScaleNsByStepsData scaleNsByStepsData) {
+ this.scaleNsByStepsData = scaleNsByStepsData;
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/ScaleResource.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/ScaleResource.java
new file mode 100644
index 0000000000..4791338aab
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/ScaleResource.java
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 CMCC. 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.vfcmodel;
+
+
+public class ScaleResource {
+
+ private String resourceInstanceId;
+
+ private String scaleType;
+
+ private ScaleNsData scaleNsData;
+
+ public String getResourceInstanceId() {
+ return resourceInstanceId;
+ }
+
+ public void setResourceInstanceId(String resourceInstanceId) {
+ this.resourceInstanceId = resourceInstanceId;
+ }
+
+ public String getScaleType() {
+ return scaleType;
+ }
+
+ public void setScaleType(String scaleType) {
+ this.scaleType = scaleType;
+ }
+
+ public ScaleNsData getScaleNsData() {
+ return scaleNsData;
+ }
+
+ public void setScaleNsData(ScaleNsData scaleNsData) {
+ this.scaleNsData = scaleNsData;
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/VimLocation.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/VimLocation.java
new file mode 100644
index 0000000000..970fa43d9f
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/VimLocation.java
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 CMCC. 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.vfcmodel;
+
+
+/**
+ *
+ *
+ *
+ *
+ *
+ * @author
+ * @version ONAP Amsterdam Release 2017-10-18
+ */
+public class VimLocation {
+ private String vimId;
+
+
+ /**
+ * @return Returns the vimId.
+ */
+ public String getVimId() {
+ return vimId;
+ }
+
+
+ /**
+ * @param vimId The vimId to set.
+ */
+ public void setVimId(String vimId) {
+ this.vimId = vimId;
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java
new file mode 100644
index 0000000000..3c4a35737b
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java
@@ -0,0 +1,350 @@
+/*-
+ * ============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.workflow.serviceTask;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.json.JSONObject;
+import org.onap.msb.sdk.discovery.common.RouteException;
+import org.onap.msb.sdk.httpclient.RestServiceCreater;
+import org.onap.msb.sdk.httpclient.msb.MSBServiceClient;
+import org.onap.so.bpmn.core.BaseTask;
+import org.onap.so.bpmn.core.UrnPropertiesReader;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.GenericResourceApi;
+import org.onap.so.db.request.beans.ResourceOperationStatus;
+import org.onap.so.logger.MessageEnum;
+import org.onap.so.logger.MsoLogger;
+import org.onap.so.requestsdb.RequestsDbConstant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public abstract class AbstractSdncOperationTask extends BaseTask {
+
+ private static final Logger logger = LoggerFactory.getLogger(AbstractSdncOperationTask.class);
+ protected static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, AbstractSdncOperationTask.class);
+
+ @Autowired
+ private Environment env;
+ private static final String DEFAULT_MSB_IP = "127.0.0.1";
+ private static final int DEFAULT_MSB_PORT = 80;
+ private static final String SDCADAPTOR_INPUTS = "resourceParameters";
+ private static final String TOPOLOGY_PROPERTIES = "topology.properties";
+ public static final String ONAP_IP = "ONAP_IP";
+
+ private static final String POST_BODY_TEMPLATE = "\n"+
+ " \n"+
+ " $errorCode\n"+
+ " $jobId\n"+
+ " $operType\n"+
+ " $operationId\n"+
+ " \n"+
+ " $resourceTemplateUUID\n"+
+ " $serviceId\n"+
+ " $status\n"+
+ " $statusDescription\n"+
+ " ";
+
+ private static final String GET_BODY_TEMPLATE = " \n" +
+ " \n" +
+ " $operationId\n" +
+ " $resourceTemplateUUID\n" +
+ " $serviceId\n" +
+ " ";
+
+
+ private void updateResOperStatus(ResourceOperationStatus resourceOperationStatus) throws RouteException {
+ logger.info("AbstractSdncOperationTask.updateResOperStatus begin!");
+ String requestsdbEndPoint = env.getProperty("mso.adapters.openecomp.db.endpoint");
+ HttpPost httpPost = new HttpPost(requestsdbEndPoint);
+ httpPost.addHeader("Authorization", "Basic QlBFTENsaWVudDpwYXNzd29yZDEk");
+ httpPost.addHeader("Content-type", "application/soap+xml");
+ String postBody = getPostStringBody(resourceOperationStatus);
+ httpPost.setEntity(new StringEntity(postBody, ContentType.APPLICATION_XML));
+ httpPost(requestsdbEndPoint, httpPost);
+ logger.info("AbstractSdncOperationTask.updateResOperStatus end!");
+ }
+
+ protected String getPostbody(Object inputEntity) {
+ ObjectMapper objectMapper = new ObjectMapper();
+ String postBody = null;
+ try {
+ objectMapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
+ postBody = objectMapper.writeValueAsString(inputEntity);
+ } catch (JsonProcessingException e) {
+ logger.error(Arrays.toString(e.getStackTrace()));
+ }
+ return postBody;
+ }
+
+ protected String httpPost(String url, HttpPost httpPost) throws RouteException {
+ logger.info("AbstractSdncOperationTask.httpPost begin!");
+ String result = null;
+
+ String errorMsg;
+ try(CloseableHttpClient httpClient = HttpClients.createDefault()) {
+ CloseableHttpResponse closeableHttpResponse = httpClient.execute(httpPost);
+ result = EntityUtils.toString(closeableHttpResponse.getEntity());
+ logger.info("result = {}", result);
+ if(closeableHttpResponse.getStatusLine().getStatusCode() != 200) {
+ logger.info("exception: fail for status code = {}", closeableHttpResponse.getStatusLine().getStatusCode());
+ throw new RouteException(result, "SERVICE_GET_ERR");
+ }
+
+ closeableHttpResponse.close();
+ } catch (IOException e) {
+ errorMsg = url + ":httpPostWithJSON connect faild";
+ logger.info("exception: POST_CONNECT_FAILD : {}", errorMsg);
+ throwsRouteException(errorMsg, e, "POST_CONNECT_FAILD");
+ }
+
+ logger.info("AbstractSdncOperationTask.httpPost end!");
+ return result;
+ }
+
+ private static void throwsRouteException(String errorMsg, Exception e, String errorCode) throws RouteException {
+ String msg = errorMsg + ".errorMsg:" + e.getMessage();
+ logger.info("exception: {}", msg);
+ throw new RouteException(errorMsg, errorCode);
+ }
+
+ private String getPostStringBody(ResourceOperationStatus resourceOperationStatus) {
+ logger.info("AbstractSdncOperationTask.getPostStringBody begin!");
+ String postBody = POST_BODY_TEMPLATE;
+ postBody = postBody.replace("$errorCode", resourceOperationStatus.getErrorCode());
+ postBody = postBody.replace("$jobId", resourceOperationStatus.getJobId());
+ postBody = postBody.replace("$operType", resourceOperationStatus.getOperType());
+ postBody = postBody.replace("$operationId", resourceOperationStatus.getOperationId());
+ postBody = postBody.replace("$progress", resourceOperationStatus.getProgress());
+ postBody = postBody.replace("$resourceTemplateUUID", resourceOperationStatus.getResourceTemplateUUID());
+ postBody = postBody.replace("$serviceId", resourceOperationStatus.getServiceId());
+ postBody = postBody.replace("$status", resourceOperationStatus.getStatus());
+ postBody = postBody.replace("$statusDescription", resourceOperationStatus.getStatusDescription());
+ logger.info("AbstractSdncOperationTask.getPostStringBody end!");
+ return postBody;
+ }
+
+ private String getGetStringBody(String serviceId, String operationId, String resourceTemplateUUID) {
+ logger.info("AbstractSdncOperationTask.getGetStringBody begin!");
+ String getBody = GET_BODY_TEMPLATE;
+ getBody = getBody.replace("$operationId", operationId);
+ getBody = getBody.replace("$resourceTemplateUUID", resourceTemplateUUID);
+ getBody = getBody.replace("$serviceId", serviceId);
+ logger.info("AbstractSdncOperationTask.getGetStringBody end!");
+ return getBody;
+ }
+
+ private ResourceOperationStatus getResourceOperationStatus(String serviceId, String operationId, String resourceTemplateUUID) throws RouteException {
+ logger.info("AbstractSdncOperationTask.getResourceOperationStatus begin!");
+ String requestsdbEndPoint = env.getProperty("mso.adapters.openecomp.db.endpoint");
+ HttpPost httpPost = new HttpPost(requestsdbEndPoint);
+ httpPost.addHeader("Authorization", "Basic QlBFTENsaWVudDpwYXNzd29yZDEk");
+ httpPost.addHeader("Content-type", "application/soap+xml");
+ String getBody = getGetStringBody(serviceId, operationId, resourceTemplateUUID);
+ httpPost.setEntity(new StringEntity(getBody, ContentType.APPLICATION_XML));
+ String result = httpPost(requestsdbEndPoint, httpPost);
+ ResourceOperationStatus resourceOperationStatus = getResourceOperationStatusFromXmlString(result);
+ logger.info("AbstractSdncOperationTask.getResourceOperationStatus end!");
+ return resourceOperationStatus;
+ }
+
+ private ResourceOperationStatus getResourceOperationStatusFromXmlString(String result) {
+ logger.info("AbstractSdncOperationTask.getResourceOperationStatusFromXmlString begin!");
+ ResourceOperationStatus resourceOperationStatus = new ResourceOperationStatus();
+ resourceOperationStatus.setErrorCode(getValueByName("errorCode", result));
+ resourceOperationStatus.setJobId(getValueByName("jobId", result));
+ resourceOperationStatus.setOperType(getValueByName("operType", result));
+ resourceOperationStatus.setOperationId(getValueByName("operationId", result));
+ resourceOperationStatus.setProgress(getValueByName("progress", result));
+ resourceOperationStatus.setResourceTemplateUUID(getValueByName("resourceTemplateUUID", result));
+ resourceOperationStatus.setServiceId(getValueByName("serviceId", result));
+ resourceOperationStatus.setStatus(getValueByName("status", result));
+ resourceOperationStatus.setStatusDescription(getValueByName("statusDescription", result));
+ logger.info("AbstractSdncOperationTask.getResourceOperationStatusFromXmlString end!");
+ return resourceOperationStatus;
+ }
+
+ private String getValueByName(String name, String xml) {
+ if (!StringUtils.isBlank(xml) && xml.contains(name)) {
+ String start = "<" + name + ">";
+ String end = "" + name + ">";
+ return xml.substring(xml.indexOf(start), xml.indexOf(end)).replace(start, "");
+ }
+ return "";
+ }
+
+ @Override
+ public void execute(DelegateExecution execution) {
+ logger.info("AbstractSdncOperationTask.execute begin!");
+ GenericResourceApi genericResourceApiClient = getGenericResourceApiClient();
+ try {
+ Map inputs = getInputs(execution);
+
+ sendRestrequestAndHandleResponse(execution, inputs, genericResourceApiClient);
+ execution.setVariable("SDNCA_SuccessIndicator", true);
+ } catch (Exception e) {
+ logger.info("exception: AbstractSdncOperationTask.fail!");
+ logger.error("exception: AbstractSdncOperationTask.fail!:", e);
+ logger.error(Arrays.toString(e.getStackTrace()));
+ execution.setVariable("SDNCA_SuccessIndicator", false);
+ updateProgress(execution, RequestsDbConstant.Status.ERROR, null, "100", "sendRestrequestAndHandleResponse finished!");
+
+ }
+ logger.info("AbstractSdncOperationTask.execute end!");
+ }
+
+ protected Map getInputs(DelegateExecution execution) {
+ logger.info("AbstractSdncOperationTask.getInputs begin!");
+ Map inputs = new HashMap<>();
+ String json = (String) execution.getVariable(SDCADAPTOR_INPUTS);
+ if (!StringUtils.isBlank(json)) {
+ JSONObject jsonObject = new JSONObject(json);
+ JSONObject paras = jsonObject.getJSONObject("additionalParamForNs");
+ Iterator iterator = paras.keys();
+ while (iterator.hasNext()) {
+ String key = iterator.next();
+ inputs.put(key, paras.getString(key));
+ }
+ }
+ logger.info("AbstractSdncOperationTask.getInputs end!");
+ return inputs;
+ }
+
+ public abstract void sendRestrequestAndHandleResponse(DelegateExecution execution,
+ Map inputs,
+ GenericResourceApi genericResourceApiClient) throws Exception;
+
+ public void updateProgress(DelegateExecution execution,
+ String status,
+ String errorCode,
+ String progress,
+ String statusDescription) {
+ logger.info("AbstractSdncOperationTask.updateProgress begin!");
+ String serviceId = (String) execution.getVariable("serviceId");
+ serviceId = StringUtils.isBlank(serviceId) ? (String) execution.getVariable("serviceInstanceId") : serviceId;
+ String operationId = (String) execution.getVariable("operationId");
+ String resourceTemplateUUID = (String) execution.getVariable("resourceUUID");
+ String resourceTemplateId = (String) execution.getVariable("resourceTemplateId");
+ resourceTemplateId = StringUtils.isBlank(resourceTemplateId) ? "" : resourceTemplateUUID;
+ resourceTemplateUUID = StringUtils.isBlank(resourceTemplateUUID) ? resourceTemplateId : resourceTemplateUUID;
+ try {
+ ResourceOperationStatus resourceOperationStatus = getResourceOperationStatus(serviceId, operationId, resourceTemplateUUID);
+ if (!StringUtils.isBlank(status)) {
+ resourceOperationStatus.setStatus(status);
+ }
+ if (!StringUtils.isBlank(errorCode)) {
+ resourceOperationStatus.setErrorCode(errorCode);
+ }
+ if (!StringUtils.isBlank(progress)) {
+ resourceOperationStatus.setProgress(progress);
+ }
+ if (!StringUtils.isBlank(statusDescription)) {
+ resourceOperationStatus.setStatusDescription(statusDescription);
+ }
+ updateResOperStatus(resourceOperationStatus);
+ logger.info("AbstractSdncOperationTask.updateProgress end!");
+ } catch (Exception exception) {
+ logger.info("exception: AbstractSdncOperationTask.updateProgress fail!");
+ logger.error("exception: AbstractSdncOperationTask.updateProgress fail:", exception);
+ msoLogger.error(MessageEnum.GENERAL_EXCEPTION, " updateProgress catch exception: ", "", this.getTaskName(), MsoLogger.ErrorCode.UnknownError, exception.getClass().toString());
+ }
+ }
+
+
+ protected boolean isSend2SdncDirectly() {
+ logger.info("AbstractSdncOperationTask.isSend2SdncDirectly begin!");
+ String sdncIp = UrnPropertiesReader.getVariable("sdnc-ip");
+ String sdncPort = UrnPropertiesReader.getVariable("sdnc-port");
+ if (!StringUtils.isBlank(sdncIp) && isIp(sdncIp) && !StringUtils.isBlank(sdncPort)) {
+ logger.info("AbstractSdncOperationTask.isSend2SdncDirectly = true.");
+ return true;
+ }
+
+ logger.info("AbstractSdncOperationTask.isSend2SdncDirectly = false.");
+ return false;
+ }
+
+ protected String getSdncIp() {
+ logger.info("AbstractSdncOperationTask.getSdncIp begin.");
+ String sdncIp = null;
+ sdncIp = UrnPropertiesReader.getVariable("sdnc-ip");
+ String returnIp = StringUtils.isBlank(sdncIp) || !isIp(sdncIp) ? null : sdncIp;
+ logger.info("AbstractSdncOperationTask.getSdncIp: sdncIp = {}", returnIp);
+ return returnIp;
+ }
+
+ protected String getSdncPort() {
+ logger.info("AbstractSdncOperationTask.getSdncPort begin.");
+ String sdncPort = UrnPropertiesReader.getVariable("sdnc-port");
+ String returnPort = StringUtils.isBlank(sdncPort) ? null : sdncPort;
+ logger.info("AbstractSdncOperationTask.getSdncPort: returnPort = {}", sdncPort);
+ return returnPort;
+ }
+
+ private GenericResourceApi getGenericResourceApiClient() {
+ logger.info("AbstractSdncOperationTask.getGenericResourceApiClient begin!");
+ String msbIp = System.getenv().get(ONAP_IP);
+ int msbPort = DEFAULT_MSB_PORT;
+ if (StringUtils.isBlank(msbIp) || !isIp(msbIp)) {
+ msbIp = env.getProperty("msb-ip");
+ if (StringUtils.isBlank(msbIp)) {
+ msbIp = env.getProperty("msb.address", DEFAULT_MSB_IP);
+ }
+ }
+ String strMsbPort = env.getProperty("msb-port");
+ if (StringUtils.isBlank(strMsbPort)) {
+ strMsbPort = env.getProperty("msb.port", String.valueOf(DEFAULT_MSB_PORT));
+ }
+ msbPort = Integer.valueOf(strMsbPort);
+
+ logger.info("AbstractSdncOperationTask.getGenericResourceApiClient msbIp = " + msbIp + " msbPort = " + msbPort);
+ MSBServiceClient msbClient = new MSBServiceClient(msbIp, msbPort);
+ RestServiceCreater restServiceCreater = new RestServiceCreater(msbClient);
+ logger.info("AbstractSdncOperationTask.getGenericResourceApiClient end!");
+ return restServiceCreater.createService(GenericResourceApi.class);
+ }
+
+ protected boolean isIp(String msbIp) {
+ return !StringUtils.isBlank(msbIp) && msbIp.split("\\.").length == 4;
+ }
+
+ public String getProcessKey(DelegateExecution execution) {
+ return execution.getProcessEngineServices().getRepositoryService().getProcessDefinition(execution.getProcessDefinitionId()).getKey();
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java
new file mode 100644
index 0000000000..3ef1410425
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java
@@ -0,0 +1,102 @@
+/*-
+ * ============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.workflow.serviceTask;
+
+import java.util.Map;
+
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.msb.sdk.discovery.common.RouteException;
+import org.onap.so.bpmn.core.WorkflowException;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.GenericResourceApi;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.HeaderUtil;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder.NetworkRpcInputEntityBuilder;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.RpcNetworkTopologyOperationInputEntity;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.RpcNetworkTopologyOperationOutputEntity;
+import org.onap.so.logger.MessageEnum;
+import org.onap.so.requestsdb.RequestsDbConstant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SdncNetworkTopologyOperationTask extends AbstractSdncOperationTask {
+ private static final Logger sdncLogger = LoggerFactory.getLogger(SdncNetworkTopologyOperationTask.class);
+
+
+ private static final String URL = "/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation";
+
+ @Override
+ public void sendRestrequestAndHandleResponse(DelegateExecution execution,
+ Map inputs,
+ GenericResourceApi genericResourceApiClient) throws Exception {
+ sdncLogger.info("SdncNetworkTopologyOperationTask.sendRestrequestAndHandleResponse begin!");
+ updateProgress(execution, RequestsDbConstant.Status.PROCESSING, null, "40", "sendRestrequestAndHandleResponse begin!");
+ NetworkRpcInputEntityBuilder builder = new NetworkRpcInputEntityBuilder();
+ RpcNetworkTopologyOperationInputEntity inputEntity = builder.build(execution, inputs);
+ updateProgress(execution, RequestsDbConstant.Status.PROCESSING, null, "50", "RequestBody build finished!");
+ RpcNetworkTopologyOperationOutputEntity outputEntity;
+ if (!isSend2SdncDirectly()) {
+ outputEntity = genericResourceApiClient.postNetworkTopologyOperation
+ (HeaderUtil.DefaulAuth, inputEntity).execute().body();
+ updateProgress(execution, null, null, "90", "sendRestrequestAndHandleResponse finished!");
+ saveOutput(execution, outputEntity);
+ } else {
+ send2SdncDirectly(HeaderUtil.DefaulAuth, inputEntity);
+ }
+ updateProgress(execution, RequestsDbConstant.Status.FINISHED, null, RequestsDbConstant.Progress.ONE_HUNDRED, "execute finished!");
+ sdncLogger.info("SdncNetworkTopologyOperationTask.sendRestrequestAndHandleResponse end!");
+ }
+
+ private void send2SdncDirectly(String defaulAuth,
+ RpcNetworkTopologyOperationInputEntity inputEntity) throws RouteException {
+ sdncLogger.info("SdncNetworkTopologyOperationTask.send2SdncDirectly begin!");
+ String url = "http://" + getSdncIp() + ":" + getSdncPort() + URL;
+ HttpPost httpPost = new HttpPost(url);
+ httpPost.addHeader("Authorization", defaulAuth);
+ httpPost.addHeader("Content-type", "application/json");
+ String postBody = getPostbody(inputEntity);
+ msoLogger.info(MessageEnum.RA_SEND_REQUEST_SDNC, postBody, "SDNC", "");
+ httpPost.setEntity(new StringEntity(postBody, ContentType.APPLICATION_XML));
+ httpPost(url, httpPost);
+ sdncLogger.info("SdncNetworkTopologyOperationTask.send2SdncDirectly end!");
+ }
+
+ private void saveOutput(DelegateExecution execution, RpcNetworkTopologyOperationOutputEntity output) throws RouteException {
+ sdncLogger.info("SdncNetworkTopologyOperationTask.saveOutput begin!");
+ String responseCode = output.getOutput().getResponseCode();
+ if (!"200".equals(responseCode)) {
+ String processKey = getProcessKey(execution);
+ int errorCode = Integer.parseInt(responseCode);
+ String errorMessage = output.getOutput().getResponseMessage();
+ WorkflowException workflowException = new WorkflowException(processKey, errorCode, errorMessage);
+ execution.setVariable("SDNCA_SuccessIndicator", workflowException);
+ updateProgress(execution, RequestsDbConstant.Status.ERROR, String.valueOf(errorCode), "100", errorMessage);
+ sdncLogger.info("exception: SdncNetworkTopologyOperationTask.saveOutput fail!");
+ throw new RouteException();
+ }
+
+ sdncLogger.info("SdncNetworkTopologyOperationTask.saveOutput end!");
+ }
+
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java
new file mode 100644
index 0000000000..8e41d0d88e
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java
@@ -0,0 +1,101 @@
+/*-
+ * ============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.workflow.serviceTask;
+
+
+import java.util.Map;
+
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.msb.sdk.discovery.common.RouteException;
+import org.onap.so.bpmn.core.WorkflowException;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.GenericResourceApi;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.HeaderUtil;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder.ServiceRpcInputEntityBuilder;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.RpcServiceTopologyOperationInputEntity;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.RpcServiceTopologyOperationOutputEntity;
+import org.onap.so.logger.MessageEnum;
+import org.onap.so.requestsdb.RequestsDbConstant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SdncServiceTopologyOperationTask extends AbstractSdncOperationTask {
+ private static final Logger sdncLogger = LoggerFactory.getLogger(SdncServiceTopologyOperationTask.class);
+
+
+ private static final String URL = "/restconf/operations/GENERIC-RESOURCE-API:service-topology-operation";
+
+ @Override
+ public void sendRestrequestAndHandleResponse(DelegateExecution execution,
+ Map inputs,
+ GenericResourceApi genericResourceApiClient) throws Exception {
+ sdncLogger.info("SdncServiceTopologyOperationTask.sendRestrequestAndHandleResponse begin!");
+ updateProgress(execution, null, null, "40", "sendRestrequestAndHandleResponse begin!");
+ ServiceRpcInputEntityBuilder builder = new ServiceRpcInputEntityBuilder();
+ RpcServiceTopologyOperationInputEntity inputEntity = builder.build(execution, inputs);
+ updateProgress(execution, null, null, "50", "RequestBody build finished!");
+ RpcServiceTopologyOperationOutputEntity outputEntity;
+ if (!isSend2SdncDirectly()) {
+ outputEntity = genericResourceApiClient.postServiceTopologyOperation
+ (HeaderUtil.DefaulAuth, inputEntity).execute().body();
+ updateProgress(execution, null, null, "90", "sendRestrequestAndHandleResponse finished!");
+ saveOutput(execution, outputEntity);
+ } else {
+ send2SdncDirectly(HeaderUtil.DefaulAuth, inputEntity);
+ }
+ sdncLogger.info("SdncServiceTopologyOperationTask.sendRestrequestAndHandleResponse end!");
+
+ }
+
+ private void send2SdncDirectly(String defaulAuth,
+ RpcServiceTopologyOperationInputEntity inputEntity) throws RouteException {
+ sdncLogger.info("SdncServiceTopologyOperationTask.send2SdncDirectly begin!");
+ String url = "http://" + getSdncIp() + ":" + getSdncPort() + URL;
+ HttpPost httpPost = new HttpPost(url);
+ httpPost.addHeader("Authorization", defaulAuth);
+ httpPost.addHeader("Content-type", "application/json");
+ String postBody = getPostbody(inputEntity);
+ msoLogger.info(MessageEnum.RA_SEND_REQUEST_SDNC, postBody, "SDNC", "");
+ httpPost.setEntity(new StringEntity(postBody, ContentType.APPLICATION_XML));
+ httpPost(url, httpPost);
+ sdncLogger.info("SdncServiceTopologyOperationTask.send2SdncDirectly end!");
+ }
+
+ private void saveOutput(DelegateExecution execution, RpcServiceTopologyOperationOutputEntity output) throws Exception {
+ sdncLogger.info("SdncServiceTopologyOperationTask.saveOutput begin!");
+ String responseCode = output.getOutput().getResponseCode();
+ if (!"200".equals(responseCode)) {
+ String processKey = getProcessKey(execution);
+ int errorCode = Integer.parseInt(responseCode);
+ String errorMessage = output.getOutput().getResponseMessage();
+ WorkflowException workflowException = new WorkflowException(processKey, errorCode, errorMessage);
+ execution.setVariable("SDNCA_SuccessIndicator", workflowException);
+ updateProgress(execution, RequestsDbConstant.Status.ERROR, String.valueOf(errorCode), null, errorMessage);
+ sdncLogger.info("exception: SdncServiceTopologyOperationTask.saveOutput fail!");
+ throw new RouteException();
+ }
+ sdncLogger.info("SdncServiceTopologyOperationTask.saveOutput end!");
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java
new file mode 100644
index 0000000000..fd844648fa
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java
@@ -0,0 +1,116 @@
+/*-
+ * ============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.workflow.serviceTask;
+
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.onap.msb.sdk.httpclient.RestServiceCreater;
+import org.onap.msb.sdk.httpclient.msb.MSBServiceClient;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.GenericResourceApi;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.HeaderUtil;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder.NetworkRpcInputEntityBuilder;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.RpcNetworkTopologyOperationInputEntity;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.RpcNetworkTopologyOperationOutputEntity;
+import org.onap.so.db.request.beans.ResourceOperationStatus;
+import org.onap.so.db.request.beans.ResourceOperationStatusId;
+import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository;
+import org.onap.so.logger.MsoLogger;
+import org.onap.so.requestsdb.RequestsDbConstant;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SdncUnderlayVpnOperationClient {
+
+ private static final String DEFAULT_MSB_IP = "127.0.0.1";
+ private static final int DEFAULT_MSB_PORT = 10081;
+
+ private static MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL, SdncUnderlayVpnOperationClient.class);
+
+ public boolean excute(String msbIp,
+ int msbPort,
+ Map inputs,
+ String iServiceID,
+ String iOperationID,
+ String resourceTemplateUUID_i){
+ ResourceOperationStatusId id = new ResourceOperationStatusId(iServiceID, iOperationID, resourceTemplateUUID_i);
+ GenericResourceApi genericResourceApiClient = getGenericResourceApiClient(msbIp, msbPort);
+ updateProgress(id, RequestsDbConstant.Status.PROCESSING, null, "10", "execute begin!");
+ return sendRestrequestAndHandleResponse(id, inputs, genericResourceApiClient);
+ }
+
+ public boolean sendRestrequestAndHandleResponse(ResourceOperationStatusId id, Map inputs, GenericResourceApi genericResourceApiClient){
+ updateProgress(id, null, null, "40", "sendRestrequestAndHandleResponse begin!");
+ NetworkRpcInputEntityBuilder builder = new NetworkRpcInputEntityBuilder();
+ RpcNetworkTopologyOperationInputEntity body = builder.build(null, inputs);
+ updateProgress(id, null, null, "50", "RequestBody build finished!");
+ //RpcNetworkTopologyOperationOutputEntity networkRpcOutputEntiy = null;
+ try {
+ genericResourceApiClient.postNetworkTopologyOperation(HeaderUtil.DefaulAuth ,body).execute().body();
+ } catch (Exception e) {
+ logger.debug("Exception: ", e);
+ updateProgress(id, RequestsDbConstant.Status.ERROR, null, null, "sendRestrequestAndHandleResponse exception:" + e.getMessage());
+ return false;
+ }
+ updateProgress(id, null, null, "90", "sendRestrequestAndHandleResponse finished!");
+ updateProgress(id, RequestsDbConstant.Status.FINISHED, null, RequestsDbConstant.Progress.ONE_HUNDRED, "execute finished!");
+ return true;
+ }
+
+ private GenericResourceApi getGenericResourceApiClient(String msbIp, int msbPort) {
+ if (StringUtils.isBlank(msbIp)) {
+ msbIp = DEFAULT_MSB_IP;
+ }
+ if (msbPort <= 0) {
+ msbPort = DEFAULT_MSB_PORT;
+ }
+ MSBServiceClient msbClient = new MSBServiceClient(msbIp, msbPort);
+ RestServiceCreater restServiceCreater = new RestServiceCreater(msbClient);
+ return restServiceCreater.createService(GenericResourceApi.class);
+ }
+
+ public void updateProgress(ResourceOperationStatusId id, String status,
+ String errorCode,
+ String progress,
+ String statusDescription) {
+
+
+ ResourceOperationStatus resourceOperationStatus = new ResourceOperationStatus();//rosRepo.getOne(id);
+ if (!StringUtils.isBlank(status)) {
+ resourceOperationStatus.setStatus(status);
+ }
+ if (!StringUtils.isBlank(errorCode)) {
+ resourceOperationStatus.setErrorCode(errorCode);
+ }
+ if (!StringUtils.isBlank(progress)) {
+ resourceOperationStatus.setProgress(progress);
+ }
+ if (!StringUtils.isBlank(statusDescription)) {
+ resourceOperationStatus.setStatusDescription(statusDescription);
+ }
+ //rosRepo.save(resourceOperationStatus);
+ }
+
+ private void saveOutput() {
+ // Not implemented.
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java
new file mode 100644
index 0000000000..5bd3297c20
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java
@@ -0,0 +1,51 @@
+/*-
+ * ============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.workflow.serviceTask;
+
+import org.apache.commons.lang3.StringUtils;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.so.bpmn.core.BaseTask;
+import org.onap.so.db.request.beans.ResourceOperationStatus;
+import org.onap.so.db.request.beans.ResourceOperationStatusId;
+import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SdncUnderlayVpnPreprocessTask extends BaseTask {
+ public static final String RESOURCE_OPER_TYPE = "resourceOperType";
+
+ @Override
+ public void execute(DelegateExecution execution) {
+ String operType = getOperType(execution);
+ execution.setVariable(RESOURCE_OPER_TYPE, operType);
+ }
+
+ private String getOperType(DelegateExecution execution) {
+ String serviceId = (String) execution.getVariable("serviceId");
+ serviceId = StringUtils.isBlank(serviceId) ? (String) execution.getVariable("serviceInstanceId") : serviceId;
+ String operationId = (String) execution.getVariable("operationId");
+ String resourceTemplateUUID = (String) execution.getVariable("resourceTemplateUUID");
+ resourceTemplateUUID = StringUtils.isBlank(resourceTemplateUUID) ? (String) execution.getVariable("resourceTemplateId") : resourceTemplateUUID;
+ ResourceOperationStatus resourceOperationStatus = new ResourceOperationStatus();//rosRepo.getOne(new ResourceOperationStatusId(serviceId, operationId, resourceTemplateUUID));
+ return resourceOperationStatus.getOperType();
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/GenericResourceApi.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/GenericResourceApi.java
new file mode 100644
index 0000000000..a837782a2c
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/GenericResourceApi.java
@@ -0,0 +1,48 @@
+/*-
+ * ============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.workflow.serviceTask.client;
+
+import okhttp3.RequestBody;
+import okhttp3.ResponseBody;
+import org.onap.msb.sdk.httpclient.annotaion.ServiceHttpEndPoint;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.*;
+import retrofit2.Call;
+import retrofit2.http.Body;
+import retrofit2.http.Header;
+import retrofit2.http.POST;
+
+@ServiceHttpEndPoint(serviceName = "sdnc", serviceVersion = "v1")
+public interface GenericResourceApi {
+
+ @POST("/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation")
+ Call postNetworkTopologyOperation(@Header("Authorization") String authorization,
+ @Body RequestBody input);
+
+ @POST("/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation")
+ Call postNetworkTopologyOperation(@Header("Authorization") String authorization,
+ @Body RpcNetworkTopologyOperationInputEntity input);
+
+ @POST("/restconf/operations/GENERIC-RESOURCE-API:service-topology-operation")
+ Call postServiceTopologyOperation(@Header("Authorization") String authorization,
+ @Body RpcServiceTopologyOperationInputEntity input);
+
+}
+
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtil.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtil.java
new file mode 100644
index 0000000000..696be02809
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtil.java
@@ -0,0 +1,45 @@
+/*-
+ * ============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.workflow.serviceTask.client;
+
+import java.util.Base64;
+
+public class HeaderUtil {
+
+ public static final String USER = "admin";
+ public static final String PASS = "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U";
+ public static final String DefaulAuth = getAuthorization(USER, PASS);
+
+ public static String getAuthorization(String usr, String pwd) {
+
+ return "Basic " + base64Encode(usr + ":" + pwd);
+ }
+
+ private static String base64Encode(String str) {
+ String base64 = str;
+ try {
+ base64 = Base64.getEncoder()
+ .encodeToString(str.getBytes("utf-8"));
+ } catch (Exception ex) {
+ }
+ return base64;
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java
new file mode 100644
index 0000000000..961b846ace
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java
@@ -0,0 +1,239 @@
+/*-
+ * ============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.workflow.serviceTask.client.builder;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.commons.lang3.StringUtils;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.OnapModelInformationEntity;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.ParamEntity;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.RequestInformationEntity;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.ServiceInformationEntity;
+import org.onap.so.requestsdb.RequestsDbConstant;
+
+public abstract class AbstractBuilder {
+
+ public static final String OPERATION_TYPE = "operationType";
+ public static final String RESOURCE_TYPE = "resourceType";
+
+ public enum RequestAction {
+ CREATE_NETWORK_INSTANCE(0, "CreateNetworkInstance"),
+ ACTIVATE_NETWORK_INSTANCE(1, "ActivateNetworkInstance"),
+ CREATE_SERVICE_INSTANCE(2, "CreateServiceInstance"),
+ DELETE_SERVICE_INSTANCE(3, "DeleteServiceInstance"),
+ DELETE_NETWORK_INSTANCE(4, "DeleteNetworkInstance"),
+ CREATE_VNF_INSTANCE(5, "CreateVnfInstance"),
+ ACTIVATE_VNF_INSTANCE(6, "ActivateVnfInstance"),
+ DELETE_VNF_INSTANCE(7, "DeleteVnfInstance"),
+ CREATE_VF_MODULE_INSTANCE(8, "CreateVfModuleInstance"),
+ ACTIVATE_VF_MODULE_INSTANCE(9, "ActivateVfModuleInstance"),
+ DELETE_VF_MODULE_INSTANCE(10, "DeleteVfModuleInstance"),
+ CREATE_CONTRAIL_ROUTE_INSTANCE(11, "CreateContrailRouteInstance"),
+ DELETE_CONTRAIL_ROUTE_INSTANCE(12, "DeleteContrailRouteInstance"),
+ CREATE_SECURITY_ZONE_INSTANCE(13, "CreateSecurityZoneInstance"),
+ DELETE_SECURITY_ZONE_INSTANCE(14, "DeleteSecurityZoneInstance"),
+ ACTIVATE_DCI_NETWORK_INSTANCE(15, "ActivateDCINetworkInstance"),
+ DEACTIVATE_DCI_NETWORK_INSTANCE(16, "DeActivateDCINetworkInstance");
+
+ String name;
+ int value;
+
+ private RequestAction(int value, String name) {
+ this.value = value;
+ this.name = name;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public int getIntValue() {
+ return this.value;
+ }
+ }
+
+ public enum SvcAction {
+ RESERVE(0, "reserve"),
+ ASSIGN(1, "assign"),
+ ACTIVATE(2, "activate"),
+ DELETE(3, "delete"),
+ CHANGEASSIGN(4, "changeassign"),
+ CHANGEDELETE(5, "changedelete"),
+ ROLLBACK(6, "rollback"),
+ DEACTIVATE(7, "deactivate"),
+ UNASSIGN(8, "unassign"),
+ CREATE(9, "create");
+
+ String name;
+ int value;
+
+ private SvcAction(int value, String name) {
+ this.value = value;
+ this.name = name;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public int getIntValue() {
+ return this.value;
+ }
+ }
+
+ protected String requestId = null;
+
+ abstract O build(DelegateExecution execution, I input) throws Exception;
+
+ protected String getRequestAction(DelegateExecution execution) {
+ String action = /*RequestInformation.*/RequestAction.CREATE_NETWORK_INSTANCE.getName();
+ String operType = (String) execution.getVariable(OPERATION_TYPE);
+ String resourceType = (String)execution.getVariable(RESOURCE_TYPE);
+ if (!StringUtils.isBlank(operType)) {
+ if (RequestsDbConstant.OperationType.DELETE.equalsIgnoreCase(operType)) {
+ if (isOverlay(resourceType)) {
+ action = /*RequestInformation.*/RequestAction.DEACTIVATE_DCI_NETWORK_INSTANCE.getName();
+ } else if (isUnderlay(resourceType)) {
+ action = /*RequestInformation.*/RequestAction.DELETE_NETWORK_INSTANCE.getName();
+ } else {
+ action = /*RequestInformation.*/RequestAction.DELETE_SERVICE_INSTANCE.getName();
+ }
+ } else if (RequestsDbConstant.OperationType.CREATE.equalsIgnoreCase(operType)) {
+ if (isOverlay(resourceType)) {
+ action = /*RequestInformation.*/RequestAction.ACTIVATE_DCI_NETWORK_INSTANCE.getName();
+ } else if (isUnderlay(resourceType)) {
+ action = /*RequestInformation.*/RequestAction.CREATE_NETWORK_INSTANCE.getName();
+ } else {
+ action = /*RequestInformation.*/RequestAction.CREATE_SERVICE_INSTANCE.getName();
+ }
+ }
+ }
+ return action;
+ }
+
+ private boolean isOverlay(String resourceType) {
+ return !StringUtils.isBlank(resourceType) && resourceType.toLowerCase().contains("overlay");
+ }
+
+ private boolean isUnderlay(String resourceType) {
+ return !StringUtils.isBlank(resourceType) && resourceType.toLowerCase().contains("underlay");
+ }
+
+ protected String getSvcAction(DelegateExecution execution) {
+ String action = /*SdncRequestHeader.*/SvcAction.CREATE.getName();
+ String operType = (String) execution.getVariable(OPERATION_TYPE);
+ String resourceType = (String)execution.getVariable(RESOURCE_TYPE);
+ if (!StringUtils.isBlank(operType)) {
+ if (RequestsDbConstant.OperationType.DELETE.equalsIgnoreCase(operType)) {
+ if (isOverlay(resourceType)) {
+ action = /*SdncRequestHeader.*/SvcAction.DEACTIVATE.getName();
+ } else if (isUnderlay(resourceType)) {
+ action = /*SdncRequestHeader.*/SvcAction.DELETE.getName();
+ } else {
+ action = /*SdncRequestHeader.*/SvcAction.UNASSIGN.getName();
+ }
+ } else if (RequestsDbConstant.OperationType.CREATE.equalsIgnoreCase(operType)) {
+ if (isOverlay(resourceType)) {
+ action = /*SdncRequestHeader.*/SvcAction.ACTIVATE.getName();
+ } else if (isUnderlay(resourceType)) {
+ action = /*SdncRequestHeader.*/SvcAction.CREATE.getName();
+ } else {
+ action = /*SdncRequestHeader.*/SvcAction.ASSIGN.getName();
+ }
+ }
+ }
+ return action;
+ }
+
+ protected synchronized String getRequestId(DelegateExecution execution) {
+ if (StringUtils.isBlank(requestId)) {
+ requestId = (String) execution.getVariable("msoRequestId");
+ if (StringUtils.isBlank(requestId)) {
+ requestId = UUID.randomUUID().toString();
+ }
+ }
+ return requestId;
+ }
+
+ protected OnapModelInformationEntity getOnapServiceModelInformationEntity(DelegateExecution execution) {
+ OnapModelInformationEntity onapModelInformationEntity = new OnapModelInformationEntity();
+ String modelInvariantUuid = (String) execution.getVariable("modelInvariantUuid");
+ String modelVersion = (String) execution.getVariable("modelVersion");
+ String modelUuid = (String) execution.getVariable("modelUuid");
+ String modelName = (String) execution.getVariable("serviceModelName");
+ onapModelInformationEntity.setModelInvariantUuid(modelInvariantUuid);
+ onapModelInformationEntity.setModelVersion(modelVersion);
+ onapModelInformationEntity.setModelUuid(modelUuid);
+ onapModelInformationEntity.setModelName(modelName);
+ return onapModelInformationEntity;
+ }
+
+ protected OnapModelInformationEntity getOnapNetworkModelInformationEntity(DelegateExecution execution) {
+ OnapModelInformationEntity onapModelInformationEntity = new OnapModelInformationEntity();
+ String modelInvariantUuid = (String) execution.getVariable("resourceInvariantUUID");
+ String modelVersion = (String) execution.getVariable("modelVersion");
+ String modelUuid = (String) execution.getVariable("resourceUUID");
+ String modelName = (String) execution.getVariable(RESOURCE_TYPE);
+ onapModelInformationEntity.setModelInvariantUuid(modelInvariantUuid);
+ onapModelInformationEntity.setModelVersion(modelVersion);
+ onapModelInformationEntity.setModelUuid(modelUuid);
+ onapModelInformationEntity.setModelName(modelName);
+ return onapModelInformationEntity;
+ }
+
+ protected List getParamEntities(Map inputs) {
+ List paramEntityList = new ArrayList<>();
+ if (inputs != null && !inputs.isEmpty()) {
+ inputs.keySet().forEach(key -> {
+ ParamEntity paramEntity = new ParamEntity();
+ paramEntity.setName(key);
+ paramEntity.setValue(inputs.get(key));
+ paramEntityList.add(paramEntity);
+ });
+ }
+ return paramEntityList;
+ }
+
+ protected RequestInformationEntity getRequestInformationEntity(DelegateExecution execution) {
+ RequestInformationEntity requestInformationEntity = new RequestInformationEntity();
+ requestInformationEntity.setRequestId(getRequestId(execution));
+ requestInformationEntity.setRequestAction(getRequestAction(execution));
+ return requestInformationEntity;
+ }
+
+ protected ServiceInformationEntity getServiceInformationEntity(DelegateExecution execution) {
+ ServiceInformationEntity serviceInformationEntity = new ServiceInformationEntity();
+ serviceInformationEntity.setServiceId((String) execution.getVariable("serviceInstanceId"));
+ serviceInformationEntity.setSubscriptionServiceType((String) execution.getVariable("serviceType"));
+ serviceInformationEntity.setOnapModelInformation(getOnapServiceModelInformationEntity(execution));
+ serviceInformationEntity.setServiceInstanceId((String) execution.getVariable("serviceInstanceId"));
+ serviceInformationEntity.setGlobalCustomerId((String) execution.getVariable("globalSubscriberId"));
+ return serviceInformationEntity;
+ }
+
+ protected String getServiceInstanceName(DelegateExecution execution) {
+ return (String) execution.getVariable("serviceInstanceName");
+ }
+}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilder.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilder.java
new file mode 100644
index 0000000000..547df2bb3a
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilder.java
@@ -0,0 +1,90 @@
+/*-
+ * ============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.workflow.serviceTask.client.builder;
+
+import java.util.List;
+import java.util.Map;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.NetworkInformationEntity;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.NetworkInputParametersEntity;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.NetworkRequestInputEntity;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.NetworkTopologyOperationInputEntity;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.OnapModelInformationEntity;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.ParamEntity;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.RequestInformationEntity;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.RpcNetworkTopologyOperationInputEntity;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.SdncRequestHeaderEntity;
+import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.entity.ServiceInformationEntity;
+
+public class NetworkRpcInputEntityBuilder extends AbstractBuilder