Interface IJob
-
- All Known Implementing Classes:
EntityJob
public interface IJob
Interface for an object which defines a detection job. Stores, files, parameters, tasks (detectors) and the job results
-
-
Method Summary
All Methods Instance Methods Abstract 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 jobIResultJob
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
-
-
-
Method Detail
-
addDetector
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 prepared- 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
IResultJob createNewResult()
Return a new JobResult instance- Returns:
- newly created instance
-
getFiles
long[] getFiles()
The ids of the files used for this job- Returns:
- ids of files used
-
getLatestResult
IResultJob getLatestResult()
get the latest processed results for this job- Returns:
- latest processed results
-
getPersistentId
long getPersistentId()
The unique id for the job- Returns:
- the unique id
-
getStatus
WorkStatus getStatus()
Returns the status of the job- Returns:
- the stored status
-
setStatus
void setStatus(WorkStatus status)
Sets the status of the job- Parameters:
status
- the new status of the job
-
getTasks
java.util.List<ITask> getTasks()
The list of tasks used to process this job- Returns:
- tasks used for the job
-
getTimestamp
java.time.LocalDateTime getTimestamp()
Fetch the timestamp for the job creation;- Returns:
- Timestamp when the job was created;
-
getWorkspace
IWorkspace getWorkspace()
get the workspace containing the job- Returns:
- workspace
-
isPrepared
boolean isPrepared()
Has the prepare() method been called?- Returns:
- is prepared?
-
prepare
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 database- Returns:
- successfully prepared?
-
removeDetector
boolean removeDetector(java.lang.Class<? extends IDetector> det)
Removes a detector from the job- 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
void remove()
Delete the job, all tasks and results. Cannot be undone
-
-