Class AttributesFactory<K,​V>

  • java.lang.Object
    • org.apache.geode.cache.AttributesFactory<K,​V>
    • Field Detail

      • DEFAULT_DISK_SYNCHRONOUS

        public static final boolean DEFAULT_DISK_SYNCHRONOUS
        Deprecated.
        The default disk synchronous write setting

        Current value: true each.

        Since:
        GemFire 6.5
        See Also:
        Constant Field Values
      • DEFAULT_CONCURRENCY_LEVEL

        public static final int DEFAULT_CONCURRENCY_LEVEL
        Deprecated.
        The default concurrency level for updates to region values
        See Also:
        Constant Field Values
    • Constructor Detail

      • AttributesFactory

        public AttributesFactory()
        Deprecated.
        Creates a new instance of AttributesFactory ready to create a RegionAttributes with default settings.
      • AttributesFactory

        public AttributesFactory​(RegionAttributes<K,​V> regionAttributes)
        Deprecated.
        Creates a new instance of AttributesFactory ready to create a RegionAttributes with the same settings as those in the specified RegionAttributes.
        Parameters:
        regionAttributes - the RegionAttributes used to initialize this AttributesFactory
    • Method Detail

      • setCacheLoader

        public void setCacheLoader​(CacheLoader<K,​V> cacheLoader)
        Deprecated.
        Sets the cache loader for the next RegionAttributes created.
        Parameters:
        cacheLoader - the cache loader or null if no loader
        Throws:
        java.lang.IllegalStateException - if this region has a pool name set
      • setCacheWriter

        public void setCacheWriter​(CacheWriter<K,​V> cacheWriter)
        Deprecated.
        Sets the cache writer for the next RegionAttributes created.
        Parameters:
        cacheWriter - the cache writer or null if no cache writer
        Throws:
        java.lang.IllegalStateException - if this region has a pool name set
      • setCacheListener

        @Deprecated
        public void setCacheListener​(CacheListener<K,​V> aListener)
        Deprecated.
        Sets the CacheListener for the next RegionAttributes created. Any existing cache listeners on this factory are removed.
        Parameters:
        aListener - a user defined CacheListener, null if no listener
      • addCacheListener

        public void addCacheListener​(CacheListener<K,​V> aListener)
        Deprecated.
        Adds a cache listener to the end of the list of cache listeners on this factory.
        Parameters:
        aListener - the cache listener to add to the factory.
        Throws:
        java.lang.IllegalArgumentException - if aListener is null
        Since:
        GemFire 5.0
      • initCacheListeners

        public void initCacheListeners​(CacheListener<K,​V>[] newListeners)
        Deprecated.
        Removes all cache listeners and then adds each listener in the specified array.
        Parameters:
        newListeners - a possibly null or empty array of listeners to add to this factory.
        Throws:
        java.lang.IllegalArgumentException - if the newListeners array has a null element
        Since:
        GemFire 5.0
      • setEntryIdleTimeout

        public void setEntryIdleTimeout​(ExpirationAttributes idleTimeout)
        Deprecated.
        Sets the idleTimeout expiration attributes for region entries for the next RegionAttributes created. Default is 0 which indicates no expiration of this type.
        Parameters:
        idleTimeout - the idleTimeout ExpirationAttributes for entries in this region
        Throws:
        java.lang.IllegalArgumentException - if idleTimeout is null
      • setCustomEntryIdleTimeout

        public void setCustomEntryIdleTimeout​(CustomExpiry<K,​V> custom)
        Deprecated.
        Sets the idleTimeout CustomExpiry for the next RegionAttributes created.
        Parameters:
        custom - the CustomExpiry to use; null means none will be used.
      • setEntryTimeToLive

        public void setEntryTimeToLive​(ExpirationAttributes timeToLive)
        Deprecated.
        Sets the timeToLive expiration attributes for region entries for the next RegionAttributes created. Default is 0 which indicates no expiration of this type.
        Parameters:
        timeToLive - the timeToLive ExpirationAttributes for entries in this region
        Throws:
        java.lang.IllegalArgumentException - if timeToLive is null
      • setCustomEntryTimeToLive

        public void setCustomEntryTimeToLive​(CustomExpiry<K,​V> custom)
        Deprecated.
        Sets the custom timeToLive for the next RegionAttributes created.
        Parameters:
        custom - the CustomExpiry to use, none if the default for the region is to be used.
      • setRegionIdleTimeout

        public void setRegionIdleTimeout​(ExpirationAttributes idleTimeout)
        Deprecated.
        Sets the idleTimeout expiration attributes for the region itself for the next RegionAttributes created. Default is 0 which indicates no expiration of this type is set.
        Parameters:
        idleTimeout - the ExpirationAttributes for this region idleTimeout
        Throws:
        java.lang.IllegalArgumentException - if idleTimeout is null
      • setRegionTimeToLive

        public void setRegionTimeToLive​(ExpirationAttributes timeToLive)
        Deprecated.
        Sets the timeToLive expiration attributes for the region itself for the next RegionAttributes created. Default is 0 i.e. no expiration of this type.
        Parameters:
        timeToLive - the ExpirationAttributes for this region timeToLive
        Throws:
        java.lang.IllegalArgumentException - if timeToLive is null
      • setScope

        public void setScope​(Scope scopeType)
        Deprecated.
        Sets the scope for the next RegionAttributes created. Default scope is DISTRIBUTED_NO_ACK. Refer gemfire documentation for more details on this.
        Parameters:
        scopeType - the type of Scope to use for the region
        Throws:
        java.lang.IllegalArgumentException - if scopeType is null
      • setEvictionAttributes

        public void setEvictionAttributes​(EvictionAttributes evictAttrs)
        Deprecated.
        Sets the EvictionController for the next RegionAttributes created. Use one of the creation methods on EvictionAttributes e.g. EvictionAttributes.createLRUHeapAttributes() to create the desired instance for this AttributesFactory
        Parameters:
        evictAttrs - Explains how and when eviction occurs in the Region.
      • setMirrorType

        @Deprecated
        public void setMirrorType​(MirrorType mirrorType)
        Sets the mirror type for the next RegionAttributes created.
        Parameters:
        mirrorType - The type of mirroring to use for the region
        Throws:
        java.lang.IllegalArgumentException - if mirrorType is null
      • setDataPolicy

        public void setDataPolicy​(DataPolicy dataPolicy)
        Deprecated.
        Sets the data policy for the next RegionAttributes created. Default data policy is 'Normal'. Please refer gemfire documentation for more details on this.
        Parameters:
        dataPolicy - The data policy to use for the region
        Throws:
        java.lang.IllegalArgumentException - if dataPolicy is null
      • setKeyConstraint

        public void setKeyConstraint​(java.lang.Class<K> keyConstraint)
        Deprecated.
        Sets the key constraint for the next RegionAttributes created. Keys in the region will be constrained to this class (or subclass). Any attempt to store a key of an incompatible type in the region will cause a ClassCastException to be thrown.
        Parameters:
        keyConstraint - The Class to constrain the keys to, or null if no constraint
        Throws:
        java.lang.IllegalArgumentException - if keyConstraint is a class denoting a primitive type
      • setValueConstraint

        public void setValueConstraint​(java.lang.Class<V> valueConstraint)
        Deprecated.
        Sets the value constraint for the next RegionAttributes created. Values in the region will be constrained to this class (or subclass). Any attempt to store a value of an incompatible type in the region will cause a ClassCastException to be thrown.
        Parameters:
        valueConstraint - The Class to constrain the values to, or null if no constraint
        Throws:
        java.lang.IllegalArgumentException - if valueConstraint is a class denoting a primitive type
      • setInitialCapacity

        public void setInitialCapacity​(int initialCapacity)
        Deprecated.
        Sets the entry initial capacity for the next RegionAttributes created. This value is used in initializing the map that holds the entries. Default is 16.
        Parameters:
        initialCapacity - the initial capacity of the entry map
        Throws:
        java.lang.IllegalArgumentException - if initialCapacity is negative.
        See Also:
        HashMap
      • setLoadFactor

        public void setLoadFactor​(float loadFactor)
        Deprecated.
        Sets the entry load factor for the next RegionAttributes created. This value is used in initializing the map that holds the entries. Default is 0.75.
        Parameters:
        loadFactor - the load factor of the entry map
        Throws:
        java.lang.IllegalArgumentException - if loadFactor is nonpositive
        See Also:
        HashMap
      • setConcurrencyLevel

        public void setConcurrencyLevel​(int concurrencyLevel)
        Deprecated.
        Sets the concurrency level of the next RegionAttributes created. This value is used in initializing the map that holds the entries. Default is 16.
        Parameters:
        concurrencyLevel - the concurrency level of the entry map
        Throws:
        java.lang.IllegalArgumentException - if concurrencyLevel is nonpositive
      • setConcurrencyChecksEnabled

        public void setConcurrencyChecksEnabled​(boolean concurrencyChecksEnabled)
        Deprecated.
        Enables or disabled concurrent modification checks. Concurrency checks are enabled by default.
        Parameters:
        concurrencyChecksEnabled - whether to perform concurrency checks on operations
        Since:
        GemFire 7.0
      • setPersistBackup

        @Deprecated
        public void setPersistBackup​(boolean persistBackup)
        Deprecated.
        as of GemFire 5.0, use DataPolicy.PERSISTENT_REPLICATE instead
        Sets whether or not a persistent backup should be made of the region.
        Parameters:
        persistBackup - boolean specifying if a persistent backup should be made of the region
        Since:
        GemFire 3.2
      • setEarlyAck

        @Deprecated
        public void setEarlyAck​(boolean earlyAck)
        Deprecated.
        This setting no longer has any effect.
        Sets whether or not acks are sent after an operation is processed.
        Parameters:
        earlyAck - boolean specifying if acks are sent after an operation is processed
        Since:
        GemFire 4.1
      • setPublisher

        @Deprecated
        public void setPublisher​(boolean v)
        Deprecated.
        as of 6.5
        Sets whether or not this region should be considered a publisher.
        Parameters:
        v - boolean specifying if this region should be considered a publisher
        Since:
        GemFire 4.2.3
      • setEnableAsyncConflation

        public void setEnableAsyncConflation​(boolean enableAsyncConflation)
        Deprecated.
        Sets whether or not conflation is enabled for sending messages to async peers. Default value is false.
        Parameters:
        enableAsyncConflation - boolean specifying if conflation is enabled for sending messages to async peers
        Since:
        GemFire 4.2.3
      • setEnableSubscriptionConflation

        public void setEnableSubscriptionConflation​(boolean enableSubscriptionConflation)
        Deprecated.
        Sets whether or not conflation is enabled for sending messages from a cache server to its clients. Default is false.
        Parameters:
        enableSubscriptionConflation - boolean specifying if conflation is enabled for sending messages from a cache server to its clients
        Since:
        GemFire 5.0
      • addGatewaySenderId

        public void addGatewaySenderId​(java.lang.String gatewaySenderId)
        Deprecated.
        adds a gateway sender to the end of list of gateway senders on this factory
        Parameters:
        gatewaySenderId - the ID of the gateway sender to be added
        Throws:
        java.lang.IllegalArgumentException - if gatewaySender is null
        Since:
        GemFire 7.0
      • addAsyncEventQueueId

        public void addAsyncEventQueueId​(java.lang.String asyncEventQueueId)
        Deprecated.
        Adds a AsyncEventQueue to the end of list of async event queues on this factory
        Parameters:
        asyncEventQueueId - the ID of the async event queue to be added
        Throws:
        java.lang.IllegalArgumentException - if gatewaySender is null
        Since:
        GemFire 7.0
      • setEnableBridgeConflation

        @Deprecated
        public void setEnableBridgeConflation​(boolean enableBridgeConflation)
        Deprecated.
        Sets whether or not conflation is enabled for sending messages from a cache server to its clients.
        Parameters:
        enableBridgeConflation - boolean specifying if conflation is enabled for sending messages from a cache server to its clients
        Since:
        GemFire 5.0
      • setEnableConflation

        @Deprecated
        public void setEnableConflation​(boolean enableBridgeConflation)
        Deprecated.
        Sets whether or not conflation is enabled for sending messages from a cache server to its clients.
        Parameters:
        enableBridgeConflation - boolean specifying if conflation is enabled for sending messages from a cache server to its clients
      • setDiskDirs

        @Deprecated
        public void setDiskDirs​(java.io.File[] diskDirs)
        Deprecated.
        Sets the directories with the default size of 10240 MB to which the region's data is written
        Parameters:
        diskDirs - the directories to which the region's data is written
        Throws:
        GemFireIOException - if a directory does not exist
        Since:
        GemFire 3.2
      • setDiskStoreName

        public void setDiskStoreName​(java.lang.String name)
        Deprecated.
        Sets the DiskStore name attribute. This causes the region to use the DiskStore.
        Parameters:
        name - the name of the diskstore
        Since:
        GemFire 6.5
      • setDiskSynchronous

        public void setDiskSynchronous​(boolean isSynchronous)
        Deprecated.
        Sets whether or not the writing to the disk is synchronous. Default is true.
        Parameters:
        isSynchronous - boolean if true indicates synchronous writes
        Since:
        GemFire 6.5
      • setDiskDirsAndSizes

        @Deprecated
        public void setDiskDirsAndSizes​(java.io.File[] diskDirs,
                                        int[] diskSizes)
        Sets the directories to which the region's data is written and also set their sizes in megabytes
        Parameters:
        diskDirs - the directories to which the region's data is written
        diskSizes - the size in megabytes for each directory
        Throws:
        java.lang.IllegalArgumentException - if a dir does not exist or the length of the size array does not match to the length of the dir array or the given size is not a valid positive number
        Since:
        GemFire 5.1
      • setPartitionAttributes

        public void setPartitionAttributes​(PartitionAttributes partition)
        Deprecated.
        Sets the PartitionAttributes that describe how the region is partitioned among members of the distributed system. This also establishes a data policy of PARTITION, if the data policy has not already been set.
        Parameters:
        partition - the PartitionAttributes that describe how the region is partitioned among members of the distributed system
        Since:
        GemFire 5.0
      • setBucketRegion

        protected void setBucketRegion​(boolean b)
        Deprecated.
      • setMembershipAttributes

        @Deprecated
        public void setMembershipAttributes​(MembershipAttributes membership)
        Deprecated.
        this API is scheduled to be removed
        Sets the MembershipAttributes that describe the membership roles required for reliable access to the region.
        Parameters:
        membership - the MembershipAttributes that describe the membership roles required for reliable access to the region
      • setSubscriptionAttributes

        public void setSubscriptionAttributes​(SubscriptionAttributes subscription)
        Deprecated.
        Sets the SubscriptionAttributes that describe how the region will subscribe to other distributed cache instances of the region.
        Parameters:
        subscription - the SubscriptionAttributes that describe how the region will subscribe to other distributed cache instances of the region
        Since:
        GemFire 5.0
      • setIndexMaintenanceSynchronous

        public void setIndexMaintenanceSynchronous​(boolean synchronous)
        Deprecated.
        Set how indexes on the region should be maintained. It will be either synchronous or asynchronous. Default is true.
        Parameters:
        synchronous - boolean specifying if index maintenance on the region should be synchronous (true) or asynchronous (false)
      • setStatisticsEnabled

        public void setStatisticsEnabled​(boolean statisticsEnabled)
        Deprecated.
        Sets whether statistics are enabled for this region and its entries. Default is false.
        Parameters:
        statisticsEnabled - whether statistics are enabled
      • setIgnoreJTA

        public void setIgnoreJTA​(boolean flag)
        Deprecated.
        Sets the flag telling a region to ignore JTA transactions. Default is false.
        Parameters:
        flag - boolean specifying if the region should ignore JTA transactions
        Since:
        GemFire 5.0
      • setLockGrantor

        public void setLockGrantor​(boolean isLockGrantor)
        Deprecated.
        Sets whether this region should become lock grantor. Default value is false.
        Parameters:
        isLockGrantor - whether this region should become lock grantor
      • setMulticastEnabled

        public void setMulticastEnabled​(boolean value)
        Deprecated.
        Sets whether distributed operations on this region should attempt to use multicast. Multicast must also be enabled in the cache's DistributedSystem (see "mcast-port"). Default is false.
        Parameters:
        value - boolean specifying if distributed operations on this region should attempt to use multicast
        Since:
        GemFire 5.0
        See Also:
        RegionAttributes.getMulticastEnabled()
      • setCloningEnabled

        public void setCloningEnabled​(boolean cloningEnable)
        Deprecated.
        Sets cloning on region. Default is false. Note: off-heap regions always behave as if cloning is enabled.
        Parameters:
        cloningEnable - boolean specifying if cloning is enabled on the region
        Since:
        GemFire 6.1
        See Also:
        RegionAttributes.getCloningEnabled()
      • setPoolName

        public void setPoolName​(java.lang.String name)
        Deprecated.
        Sets the pool name attribute. This causes regions that use these attributes to be a client region which communicates with the servers that the connection pool communicates with.

        If this attribute is set to null or "" then the connection pool is disabled causing regions that use these attributes to be communicate with peers instead of servers.

        The named connection pool must exist on the cache at the time these attributes are used to create a region. See PoolManager.createFactory() for how to create a connection pool.

        Parameters:
        name - the name of the connection pool to use; if null or "" then the connection pool is disabled for regions using these attributes.
        Since:
        GemFire 5.7
      • setCompressor

        public void setCompressor​(Compressor compressor)
        Deprecated.
        Sets this region's compressor for compressing entry values.
        Parameters:
        compressor - a compressor.
        Since:
        GemFire 8.0
      • setOffHeap

        public void setOffHeap​(boolean offHeap)
        Deprecated.
        Enables this region's usage of off-heap memory if true.
        Parameters:
        offHeap - boolean flag to enable off-heap memory
        Since:
        Geode 1.0
      • createRegionAttributes

        @Deprecated
        public RegionAttributes<K,​V> createRegionAttributes()
        Deprecated.
        as of GemFire 5.0, use create() instead
        Creates a RegionAttributes with the current settings.
        Returns:
        the newly created RegionAttributes
        Throws:
        java.lang.IllegalStateException - if the current settings violate the compatibility rules
      • create

        public RegionAttributes<K,​V> create()
        Deprecated.
        Creates a RegionAttributes with the current settings.
        Returns:
        the newly created RegionAttributes
        Throws:
        java.lang.IllegalStateException - if the current settings violate the compatibility rules
        Since:
        GemFire 5.0
      • validateAttributes

        public static void validateAttributes​(RegionAttributes<?,​?> attrs)
        Deprecated.
        Validates that the attributes are consistent with each other. The following rules are checked and enforced:
        • If the data policy uses replication and the scope is distributed then the following are incompatible:
          • ExpirationAction.LOCAL_INVALIDATE on the region
          • ExpirationAction.LOCAL_DESTROY on the entries
          • ExpirationAction.LOCAL_INVALIDATE on the entries
          • An LRU with local destroy eviction action
        • Region or entry expiration is incompatible with disabled statistics on the region
        • Entry expiration is incompatible with the DataPolicy.EMPTY data policy
        • Eviction is incompatible with the DataPolicy.EMPTY data policy
        Parameters:
        attrs - the attributes to validate
        Throws:
        java.lang.IllegalStateException - if the attributes are not consistent with each other.
        Since:
        GemFire 3.5