All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.byu.hbll.box.QueueEntry Maven / Gradle / Ivy

There is a newer version: 2.5.3
Show newest version
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