edu.byu.hbll.box.QueueEntry Maven / Gradle / Ivy
package edu.byu.hbll.box;
import java.time.Instant;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* An entry to be added to a source's process queue.
*
* @author Charles Draper
*/
@Data
@AllArgsConstructor
@Accessors(chain = true)
public class QueueEntry {
/** The id of the document to process. */
private String id;
/** When the processing should take place. */
private Instant attempt = Instant.now();
/**
* The priority of this entry. Entries with higher priority (lower number) will be processed
* first.
*/
private float priority = 1;
/** Whether or not to overwrite the entry if it already exists. */
private boolean overwrite;
public QueueEntry(String id) {
this.id = id;
}
public QueueEntry setPriority(double priority) {
this.priority = (float) priority;
return this;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy