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.String
getHash()
IJob
getJob()
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 runlong
getPersistentId()
Returns the unique id for this taskjava.util.List<AbstractModelTaskRawResult>
getRawResults()
Returns the raw results object produced by the tasks detectorbyte[]
getSecureParam()
WorkStatus
getStatus()
Returns the status of the taskjava.sql.Timestamp
getTimestamp()
boolean
hasResults()
Does the task have raw results saved?boolean
resetParameter(AdjustableParameterObj paramObj)
Sets the passed adjustable parameter to its default valuevoid
setComplete()
Used to set task complete if no results are foundvoid
setHash(java.lang.String hash)
boolean
setParameter(AdjustableParameterObj paramObj, float value)
Sets the passed adjustable parameter to the passed value
Will return false if the AdjustableParameter is invalidvoid
setRawResults(java.util.List<AbstractModelTaskRawResult> rawResults)
Sets the raw results to be stored and processedvoid
setSecureParam(byte[] secure)
-
-
-
Method Detail
-
getDetector
public java.lang.Class<? extends IDetector> getDetector()
Description copied from interface:ITask
Fetches the detector for this task- Specified by:
getDetector
in 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:ITask
Get the job this task is a child of
-
getParameterMapping
public java.util.Map<java.lang.String,java.lang.Float> getParameterMapping()
Description copied from interface:ITask
Gets the mapping of the adjustable parameters for this detector run- Specified by:
getParameterMapping
in interfaceITask
- Returns:
- mapping of reference string to value
-
getPersistentId
public long getPersistentId()
Description copied from interface:ITask
Returns the unique id for this task- Specified by:
getPersistentId
in interfaceITask
- Returns:
- id
-
getRawResults
public java.util.List<AbstractModelTaskRawResult> getRawResults()
Description copied from interface:ITask
Returns the raw results object produced by the tasks detector- Specified by:
getRawResults
in interfaceITask
- Returns:
- list of the raw results
-
setRawResults
public void setRawResults(java.util.List<AbstractModelTaskRawResult> rawResults)
Description copied from interface:ITask
Sets the raw results to be stored and processed- Specified by:
setRawResults
in interfaceITask
- Parameters:
rawResults
- raw results list
-
getSecureParam
public byte[] getSecureParam()
-
setSecureParam
public void setSecureParam(byte[] secure)
-
getStatus
public WorkStatus getStatus()
Description copied from interface:ITask
Returns the status of the task
-
getTimestamp
public java.sql.Timestamp getTimestamp()
-
hasResults
public boolean hasResults()
Description copied from interface:ITask
Does the task have raw results saved?- Specified by:
hasResults
in interfaceITask
- Returns:
- has results
-
resetParameter
public boolean resetParameter(AdjustableParameterObj paramObj)
Description copied from interface:ITask
Sets the passed adjustable parameter to its default value- Specified by:
resetParameter
in interfaceITask
- Parameters:
paramObj
- The parameter object to reset- Returns:
- true if successfully reset
-
setComplete
public void setComplete()
Description copied from interface:ITask
Used to set task complete if no results are found- Specified by:
setComplete
in interfaceITask
-
setParameter
public boolean setParameter(AdjustableParameterObj paramObj, float value)
Description copied from interface:ITask
Sets the passed adjustable parameter to the passed value
Will return false if the AdjustableParameter is invalid- Specified by:
setParameter
in 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
-
-