GigaSpaces XAP 8.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 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, String propertyTypeName)
          Adds a property to the fixed properties set.
 SpaceTypeDescriptorBuilder addFixedProperty(String propertyName, String propertyTypeName, com.gigaspaces.metadata.SpaceDocumentSupport documentSupport)
           
 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 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 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.

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,
                                                   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)

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.

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 8.0 API

Copyright © GigaSpaces.