Class TaskCommand

java.lang.Object
ubic.gemma.core.job.TaskCommand
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ArrayDesignProbeMapTaskCommand, ArrayDesignRepeatScanTaskCommand, BioAssayOutlierProcessingTaskCommand, CharacteristicUpdateCommand, CoexSearchTaskCommand, DifferentialExpressionAnalysisTaskCommand, DifferentialExpressionSearchTaskCommand, DiffExMetaAnalyzerTaskCommand, EntityTaskCommand, ExpressionExperimentDataFetchCommand, ExpressionExperimentLoadTaskCommand, ExpressionExperimentReportTaskCommand, IndexerTaskCommand, LinkAnalysisTaskCommand, PreprocessTaskCommand, SimpleExpressionExperimentLoadTaskCommand, SvdTaskCommand, TwoChannelMissingValueTaskCommand, UpdateEEDetailsCommand, UpdatePubMedCommand

public abstract class TaskCommand extends Object implements Serializable
This command class is used to allow communication of parameters for a task between a client and task running service, which might be on a different computer. This class can be used directly, or extended to create a command object to pass parameters for a specific task. See for example ExpressionExperimentLoadTaskCommand. A entityId field is provided as a convenience for the case when a primary key is all that is really needed.
Author:
keshav
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    How long we will queue a task before giving up and cancelling it (default value)
    static final long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    How long we will allow this task to be queued before giving up, or -1 for no limit.
    long
    How long we will allow this task to run before giving up, or -1 for no limit.
    If true, the jobDetails associated with this task will be persisted in the database.
    org.springframework.security.core.context.SecurityContext
    Used to propagate security to grid workers.
    Task submitted, if known.
    Class<? extends Task<?>>
    Obtain the class of the Task object that will be run for this command.
    boolean
    Should an email be sent to the user when the job is done?
    void
    setEmailAlert(boolean emailAlert)
    Should an email be sent to the user when the job is done?
    void
    setMaxQueueMillis(long maxQueueMillis)
    How long we will allow this task to be queued before giving up, or -1 for no limit.
    void
    setMaxRuntimeMillis(long maxRuntimeMillis)
    How long we will allow this task to run before giving up, or -1 for no limit.
    void
    setPersistJobDetails(Boolean persistJobDetails)
    If true, the jobDetails associated with this task will be persisted in the database.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MAX_RUNTIME_MILLIS

      public static final long MAX_RUNTIME_MILLIS
      See Also:
    • MAX_QUEUING_MILLIS

      public static final long MAX_QUEUING_MILLIS
      How long we will queue a task before giving up and cancelling it (default value)
      See Also:
  • Constructor Details

    • TaskCommand

      public TaskCommand()
  • Method Details

    • getTaskClass

      @Nullable public Class<? extends Task<?>> getTaskClass()
      Obtain the class of the Task object that will be run for this command.

      If null, the task command cannot be submitted through TaskRunningService.submitTaskCommand(TaskCommand) and a task object must be explicitly created.

      For now, this how we map from TaskCommand to Task that actually runs it. We have to have this mapping somewhere until we make Tasks themselves serializable. Tasks are not readily serializable because they have dependencies to Spring services. at which point TaskCommand can be deprecated(or remain as TaskContext).

    • isEmailAlert

      public boolean isEmailAlert()
      Should an email be sent to the user when the job is done?
    • getPersistJobDetails

      public Boolean getPersistJobDetails()
      If true, the jobDetails associated with this task will be persisted in the database. Consider setting to false for test jobs or other super-frequent maintenance tasks.
    • getSecurityContext

      public org.springframework.security.core.context.SecurityContext getSecurityContext()
      Used to propagate security to grid workers.
    • getSubmitter

      @Nullable public String getSubmitter()
      Task submitted, if known.
    • getMaxQueueMillis

      public long getMaxQueueMillis()
      How long we will allow this task to be queued before giving up, or -1 for no limit.
    • getMaxRuntimeMillis

      public long getMaxRuntimeMillis()
      How long we will allow this task to run before giving up, or -1 for no limit.
    • setEmailAlert

      public void setEmailAlert(boolean emailAlert)
      Should an email be sent to the user when the job is done?
    • setPersistJobDetails

      public void setPersistJobDetails(Boolean persistJobDetails)
      If true, the jobDetails associated with this task will be persisted in the database. Consider setting to false for test jobs or other super-frequent maintenance tasks.
    • setMaxQueueMillis

      public void setMaxQueueMillis(long maxQueueMillis)
      How long we will allow this task to be queued before giving up, or -1 for no limit.
    • setMaxRuntimeMillis

      public void setMaxRuntimeMillis(long maxRuntimeMillis)
      How long we will allow this task to run before giving up, or -1 for no limit.