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

woko.async.JobDetails Maven / Gradle / Ivy

The newest version!
package woko.async;

import java.util.Date;

/**
 * Base interface for Job Details.
 *
 * JobDetails represent the state of an async {@link Job}. Such objects can be
 * used in order to monitor Job execution.
 */
public interface JobDetails {

    /**
     * Return the job uuid
     */
    String getJobUuid();

    /**
     * Invoked when passed Job has progressed.
     * @param job the job
     * @return true if this JobDetails was modified by the call, false otherwise
     */
    boolean updateProgress(Job job);

    /**
     * Invoked when passed Job has thrown an Exception.
     * @param e the exception thrown by the job
     * @param job the job
     */
    void updateException(Exception e, Job job);

    /**
     * Invoked when passed Job has ended.
     * @param job the job
     */
    void updateEnded(Job job);

    /**
     * Invoked when passed Job was killed.
     * @param job the job
     */
    void updateKilled(Job job);

    /**
     * Invoked when passed Job has started.
     * @param job the job
     */
    void updateStarted(Job job);

    /**
     * Return the start time for the job
     */
    Date getStartTime();

    /**
     * Return the end time for the job if any
     */
    Date getEndTime();

    /**
     * Return the kill time if any
     */
    Date getKillTime();

    /**
     * Return the exception string if any
     */
    String getExceptionString();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy