2021-03-16 14:25:15 +01:00
|
|
|
package eu.openaire.urls_controller.models;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
|
|
|
|
2021-11-30 18:59:46 +01:00
|
|
|
import java.sql.Timestamp;
|
2021-06-19 06:07:36 +02:00
|
|
|
|
2021-03-16 14:25:15 +01:00
|
|
|
|
|
|
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
|
|
|
@JsonPropertyOrder({
|
|
|
|
"id",
|
|
|
|
"original_url",
|
|
|
|
"actual_url",
|
2021-11-30 18:59:46 +01:00
|
|
|
"timestamp_acquired",
|
2021-03-16 14:25:15 +01:00
|
|
|
"mime_type",
|
|
|
|
"size",
|
2021-07-05 13:04:39 +02:00
|
|
|
"hash",
|
2021-03-16 14:25:15 +01:00
|
|
|
"location",
|
2022-04-01 18:24:04 +02:00
|
|
|
"provenance",
|
|
|
|
"datasourceId"
|
2021-03-16 14:25:15 +01:00
|
|
|
})
|
2021-09-23 14:08:52 +02:00
|
|
|
public class Payload {
|
2021-03-16 14:25:15 +01:00
|
|
|
|
|
|
|
@JsonProperty("id")
|
|
|
|
private String id;
|
|
|
|
|
|
|
|
@JsonProperty("original_url")
|
|
|
|
private String original_url;
|
|
|
|
|
|
|
|
@JsonProperty("actual_url")
|
2021-06-19 06:07:36 +02:00
|
|
|
private String actual_url;
|
2021-03-16 14:25:15 +01:00
|
|
|
|
2021-11-30 18:59:46 +01:00
|
|
|
@JsonProperty("timestamp_acquired")
|
|
|
|
private Timestamp timestamp_acquired;
|
2021-03-16 14:25:15 +01:00
|
|
|
|
|
|
|
@JsonProperty("mime_type")
|
|
|
|
private String mime_type;
|
|
|
|
|
|
|
|
@JsonProperty("size")
|
2021-06-19 06:07:36 +02:00
|
|
|
private Long size; // In bytes.
|
2021-03-16 14:25:15 +01:00
|
|
|
|
2021-07-05 13:04:39 +02:00
|
|
|
@JsonProperty("hash")
|
|
|
|
private String hash;
|
2021-03-16 14:25:15 +01:00
|
|
|
|
|
|
|
@JsonProperty("location")
|
|
|
|
private String location;
|
|
|
|
|
|
|
|
@JsonProperty("provenance")
|
2021-07-05 13:04:39 +02:00
|
|
|
private String provenance; // "crawl:<PluginName>"
|
2021-03-16 14:25:15 +01:00
|
|
|
|
2022-04-04 23:01:44 +02:00
|
|
|
@JsonProperty("datasourceId")
|
|
|
|
private String datasourceId; // This is NOT inserted into the "payload"-table.
|
2022-04-01 18:24:04 +02:00
|
|
|
|
|
|
|
|
2021-09-23 14:08:52 +02:00
|
|
|
public Payload() {}
|
2021-03-16 14:25:15 +01:00
|
|
|
|
2022-04-01 18:24:04 +02:00
|
|
|
public Payload(String id, String original_url, String actual_url, Timestamp timestamp_acquired, String mime_type, Long size, String hash, String location, String provenance, String datasourceId) {
|
2021-06-19 06:07:36 +02:00
|
|
|
this.id = id;
|
|
|
|
this.original_url = original_url;
|
|
|
|
this.actual_url = actual_url;
|
2021-11-30 18:59:46 +01:00
|
|
|
this.timestamp_acquired = timestamp_acquired;
|
2021-06-19 06:07:36 +02:00
|
|
|
this.mime_type = mime_type;
|
|
|
|
this.size = size;
|
2021-07-05 13:04:39 +02:00
|
|
|
this.hash = hash;
|
2021-06-19 06:07:36 +02:00
|
|
|
this.location = location;
|
|
|
|
this.provenance = provenance;
|
2022-04-01 18:24:04 +02:00
|
|
|
this.datasourceId = datasourceId;
|
2021-06-19 06:07:36 +02:00
|
|
|
}
|
|
|
|
|
2024-03-11 18:48:04 +01:00
|
|
|
|
|
|
|
public Payload clone()
|
|
|
|
{
|
|
|
|
// Return a new object with the same values. Clone whatever objects are not immutable.!
|
|
|
|
return new Payload(this.id, this.original_url, this.actual_url, (Timestamp) this.timestamp_acquired.clone(), this.mime_type, this.size, this.hash,
|
|
|
|
this.location, this.provenance, this.datasourceId);
|
|
|
|
}
|
|
|
|
|
2021-04-24 20:05:21 +02:00
|
|
|
public String getId() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setId(String id) {
|
|
|
|
this.id = id;
|
|
|
|
}
|
|
|
|
|
2021-03-16 14:25:15 +01:00
|
|
|
public String getOriginal_url() {
|
|
|
|
return original_url;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setOriginal_url(String original_url) {
|
|
|
|
this.original_url = original_url;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getActual_url() {
|
|
|
|
return actual_url;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setActual_url(String actual_url) {
|
|
|
|
this.actual_url = actual_url;
|
|
|
|
}
|
|
|
|
|
2021-11-30 18:59:46 +01:00
|
|
|
public Timestamp getTimestamp_acquired() {
|
|
|
|
return timestamp_acquired;
|
2021-03-16 14:25:15 +01:00
|
|
|
}
|
|
|
|
|
2021-11-30 18:59:46 +01:00
|
|
|
public void setTimestamp_acquired(Timestamp timestamp_acquired) {
|
|
|
|
this.timestamp_acquired = timestamp_acquired;
|
2021-03-16 14:25:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public String getMime_type() {
|
|
|
|
return mime_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setMime_type(String mime_type) {
|
|
|
|
this.mime_type = mime_type;
|
|
|
|
}
|
|
|
|
|
2021-06-19 06:07:36 +02:00
|
|
|
public Long getSize() {
|
2021-03-16 14:25:15 +01:00
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
2021-06-19 06:07:36 +02:00
|
|
|
public void setSize(Long size) {
|
2021-03-16 14:25:15 +01:00
|
|
|
this.size = size;
|
|
|
|
}
|
|
|
|
|
2021-07-05 13:04:39 +02:00
|
|
|
public String getHash() {
|
|
|
|
return hash;
|
2021-03-16 14:25:15 +01:00
|
|
|
}
|
|
|
|
|
2021-07-05 13:04:39 +02:00
|
|
|
public void setHash(String hash) {
|
|
|
|
this.hash = hash;
|
2021-03-16 14:25:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public String getLocation() {
|
|
|
|
return location;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setLocation(String location) {
|
|
|
|
this.location = location;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getProvenance() {
|
|
|
|
return provenance;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setProvenance(String provenance) {
|
|
|
|
this.provenance = provenance;
|
|
|
|
}
|
|
|
|
|
2022-04-01 18:24:04 +02:00
|
|
|
public String getDatasourceId() {
|
|
|
|
return datasourceId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDatasourceId(String datasourceId) {
|
|
|
|
this.datasourceId = datasourceId;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-16 14:25:15 +01:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "Payload{" +
|
|
|
|
"id='" + id + '\'' +
|
|
|
|
", original_url='" + original_url + '\'' +
|
|
|
|
", actual_url='" + actual_url + '\'' +
|
2022-04-01 18:24:04 +02:00
|
|
|
", timestamp_acquired=" + timestamp_acquired +
|
2021-03-16 14:25:15 +01:00
|
|
|
", mime_type='" + mime_type + '\'' +
|
2022-04-01 18:24:04 +02:00
|
|
|
", size=" + size +
|
|
|
|
", hash='" + hash + '\'' +
|
2021-03-16 14:25:15 +01:00
|
|
|
", location='" + location + '\'' +
|
|
|
|
", provenance='" + provenance + '\'' +
|
2022-04-01 18:24:04 +02:00
|
|
|
", datasourceId='" + datasourceId + '\'' +
|
2021-03-16 14:25:15 +01:00
|
|
|
'}';
|
|
|
|
}
|
2022-04-01 18:24:04 +02:00
|
|
|
|
2021-03-16 14:25:15 +01:00
|
|
|
}
|