public class JobDefinition extends DefinitionBase
{ "name": "optimizeWikipediaIndex", "parameters": { "indexName" : "wikipedia", "mergeParameters" : "..." }, "workflow" : "indexOptimize" }"parameters" are optional but must not be "null".
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
KEY_JOBS
name of JSON property for lists of jobs.
|
static java.lang.String |
KEY_MODES
name of JSON property for job modes list.
|
static java.lang.String |
KEY_PARAMETERS
name of JSON property for job parameters map.
|
static java.lang.String |
KEY_TASK_CONTROL
name of JSON property for job task control.
|
static java.lang.String |
KEY_TASK_CONTROL_DELAY
name of JSON property for job task control delay.
|
static java.lang.String |
KEY_TASK_CONTROL_WORKERS
name of JSON property for job task control delay.
|
static java.lang.String |
KEY_WORKFLOW
name of JSON property for job workflow.
|
_anyMap, _name, _readOnly, _timestamp, KEY_NAME, KEY_READ_ONLY, KEY_TIMESTAMP
Constructor and Description |
---|
JobDefinition(AnyMap job)
parse job definition from Any object.
|
Modifier and Type | Method and Description |
---|---|
JobRunMode |
getDefaultJobRunMode()
return the default job run mode for this job: either the first of the configured list of modes, or null.
|
java.util.List<JobRunMode> |
getJobRunModes()
get allowed job run modes for this job: either the configured ones or null.
|
AnyMap |
getParameters() |
long |
getTaskDelay() |
java.util.List<java.lang.String> |
getTaskDelayWorkers() |
java.lang.String |
getWorkflow() |
static JobDefinition |
parseJob(AnyMap jobAny)
Parse on single job from an Any object containing a job description:
{
// see class comment for job format.
}
|
AnyMap |
toAny(boolean includingAdditionalAttributes)
Returns the object as an Any representation.
|
getName, getTimestamp, isReadOnly, toAny, toString, validateName
public static final java.lang.String KEY_JOBS
public static final java.lang.String KEY_MODES
public static final java.lang.String KEY_PARAMETERS
public static final java.lang.String KEY_WORKFLOW
public static final java.lang.String KEY_TASK_CONTROL
public static final java.lang.String KEY_TASK_CONTROL_WORKERS
public static final java.lang.String KEY_TASK_CONTROL_DELAY
public JobDefinition(AnyMap job) throws InvalidDefinitionException
job
- see class comment for format of Any objectInvalidDefinitionException
- error parsing object.public static JobDefinition parseJob(AnyMap jobAny) throws InvalidDefinitionException
{ // see class comment for job format. }
jobAny
- job as Any.InvalidDefinitionException
- error parsing Any.public java.util.List<JobRunMode> getJobRunModes()
public JobRunMode getDefaultJobRunMode()
public AnyMap getParameters()
public java.lang.String getWorkflow()
public java.util.List<java.lang.String> getTaskDelayWorkers()
public long getTaskDelay()
public AnyMap toAny(boolean includingAdditionalAttributes)
toAny
in class DefinitionBase
includingAdditionalAttributes
- 'true' if also any additional information in the AnyMap should be returned, 'false' if only the (minimal
set of) relevant information should be returned.