Class EntityJob

  • All Implemented Interfaces:
    java.io.Serializable, IJob

    @Entity(name="Job")
    public class EntityJob
    extends java.lang.Object
    implements IJob, java.io.Serializable
    IJob object for base storage implementation
    See Also:
    Serialized Form
    • Constructor Detail

      • EntityJob

        public EntityJob()
    • Method Detail

      • addDetector

        public boolean addDetector​(java.lang.Class<? extends IDetector> det)
        Description copied from interface: IJob
        Add a detector to the job, a job for each detector will be created when the job is prepared
        Specified by:
        addDetector in interface IJob
        Parameters:
        det - Class of the detector to add
        Returns:
        returns true if added, false if already added to the job or the job has been prepared
      • createNewResult

        public IResultJob createNewResult()
        Description copied from interface: IJob
        Return a new JobResult instance
        Specified by:
        createNewResult in interface IJob
        Returns:
        newly created instance
      • getFiles

        public long[] getFiles()
        Description copied from interface: IJob
        The ids of the files used for this job
        Specified by:
        getFiles in interface IJob
        Returns:
        ids of files used
      • getFilesList

        public java.util.List<java.lang.Long> getFilesList()
      • getLatestResult

        public IResultJob getLatestResult()
        Description copied from interface: IJob
        get the latest processed results for this job
        Specified by:
        getLatestResult in interface IJob
        Returns:
        latest processed results
      • getPersistentId

        public long getPersistentId()
        Description copied from interface: IJob
        The unique id for the job
        Specified by:
        getPersistentId in interface IJob
        Returns:
        the unique id
      • getStatus

        public WorkStatus getStatus()
        Description copied from interface: IJob
        Returns the status of the job
        Specified by:
        getStatus in interface IJob
        Returns:
        the stored status
      • setStatus

        public void setStatus​(WorkStatus status)
        Description copied from interface: IJob
        Sets the status of the job
        Specified by:
        setStatus in interface IJob
        Parameters:
        status - the new status of the job
      • getTasks

        public java.util.List<ITask> getTasks()
        Description copied from interface: IJob
        The list of tasks used to process this job
        Specified by:
        getTasks in interface IJob
        Returns:
        tasks used for the job
      • getTimestamp

        public java.time.LocalDateTime getTimestamp()
        Description copied from interface: IJob
        Fetch the timestamp for the job creation;
        Specified by:
        getTimestamp in interface IJob
        Returns:
        Timestamp when the job was created;
      • getWorkspace

        public IWorkspace getWorkspace()
        Description copied from interface: IJob
        get the workspace containing the job
        Specified by:
        getWorkspace in interface IJob
        Returns:
        workspace
      • isPrepared

        public boolean isPrepared()
        Description copied from interface: IJob
        Has the prepare() method been called?
        Specified by:
        isPrepared in interface IJob
        Returns:
        is prepared?
      • prepare

        public boolean prepare()
        Description copied from interface: IJob
        Builds the tasks required for the job, it cannot be edited after this method is called

        This should also save the job to the database
        Specified by:
        prepare in interface IJob
        Returns:
        successfully prepared?
      • removeDetector

        public boolean removeDetector​(java.lang.Class<? extends IDetector> det)
        Description copied from interface: IJob
        Removes a detector from the job
        Specified by:
        removeDetector in interface IJob
        Parameters:
        det - Class of the detector to remove
        Returns:
        returns true if removed, false if not present in the job or the job has been prepared
      • remove

        public void remove()
        Description copied from interface: IJob
        Delete the job, all tasks and results. Cannot be undone
        Specified by:
        remove in interface IJob