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

se.l4.jobs.engine.QueuedJob Maven / Gradle / Ivy

The newest version!
package se.l4.jobs.engine;

import java.util.Optional;

import se.l4.jobs.JobData;
import se.l4.jobs.Schedule;

/**
 * Information about job that has been queued up to be run.
 *
 * @param 
 */
public interface QueuedJob, R>
{
	/**
	 * Get the automatically generated identifier of the job.
	 *
	 * @return
	 */
	long getId();

	/**
	 * Get the known identifier for this job.
	 *
	 * @return
	 */
	Optional getKnownId();

	/**
	 * Get the data of the job.
	 *
	 * @return
	 */
	D getData();

	/**
	 * Get the time at which this job was first scheduled to run.
	 *
	 * @return
	 */
	long getFirstScheduled();

	/**
	 * Get the time in milliseconds from the epoch for when this job should be
	 * run.
	 *
	 * @return
	 *   time in milliseconds from the epoch
	 */
	long getScheduledTime();

	/**
	 * Get the schedule for when this job runs.
	 *
	 * @return
	 */
	Optional getSchedule();

	/**
	 * Get the number of attempts to run this job has been made.
	 *
	 * @return
	 */
	int getAttempt();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy