SMILA 1.0 API documentation

org.eclipse.smila.jobmanager.definitions
Class WorkerDefinition

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

public class WorkerDefinition
extends DefinitionBase

Definition for workers e.g.

 { "workers": 
   [
     {  "name": "worker",
        "modes: ["bulkSource", "autoCommit"], 
        "parameters": [ {"name": "parameter"} ],
        "output":
          [ 
            {  "name": "insertedRecords",
               "type": "recordBulks",
               "modes": [ "optional" ],
               "group": "recordBulk"
            }
          ]
      }, ...
   ]
 }
 


Nested Class Summary
static class WorkerDefinition.Input
          represents an Input node.
static class WorkerDefinition.InputOutput<T extends java.lang.Enum<T>>
          A helper class to represent Input or Output nodes for worker definitions.
static class WorkerDefinition.Mode
          Worker modes.
static class WorkerDefinition.Output
          represents an Output node.
 
Field Summary
static java.lang.String KEY_GROUP
          Property for input or output slot group in json.
static java.lang.String KEY_INPUT
          Property for input in json.
static java.lang.String KEY_MODES
          Property for modes in json.
static java.lang.String KEY_OUTPUT
          Property for output in json.
static java.lang.String KEY_PARAMETERS
          Property for parameters in json.
static java.lang.String KEY_TASK_GENERATOR
          Property for taskGenerator in json.
static java.lang.String KEY_TYPE
          Property for type in json.
static java.lang.String KEY_WORKERS
          Property for workers in json.
 
Fields inherited from class org.eclipse.smila.common.definitions.DefinitionBase
_anyMap, _name, _readOnly, _timestamp, KEY_NAME, KEY_READ_ONLY, KEY_TIMESTAMP
 
Constructor Summary
WorkerDefinition(AnyMap workerAny)
          Constructor for WorkerDefinition.
 
Method Summary
 java.util.Collection<WorkerDefinition.Input> getInput()
           
 WorkerDefinition.Input getInput(java.lang.String slotName)
           
 java.util.Collection<java.lang.String> getMandatoryParameterNames()
           
 java.util.Collection<WorkerDefinition.Mode> getModes()
           
 java.util.Collection<WorkerDefinition.Output> getOutput()
           
 WorkerDefinition.Output getOutput(java.lang.String slotName)
           
 java.util.Map<java.lang.String,java.util.Collection<OutputMode>> getOutputModes()
           
 java.util.List<ParameterDefinition> getParameters()
           
 java.util.List<ParameterDefinition> getParametersbyRange(java.lang.String range)
           
 java.lang.String getTaskGenerator()
           
 boolean hasOnlyMandatoryGroups()
           
 AnyMap toAny(boolean includingAdditionalAttributes)
          Converts the object to an Any.
 
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_WORKERS

public static final java.lang.String KEY_WORKERS
Property for workers in json.

See Also:
Constant Field Values

KEY_MODES

public static final java.lang.String KEY_MODES
Property for modes in json.

See Also:
Constant Field Values

KEY_PARAMETERS

public static final java.lang.String KEY_PARAMETERS
Property for parameters in json.

See Also:
Constant Field Values

KEY_OUTPUT

public static final java.lang.String KEY_OUTPUT
Property for output in json.

See Also:
Constant Field Values

KEY_INPUT

public static final java.lang.String KEY_INPUT
Property for input in json.

See Also:
Constant Field Values

KEY_TYPE

public static final java.lang.String KEY_TYPE
Property for type in json.

See Also:
Constant Field Values

KEY_TASK_GENERATOR

public static final java.lang.String KEY_TASK_GENERATOR
Property for taskGenerator in json.

See Also:
Constant Field Values

KEY_GROUP

public static final java.lang.String KEY_GROUP
Property for input or output slot group in json.

See Also:
Constant Field Values
Constructor Detail

WorkerDefinition

public WorkerDefinition(AnyMap workerAny)
                 throws InvalidDefinitionException
Constructor for WorkerDefinition.

Parameters:
workerAny - The any Object with one WorkerDefinition
Throws:
InvalidDefinitionException - exception if the any object is not filled with all desired values
Method Detail

getModes

public java.util.Collection<WorkerDefinition.Mode> getModes()
Returns:
the modes

getMandatoryParameterNames

public java.util.Collection<java.lang.String> getMandatoryParameterNames()
Returns:
the names of the mandatory parameters

getParameters

public java.util.List<ParameterDefinition> getParameters()
Returns:
the parameters

getParametersbyRange

public java.util.List<ParameterDefinition> getParametersbyRange(java.lang.String range)
Returns:
the parameters with given range

getTaskGenerator

public java.lang.String getTaskGenerator()
Returns:
the task generator

getInput

public java.util.Collection<WorkerDefinition.Input> getInput()
Returns:
the input

getOutput

public java.util.Collection<WorkerDefinition.Output> getOutput()
Returns:
the output

getOutputModes

public java.util.Map<java.lang.String,java.util.Collection<OutputMode>> getOutputModes()
Returns:
the output

toAny

public AnyMap toAny(boolean includingAdditionalAttributes)
Converts the object to an Any.

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:
The object as Any.

getInput

public WorkerDefinition.Input getInput(java.lang.String slotName)
Parameters:
slotName - The slot name
Returns:
The input with the given slot name

getOutput

public WorkerDefinition.Output getOutput(java.lang.String slotName)
Parameters:
slotName - The slot name
Returns:
The output with given slot name

hasOnlyMandatoryGroups

public boolean hasOnlyMandatoryGroups()
Returns:
true iff each group has mandatory slots. false if there are not groups or at least one group with only optional slots.

SMILA 1.0 API documentation