diff options
author | 2018-03-14 02:07:32 -0400 | |
---|---|---|
committer | 2018-03-14 04:08:41 -0400 | |
commit | 38f720752af4d4aad8c4e467a288d9048659f688 (patch) | |
tree | e81066a8b5c77272e30fb57a64999573c4db4d86 /mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaClient.java | |
parent | aee3d223f92a6f250f43e17558a2dfd576ff7294 (diff) |
AT&T 1712 and 1802 release code
This is code from AT&T's 1712 and 1802 releases.
Change-Id: Ie1e85851e94bc66c4d9514a0226c221939531a04
Issue-ID: SO-425
Signed-off-by: Rob Daugherty <rd472p@att.com>
Diffstat (limited to 'mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaClient.java')
-rw-r--r-- | mso-api-handlers/mso-api-handler-common/src/main/java/org/openecomp/mso/apihandler/common/CamundaClient.java | 38 |
1 files changed, 24 insertions, 14 deletions
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 9258cabe5b..9cc89530c4 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 @@ -21,18 +21,24 @@ package org.openecomp.mso.apihandler.common; -import org.openecomp.mso.apihandler.camundabeans.*; -import org.openecomp.mso.logger.MessageEnum; -import org.openecomp.mso.logger.MsoLogger; +import java.io.IOException; + +import javax.xml.bind.DatatypeConverter; + import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; +import org.openecomp.mso.apihandler.camundabeans.CamundaBooleanInput; +import org.openecomp.mso.apihandler.camundabeans.CamundaInput; +import org.openecomp.mso.apihandler.camundabeans.CamundaIntegerInput; +import org.openecomp.mso.apihandler.camundabeans.CamundaRequest; +import org.openecomp.mso.apihandler.camundabeans.CamundaVIDRequest; +import org.openecomp.mso.logger.MessageEnum; +import org.openecomp.mso.logger.MsoLogger; -import javax.xml.bind.DatatypeConverter; -import java.io.IOException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; public class CamundaClient extends RequestClient{ private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.APIH); @@ -98,14 +104,14 @@ public class CamundaClient extends RequestClient{ @Override public HttpResponse post(String requestId, boolean isBaseVfModule, int recipeTimeout, String requestAction, String serviceInstanceId, - String vnfId, String vfModuleId, String volumeGroupId, String networkId, + String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId, String serviceType, String vnfType, String vfModuleType, String networkType, 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, + serviceInstanceId, vnfId, vfModuleId, volumeGroupId, networkId, configurationId, serviceType, vnfType, vfModuleType, networkType, requestDetails, recipeParamXsd); StringEntity input = new StringEntity(jsonReq); @@ -167,7 +173,7 @@ public class CamundaClient extends RequestClient{ camundaRequest.setSchema(schema); camundaRequest.setTimeout(timeout); ObjectMapper mapper = new ObjectMapper(); - mapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true); + mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true); jsonReq = mapper.writeValueAsString(camundaRequest); msoLogger.debug("request body is " + jsonReq); @@ -179,7 +185,7 @@ public class CamundaClient extends RequestClient{ private String wrapVIDRequest(String requestId, boolean isBaseVfModule, int recipeTimeout, String requestAction, String serviceInstanceId, - String vnfId, String vfModuleId, String volumeGroupId, String networkId, + String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId, String serviceType, String vnfType, String vfModuleType, String networkType, String requestDetails, String recipeParams){ String jsonReq = null; @@ -204,6 +210,9 @@ public class CamundaClient extends RequestClient{ if(networkId == null){ networkId =""; } + if(configurationId == null){ + configurationId =""; + } if(serviceType == null){ serviceType =""; } @@ -220,8 +229,6 @@ public class CamundaClient extends RequestClient{ requestDetails =""; } - - try{ CamundaVIDRequest camundaRequest = new CamundaVIDRequest(); CamundaInput serviceInput = new CamundaInput(); @@ -235,6 +242,7 @@ public class CamundaClient extends RequestClient{ CamundaInput vfModuleIdInput = new CamundaInput(); CamundaInput volumeGroupIdInput = new CamundaInput(); CamundaInput networkIdInput = new CamundaInput(); + CamundaInput configurationIdInput = new CamundaInput(); CamundaInput serviceTypeInput = new CamundaInput(); CamundaInput vnfTypeInput = new CamundaInput(); CamundaInput vfModuleTypeInput = new CamundaInput(); @@ -250,6 +258,7 @@ public class CamundaClient extends RequestClient{ vfModuleIdInput.setValue(vfModuleId); volumeGroupIdInput.setValue(volumeGroupId); networkIdInput.setValue(networkId); + configurationIdInput.setValue(configurationId); serviceTypeInput.setValue(serviceType); vnfTypeInput.setValue(vnfType); vfModuleTypeInput.setValue(vfModuleType); @@ -268,13 +277,14 @@ public class CamundaClient extends RequestClient{ camundaRequest.setVfModuleId(vfModuleIdInput); camundaRequest.setVolumeGroupId(volumeGroupIdInput); camundaRequest.setNetworkId(networkIdInput); + camundaRequest.setConfigurationId(configurationIdInput); camundaRequest.setServiceType(serviceTypeInput); camundaRequest.setVnfType(vnfTypeInput); camundaRequest.setVfModuleType(vfModuleTypeInput); camundaRequest.setNetworkType(networkTypeInput); camundaRequest.setRecipeParams(recipeParamsInput); ObjectMapper mapper = new ObjectMapper(); - mapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true); + mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true); jsonReq = mapper.writeValueAsString(camundaRequest); msoLogger.debug("request body is " + jsonReq); |