forked from lsmyrnaios/UrlsController
Add classes: "AssignmentResponse", "WorkerReport", "WorkerRequest", "UrlReport".
This commit is contained in:
parent
c2ea8a69de
commit
85ecc4a36b
|
@ -0,0 +1,55 @@
|
|||
package eu.openaire.urls_controller.models;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonPropertyOrder({
|
||||
"task",
|
||||
"status",
|
||||
"payload"
|
||||
})
|
||||
public class UrlReport {
|
||||
|
||||
@JsonProperty("task")
|
||||
private Task task;
|
||||
|
||||
@JsonProperty("status")
|
||||
private String Status;
|
||||
|
||||
@JsonProperty("payload")
|
||||
private Payload payload;
|
||||
|
||||
|
||||
public UrlReport(Task task, String status, Payload payload) {
|
||||
this.task = task;
|
||||
Status = status;
|
||||
this.payload = payload;
|
||||
}
|
||||
|
||||
public Task getTask() {
|
||||
return task;
|
||||
}
|
||||
|
||||
public void setTask(Task task) {
|
||||
this.task = task;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return Status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
Status = status;
|
||||
}
|
||||
|
||||
public Payload getPayload() {
|
||||
return payload;
|
||||
}
|
||||
|
||||
public void setPayload(Payload payload) {
|
||||
this.payload = payload;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package eu.openaire.urls_controller.payloads.requests;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import eu.openaire.urls_controller.models.UrlReport;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonPropertyOrder({
|
||||
"workerId",
|
||||
"urlReports"
|
||||
})
|
||||
public class WorkerReport {
|
||||
|
||||
@JsonProperty("workerId")
|
||||
private String workerId;
|
||||
|
||||
@JsonProperty("urlReports")
|
||||
private List<UrlReport> urlReports;
|
||||
|
||||
public WorkerReport(String workerId, List<UrlReport> urlReports) {
|
||||
this.workerId = workerId;
|
||||
this.urlReports = urlReports;
|
||||
}
|
||||
|
||||
public String getWorkerId() {
|
||||
return workerId;
|
||||
}
|
||||
|
||||
public void setWorkerId(String workerId) {
|
||||
this.workerId = workerId;
|
||||
}
|
||||
|
||||
public List<UrlReport> getUrlReports() {
|
||||
return this.urlReports;
|
||||
}
|
||||
|
||||
public void setUrlReports(List<UrlReport> urlReports) {
|
||||
this.urlReports = urlReports;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package eu.openaire.urls_controller.payloads.requests;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonPropertyOrder({
|
||||
"workerId",
|
||||
"tasksLimit"
|
||||
})
|
||||
public class WorkerRequest {
|
||||
|
||||
@JsonProperty("workerId")
|
||||
private String workerId;
|
||||
|
||||
@JsonProperty("tasksLimit")
|
||||
private int tasksLimit;
|
||||
|
||||
public String getWorkerId() {
|
||||
return workerId;
|
||||
}
|
||||
|
||||
public void setWorkerId(String workerId) {
|
||||
this.workerId = workerId;
|
||||
}
|
||||
|
||||
public int getTasksLimit() {
|
||||
return tasksLimit;
|
||||
}
|
||||
|
||||
public void setTasksLimit(int tasksLimit) {
|
||||
this.tasksLimit = tasksLimit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WorkerRequest{" +
|
||||
"id='" + workerId + '\'' +
|
||||
", tasksLimit=" + tasksLimit +
|
||||
'}';
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package eu.openaire.urls_controller.payloads.responces;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import eu.openaire.urls_controller.models.Assignment;
|
||||
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class AssignmentResponse {
|
||||
|
||||
@JsonProperty("assignment")
|
||||
private Assignment assignment;
|
||||
|
||||
public AssignmentResponse(Assignment assignment) {
|
||||
this.assignment = assignment;
|
||||
}
|
||||
|
||||
public Assignment getAssignment() {
|
||||
return assignment;
|
||||
}
|
||||
|
||||
public void setAssignment(Assignment assignment) {
|
||||
this.assignment = assignment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AssignmentResponse{" +
|
||||
"assignment=" + assignment +
|
||||
'}';
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue