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 boolean
addDetector(java.lang.Class<? extends IDetector> det)
Add a detector to the job, a job for each detector will be created when the job is preparedIResultJob
createNewResult()
Return a new JobResult instancelong[]
getFiles()
The ids of the files used for this jobjava.util.List<java.lang.Long>
getFilesList()
IResultJob
getLatestResult()
get the latest processed results for this joblong
getPersistentId()
The unique id for the jobWorkStatus
getStatus()
Returns the status of the jobjava.util.List<ITask>
getTasks()
The list of tasks used to process this jobjava.time.LocalDateTime
getTimestamp()
Fetch the timestamp for the job creation;IWorkspace
getWorkspace()
get the workspace containing the jobboolean
isPrepared()
Has the prepare() method been called?boolean
prepare()
Builds the tasks required for the job, it cannot be edited after this method is called
This should also save the job to the databasevoid
remove()
Delete the job, all tasks and results.boolean
removeDetector(java.lang.Class<? extends IDetector> det)
Removes a detector from the jobvoid
setStatus(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:IJob
Add a detector to the job, a job for each detector will be created when the job is prepared- Specified by:
addDetector
in 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:IJob
Return a new JobResult instance- Specified by:
createNewResult
in interfaceIJob
- Returns:
- newly created instance
-
getFiles
public long[] getFiles()
Description copied from interface:IJob
The 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:IJob
get the latest processed results for this job- Specified by:
getLatestResult
in interfaceIJob
- Returns:
- latest processed results
-
getPersistentId
public long getPersistentId()
Description copied from interface:IJob
The unique id for the job- Specified by:
getPersistentId
in interfaceIJob
- Returns:
- the unique id
-
getStatus
public WorkStatus getStatus()
Description copied from interface:IJob
Returns the status of the job
-
setStatus
public void setStatus(WorkStatus status)
Description copied from interface:IJob
Sets the 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
-
getTimestamp
public java.time.LocalDateTime getTimestamp()
Description copied from interface:IJob
Fetch the timestamp for the job creation;- Specified by:
getTimestamp
in interfaceIJob
- 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 interfaceIJob
- Returns:
- workspace
-
isPrepared
public boolean isPrepared()
Description copied from interface:IJob
Has the prepare() method been called?- Specified by:
isPrepared
in interfaceIJob
- 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
-
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 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
-
-