summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorc00149107 <chenchuanyu@huawei.com>2018-02-27 09:43:05 +0800
committerc00149107 <chenchuanyu@huawei.com>2018-02-27 15:25:22 +0800
commit1e3e3c58976c321049068033d909c64a8547c952 (patch)
tree415fa730f657d644e85ec5b60a224efa3611ff2c
parent250de788c5cf40cc8a73c7aad4dc2f482f821768 (diff)
Add recipe params for bpmn call
Add recipe params for bpmn call, to improve recipe enhancement. Change-Id: If9f2bff3f27ced62e814afcb918c863a527363e6 Issue-ID: SO-449 Signed-off-by: c00149107 <chenchuanyu@huawei.com>
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/camundabeans/CamundaVIDRequest.java14
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/BPELRestClient.java2
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaClient.java12
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaTaskClient.java2
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CommonConstants.java1
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/RequestClient.java2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java6
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/RecipeLookupResult.java26
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java8
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/ServiceInstanceTest.java8
11 files changed, 61 insertions, 22 deletions
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 fd1227ec13..a53ef22743 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
@@ -91,6 +91,9 @@ public class CamundaVIDRequest {
@JsonProperty(CommonConstants.NETWORK_TYPE_VARIABLE)
private CamundaInput networkType;
+ @JsonProperty(CommonConstants.RECIPE_PARAMS)
+ private CamundaInput recipeParams;
+
@JsonProperty(CommonConstants.CAMUNDA_SERVICE_INPUT)
public CamundaInput getServiceInput() {
return serviceInput;
@@ -250,8 +253,17 @@ public class CamundaVIDRequest {
this.networkType = networkType;
}
+ @JsonProperty(CommonConstants.RECIPE_PARAMS)
+ public CamundaInput getRecipeParams() {
+ return recipeParams;
+ }
- @Override
+ @JsonProperty(CommonConstants.RECIPE_PARAMS)
+ public void setRecipeParams(CamundaInput recipeParams) {
+ this.recipeParams = recipeParams;
+ }
+
+ @Override
public String toString() {
//return "CamundaRequest [requestId=" + + ", host="
// + host + ", schema=" + schema + ", reqid=" + reqid + ", svcid="
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/BPELRestClient.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/BPELRestClient.java
index ddeb359071..cc68a45d19 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/BPELRestClient.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/BPELRestClient.java
@@ -89,7 +89,7 @@ public class BPELRestClient extends RequestClient {
int recipeTimeout, String requestAction, String serviceInstanceId,
String vnfId, String vfModuleId, String volumeGroupId, String networkId,
String serviceType, String vnfType, String vfModuleType, String networkType,
- String requestDetails) {
+ String requestDetails, String recipeParamXsd) {
return null;
}
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 b9c0725766..371d3162de 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
@@ -98,13 +98,13 @@ public class CamundaClient extends RequestClient{
int recipeTimeout, String requestAction, String serviceInstanceId,
String vnfId, String vfModuleId, String volumeGroupId, String networkId,
String serviceType, String vnfType, String vfModuleType, String networkType,
- String requestDetails)
+ String requestDetails, String recipeParamXsd)
throws ClientProtocolException, IOException{
HttpPost post = new HttpPost(url);
msoLogger.debug(CAMUNDA_URL_MESAGE + url);
String jsonReq = wrapVIDRequest(requestId, isBaseVfModule, recipeTimeout, requestAction,
serviceInstanceId, vnfId, vfModuleId, volumeGroupId, networkId,
- serviceType, vnfType, vfModuleType, networkType, requestDetails);
+ serviceType, vnfType, vfModuleType, networkType, requestDetails, recipeParamXsd);
StringEntity input = new StringEntity(jsonReq);
input.setContentType(CommonConstants.CONTENT_TYPE_JSON);
@@ -178,7 +178,7 @@ public class CamundaClient extends RequestClient{
int recipeTimeout, String requestAction, String serviceInstanceId,
String vnfId, String vfModuleId, String volumeGroupId, String networkId,
String serviceType, String vnfType, String vfModuleType, String networkType,
- String requestDetails){
+ String requestDetails, String recipeParams){
String jsonReq = null;
if(requestId == null){
requestId ="";
@@ -236,7 +236,7 @@ public class CamundaClient extends RequestClient{
CamundaInput vnfTypeInput = new CamundaInput();
CamundaInput vfModuleTypeInput = new CamundaInput();
CamundaInput networkTypeInput = new CamundaInput();
-
+ CamundaInput recipeParamsInput = new CamundaInput();
host.setValue(parseURL());
requestIdInput.setValue(requestId);
isBaseVfModuleInput.setValue(isBaseVfModule);
@@ -251,7 +251,7 @@ public class CamundaClient extends RequestClient{
vnfTypeInput.setValue(vnfType);
vfModuleTypeInput.setValue(vfModuleType);
networkTypeInput.setValue(networkType);
-
+ recipeParamsInput.setValue(recipeParams);
serviceInput.setValue(requestDetails);
camundaRequest.setServiceInput(serviceInput);
camundaRequest.setHost(host);
@@ -269,7 +269,7 @@ public class CamundaClient extends RequestClient{
camundaRequest.setVnfType(vnfTypeInput);
camundaRequest.setVfModuleType(vfModuleTypeInput);
camundaRequest.setNetworkType(networkTypeInput);
-
+ camundaRequest.setRecipeParams(recipeParamsInput);
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true);
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaTaskClient.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaTaskClient.java
index 64193cf6c4..364169d4c1 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaTaskClient.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaTaskClient.java
@@ -74,7 +74,7 @@ public class CamundaTaskClient extends RequestClient{
int recipeTimeout, String requestAction, String serviceInstanceId,
String vnfId, String vfModuleId, String volumeGroupId, String networkId,
String serviceType, String vnfType, String vfModuleType, String networkType,
- String requestDetails)
+ String requestDetails, String recipeParamXsd)
throws ClientProtocolException, IOException{
msoLogger.debug("Method not supported");
return null;
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 91bd226c30..cfbe892e68 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
@@ -63,6 +63,7 @@ public final class CommonConstants {
public static final String VF_MODULE_TYPE_VARIABLE = "vfModuleType";
public static final String NETWORK_TYPE_VARIABLE = "networkType";
public static final String REQUEST_DETAILS_VARIABLE = "requestDetails";
+ public static final String RECIPE_PARAMS = "recipeParams";
private CommonConstants () {
// prevent creating an instance of this class
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/RequestClient.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/RequestClient.java
index addf4e11a5..eaf8be76a3 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/RequestClient.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/RequestClient.java
@@ -74,7 +74,7 @@ public abstract class RequestClient {
int recipeTimeout, String requestAction, String serviceInstanceId,
String vnfId, String vfModuleId, String volumeGroupId, String networkId,
String serviceType, String vnfType, String vfModuleType, String networkType,
- String requestDetails)
+ String requestDetails, String recipeParamXsd)
throws ClientProtocolException, IOException;
public abstract HttpResponse get()
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
index 403e9407a6..0914516598 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
@@ -314,7 +314,7 @@ public class E2EServiceInstances {
response = requestClient.post(requestId, false,
recipeLookupResult.getRecipeTimeout(), action.name(),
serviceId, null, null, null, null, serviceInstanceType,
- null, null, null, bpmnRequest);
+ null, null, null, bpmnRequest, recipeLookupResult.getRecipeParamXsd());
msoLogger.recordMetricEvent(subStartTime,
MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
@@ -542,7 +542,7 @@ public class E2EServiceInstances {
msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
response = requestClient.post(requestId, false, recipeLookupResult.getRecipeTimeout(), action.name(),
- serviceId, null, null, null, null, serviceInstanceType, null, null, null, sirRequestJson);
+ serviceId, null, null, null, null, serviceInstanceType, null, null, null, sirRequestJson, recipeLookupResult.getRecipeParamXsd());
msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
"Successfully received response from BPMN engine", "BPMN", recipeLookupResult.getOrchestrationURI(),
@@ -723,7 +723,7 @@ public class E2EServiceInstances {
return null;
}
return new RecipeLookupResult(recipe.getOrchestrationUri(),
- recipe.getRecipeTimeout());
+ recipe.getRecipeTimeout(), recipe.getServiceParamXSD());
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/RecipeLookupResult.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/RecipeLookupResult.java
index ac4c01175a..2a02344ab3 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/RecipeLookupResult.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/RecipeLookupResult.java
@@ -25,12 +25,20 @@ public class RecipeLookupResult {
private String orchestrationURI;
private int recipeTimeout;
+ // the service recipe param.
+ private String recipeParamXsd;
public RecipeLookupResult(String orchestrationURI, int recipeTimeout) {
this.orchestrationURI = orchestrationURI;
this.recipeTimeout = recipeTimeout;
}
+ public RecipeLookupResult(String orchestrationURI, int recipeTimeout, String recipeParamXsd) {
+ this.orchestrationURI = orchestrationURI;
+ this.recipeTimeout = recipeTimeout;
+ this.recipeParamXsd = recipeParamXsd;
+ }
+
public String getOrchestrationURI () {
return orchestrationURI;
}
@@ -46,5 +54,23 @@ public class RecipeLookupResult {
public void setRecipeTimeout (int recipeTimeout) {
this.recipeTimeout = recipeTimeout;
}
+
+
+ /**
+ * @return Returns the recipeParamXsd.
+ */
+ public String getRecipeParamXsd() {
+ return recipeParamXsd;
+ }
+
+
+ /**
+ * @param recipeParamXsd The recipeParamXsd to set.
+ */
+ public void setRecipeParamXsd(String recipeParamXsd) {
+ this.recipeParamXsd = recipeParamXsd;
+ }
+
+
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java
index 6f6d2972d1..287b0ad812 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java
@@ -633,7 +633,7 @@ public class ServiceInstances {
serviceInstanceId, vnfId, vfModuleId, volumeGroupId, networkId,
msoRequest.getServiceInstanceType (),
msoRequest.getVnfType (), msoRequest.getVfModuleType (),
- msoRequest.getNetworkType (), msoRequest.getRequestJSON());
+ msoRequest.getNetworkType (), msoRequest.getRequestJSON(), null);
msoLogger.recordMetricEvent (subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully received response from BPMN engine", "BPMN", recipeLookupResult.getOrchestrationURI (), null);
} catch (Exception e) {
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java
index 238b6b677c..21c59ac6d5 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java
@@ -110,7 +110,7 @@ public class E2EServiceInstancesTest {
String serviceInstanceId, String vnfId, String vfModuleId,
String volumeGroupId, String networkId, String serviceType,
String vnfType, String vfModuleType, String networkType,
- String requestDetails) {
+ String requestDetails, String recipeParamXsd) {
ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);
HttpResponse resp = new BasicHttpResponse(pv, 202,
"test response");
@@ -181,7 +181,7 @@ public class E2EServiceInstancesTest {
String serviceInstanceId, String vnfId, String vfModuleId,
String volumeGroupId, String networkId, String serviceType,
String vnfType, String vfModuleType, String networkType,
- String requestDetails) {
+ String requestDetails, String recipeParamXsd) {
ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);
HttpResponse resp = new BasicHttpResponse(pv, 500,
"test response");
@@ -252,7 +252,7 @@ public class E2EServiceInstancesTest {
String serviceInstanceId, String vnfId, String vfModuleId,
String volumeGroupId, String networkId, String serviceType,
String vnfType, String vfModuleType, String networkType,
- String requestDetails) {
+ String requestDetails, String recipeParamXsd) {
ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);
HttpResponse resp = new BasicHttpResponse(pv, 500,
"test response");
@@ -323,7 +323,7 @@ public class E2EServiceInstancesTest {
String serviceInstanceId, String vnfId, String vfModuleId,
String volumeGroupId, String networkId, String serviceType,
String vnfType, String vfModuleType, String networkType,
- String requestDetails) {
+ String requestDetails, String recipeParamXsd) {
HttpResponse resp = null;
return resp;
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/ServiceInstanceTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/ServiceInstanceTest.java
index 08abf5702f..27d395857b 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/ServiceInstanceTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/ServiceInstanceTest.java
@@ -216,7 +216,7 @@ public class ServiceInstanceTest {
int recipeTimeout, String requestAction, String serviceInstanceId,
String vnfId, String vfModuleId, String volumeGroupId, String networkId,
String serviceType, String vnfType, String vfModuleType, String networkType,
- String requestDetails){
+ String requestDetails, String recipeParamXsd){
ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);
HttpResponse resp = new BasicHttpResponse(pv,200, "test response");
BasicHttpEntity entity = new BasicHttpEntity();
@@ -286,7 +286,7 @@ public class ServiceInstanceTest {
int recipeTimeout, String requestAction, String serviceInstanceId,
String vnfId, String vfModuleId, String volumeGroupId, String networkId,
String serviceType, String vnfType, String vfModuleType, String networkType,
- String requestDetails){
+ String requestDetails, String recipeParamXsd){
ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);
HttpResponse resp = new BasicHttpResponse(pv,500, "test response");
BasicHttpEntity entity = new BasicHttpEntity();
@@ -357,7 +357,7 @@ public class ServiceInstanceTest {
int recipeTimeout, String requestAction, String serviceInstanceId,
String vnfId, String vfModuleId, String volumeGroupId, String networkId,
String serviceType, String vnfType, String vfModuleType, String networkType,
- String requestDetails){
+ String requestDetails, String recipeParamXsd){
ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);
HttpResponse resp = new BasicHttpResponse(pv,500, "test response");
BasicHttpEntity entity = new BasicHttpEntity();
@@ -428,7 +428,7 @@ public class ServiceInstanceTest {
int recipeTimeout, String requestAction, String serviceInstanceId,
String vnfId, String vfModuleId, String volumeGroupId, String networkId,
String serviceType, String vnfType, String vfModuleType, String networkType,
- String requestDetails){
+ String requestDetails, String recipeParamXsd){
return null;
}
};