aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-common
diff options
context:
space:
mode:
Diffstat (limited to 'mso-api-handlers/mso-api-handler-common')
-rw-r--r--mso-api-handlers/mso-api-handler-common/pom.xml10
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaVIDRequest.java10
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaClient.java28
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CommonConstants.java12
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/ValidationException.java11
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/BPELRestClientTest.java4
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/CamundaRequestTest.java6
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/ResponseHandlerTest.java4
8 files changed, 31 insertions, 54 deletions
diff --git a/mso-api-handlers/mso-api-handler-common/pom.xml b/mso-api-handlers/mso-api-handler-common/pom.xml
index 859155a1b7..e11fbb8c25 100644
--- a/mso-api-handlers/mso-api-handler-common/pom.xml
+++ b/mso-api-handlers/mso-api-handler-common/pom.xml
@@ -47,16 +47,6 @@
</dependency>
<dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- </dependency>
-
- <dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaVIDRequest.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaVIDRequest.java
index 5cf859d537..00e52ab7e4 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaVIDRequest.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaVIDRequest.java
@@ -52,7 +52,7 @@ public class CamundaVIDRequest {
private CamundaInput requestId;
@JsonProperty(CommonConstants.REQUEST_ID_HEADER)
- private CamundaInput attMsoRequestId;
+ private CamundaInput msoRequestId;
@JsonProperty(CommonConstants.IS_BASE_VF_MODULE_VARIABLE)
@@ -122,13 +122,13 @@ public class CamundaVIDRequest {
}
@JsonProperty(CommonConstants.REQUEST_ID_HEADER)
- public CamundaInput getAttMsoRequestId() {
- return attMsoRequestId;
+ public CamundaInput getMsoRequestId() {
+ return msoRequestId;
}
@JsonProperty(CommonConstants.REQUEST_ID_HEADER)
- public void setAttMsoRequestId(CamundaInput attMsoRequestId) {
- this.attMsoRequestId = attMsoRequestId;
+ public void setMsoRequestId(CamundaInput msoRequestIdp) {
+ this.msoRequestId = msoRequestIdp;
}
@JsonProperty(CommonConstants.IS_BASE_VF_MODULE_VARIABLE)
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaClient.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaClient.java
index dd83d24c9e..d893a12b24 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaClient.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaClient.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -38,7 +38,7 @@ public class CamundaClient extends RequestClient{
private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.APIH);
public CamundaClient() {
- super(CommonConstants.CAMUNDA);
+ super(CommonConstants.CAMUNDA);
}
@@ -141,8 +141,8 @@ public class CamundaClient extends RequestClient{
if(schemaVersion == null){
schemaVersion = "";
}
-
-
+
+
try{
CamundaRequest camundaRequest = new CamundaRequest();
CamundaInput camundaInput = new CamundaInput();
@@ -221,7 +221,6 @@ public class CamundaClient extends RequestClient{
try{
CamundaVIDRequest camundaRequest = new CamundaVIDRequest();
- BpmnRequest bpmnRequest = new BpmnRequest();
CamundaInput serviceInput = new CamundaInput();
CamundaInput host = new CamundaInput();
CamundaInput requestIdInput= new CamundaInput();
@@ -253,26 +252,11 @@ public class CamundaClient extends RequestClient{
vfModuleTypeInput.setValue(vfModuleType);
networkTypeInput.setValue(networkType);
- bpmnRequest.setRequestId(requestIdInput);
- bpmnRequest.setIsBaseVfModule(isBaseVfModuleInput);
- bpmnRequest.setRecipeTimeout(recipeTimeoutInput);
- bpmnRequest.setRequestAction(requestActionInput);
- bpmnRequest.setServiceInstanceId(serviceInstanceIdInput);
- bpmnRequest.setVnfId(vnfIdInput);
- bpmnRequest.setVfModuleId(vfModuleIdInput);
- bpmnRequest.setVolumeGroupId(volumeGroupIdInput);
- bpmnRequest.setNetworkId(networkIdInput);
- bpmnRequest.setServiceType(serviceTypeInput);
- bpmnRequest.setVnfType(vnfTypeInput);
- bpmnRequest.setVfModuleType(vfModuleTypeInput);
- bpmnRequest.setNetworkType(networkTypeInput);
- //bpmnRequest.setRequestDetails(requestDetailsInput);
-
serviceInput.setValue(requestDetails);
camundaRequest.setServiceInput(serviceInput);
camundaRequest.setHost(host);
camundaRequest.setRequestId(requestIdInput);
- camundaRequest.setAttMsoRequestId(requestIdInput);
+ camundaRequest.setMsoRequestId(requestIdInput);
camundaRequest.setIsBaseVfModule(isBaseVfModuleInput);
camundaRequest.setRecipeTimeout(recipeTimeoutInput);
camundaRequest.setRequestAction(requestActionInput);
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CommonConstants.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CommonConstants.java
index 3a9ad60ac2..187e0ed0a6 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CommonConstants.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CommonConstants.java
@@ -26,11 +26,11 @@ public final class CommonConstants {
public static final String DEFAULT_BPEL_AUTH = "admin:admin";
public static final String ENCRYPTION_KEY = "aa3871669d893c7fb8abbcda31b88b4f";
- public static final String REQUEST_ID_HEADER = "att-mso-request-id";
- public static final String REQUEST_TIMEOUT_HEADER = "att-mso-service-request-timeout";
- public static final String SCHEMA_VERSION_HEADER = "att-mso-schema-version";
- public static final String SERVICE_INSTANCE_ID_HEADER = "att-mso-service-instance-id";
- public static final String ACTION_HEADER = "att-mso-action";
+ public static final String REQUEST_ID_HEADER = "mso-request-id";
+ public static final String REQUEST_TIMEOUT_HEADER = "mso-service-request-timeout";
+ public static final String SCHEMA_VERSION_HEADER = "mso-schema-version";
+ public static final String SERVICE_INSTANCE_ID_HEADER = "mso-service-instance-id";
+ public static final String ACTION_HEADER = "mso-action";
public static final String CAMUNDA_SERVICE_INPUT = "bpmnRequest";
public static final String CAMUNDA_ROOT_INPUT = "variables";
@@ -45,7 +45,7 @@ public final class CommonConstants {
public static final int BPEL = 0;
public static final int CAMUNDA = 1;
public static final String CAMUNDA_HOST = "host";
- public static final String SDNC_UUID_HEADER = "att-mso-sdnc-request-id";
+ public static final String SDNC_UUID_HEADER = "mso-sdnc-request-id";
public static final String REQUEST_ID_VARIABLE = "requestId";
public static final String IS_BASE_VF_MODULE_VARIABLE = "isBaseVfModule";
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/ValidationException.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/ValidationException.java
index 0136a2d3b7..eb7a01210f 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/ValidationException.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/ValidationException.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,12 +26,13 @@ public class ValidationException extends Exception {
/**
* This class simply extends Exception (without addition additional functionality)
* to provide an identifier for RequestsDB related exceptions on create, delete, query.
- *
+ *
*
**/
private static final long serialVersionUID = 1L;
private static final String validationFailMessage = "No valid $ELEMENT is specified";
+ private static final String invalidElementMessage = "$ELEMENT is not valid in the $VERSION version";
public ValidationException (String msg) {
super (validationFailMessage.replaceAll ("\\$ELEMENT", msg));
@@ -40,5 +41,7 @@ public class ValidationException extends Exception {
public ValidationException (String msg, Exception cause) {
super (validationFailMessage.replaceAll ("\\$ELEMENT", msg), cause);
}
-
+ public ValidationException(String msg, String version) {
+ super(invalidElementMessage.replaceAll("\\$ELEMENT", msg).replaceAll("\\$VERSION", version));
+ }
}
diff --git a/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/BPELRestClientTest.java b/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/BPELRestClientTest.java
index 46e3a4602f..a0bed927e8 100644
--- a/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/BPELRestClientTest.java
+++ b/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/BPELRestClientTest.java
@@ -70,8 +70,8 @@ public class BPELRestClientTest {
JsonMappingException, IOException {
- String responseBody ="<layer3activate:service-response xmlns:layer3activate=\"http://ecomp.att.com/mso/request/layer3serviceactivate/schema/v1\""
- + "xmlns:reqtype=\"http://ecomp.att.com/mso/request/types/v1\""
+ String responseBody ="<layer3activate:service-response xmlns:layer3activate=\"http://org.openecomp/mso/request/layer3serviceactivate/schema/v1\""
+ + "xmlns:reqtype=\"http://org.openecomp/mso/request/types/v1\""
+ "xmlns:aetgt=\"http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd\""
+ "xmlns:types=\"http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd\">"
+ "<reqtype:request-id>req5</reqtype:request-id>"
diff --git a/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/CamundaRequestTest.java b/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/CamundaRequestTest.java
index bd2fee6f1e..a988111d61 100644
--- a/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/CamundaRequestTest.java
+++ b/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/CamundaRequestTest.java
@@ -54,7 +54,7 @@ public class CamundaRequestTest {
CamundaInput svcid = new CamundaInput();
CamundaInput timeout = new CamundaInput();
camundaInput
- .setValue("<aetgt:CreateTenantRequest xmlns:aetgt=\"http://ecomp.att.com/mso/workflow/schema/v1\" xmlns:sdncadapterworkflow=\"http://ecomp.att.com/mso/workflow/schema/v1\" xmlns:ns5=\"http://ecomp.att.com/mso/request/types/v1\"> <msoservtypes:request-information xmlns:msoservtypes=\"http://ecomp.att.com/mso/request/types/v1\"><msoservtypes:request-id>155415ab-b4a7-4382-b4c6-d17d950604</msoservtypes:request-id><msoservtypes:request-action>Layer3ServiceActivateRequest</msoservtypes:request-action><msoservtypes:source>OMX</msoservtypes:source><msoservtypes:notification-url>https://csi-tst-q22.it.att.com:22443/Services/com/cingular/csi/sdn/SendManagedNetworkStatusNotification.jws</msoservtypes:notification-url><msoservtypes:order-number>5051563</msoservtypes:order-number><msoservtypes:order-version>1</msoservtypes:order-version> </msoservtypes:request-information> <msoservtypes:service-information xmlns:msoservtypes=\"http://ecomp.att.com/mso/request/types/v1\"><msoservtypes:service-type>SDN-ETHERNET-INTERNET</msoservtypes:service-type><msoservtypes:service-instance-id>HI/VLXM/950604//SW_INTERNET</msoservtypes:service-instance-id><msoservtypes:subscriber-name>SubName01</msoservtypes:subscriber-name> </msoservtypes:service-information> <sdncadapterworkflow:cloudId>MTSNJA4LCP1</sdncadapterworkflow:cloudId> </aetgt:CreateTenantRequest>");
+ .setValue("<aetgt:CreateTenantRequest xmlns:aetgt=\"http://org.openecomp/mso/workflow/schema/v1\" xmlns:sdncadapterworkflow=\"http://org.openecomp/mso/workflow/schema/v1\" xmlns:ns5=\"http://org.openecomp/mso/request/types/v1\"> <msoservtypes:request-information xmlns:msoservtypes=\"http://org.openecomp/mso/request/types/v1\"><msoservtypes:request-id>155415ab-b4a7-4382-b4c6-d17d950604</msoservtypes:request-id><msoservtypes:request-action>Layer3ServiceActivateRequest</msoservtypes:request-action><msoservtypes:source>OMX</msoservtypes:source><msoservtypes:notification-url>https://localhost:22443/Services/com/cingular/csi/sdn/SendManagedNetworkStatusNotification.jws</msoservtypes:notification-url><msoservtypes:order-number>5051563</msoservtypes:order-number><msoservtypes:order-version>1</msoservtypes:order-version> </msoservtypes:request-information> <msoservtypes:service-information xmlns:msoservtypes=\"http://org.openecomp/mso/request/types/v1\"><msoservtypes:service-type>SDN-ETHERNET-INTERNET</msoservtypes:service-type><msoservtypes:service-instance-id>HI/VLXM/950604//SW_INTERNET</msoservtypes:service-instance-id><msoservtypes:subscriber-name>SubName01</msoservtypes:subscriber-name> </msoservtypes:service-information> <sdncadapterworkflow:cloudId>MTSNJA4LCP1</sdncadapterworkflow:cloudId> </aetgt:CreateTenantRequest>");
camundaRequest.setServiceInput(camundaInput);
host.setValue("localhost");
camundaRequest.setHost(host);
@@ -72,8 +72,8 @@ public class CamundaRequestTest {
String json = mapper.writeValueAsString(camundaRequest);
System.out.println(json);
assertEquals(
- "{\"variables\":{\""+CommonConstants.CAMUNDA_SERVICE_INPUT+"\":{\"value\":\"<aetgt:CreateTenantRequest xmlns:aetgt=\\\"http://ecomp.att.com/mso/workflow/schema/v1\\\" xmlns:sdncadapterworkflow=\\\"http://ecomp.att.com/mso/workflow/schema/v1\\\" xmlns:ns5=\\\"http://ecomp.att.com/mso/request/types/v1\\\"> <msoservtypes:request-information xmlns:msoservtypes=\\\"http://ecomp.att.com/mso/request/types/v1\\\"><msoservtypes:request-id>155415ab-b4a7-4382-b4c6-d17d950604</msoservtypes:request-id><msoservtypes:request-action>Layer3ServiceActivateRequest</msoservtypes:request-action><msoservtypes:source>OMX</msoservtypes:source><msoservtypes:notification-url>https://csi-tst-q22.it.att.com:22443/Services/com/cingular/csi/sdn/SendManagedNetworkStatusNotification.jws</msoservtypes:notification-url><msoservtypes:order-number>5051563</msoservtypes:order-number><msoservtypes:order-version>1</msoservtypes:order-version> </msoservtypes:request-information> <msoservtypes:service-information xmlns:msoservtypes=\\\"http://ecomp.att.com/mso/request/types/v1\\\"><msoservtypes:service-type>SDN-ETHERNET-INTERNET</msoservtypes:service-type><msoservtypes:service-instance-id>HI/VLXM/950604//SW_INTERNET</msoservtypes:service-instance-id><msoservtypes:subscriber-name>SubName01</msoservtypes:subscriber-name> </msoservtypes:service-information> <sdncadapterworkflow:cloudId>MTSNJA4LCP1</sdncadapterworkflow:cloudId> </aetgt:CreateTenantRequest>\",\"type\":\"String\"}" +
- ",\"host\":{\"value\":\"localhost\",\"type\":\"String\"},\"att-mso-schema-version\":{\"value\":\"v1\",\"type\":\"String\"},\"att-mso-request-id\":{\"value\":\"reqid123\",\"type\":\"String\"},\"att-mso-service-instance-id\":{\"value\":\"svcid123\",\"type\":\"String\"},\"att-mso-service-request-timeout\":{\"value\":\"\",\"type\":\"String\"}}}",
+ "{\"variables\":{\""+CommonConstants.CAMUNDA_SERVICE_INPUT+"\":{\"value\":\"<aetgt:CreateTenantRequest xmlns:aetgt=\\\"http://org.openecomp/mso/workflow/schema/v1\\\" xmlns:sdncadapterworkflow=\\\"http://org.openecomp/mso/workflow/schema/v1\\\" xmlns:ns5=\\\"http://org.openecomp/mso/request/types/v1\\\"> <msoservtypes:request-information xmlns:msoservtypes=\\\"http://org.openecomp/mso/request/types/v1\\\"><msoservtypes:request-id>155415ab-b4a7-4382-b4c6-d17d950604</msoservtypes:request-id><msoservtypes:request-action>Layer3ServiceActivateRequest</msoservtypes:request-action><msoservtypes:source>OMX</msoservtypes:source><msoservtypes:notification-url>https://localhost:22443/Services/com/cingular/csi/sdn/SendManagedNetworkStatusNotification.jws</msoservtypes:notification-url><msoservtypes:order-number>5051563</msoservtypes:order-number><msoservtypes:order-version>1</msoservtypes:order-version> </msoservtypes:request-information> <msoservtypes:service-information xmlns:msoservtypes=\\\"http://org.openecomp/mso/request/types/v1\\\"><msoservtypes:service-type>SDN-ETHERNET-INTERNET</msoservtypes:service-type><msoservtypes:service-instance-id>HI/VLXM/950604//SW_INTERNET</msoservtypes:service-instance-id><msoservtypes:subscriber-name>SubName01</msoservtypes:subscriber-name> </msoservtypes:service-information> <sdncadapterworkflow:cloudId>MTSNJA4LCP1</sdncadapterworkflow:cloudId> </aetgt:CreateTenantRequest>\",\"type\":\"String\"}" +
+ ",\"host\":{\"value\":\"localhost\",\"type\":\"String\"},\"mso-schema-version\":{\"value\":\"v1\",\"type\":\"String\"},\"mso-request-id\":{\"value\":\"reqid123\",\"type\":\"String\"},\"mso-service-instance-id\":{\"value\":\"svcid123\",\"type\":\"String\"},\"mso-service-request-timeout\":{\"value\":\"\",\"type\":\"String\"}}}",
json);
}
diff --git a/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/ResponseHandlerTest.java b/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/ResponseHandlerTest.java
index ba2c5524b5..6318d43485 100644
--- a/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/ResponseHandlerTest.java
+++ b/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/ResponseHandlerTest.java
@@ -65,8 +65,8 @@ public class ResponseHandlerTest {
@Test
public void tesParseBpelResponse () throws JsonGenerationException, JsonMappingException, IOException {
- String body = "<layer3activate:service-response xmlns:layer3activate=\"http://ecomp.att.com/mso/request/layer3serviceactivate/schema/v1\""
- + "xmlns:reqtype=\"http://ecomp.att.com/mso/request/types/v1\""
+ String body = "<layer3activate:service-response xmlns:layer3activate=\"http://org.openecomp/mso/request/layer3serviceactivate/schema/v1\""
+ + "xmlns:reqtype=\"http://org.openecomp/mso/request/types/v1\""
+ "xmlns:aetgt=\"http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd\""
+ "xmlns:types=\"http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd\">"
+ "<reqtype:request-id>req5</reqtype:request-id>"