SMILA 1.0 API documentation

org.eclipse.smila.jobmanager.definitions
Class JobDefinition

java.lang.Object
  extended by org.eclipse.smila.common.definitions.DefinitionBase
      extended by org.eclipse.smila.jobmanager.definitions.JobDefinition

public class JobDefinition
extends DefinitionBase

Definition of a job. JSON format:

 { 
   "name": "optimizeWikipediaIndex", 
   "parameters":
     { 
       "indexName" : "wikipedia",
       "mergeParameters" : "..."
     },
   "workflow" : "indexOptimize"
 }
 
"parameters" are optional but must not be "null".


Field Summary
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_WORKFLOW
          name of JSON property for job workflow.
 
Fields inherited from class org.eclipse.smila.common.definitions.DefinitionBase
_anyMap, _name, _readOnly, _timestamp, KEY_NAME, KEY_READ_ONLY, KEY_TIMESTAMP
 
Constructor Summary
JobDefinition(AnyMap job)
          parse job definition from Any object.
 
Method Summary
 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()
           
 java.lang.String getWorkflow()
           
static JobDefinition parseJob(AnyMap jobAny)
          Parse on single job from an Any object containing a job description:
 AnyMap toAny(boolean includingAdditionalAttributes)
          Returns the object as an Any representation.
 
Methods inherited from class org.eclipse.smila.common.definitions.DefinitionBase
getName, getTimestamp, isReadOnly, toAny, toString, validateName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY_JOBS

public static final java.lang.String KEY_JOBS
name of JSON property for lists of jobs.

See Also:
Constant Field Values

KEY_MODES

public static final java.lang.String KEY_MODES
name of JSON property for job modes list.

See Also:
Constant Field Values

KEY_PARAMETERS

public static final java.lang.String KEY_PARAMETERS
name of JSON property for job parameters map.

See Also:
Constant Field Values

KEY_WORKFLOW

public static final java.lang.String KEY_WORKFLOW
name of JSON property for job workflow.

See Also:
Constant Field Values
Constructor Detail

JobDefinition

public JobDefinition(AnyMap job)
              throws InvalidDefinitionException
parse job definition from Any object.

Parameters:
job - see class comment for format of Any object
Throws:
InvalidDefinitionException - error parsing object.
Method Detail

parseJob

public static JobDefinition parseJob(AnyMap jobAny)
                              throws InvalidDefinitionException
Parse on single job from an Any object containing a job description:
 {
 // see class comment for job format.
 }
 

Parameters:
jobAny - job as Any.
Returns:
parsed job definition.
Throws:
InvalidDefinitionException - error parsing Any.

getJobRunModes

public java.util.List<JobRunMode> getJobRunModes()
get allowed job run modes for this job: either the configured ones or null.


getDefaultJobRunMode

public JobRunMode getDefaultJobRunMode()
return the default job run mode for this job: either the first of the configured list of modes, or null.


getParameters

public AnyMap getParameters()
Returns:
the _parameters

getWorkflow

public java.lang.String getWorkflow()
Returns:
the _workflow

toAny

public AnyMap toAny(boolean includingAdditionalAttributes)
Returns the object as an Any representation. If "parameters" are set to null it will not be guaranteed if the "parameters" property will be present in the resulting Any with a value of null or if it will not be present at all.

Overrides:
toAny in class DefinitionBase
Parameters:
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.
Returns:
Any object describing this job definition.

SMILA 1.0 API documentation