Class EntityTask
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.engine.storage.EntityTask
-
- All Implemented Interfaces:
java.io.Serializable,ITask
@Entity(name="Task") public class EntityTask extends java.lang.Object implements ITask, java.io.Serializable
ITask object for base storage implementation- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EntityTask()EntityTask(EntityJob job, java.lang.Class<? extends IDetector> detector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<? extends IDetector>getDetector()Fetches the detector for this taskjava.lang.StringgetHash()IJobgetJob()Get the job this task is a child ofjava.util.Map<java.lang.String,java.lang.Float>getParameterMapping()Gets the mapping of the adjustable parameters for this detector runlonggetPersistentId()Returns the unique id for this taskjava.util.List<AbstractModelTaskRawResult>getRawResults()Returns the raw results object produced by the tasks detectorbyte[]getSecureParam()WorkStatusgetStatus()Returns the status of the taskjava.sql.TimestampgetTimestamp()booleanhasResults()Does the task have raw results saved?booleanresetParameter(AdjustableParameterObj paramObj)Sets the passed adjustable parameter to its default valuevoidsetComplete()Used to set task complete if no results are foundvoidsetHash(java.lang.String hash)booleansetParameter(AdjustableParameterObj paramObj, float value)Sets the passed adjustable parameter to the passed value
Will return false if the AdjustableParameter is invalidvoidsetRawResults(java.util.List<AbstractModelTaskRawResult> rawResults)Sets the raw results to be stored and processedvoidsetSecureParam(byte[] secure)
-
-
-
Method Detail
-
getDetector
public java.lang.Class<? extends IDetector> getDetector()
Description copied from interface:ITaskFetches the detector for this task- Specified by:
getDetectorin interfaceITask- Returns:
- detector class
-
getHash
public java.lang.String getHash()
-
setHash
public void setHash(java.lang.String hash)
-
getJob
public IJob getJob()
Description copied from interface:ITaskGet the job this task is a child of
-
getParameterMapping
public java.util.Map<java.lang.String,java.lang.Float> getParameterMapping()
Description copied from interface:ITaskGets the mapping of the adjustable parameters for this detector run- Specified by:
getParameterMappingin interfaceITask- Returns:
- mapping of reference string to value
-
getPersistentId
public long getPersistentId()
Description copied from interface:ITaskReturns the unique id for this task- Specified by:
getPersistentIdin interfaceITask- Returns:
- id
-
getRawResults
public java.util.List<AbstractModelTaskRawResult> getRawResults()
Description copied from interface:ITaskReturns the raw results object produced by the tasks detector- Specified by:
getRawResultsin interfaceITask- Returns:
- list of the raw results
-
setRawResults
public void setRawResults(java.util.List<AbstractModelTaskRawResult> rawResults)
Description copied from interface:ITaskSets the raw results to be stored and processed- Specified by:
setRawResultsin interfaceITask- Parameters:
rawResults- raw results list
-
getSecureParam
public byte[] getSecureParam()
-
setSecureParam
public void setSecureParam(byte[] secure)
-
getStatus
public WorkStatus getStatus()
Description copied from interface:ITaskReturns the status of the task
-
getTimestamp
public java.sql.Timestamp getTimestamp()
-
hasResults
public boolean hasResults()
Description copied from interface:ITaskDoes the task have raw results saved?- Specified by:
hasResultsin interfaceITask- Returns:
- has results
-
resetParameter
public boolean resetParameter(AdjustableParameterObj paramObj)
Description copied from interface:ITaskSets the passed adjustable parameter to its default value- Specified by:
resetParameterin interfaceITask- Parameters:
paramObj- The parameter object to reset- Returns:
- true if successfully reset
-
setComplete
public void setComplete()
Description copied from interface:ITaskUsed to set task complete if no results are found- Specified by:
setCompletein interfaceITask
-
setParameter
public boolean setParameter(AdjustableParameterObj paramObj, float value)
Description copied from interface:ITaskSets the passed adjustable parameter to the passed value
Will return false if the AdjustableParameter is invalid- Specified by:
setParameterin interfaceITask- Parameters:
paramObj- The parameter object to setvalue- new value of the object, if it should be an integer then this will be checked- Returns:
- true if successfully set
-
-