Package com.gigaspaces.metadata
Class SpaceTypeDescriptorBuilder
java.lang.Object
com.gigaspaces.metadata.SpaceTypeDescriptorBuilder
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:
-
Constructor Summary
ConstructorsConstructorDescriptionSpaceTypeDescriptorBuilder(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
Modifier and TypeMethodDescriptionaddCompoundIndex(String[] paths) Adds an index of the specified type for the specified path.addCompoundIndex(String[] paths, boolean unique) Adds an index of the specified type for the specified path.addCompoundIndex(String[] paths, SpaceIndexType indexType) Deprecated.addCompoundIndex(String[] paths, SpaceIndexType indexType, boolean unique) Deprecated.addFifoGroupingIndex(String fifoGroupingIndexPath) Sets a fifo grouping indexaddFixedProperty(String propertyName, Class<?> propertyType) Adds a property to the fixed properties set.addFixedProperty(String propertyName, Class<?> propertyType, SpaceDocumentSupport documentSupport) Adds a property to the fixed properties set.addFixedProperty(String propertyName, Class<?> propertyType, SpaceDocumentSupport documentSupport, StorageType storageType) Adds a property to the fixed properties set.addFixedProperty(String propertyName, Class<?> propertyType, SpaceDocumentSupport documentSupport, Class<? extends PropertyStorageAdapter> propertyStorageAdapter) Adds a property to the fixed properties set.addFixedProperty(String propertyName, Class<?> propertyType, StorageType storageType) Adds a property to the fixed properties set.addFixedProperty(String propertyName, Class<?> propertyType, Class<? extends PropertyStorageAdapter> propertyStorageAdapter) Adds a property to the fixed properties set.addFixedProperty(String propertyName, String propertyTypeName) Adds a property to the fixed properties set.addFixedProperty(String propertyName, String propertyTypeName, SpaceDocumentSupport documentSupport) addFixedProperty(String propertyName, String propertyTypeName, SpaceDocumentSupport documentSupport, StorageType storageType) addFixedProperty(String propertyName, String propertyTypeName, SpaceDocumentSupport documentSupport, Class<? extends PropertyStorageAdapter> propertyStorageAdapter) addIdPropertyType(String idPropertyName, Class<?> idPropertyType) Adds an id property to the fixed properties set.addIndex(SpaceIndex index) Adds the specified index to the type's index set.addPathIndex(String path, SpaceIndexType indexType) Adds an index of the specified type for the specified path.addPathIndex(String path, SpaceIndexType indexType, boolean unique) Adds an index of the specified type for the specified path.addPropertyIndex(String propertyName, SpaceIndexType indexType) Adds an index of the specified type for the specified property.addPropertyIndex(String propertyName, SpaceIndexType indexType, boolean unique) Adds an index of the specified type for the specified property.addQueryExtensionInfo(String path, QueryExtensionPathInfo pathInfo) Adds a QueryExtension information for the specified pathaddQueryExtensionInfo(String path, Class<? extends Annotation> queryExtensionAnnotation) Adds a QueryExtension information for the specified pathaddRoutingPropertyType(String routingPropertyName, Class<?> routingPropertyType) Adds a routing property to the fixed properties set.broadcast(boolean broadcast) Sets whether this type should be distributed across partitions.create()Create the space type descriptor using the gathered information.documentWrapperClass(Class<? extends SpaceDocument> documentWrapperClass) Sets the document wrapper class for this type.fifoGroupingProperty(String fifoGroupingPropertyPath) Sets the fifo grouping propertyfifoSupport(FifoSupport fifoSupport) Sets this type FIFO support.idProperty(String idPropertyName) Sets the ID property.idProperty(String idPropertyName, boolean autoGenerateId) Sets the ID property.idProperty(String idPropertyName, boolean autoGenerateId, SpaceIndexType indexType) Sets the ID property.idProperty(List<String> idPropertiesNames) Sets the ID propertiesidProperty(List<String> idPropertiesNames, SpaceIndexType indexType) Sets the ID propertiesreplicable(boolean replicable) Sets whether this type is replicable or not.routingProperty(String routingPropertyName) Sets the routing property.routingProperty(String routingPropertyName, SpaceIndexType indexType) Sets the routing property.sequenceNumberProperty(String sequenceNumberPropertyName, boolean sequenceNumberFromDocumentBuilder) setBlobstoreEnabled(boolean blobstoreEnabled) Sets whether for this type blobstore data is enabled when cache policy is set for blobstore.setTieredStorageTableConfig(TieredStorageTableConfig tieredStorageTableConfig) storageType(StorageType storageType) Sets type's storage typesupportsDynamicProperties(boolean supportsDynamicProperties) Sets whether or not this type supports dynamic properties.supportsOptimisticLocking(boolean supportsOptimisticLocking) Sets whether or not this type supports optimistic locking.
-
Constructor Details
-
SpaceTypeDescriptorBuilder
Initialize a type descriptor builder using the specified type name.- Parameters:
typeName- Name of type.
-
SpaceTypeDescriptorBuilder
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
-
-
Method Details
-
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 extendsSpaceDocumentand can be used as a surrogate for a specific type.- Parameters:
documentWrapperClass- The document wrapper class for this type.
-
binaryStorage
- Since:
- 15.8
- See Also:
-
binaryStorage
- Since:
- 15.8
- See Also:
-
fifoSupport
Sets this type FIFO support.- Parameters:
fifoSupport- Desired FIFO support.
-
replicable
Sets whether this type is replicable or not.- Parameters:
replicable- true if this type is replicable, false otherwise.
-
setBlobstoreEnabled
Sets whether for this type blobstore data is enabled when cache policy is set for blobstore.- Parameters:
blobstoreEnabled- true if this type blobstore data is enabled, false otherwise.
-
broadcast
Sets whether this type should be distributed across partitions.- Parameters:
broadcast- true if this type is broadcast, false otherwise.
-
setTieredStorageTableConfig
public SpaceTypeDescriptorBuilder setTieredStorageTableConfig(TieredStorageTableConfig tieredStorageTableConfig) -
supportsDynamicProperties
Sets whether or not this type supports dynamic properties.- Parameters:
supportsDynamicProperties- true if this type supports dynamic properties, false otherwise.
-
supportsOptimisticLocking
Sets whether or not this type supports optimistic locking.- Parameters:
supportsOptimisticLocking- true if this type supports optimistic locking, false otherwise.
-
storageType
Sets type's storage type -
addFixedProperty
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, 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, Class<? extends PropertyStorageAdapter> propertyStorageAdapter) Adds a property to the fixed properties set.- Parameters:
propertyName- Name of property.propertyType- Type of property.propertyStorageAdapter- PropertyStorageAdapter class- Since:
- 15.2.0
-
addFixedProperty
public SpaceTypeDescriptorBuilder addFixedProperty(String propertyName, Class<?> propertyType, 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, Class<?> propertyType, SpaceDocumentSupport documentSupport, Class<? extends PropertyStorageAdapter> propertyStorageAdapter) Adds a property to the fixed properties set.- Parameters:
propertyName- Name of property.propertyType- Type of property.documentSupport- Document support of property.propertyStorageAdapter- PropertyStorageAdapter class- Since:
- 9.0.0
-
addFixedProperty
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, SpaceDocumentSupport documentSupport) -
addFixedProperty
public SpaceTypeDescriptorBuilder addFixedProperty(String propertyName, String propertyTypeName, SpaceDocumentSupport documentSupport, StorageType storageType) -
addFixedProperty
public SpaceTypeDescriptorBuilder addFixedProperty(String propertyName, String propertyTypeName, SpaceDocumentSupport documentSupport, Class<? extends PropertyStorageAdapter> propertyStorageAdapter) -
idProperty
Sets the ID property.- Parameters:
idPropertyName- Name of ID property.
-
idProperty
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.
-
idProperty
Sets the ID properties- Parameters:
idPropertiesNames- Names of ID properties- Since:
- 16.2
-
idProperty
public SpaceTypeDescriptorBuilder idProperty(List<String> idPropertiesNames, SpaceIndexType indexType) Sets the ID properties- Parameters:
idPropertiesNames- Names of ID propertiesindexType- Type of compound index to create (EQUAL or NONE)- Since:
- 16.2
-
routingProperty
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
Sets the fifo grouping property- Parameters:
fifoGroupingPropertyPath- Path of fifo grouping property- Since:
- 9.0.0
-
sequenceNumberProperty
public SpaceTypeDescriptorBuilder sequenceNumberProperty(String sequenceNumberPropertyName, boolean sequenceNumberFromDocumentBuilder) -
addFifoGroupingIndex
Sets a fifo grouping index- Parameters:
fifoGroupingIndexPath- Path of fifo grouping- Since:
- 9.0.0
-
addPropertyIndex
Adds an index of the specified type for the specified property.- Parameters:
propertyName- Name of property to index.indexType- Type of index.
-
addPropertyIndex
public SpaceTypeDescriptorBuilder addPropertyIndex(String propertyName, SpaceIndexType indexType, boolean unique) Adds an index of the specified type for the specified property.- Parameters:
propertyName- Name of property to index.indexType- Type of index.unique- is it a unique index
-
addPathIndex
Adds an index of the specified type for the specified path.- Parameters:
path- Path to indexindexType- Type of index.
-
addPathIndex
public SpaceTypeDescriptorBuilder addPathIndex(String path, SpaceIndexType indexType, boolean unique) Adds an index of the specified type for the specified path.- Parameters:
path- Path to indexindexType- Type of index.unique- is it a unique index
-
addCompoundIndex
@Deprecated public SpaceTypeDescriptorBuilder addCompoundIndex(String[] paths, SpaceIndexType indexType) Deprecated.Adds an index of the specified type for the specified path.- Parameters:
paths- Paths to indexindexType- Type of index.
-
addCompoundIndex
Adds an index of the specified type for the specified path.- Parameters:
paths- Paths to index
-
addCompoundIndex
@Deprecated public SpaceTypeDescriptorBuilder addCompoundIndex(String[] paths, SpaceIndexType indexType, boolean unique) Deprecated.Adds an index of the specified type for the specified path.- Parameters:
paths- Paths to indexindexType- Type of index.unique- is it a unique index
-
addCompoundIndex
Adds an index of the specified type for the specified path.- Parameters:
paths- Paths to indexunique- is it a unique index
-
addIndex
Adds the specified index to the type's index set.- Parameters:
index- Index to add.
-
addQueryExtensionInfo
public SpaceTypeDescriptorBuilder addQueryExtensionInfo(String path, Class<? extends Annotation> queryExtensionAnnotation) Adds a QueryExtension information for the specified path- Parameters:
path- Path to decoratequeryExtensionAnnotation- Query Extension annotation encapsulating mapping info
-
addQueryExtensionInfo
public SpaceTypeDescriptorBuilder addQueryExtensionInfo(String path, QueryExtensionPathInfo pathInfo) Adds a QueryExtension information for the specified path- Parameters:
path- Path to decoratepathInfo- Query Extension encapsulating mapping info
-
addIdPropertyType
Adds an id property to the fixed properties set. Default is java.lang.Object or java.lang.String for AutoGenerated=true- Parameters:
idPropertyName- Name of property.idPropertyType- Type of property.- Since:
- 16.2
-
addRoutingPropertyType
public SpaceTypeDescriptorBuilder addRoutingPropertyType(String routingPropertyName, Class<?> routingPropertyType) Adds a routing property to the fixed properties set. Default is java.lang.Object- Parameters:
routingPropertyName- Name of property.routingPropertyType- Type of property.- Since:
- 16.2
-
create
Create the space type descriptor using the gathered information.
-