Class 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 Detail

      • EntityTask

        public EntityTask()
      • EntityTask

        public EntityTask​(EntityJob job,
                          java.lang.Class<? extends IDetector> detector)
    • 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 interface ITask
        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
        Specified by:
        getJob in interface ITask
        Returns:
        job instance
      • 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 interface ITask
        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 interface ITask
        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 interface ITask
        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 interface ITask
        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
        Specified by:
        getStatus in interface ITask
        Returns:
        the stored status
      • 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 interface ITask
        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 interface ITask
        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 interface ITask
      • 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 interface ITask
        Parameters:
        paramObj - The parameter object to set
        value - new value of the object, if it should be an integer then this will be checked
        Returns:
        true if successfully set