Update the "WorkerReport" response and the "UrlReport" and "Payload" models.
This commit is contained in:
parent
3550ed71d9
commit
83d1bd2def
|
@ -4,6 +4,8 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
@JsonPropertyOrder({
|
@JsonPropertyOrder({
|
||||||
|
@ -30,13 +32,13 @@ public class Payload {
|
||||||
private String actual_url;
|
private String actual_url;
|
||||||
|
|
||||||
@JsonProperty("date_acquired")
|
@JsonProperty("date_acquired")
|
||||||
private String date_acquired;
|
private Date date_acquired;
|
||||||
|
|
||||||
@JsonProperty("mime_type")
|
@JsonProperty("mime_type")
|
||||||
private String mime_type;
|
private String mime_type;
|
||||||
|
|
||||||
@JsonProperty("size")
|
@JsonProperty("size")
|
||||||
private String size;
|
private Long size; // In bytes.
|
||||||
|
|
||||||
@JsonProperty("more_info")
|
@JsonProperty("more_info")
|
||||||
private String more_info;
|
private String more_info;
|
||||||
|
@ -51,6 +53,27 @@ public class Payload {
|
||||||
private String provenance;
|
private String provenance;
|
||||||
|
|
||||||
|
|
||||||
|
public Payload(String id, String original_url, String actual_url, Date date_acquired, String mime_type, Long size, String more_info, String md5, String location, String provenance) {
|
||||||
|
this.id = id;
|
||||||
|
this.original_url = original_url;
|
||||||
|
this.actual_url = actual_url;
|
||||||
|
this.date_acquired = date_acquired;
|
||||||
|
this.mime_type = mime_type;
|
||||||
|
this.size = size;
|
||||||
|
this.more_info = more_info;
|
||||||
|
this.md5 = md5;
|
||||||
|
this.location = location;
|
||||||
|
this.provenance = provenance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
public String getOriginal_url() {
|
public String getOriginal_url() {
|
||||||
return original_url;
|
return original_url;
|
||||||
}
|
}
|
||||||
|
@ -67,11 +90,11 @@ public class Payload {
|
||||||
this.actual_url = actual_url;
|
this.actual_url = actual_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDate_acquired() {
|
public Date getDate_acquired() {
|
||||||
return date_acquired;
|
return date_acquired;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDate_acquired(String date_acquired) {
|
public void setDate_acquired(Date date_acquired) {
|
||||||
this.date_acquired = date_acquired;
|
this.date_acquired = date_acquired;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,11 +106,11 @@ public class Payload {
|
||||||
this.mime_type = mime_type;
|
this.mime_type = mime_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSize() {
|
public Long getSize() {
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSize(String size) {
|
public void setSize(Long size) {
|
||||||
this.size = size;
|
this.size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,15 +146,6 @@ public class Payload {
|
||||||
this.provenance = provenance;
|
this.provenance = provenance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(String id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Payload{" +
|
return "Payload{" +
|
||||||
|
|
|
@ -7,42 +7,30 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||||
|
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
@JsonPropertyOrder({
|
@JsonPropertyOrder({
|
||||||
"task",
|
|
||||||
"status",
|
"status",
|
||||||
"payload"
|
"payload"
|
||||||
})
|
})
|
||||||
public class UrlReport {
|
public class UrlReport {
|
||||||
|
|
||||||
@JsonProperty("task")
|
|
||||||
private Task task;
|
|
||||||
|
|
||||||
@JsonProperty("status")
|
@JsonProperty("status")
|
||||||
private String Status;
|
private String status;
|
||||||
|
|
||||||
@JsonProperty("payload")
|
@JsonProperty("payload")
|
||||||
private Payload payload;
|
private Payload payload;
|
||||||
|
|
||||||
|
|
||||||
public UrlReport(Task task, String status, Payload payload) {
|
public UrlReport(String status, Payload payload) {
|
||||||
this.task = task;
|
this.status = status;
|
||||||
Status = status;
|
|
||||||
this.payload = payload;
|
this.payload = payload;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task getTask() {
|
|
||||||
return task;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTask(Task task) {
|
|
||||||
this.task = task;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
return Status;
|
return this.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus(String status) {
|
public void setStatus(String status) {
|
||||||
Status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Payload getPayload() {
|
public Payload getPayload() {
|
||||||
|
@ -52,4 +40,12 @@ public class UrlReport {
|
||||||
public void setPayload(Payload payload) {
|
public void setPayload(Payload payload) {
|
||||||
this.payload = payload;
|
this.payload = payload;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "UrlReport{" +
|
||||||
|
"status='" + status + '\'' +
|
||||||
|
", payload=" + payload +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,18 +11,23 @@ import java.util.List;
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
@JsonPropertyOrder({
|
@JsonPropertyOrder({
|
||||||
"workerId",
|
"workerId",
|
||||||
"url"
|
"assignmentId",
|
||||||
|
"urlReports"
|
||||||
})
|
})
|
||||||
public class WorkerReport {
|
public class WorkerReport {
|
||||||
|
|
||||||
@JsonProperty("workerId")
|
@JsonProperty("workerId")
|
||||||
private String workerId;
|
private String workerId;
|
||||||
|
|
||||||
|
@JsonProperty("assignmentId")
|
||||||
|
private int assignmentId;
|
||||||
|
|
||||||
@JsonProperty("urlReports")
|
@JsonProperty("urlReports")
|
||||||
private List<UrlReport> urlReports;
|
private List<UrlReport> urlReports;
|
||||||
|
|
||||||
public WorkerReport(String workerId, List<UrlReport> urlReports) {
|
public WorkerReport(String workerId, int assignmentId, List<UrlReport> urlReports) {
|
||||||
this.workerId = workerId;
|
this.workerId = workerId;
|
||||||
|
this.assignmentId = assignmentId;
|
||||||
this.urlReports = urlReports;
|
this.urlReports = urlReports;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,11 +39,28 @@ public class WorkerReport {
|
||||||
this.workerId = workerId;
|
this.workerId = workerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getAssignmentId() {
|
||||||
|
return this.assignmentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAssignmentId(int assignmentId) {
|
||||||
|
this.assignmentId = assignmentId;
|
||||||
|
}
|
||||||
|
|
||||||
public List<UrlReport> getUrlReports() {
|
public List<UrlReport> getUrlReports() {
|
||||||
return urlReports;
|
return this.urlReports;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUrlReports(List<UrlReport> urlReports) {
|
public void setUrlReports(List<UrlReport> urlReports) {
|
||||||
this.urlReports = urlReports;
|
this.urlReports = urlReports;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "WorkerReport{" +
|
||||||
|
"workerId='" + workerId + '\'' +
|
||||||
|
", assignmentId=" + assignmentId +
|
||||||
|
", urlReports=" + urlReports +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue