Package ubic.gemma.core.job
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
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
FieldsModifier and TypeFieldDescriptionstatic final longHow long we will queue a task before giving up and cancelling it (default value)static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongHow long we will allow this task to be queued before giving up, or -1 for no limit.longHow 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.SecurityContextUsed to propagate security to grid workers.Task submitted, if known.Obtain the class of theTaskobject that will be run for this command.booleanShould an email be sent to the user when the job is done?voidsetEmailAlert(boolean emailAlert) Should an email be sent to the user when the job is done?voidsetMaxQueueMillis(long maxQueueMillis) How long we will allow this task to be queued before giving up, or -1 for no limit.voidsetMaxRuntimeMillis(long maxRuntimeMillis) How long we will allow this task to run before giving up, or -1 for no limit.voidsetPersistJobDetails(Boolean persistJobDetails) If true, the jobDetails associated with this task will be persisted in the database.
-
Field Details
-
MAX_RUNTIME_MILLIS
public static final long MAX_RUNTIME_MILLIS- See Also:
-
MAX_QUEUING_MILLIS
public static final long MAX_QUEUING_MILLISHow long we will queue a task before giving up and cancelling it (default value)- See Also:
-
-
Constructor Details
-
TaskCommand
public TaskCommand()
-
-
Method Details
-
getTaskClass
Obtain the class of theTaskobject 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
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
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
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.
-