From 6ad41e3ccd398a2721f41ad61c80b7bb03f7d127 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Mon, 31 Dec 2018 17:21:27 +0200 Subject: Merge from ECOMP's repository Main Features -------------- - Async-Instantiation jobs mechanism major update; still WIP (package `org.onap.vid.job`) - New features in View/Edit: Activate fabric configuration; show related networks; soft delete - Support AAI service-tree traversal (`AAIServiceTree`) - In-memory cache for SDC models and certain A&AI queries (`CacheProviderWithLoadingCache`) - Upgrade TOSCA Parser and add parsing options; fix malformed TOSCA models - Resolve Cloud-Owner values for MSO - Pass X-ONAP headers to MSO Infrastructure -------------- - Remove codehaus' jackson mapper; use soley fasterxml 2.9.7 - Surefire invokes both TestNG and JUnit tests - Support Kotlin source files - AaiController2 which handles errors in a "Spring manner" - Inline generated-sources and remove jsonschema2pojo Quality -------- - Cumulative bug fixes (A&AI API, UI timeouts, and many more) - Many Sonar issues cleaned-up - Some unused classes removed - Minor changes in vid-automation project, allowing some API verification to run Hard Merges ------------ - HTTP Clients (MSO, A&AI, WebConfig, OutgoingRequestHeadersTest) - Moved `package org.onap.vid.controllers` to `controller`, without plural -- just to keep semantic sync with ECOMP. Reference commit in ECOMP: 3d1141625 Issue-ID: VID-378 Change-Id: I9c8d1e74caa41815891d441fc0760bb5f29c5788 Signed-off-by: Ittay Stern --- .../main/java/org/onap/vid/mso/rest/Request.java | 231 ++++++++++++++++++--- 1 file changed, 199 insertions(+), 32 deletions(-) (limited to 'vid-app-common/src/main/java/org/onap/vid/mso/rest/Request.java') diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/Request.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Request.java index ee1652e75..91739937a 100644 --- a/vid-app-common/src/main/java/org/onap/vid/mso/rest/Request.java +++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Request.java @@ -20,44 +20,89 @@ package org.onap.vid.mso.rest; -//import java.util.HashMap; -//import java.util.Map; -//import javax.annotation.Generated; - -import org.apache.commons.lang3.builder.HashCodeBuilder; -import org.onap.vid.domain.mso.InstanceIds; -import org.onap.vid.domain.mso.RequestStatus; -//import com.fasterxml.jackson.annotation.JsonAnyGetter; -//import com.fasterxml.jackson.annotation.JsonAnySetter; -//import com.fasterxml.jackson.annotation.JsonCreator; -//import com.fasterxml.jackson.annotation.JsonIgnore; -//import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -//import com.fasterxml.jackson.annotation.JsonPropertyOrder; -//import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.*; import org.apache.commons.lang.builder.EqualsBuilder; -//import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +import java.util.HashMap; +import java.util.Map; /** * request structure. */ -public class Request extends org.onap.vid.domain.mso.Request { +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "finishTime", + "instanceIds", + "requestDetails", + "requestId", + "requestScope", + "requestStatus", + "requestType", + "startTime" +}) +public class Request { /** The instance ids. */ + @JsonProperty("instanceIds") private InstanceIds instanceIds; /** The request details. */ + @JsonProperty("requestDetails") private RequestDetails requestDetails; /** The request status. */ + @JsonProperty("requestStatus") private RequestStatus requestStatus; - - + + /** + * Date and time the request was finished in GMT with the following sample format: Wed, 15 Oct 2014 13:01:52 GMT + * + */ + @JsonProperty("finishTime") + private String finishTime; + + /** + * UUID for the request generated by the instantiation service + * (Required) + * + */ + @JsonProperty("requestId") + private String requestId; + + /** + * short description of the entity being operated on + * (Required) + * + */ + @JsonProperty("requestScope") + private String requestScope; + + /** + * short description of the action being performed on the requestScope + * (Required) + * + */ + @JsonProperty("requestType") + private String requestType; + + /** + * Date and time the request was created in GMT with the following sample format: Wed, 15 Oct 2014 13:01:52 GMT + * (Required) + * + */ + @JsonProperty("startTime") + private String startTime; + + @JsonIgnore + private Map additionalProperties = new HashMap<>(); + + /* (non-Javadoc) - * @see org.onap.vid.domain.mso.Request#getInstanceIds() + * @see org.openecomp.vid.domain.mso.Request#getInstanceIds() */ @JsonProperty("instanceIds") public InstanceIds getInstanceIds() { @@ -115,32 +160,154 @@ public class Request extends org.onap.vid.domain.mso.Request { this.requestStatus = requestStatus; } - - /* (non-Javadoc) - * @see org.onap.vid.domain.mso.Request#toString() + /** + * Date and time the request was finished in GMT with the following sample format: Wed, 15 Oct 2014 13:01:52 GMT + * + * @return + * The finishTime + */ + @JsonProperty("finishTime") + public String getFinishTime() { + return finishTime; + } + + /** + * Date and time the request was finished in GMT with the following sample format: Wed, 15 Oct 2014 13:01:52 GMT + * + * @param finishTime + * The finishTime + */ + @JsonProperty("finishTime") + public void setFinishTime(String finishTime) { + this.finishTime = finishTime; + } + + /** + * UUID for the request generated by the instantiation service + * (Required) + * + * @return + * The requestId + */ + @JsonProperty("requestId") + public String getRequestId() { + return requestId; + } + + /** + * UUID for the request generated by the instantiation service + * (Required) + * + * @param requestId + * The requestId */ + @JsonProperty("requestId") + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + /** + * short description of the entity being operated on + * (Required) + * + * @return + * The requestScope + */ + @JsonProperty("requestScope") + public String getRequestScope() { + return requestScope; + } + + /** + * short description of the entity being operated on + * (Required) + * + * @param requestScope + * The requestScope + */ + @JsonProperty("requestScope") + public void setRequestScope(String requestScope) { + this.requestScope = requestScope; + } + + /** + * short description of the action being performed on the requestScope + * (Required) + * + * @return + * The requestType + */ + @JsonProperty("requestType") + public String getRequestType() { + return requestType; + } + + /** + * short description of the action being performed on the requestScope + * (Required) + * + * @param requestType + * The requestType + */ + @JsonProperty("requestType") + public void setRequestType(String requestType) { + this.requestType = requestType; + } + + /** + * Date and time the request was created in GMT with the following sample format: Wed, 15 Oct 2014 13:01:52 GMT + * (Required) + * + * @return + * The startTime + */ + @JsonProperty("startTime") + public String getStartTime() { + return startTime; + } + + /** + * Date and time the request was created in GMT with the following sample format: Wed, 15 Oct 2014 13:01:52 GMT + * (Required) + * + * @param startTime + * The startTime + */ + @JsonProperty("startTime") + public void setStartTime(String startTime) { + this.startTime = startTime; + } + @Override public String toString() { return ToStringBuilder.reflectionToString(this); } - - /* (non-Javadoc) - * @see org.onap.vid.domain.mso.Request#equals(java.lang.Object) - */ + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(getFinishTime()).append(getInstanceIds()).append(getRequestDetails()).append(getRequestId()).append(getRequestScope()).append(getRequestStatus()).append(getRequestType()).append(getStartTime()).append(getAdditionalProperties()).toHashCode(); + } + @Override public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof Request) == false) { + if (!(other instanceof Request)) { return false; } Request rhs = ((Request) other); return new EqualsBuilder().append(getFinishTime(), rhs.getFinishTime()).append(getInstanceIds(), rhs.getInstanceIds()).append(getRequestDetails(), rhs.getRequestDetails()).append(getRequestId(), rhs.getRequestId()).append(getRequestScope(), rhs.getRequestScope()).append(getRequestStatus(), rhs.getRequestStatus()).append(getRequestType(), rhs.getRequestType()).append(getStartTime(), rhs.getStartTime()).append(getAdditionalProperties(), rhs.getAdditionalProperties()).isEquals(); } - @Override - public int hashCode() { - return new HashCodeBuilder(17, 37).append(getFinishTime()).append(getInstanceIds()).append(getRequestDetails()).append(getRequestId()).append(getRequestScope()).append(getRequestStatus()).append(getRequestType()).append(getStartTime()).append(getAdditionalProperties()).toHashCode(); - } } -- cgit 1.2.3-korg