MariaDB Connector and Sonar Scans; clean nl
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / scheduler / SchedulerResponseWrapper.java
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerResponseWrapper.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerResponseWrapper.java
new file mode 100644 (file)
index 0000000..d30f056
--- /dev/null
@@ -0,0 +1,71 @@
+package org.openecomp.portalapp.portal.scheduler;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+/**
+ * This wrapper encapsulates the Scheduler response
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+           "status",
+           "entity",
+           "uuid"
+})
+
+public class SchedulerResponseWrapper {
+       
+       @JsonProperty("status")
+       private int status;
+
+       @JsonProperty("entity")
+       private String entity;
+       
+       @JsonProperty("uuid")
+       private String uuid;
+
+       @JsonProperty("entity")
+    public String getEntity() {
+        return entity;
+    }
+       
+       @JsonProperty("status")
+    public int getStatus() {
+        return status;
+    }
+       
+       @JsonProperty("uuid")
+    public String getUuid() {
+        return uuid;
+    }  
+       
+       @JsonProperty("status")
+    public void setStatus(int v) {
+        this.status = v;
+    }
+
+       @JsonProperty("entity")
+    public void setEntity(String v) {
+        this.entity = v;
+    }
+       
+       @JsonProperty("uuid")
+    public void setUuid(String v) {
+        this.uuid = v;
+    }  
+
+    @Override
+    public String toString() {
+        return ToStringBuilder.reflectionToString(this);
+    }
+
+    public String getResponse () {
+       
+       StringBuilder b = new StringBuilder ("{ \"status\": ");
+       b.append(getStatus()).append(", \"entity\": \" " ).append(this.getEntity()).append("\" ,\"uuid\": \"" ).append(this.getUuid()).append("\"}");
+        return (b.toString());
+    }
+
+}