GigaSpaces XAP 9.0 API

com.gigaspaces.metadata
Class SpaceTypeDescriptorBuilder

java.lang.Object
  extended by com.gigaspaces.metadata.SpaceTypeDescriptorBuilder

public class SpaceTypeDescriptorBuilder
extends Object

A builder class for creating SpaceTypeDescriptor instances. For example, to create a type descriptor with type name 'foo' and id property 'bar' use the following code: new SpaceTypeDescriptorBuilder("foo").setIdProperty("bar").create()

Since:
8.0
Author:
Niv Ingberg
See Also:
SpaceTypeDescriptor

Constructor Summary
SpaceTypeDescriptorBuilder(Class<?> type, SpaceTypeDescriptor superTypeDescriptor)
           
SpaceTypeDescriptorBuilder(String typeName)
          Initialize a type descriptor builder using the specified type name.
SpaceTypeDescriptorBuilder(String typeName, SpaceTypeDescriptor superTypeDescriptor)
          Initialize a type descriptor builder using the specified type name and super type descriptor.
 
Method Summary
 SpaceTypeDescriptorBuilder addFifoGroupingIndex(String fifoGroupingIndexPath)
          Sets a fifo grouping index
 SpaceTypeDescriptorBuilder addFixedProperty(String propertyName, Class<?> propertyType)
          Adds a property to the fixed properties set.
 SpaceTypeDescriptorBuilder addFixedProperty(String propertyName, Class<?> propertyType, com.gigaspaces.metadata.SpaceDocumentSupport documentSupport)
          Adds a property to the fixed properties set.
 SpaceTypeDescriptorBuilder addFixedProperty(String propertyName, Class<?> propertyType, com.gigaspaces.metadata.SpaceDocumentSupport documentSupport, StorageType storageType)
          Adds a property to the fixed properties set.
 SpaceTypeDescriptorBuilder addFixedProperty(String propertyName, Class<?> propertyType, StorageType storageType)
          Adds a property to the fixed properties set.
 SpaceTypeDescriptorBuilder addFixedProperty(String propertyName, String propertyTypeName)
          Adds a property to the fixed properties set.
 SpaceTypeDescriptorBuilder addFixedProperty(String propertyName, String propertyTypeName, com.gigaspaces.metadata.SpaceDocumentSupport documentSupport)
           
 SpaceTypeDescriptorBuilder addFixedProperty(String propertyName, String propertyTypeName, com.gigaspaces.metadata.SpaceDocumentSupport documentSupport, StorageType storageType)
           
 SpaceTypeDescriptorBuilder addIndex(SpaceIndex index)
          Adds the specified index to the type's index set.
 SpaceTypeDescriptorBuilder addPathIndex(String path, SpaceIndexType indexType)
          Adds an index of the specified type for the specified path.
 SpaceTypeDescriptorBuilder addPropertyIndex(String propertyName, SpaceIndexType indexType)
          Adds an index of the specified type for the specified property.
 SpaceTypeDescriptor create()
          Create the space type descriptor using the gathered information.
 SpaceTypeDescriptorBuilder documentWrapperClass(Class<? extends SpaceDocument> documentWrapperClass)
          Sets the document wrapper class for this type.
 SpaceTypeDescriptorBuilder fifoGroupingProperty(String fifoGroupingPropertyPath)
          Sets the fifo grouping property
 SpaceTypeDescriptorBuilder fifoSupport(FifoSupport fifoSupport)
          Sets this type FIFO support.
 SpaceTypeDescriptorBuilder idProperty(String idPropertyName)
          Sets the ID property.
 SpaceTypeDescriptorBuilder idProperty(String idPropertyName, boolean autoGenerateId)
          Sets the ID property.
 SpaceTypeDescriptorBuilder idProperty(String idPropertyName, boolean autoGenerateId, SpaceIndexType indexType)
          Sets the ID property.
 SpaceTypeDescriptorBuilder replicable(boolean replicable)
          Sets whether this type is replicable or not.
 SpaceTypeDescriptorBuilder routingProperty(String routingPropertyName)
          Sets the routing property.
 SpaceTypeDescriptorBuilder routingProperty(String routingPropertyName, SpaceIndexType indexType)
          Sets the routing property.
 SpaceTypeDescriptorBuilder storageType(StorageType storageType)
          Sets type's storage type
 SpaceTypeDescriptorBuilder supportsDynamicProperties(boolean supportsDynamicProperties)
          Sets whether or not this type supports dynamic properties.
 SpaceTypeDescriptorBuilder supportsOptimisticLocking(boolean supportsOptimisticLocking)
          Sets whether or not this type supports optimistic locking.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpaceTypeDescriptorBuilder

public SpaceTypeDescriptorBuilder(String typeName)
Initialize a type descriptor builder using the specified type name.

Parameters:
typeName - Name of type.

SpaceTypeDescriptorBuilder

public SpaceTypeDescriptorBuilder(String typeName,
                                  SpaceTypeDescriptor superTypeDescriptor)
Initialize a type descriptor builder using the specified type name and super type descriptor.

Parameters:
typeName - Name of type.
superTypeDescriptor - Type descriptor of super type.

SpaceTypeDescriptorBuilder

public SpaceTypeDescriptorBuilder(Class<?> type,
                                  SpaceTypeDescriptor superTypeDescriptor)
Method Detail

documentWrapperClass

public SpaceTypeDescriptorBuilder documentWrapperClass(Class<? extends SpaceDocument> documentWrapperClass)
Sets the document wrapper class for this type. A document wrapper class is a java class which extends SpaceDocument and can be used as a surrogate for a specific type.

Parameters:
documentWrapperClass - The document wrapper class for this type.

fifoSupport

