diff options
Diffstat (limited to 'mso-api-handlers')
25 files changed, 110 insertions, 70 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..3ef6d4974c 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 @@ -38,7 +38,7 @@ import org.openecomp.mso.apihandler.common.CommonConstants; CommonConstants.VOLUME_GROUP_ID_VARIABLE, CommonConstants.NETWORK_ID_VARIABLE, CommonConstants.SERVICE_TYPE_VARIABLE, CommonConstants.VNF_TYPE_VARIABLE, CommonConstants.VF_MODULE_TYPE_VARIABLE, CommonConstants.NETWORK_TYPE_VARIABLE, - CommonConstants.CAMUNDA_SERVICE_INPUT}) + CommonConstants.CAMUNDA_SERVICE_INPUT, CommonConstants.RECIPE_PARAMS}) @JsonRootName(CommonConstants.CAMUNDA_ROOT_INPUT) public class CamundaVIDRequest { @@ -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/MsoRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java index 7d45c4b0a2..79ac76ff04 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java @@ -738,7 +738,7 @@ public class MsoRequest { if ((status == Status.FAILED) || (status == Status.COMPLETE)) { aq.setStatusMessage (this.errorMessage); aq.setResponseBody (this.responseBody); - aq.setProgress(new Long(100)); + aq.setProgress(100L); Timestamp endTimeStamp = new Timestamp (System.currentTimeMillis()); aq.setEndTime (endTimeStamp); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NetworkInfoHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NetworkInfoHandler.java index bcea8fd8d5..4e1468c4e9 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NetworkInfoHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NetworkInfoHandler.java @@ -295,8 +295,8 @@ public class NetworkInfoHandler { private String translateNetworkRequests (List <NetworkRequest> queryResponseList) { NetworkRequests queryResponses = new NetworkRequests (); - for (int i = 0; i < queryResponseList.size (); i++) { - queryResponses.getNetworkRequest ().add (queryResponseList.get (i)); + for (NetworkRequest aQueryResponseList : queryResponseList) { + queryResponses.getNetworkRequest().add(aQueryResponseList); } StringWriter stringWriter = new StringWriter (); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NetworkRequestHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NetworkRequestHandler.java index 981fee9fb6..79247deca8 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NetworkRequestHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NetworkRequestHandler.java @@ -323,8 +323,8 @@ public class NetworkRequestHandler { private String translateNetworkRequests (List <NetworkRequest> queryResponseList) { NetworkRequests queryResponses = new NetworkRequests (); - for (int i = 0; i < queryResponseList.size (); i++) { - queryResponses.getNetworkRequest ().add (queryResponseList.get (i)); + for (NetworkRequest aQueryResponseList : queryResponseList) { + queryResponses.getNetworkRequest().add(aQueryResponseList); } StringWriter stringWriter = new StringWriter (); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NetworkTypesHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NetworkTypesHandler.java index b01c6d6e2a..43f2d2afbb 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NetworkTypesHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/NetworkTypesHandler.java @@ -78,13 +78,13 @@ public class NetworkTypesHandler { ObjectFactory beansObjectFactory = new ObjectFactory (); NetworkTypes networkTypes = beansObjectFactory.createNetworkTypes (); - for (int i = 0; i < networkResources.size (); i++) { - NetworkType networkType = beansObjectFactory.createNetworkType (); - NetworkResource vr = networkResources.get (i); - networkType.setType (vr.getModelName()); - networkType.setDescription (vr.getDescription ()); - networkType.setId (String.valueOf (vr.getModelUUID())); - networkTypes.getNetworkType ().add (networkType); + for (NetworkResource networkResource : networkResources) { + NetworkType networkType = beansObjectFactory.createNetworkType(); + NetworkResource vr = networkResource; + networkType.setType(vr.getModelName()); + networkType.setDescription(vr.getDescription()); + networkType.setId(String.valueOf(vr.getModelUUID())); + networkTypes.getNetworkType().add(networkType); } StringWriter stringWriter = new StringWriter (); 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/main/java/org/openecomp/mso/apihandlerinfra/VfModuleModelNamesHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VfModuleModelNamesHandler.java index 57720dcfba..df51a8f96a 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VfModuleModelNamesHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VfModuleModelNamesHandler.java @@ -74,17 +74,17 @@ public class VfModuleModelNamesHandler { ObjectFactory beansObjectFactory = new ObjectFactory (); VfModuleModelNames vfModuleModelNames = beansObjectFactory.createVfModuleModelNames (); - for (int i = 0; i < vfModules.size (); i++) { - VfModuleModelName vfModuleModelName = beansObjectFactory.createVfModuleModelName (); - VfModule vm = vfModules.get (i); - vfModuleModelName.setModelName (vm.getModelName ()); - vfModuleModelName.setModelVersion (vm.getVersion ()); - vfModuleModelName.setModelInvariantUuid (vm.getModelInvariantUuid ()); + for (VfModule vfModule : vfModules) { + VfModuleModelName vfModuleModelName = beansObjectFactory.createVfModuleModelName(); + VfModule vm = vfModule; + vfModuleModelName.setModelName(vm.getModelName()); + vfModuleModelName.setModelVersion(vm.getVersion()); + vfModuleModelName.setModelInvariantUuid(vm.getModelInvariantUuid()); vfModuleModelName.setIsBase(vm.isBase()); - vfModuleModelName.setDescription (vm.getDescription ()); - vfModuleModelName.setId (String.valueOf (vm.getModelUUID())); - vfModuleModelName.setAsdcServiceModelVersion(vm.getVersion ()); - vfModuleModelNames.getVfModuleModelName ().add (vfModuleModelName); + vfModuleModelName.setDescription(vm.getDescription()); + vfModuleModelName.setId(String.valueOf(vm.getModelUUID())); + vfModuleModelName.setAsdcServiceModelVersion(vm.getVersion()); + vfModuleModelNames.getVfModuleModelName().add(vfModuleModelName); } StringWriter stringWriter = new StringWriter (); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfInfoHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfInfoHandler.java index 7071ed50c3..a5e1f6f4e2 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfInfoHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfInfoHandler.java @@ -332,8 +332,8 @@ public class VnfInfoHandler { private String translateVnfRequests (List <VnfRequest> queryResponseList) { VnfRequests queryResponses = new VnfRequests (); - for (int i = 0; i < queryResponseList.size (); i++) { - queryResponses.getVnfRequest ().add (queryResponseList.get (i)); + for (VnfRequest aQueryResponseList : queryResponseList) { + queryResponses.getVnfRequest().add(aQueryResponseList); } StringWriter stringWriter = new StringWriter (); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandler.java index a55c13baed..7a61c641ae 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandler.java @@ -363,8 +363,8 @@ public class VnfRequestHandler { private String translateVnfRequests (List <VnfRequest> queryResponseList) { VnfRequests queryResponses = new VnfRequests (); - for (int i = 0; i < queryResponseList.size (); i++) { - queryResponses.getVnfRequest ().add (queryResponseList.get (i)); + for (VnfRequest aQueryResponseList : queryResponseList) { + queryResponses.getVnfRequest().add(aQueryResponseList); } StringWriter stringWriter = new StringWriter (); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandler.java index 44cf038ef8..3d87d131b3 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandler.java @@ -85,12 +85,12 @@ public class VnfTypesHandler { ObjectFactory beansObjectFactory = new ObjectFactory (); VnfTypes vnfTypes = beansObjectFactory.createVnfTypes (); - for (int i = 0; i < vnfResources.size (); i++) { - VnfType vnfType = beansObjectFactory.createVnfType (); - VnfResource vr = vnfResources.get (i); - vnfType.setDescription (vr.getDescription ()); - vnfType.setId (String.valueOf (vr.getModelUuid())); - vnfTypes.getVnfType ().add (vnfType); + for (VnfResource vnfResource : vnfResources) { + VnfType vnfType = beansObjectFactory.createVnfType(); + VnfResource vr = vnfResource; + vnfType.setDescription(vr.getDescription()); + vnfType.setId(String.valueOf(vr.getModelUuid())); + vnfTypes.getVnfType().add(vnfType); } StringWriter stringWriter = new StringWriter (); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VolumeInfoHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VolumeInfoHandler.java index 6618fcfb00..3de945a275 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VolumeInfoHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VolumeInfoHandler.java @@ -314,8 +314,8 @@ public class VolumeInfoHandler { private String translateVolumeRequests (List <VolumeRequest> queryResponseList) { VolumeRequests queryResponses = new VolumeRequests (); - for (int i = 0; i < queryResponseList.size (); i++) { - queryResponses.getVolumeRequest ().add (queryResponseList.get (i)); + for (VolumeRequest aQueryResponseList : queryResponseList) { + queryResponses.getVolumeRequest().add(aQueryResponseList); } StringWriter stringWriter = new StringWriter (); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandler.java index 2c1f506943..3fa4a7a9e8 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandler.java @@ -346,8 +346,8 @@ public class VolumeRequestHandler { private String translateVolumeRequests (List <VolumeRequest> queryResponseList) { VolumeRequests queryResponses = new VolumeRequests (); - for (int i = 0; i < queryResponseList.size (); i++) { - queryResponses.getVolumeRequest ().add (queryResponseList.get (i)); + for (VolumeRequest aQueryResponseList : queryResponseList) { + queryResponses.getVolumeRequest().add(aQueryResponseList); } StringWriter stringWriter = new StringWriter (); 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/NetworkRequestHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/NetworkRequestHandlerTest.java index 3c5c89fc92..89d4d0c98f 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/NetworkRequestHandlerTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/NetworkRequestHandlerTest.java @@ -184,7 +184,7 @@ UriInfo uriInfo = null; req.setAaiServiceId("299392"); req.setAction("CREATE"); req.setRequestStatus("COMPLETE"); - req.setProgress(10001l); + req.setProgress(10001L); req.setSource("test"); req.setStartTime(new Timestamp(10020100)); req.setEndTime(new Timestamp(20020100)); @@ -206,7 +206,7 @@ UriInfo uriInfo = null; req.setAaiServiceId("299392"); req.setAction("CREATE"); req.setRequestStatus("COMPLETE"); - req.setProgress(10001l); + req.setProgress(10001L); req.setSource("test"); req.setStartTime(new Timestamp(10020100)); req.setEndTime(new Timestamp(20020100)); 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;
}
};
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandlerTest.java index 2d3a2a47a5..205bb8d910 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandlerTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandlerTest.java @@ -182,7 +182,7 @@ public class VnfRequestHandlerTest { req.setAaiServiceId("299392"); req.setAction("CREATE"); req.setRequestStatus("COMPLETE"); - req.setProgress(10001l); + req.setProgress(10001L); req.setSource("test"); req.setStartTime(new Timestamp(10020100)); req.setEndTime(new Timestamp(20020100)); @@ -207,7 +207,7 @@ public class VnfRequestHandlerTest { req.setAaiServiceId("299392"); req.setAction("CREATE"); req.setRequestStatus("COMPLETE"); - req.setProgress(10001l); + req.setProgress(10001L); req.setSource("test"); req.setStartTime(new Timestamp(10020100)); req.setEndTime(new Timestamp(20020100)); @@ -229,7 +229,7 @@ public class VnfRequestHandlerTest { req.setAaiServiceId("299392"); req.setAction("CREATE"); req.setRequestStatus("COMPLETE"); - req.setProgress(10001l); + req.setProgress(10001L); req.setSource("test"); req.setStartTime(new Timestamp(10020100)); req.setEndTime(new Timestamp(20020100)); diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandlerTest.java index bf4d7c4d98..fa6b06b4b2 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandlerTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandlerTest.java @@ -156,7 +156,7 @@ public class VolumeRequestHandlerTest { req.setAaiServiceId("299392"); req.setAction("CREATE"); req.setRequestStatus("COMPLETE"); - req.setProgress(10001l); + req.setProgress(10001L); req.setSource("test"); req.setStartTime(new Timestamp(10020100)); req.setEndTime(new Timestamp(20020100)); @@ -177,7 +177,7 @@ public class VolumeRequestHandlerTest { req.setAaiServiceId("299392"); req.setAction("CREATE"); req.setRequestStatus("COMPLETE"); - req.setProgress(10001l); + req.setProgress(10001L); req.setSource("test"); req.setStartTime(new Timestamp(10020100)); req.setEndTime(new Timestamp(20020100)); @@ -197,7 +197,7 @@ public class VolumeRequestHandlerTest { req.setAaiServiceId("299392"); req.setAction("CREATE"); req.setRequestStatus("COMPLETE"); - req.setProgress(10001l); + req.setProgress(10001L); req.setSource("test"); req.setStartTime(new Timestamp(10020100)); req.setEndTime(new Timestamp(20020100)); diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java index 98121d8490..d9448d06fa 100644 --- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java @@ -38,6 +38,7 @@ import org.hibernate.criterion.Criterion; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; import org.openecomp.mso.db.AbstractSessionFactoryManager; +import org.openecomp.mso.requestsdb.RequestsDbConstant.Status; import org.openecomp.mso.requestsdb.RequestsDbSessionFactoryManager; import org.openecomp.mso.logger.MsoLogger; @@ -757,9 +758,9 @@ public class RequestsDatabase { int resourceCount = lstResourceStatus.size(); int progress = 0; boolean isFinished = true; - for(int i = 0; i < resourceCount; i++) { - progress = progress + Integer.valueOf(lstResourceStatus.get(i).getProgress()) / resourceCount; - if(RequestsDbConstant.Status.PROCESSING.equals(lstResourceStatus.get(i).getStatus())) { + for (ResourceOperationStatus lstResourceStatu : lstResourceStatus) { + progress = progress + Integer.valueOf(lstResourceStatu.getProgress()) / resourceCount; + if (Status.PROCESSING.equals(lstResourceStatu.getStatus())) { isFinished = false; } } |