Class EntityJob
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.engine.storage.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 Summary
Constructors Constructor Description EntityJob()EntityJob(EntityWorkspace workspace)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddDetector(java.lang.Class<? extends IDetector> det)Add a detector to the job, a job for each detector will be created when the job is preparedIResultJobcreateNewResult()Return a new JobResult instancelong[]getFiles()The ids of the files used for this jobjava.util.List<java.lang.Long>getFilesList()IResultJobgetLatestResult()get the latest processed results for this joblonggetPersistentId()The unique id for the jobWorkStatusgetStatus()Returns the status of the jobjava.util.List<ITask>getTasks()The list of tasks used to process this jobjava.time.LocalDateTimegetTimestamp()Fetch the timestamp for the job creation;IWorkspacegetWorkspace()get the workspace containing the jobbooleanisPrepared()Has the prepare() method been called?booleanprepare()Builds the tasks required for the job, it cannot be edited after this method is called
This should also save the job to the databasevoidremove()Delete the job, all tasks and results.booleanremoveDetector(java.lang.Class<? extends IDetector> det)Removes a detector from the jobvoidsetStatus(WorkStatus status)Sets the status of the job
-
-
-
Constructor Detail
-
EntityJob
public EntityJob()
-
EntityJob
public EntityJob(EntityWorkspace workspace)
-
-
Method Detail
-
addDetector
public boolean addDetector(java.lang.Class<? extends IDetector> det)
Description copied from interface:IJobAdd a detector to the job, a job for each detector will be created when the job is prepared- Specified by:
addDetectorin interfaceIJob- 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:IJobReturn a new JobResult instance- Specified by:
createNewResultin interfaceIJob- Returns:
- newly created instance
-
getFiles
public long[] getFiles()
Description copied from interface:IJobThe ids of the files used for this job
-
getFilesList
public java.util.List<java.lang.Long> getFilesList()
-
getLatestResult
public IResultJob getLatestResult()
Description copied from interface:IJobget the latest processed results for this job- Specified by:
getLatestResultin interfaceIJob- Returns:
- latest processed results
-
getPersistentId
public long getPersistentId()
Description copied from interface:IJobThe unique id for the job- Specified by:
getPersistentIdin interfaceIJob- Returns:
- the unique id
-
getStatus
public WorkStatus getStatus()
Description copied from interface:IJobReturns the status of the job
-
setStatus
public void setStatus(WorkStatus status)
Description copied from interface:IJobSets the status of the job
-
getTasks
public java.util.List<ITask> getTasks()
Description copied from interface:IJobThe list of tasks used to process this job
-
getTimestamp
public java.time.LocalDateTime getTimestamp()
Description copied from interface:IJobFetch the timestamp for the job creation;- Specified by:
getTimestampin interfaceIJob- Returns:
- Timestamp when the job was created;
-
getWorkspace
public IWorkspace getWorkspace()
Description copied from interface:IJobget the workspace containing the job- Specified by:
getWorkspacein interfaceIJob- Returns:
- workspace
-
isPrepared
public boolean isPrepared()
Description copied from interface:IJobHas the prepare() method been called?- Specified by:
isPreparedin interfaceIJob- Returns:
- is prepared?
-
prepare
public boolean prepare()
Description copied from interface:IJobBuilds the tasks required for the job, it cannot be edited after this method is called
This should also save the job to the database
-
removeDetector
public boolean removeDetector(java.lang.Class<? extends IDetector> det)
Description copied from interface:IJobRemoves a detector from the job- Specified by:
removeDetectorin interfaceIJob- 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
-
-