public SpaceTypeDescriptorBuilder fifoSupport(FifoSupport fifoSupport)
Sets this type FIFO support.

Parameters:
fifoSupport - Desired FIFO support.

replicable

public SpaceTypeDescriptorBuilder replicable(boolean replicable)
Sets whether this type is replicable or not.

Parameters:
replicable - true if this type is replicable, false otherwise.

supportsDynamicProperties

public SpaceTypeDescriptorBuilder supportsDynamicProperties(boolean supportsDynamicProperties)
Sets whether or not this type supports dynamic properties.

Parameters:
supportsDynamicProperties - true if this type supports dynamic properties, false otherwise.

supportsOptimisticLocking

public SpaceTypeDescriptorBuilder supportsOptimisticLocking(boolean supportsOptimisticLocking)
Sets whether or not this type supports optimistic locking.

Parameters:
supportsOptimisticLocking - true if this type supports optimistic locking, false otherwise.

storageType

public SpaceTypeDescriptorBuilder storageType(StorageType storageType)
Sets type's storage type

Parameters:
storageType -

addFixedProperty

public SpaceTypeDescriptorBuilder addFixedProperty(String propertyName,
                                                   Class<?> propertyType)
Adds a property to the fixed properties set.

Parameters:
propertyName - Name of property.
propertyType - Type of property.

addFixedProperty

public SpaceTypeDescriptorBuilder addFixedProperty(String propertyName,
                                                   Class<?> propertyType,
                                                   com.gigaspaces.metadata.SpaceDocumentSupport documentSupport)
Adds a property to the fixed properties set.

Parameters:
propertyName - Name of property.
propertyType - Type of property.
documentSupport - Document support of property.

addFixedProperty

public SpaceTypeDescriptorBuilder addFixedProperty(String propertyName,
                                                   Class<?> propertyType,
                                                   StorageType storageType)
Adds a property to the fixed properties set.

Parameters:
propertyName - Name of property.
propertyType - Type of property.
storageType - StorageType of property
Since:
9.0.0

addFixedProperty

public SpaceTypeDescriptorBuilder addFixedProperty(String propertyName,
                                                   Class<?> propertyType,
                                                   com.gigaspaces.metadata.SpaceDocumentSupport documentSupport,
                                                   StorageType storageType)
Adds a property to the fixed properties set.

Parameters:
propertyName - Name of property.
propertyType - Type of property.
documentSupport - Document support of property.
storageType - StorageType of property
Since:
9.0.0

addFixedProperty

public SpaceTypeDescriptorBuilder addFixedProperty(String propertyName,
                                                   String propertyTypeName)
Adds a property to the fixed properties set.

Parameters:
propertyName - Name of property.
propertyTypeName - Name of type of property.

addFixedProperty

public SpaceTypeDescriptorBuilder addFixedProperty(String propertyName,
                                                   String propertyTypeName,
                                                   com.gigaspaces.metadata.SpaceDocumentSupport documentSupport)

addFixedProperty

public SpaceTypeDescriptorBuilder addFixedProperty(String propertyName,
                                                   String propertyTypeName,
                                                   com.gigaspaces.metadata.SpaceDocumentSupport documentSupport,
                                                   StorageType storageType)

idProperty

public SpaceTypeDescriptorBuilder idProperty(String idPropertyName)
Sets the ID property.

Parameters:
idPropertyName - Name of ID property.

idProperty

public SpaceTypeDescriptorBuilder idProperty(String idPropertyName,
                                             boolean autoGenerateId)
Sets the ID property.

Parameters:
idPropertyName - Name of ID property.
autoGenerateId - false if the uid is generated using the id value, true if the uid is automatically generated.

idProperty

public SpaceTypeDescriptorBuilder idProperty(String idPropertyName,
                                             boolean autoGenerateId,
                                             SpaceIndexType indexType)
Sets the ID property.

Parameters:
idPropertyName - Name of ID property.
autoGenerateId - false if the uid is generated using the id value, true if the uid is automatically generated.
indexType - Type of index.

routingProperty

public SpaceTypeDescriptorBuilder routingProperty(String routingPropertyName)
Sets the routing property.

Parameters:
routingPropertyName - Name of routing property.

routingProperty

public SpaceTypeDescriptorBuilder routingProperty(String routingPropertyName,
                                                  SpaceIndexType indexType)
Sets the routing property.

Parameters:
routingPropertyName - Name of routing property.
indexType - Routing property index type.

fifoGroupingProperty

public SpaceTypeDescriptorBuilder fifoGroupingProperty(String fifoGroupingPropertyPath)
Sets the fifo grouping property

Parameters:
fifoGroupingPropertyPath - Path of fifo grouping property
Since:
9.0.0

addFifoGroupingIndex

public SpaceTypeDescriptorBuilder addFifoGroupingIndex(String fifoGroupingIndexPath)
Sets a fifo grouping index

Parameters:
fifoGroupingIndexPath - Path of fifo grouping
Since:
9.0.0

addPropertyIndex

public SpaceTypeDescriptorBuilder addPropertyIndex(String propertyName,
                                                   SpaceIndexType indexType)
Adds an index of the specified type for the specified property.

Parameters:
propertyName - Name of property to index.
indexType - Type of index.

addPathIndex

public SpaceTypeDescriptorBuilder addPathIndex(String path,
                                               SpaceIndexType indexType)
Adds an index of the specified type for the specified path.

Parameters:
path - Path to index
indexType - Type of index.

addIndex

public SpaceTypeDescriptorBuilder addIndex(SpaceIndex index)
Adds the specified index to the type's index set.

Parameters:
index - Index to add.

create

public SpaceTypeDescriptor create()
Create the space type descriptor using the gathered information.


GigaSpaces XAP 9.0 API

Copyright © GigaSpaces.