From 48360933b7e20f3ee9d6fe81501f001faaaad442 Mon Sep 17 00:00:00 2001 From: MariosIakovidis Date: Wed, 5 Sep 2018 15:39:22 +0100 Subject: EXTAPI-125 Percent Progress Change-Id: I57c9ee5f814a72aa50e716948f4e356de683b6e4 Issue-ID: EXTAPI-125 Signed-off-by: MariosIakovidis --- .../apis/serviceorder/model/ServiceOrderItem.java | 23 +++++++++++++++++++++- .../serviceorder/workflow/SOGetStatusManager.java | 2 ++ src/test/resources/mappings/so_get_e2e.json | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/model/ServiceOrderItem.java b/src/main/java/org/onap/nbi/apis/serviceorder/model/ServiceOrderItem.java index 812e42b..c68af37 100755 --- a/src/main/java/org/onap/nbi/apis/serviceorder/model/ServiceOrderItem.java +++ b/src/main/java/org/onap/nbi/apis/serviceorder/model/ServiceOrderItem.java @@ -62,6 +62,9 @@ public class ServiceOrderItem { @JsonProperty("state") private StateType state = null; + @JsonProperty("percentProgress") + private String percentProgress = null; + @JsonProperty("@type") private String type = null; @@ -152,6 +155,22 @@ public class ServiceOrderItem { return this; } + /** + * Progress of the delivery in percentage + * + * @return percentProgress + **/ + @JsonProperty("percentProgress") + @ApiModelProperty(required = false, value = "Progress of the delivery in percentage") + @NotNull + public String getPercentProgress() { + return percentProgress; + } + + public void setPercentProgress(String percentProgress) { + this.percentProgress = percentProgress; + } + /** * * @return type @@ -313,6 +332,7 @@ public class ServiceOrderItem { ServiceOrderItem serviceOrderItem = (ServiceOrderItem) o; return Objects.equals(this.id, serviceOrderItem.id) && Objects.equals(this.action, serviceOrderItem.action) && Objects.equals(this.state, serviceOrderItem.state) + && Objects.equals(this.percentProgress, serviceOrderItem.percentProgress) && Objects.equals(this.type, serviceOrderItem.type) && Objects.equals(this.schemaLocation, serviceOrderItem.schemaLocation) && Objects.equals(this.baseType, serviceOrderItem.baseType) @@ -325,7 +345,7 @@ public class ServiceOrderItem { @Override public int hashCode() { - return Objects.hash(id, action, state, type, schemaLocation, baseType, orderItemRelationship, service, + return Objects.hash(id, action, state, percentProgress, type, schemaLocation, baseType, orderItemRelationship, service, requestId,orderItemMessage); } @@ -337,6 +357,7 @@ public class ServiceOrderItem { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" action: ").append(toIndentedString(action)).append("\n"); sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" percentProgress: ").append(toIndentedString(percentProgress)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n"); sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n"); diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/workflow/SOGetStatusManager.java b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/SOGetStatusManager.java index f553faf..da3029d 100644 --- a/src/main/java/org/onap/nbi/apis/serviceorder/workflow/SOGetStatusManager.java +++ b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/SOGetStatusManager.java @@ -62,6 +62,7 @@ public class SOGetStatusManager { while (!stopPolling) { response = soClient.callGetRequestStatus(requestId); if (response != null) { + orderItem.setPercentProgress(String.valueOf(response.getRequest().getRequestStatus().getPercentProgress())); if (response.getRequest().getRequestStatus().getPercentProgress() != 100) { nbRetries++; Thread.sleep(1000); @@ -114,6 +115,7 @@ public class SOGetStatusManager { while (!stopPolling) { response = soClient.callE2EGetRequestStatus(operationId, serviceId); if (response != null) { + orderItem.setPercentProgress(response.getOperation().getProgress()); result = response.getOperation().getResult(); if (PROCESSING.equals(result)) { nbRetries++; diff --git a/src/test/resources/mappings/so_get_e2e.json b/src/test/resources/mappings/so_get_e2e.json index e3bb36e..c79dd78 100644 --- a/src/test/resources/mappings/so_get_e2e.json +++ b/src/test/resources/mappings/so_get_e2e.json @@ -16,7 +16,7 @@ "reason": "", "userid": "", "operationContent": "Creating E2E SOTN Service", - "progress": 100, + "progress": "100", "operateAt": "", "finishedAt": "" } -- cgit 1.2.3-korg