Add recipe params for bpmn call, to improve recipe enhancement.
Change-Id: If9f2bff3f27ced62e814afcb918c863a527363e6
Issue-ID: SO-449
Signed-off-by: c00149107 <chenchuanyu@huawei.com>
@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;
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="
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;
}
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);
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 ="";
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);
vnfTypeInput.setValue(vnfType);
vfModuleTypeInput.setValue(vfModuleType);
networkTypeInput.setValue(networkType);
-
+ recipeParamsInput.setValue(recipeParams);
serviceInput.setValue(requestDetails);
camundaRequest.setServiceInput(serviceInput);
camundaRequest.setHost(host);
camundaRequest.setVnfType(vnfTypeInput);
camundaRequest.setVfModuleType(vfModuleTypeInput);
camundaRequest.setNetworkType(networkTypeInput);
-
+ camundaRequest.setRecipeParams(recipeParamsInput);
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true);
int recipeTimeout, String requestAction, String serviceInstanceId,\r
String vnfId, String vfModuleId, String volumeGroupId, String networkId,\r
String serviceType, String vnfType, String vfModuleType, String networkType,\r
- String requestDetails)\r
+ String requestDetails, String recipeParamXsd)\r
throws ClientProtocolException, IOException{\r
msoLogger.debug("Method not supported");\r
return null;\r
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
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()
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,
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(),
return null;
}
return new RecipeLookupResult(recipe.getOrchestrationUri(),
- recipe.getRecipeTimeout());
+ recipe.getRecipeTimeout(), recipe.getServiceParamXSD());
}
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;
}
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;
+ }
+
+
}
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) {
String serviceInstanceId, String vnfId, String vfModuleId,\r
String volumeGroupId, String networkId, String serviceType,\r
String vnfType, String vfModuleType, String networkType,\r
- String requestDetails) {\r
+ String requestDetails, String recipeParamXsd) {\r
ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);\r
HttpResponse resp = new BasicHttpResponse(pv, 202,\r
"test response");\r
String serviceInstanceId, String vnfId, String vfModuleId,\r
String volumeGroupId, String networkId, String serviceType,\r
String vnfType, String vfModuleType, String networkType,\r
- String requestDetails) {\r
+ String requestDetails, String recipeParamXsd) {\r
ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);\r
HttpResponse resp = new BasicHttpResponse(pv, 500,\r
"test response");\r
String serviceInstanceId, String vnfId, String vfModuleId,\r
String volumeGroupId, String networkId, String serviceType,\r
String vnfType, String vfModuleType, String networkType,\r
- String requestDetails) {\r
+ String requestDetails, String recipeParamXsd) {\r
ProtocolVersion pv = new ProtocolVersion("HTTP", 1, 1);\r
HttpResponse resp = new BasicHttpResponse(pv, 500,\r
"test response");\r
String serviceInstanceId, String vnfId, String vfModuleId,\r
String volumeGroupId, String networkId, String serviceType,\r
String vnfType, String vfModuleType, String networkType,\r
- String requestDetails) {\r
+ String requestDetails, String recipeParamXsd) {\r
HttpResponse resp = null;\r
return resp;\r
}\r
int recipeTimeout, String requestAction, String serviceInstanceId,\r
String vnfId, String vfModuleId, String volumeGroupId, String networkId,\r
String serviceType, String vnfType, String vfModuleType, String networkType,\r
- String requestDetails){ \r
+ String requestDetails, String recipeParamXsd){ \r
ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
HttpResponse resp = new BasicHttpResponse(pv,200, "test response");\r
BasicHttpEntity entity = new BasicHttpEntity();\r
int recipeTimeout, String requestAction, String serviceInstanceId,\r
String vnfId, String vfModuleId, String volumeGroupId, String networkId,\r
String serviceType, String vnfType, String vfModuleType, String networkType,\r
- String requestDetails){ \r
+ String requestDetails, String recipeParamXsd){ \r
ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
HttpResponse resp = new BasicHttpResponse(pv,500, "test response");\r
BasicHttpEntity entity = new BasicHttpEntity();\r
int recipeTimeout, String requestAction, String serviceInstanceId,\r
String vnfId, String vfModuleId, String volumeGroupId, String networkId,\r
String serviceType, String vnfType, String vfModuleType, String networkType,\r
- String requestDetails){ \r
+ String requestDetails, String recipeParamXsd){ \r
ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
HttpResponse resp = new BasicHttpResponse(pv,500, "test response");\r
BasicHttpEntity entity = new BasicHttpEntity();\r
int recipeTimeout, String requestAction, String serviceInstanceId,\r
String vnfId, String vfModuleId, String volumeGroupId, String networkId,\r
String serviceType, String vnfType, String vfModuleType, String networkType,\r
- String requestDetails){ \r
+ String requestDetails, String recipeParamXsd){ \r
return null;\r
}\r
};\r