summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthieu Geerebaert <matthieu.geerebaert@orange.com>2018-09-07 12:26:21 +0000
committerGerrit Code Review <gerrit@onap.org>2018-09-07 12:26:21 +0000
commite1e184ce87a59d632253de00ebeedfe4e3f46796 (patch)
treee56b7a736b2647cc48eb08e4977008dee468a019
parentbeb712f922ca903674844c3370424fc14330164e (diff)
parent48360933b7e20f3ee9d6fe81501f001faaaad442 (diff)
Merge "EXTAPI-125 Percent Progress"
-rwxr-xr-xsrc/main/java/org/onap/nbi/apis/serviceorder/model/ServiceOrderItem.java23
-rw-r--r--src/main/java/org/onap/nbi/apis/serviceorder/workflow/SOGetStatusManager.java2
-rw-r--r--src/test/resources/mappings/so_get_e2e.json2
3 files changed, 25 insertions, 2 deletions
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;
@@ -153,6 +156,22 @@ public class ServiceOrderItem {
}
/**
+ * 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": ""
}