SMILA (incubation) API documentation

org.eclipse.smila.jobmanager
Class JobDefinition

java.lang.Object
  extended by org.eclipse.smila.jobmanager.DefinitionBase
      extended by org.eclipse.smila.jobmanager.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 buckets.
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.jobmanager.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
 java.util.Map<java.lang.String,ValueExpression> 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.jobmanager.DefinitionBase
getName, getTimestamp, isReadOnly, toAny, toString
 
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 buckets.

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 InvalidConfigException
parse job definition from Any object.

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

parseJob

public static JobDefinition parseJob(AnyMap jobAny)
                              throws InvalidConfigException
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:
InvalidConfigException - error parsing Any.

getParameters

public java.util.Map<java.lang.String,ValueExpression> 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 (incubation) API documentation