Merge changes I4e542ffd,Ibb86da2d
authorSeshu Kumar M <seshu.kumar.m@huawei.com>
Fri, 10 Nov 2017 04:49:49 +0000 (04:49 +0000)
committerGerrit Code Review <gerrit@onap.org>
Fri, 10 Nov 2017 04:49:49 +0000 (04:49 +0000)
* changes:
  Fix Null Point Exception
  Fix Delete workflow sent msg to vfc adatper failed

161 files changed:
.gitignore
bpmn/MSOCommonBPMN/pom.xml
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/MSOCommonApplication.java [deleted file]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/ProcessEngineAwareService.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/SDNCAdapterCallbackServiceImpl.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResourceApplication.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/PreconditionFailedException.java [moved from bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java with 70% similarity]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/ResponseExceptionMapper.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/ResponseExceptionMapperImpl.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/RestProperties.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/RestPropertiesLoader.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/Consumer.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DefaultDmaapPropertiesImpl.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapClient.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapConsumer.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapProperties.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPropertiesLoader.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPublisher.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/Publisher.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/exceptions/DMaaPConsumerFailure.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/exceptions/ExceededMaximumPollingTime.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/DMaaPRestClient.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/PropertiesBean.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/RestConsumer.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/RestPublisher.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyRestClient.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyRestProperties.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/RestClient.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/entities/PolicyServiceType.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidator.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidatorImpl.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/Body.java [moved from bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Body.java with 97% similarity]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/Input.java [moved from bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Input.java with 95% similarity]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/RequestHealthDiagnostic.java [moved from bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/RequestHealthDiagnostic.java with 98% similarity]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/ResultInfo.java [moved from bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/ResultInfo.java with 95% similarity]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/beans/SDNO.java [moved from bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNO.java with 86% similarity]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/dmaap/SDNOHealthCheckDmaapConsumer.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/dmaap/SDNOHealthCheckDmaapPublisher.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/main/resources/META-INF/processes.xml
bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/applicationContext.xml [deleted file]
bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml [deleted file]
bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-web.xml [deleted file]
bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/web.xml [deleted file]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/FileUtil.java [moved from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/FileUtil.java with 100% similarity]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResource.java [moved from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/MockResource.java with 100% similarity]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/MockResourceApplication.java [moved from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/MockResourceApplication.java with 100% similarity]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/SDNCAdapterMockTransformer.java [moved from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterMockTransformer.java with 100% similarity]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/SDNCAdapterNetworkTopologyMockTransformer.java [moved from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/SDNCAdapterNetworkTopologyMockTransformer.java with 100% similarity]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java [moved from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseAAI.java with 97% similarity]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseDatabase.java [moved from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseDatabase.java with 100% similarity]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseNetworkAdapter.java [moved from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseNetworkAdapter.java with 100% similarity]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponsePolicy.java [moved from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponsePolicy.java with 97% similarity]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseSDNCAdapter.java [moved from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseSDNCAdapter.java with 100% similarity]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseSNIRO.java [moved from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseSNIRO.java with 97% similarity]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseVNFAdapter.java [moved from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/StubResponseVNFAdapter.java with 100% similarity]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterCreateMockTransformer.java [moved from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterCreateMockTransformer.java with 100% similarity]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterDeleteMockTransformer.java [moved from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterDeleteMockTransformer.java with 100% similarity]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterQueryMockTransformer.java [moved from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterQueryMockTransformer.java with 100% similarity]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterRollbackMockTransformer.java [moved from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterRollbackMockTransformer.java with 100% similarity]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/VnfAdapterUpdateMockTransformer.java [moved from bpmn/MSOMockServer/src/main/java/org/openecomp/mso/bpmn/mock/VnfAdapterUpdateMockTransformer.java with 100% similarity]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/policy/PolicyDecisionTest.java [deleted file]
bpmn/MSOInfrastructureBPMN/pom.xml
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnfAndModules.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy
bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowAsyncInfrastructureResource.java [deleted file]
bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java
bpmn/MSOInfrastructureBPMN/src/main/resources/META-INF/processes.xml
bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn
bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteVcpeResCustService.bpmn
bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceBRG.bpmn
bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceTXC.bpmn
bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstanceTest.groovy [new file with mode: 0644]
bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceTest.groovy [new file with mode: 0644]
bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustServiceTest.groovy
bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy
bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGTest.groovy
bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCTest.groovy
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/CreateVcpeResCustServiceTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceBRGTest.java
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/vcpe/DoCreateAllottedResourceTXCTest.java
bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/SDNCTopologyQueryTXCCallback.xml
bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml
bpmn/MSOInfrastructureBPMN/src/test/resources/mso.bpmn.urn.properties
bpmn/MSOMockServer/.gitignore [deleted file]
bpmn/MSOMockServer/WebContent/META-INF/MANIFEST.MF [deleted file]
bpmn/MSOMockServer/WebContent/WEB-INF/jboss-deployment-structure.xml [deleted file]
bpmn/MSOMockServer/WebContent/WEB-INF/web.xml [deleted file]
bpmn/MSOMockServer/pom.xml [deleted file]
bpmn/MSOMockServer/src/main/resources/__files/sdncSimResponse.xml [deleted file]
bpmn/MSOMockServer/src/main/webapp/WEB-INF/jboss-web.xml [deleted file]
bpmn/pom.xml
docs/BPMN_Main_Process_Flows.rst [new file with mode: 0644]
docs/BPMN_Project_Deployment_Strategy.rst [new file with mode: 0644]
docs/BPMN_Project_Structure.rst [new file with mode: 0644]
docs/BPMN_Subprocess_Process_Flows.rst [new file with mode: 0644]
docs/Building_SO.rst [new file with mode: 0644]
docs/Camunda_Cockpit_Community_Edition.rst [new file with mode: 0644]
docs/Camunda_Cockpit_Enterprise_Edition.rst [new file with mode: 0644]
docs/Camunda_Modeler.rst [new file with mode: 0644]
docs/Configure_git_and_gerrit.rst [new file with mode: 0644]
docs/Developer_Info.rst [new file with mode: 0644]
docs/Install_Configure_SO.rst
docs/Install_Docker.rst [new file with mode: 0644]
docs/SO_API_v0.1.pdf [new file with mode: 0644]
docs/SO_R1_Interface.rst [new file with mode: 0644]
docs/UUI-SO_API_Specification_v0.1.docx [moved from docs/UUI-SO API Specification v0.1(1).docx with 96% similarity]
docs/Working_with_SO_Docker.rst [new file with mode: 0644]
docs/Workspace_and_Development_Tools.rst [new file with mode: 0644]
docs/architecture.rst
docs/developer_information.rst [new file with mode: 0644]
docs/images/BPMN_Main_Process_Flows_1.png [new file with mode: 0644]
docs/images/BPMN_Subprocess_process_flows_1.png [new file with mode: 0644]
docs/images/Camunda_Cockpit_1.png [new file with mode: 0644]
docs/images/Camunda_Cockpit_2.png [new file with mode: 0644]
docs/images/Camunda_Cockpit_3.png [new file with mode: 0644]
docs/images/Camunda_Cockpit_4.png [new file with mode: 0644]
docs/images/Camunda_Cockpit_Enterprise_1.png [new file with mode: 0644]
docs/images/Configure_git_1.png [new file with mode: 0644]
docs/images/Configure_git_2.png [new file with mode: 0644]
docs/images/Configure_git_3.png [new file with mode: 0644]
docs/images/Configure_ubuntu_SO_1.png [new file with mode: 0644]
docs/images/Configure_ubuntu_SO_2.png [new file with mode: 0644]
docs/images/Configure_ubuntu_SO_3.png [new file with mode: 0644]
docs/images/Configure_ubuntu_SO_4.png [new file with mode: 0644]
docs/images/Configure_ubuntu_SO_5.png [new file with mode: 0644]
docs/images/Configure_ubuntu_SO_6.png [new file with mode: 0644]
docs/images/Configure_ubuntu_SO_7.png [new file with mode: 0644]
docs/images/Configure_ubuntu_SO_8.png [new file with mode: 0644]
docs/images/Configure_ubuntu_SO_9.png [new file with mode: 0644]
docs/images/Docker_install_1.png [new file with mode: 0644]
docs/images/SO_Architecture_1.png [new file with mode: 0644]
docs/images/SO_R1_1.png [new file with mode: 0644]
docs/images/Workspace_and_Development_Tools.png [new file with mode: 0644]
docs/images/Workspace_and_Development_Tools_2.png [new file with mode: 0644]
docs/images/Workspace_and_Development_Tools_3.png [new file with mode: 0644]
docs/images/Workspace_and_Development_Tools_4.png [new file with mode: 0644]
docs/images/bpmn_project_structure_1.png [new file with mode: 0644]
docs/images/bpmn_project_structure_2.png [new file with mode: 0644]
docs/images/bpmn_project_structure_3.png [new file with mode: 0644]
docs/images/bpmn_project_structure_4.png [new file with mode: 0644]
docs/images/bpmn_project_structure_5.png [new file with mode: 0644]
docs/images/camunda_modeler_1.png [new file with mode: 0644]
docs/index.rst
docs/installation.rst
docs/offered_consumed_apis.rst
docs/release-notes.rst
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/serviceinstancebeans/RequestInfo.java
packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/soapui/SoapUiITCase.java
packages/deliveries/src/main/assembly/war-pack/mso-wars.xml

index 04bad35..958c3e2 100644 (file)
@@ -4,6 +4,7 @@ target
 .project
 .buildpath
 .idea
+.checkstyle
 *.iml
 **/logs/
 **/debug-logs/
index e5becbf..c0e6574 100644 (file)
-<?xml version="1.0"?>\r
-<project\r
-       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"\r
-       xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
-       <modelVersion>4.0.0</modelVersion>\r
-       <parent>\r
-               <groupId>org.openecomp.so</groupId>\r
-               <artifactId>bpmn</artifactId>\r
-               <version>1.1.0-SNAPSHOT</version>\r
-       </parent>\r
-       <artifactId>MSOCommonBPMN</artifactId>\r
-       <name>MSOCommonBPMN</name>\r
-       <packaging>war</packaging>\r
-\r
-       <properties>\r
-               <camunda.version>7.6.0</camunda.version>\r
-               <spring.version>4.3.2.RELEASE</spring.version>\r
-               <httpclient.version>3.1</httpclient.version>\r
-               <jax.ws.rs>2.0.1</jax.ws.rs>\r
-               <jackson.version>1.1.1</jackson.version>\r
-               <maven.compiler.target>1.8</maven.compiler.target>\r
-               <maven.compiler.source>1.8</maven.compiler.source>\r
-       </properties>\r
-\r
-\r
-       <build>\r
-               <plugins>\r
-                       <plugin>\r
-                               <groupId>org.apache.maven.plugins</groupId>\r
-                               <artifactId>maven-compiler-plugin</artifactId>\r
-                               <executions>\r
-                                       <execution>\r
-                                               <id>test-compile</id>\r
-                                               <phase>compile</phase>\r
-                                               <goals>\r
-                                                       <goal>testCompile</goal>\r
-                                               </goals>\r
-                                               <configuration>\r
-                                                       <skip>false</skip>\r
-                                               </configuration>\r
-                                       </execution>\r
-                               </executions>\r
-                       </plugin>\r
-\r
-                       <plugin>\r
-                               <groupId>org.apache.maven.plugins</groupId>\r
-                               <artifactId>maven-jar-plugin</artifactId>\r
-                               <version>2.6</version>\r
-                               <executions>\r
-                                       <execution>\r
-                                               <!-- Build MSOCommonBPMN-${version}.jar -->\r
-                                               <id>default-jar</id>\r
-                                               <phase>package</phase>\r
-                                               <goals>\r
-                                                       <goal>jar</goal>\r
-                                               </goals>\r
-                                               <configuration>\r
-                                                       <excludes>\r
-                                                               <exclude>org/openecomp/mso/bpmn/common/MSOCommonApplication.class</exclude>\r
-                                                               <!-- <exclude>META-INF/</exclude> -->\r
-                                                       </excludes>\r
-                                               </configuration>\r
-                                       </execution>\r
-                                       <execution>\r
-                                               <goals>\r
-                                                       <goal>test-jar</goal>\r
-                                               </goals>\r
-                                               <configuration>\r
-                                                       <forceCreation>true</forceCreation>\r
-                                                       <skip>false</skip>\r
-                                               </configuration>\r
-                                       </execution>\r
-                               </executions>\r
-                       </plugin>\r
-                       <plugin>\r
-                               <groupId>org.codehaus.mojo</groupId>\r
-                               <artifactId>build-helper-maven-plugin</artifactId>\r
-                               <version>3.0.0</version>\r
-                               <executions>\r
-                                       <execution>\r
-                                               <goals>\r
-                                                       <goal>attach-artifact</goal>\r
-                                               </goals>\r
-                                               <phase>package</phase>\r
-                                               <configuration>\r
-                                                       <artifacts>\r
-                                                               <artifact>\r
-                                                                       <file>${project.build.directory}/${project.artifactId}-${project.version}.jar</file>\r
-                                                                       <type>jar</type>\r
-                                                               </artifact>\r
-                                                       </artifacts>\r
-                                               </configuration>\r
-                                       </execution>\r
-                               </executions>\r
-                       </plugin>\r
-\r
-                       <plugin>\r
-                               <groupId>org.apache.maven.plugins</groupId>\r
-                               <artifactId>maven-war-plugin</artifactId>\r
-                               <version>2.3</version>\r
-                               <configuration>\r
-                                       <failOnMissingWebXml>false</failOnMissingWebXml>\r
-                               </configuration>\r
-                       </plugin>\r
-                       <plugin>\r
-                               <groupId>org.apache.cxf</groupId>\r
-                               <artifactId>cxf-codegen-plugin</artifactId>\r
-                               <version>2.5.2</version>\r
-                       </plugin>\r
-                       <plugin>\r
-                               <groupId>org.apache.maven.plugins</groupId>\r
-                               <artifactId>maven-eclipse-plugin</artifactId>\r
-                               <version>2.8</version>\r
-                               <configuration>\r
-                                       <additionalProjectnatures>\r
-                                               <projectnature>org.eclipse.jdt.groovy.core.groovyNature</projectnature>\r
-                                       </additionalProjectnatures>\r
-                                       <sourceIncludes>\r
-                                               <sourceInclude>**/*.groovy</sourceInclude>\r
-                                       </sourceIncludes>\r
-                               </configuration>\r
-                       </plugin>\r
-                       <plugin>\r
-                               <artifactId>maven-antrun-plugin</artifactId>\r
-                               <executions>\r
-                                       <execution>\r
-                                               <id>compile</id>\r
-                                               <phase>compile</phase>\r
-                                               <configuration>\r
-                                                       <tasks>\r
-                                                               <mkdir dir="${basedir}/src/main/groovy" />\r
-                                                               <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc">\r
-                                                                       <classpath refid="maven.compile.classpath" />\r
-                                                               </taskdef>\r
-                                                               <mkdir dir="${project.build.outputDirectory}" />\r
-                                                               <groovyc destdir="${project.build.outputDirectory}"\r
-                                                                       srcdir="${basedir}/src/main/groovy/" listfiles="true">\r
-                                                                       <classpath refid="maven.compile.classpath" />\r
-                                                               </groovyc>\r
-                                                       </tasks>\r
-                                               </configuration>\r
-                                               <goals>\r
-                                                       <goal>run</goal>\r
-                                               </goals>\r
-                                       </execution>\r
-                                       <execution>\r
-                                               <id>test-compile</id>\r
-                                               <phase>test-compile</phase>\r
-                                               <configuration>\r
-                                                       <tasks>\r
-                                                               <mkdir dir="${basedir}/src/test/groovy" />\r
-                                                               <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc">\r
-                                                                       <classpath refid="maven.test.classpath" />\r
-                                                               </taskdef>\r
-                                                               <mkdir dir="${project.build.testOutputDirectory}" />\r
-                                                               <groovyc destdir="${project.build.testOutputDirectory}"\r
-                                                                       srcdir="${basedir}/src/test/groovy/" listfiles="true">\r
-                                                                       <classpath refid="maven.test.classpath" />\r
-                                                               </groovyc>\r
-                                                       </tasks>\r
-                                               </configuration>\r
-                                               <goals>\r
-                                                       <goal>run</goal>\r
-                                               </goals>\r
-                                       </execution>\r
-                               </executions>\r
-                       </plugin>\r
-                       <plugin>\r
-                               <groupId>org.codehaus.mojo</groupId>\r
-                               <artifactId>jaxb2-maven-plugin</artifactId>\r
-                               <version>2.3</version>\r
-                               <executions>\r
-                                       <execution>\r
-                                               <id>xjc</id>\r
-                                               <goals>\r
-                                                       <goal>xjc</goal>\r
-                                               </goals>\r
-                                       </execution>\r
-                               </executions>\r
-                               <configuration>\r
-                                       <extension>true</extension>\r
-                                       <arguments>\r
-                                               <argument>-Xannotate</argument>\r
-                                               <argument>-Xcommons-lang</argument>\r
-                                       </arguments>\r
-                                       <sources>\r
-                                               <source>src/main/resources/xsd</source>\r
-                                       </sources>\r
-                                       <xjbSources>\r
-                                               <xjbSource>src/main/resources/xjb</xjbSource>\r
-                                       </xjbSources>\r
-                                       <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>\r
-                               </configuration>\r
-                               <dependencies>\r
-                                       <dependency>\r
-                                               <groupId>org.jvnet.jaxb2_commons</groupId>\r
-                                               <artifactId>jaxb2-basics-annotate</artifactId>\r
-                                               <version>0.6.4</version>\r
-                                       </dependency>\r
-                                       <dependency>\r
-                                               <groupId>org.jvnet.jaxb2_commons</groupId>\r
-                                               <artifactId>jaxb2-commons-lang</artifactId>\r
-                                               <version>2.3</version>\r
-                                       </dependency>\r
-                                       <dependency>\r
-                                               <groupId>com.sun.codemodel</groupId>\r
-                                               <artifactId>codemodel</artifactId>\r
-                                               <version>2.6</version>\r
-                                       </dependency>\r
-                               </dependencies>\r
-                       </plugin>\r
-               </plugins>\r
-               <pluginManagement>\r
-                       <plugins>\r
-                               <!--This plugin's configuration is used to store Eclipse m2e settings \r
-                                       only. It has no influence on the Maven build itself. -->\r
-                               <plugin>\r
-                                       <groupId>org.eclipse.m2e</groupId>\r
-                                       <artifactId>lifecycle-mapping</artifactId>\r
-                                       <version>1.0.0</version>\r
-                                       <configuration>\r
-                                               <lifecycleMappingMetadata>\r
-                                                       <pluginExecutions>\r
-                                                               <pluginExecution>\r
-                                                                       <pluginExecutionFilter>\r
-                                                                               <groupId>\r
-                                                                                       org.apache.maven.plugins\r
-                                                                               </groupId>\r
-                                                                               <artifactId>\r
-                                                                                       maven-antrun-plugin\r
-                                                                               </artifactId>\r
-                                                                               <versionRange>\r
-                                                                                       [1.3,)\r
-                                                                               </versionRange>\r
-                                                                               <goals>\r
-                                                                                       <goal>run</goal>\r
-                                                                               </goals>\r
-                                                                       </pluginExecutionFilter>\r
-                                                                       <action>\r
-                                                                               <ignore></ignore>\r
-                                                                       </action>\r
-                                                               </pluginExecution>\r
-                                                       </pluginExecutions>\r
-                                               </lifecycleMappingMetadata>\r
-                                       </configuration>\r
-                               </plugin>\r
-\r
-\r
-                       </plugins>\r
-               </pluginManagement>\r
-       </build>\r
-\r
-       <dependencies>\r
-\r
-               <dependency>\r
-                       <!-- process engine, in compile scope to include it in the war file -->\r
-                       <groupId>org.camunda.bpm</groupId>\r
-                       <artifactId>camunda-engine</artifactId>\r
-                       <scope>compile</scope>\r
-                       <exclusions>\r
-                               <exclusion>\r
-                                       <groupId>org.slf4j</groupId>\r
-                                       <artifactId>slf4j-api</artifactId>\r
-                               </exclusion>\r
-                       </exclusions>\r
-               </dependency>\r
-               <!-- Using the `DefaultEjbProcessApplication` result in: `java.sql.SQLException: \r
-                       You cannot commit during a managed transaction!` -->\r
-               <dependency>\r
-                       <!-- CDI integration, needs to be included in WAR, otherwise CDI can not \r
-                               work correctly -->\r
-                       <groupId>org.camunda.bpm</groupId>\r
-                       <artifactId>camunda-engine-cdi</artifactId>\r
-               </dependency>\r
-\r
-               <dependency>\r
-                       <groupId>org.camunda.bpm.extension</groupId>\r
-                       <artifactId>camunda-bpm-assert</artifactId>\r
-                       <scope>test</scope>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.mockito</groupId>\r
-                       <artifactId>mockito-all</artifactId>\r
-                       <version>1.10.19</version>\r
-                       <scope>test</scope>\r
-               </dependency>\r
-               \r
-               <!-- Spin dataformat support, in compile scope to include it in the war \r
-                       file -->\r
-               <dependency>\r
-                       <groupId>org.camunda.spin</groupId>\r
-                       <artifactId>camunda-spin-dataformat-all</artifactId>\r
-                       <scope>compile</scope>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.camunda.bpm</groupId>\r
-                       <artifactId>camunda-engine-plugin-spin</artifactId>\r
-                       <scope>compile</scope>\r
-               </dependency>\r
-\r
-               <dependency>\r
-                       <groupId>org.camunda.bpm</groupId>\r
-                       <artifactId>camunda-engine-plugin-connect</artifactId>\r
-                       <scope>compile</scope>\r
-               </dependency>\r
-\r
-               <dependency>\r
-                       <!-- Bootstrap for styling via Webjars project -->\r
-                       <groupId>org.webjars</groupId>\r
-                       <artifactId>bootstrap</artifactId>\r
-                       <version>2.3.2</version>\r
-               </dependency>\r
-\r
-               <dependency>\r
-                       <groupId>org.jboss.resteasy</groupId>\r
-                       <artifactId>resteasy-client</artifactId>\r
-                       <version>3.0.19.Final</version>\r
-                       <scope>provided</scope>\r
-                       <exclusions>\r
-                               <exclusion>\r
-                                       <groupId>org.apache.httpcomponents</groupId>\r
-                                       <artifactId>httpclient</artifactId>\r
-                               </exclusion>\r
-                       </exclusions>\r
-               </dependency>\r
-\r
-               <dependency>\r
-                       <!-- Needed for InMemoryH2Test -->\r
-                       <groupId>com.h2database</groupId>\r
-                       <artifactId>h2</artifactId>\r
-                       <scope>test</scope>\r
-               </dependency>\r
-\r
-               <dependency>\r
-                       <groupId>com.fasterxml.uuid</groupId>\r
-                       <artifactId>java-uuid-generator</artifactId>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.codehaus.groovy</groupId>\r
-                       <artifactId>groovy-all</artifactId>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.apache.commons</groupId>\r
-                       <artifactId>commons-lang3</artifactId>\r
-                       <version>3.4</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.openecomp.so</groupId>\r
-                       <artifactId>MSOCoreBPMN</artifactId>\r
-                       <version>${project.version}</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <!-- unit test utilities -->\r
-                       <groupId>org.openecomp.so</groupId>\r
-                       <artifactId>MSOCoreBPMN</artifactId>\r
-                       <version>${project.version}</version>\r
-                       <classifier>tests</classifier>\r
-                       <scope>test</scope>\r
-               </dependency>\r
-               <dependency>\r
-            <groupId>org.openecomp.so</groupId>\r
-            <artifactId>common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-               <dependency>\r
-                       <groupId>javax.ws.rs</groupId>\r
-                       <artifactId>javax.ws.rs-api</artifactId>\r
-                       <version>2.0</version>\r
-               </dependency>\r
-               <!-- for encoding the url the same way A&AI does -->\r
-               <dependency>\r
-                       <groupId>org.openecomp.so</groupId>\r
-                       <artifactId>MSOMockServer</artifactId>\r
-                       <version>${project.version}</version>\r
-                       <classifier>classes</classifier>\r
-                       <scope>test</scope>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.openecomp.so</groupId>\r
-                       <artifactId>MSORESTClient</artifactId>\r
-                       <version>${project.version}</version>\r
-               </dependency>\r
-\r
-               <dependency>\r
-                       <groupId>javax.servlet</groupId>\r
-                       <artifactId>javax.servlet-api</artifactId>\r
-                       <version>3.0.1</version>\r
-                       <scope>provided</scope>\r
-               </dependency>\r
-\r
-               <dependency>\r
-                       <groupId>org.springframework</groupId>\r
-                       <artifactId>spring-test</artifactId>\r
-                       <version>${spring.version}</version>\r
-               </dependency>\r
-\r
-               <dependency>\r
-                       <groupId>com.github.tomakehurst</groupId>\r
-                       <artifactId>wiremock</artifactId>\r
-                       <version>1.56</version>\r
-                       <scope>test</scope>\r
-                       <classifier>standalone</classifier>\r
-                       <exclusions>\r
-                               <exclusion>\r
-                                       <groupId>org.mortbay.jetty</groupId>\r
-                                       <artifactId>jetty</artifactId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <groupId>com.google.guava</groupId>\r
-                                       <artifactId>guava</artifactId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <groupId>com.fasterxml.jackson.core</groupId>\r
-                                       <artifactId>jackson-core</artifactId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <groupId>com.fasterxml.jackson.core</groupId>\r
-                                       <artifactId>jackson-annotations</artifactId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <groupId>com.fasterxml.jackson.core</groupId>\r
-                                       <artifactId>jackson-databind</artifactId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <groupId>org.apache.httpcomponents</groupId>\r
-                                       <artifactId>httpclient</artifactId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <groupId>org.skyscreamer</groupId>\r
-                                       <artifactId>jsonassert</artifactId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <groupId>xmlunit</groupId>\r
-                                       <artifactId>xmlunit</artifactId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <groupId>com.jayway.jsonpath</groupId>\r
-                                       <artifactId>json-path</artifactId>\r
-                               </exclusion>\r
-                               <exclusion>\r
-                                       <groupId>net.sf.jopt-simple</groupId>\r
-                                       <artifactId>jopt-simple</artifactId>\r
-                               </exclusion>\r
-                       </exclusions>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.camunda.bpm</groupId>\r
-                       <artifactId>camunda-engine-spring</artifactId>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.springframework</groupId>\r
-                       <artifactId>spring-beans</artifactId>\r
-                       <version>4.3.2.RELEASE</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>com.fasterxml.jackson.core</groupId>\r
-                       <artifactId>jackson-annotations</artifactId>\r
-                       <version>2.8.7</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>com.fasterxml.jackson.core</groupId>\r
-                       <artifactId>jackson-core</artifactId>\r
-                       <version>2.8.7</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>com.fasterxml.jackson.module</groupId>\r
-                       <artifactId>jackson-module-jaxb-annotations</artifactId>\r
-                       <version>2.4.0</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.aspectj</groupId>\r
-                       <artifactId>aspectjrt</artifactId>\r
-                       <version>1.6.12</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>commons-httpclient</groupId>\r
-                       <artifactId>commons-httpclient</artifactId>\r
-                       <version>${httpclient.version}</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.openecomp.appc.client</groupId>\r
-                       <artifactId>client-kit</artifactId>\r
-                       <version>1.1.0</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.openecomp.appc.client</groupId>\r
-                       <artifactId>client-lib</artifactId>\r
-                       <version>1.1.0</version>\r
-               </dependency>\r
-               \r
-               <dependency>\r
-                       <groupId>org.onap.aai.aai-common</groupId>\r
-                       <artifactId>aai-schema</artifactId>\r
-                       <version>1.1.0</version>\r
-               </dependency>\r
-               \r
-               \r
-               <dependency>\r
-                       <groupId>com.fasterxml.jackson.core</groupId>\r
-                       <artifactId>jackson-databind</artifactId>\r
-                       <version>2.8.7</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.mockito</groupId>\r
-                       <artifactId>mockito-all</artifactId>\r
-                       <version>1.10.19</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>commons-lang</groupId>\r
-                       <artifactId>commons-lang</artifactId>\r
-                       <version>2.6</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>com.openpojo</groupId>\r
-                       <artifactId>openpojo</artifactId>\r
-                       <version>0.8.6</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>com.jayway.jsonpath</groupId>\r
-                       <artifactId>json-path</artifactId>\r
-                       <version>2.2.0</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.springframework</groupId>\r
-                       <artifactId>spring-web</artifactId>\r
-                       <version>${spring.version}</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.springframework</groupId>\r
-                       <artifactId>spring-test</artifactId>\r
-                       <version>${spring.version}</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>junit</groupId>\r
-                       <artifactId>junit</artifactId>\r
-                       <version>4.12</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>commons-httpclient</groupId>\r
-                       <artifactId>commons-httpclient</artifactId>\r
-                       <version>${httpclient.version}</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>javax.ws.rs</groupId>\r
-                       <artifactId>javax.ws.rs-api</artifactId>\r
-                       <version>${jax.ws.rs}</version>\r
-               </dependency>\r
-\r
-               <dependency>\r
-                       <groupId>org.openecomp.appc.client</groupId>\r
-                       <artifactId>client-kit</artifactId>\r
-                       <version>1.1.0</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.openecomp.appc.client</groupId>\r
-                       <artifactId>client-lib</artifactId>\r
-                       <version>1.1.0</version>\r
-               </dependency>\r
-               \r
-               <dependency>\r
-                       <groupId>com.fasterxml.jackson.core</groupId>\r
-                       <artifactId>jackson-databind</artifactId>\r
-                       <version>2.8.7</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>com.fasterxml.jackson.core</groupId>\r
-                       <artifactId>jackson-annotations</artifactId>\r
-                       <version>2.8.7</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>com.fasterxml.jackson.module</groupId>\r
-                       <artifactId>jackson-module-jaxb-annotations</artifactId>\r
-                       <version>2.4.0</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.aspectj</groupId>\r
-                       <artifactId>aspectjrt</artifactId>\r
-                       <version>1.6.12</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.mockito</groupId>\r
-                       <artifactId>mockito-all</artifactId>\r
-                       <version>1.10.19</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>com.att.nsa</groupId>\r
-                       <artifactId>dmaapClient</artifactId>\r
-                       <version>0.2.12</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <!-- Optional Plugin for Camunda BPM Workbench -->\r
-                       <groupId>org.camunda.bpm.workbench</groupId>\r
-                       <artifactId>camunda-workbench-dist-embeddable</artifactId>\r
-                       <version>1.0.0-alpha8</version>\r
-                       <scope>test</scope>\r
-               </dependency>\r
-               <dependency>\r
-       <groupId>org.jboss.resteasy</groupId>\r
-       <artifactId>resteasy-jackson2-provider</artifactId>\r
-       <version>3.0.11.Final</version>\r
-    </dependency>\r
-                               \r
-       </dependencies>\r
-</project>\r
+<?xml version="1.0"?>
+<project
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+       xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+               <groupId>org.openecomp.so</groupId>
+               <artifactId>bpmn</artifactId>
+               <version>1.1.0-SNAPSHOT</version>
+       </parent>
+       <artifactId>MSOCommonBPMN</artifactId>
+       <name>MSOCommonBPMN</name>
+       <packaging>jar</packaging>
+
+       <properties>
+               <camunda.version>7.6.0</camunda.version>
+               <spring.version>4.3.2.RELEASE</spring.version>
+               <httpclient.version>3.1</httpclient.version>
+               <jax.ws.rs>2.0.1</jax.ws.rs>
+               <jackson.version>1.1.1</jackson.version>
+               <maven.compiler.target>1.8</maven.compiler.target>
+               <maven.compiler.source>1.8</maven.compiler.source>
+       </properties>
+
+       <build>
+               <plugins>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-compiler-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <id>test-compile</id>
+                                               <phase>compile</phase>
+                                               <goals>
+                                                       <goal>testCompile</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <skip>false</skip>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-jar-plugin</artifactId>
+                               <version>3.0.2</version>
+                               <executions>
+                                       <execution>
+                                               <goals>
+                                                       <goal>test-jar</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <skip>false</skip>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.cxf</groupId>
+                               <artifactId>cxf-codegen-plugin</artifactId>
+                               <version>2.5.2</version>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-eclipse-plugin</artifactId>
+                               <version>2.8</version>
+                               <configuration>
+                                       <additionalProjectnatures>
+                                               <projectnature>org.eclipse.jdt.groovy.core.groovyNature</projectnature>
+                                       </additionalProjectnatures>
+                                       <sourceIncludes>
+                                               <sourceInclude>**/*.groovy</sourceInclude>
+                                       </sourceIncludes>
+                               </configuration>
+                       </plugin>
+                       <plugin>
+                               <artifactId>maven-antrun-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <id>compile</id>
+                                               <phase>compile</phase>
+                                               <configuration>
+                                                       <tasks>
+                                                               <mkdir dir="${basedir}/src/main/groovy" />
+                                                               <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc">
+                                                                       <classpath refid="maven.compile.classpath" />
+                                                               </taskdef>
+                                                               <mkdir dir="${project.build.outputDirectory}" />
+                                                               <groovyc destdir="${project.build.outputDirectory}"
+                                                                       srcdir="${basedir}/src/main/groovy/" listfiles="true">
+                                                                       <classpath refid="maven.compile.classpath" />
+                                                               </groovyc>
+                                                       </tasks>
+                                               </configuration>
+                                               <goals>
+                                                       <goal>run</goal>
+                                               </goals>
+                                       </execution>
+                                       <execution>
+                                               <id>test-compile</id>
+                                               <phase>test-compile</phase>
+                                               <configuration>
+                                                       <tasks>
+                                                               <mkdir dir="${basedir}/src/test/groovy" />
+                                                               <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc">
+                                                                       <classpath refid="maven.test.classpath" />
+                                                               </taskdef>
+                                                               <mkdir dir="${project.build.testOutputDirectory}" />
+                                                               <groovyc destdir="${project.build.testOutputDirectory}"
+                                                                       srcdir="${basedir}/src/test/groovy/" listfiles="true">
+                                                                       <classpath refid="maven.test.classpath" />
+                                                               </groovyc>
+                                                       </tasks>
+                                               </configuration>
+                                               <goals>
+                                                       <goal>run</goal>
+                                               </goals>
+                                       </execution>
+                               </executions>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.codehaus.mojo</groupId>
+                               <artifactId>jaxb2-maven-plugin</artifactId>
+                               <version>2.3</version>
+                               <executions>
+                                       <execution>
+                                               <id>xjc</id>
+                                               <goals>
+                                                       <goal>xjc</goal>
+                                               </goals>
+                                       </execution>
+                               </executions>
+                               <configuration>
+                                       <extension>true</extension>
+                                       <arguments>
+                                               <argument>-Xannotate</argument>
+                                               <argument>-Xcommons-lang</argument>
+                                       </arguments>
+                                       <sources>
+                                               <source>src/main/resources/xsd</source>
+                                       </sources>
+                                       <xjbSources>
+                                               <xjbSource>src/main/resources/xjb</xjbSource>
+                                       </xjbSources>
+                                       <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
+                               </configuration>
+                               <dependencies>
+                                       <dependency>
+                                               <groupId>org.jvnet.jaxb2_commons</groupId>
+                                               <artifactId>jaxb2-basics-annotate</artifactId>
+                                               <version>0.6.4</version>
+                                       </dependency>
+                                       <dependency>
+                                               <groupId>org.jvnet.jaxb2_commons</groupId>
+                                               <artifactId>jaxb2-commons-lang</artifactId>
+                                               <version>2.3</version>
+                                       </dependency>
+                                       <dependency>
+                                               <groupId>com.sun.codemodel</groupId>
+                                               <artifactId>codemodel</artifactId>
+                                               <version>2.6</version>
+                                       </dependency>
+                               </dependencies>
+                       </plugin>
+               </plugins>
+               <pluginManagement>
+                       <plugins>
+                               <!--This plugin's configuration is used to store Eclipse m2e settings 
+                                       only. It has no influence on the Maven build itself. -->
+                               <plugin>
+                                       <groupId>org.eclipse.m2e</groupId>
+                                       <artifactId>lifecycle-mapping</artifactId>
+                                       <version>1.0.0</version>
+                                       <configuration>
+                                               <lifecycleMappingMetadata>
+                                                       <pluginExecutions>
+                                                               <pluginExecution>
+                                                                       <pluginExecutionFilter>
+                                                                               <groupId>
+                                                                                       org.apache.maven.plugins
+                                                                               </groupId>
+                                                                               <artifactId>
+                                                                                       maven-antrun-plugin
+                                                                               </artifactId>
+                                                                               <versionRange>
+                                                                                       [1.3,)
+                                                                               </versionRange>
+                                                                               <goals>
+                                                                                       <goal>run</goal>
+                                                                               </goals>
+                                                                       </pluginExecutionFilter>
+                                                                       <action>
+                                                                               <ignore></ignore>
+                                                                       </action>
+                                                               </pluginExecution>
+                                                       </pluginExecutions>
+                                               </lifecycleMappingMetadata>
+                                       </configuration>
+                               </plugin>
+                       </plugins>
+               </pluginManagement>
+       </build>
+
+       <dependencies>
+               <dependency>
+                       <groupId>org.camunda.bpm</groupId>
+                       <artifactId>camunda-engine</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.camunda.bpm</groupId>
+                       <artifactId>camunda-engine-cdi</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.camunda.bpm.extension</groupId>
+                       <artifactId>camunda-bpm-assert</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.mockito</groupId>
+                       <artifactId>mockito-all</artifactId>
+                       <version>1.10.19</version>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.camunda.spin</groupId>
+                       <artifactId>camunda-spin-dataformat-all</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.camunda.bpm</groupId>
+                       <artifactId>camunda-engine-plugin-spin</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.camunda.bpm</groupId>
+                       <artifactId>camunda-engine-plugin-connect</artifactId>
+               </dependency>
+               <dependency>
+                       <!-- Bootstrap for styling via Webjars project -->
+                       <groupId>org.webjars</groupId>
+                       <artifactId>bootstrap</artifactId>
+                       <version>2.3.2</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.jboss.resteasy</groupId>
+                       <artifactId>resteasy-client</artifactId>
+                       <version>3.0.19.Final</version>
+               </dependency>
+               <dependency>
+                       <!-- Needed for InMemoryH2Test -->
+                       <groupId>com.h2database</groupId>
+                       <artifactId>h2</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>com.fasterxml.uuid</groupId>
+                       <artifactId>java-uuid-generator</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.codehaus.groovy</groupId>
+                       <artifactId>groovy-all</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.commons</groupId>
+                       <artifactId>commons-lang3</artifactId>
+                       <version>3.4</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.openecomp.so</groupId>
+                       <artifactId>MSOCoreBPMN</artifactId>
+                       <version>${project.version}</version>
+               </dependency>
+               <dependency>
+                       <!-- unit test utilities -->
+                       <groupId>org.openecomp.so</groupId>
+                       <artifactId>MSOCoreBPMN</artifactId>
+                       <version>${project.version}</version>
+                       <classifier>tests</classifier>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.openecomp.so</groupId>
+                       <artifactId>common</artifactId>
+                       <version>${project.version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>javax.ws.rs</groupId>
+                       <artifactId>javax.ws.rs-api</artifactId>
+                       <version>2.0</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.openecomp.so</groupId>
+                       <artifactId>MSORESTClient</artifactId>
+                       <version>${project.version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>javax.servlet</groupId>
+                       <artifactId>javax.servlet-api</artifactId>
+                       <version>3.0.1</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.springframework</groupId>
+                       <artifactId>spring-test</artifactId>
+                       <version>${spring.version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>com.github.tomakehurst</groupId>
+                       <artifactId>wiremock</artifactId>
+                       <version>1.56</version>
+                       <scope>test</scope>
+                       <classifier>standalone</classifier>
+                       <exclusions>
+                               <exclusion>
+                                       <groupId>org.mortbay.jetty</groupId>
+                                       <artifactId>jetty</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>com.google.guava</groupId>
+                                       <artifactId>guava</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>com.fasterxml.jackson.core</groupId>
+                                       <artifactId>jackson-core</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>com.fasterxml.jackson.core</groupId>
+                                       <artifactId>jackson-annotations</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>com.fasterxml.jackson.core</groupId>
+                                       <artifactId>jackson-databind</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.apache.httpcomponents</groupId>
+                                       <artifactId>httpclient</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>org.skyscreamer</groupId>
+                                       <artifactId>jsonassert</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>xmlunit</groupId>
+                                       <artifactId>xmlunit</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>com.jayway.jsonpath</groupId>
+                                       <artifactId>json-path</artifactId>
+                               </exclusion>
+                               <exclusion>
+                                       <groupId>net.sf.jopt-simple</groupId>
+                                       <artifactId>jopt-simple</artifactId>
+                               </exclusion>
+                       </exclusions>
+               </dependency>
+               <dependency>
+                       <groupId>org.camunda.bpm</groupId>
+                       <artifactId>camunda-engine-spring</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.springframework</groupId>
+                       <artifactId>spring-beans</artifactId>
+                       <version>4.3.2.RELEASE</version>
+               </dependency>
+               <dependency>
+                       <groupId>com.fasterxml.jackson.core</groupId>
+                       <artifactId>jackson-annotations</artifactId>
+                       <version>2.8.7</version>
+               </dependency>
+               <dependency>
+                       <groupId>com.fasterxml.jackson.core</groupId>
+                       <artifactId>jackson-core</artifactId>
+                       <version>2.8.7</version>
+               </dependency>
+               <dependency>
+                       <groupId>com.fasterxml.jackson.module</groupId>
+                       <artifactId>jackson-module-jaxb-annotations</artifactId>
+                       <version>2.4.0</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.aspectj</groupId>
+                       <artifactId>aspectjrt</artifactId>
+                       <version>1.6.12</version>
+               </dependency>
+               <dependency>
+                       <groupId>commons-httpclient</groupId>
+                       <artifactId>commons-httpclient</artifactId>
+                       <version>${httpclient.version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.openecomp.appc.client</groupId>
+                       <artifactId>client-kit</artifactId>
+                       <version>1.1.0</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.openecomp.appc.client</groupId>
+                       <artifactId>client-lib</artifactId>
+                       <version>1.1.0</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.onap.aai.aai-common</groupId>
+                       <artifactId>aai-schema</artifactId>
+                       <version>1.1.0</version>
+               </dependency>
+               <dependency>
+                       <groupId>com.fasterxml.jackson.core</groupId>
+                       <artifactId>jackson-databind</artifactId>
+                       <version>2.8.7</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.mockito</groupId>
+                       <artifactId>mockito-all</artifactId>
+                       <version>1.10.19</version>
+               </dependency>
+               <dependency>
+                       <groupId>commons-lang</groupId>
+                       <artifactId>commons-lang</artifactId>
+                       <version>2.6</version>
+               </dependency>
+               <dependency>
+                       <groupId>com.openpojo</groupId>
+                       <artifactId>openpojo</artifactId>
+                       <version>0.8.6</version>
+               </dependency>
+               <dependency>
+                       <groupId>com.jayway.jsonpath</groupId>
+                       <artifactId>json-path</artifactId>
+                       <version>2.2.0</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.springframework</groupId>
+                       <artifactId>spring-web</artifactId>
+                       <version>${spring.version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.springframework</groupId>
+                       <artifactId>spring-test</artifactId>
+                       <version>${spring.version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>junit</groupId>
+                       <artifactId>junit</artifactId>
+                       <version>4.12</version>
+               </dependency>
+               <dependency>
+                       <groupId>commons-httpclient</groupId>
+                       <artifactId>commons-httpclient</artifactId>
+                       <version>${httpclient.version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>javax.ws.rs</groupId>
+                       <artifactId>javax.ws.rs-api</artifactId>
+                       <version>${jax.ws.rs}</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.openecomp.appc.client</groupId>
+                       <artifactId>client-kit</artifactId>
+                       <version>1.1.0</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.openecomp.appc.client</groupId>
+                       <artifactId>client-lib</artifactId>
+                       <version>1.1.0</version>
+               </dependency>
+               <dependency>
+                       <groupId>com.fasterxml.jackson.core</groupId>
+                       <artifactId>jackson-databind</artifactId>
+                       <version>2.8.7</version>
+               </dependency>
+               <dependency>
+                       <groupId>com.fasterxml.jackson.core</groupId>
+                       <artifactId>jackson-annotations</artifactId>
+                       <version>2.8.7</version>
+               </dependency>
+               <dependency>
+                       <groupId>com.fasterxml.jackson.module</groupId>
+                       <artifactId>jackson-module-jaxb-annotations</artifactId>
+                       <version>2.4.0</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.aspectj</groupId>
+                       <artifactId>aspectjrt</artifactId>
+                       <version>1.6.12</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.mockito</groupId>
+                       <artifactId>mockito-all</artifactId>
+                       <version>1.10.19</version>
+               </dependency>
+               <dependency>
+                       <groupId>com.att.nsa</groupId>
+                       <artifactId>dmaapClient</artifactId>
+                       <version>0.2.12</version>
+               </dependency>
+               <dependency>
+                       <!-- Optional Plugin for Camunda BPM Workbench -->
+                       <groupId>org.camunda.bpm.workbench</groupId>
+                       <artifactId>camunda-workbench-dist-embeddable</artifactId>
+                       <version>1.0.0-alpha8</version>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.jboss.resteasy</groupId>
+                       <artifactId>resteasy-jackson2-provider</artifactId>
+                       <version>3.0.11.Final</version>
+               </dependency>
+               <dependency>
+                       <groupId>com.google.guava</groupId>
+                       <artifactId>guava</artifactId>
+                       <version>22.0</version>
+               </dependency>
+       </dependencies>
+</project>
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/MSOCommonApplication.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/MSOCommonApplication.java
deleted file mode 100644 (file)
index 3e8fd6e..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-package org.openecomp.mso.bpmn.common;\r
-/*-\r
- * ============LICENSE_START=======================================================\r
- * ONAP - SO\r
- * ================================================================================\r
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
- * ================================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ============LICENSE_END=========================================================\r
- */\r
-\r
-\r
-\r
-import java.util.List;\r
-\r
-import org.camunda.bpm.application.PostDeploy;\r
-import org.camunda.bpm.application.PreUndeploy;\r
-import org.camunda.bpm.application.ProcessApplication;\r
-import org.camunda.bpm.application.ProcessApplicationInfo;\r
-import org.camunda.bpm.application.impl.ServletProcessApplication;\r
-import org.camunda.bpm.engine.ProcessEngine;\r
-\r
-import org.openecomp.mso.logger.MsoLogger;\r
-\r
-/**\r
- * @since Version 1.0\r
- *\r
- */\r
-@ProcessApplication(name="MSO Common Application", deploymentDescriptors={"../processes.xml"})\r
-public class MSOCommonApplication extends ServletProcessApplication {\r
-       \r
-       private MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);\r
-       \r
-       @PostDeploy\r
-       public void postDeploy(ProcessEngine processEngineInstance) {\r
-               long startTime = System.currentTimeMillis();\r
-               \r
-               msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Post deployment complete...");               \r
-       }\r
-       \r
-       @PreUndeploy\r
-       public void cleanup(ProcessEngine processEngine, ProcessApplicationInfo processApplicationInfo, List<ProcessEngine> processEngines) {\r
-               long startTime = System.currentTimeMillis();\r
-               \r
-               msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Pre Undeploy complete...");  \r
-               \r
-       }\r
-       \r
-}\r
index c0be899..d65311d 100644 (file)
@@ -26,8 +26,6 @@ import java.util.List;
 import java.util.Map;\r
 \r
 import org.camunda.bpm.engine.MismatchingMessageCorrelationException;\r
-import org.camunda.bpm.engine.ProcessEngineServices;\r
-import org.camunda.bpm.engine.ProcessEngines;\r
 import org.camunda.bpm.engine.RuntimeService;\r
 import org.camunda.bpm.engine.runtime.Execution;\r
 import org.camunda.bpm.engine.runtime.MessageCorrelationResult;\r
@@ -38,7 +36,7 @@ import org.openecomp.mso.logger.MsoLogger;
 /**\r
  * Abstract base class for callback services.\r
  */\r
-public abstract class AbstractCallbackService {\r
+public abstract class AbstractCallbackService extends ProcessEngineAwareService {\r
        public static final long DEFAULT_TIMEOUT_SECONDS = 60;\r
        public static final long FAST_POLL_DUR_SECONDS = 5;\r
        public static final long FAST_POLL_INT_MS = 100;\r
@@ -46,8 +44,6 @@ public abstract class AbstractCallbackService {
        \r
        private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);\r
 \r
-       protected volatile ProcessEngineServices pes4junit = null;\r
-       \r
        /**\r
         * Parameterized callback handler.\r
         */\r
@@ -368,16 +364,4 @@ public abstract class AbstractCallbackService {
                                + ":" + execution.getId() + "]";\r
                }\r
        }\r
-       \r
-       protected ProcessEngineServices getProcessEngineServices() {\r
-               if (pes4junit == null) {\r
-                       return ProcessEngines.getProcessEngine("infrastructure");\r
-               } else {\r
-                       return pes4junit;\r
-               }\r
-       }\r
-\r
-       public void setProcessEngineServices4junit(ProcessEngineServices pes) {\r
-               pes4junit = pes;\r
-       }\r
 }
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/ProcessEngineAwareService.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/ProcessEngineAwareService.java
new file mode 100644 (file)
index 0000000..dbb6674
--- /dev/null
@@ -0,0 +1,64 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.bpmn.common.workflow.service;
+
+import java.util.Optional;
+
+import org.camunda.bpm.engine.ProcessEngineServices;
+import org.camunda.bpm.engine.ProcessEngines;
+
+/**
+ * Base class for services that must be process-engine aware. The only
+ * process engine currently supported is the "default" process engine.
+ */
+public class ProcessEngineAwareService {
+       
+       private final String processEngineName = "default";
+       private volatile Optional<ProcessEngineServices> pes4junit = Optional.empty();
+       
+       /**
+        * Gets the process engine name.
+        * @return the process engine name
+        */
+       public String getProcessEngineName() {
+               return processEngineName;
+       }
+
+       /**
+        * Gets process engine services.
+        * @return process engine services
+        */
+       public ProcessEngineServices getProcessEngineServices() {
+               return pes4junit.orElse(ProcessEngines.getProcessEngine(
+                               getProcessEngineName()));
+       }
+
+       /**
+        * Allows a particular process engine to be specified, overriding the
+        * usual process engine lookup by name.  Intended primarily for the
+        * unit test environment.
+        * @param pes process engine services
+        */
+       public void setProcessEngineServices4junit(ProcessEngineServices pes) {
+               pes4junit = Optional.ofNullable(pes);
+       }
+}
index 2186e07..c5f0d02 100644 (file)
@@ -20,9 +20,6 @@
 \r
 package org.openecomp.mso.bpmn.common.workflow.service;\r
 \r
-import java.util.HashMap;\r
-import java.util.Map;\r
-\r
 import javax.jws.WebMethod;\r
 import javax.jws.WebParam;\r
 import javax.jws.WebResult;\r
@@ -30,16 +27,9 @@ import javax.jws.WebService;
 import javax.ws.rs.core.Context;\r
 import javax.xml.ws.WebServiceContext;\r
 \r
-import org.camunda.bpm.BpmPlatform;\r
-import org.camunda.bpm.engine.MismatchingMessageCorrelationException;\r
-import org.camunda.bpm.engine.ProcessEngineServices;\r
-import org.camunda.bpm.engine.RuntimeService;\r
-import org.camunda.bpm.engine.runtime.ExecutionQuery;\r
 import org.openecomp.mso.bpmn.common.adapter.sdnc.SDNCAdapterCallbackRequest;\r
 import org.openecomp.mso.bpmn.common.adapter.sdnc.SDNCAdapterResponse;\r
 import org.openecomp.mso.bpmn.common.adapter.sdnc.SDNCCallbackAdapterPortType;\r
-import org.openecomp.mso.bpmn.core.PropertyConfiguration;\r
-import org.openecomp.mso.logger.MessageEnum;\r
 import org.openecomp.mso.logger.MsoLogger;\r
 \r
 /**\r
index 99909b6..608adcf 100644 (file)
@@ -53,7 +53,7 @@ import org.slf4j.MDC;
  * For asynchronous process - the activity may send a acknowledgement response and then proceed further on executing the process\r
  */\r
 @Path("/async")\r
-public abstract class WorkflowAsyncResource {\r
+public class WorkflowAsyncResource extends ProcessEngineAwareService {\r
 \r
        private static final WorkflowContextHolder contextHolder = WorkflowContextHolder.getInstance();\r
        protected Optional<ProcessEngineServices> pes4junit = Optional.empty();\r
@@ -274,12 +274,6 @@ public abstract class WorkflowAsyncResource {
        }\r
        \r
        \r
-       protected abstract ProcessEngineServices getProcessEngineServices();\r
-       \r
-       public void setProcessEngineServices4junit(ProcessEngineServices pes) {\r
-               pes4junit = Optional.ofNullable(pes);\r
-       }\r
-\r
        private static Map<String, Object> getInputVariables(VariableMapImpl variableMap) {\r
                Map<String, Object> inputVariables = new HashMap<>();\r
                @SuppressWarnings("unchecked")\r
index 0521fb4..76ff221 100644 (file)
@@ -39,7 +39,6 @@ import javax.ws.rs.core.UriInfo;
 import org.camunda.bpm.engine.HistoryService;\r
 import org.camunda.bpm.engine.ProcessEngineException;\r
 import org.camunda.bpm.engine.ProcessEngineServices;\r
-import org.camunda.bpm.engine.ProcessEngines;\r
 import org.camunda.bpm.engine.RuntimeService;\r
 import org.camunda.bpm.engine.history.HistoricVariableInstance;\r
 import org.camunda.bpm.engine.runtime.ProcessInstance;\r
@@ -53,10 +52,8 @@ import org.openecomp.mso.logger.MsoLogger;
 import org.slf4j.MDC;\r
 \r
 @Path("/workflow")\r
-public class WorkflowResource {\r
+public class WorkflowResource extends ProcessEngineAwareService {\r
        \r
-       private ProcessEngineServices pes4junit = null;\r
-\r
        private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);\r
        private static final String LOGMARKER = "[WRKFLOW-RESOURCE]";\r
 \r
@@ -615,16 +612,4 @@ public class WorkflowResource {
                \r
                return response;\r
        }\r
-\r
-       private ProcessEngineServices getProcessEngineServices() {\r
-               if (pes4junit == null) {\r
-                       return ProcessEngines.getProcessEngine("infrastructure");\r
-               } else {\r
-                       return pes4junit;\r
-               }\r
-       }\r
-\r
-       public void setProcessEngineServices4junit(ProcessEngineServices pes) {\r
-               pes4junit = pes;\r
-       }\r
 }\r
index 4f99edd..193b8fe 100644 (file)
@@ -26,23 +26,12 @@ import java.util.Set;
 import javax.ws.rs.ApplicationPath;\r
 import javax.ws.rs.core.Application;\r
 \r
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowMessageResource;\r
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResource;\r
-\r
-/**\r
- * @version 1.0\r
- * RESTeasy workflow application which wires synchronous and asynchronous response\r
- *\r
- */\r
 @ApplicationPath("/")\r
 public class WorkflowResourceApplication extends Application {\r
     private Set<Object> singletons = new HashSet<Object>();\r
     private Set<Class<?>> classes = new HashSet<Class<?>>();\r
 \r
     public WorkflowResourceApplication() {\r
-        singletons.add(new WorkflowResource());\r
-        singletons.add(new WorkflowAsyncCommonResource());\r
-        singletons.add(new WorkflowMessageResource());\r
     }\r
 \r
     @Override\r
@@ -1,32 +1,35 @@
-/*-\r
- * ============LICENSE_START=======================================================\r
- * ONAP - SO\r
- * ================================================================================\r
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
- * ================================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ============LICENSE_END=========================================================\r
- */\r
-\r
-package org.openecomp.mso.bpmn.common.workflow.service;\r
-\r
-import org.camunda.bpm.engine.ProcessEngineServices;\r
-import org.camunda.bpm.engine.ProcessEngines;\r
-\r
-\r
-public class WorkflowAsyncCommonResource extends WorkflowAsyncResource {\r
-\r
-    protected ProcessEngineServices getProcessEngineServices() {\r
-        return pes4junit.orElse(ProcessEngines.getProcessEngine("infrastructure"));\r
-    }\r
-}\r
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.client;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+
+public class PreconditionFailedException extends WebApplicationException {
+       /**
+        * 
+        */
+       private static final long serialVersionUID = 1L;
+
+       public PreconditionFailedException(String message) {
+        super(message, Response.Status.PRECONDITION_FAILED);
+    }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/ResponseExceptionMapper.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/ResponseExceptionMapper.java
new file mode 100644 (file)
index 0000000..e0e3e93
--- /dev/null
@@ -0,0 +1,98 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.client;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Optional;
+
+import javax.annotation.Priority;
+import javax.ws.rs.BadRequestException;
+import javax.ws.rs.ForbiddenException;
+import javax.ws.rs.InternalServerErrorException;
+import javax.ws.rs.NotAcceptableException;
+import javax.ws.rs.NotAllowedException;
+import javax.ws.rs.NotAuthorizedException;
+import javax.ws.rs.NotFoundException;
+import javax.ws.rs.NotSupportedException;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.client.ClientRequestContext;
+import javax.ws.rs.client.ClientResponseContext;
+import javax.ws.rs.client.ClientResponseFilter;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.Provider;
+
+@Provider
+@Priority(value = 1)
+public abstract class ResponseExceptionMapper implements ClientResponseFilter {
+
+       @Override
+       public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {
+               if (responseContext.getStatus() >= 300) {
+                       String message = "empty message";
+                       if (responseContext.hasEntity()) {
+                               Optional<String> result = this.extractMessage(responseContext.getEntityStream());
+                               if (result.isPresent()) {
+                                       message = result.get();
+                               }
+                       }
+                       Response.Status status = Response.Status.fromStatusCode(responseContext.getStatus());
+                       WebApplicationException webAppException;
+                       switch (status) {
+                       case BAD_REQUEST:
+                               webAppException = new BadRequestException(message);
+                               break;
+                       case UNAUTHORIZED:
+                               webAppException = new NotAuthorizedException(message);
+                               break;
+                       case FORBIDDEN:
+                               webAppException = new ForbiddenException(message);
+                               break;
+                       case NOT_FOUND:
+                               webAppException = new NotFoundException(message);
+                               break;
+                       case METHOD_NOT_ALLOWED:
+                               webAppException = new NotAllowedException(message);
+                               break;
+                       case NOT_ACCEPTABLE:
+                               webAppException = new NotAcceptableException(message);
+                               break;
+                       case PRECONDITION_FAILED:
+                               webAppException = new PreconditionFailedException(message);
+                               break;
+                       case UNSUPPORTED_MEDIA_TYPE:
+                               webAppException = new NotSupportedException(message);
+                               break;
+                       case INTERNAL_SERVER_ERROR:
+                               webAppException = new InternalServerErrorException(message);
+                               break;
+                       case SERVICE_UNAVAILABLE:
+                               webAppException = new WebApplicationException(message);
+                               break;
+                       default:
+                               webAppException = new WebApplicationException(message);
+                       }
+                       throw webAppException;
+               }
+       }
+       
+       public abstract Optional<String> extractMessage(InputStream stream) throws IOException;
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/ResponseExceptionMapperImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/ResponseExceptionMapperImpl.java
new file mode 100644 (file)
index 0000000..0845a2f
--- /dev/null
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.client;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Optional;
+
+import org.apache.commons.io.IOUtils;
+
+public class ResponseExceptionMapperImpl extends ResponseExceptionMapper {
+
+       @Override
+       public Optional<String> extractMessage(InputStream stream) throws IOException {
+               final String input = IOUtils.toString(stream, "UTF-8");
+               IOUtils.closeQuietly(stream);
+               return Optional.of(input);
+       }
+       
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/RestProperties.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/RestProperties.java
new file mode 100644 (file)
index 0000000..ae8862d
--- /dev/null
@@ -0,0 +1,30 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.client;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+public interface RestProperties {
+
+       public URL getEndpoint() throws MalformedURLException;
+       public String getSystemName();
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/RestPropertiesLoader.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/RestPropertiesLoader.java
new file mode 100644 (file)
index 0000000..6d49d98
--- /dev/null
@@ -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.openecomp.mso.client;
+
+import java.util.Iterator;
+import java.util.ServiceLoader;
+
+public class RestPropertiesLoader {
+
+       private final ServiceLoader<RestProperties> services;
+       private RestPropertiesLoader() {
+               services = ServiceLoader.load(RestProperties.class);
+       }
+       
+       private static class Helper {
+               private static final RestPropertiesLoader INSTANCE = new RestPropertiesLoader();
+       }
+       
+       public static RestPropertiesLoader getInstance() {
+               return Helper.INSTANCE;
+       }
+       
+       public <T> T getImpl(Class<? extends RestProperties> clazz) {
+               T result = null;
+               Iterator<RestProperties> propertyImpls = services.iterator();
+               RestProperties item;
+               while (propertyImpls.hasNext()) {
+                       item = propertyImpls.next();
+                       if (clazz.isAssignableFrom(item.getClass())) {
+                               result = (T)item;
+                               break;
+                       }
+               }
+               
+               return result;
+       }
+}
index f1bafde..0e00ae5 100644 (file)
@@ -22,33 +22,5 @@ package org.openecomp.mso.client.dmaap;
 
 public interface Consumer {
 
-       /**
-        * Should this consumer continue to consume messages from the topic?
-        * @return
-        */
-       public boolean continuePolling();
-       /**
-        * Process a message from a DMaaP topic
-        * 
-        * @param message
-        * @throws Exception
-        */
-       public void processMessage(String message) throws Exception;
-       /**
-        * Has the request been accepted by the receiving system?
-        * Should the consumer move to processing messages?
-        * 
-        * @param message
-        * @return
-        */
-       public boolean isAccepted(String message);
-       /**
-        * The request id to filter messages on
-        * @return
-        */
-       public String getRequestId();
-       /**
-        * Logic that defines when the consumer should stop processing messages
-        */
-       public void stopProcessingMessages();
+       public Iterable<String> fetch();
 }
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DefaultDmaapPropertiesImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DefaultDmaapPropertiesImpl.java
new file mode 100644 (file)
index 0000000..9af1fd3
--- /dev/null
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.client.dmaap;
+
+import java.util.Map;
+
+import org.openecomp.mso.bpmn.core.PropertyConfiguration;
+
+public class DefaultDmaapPropertiesImpl implements DmaapProperties {
+
+       private final Map<String, String> properties;
+       public DefaultDmaapPropertiesImpl() {
+               this.properties = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties");
+       }
+       @Override
+       public Map<String, String> getProperties() {
+               return this.properties;
+       } 
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapClient.java
new file mode 100644 (file)
index 0000000..7862c9d
--- /dev/null
@@ -0,0 +1,68 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.client.dmaap;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Base64;
+import java.util.Map;
+import java.util.Properties;
+
+import org.openecomp.mso.bpmn.core.PropertyConfiguration;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+public abstract class DmaapClient {
+       
+       protected final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
+       protected final Map<String, String> msoProperties;
+       protected final Properties properties;
+       public DmaapClient(String filepath) throws FileNotFoundException, IOException {
+               Resource resource = new ClassPathResource(filepath);
+               DmaapProperties dmaapProperties = DmaapPropertiesLoader.getInstance().getImpl();
+               if (dmaapProperties == null) {
+                       dmaapProperties = new DefaultDmaapPropertiesImpl();
+               }
+               this.msoProperties = dmaapProperties.getProperties();
+               this.properties = new Properties();
+               this.properties.load(resource.getInputStream());
+               this.properties.put("password", this.deobfuscatePassword(this.getPassword()));
+               this.properties.put("username", this.getUserName());
+               this.properties.put("topic", this.getTopic());
+       }
+       protected String deobfuscatePassword(String password) {
+               
+               try {
+                       return new String(Base64.getDecoder().decode(password.getBytes()));
+               } catch(IllegalArgumentException iae) {
+                       
+                       return password;
+               }
+       }
+       
+       
+       public abstract String getUserName();
+       public abstract String getPassword();
+       public abstract String getTopic();
+}
index 2a61876..0339516 100644 (file)
@@ -22,39 +22,110 @@ package org.openecomp.mso.client.dmaap;
 
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.util.concurrent.TimeUnit;
 
-import com.att.nsa.mr.client.MRClientFactory;
-import com.att.nsa.mr.client.MRConsumer;
+import org.openecomp.mso.client.dmaap.exceptions.DMaaPConsumerFailure;
+import org.openecomp.mso.client.dmaap.exceptions.ExceededMaximumPollingTime;
+import org.openecomp.mso.client.dmaap.rest.RestConsumer;
 
-public class DmaapConsumer {
+import com.google.common.base.Stopwatch;
 
-       private final MRConsumer mrConsumer;
-       public DmaapConsumer() {
-               mrConsumer = null;
-       }
-       public DmaapConsumer (String filepath) throws FileNotFoundException, IOException {
-               
-               mrConsumer = MRClientFactory.createConsumer(filepath);
+public abstract class DmaapConsumer extends DmaapClient {
+
+       public DmaapConsumer() throws FileNotFoundException, IOException {
+               super("dmaap/default-consumer.properties");
        }
        
-       
-       public MRConsumer getMRConsumer() {
-               return mrConsumer;
+       public Consumer getConsumer() throws FileNotFoundException, IOException {
+               return new RestConsumer(this.properties);
        }
-       public boolean consume(Consumer consumer) throws Exception {
+       public boolean consume() throws Exception {
+               
+               Consumer mrConsumer = this.getConsumer();
+               int iterations = 0;
                boolean accepted = false;
-               while (consumer.continuePolling()) {
-                       for (String message : this.getMRConsumer().fetch()) {
-                               if (!accepted && consumer.isAccepted(message)) {
-                                       accepted = true;
-                               } 
-                               if (accepted) {
-                                       consumer.processMessage(message);
+               Stopwatch stopwatch = Stopwatch.createUnstarted();
+               try {
+                       while (this.continuePolling()) {
+                               if (stopwatch.elapsed(TimeUnit.MILLISECONDS) >= this.getMaximumElapsedTime()) {
+                                       final String message = "exceeded maximum retries on " + this.getRequestId() + " on " + this.getTopic();
+                                       auditLogger.error(message);
+                                       throw new ExceededMaximumPollingTime(message);
                                }
+                               stopwatch.start();
+                               Iterable<String> itr = mrConsumer.fetch();
+                               stopwatch.stop();
+                               for (String message : itr) {
+                                       if (!accepted && this.isAccepted(message)) {
+                                               auditLogger.info("accepted message found for " + this.getRequestId() + " on " + this.getTopic());
+                                               accepted = true;
+                                       } 
+                                       if (accepted) {
+                                               if (this.isFailure(message)) {
+                                                       this.stopProcessingMessages();
+                                                       auditLogger.info("received dmaap message: " + message);
+                                                       final String errorMsg = "failure received from dmaap topic " + this.getTopic();
+                                                       auditLogger.error(errorMsg);
+                                                       throw new DMaaPConsumerFailure(errorMsg);
+                                               } else {
+                                                       auditLogger.info("received dmaap message: " + message);
+                                                       this.processMessage(message);
+                                               }
+                                       }
+                               }
+                               iterations++;
+                       }
+                       return true;
+               } catch (Exception e ) {
+                       throw e;
+               } finally {
+                       if (stopwatch.isRunning()) {
+                               stopwatch.stop();
                        }
                }
-               
-               return true;
        }
        
+       /**
+        * Should this consumer continue to consume messages from the topic?
+        * @return
+        */
+       public abstract boolean continuePolling();
+       /**
+        * Process a message from a DMaaP topic
+        * 
+        * @param message
+        * @throws Exception
+        */
+       public abstract void processMessage(String message) throws Exception;
+       /**
+        * Has the request been accepted by the receiving system?
+        * Should the consumer move to processing messages?
+        * 
+        * @param message
+        * @return
+        */
+       public abstract boolean isAccepted(String message);
+       /**
+        * has the request failed?
+        * 
+        * @param message
+        * @return
+        */
+       public abstract boolean isFailure(String message);
+       /**
+        * The request id to filter messages on
+        * @return
+        */
+       public abstract String getRequestId();
+       /**
+        * Logic that defines when the consumer should stop processing messages
+        */
+       public abstract void stopProcessingMessages();
+       
+       /**
+        * time in milliseconds
+        */
+       public int getMaximumElapsedTime() {
+               return 180000;
+       }
 }
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapProperties.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapProperties.java
new file mode 100644 (file)
index 0000000..7bdd7df
--- /dev/null
@@ -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.openecomp.mso.client.dmaap;
+
+import java.util.Map;
+
+public interface DmaapProperties {
+
+       /**
+        * A map of strings which contains the properties for a dmaap client
+        * @return
+        */
+       public Map<String, String> getProperties();
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPropertiesLoader.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPropertiesLoader.java
new file mode 100644 (file)
index 0000000..a21dbe8
--- /dev/null
@@ -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.openecomp.mso.client.dmaap;
+
+import java.util.Iterator;
+import java.util.ServiceLoader;
+
+public class DmaapPropertiesLoader {
+
+       private final ServiceLoader<DmaapProperties> services;
+       private DmaapPropertiesLoader() {
+               services = ServiceLoader.load(DmaapProperties.class);
+       }
+       
+       private static class Helper {
+               private static final DmaapPropertiesLoader INSTANCE = new DmaapPropertiesLoader();
+       }
+       
+       public static DmaapPropertiesLoader getInstance() {
+               return Helper.INSTANCE;
+       }
+       
+       public DmaapProperties getImpl() {
+               Iterator<DmaapProperties> propertyImpls = services.iterator();
+               while (propertyImpls.hasNext()) {
+                       return propertyImpls.next();
+               }
+               
+               return null;
+       }
+}
index 4d70a16..d2752c5 100644 (file)
@@ -22,29 +22,30 @@ package org.openecomp.mso.client.dmaap;
 
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.util.concurrent.TimeUnit;
 
-import com.att.nsa.mr.client.MRBatchingPublisher;
-import com.att.nsa.mr.client.MRClientFactory;
+import org.openecomp.mso.client.dmaap.rest.RestPublisher;
 
-public class DmaapPublisher {
+public abstract class DmaapPublisher extends DmaapClient {
        
-       private final long seconds;
-       private final MRBatchingPublisher publisher;
-       
-       public DmaapPublisher(String filepath) throws FileNotFoundException, IOException {
+       private long seconds;
+       private final Publisher publisher;
+       public DmaapPublisher() throws FileNotFoundException, IOException {
+               super("dmaap/default-consumer.properties");
+               this.publisher = new RestPublisher(properties);
                this.seconds = 20;
-               this.publisher = MRClientFactory.createBatchingPublisher(filepath);
+               
        }
        
-       public DmaapPublisher(String filepath, long seconds) throws FileNotFoundException, IOException {
+       public DmaapPublisher(long seconds) throws FileNotFoundException, IOException {
+               this();
                this.seconds = seconds;
-               this.publisher = MRClientFactory.createBatchingPublisher(filepath);
        }
        
        public void send(String json) throws IOException, InterruptedException {
+               auditLogger.info("publishing message to dmaap topic " + this.getTopic() + ": " + json);
                publisher.send(json);
-               publisher.close(seconds, TimeUnit.SECONDS);
+               //publisher.close(seconds, TimeUnit.SECONDS);
        }
 
+
 }
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/Publisher.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/Publisher.java
new file mode 100644 (file)
index 0000000..d89ee6e
--- /dev/null
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.client.dmaap;
+
+public interface Publisher {
+
+       public void send(String json);
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/exceptions/DMaaPConsumerFailure.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/exceptions/DMaaPConsumerFailure.java
new file mode 100644 (file)
index 0000000..29472b2
--- /dev/null
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.client.dmaap.exceptions;
+
+public class DMaaPConsumerFailure extends Exception {
+
+       private static final long serialVersionUID = 2499229901897110362L;
+
+       public DMaaPConsumerFailure() {
+               super();
+       }
+       
+       public DMaaPConsumerFailure(String message) {
+               super(message);
+       }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/exceptions/ExceededMaximumPollingTime.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/exceptions/ExceededMaximumPollingTime.java
new file mode 100644 (file)
index 0000000..c9d6750
--- /dev/null
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.client.dmaap.exceptions;
+
+public class ExceededMaximumPollingTime extends RuntimeException  {
+
+       private static final long serialVersionUID = 2331207691092906423L;
+
+       public ExceededMaximumPollingTime() {
+               super();
+       }
+       
+       public ExceededMaximumPollingTime(String message) {
+               super(message);
+       }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/DMaaPRestClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/DMaaPRestClient.java
new file mode 100644 (file)
index 0000000..124e2c3
--- /dev/null
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.client.dmaap.rest;
+
+import java.net.URL;
+import java.util.Base64;
+import java.util.Map;
+import java.util.Optional;
+
+import javax.ws.rs.client.ClientResponseFilter;
+
+import org.openecomp.mso.client.ResponseExceptionMapperImpl;
+import org.openecomp.mso.client.policy.RestClient;
+
+public class DMaaPRestClient  extends RestClient {
+
+       private final String username;
+       private final String password;
+       public DMaaPRestClient(URL url, String contentType, String username, String password) {
+               super(url, contentType);
+               this.username = username;
+               this.password = password;
+       }
+
+       @Override
+       protected void initializeHeaderMap(Map<String, String> headerMap) {
+               headerMap.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(new String(username + ":" + password).getBytes()));
+       }
+
+       @Override
+       protected Optional<ClientResponseFilter> addResponseFilter() {
+               return Optional.of(new ResponseExceptionMapperImpl());
+       }
+
+       @Override
+       public RestClient addRequestId(String requestId) {
+               return null;
+       }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/PropertiesBean.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/PropertiesBean.java
new file mode 100644 (file)
index 0000000..fb914a0
--- /dev/null
@@ -0,0 +1,131 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.client.dmaap.rest;
+
+import java.util.Properties;
+
+public class PropertiesBean {
+
+       private String username;
+       private String password;
+       private String environment;
+       private String partition;
+       private String contentType;
+       private String host;
+       private String topic;
+       private String timeout;
+       
+       
+       public PropertiesBean(Properties properties) {
+               this.withUsername(properties.getProperty("username"))
+               .withPassword(properties.getProperty("password"))
+               .withTopic(properties.getProperty("topic"))
+               .withEnvironment(properties.getProperty("environment"))
+               .withHost(properties.getProperty("host"))
+               .withTimeout(properties.getProperty("timeout", "20000"))
+               .withPartition(properties.getProperty("partition"))
+               .withContentType(properties.getProperty("contentType", "application/json"));
+       }
+       public String getUsername() {
+               return username;
+       }
+       public void setUsername(String username) {
+               this.username = username;
+       }
+       public PropertiesBean withUsername(String username) {
+               this.username = username;
+               return this;
+       }
+       public String getPassword() {
+               return password;
+       }
+       public void setPassword(String password) {
+               this.password = password;
+       }
+       public PropertiesBean withPassword(String password) {
+               this.password = password;
+               return this;
+       }
+       public String getEnvironment() {
+               return environment;
+       }
+       public void setEnvironment(String environment) {
+               this.environment = environment;
+       }
+       public PropertiesBean withEnvironment(String environment) {
+               this.environment = environment;
+               return this;
+       }
+       public String getPartition() {
+               return partition;
+       }
+       public void setPartition(String partition) {
+               this.partition = partition;
+       }
+       public PropertiesBean withPartition(String partition) {
+               this.partition = partition;
+               return this;
+       }
+       public String getContentType() {
+               return contentType;
+       }
+       public void setContentType(String contentType) {
+               this.contentType = contentType;
+       }
+       public PropertiesBean withContentType(String contentType) {
+               this.contentType = contentType;
+               return this;
+       }
+       public String getHost() {
+               return host;
+       }
+       public void setHost(String host) {
+               this.host = host;
+       }
+       public PropertiesBean withHost(String host) {
+               this.host = host;
+               return this;
+       }
+       public String getTopic() {
+               return topic;
+       }
+       public void setTopic(String topic) {
+               this.topic = topic;
+       }
+       public PropertiesBean withTopic(String topic) {
+               this.topic = topic;
+               return this;
+       }
+       public String getTimeout() {
+               return timeout;
+       }
+       public void setTimeout(String timeout) {
+               this.timeout = timeout;
+       }
+       public PropertiesBean withTimeout(String timeout) {
+               this.timeout = timeout;
+               return this;
+       }
+       
+       
+       
+       
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/RestConsumer.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/RestConsumer.java
new file mode 100644 (file)
index 0000000..ff199e2
--- /dev/null
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.client.dmaap.rest;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+import java.util.Properties;
+
+import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.UriBuilder;
+
+import org.openecomp.mso.client.dmaap.Consumer;
+import org.openecomp.mso.client.policy.RestClient;
+
+public class RestConsumer implements Consumer {
+
+       private final RestClient client;
+       public RestConsumer(Properties properties) {
+               PropertiesBean bean = new PropertiesBean(properties);
+               client = new DMaaPRestClient(this.createURL(bean), bean.getContentType(), bean.getUsername(), bean.getPassword());
+       }
+       
+       private URL createURL(PropertiesBean properties) {
+               try {
+                       return UriBuilder.fromUri("http://" + properties.getHost())
+                                       .path("events").path(properties.getTopic())
+                                       .path(properties.getPartition())
+                                       .path("consumer1")
+                                       .queryParam("timeout",  properties.getTimeout()).build().toURL();
+               } catch (MalformedURLException e) {
+                       throw new RuntimeException(e);
+               }
+       }
+       
+       @Override
+       public Iterable<String> fetch() {
+               
+               return client.get(new GenericType<List<String>>() {});
+       }
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/RestPublisher.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/rest/RestPublisher.java
new file mode 100644 (file)
index 0000000..e8e6859
--- /dev/null
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.client.dmaap.rest;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Properties;
+
+import javax.ws.rs.core.UriBuilder;
+import javax.ws.rs.core.UriBuilderException;
+
+import org.openecomp.mso.client.dmaap.Publisher;
+import org.openecomp.mso.client.policy.RestClient;
+
+public class RestPublisher implements Publisher {
+
+       private final RestClient client;
+
+       public RestPublisher(Properties properties) {
+               PropertiesBean bean = new PropertiesBean(properties);
+               client = new DMaaPRestClient(this.createURL(bean), bean.getContentType(), bean.getUsername(), bean.getPassword());
+       }
+       
+       private URL createURL(PropertiesBean properties) {
+               try {
+                       return UriBuilder.fromUri("http://" + properties.getHost())
+                                       .path("events").path(properties.getTopic())
+                                       .queryParam("timeout",  properties.getTimeout()).build().toURL();
+               } catch (MalformedURLException e) {
+                       throw new RuntimeException(e);
+               }
+       }
+       
+       @Override
+       public void send(String json) {
+               client.post(json);
+       }
+}
index 665b905..e029419 100644 (file)
-/*-\r
- * ============LICENSE_START=======================================================\r
- * ONAP - SO\r
- * ================================================================================\r
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
- * ================================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ============LICENSE_END=========================================================\r
- */\r
-\r
-package org.openecomp.mso.client.policy;\r
-\r
-import java.io.BufferedInputStream;\r
-\r
-import java.io.ByteArrayOutputStream;\r
-import java.io.FilterOutputStream;\r
-import java.io.IOException;\r
-import java.io.InputStream;\r
-import java.io.OutputStream;\r
-import java.nio.charset.Charset;\r
-import java.nio.charset.StandardCharsets;\r
-import java.util.logging.Logger;\r
-import javax.annotation.Priority;\r
-import javax.ws.rs.WebApplicationException;\r
-import javax.ws.rs.client.ClientRequestContext;\r
-import javax.ws.rs.client.ClientRequestFilter;\r
-import javax.ws.rs.client.ClientResponseContext;\r
-import javax.ws.rs.client.ClientResponseFilter;\r
-import javax.ws.rs.ext.WriterInterceptor;\r
-import javax.ws.rs.ext.WriterInterceptorContext;\r
-\r
-@Priority(Integer.MIN_VALUE)\r
-public class LoggingFilter implements ClientRequestFilter, ClientResponseFilter, WriterInterceptor {\r
-\r
-       private static final Logger logger = Logger.getLogger(LoggingFilter.class.getName());\r
-       private static final String ENTITY_STREAM_PROPERTY = "LoggingFilter.entityStream";\r
-       private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;\r
-       private final int maxEntitySize = 1024 * 8;\r
-\r
-       private void log(StringBuilder sb) {\r
-               logger.info(sb.toString());\r
-       }\r
-\r
-       private InputStream logInboundEntity(final StringBuilder b, InputStream stream, final Charset charset)\r
-                       throws IOException {\r
-               InputStream inputStream = stream;\r
-               if (!inputStream.markSupported()) {\r
-                       inputStream = new BufferedInputStream(inputStream);\r
-               }\r
-               inputStream.mark(maxEntitySize + 1);\r
-               final byte[] entity = new byte[maxEntitySize + 1];\r
-               final int entitySize = inputStream.read(entity);\r
-               b.append(new String(entity, 0, Math.min(entitySize, maxEntitySize), charset));\r
-               if (entitySize > maxEntitySize) {\r
-                       b.append("...more...");\r
-               }\r
-               b.append('\n');\r
-               inputStream.reset();\r
-               return inputStream;\r
-       }\r
-\r
-       @Override\r
-       public void filter(ClientRequestContext requestContext) throws IOException {\r
-               if (requestContext.hasEntity()) {\r
-                       final OutputStream stream = new LoggingStream(requestContext.getEntityStream());\r
-                       requestContext.setEntityStream(stream);\r
-                       requestContext.setProperty(ENTITY_STREAM_PROPERTY, stream);\r
-               }\r
-       }\r
-\r
-       @Override\r
-       public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {\r
-               final StringBuilder sb = new StringBuilder();\r
-               if (responseContext.hasEntity()) {\r
-                       responseContext.setEntityStream(logInboundEntity(sb, responseContext.getEntityStream(), DEFAULT_CHARSET));\r
-                       log(sb);\r
-               }\r
-\r
-       }\r
-\r
-       @Override\r
-       public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException {\r
-               final LoggingStream stream = (LoggingStream) context.getProperty(ENTITY_STREAM_PROPERTY);\r
-               context.proceed();\r
-               if (stream != null) {\r
-                       log(stream.getStringBuilder(DEFAULT_CHARSET));\r
-               }\r
-       }\r
-\r
-       private class LoggingStream extends FilterOutputStream {\r
-\r
-               private final StringBuilder sb = new StringBuilder();\r
-               private final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r
-\r
-               LoggingStream(OutputStream out) {\r
-                       super(out);\r
-               }\r
-\r
-               StringBuilder getStringBuilder(Charset charset) {\r
-                       // write entity to the builder\r
-                       final byte[] entity = baos.toByteArray();\r
-\r
-                       sb.append(new String(entity, 0, entity.length, charset));\r
-                       if (entity.length > maxEntitySize) {\r
-                               sb.append("...more...");\r
-                       }\r
-                       sb.append('\n');\r
-\r
-                       return sb;\r
-               }\r
-\r
-               @Override\r
-               public void write(final int i) throws IOException {\r
-                       if (baos.size() <= maxEntitySize) {\r
-                               baos.write(i);\r
-                       }\r
-                       out.write(i);\r
-               }\r
-       }\r
-}\r
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.client.policy;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.FilterOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.util.logging.Logger;
+
+import javax.annotation.Priority;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.client.ClientRequestContext;
+import javax.ws.rs.client.ClientRequestFilter;
+import javax.ws.rs.client.ClientResponseContext;
+import javax.ws.rs.client.ClientResponseFilter;
+import javax.ws.rs.ext.WriterInterceptor;
+import javax.ws.rs.ext.WriterInterceptorContext;
+
+@Priority(Integer.MIN_VALUE)
+public class LoggingFilter implements ClientRequestFilter, ClientResponseFilter, WriterInterceptor {
+
+       private static final Logger logger = Logger.getLogger(LoggingFilter.class.getName());
+       private static final String ENTITY_STREAM_PROPERTY = "LoggingFilter.entityStream";
+       private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;
+       private final int maxEntitySize;
+
+       public LoggingFilter() {
+               maxEntitySize = 1024 * 1024;
+       }
+
+       public LoggingFilter(int maxPayloadSize) {
+               this.maxEntitySize = Integer.min(maxPayloadSize, 1024 * 1024);
+       }
+
+       private void log(StringBuilder sb) {
+               logger.info(sb.toString());
+       }
+
+       private InputStream logInboundEntity(final StringBuilder b, InputStream stream, final Charset charset)
+                       throws IOException {
+               if (!stream.markSupported()) {
+                       stream = new BufferedInputStream(stream);
+               }
+               stream.mark(maxEntitySize + 1);
+               final byte[] entity = new byte[maxEntitySize + 1];
+               final int entitySize = stream.read(entity);
+               if (entitySize != -1) {
+                       b.append(new String(entity, 0, Math.min(entitySize, maxEntitySize), charset));
+               }
+               if (entitySize > maxEntitySize) {
+                       b.append("...more...");
+               }
+               b.append('\n');
+               stream.reset();
+               return stream;
+       }
+
+       @Override
+       public void filter(ClientRequestContext requestContext) throws IOException {
+               if (requestContext.hasEntity()) {
+                       final OutputStream stream = new LoggingStream(requestContext.getEntityStream());
+                       requestContext.setEntityStream(stream);
+                       requestContext.setProperty(ENTITY_STREAM_PROPERTY, stream);
+               }
+       }
+
+       @Override
+       public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {
+               final StringBuilder sb = new StringBuilder();
+               if (responseContext.hasEntity()) {
+                       responseContext.setEntityStream(logInboundEntity(sb, responseContext.getEntityStream(), DEFAULT_CHARSET));
+                       log(sb);
+               }
+       }
+
+       @Override
+       public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException {
+               final LoggingStream stream = (LoggingStream) context.getProperty(ENTITY_STREAM_PROPERTY);
+               context.proceed();
+               if (stream != null) {
+                       log(stream.getStringBuilder(DEFAULT_CHARSET));
+               }
+       }
+
+       private class LoggingStream extends FilterOutputStream {
+
+               private final StringBuilder sb = new StringBuilder();
+               private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+               LoggingStream(OutputStream out) {
+                       super(out);
+               }
+
+               StringBuilder getStringBuilder(Charset charset) {
+                       // write entity to the builder
+                       final byte[] entity = baos.toByteArray();
+
+                       sb.append(new String(entity, 0, entity.length, charset));
+                       if (entity.length > maxEntitySize) {
+                               sb.append("...more...");
+                       }
+                       sb.append('\n');
+
+                       return sb;
+               }
+
+               @Override
+               public void write(final int i) throws IOException {
+                       if (baos.size() <= maxEntitySize) {
+                               baos.write(i);
+                       }
+                       out.write(i);
+               }
+       }
+}
\ No newline at end of file
index 71ae56f..4ed2a88 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * ONAP - SO
+ * OPENECOMP - MSO
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
 
 package org.openecomp.mso.client.policy;
 
+import java.net.MalformedURLException;
 import java.util.Map;
+import java.util.Optional;
 import java.util.UUID;
 
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
+import javax.ws.rs.client.ClientResponseFilter;
+import javax.ws.rs.core.UriBuilder;
+import javax.ws.rs.core.UriBuilderException;
 
+import org.openecomp.mso.client.ResponseExceptionMapperImpl;
+import org.openecomp.mso.client.RestProperties;
+import org.openecomp.mso.client.policy.entities.PolicyServiceType;
 import org.springframework.stereotype.Service;
 
 @Service
 public class PolicyRestClient extends RestClient {
 
-       private static final String ENDPOINT_KEY = "policy.endpoint";
        private static final String X_ECOMP_REQUESTID = String.valueOf(UUID.randomUUID());
-
-       public PolicyRestClient() {
-               super(ENDPOINT_KEY);
+       private final PolicyRestProperties properties;
+       public PolicyRestClient(PolicyRestProperties props, PolicyServiceType serviceType) {
+               super(props, Optional.of(UriBuilder.fromPath(serviceType.toString()).build()));
+               this.properties = props;
+               this.getClient();
        }
 
        @Override
        protected void initializeHeaderMap(Map<String, String> headerMap) {
-               headerMap.put("ClientAuth", properties.get("policy.client.auth"));
-               headerMap.put("Authorization", properties.get("policy.auth"));
-               headerMap.put("Environment", properties.get("policy.environment"));
-               headerMap.put("X-ECOMP-RequestID", X_ECOMP_REQUESTID);
+               headerMap.put("ClientAuth", properties.getClientAuth());
+               headerMap.put("Authorization", properties.getAuth());
+               headerMap.put("Environment", properties.getEnvironment());
+               this.addRequestId(X_ECOMP_REQUESTID);
        }
 
-       public PolicyDecision getDecision(String serviceType, String vnfType, String bbID, String workStep,
-                       String errorCode) {
-               DecisionAttributes decisionAttributes = new DecisionAttributes();
-               decisionAttributes.setServiceType(serviceType);
-               decisionAttributes.setVNFType(vnfType);
-               decisionAttributes.setBBID(bbID);
-               decisionAttributes.setWorkStep(workStep);
-               decisionAttributes.setErrorCode(errorCode);
-
-               return this.getDecision(decisionAttributes);
+       @Override
+       protected Optional<ClientResponseFilter> addResponseFilter() {
+               return Optional.of(new ResponseExceptionMapperImpl());
        }
 
-       private PolicyDecision getDecision(DecisionAttributes decisionAttributes) {
-               PolicyDecisionRequest decisionRequest = new PolicyDecisionRequest();
-               decisionRequest.setDecisionAttributes(decisionAttributes);
-               decisionRequest.setEcompcomponentName(ECOMP_COMPONENT_NAME);
-
-               return this.getBuilder().accept(MediaType.APPLICATION_JSON_TYPE)
-                               .post(Entity.entity(decisionRequest, MediaType.APPLICATION_JSON)).readEntity(PolicyDecision.class);
+       @Override
+       public RestClient addRequestId(String requestId) {
+               this.headerMap.put("X-ECOMP-RequestID", requestId);
+               return this;
        }
 }
\ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyRestProperties.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyRestProperties.java
new file mode 100644 (file)
index 0000000..d933676
--- /dev/null
@@ -0,0 +1,64 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.client.policy;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Map;
+
+import org.openecomp.mso.bpmn.core.PropertyConfiguration;
+import org.openecomp.mso.client.RestProperties;
+
+public class PolicyRestProperties implements RestProperties {
+
+       
+       final Map<String, String> props;
+       public PolicyRestProperties() {
+               this.props = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties");
+
+       }
+       @Override
+       public URL getEndpoint() {
+               try {
+                       return new URL(props.getOrDefault("policy.endpoint", ""));
+               } catch (MalformedURLException e) {
+                       return null;
+               }
+       }
+
+       @Override
+       public String getSystemName() {
+               return "MSO";
+       }
+       
+       public String getClientAuth() {
+               return props.get("policy.client.auth");
+       }
+       
+       public String getAuth() {
+               return props.get("policy.auth");
+       }
+       
+       public String getEnvironment() {
+               return props.get("policy.environment");
+       }
+
+}
index 81c072f..74b1c3f 100644 (file)
 
 package org.openecomp.mso.client.policy;
 
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
-import java.util.logging.Logger;
+import java.util.Optional;
 
+import javax.ws.rs.client.Client;
 import javax.ws.rs.client.ClientBuilder;
+import javax.ws.rs.client.ClientResponseFilter;
+import javax.ws.rs.client.Entity;
 import javax.ws.rs.client.Invocation.Builder;
 import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriBuilder;
+import javax.ws.rs.ext.ContextResolver;
 
-
-import org.openecomp.mso.bpmn.core.PropertyConfiguration;
+import org.apache.log4j.Logger;
+import org.openecomp.mso.client.RestProperties;
 import org.openecomp.mso.logger.MsoLogger;
 import org.springframework.stereotype.Service;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+
 @Service
 public abstract class RestClient {
        protected static final String ECOMP_COMPONENT_NAME = "MSO";
-
+       
+       private static final int MAX_PAYLOAD_SIZE = 1024 * 1024;
        private WebTarget webTarget;
 
        protected final Map<String, String> headerMap;
        protected final MsoLogger msoLogger;
-       protected Map<String, String> properties;
-       protected String host;
+       protected URL host;
+       protected Optional<URI> path;
+       protected Logger logger;
+       protected String accept;
+       protected String contentType;
 
-       protected RestClient(String endpointKey) {
-               Logger logger = Logger.getLogger(getClass().getName());
+       protected RestClient(RestProperties props, Optional<URI> path) {
+               logger = Logger.getLogger(getClass().getName());
                msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL);
-               
-               properties = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties");
+
                headerMap = new HashMap<>();
-               initializeHeaderMap(headerMap);
+               try {
+                       host = props.getEndpoint();
+               } catch (MalformedURLException e) {
+                       logger.error("url not valid", e);
+                       throw new RuntimeException(e);
+               }
+               
+               this.path = path;
+               initializeClient(getClient());
+       }
 
-               host = this.getHost(endpointKey);
+       protected RestClient(RestProperties props, Optional<URI> path, String accept, String contentType) {
+               this(props, path);
+               this.accept = accept;
+               this.contentType = contentType;
 
-               webTarget = ClientBuilder.newClient().register(logger).register(new LoggingFilter())
-                               .register(new CommonObjectMapperProvider()).target(host);
        }
 
-       private String getHost(String key) {
-               return properties.get(key);
+       protected RestClient(URL host, String contentType) {
+               headerMap = new HashMap<>();
+               logger = Logger.getLogger(getClass().getName());
+               msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL);
+               this.path = Optional.empty();
+               this.host = host;
+               this.contentType = contentType;
+               initializeClient(getClient());
+       }
+
+       /**
+        * Override method to return false to disable logging.
+        * 
+        * @return true - to enable logging, false otherwise
+        */
+       protected boolean enableLogging() {
+               return true;
+       }
+       
+       /**
+        * Override method to return custom value for max payload size.
+        * 
+        * @return Default value for MAX_PAYLOAD_SIZE = 1024 * 1024
+        */
+       protected int getMaxPayloadSize()
+       {
+               return MAX_PAYLOAD_SIZE;
        }
 
        protected Builder getBuilder() {
+
                Builder builder = webTarget.request();
+               initializeHeaderMap(headerMap);
 
                for (Entry<String, String> entry : headerMap.entrySet()) {
                        builder.header(entry.getKey(), entry.getValue());
@@ -73,4 +126,100 @@ public abstract class RestClient {
        }
 
        protected abstract void initializeHeaderMap(Map<String, String> headerMap);
+
+       protected abstract Optional<ClientResponseFilter> addResponseFilter();
+
+       public abstract RestClient addRequestId(String requestId);
+
+       protected ContextResolver<ObjectMapper> getMapper() {
+               return new CommonObjectMapperProvider();
+       }
+
+       protected String getAccept() {
+               return accept;
+       }
+
+       protected String getContentType() {
+               return contentType;
+       }
+
+       protected String getMergeContentType() {
+               return "application/merge-patch+json";
+       }
+
+       protected Client getClient() {
+               return ClientBuilder.newBuilder().build();
+       }
+
+       protected void initializeClient(Client client) {
+               if (this.enableLogging()) {
+                       client.register(logger).register(new LoggingFilter(this.getMaxPayloadSize()));
+               }
+               client.register(this.getMapper());
+               Optional<ClientResponseFilter> responseFilter = this.addResponseFilter();
+               if (responseFilter.isPresent()) {
+                       client.register(responseFilter.get());
+               }
+               if (!path.isPresent()) {
+                       webTarget = client.target(host.toString());
+               } else {
+                       webTarget = client.target(UriBuilder.fromUri(host + path.get().toString()));
+               }
+               this.accept = MediaType.APPLICATION_JSON;
+               this.contentType = MediaType.APPLICATION_JSON;
+       }
+
+       public Response get() {
+               return this.getBuilder().accept(this.getAccept()).get();
+       }
+
+       public Response post(Object obj) {
+               return this.getBuilder().accept(this.getAccept()).post(Entity.entity(obj, this.getContentType()));
+       }
+
+       public Response patch(Object obj) {
+               return this.getBuilder().header("X-HTTP-Method-Override", "PATCH").accept(this.getAccept())
+                               .post(Entity.entity(obj, this.getMergeContentType()));
+       }
+
+       public Response put(Object obj) {
+               return this.getBuilder().accept(this.getAccept()).put(Entity.entity(obj, this.getContentType()));
+       }
+
+       public Response delete() {
+               return this.getBuilder().accept(this.getAccept()).delete();
+       }
+
+       public Response delete(Object obj) {
+               return this.getBuilder().header("X-HTTP-Method-Override", "DELETE").accept(this.getAccept())
+                               .put(Entity.entity(obj, this.getContentType()));
+       }
+
+       public <T> T get(Class<T> resultClass) {
+               return this.get().readEntity(resultClass);
+       }
+
+       public <T> T get(GenericType<T> resultClass) {
+               return this.get().readEntity(resultClass);
+       }
+
+       public <T> T post(Object obj, Class<T> resultClass) {
+               return this.post(obj).readEntity(resultClass);
+       }
+
+       public <T> T patch(Object obj, Class<T> resultClass) {
+               return this.patch(obj).readEntity(resultClass);
+       }
+
+       public <T> T put(Object obj, Class<T> resultClass) {
+               return this.put(obj).readEntity(resultClass);
+       }
+
+       public <T> T delete(Class<T> resultClass) {
+               return this.delete().readEntity(resultClass);
+       }
+       
+       public <T> T delete(Object obj, Class<T> resultClass) {
+               return this.delete(obj).readEntity(resultClass);
+       }
 }
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/entities/PolicyServiceType.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/entities/PolicyServiceType.java
new file mode 100644 (file)
index 0000000..b5ab63c
--- /dev/null
@@ -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.openecomp.mso.client.policy.entities;
+
+public enum PolicyServiceType {
+       GET_CONFIG("getConfig"),
+       SEND_EVENT("sendEvent"),
+       PUSH_POLICY("pushPolicy"),
+       CREATE_POLICY("createPolicy"),
+       UPDATE_POLICY("updatePolicy"),
+       GET_DECISION("getDecision"),
+       GET_METRICS("getMetrics"),
+       DELETE_POLICY("deletePolicy"),
+       LIST_CONFIG("listConfig"),
+       CREATE_DICTIONARY_ITEM("createDictionaryItem"),
+       UPDATE_DICTIONARY_ITEM("updateDictionaryItem"),
+       GET_DICTIONARY_ITEMS("getDictionaryItems");
+       
+       private final String name;
+       
+       private PolicyServiceType(String name) {
+               this.name = name;
+       }
+       
+       @Override
+       public String toString() {
+               return name;
+       }
+       
+}
index eb18e10..c746c0d 100644 (file)
@@ -32,6 +32,6 @@ public interface SDNOValidator {
         * @throws IOException
         * @throws Exception
         */
-       public void healthDiagnostic(String vnfName, String uuid) throws IOException, Exception;
+       public void healthDiagnostic(String vnfId, String requestingUserId) throws IOException, Exception;
 
 }
index 92a00ee..bdb4aa9 100644 (file)
@@ -30,7 +30,7 @@ import org.openecomp.mso.client.dmaap.DmaapPublisher;
 import org.openecomp.mso.client.exceptions.SDNOException;
 import org.openecomp.mso.jsonpath.JsonPathUtil;
 
-public class SDNOValidatorImpl implements SDNOValidator, Consumer {
+public class SDNOValidatorImpl implements SDNOValidator {
 
        private final static String aafUserName = "something";
        private final static String clientName = "MSO";
@@ -51,103 +51,4 @@ public class SDNOValidatorImpl implements SDNOValidator, Consumer {
                //block and continue to poll waiting for response
        }
 
-       protected SDNO buildRequestDiagnostic(String vnfName, String uuid, String oamIp) {
-               
-               Input input = new Input();
-               SDNO parentRequest = new SDNO();
-               Body body = new Body();
-               parentRequest.setBody(body);
-               parentRequest.setNodeType("vPE");
-               parentRequest.setOperation("health-diagnostic");
-               
-               body.setInput(input);
-               
-               RequestHealthDiagnostic request = new RequestHealthDiagnostic();
-               request.setRequestClientName(clientName);
-               request.setRequestNodeName(vnfName);
-               request.setRequestNodeIp(oamIp); //generic-vnf oam ip
-               request.setRequestUserId(aafUserName); //mech id?
-               request.setRequestId(uuid); //something to identify this request by for polling
-               
-               input.setRequestHealthDiagnostic(request);
-               
-               return parentRequest;
-       }
-       protected void submitRequest(String json) throws FileNotFoundException, IOException, InterruptedException {
-               DmaapPublisher publisher = new DmaapPublisher(this.producerFilePath);
-               publisher.send(json);
-       }
-       protected boolean pollForResponse(DmaapConsumer consumer, String uuid) throws Exception {
-               this.uuid = uuid;
-               return consumer.consume(this);
-       }
-       
-       @Override
-       public boolean continuePolling() {
-               return continuePolling;
-       }
-       
-       @Override
-       public void stopProcessingMessages() {
-               continuePolling = false;
-       }
-       @Override
-       public void processMessage(String message) throws Exception {
-               if (isHealthDiagnostic(message, this.getRequestId())) {
-                       if (!healthDiagnosticSuccessful(message)) {
-                               Optional<String> statusMessage = this.getStatusMessage(message);
-                               if (statusMessage.isPresent()) {
-                                       throw new SDNOException(statusMessage.get());
-                               } else {
-                                       throw new SDNOException();
-                               }
-                       } else {
-                               stopProcessingMessages();
-                       }
-               }
-       }
-       
-       @Override
-       public boolean isAccepted(String message) {
-               if (isResultInfo(message)) {
-                       Optional<String> code = isAccepted(message, this.getRequestId());
-                       if (code.isPresent()) {
-                               if ("202".equals(code.get())) {
-                                       return true;
-                               } else {
-                                       //TODO check other statuses 400 and 500
-                               }
-                       } else {
-                               //TODO throw error
-                       }
-               }
-               
-               return false;
-       }
-       
-       @Override
-       public String getRequestId() {
-               return uuid;
-       }
-       
-       protected Optional<String> isAccepted(String json, String uuid) {
-               return JsonPathUtil.getInstance().locateResult(json, String.format("$.result-info[?(@.status=='ACCEPTED' && @.request-id=='%s')].code", uuid));
-       }
-       
-       protected boolean isResultInfo(String json) {
-               return JsonPathUtil.getInstance().pathExists(json, "$[?(@.result-info)]");
-       }
-       
-       protected boolean isHealthDiagnostic(String json, String uuid) {
-               return JsonPathUtil.getInstance().pathExists(json, String.format("$[?(@.result-info.request-id=='%s')].%s", uuid, healthDiagnosticPath));
-       }
-       
-       protected boolean healthDiagnosticSuccessful(String json) {
-               return JsonPathUtil.getInstance().pathExists(json, "$." + healthDiagnosticPath + "[?(@.response-status=='Success')]");
-       }
-       
-       protected Optional<String> getStatusMessage(String json) {
-               return JsonPathUtil.getInstance().locateResult(json, "$." + healthDiagnosticPath + ".response-details-json");
-       }
-       
 }
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.mso.client.sdno;
+package org.openecomp.mso.client.sdno.beans;
 
 import java.io.Serializable;
 import java.util.HashMap;
@@ -41,7 +41,7 @@ public class Body implements Serializable
     @JsonProperty("input")
     private Input input;
     @JsonIgnore
-    private Map<String, Object> additionalProperties = new HashMap<>();
+    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
     private final static long serialVersionUID = 9101706044452851559L;
 
     @JsonProperty("input")
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.mso.client.sdno;
+package org.openecomp.mso.client.sdno.beans;
 
 import java.io.Serializable;
 import java.util.HashMap;
@@ -33,15 +33,17 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
 
 @JsonInclude(JsonInclude.Include.NON_NULL)
 @JsonPropertyOrder({
-    "request-healthdiagnostic"
+    "request-healthdiagnostic",
+    "request-hd-custom"
 })
 public class Input implements Serializable
 {
 
     @JsonProperty("request-healthdiagnostic")
     private RequestHealthDiagnostic RequestHealthDiagnostic;
+    
     @JsonIgnore
-    private Map<String, Object> additionalProperties = new HashMap<>();
+    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
     private final static long serialVersionUID = 7155546785389227528L;
 
     @JsonProperty("request-healthdiagnostic")
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.mso.client.sdno;
+package org.openecomp.mso.client.sdno.beans;
 
 import java.io.Serializable;
 import java.util.HashMap;
@@ -59,7 +59,7 @@ public class RequestHealthDiagnostic implements Serializable
     @JsonProperty("health-diagnostic-code")
     private String healthDiagnosticCode;
     @JsonIgnore
-    private Map<String, Object> additionalProperties = new HashMap<>();
+    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
     private final static long serialVersionUID = 1166788526178388021L;
 
     @JsonProperty("request-client-name")
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.mso.client.sdno;
+package org.openecomp.mso.client.sdno.beans;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -51,7 +51,7 @@ private String requestId;
 @JsonProperty("status")
 private String status;
 @JsonIgnore
-private Map<String, Object> additionalProperties = new HashMap<>();
+private Map<String, Object> additionalProperties = new HashMap<String, Object>();
 
 @JsonProperty("client-name")
 public String getClientName() {
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.mso.client.sdno;
+package org.openecomp.mso.client.sdno.beans;
 
 import java.io.Serializable;
 import java.util.HashMap;
@@ -34,6 +34,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
 @JsonInclude(JsonInclude.Include.NON_NULL)
 @JsonPropertyOrder({
     "operation",
+    "nodeLoc",
     "nodeType",
     "body"
 })
@@ -42,12 +43,14 @@ public class SDNO implements Serializable
 
     @JsonProperty("operation")
     private String operation;
+    @JsonProperty("nodeLoc")
+    private String nodeLoc;
     @JsonProperty("nodeType")
     private String nodeType;
     @JsonProperty("body")
     private Body body;
     @JsonIgnore
-    private Map<String, Object> additionalProperties = new HashMap<>();
+    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
     private final static long serialVersionUID = -5303297382564282650L;
 
     @JsonProperty("operation")
@@ -59,8 +62,23 @@ public class SDNO implements Serializable
     public void setOperation(String operation) {
         this.operation = operation;
     }
+    
+    @JsonProperty("nodeLoc")
+    public String getNodeLoc() {
+               return nodeLoc;
+       }
+    
+    @JsonProperty("nodeLoc")
+       public void setNodeLoc(String nodeLoc) {
+               this.nodeLoc = nodeLoc;
+       }
+    
+    public SDNO withNodeLoc(String nodeLoc) {
+       this.nodeLoc = nodeLoc;
+       return this;
+    }
 
-    public SDNO withOperation(String operation) {
+       public SDNO withOperation(String operation) {
         this.operation = operation;
         return this;
     }
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/dmaap/SDNOHealthCheckDmaapConsumer.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/dmaap/SDNOHealthCheckDmaapConsumer.java
new file mode 100644 (file)
index 0000000..f23d882
--- /dev/null
@@ -0,0 +1,156 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.client.sdno.dmaap;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Optional;
+
+import org.openecomp.mso.client.dmaap.DmaapConsumer;
+import org.openecomp.mso.client.exceptions.SDNOException;
+import org.openecomp.mso.jsonpath.JsonPathUtil;
+
+public class SDNOHealthCheckDmaapConsumer extends DmaapConsumer {
+
+       private final String uuid;
+       private boolean continuePolling = true;
+       private final static String healthDiagnosticPath = "body.output.*";
+
+       public SDNOHealthCheckDmaapConsumer() throws FileNotFoundException, IOException {
+               this("none");
+       }
+       
+       public SDNOHealthCheckDmaapConsumer(String uuid) throws FileNotFoundException, IOException {
+               super();
+               this.uuid = uuid;
+       }
+       
+       @Override
+       public String getUserName() {
+               return msoProperties.get("sdno.health-check.dmaap.username");
+       }
+
+       @Override
+       public String getPassword() {
+               return msoProperties.get("sdno.health-check.dmaap.password");
+       }
+
+       @Override
+       public String getTopic() {
+               return msoProperties.get("sdno.health-check.dmaap.subscriber.topic");
+       }
+
+       @Override
+       public boolean continuePolling() {
+               return continuePolling;
+       }
+       
+       @Override
+       public void stopProcessingMessages() {
+               continuePolling = false;
+       }
+       @Override
+       public void processMessage(String message) throws Exception {
+               if (isHealthDiagnostic(message, this.getRequestId())) {
+                       if (!healthDiagnosticSuccessful(message)) {
+                               Optional<String> statusMessage = this.getStatusMessage(message);
+                               if (statusMessage.isPresent()) {
+                                       throw new SDNOException("failed with message " + statusMessage.get());
+                               } else {
+                                       throw new SDNOException("failed with no status message");
+                               }
+                       } else {
+                               auditLogger.info("successful health diagnostic found for request: " + this.getRequestId());
+                               stopProcessingMessages();
+                       }
+               }
+       }
+       
+       @Override
+       public boolean isAccepted(String message) {
+               if (isResultInfo(message)) {
+                       Optional<String> code = isAccepted(message, this.getRequestId());
+                       if (code.isPresent()) {
+                               if ("202".equals(code.get())) {
+                                       return true;
+                               } else {
+                                       //TODO check other statuses 400 and 500
+                               }
+                       } else {
+                               //TODO throw error
+                       }
+               }
+               
+               return false;
+       }
+       
+       @Override
+       public boolean isFailure(String message) {
+               if (isResultInfo(message)) {
+                       Optional<String> code = isFailure(message, this.getRequestId());
+                       if (code.isPresent()) {
+                               if ("500".equals(code.get())) {
+                                       return true;
+                               } else {
+                                       //TODO check other statuses 400 and 500
+                               }
+                       } else {
+                               //TODO throw error
+                       }
+               }
+               
+               return false;
+       }
+       
+       @Override
+       public String getRequestId() {
+               return uuid;
+       }
+       
+       protected Optional<String> isAccepted(String json, String uuid) {
+               return JsonPathUtil.getInstance().locateResult(json, String.format("$.result-info[?(@.status=='ACCEPTED' && @.request-id=='%s')].code", uuid));
+       }
+       
+       protected Optional<String> isFailure(String json, String uuid) {
+               return JsonPathUtil.getInstance().locateResult(json, String.format("$.result-info[?(@.status=='FAILURE' && @.request-id=='%s')].code", uuid));
+       }
+       
+       protected boolean isResultInfo(String json) {
+               return JsonPathUtil.getInstance().pathExists(json, "$[?(@.result-info)]");
+       }
+       
+       protected boolean isHealthDiagnostic(String json, String uuid) {
+               return JsonPathUtil.getInstance().pathExists(json, String.format("$[?(@.result-info.request-id=='%s')].%s", uuid, healthDiagnosticPath));
+       }
+       
+       protected boolean healthDiagnosticSuccessful(String json) {
+               return JsonPathUtil.getInstance().pathExists(json, "$." + healthDiagnosticPath + "[?(@.response-status=='Success')]");
+       }
+       
+       protected Optional<String> getStatusMessage(String json) {
+               return JsonPathUtil.getInstance().locateResult(json, "$." + healthDiagnosticPath + ".error-message");
+       }
+       
+       @Override
+       public int getMaximumElapsedTime() {
+               return 300000;
+       }
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/dmaap/SDNOHealthCheckDmaapPublisher.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/dmaap/SDNOHealthCheckDmaapPublisher.java
new file mode 100644 (file)
index 0000000..73f06b8
--- /dev/null
@@ -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.openecomp.mso.client.sdno.dmaap;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.openecomp.mso.client.dmaap.DmaapPublisher;
+
+public class SDNOHealthCheckDmaapPublisher extends DmaapPublisher {
+       
+       public SDNOHealthCheckDmaapPublisher() throws FileNotFoundException, IOException {
+               super();
+       }
+       
+       @Override
+       public String getUserName() {
+               return msoProperties.get("sdno.health-check.dmaap.username");
+       }
+
+       @Override
+       public String getPassword() {
+               return msoProperties.get("sdno.health-check.dmaap.password");
+       }
+
+       @Override
+       public String getTopic() {
+               return msoProperties.get("sdno.health-check.dmaap.publisher.topic");
+       }
+       
+
+}
index d328246..772867d 100644 (file)
@@ -22,7 +22,7 @@
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
     <process-archive name="MSOCommonBPMN">
-        <process-engine>infrastructure</process-engine>
+        <process-engine>default</process-engine>
         <properties>
             <property name="isDeleteUponUndeploy">false</property>
             <property name="isScanForProcessDefinitions">true</property>
diff --git a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/applicationContext.xml b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/applicationContext.xml
deleted file mode 100644 (file)
index 6f61c8f..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<beans xmlns="http://www.springframework.org/schema/beans"\r
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-       xsi:schemaLocation="http://www.springframework.org/schema/beans\r
-                           http://www.springframework.org/schema/beans/spring-beans.xsd">\r
-\r
-  <!-- Spring bean to be invoked through the ApplicationContextElResolver -->\r
-\r
-</beans>\r
diff --git a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
deleted file mode 100644 (file)
index b68ebd9..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<!--\r
-  ============LICENSE_START=======================================================\r
-  ECOMP MSO\r
-  ================================================================================\r
-  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
-  ================================================================================\r
-  Licensed under the Apache License, Version 2.0 (the "License");\r
-  you may not use this file except in compliance with the License.\r
-  You may obtain a copy of the License at\r
-  \r
-       http://www.apache.org/licenses/LICENSE-2.0\r
-  \r
-  Unless required by applicable law or agreed to in writing, software\r
-  distributed under the License is distributed on an "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-  See the License for the specific language governing permissions and\r
-  limitations under the License.\r
-  ============LICENSE_END=========================================================\r
-  -->\r
-\r
-<jboss-deployment-structure>\r
-       <deployment>\r
-               <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->\r
-               <exclusions>\r
-                       <module name="org.apache.log4j" />\r
-                       <module name="org.slf4j" />\r
-                       <module name="org.slf4j.impl" />\r
-                       <module name="org.jboss.resteasy.resteasy-jackson-provider" />\r
-                       <module name="org.jboss.resteasy.resteasy-jettison-provider" />\r
-               </exclusions>\r
-               <dependencies>\r
-                       <module name="org.jboss.resteasy.resteasy-jackson2-provider" services="import" />\r
-                       <!-- This module contain the ProviderBase class: -->\r
-                       <module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" export="true"/>\r
-               </dependencies>\r
-       </deployment>\r
-</jboss-deployment-structure>\r
-\r
diff --git a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-web.xml b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-web.xml
deleted file mode 100644 (file)
index a9a263b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-  ============LICENSE_START=======================================================\r
-  ECOMP MSO\r
-  ================================================================================\r
-  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
-  ================================================================================\r
-  Licensed under the Apache License, Version 2.0 (the "License");\r
-  you may not use this file except in compliance with the License.\r
-  You may obtain a copy of the License at\r
-  \r
-       http://www.apache.org/licenses/LICENSE-2.0\r
-  \r
-  Unless required by applicable law or agreed to in writing, software\r
-  distributed under the License is distributed on an "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-  See the License for the specific language governing permissions and\r
-  limitations under the License.\r
-  ============LICENSE_END=========================================================\r
-  -->\r
-  \r
-<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 5.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">\r
-<jboss-web>\r
-  <security-domain>other</security-domain>\r
-  <context-root>/mso/common</context-root>\r
-</jboss-web>  \r
diff --git a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/web.xml b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644 (file)
index 3a42877..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-  ============LICENSE_START=======================================================\r
-  ECOMP MSO\r
-  ================================================================================\r
-  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
-  ================================================================================\r
-  Licensed under the Apache License, Version 2.0 (the "License");\r
-  you may not use this file except in compliance with the License.\r
-  You may obtain a copy of the License at\r
-\r
-       http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-  Unless required by applicable law or agreed to in writing, software\r
-  distributed under the License is distributed on an "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-  See the License for the specific language governing permissions and\r
-  limitations under the License.\r
-  ============LICENSE_END=========================================================\r
-  -->\r
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">\r
-  <display-name>MSO Common BPMN Workflow Servlet</display-name>\r
-  <servlet>\r
-    <servlet-name>resteasy-servlet</servlet-name>\r
-    <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>\r
-    <init-param>\r
-      <param-name>javax.ws.rs.Application</param-name>\r
-      <param-value>org.openecomp.mso.bpmn.common.workflow.service.WorkflowResourceApplication</param-value>\r
-    </init-param>\r
-  </servlet>\r
-  <servlet-mapping>\r
-    <servlet-name>resteasy-servlet</servlet-name>\r
-    <url-pattern>/*</url-pattern>\r
-  </servlet-mapping>\r
-  <context-param>\r
-    <param-name>contextConfigLocation</param-name>\r
-    <param-value>/WEB-INF/applicationContext.xml</param-value>\r
-  </context-param>\r
-  <context-param>\r
-    <param-name>mso.configuration</param-name>\r
-    <param-value>MSO_PROP_TOPOLOGY=topology.properties</param-value>\r
-  </context-param>\r
-  <context-param>\r
-    <param-name>log.configuration</param-name>\r
-    <param-value>logback.bpmn.xml</param-value>\r
-  </context-param>\r
-  <context-param>\r
-    <param-name>resteasy.resources</param-name>\r
-    <param-value>org.openecomp.mso.logger.MsoLoggingServlet,org.openecomp.mso.bpmn.core.HealthCheckHandler</param-value>\r
-  </context-param>\r
-  <listener>\r
-    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>\r
-  </listener>\r
-  <filter>\r
-    <filter-name>LogFilter</filter-name>\r
-    <filter-class>org.openecomp.mso.logger.LogFilter</filter-class>\r
-  </filter>\r
-  <filter-mapping>\r
-    <filter-name>LogFilter</filter-name>\r
-    <url-pattern>/*</url-pattern>\r
-  </filter-mapping>\r
-  <security-constraint>\r
-    <web-resource-collection>\r
-      <web-resource-name>HTTPBasicAuth</web-resource-name>\r
-      <description>Authentication for Client Apps</description>\r
-      <url-pattern>/workflow/*</url-pattern>\r
-      <http-method>GET</http-method>\r
-      <http-method>POST</http-method>\r
-    </web-resource-collection>\r
-    <auth-constraint>\r
-      <role-name>BPMN-Client</role-name>\r
-    </auth-constraint>\r
-  </security-constraint>\r
-  <login-config>\r
-    <auth-method>BASIC</auth-method>\r
-    <realm-name>ApplicationRealm</realm-name>\r
-  </login-config>\r
-  <security-role>\r
-    <role-name>BPMN-Client</role-name>\r
-  </security-role>\r
-</web-app>
\ No newline at end of file
index f60d984..eef9ed8 100644 (file)
@@ -42,7 +42,6 @@ import org.camunda.bpm.engine.variable.impl.VariableMapImpl;
 import org.jboss.resteasy.spi.AsynchronousResponse;\r
 import org.mockito.invocation.InvocationOnMock;\r
 import org.mockito.stubbing.Answer;\r
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncCommonResource;\r
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource;\r
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResource;\r
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;\r
@@ -201,7 +200,7 @@ public class BPMNUtil {
         * @param variables\r
         */\r
        private static void executeAsyncFlow(ProcessEngineServices processEngineServices, String processKey, AsynchronousResponse asyncResponse, Map<String,String> variables) {\r
-               WorkflowAsyncResource workflowResource = new WorkflowAsyncCommonResource();\r
+               WorkflowAsyncResource workflowResource = new WorkflowAsyncResource();\r
                VariableMapImpl variableMap = new VariableMapImpl();\r
 \r
                Map<String, Object> variableValueType = new HashMap<String, Object>();\r
index 51a1484..426bcee 100644 (file)
@@ -31,7 +31,7 @@ import org.camunda.bpm.engine.test.Deployment;
 import org.camunda.bpm.engine.variable.impl.VariableMapImpl;
 import org.jboss.resteasy.spi.AsynchronousResponse;
 import org.junit.Test;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncCommonResource;
+import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource;
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;
 
 public class WorkflowAsyncResourceTest extends WorkflowTest {
@@ -53,7 +53,7 @@ public class WorkflowAsyncResourceTest extends WorkflowTest {
        }
 
        private void executeWorkflow(String request, String requestId, AsynchronousResponse asyncResponse, String processKey) {
-               WorkflowAsyncCommonResource workflowResource = new WorkflowAsyncCommonResource();
+               WorkflowAsyncResource workflowResource = new WorkflowAsyncResource();
                VariableMapImpl variableMap = new VariableMapImpl();
 
                Map<String, Object> variableValueType = new HashMap<String, Object>();
index 63403f4..15dc4f4 100644 (file)
@@ -75,7 +75,6 @@ import org.openecomp.mso.bpmn.common.adapter.vnf.UpdateVnfNotification;
 import org.openecomp.mso.bpmn.common.adapter.vnf.VnfRollback;\r
 import org.openecomp.mso.bpmn.common.workflow.service.SDNCAdapterCallbackServiceImpl;\r
 import org.openecomp.mso.bpmn.common.workflow.service.VnfAdapterNotifyServiceImpl;\r
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncCommonResource;\r
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource;\r
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowMessageResource;\r
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse;\r
@@ -273,7 +272,7 @@ public class WorkflowTest {
                VariableMapImpl variableMapImpl = createVariableMapImpl(variables);\r
 \r
                System.out.println("Sending " + request + " to " + processKey + " process");\r
-               WorkflowAsyncResource workflowResource = new WorkflowAsyncCommonResource();\r
+               WorkflowAsyncResource workflowResource = new WorkflowAsyncResource();\r
                workflowResource.setProcessEngineServices4junit(processEngineRule);\r
 \r
                TestAsyncResponse asyncResponse = new TestAsyncResponse();\r
@@ -306,7 +305,7 @@ public class WorkflowTest {
                VariableMapImpl variableMapImpl = createVariableMapImpl(variables);\r
 \r
                System.out.println("Sending " + request + " to " + processKey + " process");\r
-               WorkflowAsyncResource workflowResource = new WorkflowAsyncCommonResource();\r
+               WorkflowAsyncResource workflowResource = new WorkflowAsyncResource();\r
                workflowResource.setProcessEngineServices4junit(processEngineRule);\r
 \r
                TestAsyncResponse asyncResponse = new TestAsyncResponse();\r
-/*\r
- * ============LICENSE_START======================================================= \r
- * ONAP - SO \r
- * ================================================================================ \r
- * Licensed under the Apache License, Version 2.0 (the "License"); \r
- * you may not use this file except in compliance with the License. \r
- * You may obtain a copy of the License at \r
- * \r
- *      http://www.apache.org/licenses/LICENSE-2.0 \r
- * \r
- * Unless required by applicable law or agreed to in writing, software \r
- * distributed under the License is distributed on an "AS IS" BASIS, \r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \r
- * See the License for the specific language governing permissions and \r
- * limitations under the License. \r
- * ============LICENSE_END========================================================= \r
- */ \r
-\r
-package org.openecomp.mso.bpmn.mock;\r
-\r
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.containing;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.delete;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.get;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.post;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.patch;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.put;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;\r
-\r
-\r
-/**\r
- * Reusable Mock StubResponses for AAI Endpoints\r
- *\r
- */\r
-public class StubResponseAAI {\r
-\r
-       public static void setupAllMocks() {\r
-\r
-       }\r
-\r
-\r
-       /**\r
-        * Tunnel-XConnect Mock Stub Response\r
-        */\r
-       public static void MockPutTunnelXConnect(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String tunnelId){\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId + "/tunnel-xconnects/tunnel-xconnect/" + tunnelId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)));\r
-       }\r
-\r
-\r
-       /**\r
-        * Allotted Resource Mock StubResponses below\r
-        */\r
-       public static void MockGetAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String responseFile) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockPutAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)));\r
-       }\r
-\r
-       public static void MockPutAllottedResource_500(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(500)));\r
-       }\r
-       \r
-       public static void MockDeleteAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String resourceVersion) {\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId + "[?]resource-version=" + resourceVersion))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(204)));\r
-       }\r
-       \r
-       public static void MockPatchAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {\r
-               stubFor(patch(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)));\r
-       }\r
-\r
-       public static void MockQueryAllottedResourceById(String allottedResourceId, String responseFile){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=allotted-resource[&]filter=id:EQUALS:" + allottedResourceId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-\r
-\r
-       /**\r
-        * Service Instance Mock StubResponses below\r
-        */\r
-       public static void MockGetServiceInstance(String globalCustId, String subscriptionType, String serviceInstanceId, String responseFile) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-\r
-       public static void MockGetServiceInstance_404(String customer, String serviceSubscription, String serviceInstanceId){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))\r
-                                               .willReturn(aResponse()\r
-                                               .withStatus(404)));\r
-       }\r
-\r
-       public static void MockGetServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))\r
-                                               .willReturn(aResponse()\r
-                                               .withStatus(500)));\r
-       }\r
-\r
-       public static void MockGetServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId, String responseFile){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))\r
-                                               .willReturn(aResponse()\r
-                                               .withStatus(500)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-\r
-       public static void MockNodeQueryServiceInstanceByName(String serviceInstanceName, String responseFile){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance[&]filter=service-instance-name:EQUALS:" + serviceInstanceName))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-\r
-       public static void MockNodeQueryServiceInstanceByName_404(String serviceInstanceName){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-name:EQUALS:" + serviceInstanceName))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(404)));\r
-       }\r
-\r
-       public static void MockNodeQueryServiceInstanceByName_500(String serviceInstanceName){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-name:EQUALS:" + serviceInstanceName))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(500)));\r
-       }\r
-\r
-       public static void MockNodeQueryServiceInstanceById(String serviceInstanceId, String responseFile){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance[&]filter=service-instance-id:EQUALS:" + serviceInstanceId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-\r
-       public static void MockNodeQueryServiceInstanceById_404(String serviceInstanceId){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-id:EQUALS:" + serviceInstanceId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(404)));\r
-       }\r
-\r
-       public static void MockNodeQueryServiceInstanceById_500(String serviceInstanceId){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-id:EQUALS:" + serviceInstanceId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(500)));\r
-       }\r
-\r
-       public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))\r
-                                 .willReturn(aResponse()\r
-                                 .withStatus(204)));\r
-       }\r
-       \r
-       public static void MockGetServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))\r
-                                 .willReturn(aResponse()\r
-                                 .withStatus(statusCode)));\r
-       }\r
-       \r
-       public static void MockGetServiceInstance(String customer, String serviceSubscription, String resourceVersion, int statusCode){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "[?]resource-version=" + resourceVersion))\r
-                                 .willReturn(aResponse()\r
-                                 .withStatus(200)\r
-                                 .withHeader("Content-Type", "text/xml")));\r
-       }\r
-       \r
-       public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(statusCode)));\r
-       }\r
-       \r
-       public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String resourceVersion, int statusCode){\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "[?]resource-version=" +1234))\r
-                                 .willReturn(aResponse()\r
-                                 .withStatus(statusCode)));\r
-       }\r
-\r
-       public static void MockDeleteServiceInstance_404(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))\r
-                                .willReturn(aResponse()\r
-                                 .withStatus(404)));\r
-       }\r
-\r
-       public static void MockDeleteServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))\r
-                                .willReturn(aResponse()\r
-                                 .withStatus(500)));\r
-       }\r
-\r
-       public static void MockPutServiceInstance(String globalCustId, String subscriptionType, String serviceInstanceId, String responseFile) {\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-\r
-       public static void MockPutServiceInstance_500(String globalCustId, String subscriptionType, String serviceInstanceId) {\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(500)));\r
-       }\r
-\r
-       /**\r
-        * Service-Subscription Mock StubResponses below\r
-        */\r
-       public static void MockGetServiceSubscription(String globalCustId, String subscriptionType, String responseFile) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-\r
-       public static void MockDeleteServiceSubscription(String globalCustId, String subscriptionType, int statusCode) {\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(statusCode)));\r
-       }\r
-\r
-       public static void MockDeleteServiceInstanceId(String globalCustId, String subscriptionType, String serviceInstanceId) {\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)));\r
-       }\r
-\r
-       public static void MockPutServiceSubscription(String globalCustId, String subscriptionType) {\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)));\r
-       }\r
-       \r
-       public static void MockGetServiceSubscription(String globalCustId, String subscriptionType, int statusCode) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))\r
-                               .willReturn(aResponse()\r
-                               .withStatus(statusCode)));\r
-       }\r
-\r
-       /**\r
-        * Customer Mock StubResponses below\r
-        */\r
-       public static void MockGetCustomer(String globalCustId, String responseFile) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-\r
-       public static void MockDeleteCustomer(String globalCustId) {\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)));\r
-       }\r
-\r
-       public static void MockPutCustomer(String globalCustId) {\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)));\r
-       }\r
-\r
-       public static void MockPutCustomer_500(String globalCustId) {\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(500)));\r
-       }\r
-\r
-\r
-       /**\r
-        * Generic-Vnf Mock StubResponses below\r
-        */\r
-       \r
-       public static void MockGetGenericVnfById(String vnfId, String responseFile){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=1"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetGenericVnfById(String vnfId, String responseFile, int statusCode){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(statusCode)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetGenericVnfByIdWithPriority(String vnfId, int statusCode, String responseFile) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))\r
-                               .atPriority(1)\r
-                               .willReturn(aResponse()\r
-                                       .withStatus(statusCode)\r
-                                       .withHeader("Content-Type", "text/xml")\r
-                                       .withBodyFile(responseFile)));  \r
-       }\r
-       \r
-       public static void MockGetGenericVnfByIdWithPriority(String vnfId, String vfModuleId, int statusCode, String responseFile, int priority) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))\r
-                               .atPriority(priority)\r
-                               .willReturn(aResponse()\r
-                                       .withStatus(statusCode)\r
-                                       .withHeader("Content-Type", "text/xml")\r
-                                       .withBodyFile(responseFile)));  \r
-       }\r
-\r
-       public static void MockGetGenericVnfByIdWithDepth(String vnfId, int depth, String responseFile){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=" + depth))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetGenericVnfById_404(String vnfId){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(404)));\r
-       }\r
-\r
-       public static void MockGetGenericVnfById_500(String vnfId){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(500)));\r
-       }\r
-\r
-       public static void MockGetGenericVnfByName(String vnfName, String responseFile){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetGenericVnfByNameWithDepth(String vnfName, int depth, String responseFile){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName + "[&]depth=" + depth))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-\r
-       public static void MockGetGenericVnfByName_404(String vnfName){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(404)));\r
-       }\r
-\r
-       public static void MockDeleteGenericVnf(String vnfId, String resourceVersion){\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(204)));\r
-       }\r
-\r
-       public static void MockDeleteGenericVnf(String vnfId, String resourceVersion, int statusCode){\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(statusCode)));\r
-       }\r
-\r
-       public static void MockDeleteGenericVnf_500(String vnfId, String resourceVersion){\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(500)));\r
-       }\r
-\r
-       public static void MockPutGenericVnf(String vnfId){\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)));\r
-       }\r
-       \r
-       public static void MockPutGenericVnf(String vnfId, String requestBodyContaining, int statusCode) {\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))\r
-                               .withRequestBody(containing(requestBodyContaining))\r
-                               .willReturn(aResponse()\r
-                                       .withStatus(statusCode)));\r
-       }\r
-\r
-       public static void MockPutGenericVnf(String vnfId, int statusCode) {\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))\r
-                               .willReturn(aResponse()\r
-                                       .withStatus(statusCode)));\r
-       }\r
-       \r
-       public static void MockPutGenericVnf_Bad(String vnfId, int statusCode){\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(statusCode)));\r
-       }\r
-\r
-       public static void MockPatchGenericVnf(String vnfId){\r
-               stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)));\r
-       }\r
-       /**\r
-        * Vce Mock StubResponses below\r
-        */\r
-       public static void MockGetVceById(String vnfId, String responseFile){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-\r
-       public static void MockGetVceByName(String vnfName, String responseFile){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=" + vnfName))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-\r
-       public static void MockDeleteVce(String vnfId, String resourceVersion, int statusCode){\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId + "[?]resource-version=" + resourceVersion))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(statusCode)));\r
-       }\r
-\r
-       public static void MockPutVce(String vnfId){\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)));\r
-       }\r
-       \r
-       public static void MockGetGenericVceByNameWithDepth(String vnfName, int depth, String responseFile){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=" + vnfName + "[&]depth=" + depth))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-\r
-       public static void MockGetVceGenericQuery(String serviceInstanceName, int depth, int statusCode, String responseFile){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/search/generic-query[?]key=service-instance.service-instance-name:" + serviceInstanceName + "[&]start-node-type=service-instance[&]include=vce[&]depth=" + depth))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(statusCode)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-\r
-       /**\r
-        * Tenant Mock StubResponses below\r
-        */\r
-       public static void MockGetTenantGenericQuery(String customer, String serviceType, String responseFile) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/search/generic-query[?]key=customer.global-customer-id:" + customer + "&key=service-subscription.service-type:" + serviceType + "&start-node-type=service-subscription&include=tenant&include=service-subscription&depth=1"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-\r
-       public static void MockGetTenant(String tenantId, String responseFile) {\r
-               stubFor(get(urlEqualTo("/aai/v2/cloud-infrastructure/tenants/tenant/" + tenantId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-\r
-       /**\r
-        * Network Mock StubResponses below\r
-        */\r
-       public static void MockGetNetwork(String networkId, String responseFile, int statusCode) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(statusCode)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetNetworkByIdWithDepth(String networkId, String responseFile, String depth) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId + "[?]depth=" + depth))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetNetworkCloudRegion(String responseFile, String cloudRegion) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegion))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetNetworkByName(String networkName, String responseFile) {\r
-                  stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name="+networkName))\r
-                                       .willReturn(aResponse()\r
-                                                       .withStatus(200)\r
-                                                       .withHeader("Content-Type", "text/xml")\r
-                                                       .withBodyFile(responseFile)));\r
-       }\r
-\r
-       public static void MockGetNetworkByName_404(String responseFile, String networkName) {\r
-       stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name="+networkName))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(404)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetNetworkCloudRegion_404(String cloudRegion) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegion))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(404)));\r
-       }\r
-\r
-       public static void MockPutNetwork(String networkId, int statusCode, String responseFile) {\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(statusCode)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockPutNetwork(String networkPolicyId, String responseFile, int statusCode) {\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/" + networkPolicyId))\r
-                                 .willReturn(aResponse()\r
-                                 .withStatus(statusCode)\r
-                                 .withHeader("Content-Type", "text/xml")\r
-                                 .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetNetworkName(String networkPolicyName, String responseFile, int statusCode) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name=" + networkPolicyName))\r
-                                 .willReturn(aResponse()\r
-                                 .withStatus(statusCode)\r
-                                 .withHeader("Content-Type", "text/xml")\r
-                                 .withBodyFile(responseFile)));\r
-       }\r
-\r
-       public static void MockGetNetworkVpnBinding(String responseFile, String vpnBinding) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/vpn-bindings/vpn-binding/"+vpnBinding + "[?]depth=all"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }       \r
-       \r
-       public static void MockGetNetworkPolicy(String responseFile, String policy) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/"+policy + "[?]depth=all"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetNetworkVpnBinding(String networkBindingId, String responseFile, int statusCode) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/vpn-bindings/vpn-binding/" + networkBindingId))\r
-                                 .willReturn(aResponse()\r
-                                 .withStatus(statusCode)\r
-                                 .withHeader("Content-Type", "text/xml")\r
-                                 .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetNetworkPolicy(String networkPolicy, String responseFile, int statusCode) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/" + networkPolicy))\r
-                                 .willReturn(aResponse()\r
-                                 .withStatus(statusCode)\r
-                                 .withHeader("Content-Type", "text/xml")\r
-                                 .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetNetworkTableReference(String responseFile, String tableReference) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/route-table-references/route-table-reference/"+tableReference + "[?]depth=all"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockPutNetworkIdWithDepth(String responseFile, String networkId, String depth) {\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/"+networkId+"[?]depth="+depth ))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetNetworkPolicyfqdn(String networkPolicy, String responseFile, int statusCode) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy[?]network-policy-fqdn=" + networkPolicy))\r
-                                 .willReturn(aResponse()\r
-                                 .withStatus(statusCode)\r
-                                 .withHeader("Content-Type", "text/xml")\r
-                                 .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetNetworkRouteTable(String networkRouteId, String responseFile, int statusCode) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/route-table-references/route-table-reference/" + networkRouteId))\r
-                                 .willReturn(aResponse()\r
-                                 .withStatus(statusCode)\r
-                                 .withHeader("Content-Type", "text/xml")\r
-                                 .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockPatchVfModuleId(String vnfId, String vfModuleId) {\r
-               stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)));\r
-       }\r
-       \r
-       /////////////\r
-       \r
-       public static void MockVNFAdapterRestVfModule() {\r
-               stubFor(put(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules/supercool"))\r
-                       .willReturn(aResponse()\r
-                               .withStatus(202)\r
-                               .withHeader("Content-Type", "application/xml")));\r
-               stubFor(post(urlMatching("/vnfs/v1/vnfs/.*/vf-modules"))\r
-                               .willReturn(aResponse()\r
-                                       .withStatus(202)\r
-                                       .withHeader("Content-Type", "application/xml")));\r
-               stubFor(post(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules"))\r
-                       .willReturn(aResponse()\r
-                               .withStatus(202)\r
-                               .withHeader("Content-Type", "application/xml")));\r
-               stubFor(put(urlEqualTo("/vnfs/v1/volume-groups/78987"))\r
-                       .willReturn(aResponse()\r
-                               .withStatus(202)\r
-                               .withHeader("Content-Type", "application/xml")));\r
-       }\r
-       \r
-       public static void MockDBUpdateVfModule(){\r
-               stubFor(post(urlEqualTo("/dbadapters/RequestsDbAdapter"))\r
-                       .willReturn(aResponse()\r
-                               .withStatus(200)\r
-                           .withHeader("Content-Type", "text/xml")\r
-                               .withBodyFile("VfModularity/DBUpdateResponse.xml")));\r
-       }\r
-       \r
-       // start of mocks used locally and by other VF Module unit tests\r
-       public static void MockSDNCAdapterVfModule() {\r
-               // simplified the implementation to return "success" for all requests\r
-               stubFor(post(urlEqualTo("/SDNCAdapter"))\r
-//                     .withRequestBody(containing("SvcInstanceId><"))\r
-                       .willReturn(aResponse()\r
-                               .withStatus(200)\r
-                               .withHeader("Content-Type", "text/xml")\r
-                               .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));\r
-\r
-       }\r
-       \r
-       // start of mocks used locally and by other VF Module unit tests\r
-       public static void MockAAIVfModule() {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool"))\r
-                       .atPriority(1)\r
-                       .willReturn(aResponse()\r
-                               .withStatus(200)\r
-                               .withHeader("Content-Type", "text/xml")\r
-                               .withBodyFile("VfModularity/VfModule-supercool.xml")));         \r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/lukewarm"))\r
-                       .atPriority(2)\r
-                       .willReturn(aResponse()\r
-                               .withStatus(200)\r
-                               .withHeader("Content-Type", "text/xml")\r
-                               .withBodyFile("VfModularity/VfModule-lukewarm.xml")));\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))\r
-                       .atPriority(5)\r
-                       .willReturn(aResponse()\r
-                               .withStatus(200)\r
-                               .withHeader("Content-Type", "text/xml")\r
-                               .withBodyFile("VfModularity/VfModule-new.xml")));\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask[?]depth=1"))\r
-                       .willReturn(aResponse()\r
-                               .withStatus(200)\r
-                               .withHeader("Content-Type", "text/xml")\r
-                               .withBodyFile("VfModularity/GenericVnf.xml")));\r
-               stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool"))\r
-//                     .withRequestBody(containing("PCRF"))\r
-                       .willReturn(aResponse()\r
-                               .withStatus(200)));\r
-               stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))\r
-//                             .withRequestBody(containing("PCRF"))\r
-                               .willReturn(aResponse()\r
-                                       .withStatus(200)));\r
-               // HTTP PUT stub still used by CreateAAIvfModuleVolumeGroup\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))\r
-                               .withRequestBody(containing("PCRF"))\r
-                               .willReturn(aResponse()\r
-                                       .withStatus(200)));\r
-               // HTTP PUT stub still used by DoCreateVfModuleTest\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))\r
-                               .withRequestBody(containing("MODULELABEL"))\r
-                               .willReturn(aResponse()\r
-                                       .withStatus(200)));\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group[?]volume-group-id=78987"))\r
-                       .willReturn(aResponse()\r
-                               .withStatus(200)\r
-                               .withHeader("Content-Type", "text/xml")\r
-                               .withBodyFile("VfModularity/ConfirmVolumeGroupTenantResponse.xml")));\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group[?]volume-group-id=78987"))\r
-                               .willReturn(aResponse()\r
-                               .withStatus(200)\r
-                               .withHeader("Content-Type", "text/xml")\r
-                               .withBodyFile("VfModularity/ConfirmVolumeGroupTenantResponse.xml")));\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/MDTWNJ21/volume-groups/volume-group/78987"))\r
-                       .willReturn(aResponse()\r
-                               .withStatus(200)\r
-                               .withHeader("Content-Type", "text/xml")\r
-                               .withBodyFile("VfModularity/VolumeGroup.xml")));\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups/volume-group/78987"))\r
-                               .willReturn(aResponse()\r
-                                       .withStatus(200)\r
-                                       .withHeader("Content-Type", "text/xml")\r
-                                       .withBodyFile("VfModularity/VolumeGroup.xml")));\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group/78987[?]resource-version=0000020"))\r
-                            .willReturn(aResponse()\r
-                            .withStatus(200)\r
-                            .withHeader("Content-Type", "text/xml")\r
-                            .withBodyFile("DeleteCinderVolumeV1/DeleteVolumeId_AAIResponse_Success.xml")));\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/.*"))\r
-                                 .willReturn(aResponse()\r
-                                 .withStatus(200)\r
-                                 .withHeader("Content-Type", "text/xml")\r
-                                 .withBodyFile("VfModularity/AddNetworkPolicy_AAIResponse_Success.xml")));\r
-               stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/NEWvBNGModuleId"))\r
-                               .withRequestBody(containing("NEWvBNGModuleId"))\r
-                               .willReturn(aResponse()\r
-                                       .withStatus(200)));\r
-       }\r
-\r
-       \r
-       \r
-       //////////////\r
-\r
-       /**\r
-        * Cloud infrastructure below\r
-        */\r
-       \r
-       public static void MockGetCloudRegion(String cloudRegionId, int statusCode, String responseFile) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(statusCode)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       /**\r
-        * Volume Group StubResponse below\r
-        */\r
-       public static void MockGetVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockPutVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile, int statusCode) {\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(statusCode)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetVolumeGroupByName(String cloudRegionId, String volumeGroupName, String responseFile, int statusCode) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(statusCode)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockDeleteVolumeGroupById(String cloudRegionId, String volumeGroupId, String resourceVersion, int statusCode) {\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))\r
-                                 .willReturn(aResponse()\r
-                                 .withStatus(statusCode)));\r
-       }\r
-\r
-       public static void MockGetVolumeGroupByName_404(String cloudRegionId, String volumeGroupName) {\r
-               stubFor(get(urlMatching("/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName))\r
-                               .willReturn(aResponse()\r
-                               .withStatus(404)));\r
-       }\r
-       \r
-       public static void MockDeleteVolumeGroup(String cloudRegionId, String volumeGroupId, String resourceVersion) {\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))\r
-                               .willReturn(aResponse()\r
-                               .withStatus(200)));\r
-       }\r
-       \r
-       /**\r
-        * VF-Module StubResponse below\r
-        * @param statusCode TODO\r
-        */\r
-       public static void MockGetVfModuleId(String vnfId, String vfModuleId, String responseFile, int statusCode) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(statusCode)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetVfModuleByNameWithDepth(String vnfId, String vfModuleName, int depth, String responseFile, int statusCode) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module[?]vf-module-name=" + vfModuleName + "[?]depth=" + depth))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(statusCode)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetVfModuleIdNoResponse(String vnfId, String requestContaining, String vfModuleId) {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))\r
-                               .withRequestBody(containing(requestContaining))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")));\r
-       }\r
-\r
-       public static void MockPutVfModuleIdNoResponse(String vnfId, String requestContaining, String vfModuleId) {\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId +"/vf-modules/vf-module/" +vfModuleId))\r
-                               .withRequestBody(containing(requestContaining))\r
-                               .willReturn(aResponse()\r
-                                       .withStatus(200)));\r
-       }\r
-       \r
-       public static void MockPutVfModuleId(String vnfId, String vfModuleId) {\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)));\r
-       }\r
-       \r
-       public static void MockPutVfModuleId(String vnfId, String vfModuleId, int returnCode) {\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(returnCode)));\r
-       }\r
-       \r
-       public static void MockDeleteVfModuleId(String vnfId, String vfModuleId, String resourceVersion, int returnCode) {\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId + "/[?]resource-version=" + resourceVersion))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(returnCode)));\r
-       }\r
-\r
-       public static void MockAAIVfModuleBadPatch(String endpoint, int statusCode) {\r
-               stubFor(patch(urlMatching(endpoint))\r
-                       .willReturn(aResponse()\r
-                               .withStatus(statusCode)));\r
-       }\r
-       \r
-       /* AAI Pserver Queries */\r
-       public static void MockGetPserverByVnfId(String vnfId, String responseFile, int statusCode) {\r
-               stubFor(put(urlMatching("/v10/query.*"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(statusCode)\r
-                                               .withHeader("Content-Type", "application/json")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockGetGenericVnfsByVnfId(String vnfId, String responseFile, int statusCode) {\r
-               stubFor(get(urlMatching("/v10/network/generic-vnfs/.*"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(statusCode)\r
-                                               .withHeader("Content-Type", "application/json; charset=utf-8")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-       \r
-       public static void MockSetInMaintFlagByVnfId(String vnfId, int statusCode) {\r
-               stubFor(patch(urlMatching("/v10/network/generic-vnfs/.*"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(statusCode)\r
-                                               ));\r
-       }\r
-       \r
-       //// Deprecated Stubs below - to be deleted once unit test that reference them are refactored to use common ones above ////\r
-       @Deprecated\r
-       public static void MockGetVceById(){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123?depth=1"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile("GenericFlows/getVceResponse.xml")));\r
-       }\r
-       @Deprecated\r
-       public static void MockGetVceByName(){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=testVnfName123"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile("GenericFlows/getVceByNameResponse.xml")));\r
-       }\r
-       @Deprecated\r
-       public static void MockPutVce(){\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)));\r
-       }\r
-       @Deprecated\r
-       public static void MockDeleteVce(){\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123[?]resource-version=testReVer123"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(204)));\r
-       }\r
-       @Deprecated\r
-       public static void MockDeleteVce_404(){\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123[?]resource-version=testReVer123"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(404)));\r
-       }\r
-\r
-       @Deprecated\r
-       public static void MockDeleteServiceSubscription(){\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET[?]resource-version=1234"))\r
-                                 .willReturn(aResponse()\r
-                                 .withStatus(204)));\r
-       }\r
-       @Deprecated\r
-       public static void MockGetServiceSubscription(){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))\r
-                                 .willReturn(aResponse()\r
-                                 .withStatus(200)\r
-                                 .withHeader("Content-Type", "text/xml")\r
-                                 .withBodyFile("GenericFlows/getServiceSubscription.xml")));\r
-       }\r
-       @Deprecated\r
-       public static void MockGetServiceSubscription_200Empty(){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET[?]resource-version=1234"))\r
-                                 .willReturn(aResponse()\r
-                                 .withStatus(200)\r
-                                 .withHeader("Content-Type", "text/xml")\r
-                                 .withBody(" ")));\r
-       }\r
-       @Deprecated\r
-       public static void MockGetServiceSubscription_404() {\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(404)));\r
-       }\r
-       @Deprecated\r
-       public static void MockGENPSIPutServiceInstance(){\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile("GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml")));\r
-       }\r
-\r
-       @Deprecated\r
-       public static void MockGENPSIPutServiceSubscription(){\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile("GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml")));\r
-       }\r
-       @Deprecated\r
-       public static void MockGENPSIPutServiceInstance_get500(){\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(500)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile("GenericPutServiceInstance/aaiFault.xml")));\r
-       }\r
-\r
-       @Deprecated\r
-       public static void MockGetGenericVnfById(){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile("GenericFlows/getGenericVnfByNameResponse.xml")));\r
-       }\r
-       @Deprecated\r
-       public static void MockGetGenericVnfById_404(){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(404)));\r
-       }\r
-       @Deprecated\r
-       public static void MockGetGenericVnfByName(){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile("GenericFlows/getGenericVnfResponse.xml")));\r
-       }\r
-       @Deprecated\r
-       public static void MockGetGenericVnfByName_hasRelationships(){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile("GenericFlows/getGenericVnfResponse_hasRelationships.xml")));\r
-       }\r
-       @Deprecated\r
-       public static void MockGetGenericVnfById_hasRelationships(){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)\r
-                                               .withHeader("Content-Type", "text/xml")\r
-                                               .withBodyFile("GenericFlows/getGenericVnfResponse_hasRelationships.xml")));\r
-       }\r
-       @Deprecated\r
-       public static void MockGetGenericVnfById_500(){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(500)));\r
-       }\r
-       @Deprecated\r
-       public static void MockGetGenericVnfByName_404(){\r
-               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(404)));\r
-       }\r
-       @Deprecated\r
-       public static void MockPutGenericVnf(){\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(200)));\r
-       }\r
-       @Deprecated\r
-       public static void MockPutGenericVnf_400(){\r
-               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(400)));\r
-       }\r
-       @Deprecated\r
-       public static void MockDeleteGenericVnf(){\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(204)));\r
-       }\r
-       @Deprecated\r
-       public static void MockDeleteGenericVnf_404(){\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(404)));\r
-       }\r
-       @Deprecated\r
-       public static void MockDeleteGenericVnf_500(){\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(500)));\r
-       }\r
-       @Deprecated\r
-       public static void MockDeleteGenericVnf_412(){\r
-               stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[[?]]resource-version=testReVer123"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(412)));\r
-       }\r
-\r
-}\r
+/*
+ * ============LICENSE_START======================================================= 
+ * ONAP - SO 
+ * ================================================================================ 
+ * Licensed under the Apache License, Version 2.0 (the "License"); 
+ * you may not use this file except in compliance with the License. 
+ * You may obtain a copy of the License at 
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0 
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License. 
+ * ============LICENSE_END========================================================= 
+ */ 
+
+package org.openecomp.mso.bpmn.mock;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.containing;
+import static com.github.tomakehurst.wiremock.client.WireMock.delete;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.patch;
+import static com.github.tomakehurst.wiremock.client.WireMock.put;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+
+
+/**
+ * Reusable Mock StubResponses for AAI Endpoints
+ *
+ */
+public class StubResponseAAI {
+
+       public static void setupAllMocks() {
+
+       }
+
+
+       /**
+        * Tunnel-XConnect Mock Stub Response
+        */
+       public static void MockPutTunnelXConnect(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String tunnelId){
+               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId + "/tunnel-xconnects/tunnel-xconnect/" + tunnelId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)));
+       }
+
+
+       /**
+        * Allotted Resource Mock StubResponses below
+        */
+       public static void MockGetAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String responseFile) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockPutAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
+               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)));
+       }
+
+       public static void MockPutAllottedResource_500(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
+               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
+                               .willReturn(aResponse()
+                                               .withStatus(500)));
+       }
+       
+       public static void MockDeleteAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId, String resourceVersion) {
+               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId + "[?]resource-version=" + resourceVersion))
+                               .willReturn(aResponse()
+                                               .withStatus(204)));
+       }
+       
+       public static void MockPatchAllottedResource(String globalCustId, String subscriptionType, String serviceInstanceId, String allottedResourceId) {
+               stubFor(patch(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId + "/allotted-resources/allotted-resource/" + allottedResourceId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)));
+       }
+
+       public static void MockQueryAllottedResourceById(String allottedResourceId, String responseFile){
+               stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=allotted-resource[&]filter=id:EQUALS:" + allottedResourceId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+
+
+       /**
+        * Service Instance Mock StubResponses below
+        */
+       public static void MockGetServiceInstance(String globalCustId, String subscriptionType, String serviceInstanceId, String responseFile) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+
+       public static void MockGetServiceInstance_404(String customer, String serviceSubscription, String serviceInstanceId){
+               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
+                                               .willReturn(aResponse()
+                                               .withStatus(404)));
+       }
+
+       public static void MockGetServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId){
+               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
+                                               .willReturn(aResponse()
+                                               .withStatus(500)));
+       }
+
+       public static void MockGetServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId, String responseFile){
+               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId))
+                                               .willReturn(aResponse()
+                                               .withStatus(500)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+
+       public static void MockNodeQueryServiceInstanceByName(String serviceInstanceName, String responseFile){
+               stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance[&]filter=service-instance-name:EQUALS:" + serviceInstanceName))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+
+       public static void MockNodeQueryServiceInstanceByName_404(String serviceInstanceName){
+               stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-name:EQUALS:" + serviceInstanceName))
+                               .willReturn(aResponse()
+                                               .withStatus(404)));
+       }
+
+       public static void MockNodeQueryServiceInstanceByName_500(String serviceInstanceName){
+               stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-name:EQUALS:" + serviceInstanceName))
+                               .willReturn(aResponse()
+                                               .withStatus(500)));
+       }
+
+       public static void MockNodeQueryServiceInstanceById(String serviceInstanceId, String responseFile){
+               stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance[&]filter=service-instance-id:EQUALS:" + serviceInstanceId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+
+       public static void MockNodeQueryServiceInstanceById_404(String serviceInstanceId){
+               stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-id:EQUALS:" + serviceInstanceId))
+                               .willReturn(aResponse()
+                                               .withStatus(404)));
+       }
+
+       public static void MockNodeQueryServiceInstanceById_500(String serviceInstanceId){
+               stubFor(get(urlMatching("/aai/v[0-9]+/search/nodes-query[?]search-node-type=service-instance&filter=service-instance-id:EQUALS:" + serviceInstanceId))
+                               .willReturn(aResponse()
+                                               .withStatus(500)));
+       }
+
+       public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
+               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
+                                 .willReturn(aResponse()
+                                 .withStatus(204)));
+       }
+       
+       public static void MockGetServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){
+               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
+                                 .willReturn(aResponse()
+                                 .withStatus(statusCode)));
+       }
+       
+       public static void MockGetServiceInstance(String customer, String serviceSubscription, String resourceVersion, int statusCode){
+               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "[?]resource-version=" + resourceVersion))
+                                 .willReturn(aResponse()
+                                 .withStatus(200)
+                                 .withHeader("Content-Type", "text/xml")));
+       }
+       
+       public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion, int statusCode){
+               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
+                               .willReturn(aResponse()
+                                               .withStatus(statusCode)));
+       }
+       
+       public static void MockDeleteServiceInstance(String customer, String serviceSubscription, String resourceVersion, int statusCode){
+               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "[?]resource-version=" +1234))
+                                 .willReturn(aResponse()
+                                 .withStatus(statusCode)));
+       }
+
+       public static void MockDeleteServiceInstance_404(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
+               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
+                                .willReturn(aResponse()
+                                 .withStatus(404)));
+       }
+
+       public static void MockDeleteServiceInstance_500(String customer, String serviceSubscription, String serviceInstanceId, String resourceVersion){
+               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + customer + "/service-subscriptions/service-subscription/" + serviceSubscription + "/service-instances/service-instance/" + serviceInstanceId + "[?]resource-version=" + resourceVersion))
+                                .willReturn(aResponse()
+                                 .withStatus(500)));
+       }
+
+       public static void MockPutServiceInstance(String globalCustId, String subscriptionType, String serviceInstanceId, String responseFile) {
+               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+
+       public static void MockPutServiceInstance_500(String globalCustId, String subscriptionType, String serviceInstanceId) {
+               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
+                               .willReturn(aResponse()
+                                               .withStatus(500)));
+       }
+
+       /**
+        * Service-Subscription Mock StubResponses below
+        */
+       public static void MockGetServiceSubscription(String globalCustId, String subscriptionType, String responseFile) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+
+       public static void MockDeleteServiceSubscription(String globalCustId, String subscriptionType, int statusCode) {
+               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
+                               .willReturn(aResponse()
+                                               .withStatus(statusCode)));
+       }
+
+       public static void MockDeleteServiceInstanceId(String globalCustId, String subscriptionType, String serviceInstanceId) {
+               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType + "/service-instances/service-instance/" + serviceInstanceId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)));
+       }
+
+       public static void MockPutServiceSubscription(String globalCustId, String subscriptionType) {
+               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
+                               .willReturn(aResponse()
+                                               .withStatus(200)));
+       }
+       
+       public static void MockGetServiceSubscription(String globalCustId, String subscriptionType, int statusCode) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId + "/service-subscriptions/service-subscription/" + subscriptionType))
+                               .willReturn(aResponse()
+                               .withStatus(statusCode)));
+       }
+
+       /**
+        * Customer Mock StubResponses below
+        */
+       public static void MockGetCustomer(String globalCustId, String responseFile) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+
+       public static void MockDeleteCustomer(String globalCustId) {
+               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)));
+       }
+
+       public static void MockPutCustomer(String globalCustId) {
+               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)));
+       }
+
+       public static void MockPutCustomer_500(String globalCustId) {
+               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/" + globalCustId))
+                               .willReturn(aResponse()
+                                               .withStatus(500)));
+       }
+
+
+       /**
+        * Generic-Vnf Mock StubResponses below
+        */
+       
+       public static void MockGetGenericVnfById(String vnfId, String responseFile){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=1"))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetGenericVnfById(String vnfId, String responseFile, int statusCode){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
+                               .willReturn(aResponse()
+                                               .withStatus(statusCode)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetGenericVnfByIdWithPriority(String vnfId, int statusCode, String responseFile) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
+                               .atPriority(1)
+                               .willReturn(aResponse()
+                                       .withStatus(statusCode)
+                                       .withHeader("Content-Type", "text/xml")
+                                       .withBodyFile(responseFile)));  
+       }
+       
+       public static void MockGetGenericVnfByIdWithPriority(String vnfId, String vfModuleId, int statusCode, String responseFile, int priority) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
+                               .atPriority(priority)
+                               .willReturn(aResponse()
+                                       .withStatus(statusCode)
+                                       .withHeader("Content-Type", "text/xml")
+                                       .withBodyFile(responseFile)));  
+       }
+
+       public static void MockGetGenericVnfByIdWithDepth(String vnfId, int depth, String responseFile){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]depth=" + depth))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetGenericVnfById_404(String vnfId){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
+                               .willReturn(aResponse()
+                                               .withStatus(404)));
+       }
+
+       public static void MockGetGenericVnfById_500(String vnfId){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
+                               .willReturn(aResponse()
+                                               .withStatus(500)));
+       }
+
+       public static void MockGetGenericVnfByName(String vnfName, String responseFile){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetGenericVnfByNameWithDepth(String vnfName, int depth, String responseFile){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName + "[&]depth=" + depth))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+
+       public static void MockGetGenericVnfByName_404(String vnfName){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=" + vnfName))
+                               .willReturn(aResponse()
+                                               .withStatus(404)));
+       }
+
+       public static void MockDeleteGenericVnf(String vnfId, String resourceVersion){
+               stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
+                               .willReturn(aResponse()
+                                               .withStatus(204)));
+       }
+
+       public static void MockDeleteGenericVnf(String vnfId, String resourceVersion, int statusCode){
+               stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
+                               .willReturn(aResponse()
+                                               .withStatus(statusCode)));
+       }
+
+       public static void MockDeleteGenericVnf_500(String vnfId, String resourceVersion){
+               stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "[?]resource-version=" + resourceVersion))
+                               .willReturn(aResponse()
+                                               .withStatus(500)));
+       }
+
+       public static void MockPutGenericVnf(String vnfId){
+               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)));
+       }
+       
+       public static void MockPutGenericVnf(String vnfId, String requestBodyContaining, int statusCode) {
+               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
+                               .withRequestBody(containing(requestBodyContaining))
+                               .willReturn(aResponse()
+                                       .withStatus(statusCode)));
+       }
+
+       public static void MockPutGenericVnf(String vnfId, int statusCode) {
+               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf" + vnfId))
+                               .willReturn(aResponse()
+                                       .withStatus(statusCode)));
+       }
+       
+       public static void MockPutGenericVnf_Bad(String vnfId, int statusCode){
+               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
+                               .willReturn(aResponse()
+                                               .withStatus(statusCode)));
+       }
+
+       public static void MockPatchGenericVnf(String vnfId){
+               stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)));
+       }
+       /**
+        * Vce Mock StubResponses below
+        */
+       public static void MockGetVceById(String vnfId, String responseFile){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+
+       public static void MockGetVceByName(String vnfName, String responseFile){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=" + vnfName))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+
+       public static void MockDeleteVce(String vnfId, String resourceVersion, int statusCode){
+               stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId + "[?]resource-version=" + resourceVersion))
+                               .willReturn(aResponse()
+                                               .withStatus(statusCode)));
+       }
+
+       public static void MockPutVce(String vnfId){
+               stubFor(put(urlMatching("/aai/v[0-9]+/network/vces/vce/" + vnfId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)));
+       }
+       
+       public static void MockGetGenericVceByNameWithDepth(String vnfName, int depth, String responseFile){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=" + vnfName + "[&]depth=" + depth))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+
+       public static void MockGetVceGenericQuery(String serviceInstanceName, int depth, int statusCode, String responseFile){
+               stubFor(get(urlMatching("/aai/v[0-9]+/search/generic-query[?]key=service-instance.service-instance-name:" + serviceInstanceName + "[&]start-node-type=service-instance[&]include=vce[&]depth=" + depth))
+                               .willReturn(aResponse()
+                                               .withStatus(statusCode)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+
+       /**
+        * Tenant Mock StubResponses below
+        */
+       public static void MockGetTenantGenericQuery(String customer, String serviceType, String responseFile) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/search/generic-query[?]key=customer.global-customer-id:" + customer + "&key=service-subscription.service-type:" + serviceType + "&start-node-type=service-subscription&include=tenant&include=service-subscription&depth=1"))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+
+       public static void MockGetTenant(String tenantId, String responseFile) {
+               stubFor(get(urlEqualTo("/aai/v2/cloud-infrastructure/tenants/tenant/" + tenantId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+
+       /**
+        * Network Mock StubResponses below
+        */
+       public static void MockGetNetwork(String networkId, String responseFile, int statusCode) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId))
+                               .willReturn(aResponse()
+                                               .withStatus(statusCode)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetNetworkByIdWithDepth(String networkId, String responseFile, String depth) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId + "[?]depth=" + depth))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetNetworkCloudRegion(String responseFile, String cloudRegion) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegion))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetNetworkByName(String networkName, String responseFile) {
+                  stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name="+networkName))
+                                       .willReturn(aResponse()
+                                                       .withStatus(200)
+                                                       .withHeader("Content-Type", "text/xml")
+                                                       .withBodyFile(responseFile)));
+       }
+
+       public static void MockGetNetworkByName_404(String responseFile, String networkName) {
+       stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name="+networkName))
+                               .willReturn(aResponse()
+                                               .withStatus(404)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetNetworkCloudRegion_404(String cloudRegion) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/"+cloudRegion))
+                               .willReturn(aResponse()
+                                               .withStatus(404)));
+       }
+
+       public static void MockPutNetwork(String networkId, int statusCode, String responseFile) {
+               stubFor(put(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/" + networkId))
+                               .willReturn(aResponse()
+                                               .withStatus(statusCode)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockPutNetwork(String networkPolicyId, String responseFile, int statusCode) {
+               stubFor(put(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/" + networkPolicyId))
+                                 .willReturn(aResponse()
+                                 .withStatus(statusCode)
+                                 .withHeader("Content-Type", "text/xml")
+                                 .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetNetworkName(String networkPolicyName, String responseFile, int statusCode) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network[?]network-name=" + networkPolicyName))
+                                 .willReturn(aResponse()
+                                 .withStatus(statusCode)
+                                 .withHeader("Content-Type", "text/xml")
+                                 .withBodyFile(responseFile)));
+       }
+
+       public static void MockGetNetworkVpnBinding(String responseFile, String vpnBinding) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/vpn-bindings/vpn-binding/"+vpnBinding + "[?]depth=all"))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }       
+       
+       public static void MockGetNetworkPolicy(String responseFile, String policy) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/"+policy + "[?]depth=all"))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetNetworkVpnBinding(String networkBindingId, String responseFile, int statusCode) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/vpn-bindings/vpn-binding/" + networkBindingId))
+                                 .willReturn(aResponse()
+                                 .withStatus(statusCode)
+                                 .withHeader("Content-Type", "text/xml")
+                                 .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetNetworkPolicy(String networkPolicy, String responseFile, int statusCode) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/" + networkPolicy))
+                                 .willReturn(aResponse()
+                                 .withStatus(statusCode)
+                                 .withHeader("Content-Type", "text/xml")
+                                 .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetNetworkTableReference(String responseFile, String tableReference) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/route-table-references/route-table-reference/"+tableReference + "[?]depth=all"))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockPutNetworkIdWithDepth(String responseFile, String networkId, String depth) {
+               stubFor(put(urlMatching("/aai/v[0-9]+/network/l3-networks/l3-network/"+networkId+"[?]depth="+depth ))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetNetworkPolicyfqdn(String networkPolicy, String responseFile, int statusCode) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy[?]network-policy-fqdn=" + networkPolicy))
+                                 .willReturn(aResponse()
+                                 .withStatus(statusCode)
+                                 .withHeader("Content-Type", "text/xml")
+                                 .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetNetworkRouteTable(String networkRouteId, String responseFile, int statusCode) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/route-table-references/route-table-reference/" + networkRouteId))
+                                 .willReturn(aResponse()
+                                 .withStatus(statusCode)
+                                 .withHeader("Content-Type", "text/xml")
+                                 .withBodyFile(responseFile)));
+       }
+       
+       public static void MockPatchVfModuleId(String vnfId, String vfModuleId) {
+               stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)));
+       }
+       
+       /////////////
+       
+       public static void MockVNFAdapterRestVfModule() {
+               stubFor(put(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules/supercool"))
+                       .willReturn(aResponse()
+                               .withStatus(202)
+                               .withHeader("Content-Type", "application/xml")));
+               stubFor(post(urlMatching("/vnfs/v1/vnfs/.*/vf-modules"))
+                               .willReturn(aResponse()
+                                       .withStatus(202)
+                                       .withHeader("Content-Type", "application/xml")));
+               stubFor(post(urlEqualTo("/vnfs/v1/vnfs/skask/vf-modules"))
+                       .willReturn(aResponse()
+                               .withStatus(202)
+                               .withHeader("Content-Type", "application/xml")));
+               stubFor(put(urlEqualTo("/vnfs/v1/volume-groups/78987"))
+                       .willReturn(aResponse()
+                               .withStatus(202)
+                               .withHeader("Content-Type", "application/xml")));
+       }
+       
+       public static void MockDBUpdateVfModule(){
+               stubFor(post(urlEqualTo("/dbadapters/RequestsDbAdapter"))
+                       .willReturn(aResponse()
+                               .withStatus(200)
+                           .withHeader("Content-Type", "text/xml")
+                               .withBodyFile("VfModularity/DBUpdateResponse.xml")));
+       }
+       
+       // start of mocks used locally and by other VF Module unit tests
+       public static void MockSDNCAdapterVfModule() {
+               // simplified the implementation to return "success" for all requests
+               stubFor(post(urlEqualTo("/SDNCAdapter"))
+//                     .withRequestBody(containing("SvcInstanceId><"))
+                       .willReturn(aResponse()
+                               .withStatus(200)
+                               .withHeader("Content-Type", "text/xml")
+                               .withBodyFile("VfModularity/StandardSDNCSynchResponse.xml")));
+
+       }
+       
+       // start of mocks used locally and by other VF Module unit tests
+       public static void MockAAIVfModule() {
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool"))
+                       .atPriority(1)
+                       .willReturn(aResponse()
+                               .withStatus(200)
+                               .withHeader("Content-Type", "text/xml")
+                               .withBodyFile("VfModularity/VfModule-supercool.xml")));         
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/lukewarm"))
+                       .atPriority(2)
+                       .willReturn(aResponse()
+                               .withStatus(200)
+                               .withHeader("Content-Type", "text/xml")
+                               .withBodyFile("VfModularity/VfModule-lukewarm.xml")));
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
+                       .atPriority(5)
+                       .willReturn(aResponse()
+                               .withStatus(200)
+                               .withHeader("Content-Type", "text/xml")
+                               .withBodyFile("VfModularity/VfModule-new.xml")));
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask[?]depth=1"))
+                       .willReturn(aResponse()
+                               .withStatus(200)
+                               .withHeader("Content-Type", "text/xml")
+                               .withBodyFile("VfModularity/GenericVnf.xml")));
+               stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/supercool"))
+//                     .withRequestBody(containing("PCRF"))
+                       .willReturn(aResponse()
+                               .withStatus(200)));
+               stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
+//                             .withRequestBody(containing("PCRF"))
+                               .willReturn(aResponse()
+                                       .withStatus(200)));
+               // HTTP PUT stub still used by CreateAAIvfModuleVolumeGroup
+               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
+                               .withRequestBody(containing("PCRF"))
+                               .willReturn(aResponse()
+                                       .withStatus(200)));
+               // HTTP PUT stub still used by DoCreateVfModuleTest
+               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/.*"))
+                               .withRequestBody(containing("MODULELABEL"))
+                               .willReturn(aResponse()
+                                       .withStatus(200)));
+               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group[?]volume-group-id=78987"))
+                       .willReturn(aResponse()
+                               .withStatus(200)
+                               .withHeader("Content-Type", "text/xml")
+                               .withBodyFile("VfModularity/ConfirmVolumeGroupTenantResponse.xml")));
+               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group[?]volume-group-id=78987"))
+                               .willReturn(aResponse()
+                               .withStatus(200)
+                               .withHeader("Content-Type", "text/xml")
+                               .withBodyFile("VfModularity/ConfirmVolumeGroupTenantResponse.xml")));
+               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/MDTWNJ21/volume-groups/volume-group/78987"))
+                       .willReturn(aResponse()
+                               .withStatus(200)
+                               .withHeader("Content-Type", "text/xml")
+                               .withBodyFile("VfModularity/VolumeGroup.xml")));
+               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/volume-groups/volume-group/78987"))
+                               .willReturn(aResponse()
+                                       .withStatus(200)
+                                       .withHeader("Content-Type", "text/xml")
+                                       .withBodyFile("VfModularity/VolumeGroup.xml")));
+               stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/volume-groups/volume-group/78987[?]resource-version=0000020"))
+                            .willReturn(aResponse()
+                            .withStatus(200)
+                            .withHeader("Content-Type", "text/xml")
+                            .withBodyFile("DeleteCinderVolumeV1/DeleteVolumeId_AAIResponse_Success.xml")));
+               stubFor(put(urlMatching("/aai/v[0-9]+/network/network-policies/network-policy/.*"))
+                                 .willReturn(aResponse()
+                                 .withStatus(200)
+                                 .withHeader("Content-Type", "text/xml")
+                                 .withBodyFile("VfModularity/AddNetworkPolicy_AAIResponse_Success.xml")));
+               stubFor(patch(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/skask/vf-modules/vf-module/NEWvBNGModuleId"))
+                               .withRequestBody(containing("NEWvBNGModuleId"))
+                               .willReturn(aResponse()
+                                       .withStatus(200)));
+       }
+
+       
+       
+       //////////////
+
+       /**
+        * Cloud infrastructure below
+        */
+       
+       public static void MockGetCloudRegion(String cloudRegionId, int statusCode, String responseFile) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId))
+                               .willReturn(aResponse()
+                                               .withStatus(statusCode)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       /**
+        * Volume Group StubResponse below
+        */
+       public static void MockGetVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockPutVolumeGroupById(String cloudRegionId, String volumeGroupId, String responseFile, int statusCode) {
+               stubFor(put(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId))
+                               .willReturn(aResponse()
+                                               .withStatus(statusCode)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetVolumeGroupByName(String cloudRegionId, String volumeGroupName, String responseFile, int statusCode) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName))
+                               .willReturn(aResponse()
+                                               .withStatus(statusCode)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockDeleteVolumeGroupById(String cloudRegionId, String volumeGroupId, String resourceVersion, int statusCode) {
+               stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))
+                                 .willReturn(aResponse()
+                                 .withStatus(statusCode)));
+       }
+
+       public static void MockGetVolumeGroupByName_404(String cloudRegionId, String volumeGroupName) {
+               stubFor(get(urlMatching("/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups[?]volume-group-name=" + volumeGroupName))
+                               .willReturn(aResponse()
+                               .withStatus(404)));
+       }
+       
+       public static void MockDeleteVolumeGroup(String cloudRegionId, String volumeGroupId, String resourceVersion) {
+               stubFor(delete(urlMatching("/aai/v[0-9]+/cloud-infrastructure/cloud-regions/cloud-region/att-aic/" + cloudRegionId + "/volume-groups/volume-group/" + volumeGroupId + "[?]resource-version=" + resourceVersion))
+                               .willReturn(aResponse()
+                               .withStatus(200)));
+       }
+       
+       /**
+        * VF-Module StubResponse below
+        * @param statusCode TODO
+        */
+       public static void MockGetVfModuleId(String vnfId, String vfModuleId, String responseFile, int statusCode) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
+                               .willReturn(aResponse()
+                                               .withStatus(statusCode)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetVfModuleByNameWithDepth(String vnfId, String vfModuleName, int depth, String responseFile, int statusCode) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module[?]vf-module-name=" + vfModuleName + "[?]depth=" + depth))
+                               .willReturn(aResponse()
+                                               .withStatus(statusCode)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetVfModuleIdNoResponse(String vnfId, String requestContaining, String vfModuleId) {
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
+                               .withRequestBody(containing(requestContaining))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")));
+       }
+
+       public static void MockPutVfModuleIdNoResponse(String vnfId, String requestContaining, String vfModuleId) {
+               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId +"/vf-modules/vf-module/" +vfModuleId))
+                               .withRequestBody(containing(requestContaining))
+                               .willReturn(aResponse()
+                                       .withStatus(200)));
+       }
+       
+       public static void MockPutVfModuleId(String vnfId, String vfModuleId) {
+               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
+                               .willReturn(aResponse()
+                                               .withStatus(200)));
+       }
+       
+       public static void MockPutVfModuleId(String vnfId, String vfModuleId, int returnCode) {
+               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId))
+                               .willReturn(aResponse()
+                                               .withStatus(returnCode)));
+       }
+       
+       public static void MockDeleteVfModuleId(String vnfId, String vfModuleId, String resourceVersion, int returnCode) {
+               stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/" + vnfId + "/vf-modules/vf-module/" + vfModuleId + "/[?]resource-version=" + resourceVersion))
+                               .willReturn(aResponse()
+                                               .withStatus(returnCode)));
+       }
+
+       public static void MockAAIVfModuleBadPatch(String endpoint, int statusCode) {
+               stubFor(patch(urlMatching(endpoint))
+                       .willReturn(aResponse()
+                               .withStatus(statusCode)));
+       }
+       
+       /* AAI Pserver Queries */
+       public static void MockGetPserverByVnfId(String vnfId, String responseFile, int statusCode) {
+               stubFor(put(urlMatching("/v10/query.*"))
+                               .willReturn(aResponse()
+                                               .withStatus(statusCode)
+                                               .withHeader("Content-Type", "application/json")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockGetGenericVnfsByVnfId(String vnfId, String responseFile, int statusCode) {
+               stubFor(get(urlMatching("/v10/network/generic-vnfs/.*"))
+                               .willReturn(aResponse()
+                                               .withStatus(statusCode)
+                                               .withHeader("Content-Type", "application/json; charset=utf-8")
+                                               .withBodyFile(responseFile)));
+       }
+       
+       public static void MockSetInMaintFlagByVnfId(String vnfId, int statusCode) {
+               stubFor(patch(urlMatching("/v10/network/generic-vnfs/.*"))
+                               .willReturn(aResponse()
+                                               .withStatus(statusCode)
+                                               ));
+       }
+       
+       //// Deprecated Stubs below - to be deleted once unit test that reference them are refactored to use common ones above ////
+       @Deprecated
+       public static void MockGetVceById(){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123?depth=1"))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile("GenericFlows/getVceResponse.xml")));
+       }
+       @Deprecated
+       public static void MockGetVceByName(){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/vces/vce[?]vnf-name=testVnfName123"))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile("GenericFlows/getVceByNameResponse.xml")));
+       }
+       @Deprecated
+       public static void MockPutVce(){
+               stubFor(put(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123"))
+                               .willReturn(aResponse()
+                                               .withStatus(200)));
+       }
+       @Deprecated
+       public static void MockDeleteVce(){
+               stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123[?]resource-version=testReVer123"))
+                               .willReturn(aResponse()
+                                               .withStatus(204)));
+       }
+       @Deprecated
+       public static void MockDeleteVce_404(){
+               stubFor(delete(urlMatching("/aai/v[0-9]+/network/vces/vce/testVnfId123[?]resource-version=testReVer123"))
+                               .willReturn(aResponse()
+                                               .withStatus(404)));
+       }
+
+       @Deprecated
+       public static void MockDeleteServiceSubscription(){
+               stubFor(delete(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET[?]resource-version=1234"))
+                                 .willReturn(aResponse()
+                                 .withStatus(204)));
+       }
+       @Deprecated
+       public static void MockGetServiceSubscription(){
+               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))
+                                 .willReturn(aResponse()
+                                 .withStatus(200)
+                                 .withHeader("Content-Type", "text/xml")
+                                 .withBodyFile("GenericFlows/getServiceSubscription.xml")));
+       }
+       @Deprecated
+       public static void MockGetServiceSubscription_200Empty(){
+               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET[?]resource-version=1234"))
+                                 .willReturn(aResponse()
+                                 .withStatus(200)
+                                 .withHeader("Content-Type", "text/xml")
+                                 .withBody(" ")));
+       }
+       @Deprecated
+       public static void MockGetServiceSubscription_404() {
+               stubFor(get(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))
+                               .willReturn(aResponse()
+                                               .withStatus(404)));
+       }
+       @Deprecated
+       public static void MockGENPSIPutServiceInstance(){
+               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET"))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile("GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml")));
+       }
+
+       @Deprecated
+       public static void MockGENPSIPutServiceSubscription(){
+               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET"))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile("GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml")));
+       }
+       @Deprecated
+       public static void MockGENPSIPutServiceInstance_get500(){
+               stubFor(put(urlMatching("/aai/v[0-9]+/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET"))
+                               .willReturn(aResponse()
+                                               .withStatus(500)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile("GenericPutServiceInstance/aaiFault.xml")));
+       }
+
+       @Deprecated
+       public static void MockGetGenericVnfById(){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile("GenericFlows/getGenericVnfByNameResponse.xml")));
+       }
+       @Deprecated
+       public static void MockGetGenericVnfById_404(){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
+                               .willReturn(aResponse()
+                                               .withStatus(404)));
+       }
+       @Deprecated
+       public static void MockGetGenericVnfByName(){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile("GenericFlows/getGenericVnfResponse.xml")));
+       }
+       @Deprecated
+       public static void MockGetGenericVnfByName_hasRelationships(){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile("GenericFlows/getGenericVnfResponse_hasRelationships.xml")));
+       }
+       @Deprecated
+       public static void MockGetGenericVnfById_hasRelationships(){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
+                               .willReturn(aResponse()
+                                               .withStatus(200)
+                                               .withHeader("Content-Type", "text/xml")
+                                               .withBodyFile("GenericFlows/getGenericVnfResponse_hasRelationships.xml")));
+       }
+       @Deprecated
+       public static void MockGetGenericVnfById_500(){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
+                               .willReturn(aResponse()
+                                               .withStatus(500)));
+       }
+       @Deprecated
+       public static void MockGetGenericVnfByName_404(){
+               stubFor(get(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf[?]vnf-name=testVnfName123"))
+                               .willReturn(aResponse()
+                                               .withStatus(404)));
+       }
+       @Deprecated
+       public static void MockPutGenericVnf(){
+               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
+                               .willReturn(aResponse()
+                                               .withStatus(200)));
+       }
+       @Deprecated
+       public static void MockPutGenericVnf_400(){
+               stubFor(put(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123"))
+                               .willReturn(aResponse()
+                                               .withStatus(400)));
+       }
+       @Deprecated
+       public static void MockDeleteGenericVnf(){
+               stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))
+                               .willReturn(aResponse()
+                                               .withStatus(204)));
+       }
+       @Deprecated
+       public static void MockDeleteGenericVnf_404(){
+               stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))
+                               .willReturn(aResponse()
+                                               .withStatus(404)));
+       }
+       @Deprecated
+       public static void MockDeleteGenericVnf_500(){
+               stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[?]resource-version=testReVer123"))
+                               .willReturn(aResponse()
+                                               .withStatus(500)));
+       }
+       @Deprecated
+       public static void MockDeleteGenericVnf_412(){
+               stubFor(delete(urlMatching("/aai/v[0-9]+/network/generic-vnfs/generic-vnf/testVnfId123[[?]]resource-version=testReVer123"))
+                               .willReturn(aResponse()
+                                               .withStatus(412)));
+       }
+
+}
@@ -1,94 +1,94 @@
-/*\r
- * ============LICENSE_START======================================================= \r
- * ONAP - SO \r
- * ================================================================================ \r
- * Licensed under the Apache License, Version 2.0 (the "License"); \r
- * you may not use this file except in compliance with the License. \r
- * You may obtain a copy of the License at \r
- * \r
- *      http://www.apache.org/licenses/LICENSE-2.0 \r
- * \r
- * Unless required by applicable law or agreed to in writing, software \r
- * distributed under the License is distributed on an "AS IS" BASIS, \r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \r
- * See the License for the specific language governing permissions and \r
- * limitations under the License. \r
- * ============LICENSE_END========================================================= \r
- */ \r
-\r
-package org.openecomp.mso.bpmn.mock;\r
-\r
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.containing;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.delete;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.get;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.post;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.patch;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.put;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;\r
-\r
-/**\r
- * Reusable Mock StubResponses for Policy\r
- *\r
- */\r
-public class StubResponsePolicy {\r
-\r
-       public static void setupAllMocks() {\r
-\r
-       }\r
-\r
-       // start of Policy mocks\r
-       public static void MockPolicyAbort() {          \r
-               stubFor(post(urlEqualTo("/pdp/api/getDecision"))\r
-                       .withRequestBody(containing("BB1"))\r
-                       .willReturn(aResponse()\r
-                               .withStatus(200)\r
-                               .withHeader("Content-Type", "application/json")\r
-                               .withBodyFile("policyAbortResponse.json")));\r
-               \r
-               stubFor(post(urlEqualTo("/pdp/api/getDecision"))\r
-                               .withRequestBody(containing("UPDVnfI"))\r
-                               .willReturn(aResponse()\r
-                                       .withStatus(200)\r
-                                       .withHeader("Content-Type", "application/json")\r
-                                       .withBodyFile("policyAbortResponse.json")));\r
-               \r
-               stubFor(post(urlEqualTo("/pdp/api/getDecision"))\r
-                               .withRequestBody(containing("RPLVnfI"))\r
-                               .willReturn(aResponse()\r
-                                       .withStatus(200)\r
-                                       .withHeader("Content-Type", "application/json")\r
-                                       .withBodyFile("policyAbortResponse.json")));\r
-\r
-\r
-       }\r
-       \r
-       public static void MockPolicySkip() {           \r
-               stubFor(post(urlEqualTo("/pdp/api/getDecision"))\r
-                       .withRequestBody(containing("BB1"))\r
-                       .willReturn(aResponse()\r
-                               .withStatus(200)\r
-                               .withHeader("Content-Type", "application/json")\r
-                               .withBodyFile("Policy/policySkipResponse.json")));\r
-               \r
-               stubFor(post(urlEqualTo("/pdp/api/getDecision"))\r
-                               .withRequestBody(containing("UPDVnfI"))\r
-                               .willReturn(aResponse()\r
-                                       .withStatus(200)\r
-                                       .withHeader("Content-Type", "application/json")\r
-                                       .withBodyFile("Policy/policySkipResponse.json")));\r
-               \r
-               stubFor(post(urlEqualTo("/pdp/api/getDecision"))\r
-                               .withRequestBody(containing("RPLVnfI"))\r
-                               .willReturn(aResponse()\r
-                                       .withStatus(200)\r
-                                       .withHeader("Content-Type", "application/json")\r
-                                       .withBodyFile("Policy/policySkipResponse.json")));\r
-\r
-\r
-       }\r
-       \r
-       \r
-}\r
+/*
+ * ============LICENSE_START======================================================= 
+ * ONAP - SO 
+ * ================================================================================ 
+ * Licensed under the Apache License, Version 2.0 (the "License"); 
+ * you may not use this file except in compliance with the License. 
+ * You may obtain a copy of the License at 
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0 
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License. 
+ * ============LICENSE_END========================================================= 
+ */ 
+
+package org.openecomp.mso.bpmn.mock;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.containing;
+import static com.github.tomakehurst.wiremock.client.WireMock.delete;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.patch;
+import static com.github.tomakehurst.wiremock.client.WireMock.put;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
+
+/**
+ * Reusable Mock StubResponses for Policy
+ *
+ */
+public class StubResponsePolicy {
+
+       public static void setupAllMocks() {
+
+       }
+
+       // start of Policy mocks
+       public static void MockPolicyAbort() {          
+               stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+                       .withRequestBody(containing("BB1"))
+                       .willReturn(aResponse()
+                               .withStatus(200)
+                               .withHeader("Content-Type", "application/json")
+                               .withBodyFile("policyAbortResponse.json")));
+               
+               stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+                               .withRequestBody(containing("UPDVnfI"))
+                               .willReturn(aResponse()
+                                       .withStatus(200)
+                                       .withHeader("Content-Type", "application/json")
+                                       .withBodyFile("policyAbortResponse.json")));
+               
+               stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+                               .withRequestBody(containing("RPLVnfI"))
+                               .willReturn(aResponse()
+                                       .withStatus(200)
+                                       .withHeader("Content-Type", "application/json")
+                                       .withBodyFile("policyAbortResponse.json")));
+
+
+       }
+       
+       public static void MockPolicySkip() {           
+               stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+                       .withRequestBody(containing("BB1"))
+                       .willReturn(aResponse()
+                               .withStatus(200)
+                               .withHeader("Content-Type", "application/json")
+                               .withBodyFile("Policy/policySkipResponse.json")));
+               
+               stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+                               .withRequestBody(containing("UPDVnfI"))
+                               .willReturn(aResponse()
+                                       .withStatus(200)
+                                       .withHeader("Content-Type", "application/json")
+                                       .withBodyFile("Policy/policySkipResponse.json")));
+               
+               stubFor(post(urlEqualTo("/pdp/api/getDecision"))
+                               .withRequestBody(containing("RPLVnfI"))
+                               .willReturn(aResponse()
+                                       .withStatus(200)
+                                       .withHeader("Content-Type", "application/json")
+                                       .withBodyFile("Policy/policySkipResponse.json")));
+
+
+       }
+       
+       
+}
@@ -1,69 +1,69 @@
-/*\r
- * ============LICENSE_START=======================================================\r
- * ONAP - SO\r
- * ================================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ============LICENSE_END=========================================================\r
- */\r
-\r
-/*\r
- * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.\r
- */\r
-package org.openecomp.mso.bpmn.mock;\r
-\r
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.post;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;\r
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;\r
-\r
-/**\r
- * Please describe the StubResponseSNIRO.java class\r
- *\r
- * @author cb645j\r
- */\r
-public class StubResponseSNIRO {\r
-\r
-       public static void setupAllMocks() {\r
-\r
-       }\r
-\r
-       public static void mockSNIRO() {\r
-               stubFor(post(urlEqualTo("/sniro/api/v2/placement"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(202)\r
-                                               .withHeader("Content-Type", "application/json")));\r
-       }\r
-\r
-       public static void mockSNIRO(String responseFile) {\r
-               stubFor(post(urlEqualTo("/sniro/api/v2/placement"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(202)\r
-                                               .withHeader("Content-Type", "application/json")\r
-                                               .withBodyFile(responseFile)));\r
-       }\r
-\r
-       public static void mockSNIRO_400() {\r
-               stubFor(post(urlEqualTo("/sniro/api/v2/placement"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(400)\r
-                                               .withHeader("Content-Type", "application/json")));\r
-       }\r
-\r
-       public static void mockSNIRO_500() {\r
-               stubFor(post(urlEqualTo("/sniro/api/v2/placement"))\r
-                               .willReturn(aResponse()\r
-                                               .withStatus(500)\r
-                                               .withHeader("Content-Type", "application/json")));\r
-       }\r
-\r
-}\r
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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=========================================================
+ */
+
+/*
+ * © 2014 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
+ */
+package org.openecomp.mso.bpmn.mock;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+
+/**
+ * Please describe the StubResponseSNIRO.java class
+ *
+ * @author cb645j
+ */
+public class StubResponseSNIRO {
+
+       public static void setupAllMocks() {
+
+       }
+
+       public static void mockSNIRO() {
+               stubFor(post(urlEqualTo("/sniro/api/v2/placement"))
+                               .willReturn(aResponse()
+                                               .withStatus(202)
+                                               .withHeader("Content-Type", "application/json")));
+       }
+
+       public static void mockSNIRO(String responseFile) {
+               stubFor(post(urlEqualTo("/sniro/api/v2/placement"))
+                               .willReturn(aResponse()
+                                               .withStatus(202)
+                                               .withHeader("Content-Type", "application/json")
+                                               .withBodyFile(responseFile)));
+       }
+
+       public static void mockSNIRO_400() {
+               stubFor(post(urlEqualTo("/sniro/api/v2/placement"))
+                               .willReturn(aResponse()
+                                               .withStatus(400)
+                                               .withHeader("Content-Type", "application/json")));
+       }
+
+       public static void mockSNIRO_500() {
+               stubFor(post(urlEqualTo("/sniro/api/v2/placement"))
+                               .willReturn(aResponse()
+                                               .withStatus(500)
+                                               .withHeader("Content-Type", "application/json")));
+       }
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/policy/PolicyDecisionTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/policy/PolicyDecisionTest.java
deleted file mode 100644 (file)
index 8370f74..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.client.policy;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Map;
-
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-public class PolicyDecisionTest {
-       
-       @BeforeClass
-       public static void setUp() {
-               System.setProperty("mso.config.path", "src/test/resources");
-       }
-       @Test
-       public void successReadProperties() throws IOException, Exception {
-               PolicyRestClient client = new PolicyRestClient();
-               Map<String, String> headerMap = client.headerMap;
-               
-               assertEquals("Found expected Client Auth", headerMap.get("ClientAuth"), "Basic bTAzNzQzOnBvbGljeVIwY2sk");
-               assertEquals("Found expected Authorization", headerMap.get("Authorization"), "Basic dGVzdHBkcDphbHBoYTEyMw==");
-               assertEquals("Found expected Environment", headerMap.get("Environment"), "TEST");
-               assertEquals("Has X-ECOMP-RequestID", headerMap.containsKey("X-ECOMP-RequestID"), true);
-       }
-       
-       @Test
-       @Ignore // IGNORED FOR 1710 MERGE TO ONAP
-       public void restEndpointCall() throws IOException, Exception {
-               PolicyRestClient client = new PolicyRestClient();
-               PolicyDecision decision = client.getDecision("X", "Y", "BB1", "1", "123");
-               assertEquals("Decision is correct", decision.getDecision(), "PERMIT");
-               assertEquals("Decision details is correct", decision.getDetails(), "Abort");
-       }
-/*
-       @Test
-       public void failure() throws IOException, Exception {
-               when(dmaapConsumer.getMRConsumer()).thenReturn(mrConsumer);
-               when(mrConsumer.fetch())
-                               .thenReturn(Arrays.asList(new String[] { getJson("response.json"), getJson("output-failure.json") }));
-
-               SDNOValidatorImpl validator = new SDNOValidatorImpl();
-               thrown.expect(SDNOException.class);
-               thrown.expectMessage("my message");
-               boolean result = validator.pollForResponse(dmaapConsumer, "xyz123");
-
-       }*/
-}
index 5ba7c3a..53888dd 100644 (file)
        <artifactId>spring-web</artifactId>\r
        <version>4.3.2.RELEASE</version>\r
        </dependency>\r
-       <dependency>\r
-               <groupId>org.openecomp.so</groupId>\r
-               <artifactId>MSOMockServer</artifactId>\r
-               <version>${project.version}</version>\r
-               <scope>test</scope>\r
-               <classifier>classes</classifier>\r
-       </dependency>\r
        <dependency>\r
          <groupId>org.openecomp.so</groupId>\r
          <artifactId>MSORESTClient</artifactId>\r
index d74174d..862c46a 100644 (file)
@@ -63,9 +63,9 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
        * @param - execution
        */
    public void preProcessRequest(Execution execution) {
-          def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+          def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
           execution.setVariable("prefix",Prefix)
-          utils.log("DEBUG", " *** STARTED DoCreateVnfAndModules PreProcessRequest Process*** ", isDebugEnabled)
+          utils.log("DEBUG", " *** STARTED DoCreateVnfAndModules PreProcessRequest Process*** ", isDebugLogEnabled)
           
           setBasicDBAuthHeader(execution, isDebugLogEnabled)
           try{
@@ -78,21 +78,21 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
                   String requestId = execution.getVariable("msoRequestId")
                   execution.setVariable("requestId", requestId)
                   execution.setVariable("mso-request-id", requestId)
-                  utils.log("DEBUG", "Incoming Request Id is: " + requestId, isDebugEnabled)
+                  utils.log("DEBUG", "Incoming Request Id is: " + requestId, isDebugLogEnabled)
 
                   String serviceInstanceId = execution.getVariable("serviceInstanceId")
-                  utils.log("DEBUG", "Incoming Service Instance Id is: " + serviceInstanceId, isDebugEnabled)
+                  utils.log("DEBUG", "Incoming Service Instance Id is: " + serviceInstanceId, isDebugLogEnabled)
 
                   String vnfName = execution.getVariable("vnfName")
                   execution.setVariable("CREVI_vnfName", vnfName)
-                  utils.log("DEBUG", "Incoming Vnf Name is: " + vnfName, isDebugEnabled)
+                  utils.log("DEBUG", "Incoming Vnf Name is: " + vnfName, isDebugLogEnabled)
 
                   String productFamilyId = execution.getVariable("productFamilyId")
-                  utils.log("DEBUG", "Incoming Product Family Id is: " + productFamilyId, isDebugEnabled)
+                  utils.log("DEBUG", "Incoming Product Family Id is: " + productFamilyId, isDebugLogEnabled)
 
                   String source = "VID"
                   execution.setVariable("source", source)
-                  utils.log("DEBUG", "Incoming Source is: " + source, isDebugEnabled)
+                  utils.log("DEBUG", "Incoming Source is: " + source, isDebugLogEnabled)
 
                   String lcpCloudRegionId = execution.getVariable("lcpCloudRegionId")
                   utils.log("DEBUG", "Incoming LCP Cloud Region Id is: " + lcpCloudRegionId)
@@ -101,17 +101,17 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
                   utils.log("DEBUG", "Incoming Tenant Id is: " + tenantId)
 
                   String disableRollback = execution.getVariable("disableRollback")
-                  utils.log("DEBUG", "Incoming Disable Rollback is: " + disableRollback, isDebugEnabled)
+                  utils.log("DEBUG", "Incoming Disable Rollback is: " + disableRollback, isDebugLogEnabled)
 
                   String asdcServiceModelVersion = execution.getVariable("asdcServiceModelVersion")
-                  utils.log("DEBUG", "Incoming asdcServiceModelVersion: " + asdcServiceModelVersion, isDebugEnabled)
+                  utils.log("DEBUG", "Incoming asdcServiceModelVersion: " + asdcServiceModelVersion, isDebugLogEnabled)
 
                   String vnfId = execution.getVariable("testVnfId") // for junits
                   if(isBlank(vnfId)){
                           vnfId = execution.getVariable("vnfId")
                           if (isBlank(vnfId)) {
                                   vnfId = UUID.randomUUID().toString()
-                                  utils.log("DEBUG", "Generated Vnf Id is: " + vnfId, isDebugEnabled)
+                                  utils.log("DEBUG", "Generated Vnf Id is: " + vnfId, isDebugLogEnabled)
                           }
                   }
                   execution.setVariable("vnfId", vnfId)
@@ -135,50 +135,50 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
 
 
           }catch(BpmnError b){
-                  utils.log("DEBUG", "Rethrowing MSOWorkflowException", isDebugEnabled)
+                  utils.log("DEBUG", "Rethrowing MSOWorkflowException", isDebugLogEnabled)
                   throw b
           }catch(Exception e){
-                  utils.log("DEBUG", " Error Occured in DoCreateVnfAndModules PreProcessRequest method!" + e.getMessage(), isDebugEnabled)
+                  utils.log("DEBUG", " Error Occured in DoCreateVnfAndModules PreProcessRequest method!" + e.getMessage(), isDebugLogEnabled)
                   exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf PreProcessRequest")
 
           }
-          utils.log("DEBUG", "*** COMPLETED DoCreateVnfAndModules PreProcessRequest Process ***", isDebugEnabled)
+          utils.log("DEBUG", "*** COMPLETED DoCreateVnfAndModules PreProcessRequest Process ***", isDebugLogEnabled)
    }
 
 
    public void queryCatalogDB (Execution execution) {
-          def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+          def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
           execution.setVariable("prefix",Prefix)
 
-          utils.log("DEBUG", " *** STARTED DoCreateVnfAndModules QueryCatalogDB Process *** ", isDebugEnabled)
+          utils.log("DEBUG", " *** STARTED DoCreateVnfAndModules QueryCatalogDB Process *** ", isDebugLogEnabled)
           try {
                   VnfResource vnf = null
                   ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
                   // if serviceDecomposition is specified, get info from serviceDecomposition
                   if (serviceDecomposition != null) {
-                          utils.log("DEBUG", "Getting Catalog DB data from ServiceDecomposition object: " + serviceDecomposition.toJsonString(), isDebugEnabled)
+                          utils.log("DEBUG", "Getting Catalog DB data from ServiceDecomposition object: " + serviceDecomposition.toJsonString(), isDebugLogEnabled)
                           List<VnfResource> vnfs = serviceDecomposition.getServiceVnfs()
-                          utils.log("DEBUG", "Read vnfs", isDebugEnabled)
+                          utils.log("DEBUG", "Read vnfs", isDebugLogEnabled)
                           if (vnfs == null) {
-                                  utils.log("DEBUG", "Error - vnfs are empty in serviceDecomposition object", isDebugEnabled)
+                                  utils.log("DEBUG", "Error - vnfs are empty in serviceDecomposition object", isDebugLogEnabled)
                                   exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf queryCatalogDB, vnfs are empty")
                           }
                           vnf = vnfs[0]
                           String serviceModelName = serviceDecomposition.getModelInfo().getModelName()
                           vnf.constructVnfType(serviceModelName)
                           String vnfType = vnf.getVnfType()
-                          utils.log("DEBUG", "Incoming Vnf Type is: " + vnfType, isDebugEnabled)
+                          utils.log("DEBUG", "Incoming Vnf Type is: " + vnfType, isDebugLogEnabled)
                           execution.setVariable("vnfType", vnfType)
                   }
                   else {
                           //Get Vnf Info
                           String vnfModelInfo = execution.getVariable("vnfModelInfo")
-                          utils.log("DEBUG", "vnfModelInfo: " + vnfModelInfo, isDebugEnabled)
+                          utils.log("DEBUG", "vnfModelInfo: " + vnfModelInfo, isDebugLogEnabled)
                           String vnfModelCustomizationUuid = jsonUtil.getJsonValueForKey(vnfModelInfo, "modelCustomizationUuid")
                           if (vnfModelCustomizationUuid == null) {
                                           vnfModelCustomizationUuid = ""
                           }
-                          utils.log("DEBUG", "querying Catalog DB by vnfModelCustomizationUuid: " + vnfModelCustomizationUuid, isDebugEnabled)
+                          utils.log("DEBUG", "querying Catalog DB by vnfModelCustomizationUuid: " + vnfModelCustomizationUuid, isDebugLogEnabled)
                          
                           JSONArray vnfs = cutils.getAllVnfsByVnfModelCustomizationUuid(execution,
                                                           vnfModelCustomizationUuid)
@@ -187,24 +187,24 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
                           JSONObject vnfObject = vnfs[0]
                           vnf = decomposeJsonUtil.JsonToVnfResource(vnfObject.toString())                         
                   }
-                  utils.log("DEBUG", "Read vnfResource", isDebugEnabled)
+                  utils.log("DEBUG", "Read vnfResource", isDebugLogEnabled)
                   if (vnf == null) {
-                          utils.log("DEBUG", "Error - vnf is empty in serviceDecomposition object", isDebugEnabled)
+                          utils.log("DEBUG", "Error - vnf is empty in serviceDecomposition object", isDebugLogEnabled)
                           exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf queryCatalogDB, vnf is null")
                   }
                   execution.setVariable("vnfResourceDecomposition", vnf)
 
                   List<ModuleResource> vfModules = vnf.getAllVfModuleObjects()
-                  utils.log("DEBUG", "Read vfModules", isDebugEnabled)
+                  utils.log("DEBUG", "Read vfModules", isDebugLogEnabled)
                   if (vfModules == null) {
-                          utils.log("DEBUG", "Error - vfModules are empty in serviceDecomposition object", isDebugEnabled)
+                          utils.log("DEBUG", "Error - vfModules are empty in serviceDecomposition object", isDebugLogEnabled)
                           exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf queryCatalogDB, vf modules are empty")
                   }
                                                  
                   ModuleResource baseVfModule = null
 
                   for (int i = 0; i < vfModules.size; i++) {
-                          utils.log("DEBUG", "handling VF Module ", isDebugEnabled)
+                          utils.log("DEBUG", "handling VF Module ", isDebugLogEnabled)
                           ModuleResource vfModule = vfModules[i]
                           boolean isBase = vfModule.getIsBase()
                           if (isBase) {
@@ -236,7 +236,7 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
                        execution.setVariable("addOnModulesDeployed", 0)          
 
           }catch(Exception ex) {
-                  utils.log("DEBUG", "Error Occured in DoCreateVnfAndModules QueryCatalogDB Process " + ex.getMessage(), isDebugEnabled)
+                  utils.log("DEBUG", "Error Occured in DoCreateVnfAndModules QueryCatalogDB Process " + ex.getMessage(), isDebugLogEnabled)
                   exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnfAndModules QueryCatalogDB Process")
           }
 
@@ -249,7 +249,7 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
                   execution.setVariable("vnfId", "skask")
           }
 
-          utils.log("DEBUG", "*** COMPLETED DoCreateVnfAndModules QueryCatalogDB Process ***", isDebugEnabled)
+          utils.log("DEBUG", "*** COMPLETED DoCreateVnfAndModules QueryCatalogDB Process ***", isDebugLogEnabled)
    }
 
    public void preProcessAddOnModule(Execution execution){
@@ -364,45 +364,45 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
    }   
    
    public void preProcessRollback (Execution execution) {
-          def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
-          utils.log("DEBUG"," ***** preProcessRollback ***** ", isDebugEnabled)
+          def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
+          utils.log("DEBUG"," ***** preProcessRollback ***** ", isDebugLogEnabled)
           try {
                   
                   Object workflowException = execution.getVariable("WorkflowException");
 
                   if (workflowException instanceof WorkflowException) {
-                          utils.log("DEBUG", "Prev workflowException: " + workflowException.getErrorMessage(), isDebugEnabled)
+                          utils.log("DEBUG", "Prev workflowException: " + workflowException.getErrorMessage(), isDebugLogEnabled)
                           execution.setVariable("prevWorkflowException", workflowException);
                           //execution.setVariable("WorkflowException", null);
                   }
           } catch (BpmnError e) {
-                  utils.log("DEBUG", "BPMN Error during preProcessRollback", isDebugEnabled)
+                  utils.log("DEBUG", "BPMN Error during preProcessRollback", isDebugLogEnabled)
           } catch(Exception ex) {
                   String msg = "Exception in preProcessRollback. " + ex.getMessage()
-                  utils.log("DEBUG", msg, isDebugEnabled)
+                  utils.log("DEBUG", msg, isDebugLogEnabled)
           }
-          utils.log("DEBUG"," *** Exit preProcessRollback *** ", isDebugEnabled)
+          utils.log("DEBUG"," *** Exit preProcessRollback *** ", isDebugLogEnabled)
    }
 
    public void postProcessRollback (Execution execution) {
-          def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
-          utils.log("DEBUG"," ***** postProcessRollback ***** ", isDebugEnabled)
+          def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
+          utils.log("DEBUG"," ***** postProcessRollback ***** ", isDebugLogEnabled)
           String msg = ""
           try {
                   Object workflowException = execution.getVariable("prevWorkflowException");
                   if (workflowException instanceof WorkflowException) {
-                          utils.log("DEBUG", "Setting prevException to WorkflowException: ", isDebugEnabled)
+                          utils.log("DEBUG", "Setting prevException to WorkflowException: ", isDebugLogEnabled)
                           execution.setVariable("WorkflowException", workflowException);
                   }
                   execution.setVariable("rollbackData", null)
           } catch (BpmnError b) {
-                  utils.log("DEBUG", "BPMN Error during postProcessRollback", isDebugEnabled)
+                  utils.log("DEBUG", "BPMN Error during postProcessRollback", isDebugLogEnabled)
                   throw b;
           } catch(Exception ex) {
                   msg = "Exception in postProcessRollback. " + ex.getMessage()
-                  utils.log("DEBUG", msg, isDebugEnabled)
+                  utils.log("DEBUG", msg, isDebugLogEnabled)
           }
-          utils.log("DEBUG"," *** Exit postProcessRollback *** ", isDebugEnabled)
+          utils.log("DEBUG"," *** Exit postProcessRollback *** ", isDebugLogEnabled)
    }
 
 
index 8c158db..3f7ffbf 100644 (file)
@@ -230,19 +230,10 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
                        utils.logAudit("AAI endPoint: " + endPoint)
 
                        try {
-                               RESTConfig config = new RESTConfig(endPoint);
-                               def responseData = ''
-                               def aaiRequestId = UUID.randomUUID().toString()
-                               RESTClient client = new RESTClient(config).
-                                       addHeader('X-TransactionId', aaiRequestId).
-                                       addHeader('X-FromAppId', 'MSO').
-                                       addHeader('Content-Type', 'application/xml').
-                                       addHeader('Accept','application/xml');
-                               logDebug('sending GET to AAI endpoint \'' + endPoint + '\'', isDebugLogEnabled)
-                               APIResponse response = client.httpGet()
                                utils.logAudit("createVfModule - invoking httpGet() to AAI")
+                               APIResponse response = aaiUriUtil.executeAAIGetCall(execution, endPoint)
 
-                               responseData = response.getResponseBodyAsString()
+                               def responseData = response.getResponseBodyAsString()
                                if (responseData != null) {
                                        logDebug("Received generic VNF data: " + responseData, isDebugLogEnabled)
 
index 85ff439..703ea8b 100644 (file)
@@ -40,6 +40,7 @@ import org.json.JSONArray;
 import org.apache.commons.lang3.*\r
 import org.apache.commons.codec.binary.Base64;\r
 import org.springframework.web.util.UriUtils;\r
+import static org.apache.commons.lang3.StringUtils.*\r
 \r
 /**\r
  * This groovy class supports the <class>CreateVcpeResCustService.bpmn</class> process.\r
@@ -93,6 +94,16 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
                        // initialize flow variables\r
                        InitializeProcessVariables(execution)\r
 \r
+                       //Config Inputs\r
+                       String aaiDistDelay = execution.getVariable('URN_mso_workflow_aai_distribution_delay')\r
+                       if (isBlank(aaiDistDelay)) {\r
+                               msg = "URN_mso_workflow_aai_distribution_delay is null"\r
+                               utils.log("DEBUG", msg, isDebugEnabled)\r
+                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)\r
+                       }\r
+                       execution.setVariable("aaiDistDelay", aaiDistDelay)\r
+                       utils.log("DEBUG","AAI distribution delay: " + aaiDistDelay, isDebugEnabled)\r
+\r
                        // check for incoming json message/input\r
                        String createVcpeServiceRequest = execution.getVariable("bpmnRequest")\r
                        utils.logAudit(createVcpeServiceRequest)\r
index 04eb4c7..77ef3f6 100644 (file)
@@ -135,10 +135,13 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
                        utils.log("DEBUG", "Incoming subscriptionServiceType is: " + subscriptionServiceType, isDebugEnabled)\r
                        \r
                        // extract cloud configuration\r
-                       String lcpCloudRegionId = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.cloudConfiguration.lcpCloudRegionId")\r
+                       String cloudConfiguration = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.cloudConfiguration")\r
+                       execution.setVariable("cloudConfiguration", cloudConfiguration)\r
+                       utils.log("DEBUG","cloudConfiguration: "+ cloudConfiguration, isDebugEnabled)\r
+                       String lcpCloudRegionId = jsonUtil.getJsonValue(cloudConfiguration, "lcpCloudRegionId")\r
                        execution.setVariable("lcpCloudRegionId", lcpCloudRegionId)\r
                        utils.log("DEBUG","lcpCloudRegionId: "+ lcpCloudRegionId, isDebugEnabled)\r
-                       String tenantId = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.cloudConfiguration.tenantId")\r
+                       String tenantId = jsonUtil.getJsonValue(cloudConfiguration, "tenantId")\r
                        execution.setVariable("tenantId", tenantId)\r
                        utils.log("DEBUG","tenantId: "+ tenantId, isDebugEnabled)\r
 \r
index b46721c..997757a 100644 (file)
@@ -45,6 +45,8 @@ import static org.apache.commons.lang3.StringUtils.*
  * @param - disableRollback
  * @param - failExists  - O
  * @param - serviceInstanceId
+ * @param - globalCustomerId - O
+ * @param - subscriptionServiceType - O
  * @param - parentServiceInstanceId
  * @param - allottedReourceId - O
  * @param - allottedResourceModelInfo
@@ -89,6 +91,15 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
                        execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
                        utils.log("DEBUG","SDNC Callback URL: " + sdncCallbackUrl, isDebugEnabled)
 
+                       String sdncReplDelay = execution.getVariable('URN_mso_workflow_sdnc_replication_delay')
+                       if (isBlank(sdncReplDelay)) {
+                               msg = "URN_mso_workflow_sdnc_replication_delay is null"
+                               utils.log("DEBUG", msg, isDebugEnabled)
+                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                       }
+                       execution.setVariable("sdncReplDelay", sdncReplDelay)
+                       utils.log("DEBUG","SDNC replication delay: " + sdncReplDelay, isDebugEnabled)
+
                        //Request Inputs
                        if (isBlank(execution.getVariable("serviceInstanceId"))){
                                msg = "Input serviceInstanceId is null"
@@ -312,6 +323,8 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
 
                        String allottedResourceId = execution.getVariable("allottedResourceId")
                        String serviceInstanceId = execution.getVariable("serviceInstanceId")
+                       String globalCustomerId = execution.getVariable("globalCustomerId")
+                       String subscriptionServiceType = execution.getVariable("subscriptionServiceType")
                        String parentServiceInstanceId = execution.getVariable("parentServiceInstanceId")
                        String callbackUrl = execution.getVariable("sdncCallbackUrl")
                        String requestId = execution.getVariable("msoRequestId")
@@ -365,11 +378,11 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
                                        </request-information>
                                        <service-information>
                                                <service-id></service-id>
-                                               <subscription-service-type></subscription-service-type>
+                                               <subscription-service-type>${subscriptionServiceType}</subscription-service-type>
                                                <onap-model-information></onap-model-information>
-                                               <service-instance-id>${parentServiceInstanceId}</service-instance-id>
+                                               <service-instance-id>${serviceInstanceId}</service-instance-id>
                                                <subscriber-name/>
-                                               <global-customer-id></global-customer-id>
+                                               <global-customer-id>${globalCustomerId}</global-customer-id>
                                        </service-information>
                                        <allotted-resource-information>
                                                <allotted-resource-id>${allottedResourceId}</allotted-resource-id>    
@@ -562,11 +575,6 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
 
                        String serviceInstanceId = execution.getVariable("serviceInstanceId")
                        String sdncRequestId = UUID.randomUUID().toString()
-                       
-                       String tsleep = execution.getVariable("junitSleepMs")
-                       
-                       //workaround for sdnc replication issue
-                       sleep(tsleep == null ? 5000 : tsleep as Long)
 
                        //neeed the same url as used by vfmodules
                        String SDNCGetRequest =
index c721ae8..602df6b 100644 (file)
@@ -45,6 +45,8 @@ import static org.apache.commons.lang3.StringUtils.*
  * @param - disableRollback
  * @param - failExists  - O
  * @param - serviceInstanceId
+ * @param - globalCustomerId - O
+ * @param - subscriptionServiceType - O
  * @param - parentServiceInstanceId
  * @param - allottedReourceId - O
  * @param - allottedResourceModelInfo
@@ -80,18 +82,7 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
                try {
                        String msoRequestId      = execution.getVariable("msoRequestId")
                        utils.log("DEBUG", " msoRequestId  = " + msoRequestId,  isDebugEnabled)
-
-                       if ((msoRequestId == null) || ("testRequestId".equals(msoRequestId)) || ("testRequestId123".equals(msoRequestId)))
-                       {
-                               utils.log("DEBUG"," ***** NOT sleeping 30 seconds for Junit *****",  isDebugEnabled)
-                       }
-                       else
-                       {
-                               utils.log("DEBUG"," ***** sleeping 30 seconds for AAI replication *****",  isDebugEnabled)
-                               sleep(30000);
-                               utils.log("DEBUG"," ***** sleep over *****",  isDebugEnabled)
-                       }
-
+                       
                        execution.setVariable("prefix", Prefix)
 
                        //Config Inputs
@@ -104,6 +95,15 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
                        execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
                        utils.log("DEBUG","SDNC Callback URL: " + sdncCallbackUrl, isDebugEnabled)
 
+                       String sdncReplDelay = execution.getVariable('URN_mso_workflow_sdnc_replication_delay')
+                       if (isBlank(sdncReplDelay)) {
+                               msg = "URN_mso_workflow_sdnc_replication_delay is null"
+                               utils.log("DEBUG", msg, isDebugEnabled)
+                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                       }
+                       execution.setVariable("sdncReplDelay", sdncReplDelay)
+                       utils.log("DEBUG","SDNC replication delay: " + sdncReplDelay, isDebugEnabled)
+
                        //Request Inputs
                        if (isBlank(execution.getVariable("serviceInstanceId"))){
                                msg = "Input serviceInstanceId is null"
@@ -318,6 +318,8 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
 
                        String allottedResourceId = execution.getVariable("allottedResourceId")
                        String serviceInstanceId = execution.getVariable("serviceInstanceId")
+                       String globalCustomerId = execution.getVariable("globalCustomerId")
+                       String subscriptionServiceType = execution.getVariable("subscriptionServiceType")
                        String parentServiceInstanceId = execution.getVariable("parentServiceInstanceId")
                        String serviceChainServiceInstanceId = execution.getVariable("serviceChainServiceInstanceId")
                        String callbackUrl = execution.getVariable("sdncCallbackUrl")
@@ -370,11 +372,11 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
                                        </request-information>
                                        <service-information>
                                                <service-id></service-id>
-                                               <subscription-service-type></subscription-service-type>
+                                               <subscription-service-type>${subscriptionServiceType}</subscription-service-type>
                                                <onap-model-information></onap-model-information>
-                                               <service-instance-id>${parentServiceInstanceId}</service-instance-id>
+                                               <service-instance-id>${serviceInstanceId}</service-instance-id>
                                                <subscriber-name/>
-                                               <global-customer-id></global-customer-id>
+                                               <global-customer-id>${globalCustomerId}</global-customer-id>
                                        </service-information>
                                        <allotted-resource-information>
                                                <allotted-resource-id>${allottedResourceId}</allotted-resource-id>    
@@ -565,11 +567,6 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
 
                        String serviceInstanceId = execution.getVariable("serviceInstanceId")
                        String sdncRequestId = UUID.randomUUID().toString()
-                       
-                       String tsleep = execution.getVariable("junitSleepMs")
-                       
-                       //workaround for sdnc replication issue
-                       sleep(tsleep == null ? 5000 : tsleep as Long)
 
                        //neeed the same url as used by vfmodules
                        String SDNCGetRequest =
@@ -617,8 +614,8 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
                
                        String txca = utils.getNodeXml(arData, "tunnelxconn-assignments")
                        execution.setVariable("vni", utils.getNodeText1(txca, "vni"))
-                       execution.setVariable("vgmuxBearerIP", utils.getNodeText1(txca, "vgmux_bearer_ip"))
-                       execution.setVariable("vgmuxLanIP", utils.getNodeText1(txca, "vgmux_lan_ip"))
+                       execution.setVariable("vgmuxBearerIP", utils.getNodeText1(txca, "vgmux-bearer-ip"))
+                       execution.setVariable("vgmuxLanIP", utils.getNodeText1(txca, "vgmux-lan-ip"))
                        
                        String ari = utils.getNodeXml(arData, "allotted-resource-identifiers")
                        execution.setVariable("allotedResourceName", utils.getNodeText1(ari, "allotted-resource-name"))
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowAsyncInfrastructureResource.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowAsyncInfrastructureResource.java
deleted file mode 100644 (file)
index 33b40b7..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*-\r
- * ============LICENSE_START=======================================================\r
- * ONAP - SO\r
- * ================================================================================\r
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
- * ================================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ============LICENSE_END=========================================================\r
- */\r
-\r
-package org.openecomp.mso.bpmn.infrastructure.workflow.service;\r
-\r
-import javax.ws.rs.Path;\r
-\r
-import org.camunda.bpm.engine.ProcessEngineServices;\r
-import org.camunda.bpm.engine.ProcessEngines;\r
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource;\r
-\r
-\r
-/**\r
- * \r
- * @version 1.0\r
- * Asynchronous Workflow processing using JAX RS RESTeasy implementation\r
- * Both Synchronous and Asynchronous BPMN process can benefit from this implementation since the workflow gets executed in the background\r
- * and the server thread is freed up, server scales better to process more incoming requests\r
- * \r
- * Usage: For synchronous process, when you are ready to send the response invoke the callback to write the response\r
- * For asynchronous process - the activity may send a acknowledgement response and then proceed further on executing the process\r
- */\r
-@Path("/async")\r
-public class WorkflowAsyncInfrastructureResource extends WorkflowAsyncResource {\r
-       \r
-    protected ProcessEngineServices getProcessEngineServices() {\r
-        return pes4junit.orElse(ProcessEngines.getProcessEngine("infrastructure"));\r
-    }\r
-}\r
index 1681197..80b11bb 100644 (file)
@@ -26,14 +26,10 @@ import java.util.Set;
 import javax.ws.rs.ApplicationPath;\r
 import javax.ws.rs.core.Application;\r
 \r
+import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource;\r
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowMessageResource;\r
 import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResource;\r
 \r
-/**\r
- * @version 1.0\r
- * RESTeasy workflow application which wires synchronous and asynchronous response\r
- *\r
- */\r
 @ApplicationPath("/")\r
 public class WorkflowResourceApplication extends Application {\r
     private Set<Object> singletons = new HashSet<Object>();\r
@@ -41,7 +37,7 @@ public class WorkflowResourceApplication extends Application {
 \r
     public WorkflowResourceApplication() {\r
         singletons.add(new WorkflowResource());\r
-        singletons.add(new WorkflowAsyncInfrastructureResource());\r
+        singletons.add(new WorkflowAsyncResource());\r
         singletons.add(new WorkflowMessageResource());\r
     }\r
 \r
index 4053de8..3e81a6a 100644 (file)
@@ -23,7 +23,7 @@
 <process-application\r
     xmlns="http://www.camunda.org/schema/1.0/ProcessApplication"\r
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
-  <process-engine name="infrastructure">\r
+  <process-engine name="default">\r
     <configuration>org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration</configuration>\r
     <datasource>java:jboss/datasources/ProcessEngine</datasource>\r
     <properties>\r
@@ -71,7 +71,7 @@
 \r
 \r
        <process-archive name="MSOInfrastructureBPMN">\r
-               <process-engine>infrastructure</process-engine>\r
+               <process-engine>default</process-engine>\r
                <properties>\r
                <property name="isDeleteUponUndeploy">false</property>\r
                <property name="isScanForProcessDefinitions">true</property>\r
index 02f7f48..9fe6815 100644 (file)
@@ -366,9 +366,8 @@ CreateVcpeResCustService.prepareCreateServiceInstance(execution)]]></bpmn2:scrip
         </camunda:connector>
       </bpmn2:extensionElements>
       <bpmn2:incoming>SequenceFlow_0vj46ej</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_13uceka</bpmn2:outgoing>
+      <bpmn2:outgoing>SequenceFlow_0sjpja4</bpmn2:outgoing>
     </bpmn2:serviceTask>
-    <bpmn2:sequenceFlow id="SequenceFlow_13uceka" sourceRef="updateInfraRequest" targetRef="IntermediateThrowEvent_1as6hoa" />
     <bpmn2:scriptTask id="ScriptTask_1qd3uwb" name="Post Process&#10;Create&#10;Service&#10;" scriptFormat="groovy">
       <bpmn2:incoming>SequenceFlow_1ky2sv9</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_0vj46ej</bpmn2:outgoing>
@@ -431,7 +430,7 @@ CreateVcpeResCustService.prepareCreateAllottedResourceTXC(execution)]]></bpmn2:s
       <bpmn2:linkEventDefinition name="StartService" />
     </bpmn2:intermediateCatchEvent>
     <bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_1as6hoa" name="GoToCreateAllottedResourcesTXC">
-      <bpmn2:incoming>SequenceFlow_13uceka</bpmn2:incoming>
+      <bpmn2:incoming>SequenceFlow_1db0ri1</bpmn2:incoming>
       <bpmn2:linkEventDefinition name="CreateAllottedResourcesTXC" />
     </bpmn2:intermediateThrowEvent>
     <bpmn2:sequenceFlow id="SequenceFlow_15odbkz" sourceRef="IntermediateCatchEvent_1i1nwfx" targetRef="prepareCreateService_scriptTask" />
@@ -471,36 +470,11 @@ CreateVcpeResCustService.prepareCreateAllottedResourceTXC(execution)]]></bpmn2:s
       <bpmn2:incoming>SequenceFlow_0e9e6fo</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_0hwsm6n</bpmn2:outgoing>
     </bpmn2:exclusiveGateway>
-    <bpmn2:callActivity id="CallActivity_0xt1l8t" name="Call Create BRG Allotted Resource&#10;" calledElement="DoCreateAllottedResourceBRG">
-      <bpmn2:extensionElements>
-        <camunda:in source="msoRequestId" target="msoRequestId" />
-        <camunda:in source="disableRollback" target="disableRollback" />
-        <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
-        <camunda:in source="failExists" target="failExists" />
-        <camunda:in source="serviceInstanceId" target="serviceInstanceId" />
-        <camunda:in source="parentServiceInstanceIdBRG" target="parentServiceInstanceId" />
-        <camunda:in source="allottedResourceIdBRG" target="allottedResourceId" />
-        <camunda:in source="allottedResourceModelInfoBRG" target="allottedResourceModelInfo" />
-        <camunda:in source="allottedResourceRoleBRG" target="allottedResourceRole" />
-        <camunda:out source="rollbackData" target="DCARBRG_rollbackData" />
-        <camunda:out source="rolledBack" target="rolledBack" />
-        <camunda:out source="WorkflowException" target="WorkflowException" />
-        <camunda:out source="allottedResourceId" target="DCARBRG_allottedResourceId" />
-        <camunda:out source="allottedResourceName" target="DCARBRG_allottedResourceName" />
-        <camunda:in source="allottedResourceTypeBRG" target="allottedResourceType" />
-        <camunda:in source="vni" target="vni" />
-        <camunda:in source="vgmuxBearerIP" target="vgmuxBearerIP" />
-        <camunda:in source="brgWanMacAddress" target="brgWanMacAddress" />
-      </bpmn2:extensionElements>
-      <bpmn2:incoming>SequenceFlow_0b5ztoe</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_0e9e6fo</bpmn2:outgoing>
-    </bpmn2:callActivity>
     <bpmn2:sequenceFlow id="SequenceFlow_0hwsm6n" sourceRef="ExclusiveGateway_0jqgskx" targetRef="IntermediateThrowEvent_0lt5ltv" />
     <bpmn2:sequenceFlow id="SequenceFlow_0loks1u" name="No" sourceRef="ExclusiveGateway_1xwfgxs" targetRef="ExclusiveGateway_0jqgskx" />
     <bpmn2:sequenceFlow id="SequenceFlow_0b5ztoe" name="Yes" sourceRef="ExclusiveGateway_1xwfgxs" targetRef="CallActivity_0xt1l8t">
       <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{ execution.getVariable("createBRGAR") != null && execution.getVariable("createBRGAR") == true }]]></bpmn2:conditionExpression>
     </bpmn2:sequenceFlow>
-    <bpmn2:sequenceFlow id="SequenceFlow_0e9e6fo" sourceRef="CallActivity_0xt1l8t" targetRef="ExclusiveGateway_0jqgskx" />
     <bpmn2:scriptTask id="ScriptTask_05epj75" name="Prepare to create Allotted Resources BRG" scriptFormat="groovy">
       <bpmn2:incoming>SequenceFlow_15vce9o</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_0yecpl2</bpmn2:outgoing>
@@ -595,6 +569,8 @@ CreateVcpeResCustService.prepareVnfAndModulesCreate(execution)]]></bpmn2:script>
         <camunda:out source="vgmuxLanIP" target="vgmuxLanIP" />
         <camunda:in source="allottedResourceTypeTXC" target="allottedResourceType" />
         <camunda:in source="brgWanMacAddress" target="brgWanMacAddress" />
+        <camunda:in source="globalCustomerId" target="globalCustomerId" />
+        <camunda:in source="subscriptionServiceType" target="subscriptionServiceType" />
       </bpmn2:extensionElements>
       <bpmn2:incoming>SequenceFlow_16qob4p</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_1cgpklo</bpmn2:outgoing>
@@ -616,6 +592,42 @@ def CreateVcpeResCustService= new CreateVcpeResCustService()
 CreateVcpeResCustService.validateVnfCreate(execution)]]></bpmn2:script>
     </bpmn2:scriptTask>
     <bpmn2:sequenceFlow id="SequenceFlow_0k5vcuu" sourceRef="ScriptTask_18w0jud" targetRef="ExclusiveGateway_1hlbkue" />
+    <bpmn2:callActivity id="CallActivity_0xt1l8t" name="Call Create BRG Allotted Resource&#10;" calledElement="DoCreateAllottedResourceBRG">
+      <bpmn2:extensionElements>
+        <camunda:in source="msoRequestId" target="msoRequestId" />
+        <camunda:in source="disableRollback" target="disableRollback" />
+        <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
+        <camunda:in source="failExists" target="failExists" />
+        <camunda:in source="serviceInstanceId" target="serviceInstanceId" />
+        <camunda:in source="parentServiceInstanceIdBRG" target="parentServiceInstanceId" />
+        <camunda:in source="allottedResourceIdBRG" target="allottedResourceId" />
+        <camunda:in source="allottedResourceModelInfoBRG" target="allottedResourceModelInfo" />
+        <camunda:in source="allottedResourceRoleBRG" target="allottedResourceRole" />
+        <camunda:out source="rollbackData" target="DCARBRG_rollbackData" />
+        <camunda:out source="rolledBack" target="rolledBack" />
+        <camunda:out source="WorkflowException" target="WorkflowException" />
+        <camunda:out source="allottedResourceId" target="DCARBRG_allottedResourceId" />
+        <camunda:out source="allottedResourceName" target="DCARBRG_allottedResourceName" />
+        <camunda:in source="allottedResourceTypeBRG" target="allottedResourceType" />
+        <camunda:in source="vni" target="vni" />
+        <camunda:in source="vgmuxBearerIP" target="vgmuxBearerIP" />
+        <camunda:in source="brgWanMacAddress" target="brgWanMacAddress" />
+        <camunda:in source="subscriptionServiceType" target="subscriptionServiceType" />
+        <camunda:in source="globalCustomerId" target="globalCustomerId" />
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_0b5ztoe</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_0e9e6fo</bpmn2:outgoing>
+    </bpmn2:callActivity>
+    <bpmn2:sequenceFlow id="SequenceFlow_0e9e6fo" sourceRef="CallActivity_0xt1l8t" targetRef="ExclusiveGateway_0jqgskx" />
+    <bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_1x88t9v" name="Await AAI Distribution&#10;&#10;">
+      <bpmn2:incoming>SequenceFlow_0sjpja4</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_1db0ri1</bpmn2:outgoing>
+      <bpmn2:timerEventDefinition>
+        <bpmn2:timeDuration xsi:type="bpmn2:tFormalExpression">${aaiDistDelay}</bpmn2:timeDuration>
+      </bpmn2:timerEventDefinition>
+    </bpmn2:intermediateCatchEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_0sjpja4" sourceRef="updateInfraRequest" targetRef="IntermediateCatchEvent_1x88t9v" />
+    <bpmn2:sequenceFlow id="SequenceFlow_1db0ri1" sourceRef="IntermediateCatchEvent_1x88t9v" targetRef="IntermediateThrowEvent_1as6hoa" />
   </bpmn2:process>
   <bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
   <bpmn2:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" />
@@ -913,13 +925,6 @@ CreateVcpeResCustService.validateVnfCreate(execution)]]></bpmn2:script>
       <bpmndi:BPMNShape id="ServiceTask_16yhzej_di" bpmnElement="updateInfraRequest">
         <dc:Bounds x="794" y="543" width="100" height="80" />
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_13uceka_di" bpmnElement="SequenceFlow_13uceka">
-        <di:waypoint xsi:type="dc:Point" x="894" y="583" />
-        <di:waypoint xsi:type="dc:Point" x="1053" y="583" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="974" y="568" width="0" height="0" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_1qd3uwb_di" bpmnElement="ScriptTask_1qd3uwb">
         <dc:Bounds x="623" y="543" width="100" height="80" />
       </bpmndi:BPMNShape>
@@ -1143,9 +1148,9 @@ CreateVcpeResCustService.validateVnfCreate(execution)]]></bpmn2:script>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="IntermediateThrowEvent_1as6hoa_di" bpmnElement="IntermediateThrowEvent_1as6hoa">
-        <dc:Bounds x="1056" y="565" width="36" height="36" />
+        <dc:Bounds x="1027" y="666" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1037" y="606" width="72" height="24" />
+          <dc:Bounds x="1002" y="707" width="85" height="36" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_15odbkz_di" bpmnElement="SequenceFlow_15odbkz">
@@ -1261,9 +1266,6 @@ CreateVcpeResCustService.validateVnfCreate(execution)]]></bpmn2:script>
           <dc:Bounds x="515" y="1317" width="0" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="CallActivity_0xt1l8t_di" bpmnElement="CallActivity_0xt1l8t">
-        <dc:Bounds x="400" y="1151" width="100" height="80" />
-      </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_0hwsm6n_di" bpmnElement="SequenceFlow_0hwsm6n">
         <di:waypoint xsi:type="dc:Point" x="585" y="1292" />
         <di:waypoint xsi:type="dc:Point" x="628" y="1292" />
@@ -1287,15 +1289,7 @@ CreateVcpeResCustService.validateVnfCreate(execution)]]></bpmn2:script>
         <di:waypoint xsi:type="dc:Point" x="337" y="1191" />
         <di:waypoint xsi:type="dc:Point" x="395" y="1191" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="353" y="1216.4242424242425" width="21" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_0e9e6fo_di" bpmnElement="SequenceFlow_0e9e6fo">
-        <di:waypoint xsi:type="dc:Point" x="500" y="1191" />
-        <di:waypoint xsi:type="dc:Point" x="560" y="1191" />
-        <di:waypoint xsi:type="dc:Point" x="560" y="1267" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="485" y="1166" width="0" height="12" />
+          <dc:Bounds x="354" y="1216" width="19" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_05epj75_di" bpmnElement="ScriptTask_05epj75">
@@ -1500,6 +1494,37 @@ CreateVcpeResCustService.validateVnfCreate(execution)]]></bpmn2:script>
           <dc:Bounds x="883" y="961" width="0" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="CallActivity_0xt1l8t_di" bpmnElement="CallActivity_0xt1l8t">
+        <dc:Bounds x="400" y="1151" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0e9e6fo_di" bpmnElement="SequenceFlow_0e9e6fo">
+        <di:waypoint xsi:type="dc:Point" x="500" y="1191" />
+        <di:waypoint xsi:type="dc:Point" x="560" y="1191" />
+        <di:waypoint xsi:type="dc:Point" x="560" y="1267" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="440" y="1166" width="90" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="IntermediateCatchEvent_1x88t9v_di" bpmnElement="IntermediateCatchEvent_1x88t9v">
+        <dc:Bounds x="1027" y="565" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1018" y="530" width="54" height="48" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0sjpja4_di" bpmnElement="SequenceFlow_0sjpja4">
+        <di:waypoint xsi:type="dc:Point" x="894" y="583" />
+        <di:waypoint xsi:type="dc:Point" x="1027" y="583" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="960.5" y="562" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_1db0ri1_di" bpmnElement="SequenceFlow_1db0ri1">
+        <di:waypoint xsi:type="dc:Point" x="1045" y="601" />
+        <di:waypoint xsi:type="dc:Point" x="1045" y="666" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1060" y="627.5" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </bpmn2:definitions>
index 38e1d43..88c45af 100644 (file)
@@ -253,6 +253,7 @@ DeleteVcpeResCustService.prepareServiceDelete(execution)]]></bpmn2:script>
         <camunda:out source="rolledBack" target="rolledBack" />
         <camunda:in source="lcpCloudRegionId" target="lcpCloudRegionId" />
         <camunda:in source="tenantId" target="tenantId" />
+        <camunda:in source="cloudConfiguration" target="cloudConfiguration" />
       </bpmn2:extensionElements>
       <bpmn2:incoming>SequenceFlow_128485i</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_04fys47</bpmn2:outgoing>
index a35371e..b925b00 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_DkzPAHB4EeaJwpcpVN5gXw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_DkzPAHB4EeaJwpcpVN5gXw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.9.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
   <bpmn2:process id="DoCreateAllottedResourceBRG" name="DoCreateAllottedResourceBRG" isExecutable="true">
     <bpmn2:startEvent id="StartEvent_1">
       <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
@@ -180,7 +180,7 @@ dcar.validateSDNCResp(execution, response, "activate" )]]></bpmn2:script>
       <bpmn2:outgoing>SequenceFlow_0q1hz2p</bpmn2:outgoing>
     </bpmn2:callActivity>
     <bpmn2:sequenceFlow id="SequenceFlow_1iy3cqb" sourceRef="postProcessSDNCGetResponse" targetRef="generateOutputs" />
-    <bpmn2:sequenceFlow id="SequenceFlow_1dgzhsm" sourceRef="UpdateAAIARActive" targetRef="PreProcessSDNCGet" />
+    <bpmn2:sequenceFlow id="SequenceFlow_1dgzhsm" sourceRef="UpdateAAIARActive" targetRef="IntermediateCatchEvent_1f4tse6" />
     <bpmn2:callActivity id="GetAAIParentSI" name="Get AAI  Parent ServiceInstance&#10;" calledElement="GenericGetService">
       <bpmn2:extensionElements>
         <camunda:in source="parentServiceInstanceId" target="GENGS_serviceInstanceId" />
@@ -277,8 +277,8 @@ DoCreateAllottedResourceBRG dcar = new DoCreateAllottedResourceBRG()
 dcar.updateAaiAROrchStatus(execution, "Created")]]></bpmn2:script>
     </bpmn2:scriptTask>
     <bpmn2:scriptTask id="PreProcessSDNCGet" name="PreProcess SDNC Get" scriptFormat="groovy">
-      <bpmn2:incoming>SequenceFlow_1dgzhsm</bpmn2:incoming>
       <bpmn2:incoming>SequenceFlow_0z8luou</bpmn2:incoming>
+      <bpmn2:incoming>SequenceFlow_0ec9eiq</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_030mhcm</bpmn2:outgoing>
       <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.vcpe.scripts.*
 DoCreateAllottedResourceBRG dcar = new DoCreateAllottedResourceBRG()
@@ -326,6 +326,14 @@ DoCreateAllottedResourceBRG dcar = new DoCreateAllottedResourceBRG()
 dcar.generateOutputs(execution)]]></bpmn2:script>
     </bpmn2:scriptTask>
     <bpmn2:sequenceFlow id="SequenceFlow_09xwplc" sourceRef="generateOutputs" targetRef="EndEvent_3" />
+    <bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_1f4tse6" name="Await SDNC Replication&#10;&#10;">
+      <bpmn2:incoming>SequenceFlow_1dgzhsm</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_0ec9eiq</bpmn2:outgoing>
+      <bpmn2:timerEventDefinition>
+        <bpmn2:timeDuration xsi:type="bpmn2:tFormalExpression">${sdncReplDelay}</bpmn2:timeDuration>
+      </bpmn2:timerEventDefinition>
+    </bpmn2:intermediateCatchEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_0ec9eiq" sourceRef="IntermediateCatchEvent_1f4tse6" targetRef="PreProcessSDNCGet" />
   </bpmn2:process>
   <bpmn2:error id="Error_1" name="Java Lang Exception" errorCode="java.lang.Exception" />
   <bpmn2:error id="Error_2" name="MSO Workflow Exception" errorCode="MSOWorkflowException" />
@@ -532,10 +540,9 @@ dcar.generateOutputs(execution)]]></bpmn2:script>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1dgzhsm_di" bpmnElement="SequenceFlow_1dgzhsm">
         <di:waypoint xsi:type="dc:Point" x="964" y="624" />
-        <di:waypoint xsi:type="dc:Point" x="964" y="545" />
-        <di:waypoint xsi:type="dc:Point" x="1140" y="545" />
+        <di:waypoint xsi:type="dc:Point" x="964" y="563" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="979" y="584.5" width="0" height="0" />
+          <dc:Bounds x="934" y="593.5" width="90" height="0" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="CallActivity_0e73um9_di" bpmnElement="GetAAIParentSI">
@@ -730,6 +737,19 @@ dcar.generateOutputs(execution)]]></bpmn2:script>
           <dc:Bounds x="575" y="980" width="0" height="0" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="IntermediateCatchEvent_1f4tse6_di" bpmnElement="IntermediateCatchEvent_1f4tse6">
+        <dc:Bounds x="946" y="527" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="933" y="492" width="61" height="48" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0ec9eiq_di" bpmnElement="SequenceFlow_0ec9eiq">
+        <di:waypoint xsi:type="dc:Point" x="982" y="545" />
+        <di:waypoint xsi:type="dc:Point" x="1140" y="545" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1061" y="524" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </bpmn2:definitions>
index 178534f..a240bb5 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_DkzPAHB4EeaJwpcpVN5gXw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_DkzPAHB4EeaJwpcpVN5gXw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.9.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
   <bpmn2:process id="DoCreateAllottedResourceTXC" name="DoCreateAllottedResourceTXC" isExecutable="true">
     <bpmn2:startEvent id="StartEvent_1">
       <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
@@ -180,7 +180,6 @@ dcar.validateSDNCResp(execution, response, "activate" )]]></bpmn2:script>
       <bpmn2:outgoing>SequenceFlow_0q1hz2p</bpmn2:outgoing>
     </bpmn2:callActivity>
     <bpmn2:sequenceFlow id="SequenceFlow_1iy3cqb" sourceRef="postProcessSDNCGetResponse" targetRef="generateOutputs" />
-    <bpmn2:sequenceFlow id="SequenceFlow_1dgzhsm" sourceRef="UpdateAAIARActive" targetRef="PreProcessSDNCGet" />
     <bpmn2:callActivity id="GetAAIParentSI" name="Get AAI  Parent ServiceInstance&#10;" calledElement="GenericGetService">
       <bpmn2:extensionElements>
         <camunda:in source="parentServiceInstanceId" target="GENGS_serviceInstanceId" />
@@ -262,7 +261,7 @@ dcar.postProcessRollback(execution)]]></bpmn2:script>
     </bpmn2:subProcess>
     <bpmn2:scriptTask id="UpdateAAIARActive" name="Update AAI AR Active" scriptFormat="groovy">
       <bpmn2:incoming>SequenceFlow_00i7x43</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_1dgzhsm</bpmn2:outgoing>
+      <bpmn2:outgoing>SequenceFlow_07kxd8t</bpmn2:outgoing>
       <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.vcpe.scripts.*
 
 DoCreateAllottedResourceTXC dcar = new DoCreateAllottedResourceTXC()
@@ -277,8 +276,8 @@ DoCreateAllottedResourceTXC dcar = new DoCreateAllottedResourceTXC()
 dcar.updateAaiAROrchStatus(execution, "Created")]]></bpmn2:script>
     </bpmn2:scriptTask>
     <bpmn2:scriptTask id="PreProcessSDNCGet" name="PreProcess SDNC Get" scriptFormat="groovy">
-      <bpmn2:incoming>SequenceFlow_1dgzhsm</bpmn2:incoming>
       <bpmn2:incoming>SequenceFlow_0z8luou</bpmn2:incoming>
+      <bpmn2:incoming>SequenceFlow_08hhqb2</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_030mhcm</bpmn2:outgoing>
       <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.vcpe.scripts.*
 DoCreateAllottedResourceTXC dcar = new DoCreateAllottedResourceTXC()
@@ -326,6 +325,15 @@ DoCreateAllottedResourceTXC dcar = new DoCreateAllottedResourceTXC()
 dcar.generateOutputs(execution)]]></bpmn2:script>
     </bpmn2:scriptTask>
     <bpmn2:sequenceFlow id="SequenceFlow_09xwplc" sourceRef="generateOutputs" targetRef="EndEvent_3" />
+    <bpmn2:sequenceFlow id="SequenceFlow_07kxd8t" sourceRef="UpdateAAIARActive" targetRef="IntermediateThrowEvent_0ti2fv8" />
+    <bpmn2:intermediateCatchEvent id="IntermediateThrowEvent_0ti2fv8" name="Await SDNC Replication&#10;&#10;">
+      <bpmn2:incoming>SequenceFlow_07kxd8t</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_08hhqb2</bpmn2:outgoing>
+      <bpmn2:timerEventDefinition>
+        <bpmn2:timeDuration xsi:type="bpmn2:tFormalExpression">${sdncReplDelay}</bpmn2:timeDuration>
+      </bpmn2:timerEventDefinition>
+    </bpmn2:intermediateCatchEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_08hhqb2" sourceRef="IntermediateThrowEvent_0ti2fv8" targetRef="PreProcessSDNCGet" />
   </bpmn2:process>
   <bpmn2:error id="Error_1" name="Java Lang Exception" errorCode="java.lang.Exception" />
   <bpmn2:error id="Error_2" name="MSO Workflow Exception" errorCode="MSOWorkflowException" />
@@ -530,14 +538,6 @@ dcar.generateOutputs(execution)]]></bpmn2:script>
           <dc:Bounds x="1277" y="779" width="0" height="0" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_1dgzhsm_di" bpmnElement="SequenceFlow_1dgzhsm">
-        <di:waypoint xsi:type="dc:Point" x="964" y="624" />
-        <di:waypoint xsi:type="dc:Point" x="964" y="545" />
-        <di:waypoint xsi:type="dc:Point" x="1140" y="545" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="979" y="584.5" width="0" height="0" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="CallActivity_0e73um9_di" bpmnElement="GetAAIParentSI">
         <dc:Bounds x="843" y="199" width="100" height="80" />
       </bpmndi:BPMNShape>
@@ -730,6 +730,26 @@ dcar.generateOutputs(execution)]]></bpmn2:script>
           <dc:Bounds x="575" y="980" width="0" height="0" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_07kxd8t_di" bpmnElement="SequenceFlow_07kxd8t">
+        <di:waypoint xsi:type="dc:Point" x="964" y="624" />
+        <di:waypoint xsi:type="dc:Point" x="964" y="563" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="979" y="587.5" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="IntermediateCatchEvent_038xgwf_di" bpmnElement="IntermediateThrowEvent_0ti2fv8">
+        <dc:Bounds x="946" y="527" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="933" y="492" width="61" height="48" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_08hhqb2_di" bpmnElement="SequenceFlow_08hhqb2">
+        <di:waypoint xsi:type="dc:Point" x="982" y="545" />
+        <di:waypoint xsi:type="dc:Point" x="1140" y="545" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1061" y="524" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </bpmn2:definitions>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstanceTest.groovy
new file mode 100644 (file)
index 0000000..8ccb18a
--- /dev/null
@@ -0,0 +1,160 @@
+package org.openecomp.mso.bpmn.infrastructure.scripts
+
+import com.github.tomakehurst.wiremock.junit.WireMockRule
+import org.camunda.bpm.engine.ProcessEngineServices
+import org.camunda.bpm.engine.RepositoryService
+import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
+import org.camunda.bpm.engine.repository.ProcessDefinition
+import org.camunda.bpm.engine.runtime.Execution
+import org.junit.Before
+import org.junit.BeforeClass
+import org.junit.Rule
+import org.junit.Test
+import org.mockito.MockitoAnnotations
+import org.openecomp.mso.bpmn.core.json.JsonUtils
+import org.openecomp.mso.bpmn.infrastructure.scripts.DeleteCustomE2EServiceInstance
+import org.openecomp.mso.bpmn.mock.FileUtil
+import org.openecomp.mso.bpmn.vcpe.scripts.GroovyTestBase
+
+import static org.junit.Assert.assertTrue
+import static org.junit.Assert.assertTrue
+import static org.junit.Assert.assertTrue
+import static org.mockito.Mockito.mock
+import static org.mockito.Mockito.mock
+import static org.mockito.Mockito.mock
+import static org.mockito.Mockito.mock
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+
+class DeleteCustomE2EServiceInstanceTest extends GroovyTestBase {
+
+    private static String request
+
+    @Rule
+    public WireMockRule wireMockRule = new WireMockRule(GroovyTestBase.PORT)
+
+    String Prefix = "CVRCS_"
+    String RbType = "DCRENI_"
+
+    @BeforeClass
+    public static void setUpBeforeClass() {
+        request = FileUtil.readResourceFile("__files/InfrastructureFlows/DeleteCustomE2EService.json")
+    }
+
+    @Before
+    public void init()
+    {
+        MockitoAnnotations.initMocks(this)
+    }
+
+    public DeleteCustomE2EServiceInstanceTest(){
+        super("DeleteCustomE2EServiceInstance")
+    }
+    @Test
+    public void preProcessRequestTest () {
+        ExecutionEntity mex = setupMock()
+        def map = setupMap(mex)
+        initPreProcess(mex)
+        DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance()
+        mex.setVariable("isDebugLogEnabled","true")
+        instance.preProcessRequest(mex);
+
+        verify(mex).getVariable(GroovyTestBase.DBGFLAG)
+
+        verify(mex).setVariable("globalSubscriberId", "38829939920000")
+        verify(mex).setVariable("operationId", "59960003992")
+        verify(mex).setVariable("URN_mso_adapters_openecomp_db_endpoint", "http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")
+    }
+
+    @Test
+    public void sendSyncResponseTest() {
+        ExecutionEntity mex = setupMock()
+        def map = setupMap(mex)
+        initPreProcess(mex)
+        DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance()
+        instance.sendSyncResponse(mex)
+        verify(mex).setVariable("DeleteCustomE2EServiceInstanceWorkflowResponseSent", "true")
+    }
+
+    @Test
+    public void prepareCompletionRequestTest(){
+        ExecutionEntity mex = setupMock()
+        def map = setupMap(mex)
+        initPreProcess(mex)
+        DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance()
+        instance.prepareCompletionRequest(mex)
+        String msoComplitionRequest = FileUtil.readResourceFile("__files/GenericFlows/MsoCompletionRequest.xml")
+        //verify(mex).setVariable("completionRequest", msoComplitionRequest)
+    }
+
+    @Test
+    public void sendSyncErrorTest(){
+        ExecutionEntity mex = setupMock()
+        def map = setupMap(mex)
+        initPreProcess(mex)
+        DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance()
+        instance.sendSyncError(mex)
+
+    }
+
+    @Test
+    public void prepareFalloutRequest(){
+        ExecutionEntity mex = setupMock()
+        def map = setupMap(mex)
+        initPreProcess(mex)
+        DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance()
+        instance.prepareFalloutRequest(mex)
+        String requestInfo =
+                """<request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+                                       <request-id>null</request-id>
+                                       <action>DELETE</action>
+                                       <source>null</source>
+                                  </request-info>"""
+        //verify(mex).setVariable("falloutRequest", requestInfo)
+    }
+
+    @Test
+    public void processJavaExceptionTest(){
+        ExecutionEntity mex = setupMock()
+        def map = setupMap(mex)
+        initPreProcess(mex)
+        DeleteCustomE2EServiceInstance instance = new DeleteCustomE2EServiceInstance()
+        instance.processJavaException()
+    }
+
+
+    private void initPreProcess(ExecutionEntity mex) {
+        when(mex.getVariable(GroovyTestBase.DBGFLAG)).thenReturn("true")
+        when(mex.getVariable("bpmnRequest")).thenReturn(request)
+        when(mex.getVariable("mso-request-id")).thenReturn("mri")
+        when(mex.getVariable("serviceType")).thenReturn("VoLTE")
+        when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
+        when(mex.getVariable("requestAction")).thenReturn("ra")
+        when(mex.getVariable("operationId")).thenReturn("59960003992")
+    }
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceTest.groovy
new file mode 100644 (file)
index 0000000..2cf09fe
--- /dev/null
@@ -0,0 +1,143 @@
+package org.openecomp.mso.bpmn.infrastructure.scripts
+
+import com.github.tomakehurst.wiremock.junit.WireMockRule
+import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
+import org.junit.Before
+import org.junit.BeforeClass
+import org.junit.Ignore
+import org.junit.Rule
+import org.junit.Test
+import org.mockito.MockitoAnnotations
+import org.openecomp.mso.bpmn.infrastructure.scripts.DoCustomDeleteE2EServiceInstance
+import org.openecomp.mso.bpmn.mock.FileUtil
+import org.openecomp.mso.bpmn.vcpe.scripts.GroovyTestBase
+
+import static org.mockito.Mockito.verify
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+import static org.mockito.Mockito.when
+
+class DoCustomDeleteE2EServiceInstanceTest extends GroovyTestBase {
+
+    private static String request
+
+    @Rule
+    public WireMockRule wireMockRule = new WireMockRule(GroovyTestBase.PORT)
+
+    String Prefix = "CVRCS_"
+    String RbType = "DCRENI_"
+
+    @BeforeClass
+    public static void setUpBeforeClass() {
+        request = FileUtil.readResourceFile("__files/InfrastructureFlows/DeleteCustomE2EService.json")
+    }
+
+    @Before
+    public void init()
+    {
+        MockitoAnnotations.initMocks(this)
+    }
+    public DoCustomDeleteE2EServiceInstanceTest(){
+        super("DoCustomDeleteE2EServiceInstance")
+    }
+
+    @Test
+    public void preProcessRequestTest(){
+
+        ExecutionEntity mex = setupMock()
+        def map = setupMap(mex)
+        initPreProcess(mex)
+
+        DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance()
+        instance.preProcessRequest(mex)
+        verify(mex).setVariable("sdncCallbackUrl", "/mso/sdncadapter/")
+        verify(mex).setVariable("siParamsXml", "")
+    }
+
+    @Ignore
+    @Test
+    public void postProcessAAIGETTest(){
+        ExecutionEntity mex = setupMock()
+        def map = setupMap(mex)
+        initPreProcess(mex)
+        when(mex.getVariable("GENGS_SuccessIndicator")).thenReturn(true)
+
+        String aaiGetResponse = FileUtil.readResourceFile("__files/GenericFlows/aaiGetResponse.xml")
+        when(mex.getVariable("GENGS_service")).thenReturn(aaiGetResponse)
+        DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance()
+        instance.postProcessAAIGET(mex)
+               // TODO: what to test here?
+//        verify(mex).setVariable("subscriptionServiceType", "e2eserviceInstance/delete")
+    }
+
+    @Ignore
+    @Test
+    public void preInitResourcesOperStatusTest(){
+        ExecutionEntity mex = setupMock()
+        def map = setupMap(mex)
+        initPreProcess(mex)
+        when(mex.getVariable("serviceRelationShip")).thenReturn("[{\"resourceInstanceId\":\"3333\",\"resourceType\":\"overlay\"},{\"resourceInstanceId\":\"4444\",\"resourceType\":\"underlay\"},{\"resourceInstanceId\":\"1111\",\"resourceType\":\"vIMS\"},{\"resourceInstanceId\":\"222\",\"resourceType\":\"vEPC\"}]")
+        DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance()
+        instance.preInitResourcesOperStatus(mex)
+               // TODO: what to test here?
+//        verify(mex).setVariable("CVFMI_dbAdapterEndpoint", "http://localhost:8080/mso")
+    }
+
+    @Test
+    public void preResourceDeleteTest() {
+        ExecutionEntity mex = setupMock()
+        def map = setupMap(mex)
+        initPreProcess(mex)
+        when(mex.getVariable("serviceRelationShip")).thenReturn("[{\"resourceInstanceId\":\"3333\",\"resourceType\":\"overlay\"},{\"resourceInstanceId\":\"4444\",\"resourceType\":\"underlay\"},{\"resourceInstanceId\":\"1111\",\"resourceType\":\"vIMS\"},{\"resourceInstanceId\":\"222\",\"resourceType\":\"vEPC\"}]")
+        DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance()
+        instance.preResourceDelete(mex,"overlay")
+        verify(mex).setVariable("resourceType", "overlay")
+    }
+
+    @Ignore
+    @Test
+    public void postProcessSDNCDeleteTest(){
+        ExecutionEntity mex = setupMock()
+        def map = setupMap(mex)
+        initPreProcess(mex)
+        when(mex.getVariable("SDNCA_SuccessIndicator")).thenReturn("true")
+        when(mex.getVariable("DDELSI_sdncResponseSuccess")).thenReturn("true")
+        when(mex.getVariable("prefix")).thenReturn("DDELSI_")
+        DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance()
+        String response = FileUtil.readResourceFile("__files/GenericFlows/SDNCDeleteResponse.xml")
+        String method = "deleteE2E";
+        instance.postProcessSDNCDelete(mex, response, method)
+               // TODO: what to test here?
+//        verify(mex).setVariable("DDELSI_sdncRequestDataResponseCode", "0")
+    }
+
+    @Test
+    public void postProcessAAIDELTest() {
+        ExecutionEntity mex = setupMock()
+        def map = setupMap(mex)
+        initPreProcess(mex)
+        when(mex.getVariable("GENDS_SuccessIndicator")).thenReturn("true")
+        DoCustomDeleteE2EServiceInstance instance = new DoCustomDeleteE2EServiceInstance()
+        instance.postProcessAAIDEL(mex)
+    }
+
+    private void initPreProcess(ExecutionEntity mex) {
+        when(mex.getVariable(GroovyTestBase.DBGFLAG)).thenReturn("true")
+        when(mex.getVariable("bpmnRequest")).thenReturn(request)
+        when(mex.getVariable("mso-request-id")).thenReturn("mri")
+        when(mex.getVariable("serviceType")).thenReturn("VoLTE")
+        when(mex.getVariable("serviceInstanceId")).thenReturn("e151059a-d924-4629-845f-264db19e50b4")
+        when(mex.getVariable("requestAction")).thenReturn("ra")
+        when(mex.getVariable("operationId")).thenReturn("59960003992")
+        when(mex.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("/mso/sdncadapter/")
+        when(mex.getVariable("GENGS_FoundIndicator")).thenReturn("true")
+        when(mex.getVariable("GENGS_siResourceLink")).thenReturn("/service-subscription/e2eserviceInstance/delete/service-instances/")
+        when(mex.getVariable("globalSubscriberId")).thenReturn("4993921112123")
+        when(mex.getVariable("GENGS_service")).thenReturn("test3434")
+        when(mex.getVariable("URN_mso_openecomp_adapters_db_endpoint")).thenReturn("http://localhost:8080/mso")
+    }
+}
index 0b29219..f0645b2 100644 (file)
@@ -85,7 +85,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        // ***** preProcessRequest *****\r
                        \r
        @Test\r
-//     @Ignore  \r
+       // @Ignore  \r
        public void preProcessRequest() {\r
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -96,6 +96,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
 \r
                verify(mex).getVariable(DBGFLAG)\r
                verify(mex).setVariable("prefix", Prefix)
+               verify(mex).setVariable("aaiDistDelay", "aaidelay")
                verify(mex).setVariable("createVcpeServiceRequest", request)
                verify(mex).setVariable("msoRequestId", "mri")
                assertEquals("sii", map.get("serviceInstanceId"))
@@ -118,7 +119,21 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
+       public void preProcessRequest_MissingAaiDistDelay() {
+               ExecutionEntity mex = setupMock()
+               def map = setupMap(mex)
+               initPreProcess(mex)
+               
+               when(mex.getVariable("URN_mso_workflow_aai_distribution_delay")).thenReturn(null)
+               
+               CreateVcpeResCustService CreateVcpeResCustService = new CreateVcpeResCustService()
+               
+               assertTrue(doBpmnError( { _ -> CreateVcpeResCustService.preProcessRequest(mex) }))
+       }
+                       
+       @Test
+       // @Ignore  
        public void preProcessRequest_EmptyParts() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -160,7 +175,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void preProcessRequest_MissingSubscriberId() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -178,7 +193,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void preProcessRequest_BpmnError() {
                ExecutionEntity mex = setupMock()
                initPreProcess(mex)
@@ -191,7 +206,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void preProcessRequest_Ex() {
                ExecutionEntity mex = setupMock()
                initPreProcess(mex)
@@ -206,7 +221,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        // ***** sendSyncResponse *****
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void sendSyncResponse() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -229,7 +244,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void sendSyncResponse_Ex() {
                ExecutionEntity mex = setupMock()
                initSendSyncResponse(mex)
@@ -245,7 +260,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        // ***** prepareDecomposeService *****
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void prepareDecomposeService() {
                ExecutionEntity mex = setupMock()
                initPrepareDecomposeService(mex)
@@ -258,7 +273,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void prepareDecomposeService_Ex() {
                ExecutionEntity mex = setupMock()
                initPrepareDecomposeService(mex)
@@ -274,7 +289,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        // ***** prepareCreateServiceInstance *****
                        
        @Test
-       @Ignore  
+       // @Ignore  
        public void prepareCreateServiceInstance() {
                ExecutionEntity mex = setupMock()
                initPrepareCreateServiceInstance(mex)
@@ -288,7 +303,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void prepareCreateServiceInstance_Ex() {
                ExecutionEntity mex = setupMock()
                initPrepareCreateServiceInstance(mex)
@@ -304,7 +319,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        // ***** postProcessServiceInstanceCreate *****
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void postProcessServiceInstanceCreate() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -323,7 +338,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void postProcessServiceInstanceCreate_BpmnError() {
                ExecutionEntity mex = setupMock()
                initPostProcessServiceInstanceCreate(mex)
@@ -336,7 +351,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void postProcessServiceInstanceCreate_Ex() {
                ExecutionEntity mex = setupMock()
                initPostProcessServiceInstanceCreate(mex)
@@ -352,7 +367,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        // ***** processDecomposition *****
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void processDecomposition() {
                ExecutionEntity mex = setupMock()
                def svcdecomp = initProcessDecomposition(mex, true, true)
@@ -371,7 +386,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void processDecomposition_EmptyNet_EmptyVnf() {
                ExecutionEntity mex = setupMock()
                def svcdecomp = initProcessDecomposition(mex, true, true)
@@ -392,7 +407,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void processDecomposition_Ex() {
                ExecutionEntity mex = setupMock()
                def svcdecomp = initProcessDecomposition(mex, true, true)
@@ -408,7 +423,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        // ***** prepareCreateAllottedResourceTXC *****
                        
        @Test
-       @Ignore  
+       // @Ignore  
        public void prepareCreateAllottedResourceTXC() {
                ExecutionEntity mex = setupMock()
                initPrepareCreateAllottedResourceTXC(mex)
@@ -426,7 +441,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void prepareCreateAllottedResourceTXC_NullArList() {
                ExecutionEntity mex = setupMock()
                def svcdecomp = initPrepareCreateAllottedResourceTXC(mex)
@@ -446,7 +461,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void prepareCreateAllottedResourceTXC_Ex() {
                ExecutionEntity mex = setupMock()
                initPrepareCreateAllottedResourceTXC(mex)
@@ -462,7 +477,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        // ***** prepareCreateAllottedResourceBRG *****
                        
        @Test
-       @Ignore  
+       // @Ignore  
        public void prepareCreateAllottedResourceBRG() {
                ExecutionEntity mex = setupMock()
                initPrepareCreateAllottedResourceBRG(mex)
@@ -480,7 +495,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void prepareCreateAllottedResourceBRG_NullArList() {
                ExecutionEntity mex = setupMock()
                def svcdecomp = initPrepareCreateAllottedResourceBRG(mex)
@@ -500,7 +515,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void prepareCreateAllottedResourceBRG_Ex() {
                ExecutionEntity mex = setupMock()
                initPrepareCreateAllottedResourceBRG(mex)
@@ -516,7 +531,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        // ***** prepareVnfAndModulesCreate *****
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void prepareVnfAndModulesCreate() {
                ExecutionEntity mex = setupMock()
                initPrepareVnfAndModulesCreate(mex)
@@ -532,7 +547,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void prepareVnfAndModulesCreate_EmptyList() {
                ExecutionEntity mex = setupMock()
                initPrepareVnfAndModulesCreate(mex)
@@ -550,7 +565,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void prepareVnfAndModulesCreate_NullList() {
                ExecutionEntity mex = setupMock()
                initPrepareVnfAndModulesCreate(mex)
@@ -568,7 +583,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void prepareVnfAndModulesCreate_Ex() {
                ExecutionEntity mex = setupMock()
                initPrepareVnfAndModulesCreate(mex)
@@ -584,7 +599,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        // ***** validateVnfCreate *****
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void validateVnfCreate() {
                ExecutionEntity mex = setupMock()
                initValidateVnfCreate(mex)
@@ -598,7 +613,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void validateVnfCreate_Ex() {
                ExecutionEntity mex = setupMock()
                initValidateVnfCreate(mex)
@@ -614,7 +629,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        // ***** postProcessResponse *****
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void postProcessResponse() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -635,7 +650,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void postProcessResponse_BpmnError() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -649,7 +664,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void postProcessResponse_Ex() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -666,7 +681,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        // ***** preProcessRollback *****
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void preProcessRollback() {
                ExecutionEntity mex = setupMock()
                def wfe = initPreProcessRollback(mex)
@@ -680,7 +695,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void preProcessRollback_NullWfe() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -697,7 +712,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void preProcessRollback_BpmnError() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -714,7 +729,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void preProcessRollback_Ex() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -734,7 +749,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        // ***** postProcessRollback *****
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void postProcessRollback() {
                ExecutionEntity mex = setupMock()
                def wfe = initPostProcessRollback(mex)
@@ -748,7 +763,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void postProcessRollback_NullWfe() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -765,7 +780,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void postProcessRollback_BpmnError() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -778,7 +793,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void postProcessRollback_Ex() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -798,7 +813,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        // ***** prepareFalloutRequest *****
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void prepareFalloutRequest() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -817,7 +832,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void prepareFalloutRequest_Ex() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -833,7 +848,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        // ***** sendSyncError *****
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void sendSyncError() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -857,7 +872,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void sendSyncError_NotWfe() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -883,7 +898,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void sendSyncError_NullWfe() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -909,7 +924,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void sendSyncError_Ex() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -928,7 +943,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        // ***** processJavaException *****
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void processJavaException() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -948,7 +963,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void processJavaException_BpmnError() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -964,7 +979,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        }
                        
        @Test
-//     @Ignore  
+       // @Ignore  
        public void processJavaException_Ex() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -985,6 +1000,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
        private void initPreProcess(ExecutionEntity mex) {
                when(mex.getVariable(DBGFLAG)).thenReturn("true")
                when(mex.getVariable("bpmnRequest")).thenReturn(request)
+               when(mex.getVariable("URN_mso_workflow_aai_distribution_delay")).thenReturn("aaidelay")
                when(mex.getVariable("mso-request-id")).thenReturn("mri")
                when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
                when(mex.getVariable("requestAction")).thenReturn("ra")
@@ -1008,7 +1024,7 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
                when(mex.getVariable("createVcpeServiceRequest")).thenReturn(request)
                when(mex.getVariable("serviceDecomposition")).thenReturn(svcdecomp)
                
-               when(svcdecomp.toJsonString()).thenReturn("mydecomp")
+               when(svcdecomp.toJsonStringNoRootName()).thenReturn("mydecomp")
        }
        
        private void initPostProcessServiceInstanceCreate(ExecutionEntity mex) {
@@ -1037,6 +1053,10 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
                return svcdecomp
        }
        
+       private initAwaitAaiDistribution(ExecutionEntity mex) {
+               when(mex.getVariable(DBGFLAG)).thenReturn("true")
+       }
+       
        private ServiceDecomposition initPrepareCreateAllottedResourceTXC(ExecutionEntity mex) {
                ServiceDecomposition svcdecomp = mock(ServiceDecomposition.class)
                List<AllottedResource> arlst = new LinkedList<>()
@@ -1078,13 +1098,13 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
                ModelInfo mod = mock(ModelInfo.class)
                HomingSolution home = mock(HomingSolution.class)
                
-               when(ar.toJsonString()).thenReturn("json"+id)
+               when(ar.toJsonStringNoRootName()).thenReturn("json"+id)
                when(ar.getAllottedResourceType()).thenReturn("TunnelXConn")
                when(ar.getModelInfo()).thenReturn(mod)
                when(ar.getAllottedResourceRole()).thenReturn("TXCr")
                when(ar.getHomingSolution()).thenReturn(home)
                
-               when(mod.toJsonString()).thenReturn("model"+id)
+               when(mod.toJsonStringNoRootName()).thenReturn("model"+id)
                
                when(home.getServiceInstanceId()).thenReturn("home"+id)
                
@@ -1096,13 +1116,13 @@ class CreateVcpeResCustServiceTest extends GroovyTestBase {
                ModelInfo mod = mock(ModelInfo.class)
                HomingSolution home = mock(HomingSolution.class)
                
-               when(ar.toJsonString()).thenReturn("json"+id)
+               when(ar.toJsonStringNoRootName()).thenReturn("json"+id)
                when(ar.getAllottedResourceType()).thenReturn("BRG")
                when(ar.getModelInfo()).thenReturn(mod)
                when(ar.getAllottedResourceRole()).thenReturn("BRGr")
                when(ar.getHomingSolution()).thenReturn(home)
                
-               when(mod.toJsonString()).thenReturn("model"+id)
+               when(mod.toJsonStringNoRootName()).thenReturn("model"+id)
                
                when(home.getServiceInstanceId()).thenReturn("home"+id)
                
index df7c0cf..fc53744 100644 (file)
@@ -108,6 +108,7 @@ class DeleteVcpeResCustServiceTest extends GroovyTestBase {
                
                verify(mex).setVariable("lcpCloudRegionId", "mdt1")
                verify(mex).setVariable("tenantId", "8b1df54faa3b49078e3416e21370a3ba")
+               assertEquals("""{"tenantId":"8b1df54faa3b49078e3416e21370a3ba","lcpCloudRegionId":"mdt1"}""", map.get("cloudConfiguration"))
                verify(mex).setVariable("sdncVersion", "1702")
                verify(mex).setVariable("GENGS_type", "service-instance")
                assertTrue(map.containsKey(Prefix+"requestInfo"))
@@ -146,6 +147,7 @@ class DeleteVcpeResCustServiceTest extends GroovyTestBase {
                
                verify(mex).setVariable("lcpCloudRegionId", "mdt1")
                verify(mex).setVariable("tenantId", "8b1df54faa3b49078e3416e21370a3ba")
+               assertEquals("""{"tenantId":"8b1df54faa3b49078e3416e21370a3ba","lcpCloudRegionId":"mdt1"}""", map.get("cloudConfiguration"))
                verify(mex).setVariable("sdncVersion", "1702")
                verify(mex).setVariable("GENGS_type", "service-instance")
                assertTrue(map.containsKey(Prefix+"requestInfo"))
index 1d4d3ea..89c13f1 100644 (file)
@@ -89,6 +89,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
                verify(mex).setVariable("prefix", Prefix)\r
                                
                assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdncadapter_callback"))
+               assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdnc_replication_delay"))
                assertTrue(checkMissingPreProcessRequest("serviceInstanceId"))
                assertTrue(checkMissingPreProcessRequest("parentServiceInstanceId"))
                assertTrue(checkMissingPreProcessRequest("allottedResourceModelInfo"))
@@ -296,8 +297,10 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
                assertTrue(result.indexOf("<sdncadapter:SvcAction>myact</") >= 0)
                assertTrue(result.indexOf("<allotted-resource-id>ari</") >= 0)
                assertTrue(result.indexOf("<sdncadapter:SvcInstanceId>sii</") >= 0)
-               assertTrue(result.indexOf("<service-instance-id>psii</") >= 0)
+               assertTrue(result.indexOf("<service-instance-id>sii</") >= 0)
                assertTrue(result.indexOf("<parent-service-instance-id>psii</") >= 0)
+               assertTrue(result.indexOf("<subscription-service-type>sst</") >= 0)
+               assertTrue(result.indexOf("<global-customer-id>gci</") >= 0)
                assertTrue(result.indexOf("<sdncadapter:CallbackUrl>scu</") >= 0)
                assertTrue(result.indexOf("<request-id>mri</") >= 0)
                assertTrue(result.indexOf("<brg-wan-mac-address>bwma</") >= 0)
@@ -326,8 +329,10 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
                assertTrue(result.indexOf("<sdncadapter:SvcAction>myact</") >= 0)
                assertTrue(result.indexOf("<allotted-resource-id>ari</") >= 0)
                assertTrue(result.indexOf("<sdncadapter:SvcInstanceId>sii</") >= 0)
-               assertTrue(result.indexOf("<service-instance-id>psii</") >= 0)
+               assertTrue(result.indexOf("<service-instance-id>sii</") >= 0)
                assertTrue(result.indexOf("<parent-service-instance-id>psii</") >= 0)
+               assertTrue(result.indexOf("<subscription-service-type>sst</") >= 0)
+               assertTrue(result.indexOf("<global-customer-id>gci</") >= 0)
                assertTrue(result.indexOf("<sdncadapter:CallbackUrl>scu</") >= 0)
                assertTrue(result.indexOf("<request-id>mri</") >= 0)
                assertTrue(result.indexOf("<brg-wan-mac-address>bwma</") >= 0)
@@ -886,6 +891,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
        private void initPreProcess(ExecutionEntity mex) {
                when(mex.getVariable(DBGFLAG)).thenReturn("true")
                when(mex.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("sdncurn")
+               when(mex.getVariable("URN_mso_workflow_sdnc_replication_delay")).thenReturn("sdncdelay")
                when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
                when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii")
                when(mex.getVariable("allottedResourceModelInfo")).thenReturn("armi")
@@ -931,6 +937,8 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
                when(mex.getVariable("allottedResourceId")).thenReturn("ari")
                when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
                when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii")
+               when(mex.getVariable("subscriptionServiceType")).thenReturn("sst")
+               when(mex.getVariable("globalCustomerId")).thenReturn("gci")
                when(mex.getVariable("sdncCallbackUrl")).thenReturn("scu")
                when(mex.getVariable("msoRequestId")).thenReturn("mri")
                when(mex.getVariable("brgWanMacAddress")).thenReturn("bwma")
@@ -963,7 +971,6 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
                when(mex.getVariable("aaiARGetResponse")).thenReturn("<selflink>arlink</selflink>")
                when(mex.getVariable("sdncAssignResponse")).thenReturn("<response-data>&lt;object-path&gt;assignlink&lt;/object-path&gt;</response-data>")
                when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
-               when(mex.getVariable("junitSleepMs")).thenReturn("5")
                when(mex.getVariable("sdncCallbackUrl")).thenReturn("myurl")
        }
        
index 2b6d4ba..b27e368 100644 (file)
@@ -83,7 +83,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        // ***** preProcessRequest *****\r
                        \r
        @Test\r
-//             @Ignore  \r
+       // @Ignore  \r
        public void preProcessRequest() {\r
                ExecutionEntity mex = setupMock()
                initPreProcess(mex)
@@ -95,6 +95,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
                verify(mex).setVariable("prefix", Prefix)\r
                                
                assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdncadapter_callback"))
+               assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdnc_replication_delay"))
                assertTrue(checkMissingPreProcessRequest("serviceInstanceId"))
                assertTrue(checkMissingPreProcessRequest("parentServiceInstanceId"))
                assertTrue(checkMissingPreProcessRequest("allottedResourceModelInfo"))
@@ -107,7 +108,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        // ***** getAaiAR *****
        
        @Test
-//             @Ignore
+       // @Ignore
        public void getAaiAR() {
                MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
                
@@ -121,7 +122,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void getAaiAR_Duplicate() {
                MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
                
@@ -137,7 +138,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void getAaiAR_NotActive() {
                MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
                
@@ -153,7 +154,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void getAaiAR_NoStatus() {
                MockGetAllottedResource(CUST, SVC, INST, ARID, "VCPE/DoCreateAllottedResourceTXC/getArTxc.xml")
                
@@ -172,7 +173,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        // ***** createAaiAR *****
        
        @Test
-//             @Ignore
+       // @Ignore
        public void createAaiAR() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -196,7 +197,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void createAaiAR_NoArid_NoModelUuids() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -226,7 +227,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void createAaiAR_MissingPsiLink() {
                ExecutionEntity mex = setupMock()
                initCreateAaiAr(mex)
@@ -241,7 +242,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void createAaiAR_HttpFailed() {
                ExecutionEntity mex = setupMock()
                initCreateAaiAr(mex)
@@ -254,7 +255,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void createAaiAR_BpmnError() {
                ExecutionEntity mex = setupMock()
                initCreateAaiAr(mex)
@@ -269,7 +270,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void createAaiAR_Ex() {
                ExecutionEntity mex = setupMock()
                initCreateAaiAr(mex)
@@ -287,7 +288,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        // ***** buildSDNCRequest *****
        
        @Test
-//             @Ignore
+       // @Ignore
        public void buildSDNCRequest() {
                ExecutionEntity mex = setupMock()
                initBuildSDNCRequest(mex)
@@ -300,8 +301,10 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
                assertTrue(result.indexOf("<sdncadapter:SvcAction>myact</") >= 0)
                assertTrue(result.indexOf("<allotted-resource-id>ari</") >= 0)
                assertTrue(result.indexOf("<sdncadapter:SvcInstanceId>sii</") >= 0)
-               assertTrue(result.indexOf("<service-instance-id>psii</") >= 0)
+               assertTrue(result.indexOf("<service-instance-id>sii</") >= 0)
                assertTrue(result.indexOf("<parent-service-instance-id>psii</") >= 0)
+               assertTrue(result.indexOf("<subscription-service-type>sst</") >= 0)
+               assertTrue(result.indexOf("<global-customer-id>gci</") >= 0)
                assertTrue(result.indexOf("<sdncadapter:CallbackUrl>scu</") >= 0)
                assertTrue(result.indexOf("<request-id>mri</") >= 0)
                assertTrue(result.indexOf("<model-invariant-uuid/>") >= 0)
@@ -312,7 +315,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void buildSDNCRequest_Ex() {
                ExecutionEntity mex = setupMock()
                initBuildSDNCRequest(mex)
@@ -328,7 +331,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        // ***** preProcessSDNCAssign *****
        
        @Test
-//             @Ignore
+       // @Ignore
        public void preProcessSDNCAssign() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -354,7 +357,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void preProcessSDNCAssign_BpmnError() {
                ExecutionEntity mex = setupMock()
                initPreProcessSDNC(mex)
@@ -367,7 +370,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void preProcessSDNCAssign_Ex() {
                ExecutionEntity mex = setupMock()
                initPreProcessSDNC(mex)
@@ -383,7 +386,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        // ***** preProcessSDNCCreate *****
        
        @Test
-//             @Ignore
+       // @Ignore
        public void preProcessSDNCCreate() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -410,7 +413,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void preProcessSDNCCreate_BpmnError() {
                ExecutionEntity mex = setupMock()
                initPreProcessSDNC(mex)
@@ -423,7 +426,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void preProcessSDNCCreate_Ex() {
                ExecutionEntity mex = setupMock()
                initPreProcessSDNC(mex)
@@ -439,7 +442,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        // ***** preProcessSDNCActivate *****
        
        @Test
-//             @Ignore
+       // @Ignore
        public void preProcessSDNCActivate() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -466,7 +469,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void preProcessSDNCActivate_BpmnError() {
                ExecutionEntity mex = setupMock()
                initPreProcessSDNC(mex)
@@ -479,7 +482,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void preProcessSDNCActivate_Ex() {
                ExecutionEntity mex = setupMock()
                initPreProcessSDNC(mex)
@@ -495,7 +498,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        // ***** validateSDNCResp *****
        
        @Test
-//             @Ignore
+       // @Ignore
        public void validateSDNCResp() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -519,7 +522,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void validateSDNCResp_Get() {
                ExecutionEntity mex = setupMock()
                def data = initValidateSDNCResp(mex)
@@ -538,7 +541,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void validateSDNCResp_Unsuccessful() {
                ExecutionEntity mex = setupMock()
                initValidateSDNCResp(mex)
@@ -553,7 +556,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void validateSDNCResp_BpmnError() {
                ExecutionEntity mex = setupMock()
                initValidateSDNCResp(mex)
@@ -567,7 +570,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void validateSDNCResp_Ex() {
                ExecutionEntity mex = setupMock()
                initValidateSDNCResp(mex)
@@ -584,7 +587,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        // ***** preProcessSDNCGet *****
        
        @Test
-//             @Ignore
+       // @Ignore
        public void preProcessSDNCGet_FoundAR() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -603,7 +606,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void preProcessSDNCGet_NotFoundAR() {
                ExecutionEntity mex = setupMock()
                def map = setupMap(mex)
@@ -624,7 +627,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void preProcessSDNCGet_Ex() {
                ExecutionEntity mex = setupMock()
                initPreProcessSDNCGet(mex)
@@ -640,7 +643,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        // ***** updateAaiAROrchStatus *****
        
        @Test
-//             @Ignore
+       // @Ignore
        public void updateAaiAROrchStatus() {
                MockPatchAllottedResource(CUST, SVC, INST, ARID)
                
@@ -655,7 +658,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        // ***** generateOutputs *****
        
        @Test
-//             @Ignore
+       // @Ignore
        public void generateOutputs() {
                ExecutionEntity mex = setupMock()
                def txctop = FileUtil.readResourceFile("__files/VCPE/DoCreateAllottedResourceTXC/SDNCTopologyQueryCallback.xml")
@@ -674,7 +677,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void generateOutputs_BadXml() {
                ExecutionEntity mex = setupMock()
                
@@ -689,7 +692,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void generateOutputs_BpmnError() {
                ExecutionEntity mex = setupMock()
                
@@ -704,7 +707,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void generateOutputs_Ex() {
                ExecutionEntity mex = setupMock()
                
@@ -722,7 +725,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        // ***** preProcessRollback *****
        
        @Test
-//             @Ignore
+       // @Ignore
        public void preProcessRollback() {
                ExecutionEntity mex = setupMock()
                WorkflowException wfe = mock(WorkflowException.class)
@@ -738,7 +741,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void preProcessRollback_NotWFE() {
                ExecutionEntity mex = setupMock()
                
@@ -753,7 +756,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void preProcessRollback_BpmnError() {
                ExecutionEntity mex = setupMock()
                
@@ -767,7 +770,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void preProcessRollback_Ex() {
                ExecutionEntity mex = setupMock()
                
@@ -784,7 +787,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        // ***** postProcessRollback *****
        
        @Test
-//             @Ignore
+       // @Ignore
        public void postProcessRollback() {
                ExecutionEntity mex = setupMock()
                WorkflowException wfe = mock(WorkflowException.class)
@@ -801,7 +804,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void postProcessRollback_NotWFE() {
                ExecutionEntity mex = setupMock()
                
@@ -817,7 +820,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void postProcessRollback_BpmnError() {
                ExecutionEntity mex = setupMock()
                
@@ -832,7 +835,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        }
        
        @Test
-//             @Ignore
+       // @Ignore
        public void postProcessRollback_Ex() {
                ExecutionEntity mex = setupMock()
                
@@ -860,6 +863,7 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
        private void initPreProcess(ExecutionEntity mex) {
                when(mex.getVariable(DBGFLAG)).thenReturn("true")
                when(mex.getVariable("URN_mso_workflow_sdncadapter_callback")).thenReturn("sdncurn")
+               when(mex.getVariable("URN_mso_workflow_sdnc_replication_delay")).thenReturn("sdncdelay")
                when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
                when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii")
                when(mex.getVariable("allottedResourceModelInfo")).thenReturn("armi")
@@ -903,6 +907,8 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
                when(mex.getVariable("allottedResourceId")).thenReturn("ari")
                when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
                when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii")
+               when(mex.getVariable("subscriptionServiceType")).thenReturn("sst")
+               when(mex.getVariable("globalCustomerId")).thenReturn("gci")
                when(mex.getVariable("sdncCallbackUrl")).thenReturn("scu")
                when(mex.getVariable("msoRequestId")).thenReturn("mri")
        }
@@ -923,7 +929,6 @@ class DoCreateAllottedResourceTXCTest extends GroovyTestBase {
                when(mex.getVariable("aaiARGetResponse")).thenReturn("<selflink>arlink</selflink>")
                when(mex.getVariable("sdncAssignResponse")).thenReturn("<response-data>&lt;object-path&gt;assignlink&lt;/object-path&gt;</response-data>")
                when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
-               when(mex.getVariable("junitSleepMs")).thenReturn("5")
                when(mex.getVariable("sdncCallbackUrl")).thenReturn("myurl")
        }
        
index 38461de..0af43a2 100644 (file)
@@ -371,7 +371,6 @@ public class CreateVcpeResCustServiceTest extends AbstractTestBase {
                variables.put("request-id", "testRequestId");
                variables.put("serviceInstanceId", DEC_INST);
                variables.put("allottedResourceId", ARID);
-               variables.put("junitSleepMs", "5");
                return variables;
 
        }
index 5b6f74f..0373266 100644 (file)
@@ -277,7 +277,6 @@ public class DoCreateAllottedResourceBRGTest extends AbstractTestBase {
                variables.put("vni", "BRG");
                variables.put("vgmuxBearerIP", "bearerip");
                variables.put("brgWanMacAddress", "wanmac");
-               variables.put("junitSleepMs", "5");
 
                variables.put("serviceInstanceId", DEC_INST);
                variables.put("parentServiceInstanceId", DEC_PARENT_INST);
index 4323cca..9cf059c 100644 (file)
@@ -283,7 +283,6 @@ public class DoCreateAllottedResourceTXCTest extends AbstractTestBase {
                variables.put("allottedResourceType", "TXC");
                variables.put("allottedResourceId", ARID);
                variables.put("brgWanMacAddress", "wanmac");
-               variables.put("junitSleepMs", "5");
 
                variables.put("serviceInstanceId", DEC_INST);
                variables.put("parentServiceInstanceId", DEC_PARENT_INST);
index 9b201d9..05583cd 100644 (file)
@@ -16,8 +16,8 @@
     </allotted-resource-identifiers>\r
     <tunnelxconn-assignments>\r
        <vni>my-vni</vni>\r
-       <vgmux_bearer_ip>my-bearer-ip</vgmux_bearer_ip>\r
-       <vgmux_lan_ip>my-lan-ip</vgmux_lan_ip>\r
+       <vgmux-bearer-ip>my-bearer-ip</vgmux-bearer-ip>\r
+       <vgmux-lan-ip>my-lan-ip</vgmux-lan-ip>\r
     </tunnelxconn-assignments>\r
 </tunnelxconn-topology>\r
 \r
index 9b201d9..05583cd 100644 (file)
@@ -16,8 +16,8 @@
     </allotted-resource-identifiers>\r
     <tunnelxconn-assignments>\r
        <vni>my-vni</vni>\r
-       <vgmux_bearer_ip>my-bearer-ip</vgmux_bearer_ip>\r
-       <vgmux_lan_ip>my-lan-ip</vgmux_lan_ip>\r
+       <vgmux-bearer-ip>my-bearer-ip</vgmux-bearer-ip>\r
+       <vgmux-lan-ip>my-lan-ip</vgmux-lan-ip>\r
     </tunnelxconn-assignments>\r
 </tunnelxconn-topology>\r
 \r
index aad79b0..325ee3c 100644 (file)
@@ -40,6 +40,8 @@ mso.sdnc.timeout.ucpe.async.hours=120
 mso.sdnc.timeout.ucpe.async.minutes=5\r
 mso.workflow.message.endpoint=http://localhost:28080/mso/WorkflowMesssage\r
 mso.workflow.sdncadapter.callback=http://localhost:28080/mso/SDNCAdapterCallbackService\r
+mso.workflow.sdnc.replication.delay=PT0.01S\r
+mso.workflow.aai.distribution.delay=PT0.01S\r
 \r
 mso.catalog.db.endpoint=http://localhost:28090\r
 \r
diff --git a/bpmn/MSOMockServer/.gitignore b/bpmn/MSOMockServer/.gitignore
deleted file mode 100644 (file)
index f6c8fbc..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/bin
-/target
-/target
-/target
diff --git a/bpmn/MSOMockServer/WebContent/META-INF/MANIFEST.MF b/bpmn/MSOMockServer/WebContent/META-INF/MANIFEST.MF
deleted file mode 100644 (file)
index 254272e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Class-Path: 
-
diff --git a/bpmn/MSOMockServer/WebContent/WEB-INF/jboss-deployment-structure.xml b/bpmn/MSOMockServer/WebContent/WEB-INF/jboss-deployment-structure.xml
deleted file mode 100644 (file)
index fb26891..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<jboss-deployment-structure>\r
-       <deployment>\r
-               <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->\r
-               <exclusions>\r
-                       <module name="org.apache.log4j" />\r
-                       <module name="org.slf4j" />\r
-                       <module name="org.slf4j.impl" />\r
-                       <module name="org.jboss.resteasy.resteasy-jackson-provider" />\r
-                       <module name="org.jboss.resteasy.resteasy-jettison-provider" />\r
-               </exclusions>\r
-               <dependencies>\r
-                           <module name="org.jboss.jandex" slot="main" />\r
-                <module name="org.javassist" slot="main" />\r
-                <module name="org.antlr" slot="main" />\r
-                <module name="org.dom4j" slot="main" />\r
-                <module name="org.jboss.resteasy.resteasy-jackson2-provider" services="import" />\r
-                <!-- This module contain the ProviderBase class: -->\r
-                <module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" export="true" />\r
-               </dependencies>\r
-       </deployment>\r
-</jboss-deployment-structure>\r
diff --git a/bpmn/MSOMockServer/WebContent/WEB-INF/web.xml b/bpmn/MSOMockServer/WebContent/WEB-INF/web.xml
deleted file mode 100644 (file)
index 1aa8cdb..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
-</web-app>
\ No newline at end of file
diff --git a/bpmn/MSOMockServer/pom.xml b/bpmn/MSOMockServer/pom.xml
deleted file mode 100644 (file)
index 500535d..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-       <parent>
-        <groupId>org.openecomp.so</groupId>
-        <artifactId>bpmn</artifactId>
-               <version>1.1.0-SNAPSHOT</version>
-       </parent>
-       <modelVersion>4.0.0</modelVersion>
-       <groupId>org.openecomp.so</groupId>
-       <artifactId>MSOMockServer</artifactId>
-       <packaging>war</packaging>
-
-       <build>
-               <plugins>
-               
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-war-plugin</artifactId>
-                               <version>2.4</version>
-                               <configuration>
-                                   <attachClasses>true</attachClasses>
-                                       <archiveClasses>true</archiveClasses>                           
-                                       <failOnMissingWebXml>false</failOnMissingWebXml>
-                               </configuration>
-                       </plugin>
-               </plugins>
-       </build>
-       <dependencies>
-       
-               <dependency>
-                       <groupId>com.github.tomakehurst</groupId>
-                       <artifactId>wiremock</artifactId>
-                       <version>1.56</version>
-                       <classifier>standalone</classifier>
-                       <exclusions>
-                               <exclusion>
-                                       <groupId>org.mortbay.jetty</groupId>
-                                       <artifactId>jetty</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>com.google.guava</groupId>
-                                       <artifactId>guava</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>com.fasterxml.jackson.core</groupId>
-                                       <artifactId>jackson-core</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>com.fasterxml.jackson.core</groupId>
-                                       <artifactId>jackson-annotations</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>com.fasterxml.jackson.core</groupId>
-                                       <artifactId>jackson-databind</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>org.apache.httpcomponents</groupId>
-                                       <artifactId>httpclient</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>org.skyscreamer</groupId>
-                                       <artifactId>jsonassert</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>xmlunit</groupId>
-                                       <artifactId>xmlunit</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>com.jayway.jsonpath</groupId>
-                                       <artifactId>json-path</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>net.sf.jopt-simple</groupId>
-                                       <artifactId>jopt-simple</artifactId>
-                               </exclusion>
-                       </exclusions>
-               </dependency>
-               <dependency>
-            <groupId>org.openecomp.so</groupId>
-            <artifactId>common</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-               <dependency>
-                       <groupId>javax.ws.rs</groupId>
-                       <artifactId>javax.ws.rs-api</artifactId>
-                       <version>2.0</version>
-               </dependency>
-               <dependency>
-                   <groupId>org.jboss.resteasy</groupId>
-                   <artifactId>resteasy-client</artifactId>
-                   <version>3.0.8.Final</version>
-                       <exclusions>                    
-                               <exclusion>
-                                       <groupId>org.apache.httpcomponents</groupId>                            
-                                       <artifactId>httpclient</artifactId>
-                               </exclusion>
-                       </exclusions>   
-               </dependency>
-       </dependencies>
-</project>
\ No newline at end of file
diff --git a/bpmn/MSOMockServer/src/main/resources/__files/sdncSimResponse.xml b/bpmn/MSOMockServer/src/main/resources/__files/sdncSimResponse.xml
deleted file mode 100644 (file)
index bef293d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\r
-       xmlns:v1="http://domain2.openecomp.org/workflow/sdnc/adapter/schema/v1">\r
-       <soapenv:Header />\r
-       <soapenv:Body>\r
-                       <SDNCAdapterCallbackRequest\r
-                               xmlns="http://domain2.openecomp.org/workflow/sdnc/adapter/schema/v1">\r
-                               <CallbackHeader>\r
-                                       <RequestId>d325c9a7-84c0-4081-b979-9cc773a0976d</RequestId>\r
-                                       <ResponseCode>200</ResponseCode>\r
-                                       <ResponseMessage>OK</ResponseMessage>\r
-                               </CallbackHeader>\r
-                               <RequestData xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
-                                       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">&lt;layer3-service-list\r
-                                       xmlns="com:att:sdnctl:l3api"&gt;&lt;service-instance-id&gt;0XX/VXXX/003717//Shakeout&lt;/service-instance-id&gt;&lt;service-status&gt;&lt;rpc-name&gt;svc-topology-operation&lt;/rpc-name&gt;&lt;rpc-action&gt;delete&lt;/rpc-action&gt;&lt;request-status&gt;synccomplete&lt;/request-status&gt;&lt;final-indicator&gt;Y&lt;/final-indicator&gt;&lt;l3sdn-action&gt;DisconnectLayer3ServiceRequest&lt;/l3sdn-action&gt;&lt;response-timestamp&gt;2015-10-22T02:11:52.010Z&lt;/response-timestamp&gt;&lt;/service-status&gt;&lt;service-data&gt;&lt;svc-config-additional-data/&gt;&lt;/service-data&gt;&lt;/layer3-service-list&gt;\r
-                               </RequestData>\r
-                       </SDNCAdapterCallbackRequest>\r
-       </soapenv:Body>\r
-</soapenv:Envelope>\r
diff --git a/bpmn/MSOMockServer/src/main/webapp/WEB-INF/jboss-web.xml b/bpmn/MSOMockServer/src/main/webapp/WEB-INF/jboss-web.xml
deleted file mode 100644 (file)
index cca27bb..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>  
-<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 5.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
-<jboss-web>
-  <security-domain>other</security-domain>
-  <context-root>/msomock</context-root>
-</jboss-web>  
\ No newline at end of file
index 4f96cc1..a83e85f 100644 (file)
@@ -31,7 +31,6 @@
 
   <modules>
     <module>MSOCoreBPMN</module>
-    <module>MSOMockServer</module>
     <module>MSORESTClient</module>
     <module>MSOCommonBPMN</module>
     <module>MSOInfrastructureBPMN</module>
diff --git a/docs/BPMN_Main_Process_Flows.rst b/docs/BPMN_Main_Process_Flows.rst
new file mode 100644 (file)
index 0000000..abc006e
--- /dev/null
@@ -0,0 +1,40 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
+.. http://creativecommons.org/licenses/by/4.0\r
+.. Copyright 2017 Huawei Technologies Co., Ltd.\r
+\r
+BPMN Main Process Flows\r
+========================\r
+\r
+Characteristics\r
+----------------\r
+\r
+**Invoked by an API Handler**\r
+\r
+  The BPMN application (war) exposes a REST endpoint to which the API Handler(s) send requests for flow execution.  The message sent by the API Handler to this endpoint is a JSON wrapper containing:\r
+  \r
+    * The original request received by the API handler from the portal or other client.\r
+    * Metadata such as the request-id generated by the API Handler for the request.\r
+    * The name of the BPMN process to execute (obtained by the API Handler from the mso_catalog.service_recipe table.\r
+  \r
+**Asynchronous Service Model**\r
+  \r
+  All main process flows implement an asynchronous service model.  The connection to the API Handler is kept open until the main process flow sends back a response.  In the flow shown below, this is done by the "Send Sync Ack Response" script task.  A flow is expected to send a response after validating the request, but before performing any long running tasks or tasks that could cause the process to be suspended.\r
+  \r
+  After the synchronous response is sent, the flow continues to execute.  When the flow ends, it may optionally send an asynchronous notification to a callback URL provided in the original request (behavior depends on the API agreement)\r
+  \r
+**Typically calls one or more subprocess flows**\r
+\r
+  Main process flows usually implement the high-level service logic, delegating the "real" work to reusable subflows (Building Blocks) or custom subflows\r
+  \r
+**Handles "Completion" and "Fallout" tasks**\r
+\r
+  "Completion" tasks are those that occur when the process ends successfully, and "Fallout" tasks are those that occur when the process fails.  Activities include:\r
+  \r
+    * Updating the mso_requests database.\r
+    * Rolling back uncompleted work.\r
+    * Sending an asynchronous callback notification.\r
+\r
+Example: CreateVfModuleVolumeInfraV1.bpmn\r
+------------------------------------------\r
+\r
+.. image:: images/BPMN_Main_Process_Flows_1.png
\ No newline at end of file
diff --git a/docs/BPMN_Project_Deployment_Strategy.rst b/docs/BPMN_Project_Deployment_Strategy.rst
new file mode 100644 (file)
index 0000000..50f4836
--- /dev/null
@@ -0,0 +1,35 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+BPMN Project Deployment Strategy
+==================================
+
+Single Application with Embedded Process Engine
+------------------------------------------------
+
+Deployment in SO is currently limited to a single process application: MSOInfrastructureBPMN.  The WAR file for this application contains everything needed to execute the infrastructure process flows, including:
+
+  * BPMN process flows, java classes, groovy scripts, and resource files from MSOInfrastructureBPMN itself.
+
+  * BPMN process flows, java classes, groovy scripts, and resource files from other SO projects, like MSOCommonBPMN and MSOCoreBPMN.
+
+  * An embedded Camunda Process Engine to execute the flows.
+
+The process application exposes a REST endpoint to the API Handler(s) for receiving flow execution requests.
+
+Development is required in SO to be able to support one a more versatile deployment strategy, probably one of the following:
+
+Shared Process Engine
+----------------------
+
+The Camunda Process Engine is created and manged as a Wildfly module.  This single engine is shared by all process applications.
+
+Multiple Applications, each with an Embedded Process Engine
+-------------------------------------------------------------
+
+More than one application could be deployed, each having its own embedded process engine.
+
+
+
+
diff --git a/docs/BPMN_Project_Structure.rst b/docs/BPMN_Project_Structure.rst
new file mode 100644 (file)
index 0000000..3c5ccc3
--- /dev/null
@@ -0,0 +1,47 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
+.. http://creativecommons.org/licenses/by/4.0\r
+.. Copyright 2017 Huawei Technologies Co., Ltd.\r
+\r
+BPMN Project Structure\r
+=======================\r
+\r
+BPMN main process flow\r
+----------------------\r
+\r
+A BPMN main process flow is a top-level flow.  All main process flows are under the src/main/resources/process folder.\r
+\r
+CreateVfModuleVolumeInfraV1 is a main process flow.\r
+\r
+.. image:: images/bpmn_project_structure_1.png\r
+\r
+Open BPMN files with the camunda modeler (standalone application).  To launch the modeler from eclipse, right-click→open-with→Other→Browse.  Select Check the boxes on the dialog so that eclipse will open all .bpmn files with the camunda-modeler executable.\r
+\r
+BPMN subprocess flow\r
+---------------------\r
+\r
+A BPMN subprocess flow is meant to be invoked by other flows (either main process flows or other subprocess flows).  All subprocess flows are under the src/main/resources/subprocess folder.\r
+\r
+The CreateVfModuleVolumeInfraV1 process flow is delivered with two custom subflows: DoCreateVfModuleVolumeV2 and DoCreateVfModuleVolumeRollback.\r
+\r
+.. image:: images/bpmn_project_structure_2.png\r
+\r
+Groovy scripts\r
+---------------\r
+\r
+There is one groovy script for each BPMN file.  Groovy scripts are invoked by script tasks within the BPMN flows.\r
+\r
+.. image:: images/bpmn_project_structure_3.png\r
+\r
+Unit Tests\r
+-----------\r
+\r
+Normally, we create a unit test class for every flow.  This one is missing a unit test for its rollback flow.\r
+\r
+.. image:: images/bpmn_project_structure_4.png\r
+\r
+Unit Test Resource Files\r
+------------------------\r
+\r
+Any files needed by the unit tests are kept under the src/test/resources/__files folder.\r
+\r
+.. image:: images/bpmn_project_structure_5.png
\ No newline at end of file
diff --git a/docs/BPMN_Subprocess_Process_Flows.rst b/docs/BPMN_Subprocess_Process_Flows.rst
new file mode 100644 (file)
index 0000000..cf2da40
--- /dev/null
@@ -0,0 +1,32 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
+.. http://creativecommons.org/licenses/by/4.0\r
+.. Copyright 2017 Huawei Technologies Co., Ltd.\r
+\r
+BPMN Subprocess Process Flows\r
+==============================\r
+\r
+Characteristics\r
+----------------\r
+\r
+**Invoked by other flows**\r
+\r
+    A BPMN Call_Activity_ provides the mechanism to invoke subprocess flows.  The Called Element attribute of the Call Activity specifies the name of the subprocess to execute.\r
+\r
+.. _Call_Activity: https://docs.camunda.org/manual/7.7/reference/bpmn20/subprocesses/call-activity/\r
+\r
+**Input and Output variable mapping**\r
+\r
+    In the modeler, you can specify a list of "In Mappings".  With this, you can map execution variables from the calling flow to the subprocess.  The subprocess always has its own copy of each variable.  To transfer values back to the calling flow, you specify "Out Mappings".\r
+\r
+**May throw MSOWorkflowException**\r
+\r
+    The current best practice for reporting errors from subprocess is described here:\r
+       \r
+       * The subprocess should create a WorkflowException object and store it in an execution called WorkflowException.\r
+    * The WorkflowException object contains an error code and an error message.\r
+    * The subprocess should then throw an MSOWorkflowException BPMN event which may be handled by the calling flow.\r
+       \r
+Example: VnfAdapterRestV1.bpmn\r
+-------------------------------\r
+\r
+.. image:: images/BPMN_Subprocess_process_flows_1.png\r
diff --git a/docs/Building_SO.rst b/docs/Building_SO.rst
new file mode 100644 (file)
index 0000000..29ff6bd
--- /dev/null
@@ -0,0 +1,79 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Building SO
+============
+
+Build software with unit tests
+------------------------------
+
+.. code-block:: bash
+
+  cd $HOME/onap/workspace/SO/libs
+
+  $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml clean install
+
+  cd $HOME/onap/workspace/SO/so
+
+  $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml clean install
+
+Build software without unit tests
+----------------------------------
+
+.. code-block:: bash
+
+  cd $HOME/onap/workspace/SO/libs
+
+  $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml -DskipTests -Dmaven.test.skip=true clean install
+
+  cd $HOME/onap/workspace/SO/so
+
+  $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml -DskipTests -Dmaven.test.skip=true clean install
+
+Build docker images
+--------------------
+
+SO docker images are built using the "docker" maven profile.  During the build, the chef-repo and so-docker repositories are cloned from gerrit into the "so" directory structure.  Extra definitions are required in the build environment to make this happen.   You may need to adjust the definition of mso.chef.git.url.prefix to match the way you authenticate yourself when performing git clone.
+
+If you are behind a corporate firewall, you can specify proxy definitions for the constructed docker images.
+
+**Remove existing docker containers and images**
+
+.. code-block:: bash
+
+  docker stop $(docker ps -qa)
+
+  docker rm $(docker ps -aq)
+
+  docker rmi -f $(docker images -q)
+
+**Build docker images (without proxy definition):**
+
+.. code-block:: bash
+
+  cd $HOME/onap/workspace/SO/so/packages
+
+  $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml clean install -P docker
+  -Dmso.chef.git.url.prefix=ssh://$USER@gerrit.onap.org:29418 -Dmso.chef.git.branchname=master
+  -Dmso.chef.git.url.suffix.chef.repo=so/chef-repo -Dmso.chef.git.url.suffix.chef.config=so/so-config
+  -Ddocker.buildArg.http_proxy=http://one.proxy.att.com:8080
+  -Ddocker.buildArg.https_proxy=http://one.proxy.att.com:8080
+
+**Build docker images (with proxy definition):**
+
+.. code-block:: bash
+
+  cd $HOME/onap/workspace/SO/so/packages
+  
+  $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml clean install -P docker
+  -Dmso.chef.git.url.prefix=ssh://$USER@gerrit.onap.org:29418 -Dmso.chef.git.branchname=master
+  -Dmso.chef.git.url.suffix.chef.repo=so/chef-repo -Dmso.chef.git.url.suffix.chef.config=so/so-config
+  -Ddocker.buildArg.http_proxy=http://proxyhost:port -Ddocker.buildArg.https_proxy=http://proxyhost:port
+
+Build with Integration Tests
+-----------------------------
+
+This is done exactly as described for building docker images, except that the maven profile to use is "with-integration-tests" instead of "docker".  Integration tests are executed inside docker containers constructed by the build.
+
+
diff --git a/docs/Camunda_Cockpit_Community_Edition.rst b/docs/Camunda_Cockpit_Community_Edition.rst
new file mode 100644 (file)
index 0000000..a9379de
--- /dev/null
@@ -0,0 +1,44 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Camunda Cockpit Community Edition
+=================================
+
+On a deployed instance of SO, you can use the Camunda_Cockpit to view BPMN 2.0 workflow definitions in the deployment.
+
+.. _Camunda_Cockpit: https://camunda.org/features/cockpit/
+
+Unfortunately, the Community Edition of Camunda included with SO is not fully featured.  It cannot be used to inspect running and completed process instances.  For that, the Enterprise Edition is required.
+
+Logging In
+-----------
+
+Because port 8080 on the docker host machine is forwarded to port 8080 in the SO docker container you can log into the cockpit by browsing to this URL:
+
+  http://*dockerhost*:8080/camunda/app/admin/default/#/login
+
+  Where dockerhost is the docker host system.
+
+If you can use a browser on the docker host system, then use a localhost address:
+
+  http://localhost:8080/camunda/app/admin/default/#/login
+
+The user is "admin" and the password is the same as the jboss admin password, which is not displayed here.
+
+.. image:: images/Camunda_Cockpit_1.png
+
+Viewing Process Definitions
+---------------------------
+
+Use the drop-down menu next to the home icon and select the "Cockpit" option:
+
+.. image:: images/Camunda_Cockpit_2.png
+
+The number of deployed process definitions should be displayed.  Click on it.
+
+.. image:: images/Camunda_Cockpit_3.png
+
+Now you should see an actual list of deployed process definitions.  You can click on any of them to view them.
+
+.. image:: images/Camunda_Cockpit_4.png
diff --git a/docs/Camunda_Cockpit_Enterprise_Edition.rst b/docs/Camunda_Cockpit_Enterprise_Edition.rst
new file mode 100644 (file)
index 0000000..3e2d15b
--- /dev/null
@@ -0,0 +1,143 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Camunda Cockpit Enterprise Edition
+==================================
+
+The Community Edition of Camunda is the version normally built into SO.  With the Community Edition, you can see process definitions, but you cannot inspect running or completed process instances, which is an essential debugging capability.  This capability is available only in the Enterprise Edition and requires a commercial license.  If you have such a license, you can build SO with the Enterprise Edition.  Your use must be consistent with the terms of your license, of course.
+
+With the Enterprise Edition cockpit, you can:
+
+  * See a trace of tasks executed by a running or completed process instance.
+  * Look at execution variables in a running or completed process instance.
+  * Look at called subprocesses in a running or completed process instance.
+
+Maven Repository for Camunda EE Artifacts
+------------------------------------------
+
+To build with Camunda EE, you will need a maven repository containing the Camunda EE artifacts.   This can be a nexus repository or a local repository in your filesystem.
+
+To construct a local repository, start with this structure for the 7.7.3-ee version of Camunda:
+
+  camunda-ee-repository.zip_
+
+.. _camunda-ee-repository.zip: https://wiki.onap.org/download/attachments/16001686/camunda-ee-repository.zip?version=1&modificationDate=1507838888000&api=v2
+
+*NOTE*: the zip archive does not contain the actual Enterprise Edition JAR and WAR files.  It contains zero-length files as placeholders.  You will need to replace the zero-length files with files you obtain from Camunda.  The archive does contain all the poms, checksums, and metadata required to make it a functional maven repository.
+
+Here's the minimum set of artifacts you need to build the SO Amsterdam release software:
+
+  camunda-engine-7.7.3-ee.jar
+
+  camunda-webapp-7.7.3-ee-classes.jar
+
+  camunda-webapp-7.7.3-ee.war
+
+  camunda-webapp-ee-jboss-standalone-7.7.3-ee.war
+
+  camunda-engine-cdi-7.7.3-ee.jar
+
+  camunda-engine-rest-7.7.3-ee-classes.jar
+
+  camunda-engine-plugin-spin-7.7.3-ee.jar
+
+  camunda-engine-plugin-connect-7.7.3-ee.jar
+
+  camunda-engine-rest-core-7.7.3-ee.jar
+
+  camunda-engine-feel-api-7.7.3-ee.jar
+
+  camunda-engine-feel-juel-7.7.3-ee.jar
+
+  camunda-engine-dmn-7.7.3-ee.jar
+
+  camunda-engine-spring-7.7.3-ee.jar
+
+  camunda-bpmn-model-7.7.3-ee.jar
+
+  camunda-xml-model-7.7.3-ee.jar
+
+  camunda-dmn-model-7.7.3-ee.jar
+
+  camunda-cmmn-model-7.7.3-ee.jar
+
+Maven settings.xml
+------------------
+
+Add a profile to your maven settings.xml to include the repository containing your Camunda EE artifacts.
+
+For example:
+
+.. code-block:: bash
+
+  <profile>
+  <!-- profile for artifacts not in public repositories -->
+  <id>my-local-artifacts</id>
+  <repositories>
+    <repository>
+      <!-- Local repository for Camunda Enterprise Edition -->
+      <!-- YOU MUST HAVE A VALID LICENSE TO USE THIS -->
+      <id>camunda-ee</id>
+      <name>camunda-ee</name>
+      <url>file:///home/john/onap/camunda-ee-repository</url>
+    </repository>
+  </repositories>
+  </profile>
+
+And add your profile to the list of active profiles:
+
+.. code-block:: bash
+
+  <activeProfiles>
+
+  <activeProfile>my-local-artifacts</activeProfile>
+
+  <activeProfile>openecomp-staging</activeProfile>
+
+  <activeProfile>openecomp-public</activeProfile>
+
+  <activeProfile>openecomp-release</activeProfile>
+
+  <activeProfile>openecomp-snapshots</activeProfile>
+
+  <activeProfile>opendaylight-release</activeProfile>
+
+  <activeProfile>opendaylight-snapshots</activeProfile>
+
+  </activeProfiles>
+
+Building
+--------
+
+Add these options to the mvn command line when you build "so"
+
+.. code-block:: bash
+
+  -Dcamunda.version=7.7.3-ee -Dcamunda.bpm.webapp.artifact=camunda-webapp-ee-jboss-standalone
+
+Installation
+-------------
+
+The cockpit is part of the SO image.  There are no special installation requirements.  When you log in, you will need to enter your license information.  Alternatively, you can insert your license directly into the camundabpmn database before you log in:
+
+.. code-block:: bash
+
+  INSERT INTO camundabpmn.ACT_GE_PROPERTY VALUES ('camunda-license-key','YOUR-LICENCE-KEY-HERE',1);
+
+Logging In
+-----------
+
+Because port 8080 on the docker host machine is forwarded to port 8080 in the SO docker container you can log into the Enterprise Edition cockpit by browsing to this URL:
+
+  http://*dockerhost*:8080/camunda
+
+  Where dockerhost is the docker host system.
+
+If you can use a browser on the docker host system, then use a localhost address:
+
+  http://localhost:8080/camunda
+
+The user is "admin" and the password is the same as the jboss admin password, which is not displayed here.
+
+.. image:: images/Camunda_Cockpit_Enterprise_1.png
diff --git a/docs/Camunda_Modeler.rst b/docs/Camunda_Modeler.rst
new file mode 100644 (file)
index 0000000..e2ff06d
--- /dev/null
@@ -0,0 +1,19 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
+.. http://creativecommons.org/licenses/by/4.0\r
+.. Copyright 2017 Huawei Technologies Co., Ltd.\r
+\r
+Camunda Modeler\r
+=================\r
+\r
+The Camunda_Modeler_ is the editor for BPMN 2.0 process flows.  It is a standalone application.  NOTE: the Camunda eclipse plugin is no longer supported and should not be used.\r
+\r
+.. _Camunda_Modeler: https://docs.camunda.org/manual/latest/modeler/camunda-modeler/\r
+\r
+.. image:: images/camunda_modeler_1.png\r
+\r
+Modeler Templates\r
+------------------\r
+\r
+Some work has already been done in MSO to develop templates_ for "building block" subprocess flows.  When a template is provided for a BPMN element, the modeler displays a custom form for inputting parameters.  This significantly simplifies flow construction and reduces the chance of making mistakes.\r
+\r
+.. _templates: https://docs.camunda.org/manual/7.7/modeler/camunda-modeler/element-templates/
\ No newline at end of file
diff --git a/docs/Configure_git_and_gerrit.rst b/docs/Configure_git_and_gerrit.rst
new file mode 100644 (file)
index 0000000..c4598fa
--- /dev/null
@@ -0,0 +1,93 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Configure git and gerrit
+========================
+
+Basics
+------
+The recommended version of git is 2.7.4 or later.  Check the installed version in the Ubuntu VM:
+
+.. code-block:: bash
+
+  git --version
+
+Create an SSH key to user with gerrit.  Use no passphrase.
+
+.. code-block:: bash
+
+  ssh-keygen -t rsa
+
+Enter your SSH public key (id_rsa) into gerrit:
+
+- Browse to https://gerrit.onap.org
+- Log in
+- Open the menu next to your name (under the green search button)
+
+.. image:: images/Configure_git_1.png
+
+- Select "Settings"
+- In the "Settings" sidebar, click "SSH Public Keys"`
+- Click "Add Key..."
+- Paste the entire contents of $HOME/.ssh/id_rsa.pub into the text area and click "Add".
+
+.. image:: images/Configure_git_2.png
+
+Install the git-review package.
+
+.. code-block:: bash
+
+  sudo apt update
+  sudo apt install git-review
+
+Create $HOME/.gitconfig (replace highlighted values with your own information):
+  [user]
+
+        name = FirstName LastName
+
+        email = you@yourcompany.com
+
+  [core]
+
+        autocrlf = false
+
+  [merge]
+
+        tool = vimdiff
+
+  [gitreview]
+
+        username = YourLinuxFoundationId
+
+**If you're behind a corporate firewall and your proxy server has SOCKS support...**
+
+You may be able to use the SSH protocol with git, which is preferred versus HTTP.  This method is known to work in the AT&T corporate network.
+Install the socat package, which allows you to tunnel SSH connections through a proxy that supports SOCKS:
+
+.. code-block:: bash
+
+  sudo apt update
+  sudo apt install socat
+
+Create (or append to) $HOME/.ssh/config (replace highlighted values with your information)
+
+  Host gerrit.onap.org
+
+  User userid
+
+  Hostname gerrit.onap.org
+
+  ProxyCommand socat - PROXY:host:%h:%p,proxyport=port
+
+  IdentityFile /home/userid/.ssh/id_rsa
+
+  ServerAliveInterval 10
+
+Verify that you have connectivity to gerrit through the proxy.  Answer "yes" to continue connecting, if prompted.
+
+.. code-block:: bash
+
+  ssh -p 29418 gerrit.onap.org
+
+.. image:: images/Configure_git_3.png
diff --git a/docs/Developer_Info.rst b/docs/Developer_Info.rst
new file mode 100644 (file)
index 0000000..d077323
--- /dev/null
@@ -0,0 +1,13 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
+.. http://creativecommons.org/licenses/by/4.0\r
+.. Copyright 2017 Huawei Technologies Co., Ltd.\r
+\r
+Developer Information\r
+======================\r
+\r
+.. toctree::\r
+   :maxdepth: 1\r
+\r
+   Install_Configure_SO.rst\r
+   architecture.rst\r
+   offered_consumed_apis.rst
\ No newline at end of file
index 5771a10..3f7b903 100644 (file)
@@ -2,7 +2,7 @@
 .. http://creativecommons.org/licenses/by/4.0\r
 .. Copyright 2017 Huawei Technologies Co., Ltd.\r
 \r
-Install and Configure Service Orchestrator\r
+SO Install & Configure\r
 ==========================================\r
 \r
 Get Ubuntu\r
@@ -18,79 +18,147 @@ Make sure you have the VirtualBox Guest Additions ISO for your version of Virtua
 Create a new VM in VirtualBox for Ubuntu\r
 ----------------------------------------\r
 Type: Linux\r
+\r
 Version: Ubuntu (64-bit)\r
+\r
 At least 2048 MB memory\r
+\r
 At least 40 GB VDI\r
+\r
 Network: Attached to: NAT\r
 \r
 Create a port-forwarding rule for SSH\r
 -------------------------------------\r
 Create a port-forwarding rule so that you can use PuTTY (or other SSH client) to connect to the VM.\r
+\r
 Go to "Network" settings in VirtualBox, add a port forwarding rule:\r
+\r
 Name: SSH\r
+\r
 Protocol: TCP\r
+\r
 Host IP: 127.0.0.1\r
+\r
 Host Port: 1022\r
+\r
 Guest IP: <leave blank>\r
+\r
 Guest Port: 22\r
 \r
+.. image:: images/Configure_ubuntu_SO_1.png\r
+\r
+.\r
+\r
+.. image:: images/Configure_ubuntu_SO_2.png\r
+\r
 Create Shared Folder\r
 --------------------\r
 This is oriented to Windows users.  If you're using a MAC or a Linux host computer, the details may be different.  You can share any folder on the host computer with the Ubuntu VM.  On Windows, a practical choice is to share the C:\Users folder, so that your Windows home directory will be accessible from the Ubuntu VM.\r
+\r
 Go to "Shared Folders" settings in VirtualBox, add a share:\r
+\r
 Folder Path: C:\Users\r
+\r
 Folder Name: Users\r
+\r
 Auto-mount: <checked>\r
+\r
 Read-only: <unchecked>\r
 \r
+.. image:: images/Configure_ubuntu_SO_3.png\r
+\r
+.\r
+\r
+.. image:: images/Configure_ubuntu_SO_4.png\r
+\r
 Install Ubuntu in the VM\r
 ------------------------\r
 On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image".  Select your Ubuntu ISO image.\r
 \r
+.. image:: images/Configure_ubuntu_SO_5.png\r
+\r
 After selecting the ISO image, start the VM.\r
+\r
 Follow the prompts to install Ubuntu.\r
 \r
 Proxy Configuration (optional)\r
 ------------------------------\r
 If you're behind a corporate firewall, configure some proxy settings.  NOTE: your proxy configuration may require username and password credentials, not shown here.\r
 **Ubuntu system proxy setting:**\r
+\r
        System Settings → Network → Network proxy\r
+       \r
        (Replace "proxyhost" and port with your actual proxy information)\r
 \r
+.. image:: images/Configure_ubuntu_SO_6.png\r
+       \r
 **apt proxy setting:**\r
        Edit /etc/apt/apt.conf and add one line at the top (replace "proxyhost:port" with your actual proxy information):\r
+       \r
                Acquire::http::Proxy "http://proxyhost:port";\r
+               \r
        Reboot the VM.\r
        \r
 Install SSH Server\r
 ------------------\r
-sudo apt update\r
-sudo apt install openssh-server\r
+\r
+.. code-block:: bash\r
+\r
+    sudo apt update\r
+    sudo apt install openssh-server\r
 \r
 Connect to the VM from your host computer\r
 -----------------------------------------\r
        The PuTTY SSH client is popular.  A connection to localhost:1022 (or whatever port you have forwarded) will go to the VM.\r
 \r
+.. image:: images/Configure_ubuntu_SO_7.png\r
+       \r
 Install VirtualBox Guest Additions\r
 ----------------------------------\r
 On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image".  Select your VirtualBox Guest Additions ISO image.\r
 \r
+.. image:: images/Configure_ubuntu_SO_8.png\r
+\r
 In a VM terminal window, mount the cdrom:\r
+\r
+.. code-block:: bash\r
+\r
        sudo mkdir -p /media/cdrom\r
        sudo mount /dev/cdrom /media/cdrom\r
+       \r
 Install necessary dependencies:\r
-       sudo apt update\r
-       sudo apt install gcc g++ dkms\r
+\r
+.. code-block:: bash\r
+\r
+    sudo apt update\r
+    sudo apt install gcc g++ dkms\r
+       \r
 Install the guest additions.  NOTE: look for errors in the command output!  If you see an error that says you are missing kernel headers, the most likely cause is that you are using a VirtualBox version that is too old.  The error message is misleading.\r
+\r
+.. code-block:: bash\r
+\r
        cd /media/cdrom\r
        sudo ./VBoxLinuxAdditions.run\r
 \r
+.. image:: images/Configure_ubuntu_SO_9.png    \r
+       \r
 Add yourself to the vboxsf user group (replace "userid" with your user ID):\r
+       \r
+.. code-block:: bash   \r
+       \r
        sudo usermod -a -G vboxsf userid\r
+       \r
 Reboot the VM.\r
+\r
 In a VM terminal window, verify that you can access your home directory on the host computer, which should be mounted under here:\r
        /media/sf_Users\r
        \r
 Further Reading\r
 ----------------------------------------       \r
-https://wiki.onap.org/display/DW/Development+Environment
\ No newline at end of file
+\r
+.. toctree::\r
+   :maxdepth: 1\r
+\r
+   Install_Docker.rst\r
+   Configure_git_and_gerrit.rst\r
+   Workspace_and_Development_Tools.rst
\ No newline at end of file
diff --git a/docs/Install_Docker.rst b/docs/Install_Docker.rst
new file mode 100644 (file)
index 0000000..5712691
--- /dev/null
@@ -0,0 +1,85 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
+.. http://creativecommons.org/licenses/by/4.0\r
+.. Copyright 2017 Huawei Technologies Co., Ltd.\r
+\r
+Install Docker\r
+===============\r
+\r
+Make sure curl is installed on the Ubuntu VM:\r
+\r
+.. code-block:: bash\r
+\r
+       sudo apt update\r
+       sudo apt install curl\r
+\r
+If you are behind a corporate firewall (replace "proxyhost:port" with your actual proxy information)\r
+       https_proxy="https://*proxyhost:port*" curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -\r
+       \r
+Otherwise:\r
+       curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -\r
+Expected Response:\r
+       OK\r
+Add the docker package repository:\r
+       sudo apt-add-repository "deb https://apt.dockerproject.org/repo ubuntu-xenial main"\r
+       \r
+Install packages:\r
+\r
+.. code-block:: bash\r
+\r
+    sudo apt update\r
+    sudo apt-cache policy docker-engine\r
+       sudo apt install docker-engine\r
+       sudo apt install docker-compose\r
+       \r
+If you are behind a corporate firewall, you will need to configure proxy settings for docker so that images may be obtained from internet repositories.  In the commands shown here, replace *"proxyhost:port"*, *"yourdomain1.com"*, and *"yourdomain2.com"* with appropriate values.\r
+       \r
+    Make the docker configuration directory:\r
+\r
+.. code-block:: bash\r
+       \r
+        sudo mkdir -p /etc/systemd/system/docker.service.d\r
+       \r
+    Edit (create) this file:\r
+\r
+.. code-block:: bash\r
+       \r
+               sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf\r
+       \r
+    Add these lines:\r
+\r
+        [Service]\r
+        \r
+               Environment="HTTP_PROXY=https://*proxyhost:port*"\r
+        \r
+               Environment="HTTPS_PROXY=https://*proxyhost:port*"\r
+        \r
+               Environment="NO_PROXY=localhost,127.0.0.1,.yourdomain1.com,.yourdomain2.com"\r
+       \r
+    Restart docker:\r
+\r
+.. code-block:: bash\r
+       \r
+        sudo systemctl daemon-reload\r
+        sudo systemctl restart docker\r
+\r
+Add yourself to the docker user group (replace "userid" with your user ID):\r
+\r
+.. code-block:: bash\r
+\r
+    sudo usermod -a -G docker *userid*\r
+\r
+Log out and log back in so that the user group change will takeeffect.\r
+\r
+Verify that you can connect to docker as yourself (i.e. not as root):\r
+\r
+.. code-block:: bash\r
+\r
+    docker ps\r
+\r
+Verify that you can download and run the hello-world container\r
+\r
+.. code-block:: bash\r
+\r
+    docker run hello-world\r
+       \r
+.. image:: images/Docker_install_1.png
\ No newline at end of file
diff --git a/docs/SO_API_v0.1.pdf b/docs/SO_API_v0.1.pdf
new file mode 100644 (file)
index 0000000..42fdc5f
Binary files /dev/null and b/docs/SO_API_v0.1.pdf differ
diff --git a/docs/SO_R1_Interface.rst b/docs/SO_R1_Interface.rst
new file mode 100644 (file)
index 0000000..41e127d
--- /dev/null
@@ -0,0 +1,17 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
+.. http://creativecommons.org/licenses/by/4.0\r
+.. Copyright 2017 Huawei Technologies Co., Ltd.\r
+\r
+SO R1 Interfaces\r
+================\r
+\r
+.. image:: images/SO_R1_1.png\r
+\r
+Service Orchestrator in R1 uses interfaces from both the MSO seed code and as well as new interfaces between the new components of ONAP. \r
+The below documentation of the SO APIs and are reviewed in the architecture committee meeting on 22/08/2017.\r
+\r
+See :download:`SO_API_v0.1.pdf`\r
+\r
+The interface between UUi and SO for the E2E VoLTE service:\r
+\r
+See :download:`UUI-SO_API_Specification_v0.1.docx`
\ No newline at end of file
similarity index 96%
rename from docs/UUI-SO API Specification v0.1(1).docx
rename to docs/UUI-SO_API_Specification_v0.1.docx
index a6dfbd0..d68cccf 100644 (file)
Binary files a/docs/UUI-SO API Specification v0.1(1).docx and b/docs/UUI-SO_API_Specification_v0.1.docx differ
diff --git a/docs/Working_with_SO_Docker.rst b/docs/Working_with_SO_Docker.rst
new file mode 100644 (file)
index 0000000..ee958ef
--- /dev/null
@@ -0,0 +1,208 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Working with SO Docker
+======================
+
+Verify that docker images are built
+------------------------------------
+
+.. code-block:: bash
+
+  docker images openecomp/mso
+
+  *Example Output:*
+
+  REPOSITORY     TAG                                  IMAGE ID     CREATED       SIZE
+
+  openecomp/mso  1.1-SNAPSHOT-latest                  419e9d8a17e8 3 minutes ago 1.62GB
+
+  openecomp/mso  1.1.0-SNAPSHOT-STAGING-20170926T2015 419e9d8a17e8 3 minutes ago 1.62GB
+
+  openecomp/mso  latest                               419e9d8a17e8 3 minutes ago 1.62GB
+
+Start the mariadb container
+----------------------------
+
+.. code-block:: bash
+
+  cd $HOME/onap/workspace/SO/docker-config
+
+  MTU=1500 docker-compose up mariadb
+
+*Example Output:*
+
+.. code-block:: bash
+
+  . . . many lines omitted . . .
+  mariadb_1  | Version: '10.1.11-MariaDB-1~jessie-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
+
+Log into the mariadb container and run the mysql client program
+---------------------------------------------------------------
+
+.. code-block:: bash
+
+  docker exec -it dockerconfig_mariadb_1 /bin/bash
+  mysql -uroot -ppassword
+
+Start the mso container
+-----------------------
+
+.. code-block:: bash
+
+  cd $HOME/onap/workspace/SO/docker-config
+
+  MTU=1500 docker-compose up mso
+
+*Example Output:*
+
+.. code-block:: bash
+
+  . . . many lines omitted . . .
+  mso_1      | 20:59:31,586 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.Final 
+  (WildFly Core 2.2.0.Final) started in 59937ms - Started 2422 of 2747 services (604 services are lazy, passive or
+  on-demand)
+
+Log into the mso container
+--------------------------
+
+.. code-block:: bash
+
+  docker exec -it dockerconfig_mso_1 /bin/bash
+
+Inspect a docker image
+----------------------
+
+This command shows interesting information about the structure of the mso image.  Note that an image is NOT a running container.  It is the template that a container is created from.
+
+.. code-block:: bash
+
+  docker inspect openecomp/mso
+  Example Output:
+
+  [
+    {
+        "Id": "sha256:419e9d8a17e8d7e876dfc36c1f3ed946bccbb29aa6faa6cd8e32fbc77c0ef6e5",
+        "RepoTags": [
+            "openecomp/mso:1.1-SNAPSHOT-latest",
+            "openecomp/mso:1.1.0-SNAPSHOT-STAGING-20170926T2015",
+            "openecomp/mso:latest"
+        ],
+        "RepoDigests": [],
+        "Parent": "sha256:70f1ba3d6289411fce96ba78755a3fd6055a370d33464553d72c753889b12693",
+        "Comment": "",
+        "Created": "2017-09-26T20:40:10.179358574Z",
+        "Container": "284aa05909390a3c0ffc1ec6d0f6e2071799d56b08369707505897bc73d2ea30",
+        "ContainerConfig": {
+            "Hostname": "6397aa10f0c4",
+            "Domainname": "",
+            "User": "root",
+            "AttachStdin": false,
+            "AttachStdout": false,
+            "AttachStderr": false,
+            "ExposedPorts": {
+                "8080/tcp": {}
+            },
+            "Tty": false,
+            "OpenStdin": false,
+            "StdinOnce": false,
+            "Env": [
+                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
+                "HTTP_PROXY=",
+                "HTTPS_PROXY=",
+                "http_proxy=",
+                "https_proxy=",
+                "JBOSS_HOME=/opt/jboss",
+                "CHEF_REPO_NAME=chef-repo",
+                "CHEF_CONFIG_NAME=mso-config"
+            ],
+            "Cmd": [
+                "/bin/sh",
+                "-c",
+                "#(nop) ",
+                "CMD [\"/opt/mso/scripts/start-jboss-server.sh\"]"
+            ],
+            "ArgsEscaped": true,
+            "Image": "sha256:70f1ba3d6289411fce96ba78755a3fd6055a370d33464553d72c753889b12693",
+            "Volumes": {
+                "/shared": {}
+            },
+            "WorkingDir": "",
+            "Entrypoint": null,
+            "OnBuild": [],
+            "Labels": {
+                "Description": "This image contains the ONAP SO",
+                "Version": "1.0"
+            }
+        },
+        "DockerVersion": "17.05.0-ce",
+        "Author": "\"The ONAP Team\"",
+        "Config": {
+            "Hostname": "6397aa10f0c4",
+            "Domainname": "",
+            "User": "root",
+            "AttachStdin": false,
+            "AttachStdout": false,
+            "AttachStderr": false,
+            "ExposedPorts": {
+                "8080/tcp": {}
+            },
+            "Tty": false,
+            "OpenStdin": false,
+            "StdinOnce": false,
+            "Env": [
+                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
+                "HTTP_PROXY=",
+                "HTTPS_PROXY=",
+                "http_proxy=",
+                "https_proxy=",
+                "JBOSS_HOME=/opt/jboss",
+                "CHEF_REPO_NAME=chef-repo",
+                "CHEF_CONFIG_NAME=mso-config"
+            ],
+            "Cmd": [
+                "/opt/mso/scripts/start-jboss-server.sh"
+            ],
+            "ArgsEscaped": true,
+            "Image": "sha256:70f1ba3d6289411fce96ba78755a3fd6055a370d33464553d72c753889b12693",
+            "Volumes": {
+                "/shared": {}
+            },
+            "WorkingDir": "",
+            "Entrypoint": null,
+            "OnBuild": [],
+            "Labels": {
+                "Description": "This image contains the ONAP SO",
+                "Version": "1.0"
+            }
+        },
+        "Architecture": "amd64",
+        "Os": "linux",
+        "Size": 1616881263,
+        "VirtualSize": 1616881263,
+        "GraphDriver": {
+            "Data": null,
+            "Name": "aufs"
+        },
+        "RootFS": {
+            "Type": "layers",
+            "Layers": [
+                "sha256:a2022691bf950a72f9d2d84d557183cb9eee07c065a76485f1695784855c5193",
+                "sha256:ae620432889d2553535199dbdd8ba5a264ce85fcdcd5a430974d81fc27c02b45",
+                . . .  many lines omitted . . .
+                "sha256:0f9e9dacce9191617e979f05e32ee782b1632e07130fd7fee19b0b2d635aa006",
+                "sha256:84572c6389f8ae41150e14a8f1a28a70720de91ab1032f8755b5449dc04449c9"
+            ]
+        }
+    }
+]
+
+Log into the mso image
+-----------------------
+
+This command allows you to inspect the files inside the mso image.  Note that an image is NOT a running container.  It is the template that a container is created from.
+
+.. code-block:: bash
+
+  docker run -it --entrypoint=/bin/bash openecomp/mso -i
diff --git a/docs/Workspace_and_Development_Tools.rst b/docs/Workspace_and_Development_Tools.rst
new file mode 100644 (file)
index 0000000..2012a20
--- /dev/null
@@ -0,0 +1,107 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
+.. http://creativecommons.org/licenses/by/4.0\r
+.. Copyright 2017 Huawei Technologies Co., Ltd.\r
+\r
+Workspace and Development Tools\r
+===============================\r
+\r
+We recognize that there are different ways to set up a workspace and different tools that may be chosen.  This is just one way to set things up.\r
+\r
+Suggested Directory Structure\r
+------------------------------\r
+*NOTE*: You may have different versions of eclipse and java.\r
+\r
+       onap\r
+       \r
+               .m2\r
+               \r
+               apache-maven-3.3.9\r
+               \r
+               camunda-modeler\r
+               \r
+               eclipse-jee-neon-3-linux-gtk-x86_64\r
+               \r
+               jdk1.8.0_131\r
+               \r
+               workspace\r
+               \r
+                       SO\r
+                               chef-repo\r
+                               \r
+                               docker-config\r
+                               \r
+                               libs\r
+                               \r
+                               so\r
+                               \r
+                               so-config\r
+                               \r
+Java\r
+-----\r
+Download the latest Java_8_SE_Development_Kit_ from Oracle.   Select a Linux x64 package.\r
+\r
+Unpack it.\r
+\r
+.. _Java_8_SE_Development_Kit: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html\r
+\r
+Maven\r
+------\r
+\r
+Download the Apache_Maven_3.3.9_ binary.  NOTE: 3.3.9 is the recommended version, even though much higher versions are available.\r
+\r
+Unpack it.\r
+\r
+.. _Apache_Maven_3.3.9: https://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/\r
+\r
+Create an .m2 directory for maven and put settings.xml_ in it.  Edit the local repository path in settings.xml to make it correct for your environment.  Everything else should be OK.\r
+\r
+.. _settings.xml: https://wiki.onap.org/download/attachments/15997820/settings.xml?version=1&modificationDate=1506156303000&api=v2\r
+\r
+Camunda Modeler\r
+---------------\r
+\r
+Download the Camunda_Modeler_.  Select the Linux x64 package.\r
+Unpack it.\r
+\r
+.. _Camunda_Modeler: https://camunda.org/download/modeler/\r
+\r
+Eclipse\r
+-------\r
+\r
+Download Eclipse_for_Linux_.  Select the 64-bit Eclipse IDE for Java EE Developers.  Oxygen seems to be the latest version. These instructions were written for Neon.\r
+Unpack it.\r
+\r
+.. _Eclipse_for_Linux:  https://www.eclipse.org/downloads/eclipse-packages/?osType=linux\r
+\r
+In the eclipse directory, edit eclipse.ini\r
+\r
+       Add (or change) the -vm setting so that it points to your JDK.\r
+       \r
+       Adjust the maximum heap space (2GB is recommended).\r
+       \r
+       Example:\r
+       \r
+.. image:: images/Workspace_and_Development_Tools.png  \r
+       \r
+Eclipse Settings\r
+----------------\r
+\r
+**Configure eclipse to use your external maven 3.3.9 installation:**\r
+       Go to Window→Preferences→Maven→Installations\r
+       \r
+       Click "Add" and browse to your apache-maven-3.3.9 directory.  Click "OK" to select it.\r
+       \r
+       Click "Finish"\r
+       \r
+.. image:: images/Workspace_and_Development_Tools_2.png\r
+\r
+Make sure the external installation is selected:\r
+\r
+.. image:: images/Workspace_and_Development_Tools_3.png\r
+\r
+**Configure eclipse to use your settings.xml**\r
+       Go to Window→Preferences→Maven→User Settings\r
+       \r
+       Type the full path to your settings.xml file into the "User Settings" box and click "OK".\r
+       \r
+.. image:: images/Workspace_and_Development_Tools_4.png
\ No newline at end of file
index c9f6838..7c01077 100644 (file)
 .. http://creativecommons.org/licenses/by/4.0\r
 .. Copyright 2017 Huawei Technologies Co., Ltd.\r
 \r
-Service Orchestrator\r
+SO - Service Orchestration\r
 ========================================================\r
 \r
 SO Architecture\r
 ----------------\r
-SO architecture and internal details could be found in the below wiki link\r
 \r
-https://wiki.onap.org/pages/viewpage.action?pageId=9830754\r
+.. image:: images/SO_Architecture_1.png\r
+\r
+SO Sub-Components\r
+------------------\r
+\r
+**API Handler**\r
+\r
+  RESTful interface to northbound clients\r
+      \r
+       * Handle service-level and infrastructure (VNF & network) requests\r
+       \r
+  Service-agnostic APIs\r
+    * “Service Instantiation API”\r
+\r
+  Model-driven recipe selection\r
+    * Use SO Catalog to map input requests to BPMN flows\r
+    * Dynamic lookup based on service-model + action\r
+    * Input data forwarded to BPMN flow\r
+       \r
+  Track open and completed requests via SO Request DB\r
+\r
+  Multiple API-H modules may support different APIs\r
+\r
+**BPMN Execution Engine**\r
+\r
+  Open-source Camunda platform\r
+    * Support BPMN 2.0 service recipes\r
+\r
+  Expose RESTful interface to API-H (unique path per recipe)\r
+\r
+  Make use of common “building block” sub-flows\r
+\r
+  Sequence orchestration steps for each Resource in the recipe\r
+    * Request and configure network resources via SDN-C\r
+    * Manage cloud resources via PO (OpenStack)\r
+    * Update inventory via A&AI\r
+  \r
+  Perform error handling/rollback\r
+\r
+**Resource Adapters**\r
+\r
+  Interfaces to lower level controllers and other ONAP components\r
+   * Platform Orchestrator, SDN-Controller, APP-Controller, VFC-Controllers\r
+   * Hides the details of complex interfaces (e.g. OpenStack APIs)\r
+   * Expose interfaces to BPMN flows as SOAP or REST APIs\r
+   * Support synchronous and asynchronous operations\r
+   \r
+  Provided as part of SO platform for use by all BPMN flows\r
+\r
+  Use SO Catalog to map resource requests to a recipe/template\r
+\r
+  Data-driven design\r
+   * Catalog templates may be updated via self-service (outside of release cycles)\r
+   * Merge input parameters with templates at run-time\r
+\r
+**Data Stores**\r
+   \r
+  Request DB\r
+   * Tracks open and completed requests\r
+  \r
+  SO Catalog\r
+   * SO view of the SDC Catalog\r
+      * service and resource models, recipes, and templates\r
+   * Populated via SDC distribution service from TOSCA models\r
+\r
+  Camunda DB\r
+   * Maintain state for BPMN flows\r
+   * Supports multiple active engines\r
+   \r
+**SDC Distribution Client**\r
+\r
+  Receive updated service models from SDC\r
+   * Event-bus notifications when new models available\r
+   * HTTP retrieval of models (TOSCA) and artifacts (Heat)\r
+   \r
+  Receive distributions as TOSCA models\r
+\r
+  Populate SO Catalog\r
+\r
+  Support self-service updates to models and artifacts\r
+  \r
+Third Party and Open Source\r
+---------------------------\r
+\r
+**BPMN Engine**\r
+  Camunda (open source)\r
+\r
+**Other Open Source Components of Note:**\r
+  JBOSS EAP/Wildfly\r
+  MySQL/MariaDB\r
+  Openstack Java SDK (“woorea”)\r
+\r
+\r
+\r
+\r
+\r
+  \r
\r
 \r
-.. toctree::\r
-   :maxdepth: 1\r
-   
\ No newline at end of file
diff --git a/docs/developer_information.rst b/docs/developer_information.rst
new file mode 100644 (file)
index 0000000..739a1f2
--- /dev/null
@@ -0,0 +1,20 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
+.. http://creativecommons.org/licenses/by/4.0\r
+.. Copyright 2017 Huawei Technologies Co., Ltd.\r
+\r
+SO Developer Information\r
+========================\r
+\r
+.. toctree::\r
+   :maxdepth: 1\r
+   \r
+   BPMN_Project_Structure.rst\r
+   Camunda_Modeler.rst\r
+   BPMN_Main_Process_Flows.rst\r
+   BPMN_Subprocess_Process_Flows.rst\r
+   BPMN_Project_Deployment_Strategy.rst\r
+   Building_SO.rst\r
+   Working_with_SO_Docker.rst\r
+   Camunda_Cockpit_Community_Edition.rst\r
+   Camunda_Cockpit_Enterprise_Edition.rst\r
+   
\ No newline at end of file
diff --git a/docs/images/BPMN_Main_Process_Flows_1.png b/docs/images/BPMN_Main_Process_Flows_1.png
new file mode 100644 (file)
index 0000000..57337d6
Binary files /dev/null and b/docs/images/BPMN_Main_Process_Flows_1.png differ
diff --git a/docs/images/BPMN_Subprocess_process_flows_1.png b/docs/images/BPMN_Subprocess_process_flows_1.png
new file mode 100644 (file)
index 0000000..5ec7e7c
Binary files /dev/null and b/docs/images/BPMN_Subprocess_process_flows_1.png differ
diff --git a/docs/images/Camunda_Cockpit_1.png b/docs/images/Camunda_Cockpit_1.png
new file mode 100644 (file)
index 0000000..cdcc6f3
Binary files /dev/null and b/docs/images/Camunda_Cockpit_1.png differ
diff --git a/docs/images/Camunda_Cockpit_2.png b/docs/images/Camunda_Cockpit_2.png
new file mode 100644 (file)
index 0000000..a696a68
Binary files /dev/null and b/docs/images/Camunda_Cockpit_2.png differ
diff --git a/docs/images/Camunda_Cockpit_3.png b/docs/images/Camunda_Cockpit_3.png
new file mode 100644 (file)
index 0000000..a298fe0
Binary files /dev/null and b/docs/images/Camunda_Cockpit_3.png differ
diff --git a/docs/images/Camunda_Cockpit_4.png b/docs/images/Camunda_Cockpit_4.png
new file mode 100644 (file)
index 0000000..ff445f3
Binary files /dev/null and b/docs/images/Camunda_Cockpit_4.png differ
diff --git a/docs/images/Camunda_Cockpit_Enterprise_1.png b/docs/images/Camunda_Cockpit_Enterprise_1.png
new file mode 100644 (file)
index 0000000..cdcc6f3
Binary files /dev/null and b/docs/images/Camunda_Cockpit_Enterprise_1.png differ
diff --git a/docs/images/Configure_git_1.png b/docs/images/Configure_git_1.png
new file mode 100644 (file)
index 0000000..2d4ce85
Binary files /dev/null and b/docs/images/Configure_git_1.png differ
diff --git a/docs/images/Configure_git_2.png b/docs/images/Configure_git_2.png
new file mode 100644 (file)
index 0000000..44ceeff
Binary files /dev/null and b/docs/images/Configure_git_2.png differ
diff --git a/docs/images/Configure_git_3.png b/docs/images/Configure_git_3.png
new file mode 100644 (file)
index 0000000..f44a0b4
Binary files /dev/null and b/docs/images/Configure_git_3.png differ
diff --git a/docs/images/Configure_ubuntu_SO_1.png b/docs/images/Configure_ubuntu_SO_1.png
new file mode 100644 (file)
index 0000000..a5a8301
Binary files /dev/null and b/docs/images/Configure_ubuntu_SO_1.png differ
diff --git a/docs/images/Configure_ubuntu_SO_2.png b/docs/images/Configure_ubuntu_SO_2.png
new file mode 100644 (file)
index 0000000..d3b215f
Binary files /dev/null and b/docs/images/Configure_ubuntu_SO_2.png differ
diff --git a/docs/images/Configure_ubuntu_SO_3.png b/docs/images/Configure_ubuntu_SO_3.png
new file mode 100644 (file)
index 0000000..ef4f21b
Binary files /dev/null and b/docs/images/Configure_ubuntu_SO_3.png differ
diff --git a/docs/images/Configure_ubuntu_SO_4.png b/docs/images/Configure_ubuntu_SO_4.png
new file mode 100644 (file)
index 0000000..f857eff
Binary files /dev/null and b/docs/images/Configure_ubuntu_SO_4.png differ
diff --git a/docs/images/Configure_ubuntu_SO_5.png b/docs/images/Configure_ubuntu_SO_5.png
new file mode 100644 (file)
index 0000000..01d2016
Binary files /dev/null and b/docs/images/Configure_ubuntu_SO_5.png differ
diff --git a/docs/images/Configure_ubuntu_SO_6.png b/docs/images/Configure_ubuntu_SO_6.png
new file mode 100644 (file)
index 0000000..17b9986
Binary files /dev/null and b/docs/images/Configure_ubuntu_SO_6.png differ
diff --git a/docs/images/Configure_ubuntu_SO_7.png b/docs/images/Configure_ubuntu_SO_7.png
new file mode 100644 (file)
index 0000000..d233847
Binary files /dev/null and b/docs/images/Configure_ubuntu_SO_7.png differ
diff --git a/docs/images/Configure_ubuntu_SO_8.png b/docs/images/Configure_ubuntu_SO_8.png
new file mode 100644 (file)
index 0000000..01d2016
Binary files /dev/null and b/docs/images/Configure_ubuntu_SO_8.png differ
diff --git a/docs/images/Configure_ubuntu_SO_9.png b/docs/images/Configure_ubuntu_SO_9.png
new file mode 100644 (file)
index 0000000..2cc96b3
Binary files /dev/null and b/docs/images/Configure_ubuntu_SO_9.png differ
diff --git a/docs/images/Docker_install_1.png b/docs/images/Docker_install_1.png
new file mode 100644 (file)
index 0000000..1e9c177
Binary files /dev/null and b/docs/images/Docker_install_1.png differ
diff --git a/docs/images/SO_Architecture_1.png b/docs/images/SO_Architecture_1.png
new file mode 100644 (file)
index 0000000..a50c01b
Binary files /dev/null and b/docs/images/SO_Architecture_1.png differ
diff --git a/docs/images/SO_R1_1.png b/docs/images/SO_R1_1.png
new file mode 100644 (file)
index 0000000..7bf98fc
Binary files /dev/null and b/docs/images/SO_R1_1.png differ
diff --git a/docs/images/Workspace_and_Development_Tools.png b/docs/images/Workspace_and_Development_Tools.png
new file mode 100644 (file)
index 0000000..46f8fe4
Binary files /dev/null and b/docs/images/Workspace_and_Development_Tools.png differ
diff --git a/docs/images/Workspace_and_Development_Tools_2.png b/docs/images/Workspace_and_Development_Tools_2.png
new file mode 100644 (file)
index 0000000..1f3fff0
Binary files /dev/null and b/docs/images/Workspace_and_Development_Tools_2.png differ
diff --git a/docs/images/Workspace_and_Development_Tools_3.png b/docs/images/Workspace_and_Development_Tools_3.png
new file mode 100644 (file)
index 0000000..3d2f35d
Binary files /dev/null and b/docs/images/Workspace_and_Development_Tools_3.png differ
diff --git a/docs/images/Workspace_and_Development_Tools_4.png b/docs/images/Workspace_and_Development_Tools_4.png
new file mode 100644 (file)
index 0000000..31a424e
Binary files /dev/null and b/docs/images/Workspace_and_Development_Tools_4.png differ
diff --git a/docs/images/bpmn_project_structure_1.png b/docs/images/bpmn_project_structure_1.png
new file mode 100644 (file)
index 0000000..d94b6fb
Binary files /dev/null and b/docs/images/bpmn_project_structure_1.png differ
diff --git a/docs/images/bpmn_project_structure_2.png b/docs/images/bpmn_project_structure_2.png
new file mode 100644 (file)
index 0000000..15f6360
Binary files /dev/null and b/docs/images/bpmn_project_structure_2.png differ
diff --git a/docs/images/bpmn_project_structure_3.png b/docs/images/bpmn_project_structure_3.png
new file mode 100644 (file)
index 0000000..e9f0d8d
Binary files /dev/null and b/docs/images/bpmn_project_structure_3.png differ
diff --git a/docs/images/bpmn_project_structure_4.png b/docs/images/bpmn_project_structure_4.png
new file mode 100644 (file)
index 0000000..c5cbb8b
Binary files /dev/null and b/docs/images/bpmn_project_structure_4.png differ
diff --git a/docs/images/bpmn_project_structure_5.png b/docs/images/bpmn_project_structure_5.png
new file mode 100644 (file)
index 0000000..3c3e906
Binary files /dev/null and b/docs/images/bpmn_project_structure_5.png differ
diff --git a/docs/images/camunda_modeler_1.png b/docs/images/camunda_modeler_1.png
new file mode 100644 (file)
index 0000000..2316c98
Binary files /dev/null and b/docs/images/camunda_modeler_1.png differ
index e2fbfcd..9fd4cc3 100644 (file)
@@ -2,7 +2,7 @@
 .. http://creativecommons.org/licenses/by/4.0\r
 .. Copyright 2017 Huawei Technologies Co., Ltd.\r
 \r
-ONAP Service Orchestration Documentation\r
+ONAP SO\r
 ========================================\r
 \r
 .. toctree::\r
@@ -11,4 +11,5 @@ ONAP Service Orchestration Documentation
    Install_Configure_SO.rst\r
    architecture.rst\r
    offered_consumed_apis.rst\r
-   
\ No newline at end of file
+   developer_information.rst\r
+   release-notes.rst
\ No newline at end of file
index fc5af91..07f534e 100644 (file)
-.. _open_cli_schema_version_1_0:\r
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
-.. http://creativecommons.org/licenses/by/4.0\r
-.. Copyright 2017 Huawei Technologies Co., Ltd.\r
-\r
-Install and Configure Service Orchestrator\r
-==========================================\r
-\r
-Get Ubuntu\r
-----------\r
-Get the Ubuntu ISO image from ubuntu.com. The recommended version is 16.04.3 LTS (Long Term Support), desktop edition.\r
-\r
-Get VirtualBox and VirtualBox Guest Additions\r
----------------------------------------------\r
-Make sure you have the VirtualBox Guest Additions ISO for your version of VirtualBox.  I'm using VirtualBox 5.1.28.  Save the Guest Additions ISO on your host computer along with the Ubuntu ISO.  Get the Guest Additions ISO from here:\r
-       http://download.virtualbox.org/virtualbox\r
-*NOTE*: Guest Additions versions prior to 5.1 will not work with Ubuntu 16.04.3.  If you have an earlier version of VirtualBox, you should upgrade to the latest 5.1 version.\r
-\r
-Create a new VM in VirtualBox for Ubuntu\r
-----------------------------------------\r
-Type: Linux\r
-Version: Ubuntu (64-bit)\r
-At least 2048 MB memory\r
-At least 40 GB VDI\r
-Network: Attached to: NAT\r
-\r
-Create a port-forwarding rule for SSH\r
--------------------------------------\r
-Create a port-forwarding rule so that you can use PuTTY (or other SSH client) to connect to the VM.\r
-Go to "Network" settings in VirtualBox, add a port forwarding rule:\r
-Name: SSH\r
-Protocol: TCP\r
-Host IP: 127.0.0.1\r
-Host Port: 1022\r
-Guest IP: <leave blank>\r
-Guest Port: 22\r
-\r
-Create Shared Folder\r
---------------------\r
-This is oriented to Windows users.  If you're using a MAC or a Linux host computer, the details may be different.  You can share any folder on the host computer with the Ubuntu VM.  On Windows, a practical choice is to share the C:\Users folder, so that your Windows home directory will be accessible from the Ubuntu VM.\r
-Go to "Shared Folders" settings in VirtualBox, add a share:\r
-Folder Path: C:\Users\r
-Folder Name: Users\r
-Auto-mount: <checked>\r
-Read-only: <unchecked>\r
-\r
-Install Ubuntu in the VM\r
-------------------------\r
-On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image".  Select your Ubuntu ISO image.\r
-\r
-After selecting the ISO image, start the VM.\r
-Follow the prompts to install Ubuntu.\r
-\r
-Proxy Configuration (optional)\r
-------------------------------\r
-If you're behind a corporate firewall, configure some proxy settings.  NOTE: your proxy configuration may require username and password credentials, not shown here.\r
-**Ubuntu system proxy setting:**\r
-       System Settings → Network → Network proxy\r
-       (Replace "proxyhost" and port with your actual proxy information)\r
-\r
-**apt proxy setting:**\r
-       Edit /etc/apt/apt.conf and add one line at the top (replace "proxyhost:port" with your actual proxy information):\r
-               Acquire::http::Proxy "http://proxyhost:port";\r
-       Reboot the VM.\r
-       \r
-Install SSH Server\r
-------------------\r
-sudo apt update\r
-sudo apt install openssh-server\r
-\r
-Connect to the VM from your host computer\r
------------------------------------------\r
-       The PuTTY SSH client is popular.  A connection to localhost:1022 (or whatever port you have forwarded) will go to the VM.\r
-\r
-Install VirtualBox Guest Additions\r
-----------------------------------\r
-On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image".  Select your VirtualBox Guest Additions ISO image.\r
-\r
-In a VM terminal window, mount the cdrom:\r
-       sudo mkdir -p /media/cdrom\r
-       sudo mount /dev/cdrom /media/cdrom\r
-Install necessary dependencies:\r
-       sudo apt update\r
-       sudo apt install gcc g++ dkms\r
-Install the guest additions.  NOTE: look for errors in the command output!  If you see an error that says you are missing kernel headers, the most likely cause is that you are using a VirtualBox version that is too old.  The error message is misleading.\r
-       cd /media/cdrom\r
-       sudo ./VBoxLinuxAdditions.run\r
-\r
-Add yourself to the vboxsf user group (replace "userid" with your user ID):\r
-       sudo usermod -a -G vboxsf userid\r
-Reboot the VM.\r
-In a VM terminal window, verify that you can access your home directory on the host computer, which should be mounted under here:\r
-       /media/sf_Users\r
-       \r
-Further Reading\r
-----------------------------------------       \r
-https://wiki.onap.org/display/DW/Development+Environment
\ No newline at end of file
+.. _open_cli_schema_version_1_0:
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright 2017 Huawei Technologies Co., Ltd.
+
+Install and Configure Service Orchestrator
+==========================================
+
+Get Ubuntu
+----------
+Get the Ubuntu ISO image from ubuntu.com. The recommended version is 16.04.3 LTS (Long Term Support), desktop edition.
+
+Get VirtualBox and VirtualBox Guest Additions
+---------------------------------------------
+Make sure you have the VirtualBox Guest Additions ISO for your version of
+VirtualBox.  I'm using VirtualBox 5.1.28.  Save the Guest Additions ISO on your
+host computer along with the Ubuntu ISO.  Get the Guest Additions ISO from
+here: http://download.virtualbox.org/virtualbox
+
+*NOTE*: Guest Additions versions prior to 5.1 will not work with Ubuntu 16.04.3.  If you have an earlier version of VirtualBox, you should upgrade to the latest 5.1 version.
+
+Create a new VM in VirtualBox for Ubuntu
+----------------------------------------
+Type: Linux
+Version: Ubuntu (64-bit)
+At least 2048 MB memory
+At least 40 GB VDI
+Network: Attached to: NAT
+
+Create a port-forwarding rule for SSH
+-------------------------------------
+Create a port-forwarding rule so that you can use PuTTY (or other SSH client) to connect to the VM.
+Go to "Network" settings in VirtualBox, add a port forwarding rule:
+Name: SSH
+Protocol: TCP
+Host IP: 127.0.0.1
+Host Port: 1022
+Guest IP: <leave blank>
+Guest Port: 22
+
+Create Shared Folder
+--------------------
+This is oriented to Windows users.  If you're using a MAC or a Linux host computer, the details may be different.  You can share any folder on the host computer with the Ubuntu VM.  On Windows, a practical choice is to share the C:\Users folder, so that your Windows home directory will be accessible from the Ubuntu VM.
+Go to "Shared Folders" settings in VirtualBox, add a share:
+Folder Path: C:\Users
+Folder Name: Users
+Auto-mount: <checked>
+Read-only: <unchecked>
+
+Install Ubuntu in the VM
+------------------------
+On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image".  Select your Ubuntu ISO image.
+
+After selecting the ISO image, start the VM.
+Follow the prompts to install Ubuntu.
+
+Proxy Configuration (optional)
+------------------------------
+If you're behind a corporate firewall, configure some proxy settings.  NOTE: your proxy configuration may require username and password credentials, not shown here.
+**Ubuntu system proxy setting**:
+
+- System Settings → Network → Network proxy
+  (Replace "proxyhost" and port with your actual proxy information)
+
+**apt proxy setting**:
+
+- Edit /etc/apt/apt.conf and add one line at the top (replace "proxyhost:port" with your actual proxy information):
+  Acquire::http::Proxy "http://proxyhost:port";
+- Reboot the VM.
+
+Install SSH Server
+------------------
+sudo apt update
+sudo apt install openssh-server
+
+Connect to the VM from your host computer
+-----------------------------------------
+The PuTTY SSH client is popular.  A connection to localhost:1022 (or whatever port you have forwarded) will go to the VM.
+
+Install VirtualBox Guest Additions
+----------------------------------
+On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image".  Select your VirtualBox Guest Additions ISO image.
+
+In a VM terminal window, mount the cdrom::
+
+  sudo mkdir -p /media/cdrom
+  sudo mount /dev/cdrom /media/cdrom
+
+Install necessary dependencies::
+
+  sudo apt update
+  sudo apt install gcc g++ dkms
+
+Install the guest additions.  NOTE: look for errors in the command output!
+If you see an error that says you are missing kernel headers, the most likely
+cause is that you are using a VirtualBox version that is too old.
+The error message is misleading.::
+
+  cd /media/cdrom
+  sudo ./VBoxLinuxAdditions.run
+
+Add yourself to the vboxsf user group (replace "userid" with your user ID)::
+
+  sudo usermod -a -G vboxsf userid
+
+Reboot the VM.
+In a VM terminal window, verify that you can access your home directory on the
+host computer, which should be mounted under /media/sf_Users
+
+Further Reading
+----------------------------------------
+https://wiki.onap.org/display/DW/Development+Environment
index f7110c7..8888c64 100644 (file)
@@ -2,15 +2,14 @@
 .. http://creativecommons.org/licenses/by/4.0\r
 .. Copyright 2017 Huawei Technologies Co., Ltd.\r
 \r
-ONAP Service Orchestration APIs\r
+SO Offered and Consumed APIs\r
 =====================================\r
 \r
 SO APIs\r
 --------\r
 All the Service Orchestrator APIs, both inward and outward are documented in the below link of onap wiki.\r
-\r
-   https://wiki.onap.org/display/DW/SO+R1+Interfaces\r
-   \r
-   \r
\r
 .. toctree::\r
    :maxdepth: 1\r
+   \r
+   SO_R1_Interface.rst\r
index 7c7c137..c0a2984 100644 (file)
@@ -3,46 +3,57 @@
 .. Copyright 2017 Huawei Intellectual Property.  All rights reserved.
 
 
-Service Orchestrator Release Notes
-==================================
-
-.. note::
-       * This Release Notes must be updated each time the team decides to Release new artifacts.
-       * The scope of this Release Notes is for this particular component. In other words, each ONAP component has its Release Notes.
-       * This Release Notes is cumulative, the most recently Released artifact is made visible in the top of this Release Notes.
-       * Except the date and the version number, all the other sections are optional but there must be at least one section describing the purpose of this new release.
-       * This note must be removed after content has been added.
+SO Release Notes
+================
+
                   
 
 Version: 1.1.0
 --------------
 
 
-:Release Date: yyyy-mm-dd
+:Release Date: 2017-11-16
 
 
 
 **New Features**
-       Initial release of Service Orchestrator (SO) for Open Network Automation Platform (ONAP)
-
+The SO provides the highest level of service orchestration in the ONAP architecture.
+SO is implemented via BPMN flows that operate on Models distributed from SDC that describe the Services and associated VNFs and other Resource components.
+Cloud orchestration currently based on HEAT and TOSCA templates.       
+The orchestration engine is a reusable service. Any component of the architecture can execute process workflows. 
+Orchestration services can consume a process workflow and execute it. 
+The service model maintains consistency and reusability across all orchestration activities and ensures consistent methods, structure and version of the workflow execution environment.
+Orchestration processes interact with other platform components or external systems via standard and well-defined APIs.
 
 **Bug Fixes**
-       - ``_ and a sentence explaining what this defect is addressing.
+This is the initial release of ONAP SO.
+Issues of the Ecomp 1710 release are fixed in this release.
+
 **Known Issues**
-       - ``_ and two, three sentences.
-         One sentences explaining what is the issue.
-         
-         Another sentence explaining the impact of the issue.
-         
-         And an optional sentence providing a workaround.
+1. The articatfs of SO are under the openecomp/mso folder in nexus.
+   This is not impacting the release but is good to be moved to the ONAP 
+2. Current SO release does not support PNF orchestration.
+   The usecases demonstrated in ONAP Amsterdam release does not include PNF.
+3. ARIA Plugin is not in full fledged in the current release.
+   The VNFs provided in the vCPE and vFW usecase are heat based and dont require ARIA.
 
 **Security Issues**
-       You may want to include a reference to CVE (Common Vulnerabilities and Exposures) `CVE <https://cve.mitre.org>`_
-
+This is the initial release of ONAP SO.
+Security aspects are not included in the current release.
 
 **Upgrade Notes**
+This is the initial release of ONAP SO.
 
 **Deprecation Notes**
+There is a MSO 1.0.0 SO implementation existing in the pre-R1 ONAP Gerrit system.  
+The MSO1.0.0 is deprecated by the R1 release and the current release is built over this release.
+The Gerrit repos of mso/* are voided and already locked as read-only.
+Following are the deprecated SO projects in gerrit repo:
+mso
+mso/chef-repo
+mso/docker-config
+mso/libs
+mso/mso-config
        
 
 **Other**
index 6413c4b..3c40003 100644 (file)
@@ -751,6 +751,11 @@ public class ServiceInstances {
        private RecipeLookupResult getServiceURI (CatalogDatabase db, MsoRequest msoRequest, Action action) throws Exception {
                // SERVICE REQUEST
                // Construct the default service name
+               // if no source is provided then make it as VID 
+//             if (null == msoRequest.getRequestInfo().getSource() || msoRequest.getRequestInfo().getSource().isEmpty()){
+//                                     msoRequest.getRequestInfo().setSource("VID");
+//             }
+                               
                // TODO need to make this a configurable property
                String defaultServiceModelName = msoRequest.getRequestInfo().getSource() + "_DEFAULT";
 
index b7a3b04..868de8d 100644 (file)
@@ -105,12 +105,6 @@ public class SoapUiITCase {
                return warArchive;
        }
        
-       @Deployment(name="common-bpmn",testable=false)
-       public static Archive<?> createCommonBPMNDeployment () {
-               System.out.println("Deploying Common BPMN WAR on default server");
-               return ArquillianPackagerForITCases.createPackageFromExistingOne("../../bpmn/MSOCommonBPMN/target/", "MSOCommonBPMN*.war", "MSOCommonBPMN.war");
-       }
-       
         @Deployment(name = "infrastructure-bpmn", testable = false)
         public static Archive<?> createInfraBPMNDeployment() {
             System.out.println("Deploying Infrastructure BPMN WAR on default server");
index efbd787..e909b11 100644 (file)
                        <outputDirectory>artifacts</outputDirectory>
                </fileSet>
 
-               <fileSet>
-                       <includes>
-                               <include>MSOCommonBPMN*.war</include>
-                       </includes>
-                       <directory>../../bpmn/MSOCommonBPMN/target/</directory>
-                       <outputDirectory>artifacts</outputDirectory>
-               </fileSet>
                <fileSet>
             <includes>
                 <include>MSOInfrastructureBPMN*.war</include>