Class SpaceTypeDescriptorBuilder

java.lang.Object
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:
  • Constructor Details

    • 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 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 extends SpaceDocument and can be used as a surrogate for a specific type.
      Parameters:
      documentWrapperClass - The document wrapper class for this type.
    • binaryStorage

      public SpaceTypeDescriptorBuilder binaryStorage()
      Since:
      15.8
      See Also:
    • binaryStorage

      Since:
      15.8
      See Also:
    • 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.
    • setBlobstoreEnabled

      public SpaceTypeDescriptorBuilder setBlobstoreEnabled(boolean blobstoreEnabled)
      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

      public SpaceTypeDescriptorBuilder broadcast(boolean 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

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

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

      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.
    • idProperty

      public SpaceTypeDescriptorBuilder idProperty(List<String> idPropertiesNames)
      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 properties
      indexType - Type of compound index to create (EQUAL or NONE)
      Since:
      16.2
    • 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
    • sequenceNumberProperty

      public SpaceTypeDescriptorBuilder sequenceNumberProperty(String sequenceNumberPropertyName, boolean sequenceNumberFromDocumentBuilder)
    • 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.
    • 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

      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.
    • 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 index
      indexType - 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 index
      indexType - Type of index.
    • addCompoundIndex

      public SpaceTypeDescriptorBuilder addCompoundIndex(String[] paths)
      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 index
      indexType - Type of index.
      unique - is it a unique index
    • addCompoundIndex

      public SpaceTypeDescriptorBuilder addCompoundIndex(String[] paths, boolean unique)
      Adds an index of the specified type for the specified path.
      Parameters:
      paths - Paths to index
      unique - is it a unique index
    • addIndex

      public SpaceTypeDescriptorBuilder addIndex(SpaceIndex index)
      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 decorate
      queryExtensionAnnotation - 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 decorate
      pathInfo - Query Extension encapsulating mapping info
    • addIdPropertyType

      public SpaceTypeDescriptorBuilder addIdPropertyType(String idPropertyName, Class<?> idPropertyType)
      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

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