SMILA (incubation) API documentation

org.eclipse.smila.jobmanager
Class BucketDefinition

java.lang.Object
  extended by org.eclipse.smila.jobmanager.DefinitionBase
      extended by org.eclipse.smila.jobmanager.BucketDefinition

public class BucketDefinition
extends DefinitionBase

Definition of a (persistent) bucket. JSON format:

      {
         "name": "docsBucket",
         "type": "recordBulks",
         "parameters": 
         {
            "param1": "value1",
            ...
            "paramN": "valueN"
         }
      }
 


Field Summary
static java.lang.String KEY_BUCKETS
          name of JSON property for lists of buckets.
static java.lang.String KEY_MODE
          name of JSON property for bucket modes.
static java.lang.String KEY_PARAMETERS
          name of JSON property for bucket parameters.
static java.lang.String KEY_TYPE
          name of JSON property for bucket type.
 
Fields inherited from class org.eclipse.smila.jobmanager.DefinitionBase
_anyMap, _name, _readOnly, _timestamp, KEY_NAME, KEY_READ_ONLY, KEY_TIMESTAMP
 
Constructor Summary
BucketDefinition(AnyMap bucket)
          parse bucket definition from Any object.
BucketDefinition(java.lang.String name, java.lang.String dataObjectType)
          create a bucket definition for a transient bucket.
 
Method Summary
 java.lang.String getDataObjectType()
           
 AnyMap getParameters()
           
static BucketDefinition parseBucket(AnyMap bucketAny)
          Parse a single bucket from an Any object containing a bucket description.
static java.util.Collection<BucketDefinition> parseBuckets(AnyMap bucketsAny, boolean setReadOnly)
          Parse bucket list from an Any object containing a sequence of bucket descriptions:
 AnyMap toAny(boolean includingAdditionalAttributes)
          Returns object information 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_BUCKETS

public static final java.lang.String KEY_BUCKETS
name of JSON property for lists of buckets.

See Also:
Constant Field Values

KEY_TYPE

public static final java.lang.String KEY_TYPE
name of JSON property for bucket type.

See Also:
Constant Field Values

KEY_MODE

public static final java.lang.String KEY_MODE
name of JSON property for bucket modes.

See Also:
Constant Field Values

KEY_PARAMETERS

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

See Also:
Constant Field Values
Constructor Detail

BucketDefinition

public BucketDefinition(AnyMap bucket)
                 throws InvalidConfigException
parse bucket definition from Any object.

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

BucketDefinition

public BucketDefinition(java.lang.String name,
                        java.lang.String dataObjectType)
create a bucket definition for a transient bucket.

Parameters:
name - bucket name
dataObjectType - data object type name.
Method Detail

parseBucket

public static BucketDefinition parseBucket(AnyMap bucketAny)
                                    throws InvalidConfigException
Parse a single bucket from an Any object containing a bucket description.

Parameters:
bucketAny - bucket as Any.
Returns:
parsed bucket definition.
Throws:
InvalidConfigException - error parsing Any.

parseBuckets

public static java.util.Collection<BucketDefinition> parseBuckets(AnyMap bucketsAny,
                                                                  boolean setReadOnly)
                                                           throws InvalidConfigException
Parse bucket list from an Any object containing a sequence of bucket descriptions:
 {
   "buckets": [
     {
       // see class comment for bucket format.
     }
   ]
 }
 

Parameters:
bucketsAny - bucket sequence as Any.
setReadOnly - if 'true' the readOnly flag will be set to true for each bucket definition
Returns:
list of parsed bucket definitions.
Throws:
InvalidConfigException - error parsing Any.

getDataObjectType

public java.lang.String getDataObjectType()
Returns:
name of data object type.

getParameters

public AnyMap getParameters()
Returns:
the parameters

toAny

public AnyMap toAny(boolean includingAdditionalAttributes)
Returns object information as an Any representation..

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 workflow definition.

SMILA (incubation) API documentation