Package com.hazelcast.config
Class CacheSimpleConfig
java.lang.Object
com.hazelcast.config.CacheSimpleConfig
- All Implemented Interfaces:
- NamedConfig,- UserCodeNamespaceAwareConfig<CacheSimpleConfig>,- DataSerializable,- IdentifiedDataSerializable,- com.hazelcast.nio.serialization.impl.Versioned
public class CacheSimpleConfig
extends Object
implements IdentifiedDataSerializable, NamedConfig, com.hazelcast.nio.serialization.impl.Versioned, UserCodeNamespaceAwareConfig<CacheSimpleConfig>
Simple configuration to hold parsed XML configuration.
 CacheConfig depends on the JCache API. If the JCache API is not in the classpath,
 you can use CacheSimpleConfig as a communicator between the code and CacheConfig.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classRepresents configuration for "ExpiryPolicyFactory".
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intThe default number of backups.static final InMemoryFormatDefault InMemory Format.static final intThe maximum number of backups.static final intThe minimum number of backups.Fields inherited from interface com.hazelcast.config.UserCodeNamespaceAwareConfigDEFAULT_NAMESPACE
- 
Constructor SummaryConstructorsConstructorDescriptionCacheSimpleConfig(CacheSimpleConfig cacheSimpleConfig) CacheSimpleConfig(String name) Create a Cache Simple Config for a cache with a specific name.
- 
Method SummaryModifier and TypeMethodDescriptionaddCachePartitionLostListenerConfig(CachePartitionLostListenerConfig listenerConfig) Adds the CachePartitionLostListenerConfig to partitionLostListenerConfigs.addEntryListenerConfig(CacheSimpleEntryListenerConfig listenerConfig) AddsCacheSimpleEntryListenerConfigto thisICache.final booleanintGets the number of asynchronous backups for thisICache.intGets the number of synchronous backups for thisICache.Gets a list ofCacheSimpleEntryListenerConfigfrom thisICache.Get classname of a class to be used asCacheLoader.Gets the factory for theCacheLoader.Get classname of a class to be used asCacheWriter.Gets the factory for theCacheWriter.intReturns type identifier for this class.Gets theDataPersistenceConfigfor thisCacheSimpleConfigGets theEventJournalConfigfor thisCacheSimpleConfigGets the eviction configuration for thisICache.Gets the factory configuration for theExpiryPolicy.intReturns DataSerializableFactory factory ID for this class.Gets theHotRestartConfigfor thisCacheSimpleConfigGets the InMemory Format for thisICache.Gets the key type for thisICache.Gets theMergePolicyConfigfor this map.Gets theMerkleTreeConfigfor thisCacheSimpleConfiggetName()Gets the name of thisICache.Gets the partition lost listener references added to cache configuration.Gets the name of the associated split brain protection if any.Retrieve the User Code Deployment Namespace to be used forClassLoaderawareness during operations related to the structure associated with this configuration.Gets the value type for thisICache.Gets the WAN target replication reference.final inthashCode()booleanReturns invalidation events disabled status for per entry.booleanChecks if management is enabled for thisICache.booleanChecks if thisICacheis read-through: a read loads the entry from the data store if it is not already in the cache.booleanChecks if statistics are enabled for thisICache.booleanChecks if theICacheis write-through: a write to the queue also loads the entry into the data store.voidReads fields from the input streamsetAsyncBackupCount(int asyncBackupCount) Sets the number of asynchronous backups for thisICache.setBackupCount(int backupCount) Sets the number of synchronous backups for thisICache.setCacheEntryListeners(List<CacheSimpleEntryListenerConfig> cacheEntryListeners) Sets a list ofCacheSimpleEntryListenerConfigfor thisICache.setCacheLoader(String cacheLoader) Set classname of a class to be used asCacheLoader.setCacheLoaderFactory(String cacheLoaderFactory) Sets the factory for thisCacheLoader.setCacheWriter(String cacheWriter) Set classname of a class to be used asCacheWriter.setCacheWriterFactory(String cacheWriterFactory) Sets the factory for thisCacheWriter.setDataPersistenceConfig(DataPersistenceConfig dataPersistenceConfig) Sets theDataPersistenceConfigfor thisCacheSimpleConfigsetDisablePerEntryInvalidationEvents(boolean disablePerEntryInvalidationEvents) Sets invalidation events disabled status for per entry.setEventJournalConfig(EventJournalConfig eventJournalConfig) Sets theEventJournalConfigfor thisCacheSimpleConfigsetEvictionConfig(EvictionConfig evictionConfig) Sets the eviction configuration for thisICache.setExpiryPolicyFactory(String className) Sets the factory for thisExpiryPolicy.setExpiryPolicyFactoryConfig(CacheSimpleConfig.ExpiryPolicyFactoryConfig expiryPolicyFactoryConfig) Sets the factory configuration for thisExpiryPolicy.setHotRestartConfig(HotRestartConfig hotRestartConfig) Deprecated.setInMemoryFormat(InMemoryFormat inMemoryFormat) Sets the InMemory Format for thisICache.setKeyType(String keyType) Sets the key type for thisICache.setManagementEnabled(boolean managementEnabled) Sets management to enabled or disabled for thisICache.setMergePolicyConfig(MergePolicyConfig mergePolicyConfig) Sets theMergePolicyConfigfor this map.setMerkleTreeConfig(MerkleTreeConfig merkleTreeConfig) Sets theMerkleTreeConfigfor thisCacheSimpleConfigSets the name of thisICache.setPartitionLostListenerConfigs(List<CachePartitionLostListenerConfig> partitionLostListenerConfigs) Sets the PartitionLostListenerConfigs.setReadThrough(boolean readThrough) Enables or disables read-through: a read loads the entry from the data store if it is not already in the cache.setSplitBrainProtectionName(String splitBrainProtectionName) Associates this cache configuration to a split brain protection.setStatisticsEnabled(boolean statisticsEnabled) Sets statistics to enabled or disabled for thisICache.setUserCodeNamespace(String userCodeNamespace) Associates the provided Namespace Name with this structure forClassLoaderawareness.setValueType(String valueType) Sets the value type for thisICache.setWanReplicationRef(WanReplicationRef wanReplicationRef) Sets the WAN target replication reference.setWriteThrough(boolean writeThrough) Enables or disables write-through for thisICache: a write to the queue also loads the entry into the data store.toString()voidWrites object fields to output stream
- 
Field Details- 
MIN_BACKUP_COUNTpublic static final int MIN_BACKUP_COUNTThe minimum number of backups.- See Also:
 
- 
MAX_BACKUP_COUNTpublic static final int MAX_BACKUP_COUNTThe maximum number of backups.- See Also:
 
- 
DEFAULT_BACKUP_COUNTpublic static final int DEFAULT_BACKUP_COUNTThe default number of backups.- See Also:
 
- 
DEFAULT_IN_MEMORY_FORMATDefault InMemory Format.
 
- 
- 
Constructor Details- 
CacheSimpleConfig
- 
CacheSimpleConfigCreate a Cache Simple Config for a cache with a specific name.- Parameters:
- name- cache name
 
- 
CacheSimpleConfigpublic CacheSimpleConfig()
 
- 
- 
Method Details- 
getNameGets the name of thisICache.- Specified by:
- getNamein interface- NamedConfig
- Returns:
- the name of the ICache
 
- 
setNameSets the name of thisICache.- Specified by:
- setNamein interface- NamedConfig
- Parameters:
- name- the name to set for this- ICache
- Returns:
- the current cache config instance
 
- 
getKeyTypeGets the key type for thisICache.- Returns:
- the key type
 
- 
setKeyTypeSets the key type for thisICache.- Parameters:
- keyType- the key type to set for this- ICache
- Returns:
- the current cache config instance
 
- 
getValueTypeGets the value type for thisICache.- Returns:
- the value type for this ICache
 
- 
setValueTypeSets the value type for thisICache.- Parameters:
- valueType- the value type to set for this- ICache
- Returns:
- the current cache config instance
 
- 
isStatisticsEnabledpublic boolean isStatisticsEnabled()Checks if statistics are enabled for thisICache.- Returns:
- trueif statistics are enabled,- falseotherwise
 
- 
setStatisticsEnabledSets statistics to enabled or disabled for thisICache.- Parameters:
- statisticsEnabled-- trueto enable cache statistics,- falseto disable
- Returns:
- the current cache config instance
 
- 
isManagementEnabledpublic boolean isManagementEnabled()Checks if management is enabled for thisICache.- Returns:
- trueif cache management is enabled,- falseotherwise
 
- 
setManagementEnabledSets management to enabled or disabled for thisICache.- Parameters:
- managementEnabled-- trueto enable cache management,- falseto disable
- Returns:
- the current cache config instance
 
- 
isReadThroughpublic boolean isReadThrough()Checks if thisICacheis read-through: a read loads the entry from the data store if it is not already in the cache.- Returns:
- trueif the cache is read-through,- falseotherwise
 
- 
setReadThroughEnables or disables read-through: a read loads the entry from the data store if it is not already in the cache.- Parameters:
- readThrough-- trueto enable read-through for this- ICache,- falseto disable
- Returns:
- the current cache config instance
 
- 
isWriteThroughpublic boolean isWriteThrough()Checks if theICacheis write-through: a write to the queue also loads the entry into the data store.- Returns:
- trueif the cache is write-through,- falseotherwise
 
- 
setWriteThroughEnables or disables write-through for thisICache: a write to the queue also loads the entry into the data store.- Parameters:
- writeThrough-- trueto enable write-through,- falseto disable
- Returns:
- the current cache config instance
 
- 
getCacheLoaderFactoryGets the factory for theCacheLoader.- Returns:
- the factory for the CacheLoader
 
- 
setCacheLoaderFactorySets the factory for thisCacheLoader.- Parameters:
- cacheLoaderFactory- the factory to set for this- CacheLoader
- Returns:
- the current cache config instance
 
- 
getCacheLoaderGet classname of a class to be used asCacheLoader.- Returns:
- classname to be used as CacheLoader
 
- 
setCacheLoaderSet classname of a class to be used asCacheLoader.- Parameters:
- cacheLoader- classname to be used as- CacheLoader
- Returns:
- the current cache config instance
 
- 
getCacheWriterFactoryGets the factory for theCacheWriter.- Returns:
- the factory for the CacheWriter
 
- 
setCacheWriterFactorySets the factory for thisCacheWriter.- Parameters:
- cacheWriterFactory- the factory to set for this- CacheWriter
- Returns:
- the current cache config instance
 
- 
getCacheWriterGet classname of a class to be used asCacheWriter.- Returns:
- classname to be used as CacheWriter
 
- 
setCacheWriterSet classname of a class to be used asCacheWriter.- Parameters:
- cacheWriter- classname to be used as- CacheWriter
- Returns:
- the current cache config instance
 
- 
getExpiryPolicyFactoryConfigGets the factory configuration for theExpiryPolicy.- Returns:
- the factory configuration for the ExpiryPolicy
 
- 
setExpiryPolicyFactoryConfigpublic CacheSimpleConfig setExpiryPolicyFactoryConfig(CacheSimpleConfig.ExpiryPolicyFactoryConfig expiryPolicyFactoryConfig) Sets the factory configuration for thisExpiryPolicy.- Parameters:
- expiryPolicyFactoryConfig- the factory configuration to set for this- ExpiryPolicy
- Returns:
- the current cache config instance
 
- 
setExpiryPolicyFactorySets the factory for thisExpiryPolicy.- Parameters:
- className- the factory to set for this- ExpiryPolicy
- Returns:
- the current cache config instance
 
- 
addEntryListenerConfigAddsCacheSimpleEntryListenerConfigto thisICache.- Returns:
- this CacheSimpleConfiginstance
 
- 
getCacheEntryListenersGets a list ofCacheSimpleEntryListenerConfigfrom thisICache.- Returns:
- list of CacheSimpleEntryListenerConfig
 
- 
setCacheEntryListenerspublic CacheSimpleConfig setCacheEntryListeners(List<CacheSimpleEntryListenerConfig> cacheEntryListeners) Sets a list ofCacheSimpleEntryListenerConfigfor thisICache.- Parameters:
- cacheEntryListeners- list of- CacheSimpleEntryListenerConfig
- Returns:
- this CacheSimpleConfiginstance
 
- 
getAsyncBackupCountpublic int getAsyncBackupCount()Gets the number of asynchronous backups for thisICache.- Returns:
- the number of asynchronous backups for this ICache
 
- 
setAsyncBackupCountSets the number of asynchronous backups for thisICache.- Parameters:
- asyncBackupCount- the number of asynchronous synchronous backups to set
- Returns:
- the updated CacheSimpleConfig
- Throws:
- IllegalArgumentException- if asyncBackupCount smaller than 0, or larger than the maximum number of backups, or the sum of the backups and async backups is larger than the maximum number of backups
- See Also:
 
- 
getBackupCountpublic int getBackupCount()Gets the number of synchronous backups for thisICache.- Returns:
- the number of synchronous backups
 
- 
setBackupCountSets the number of synchronous backups for thisICache.- Parameters:
- backupCount- the new backupCount
- Returns:
- the updated CacheSimpleConfig
- Throws:
- IllegalArgumentException- if backupCount smaller than 0, or larger than the maximum number of backup or the sum of the backups and async backups is larger than the maximum number of backups
 
- 
getInMemoryFormatGets the InMemory Format for thisICache.- Returns:
- the InMemory Format
 
- 
setInMemoryFormatSets the InMemory Format for thisICache.- Parameters:
- inMemoryFormat- the InMemory Format
- Returns:
- the updated CacheSimpleConfig
 
- 
getEvictionConfigGets the eviction configuration for thisICache.- Returns:
- the eviction configuration
 
- 
setEvictionConfigSets the eviction configuration for thisICache.- Parameters:
- evictionConfig- the eviction configuration to set
- Returns:
- the updated CacheSimpleConfig
 
- 
getWanReplicationRefGets the WAN target replication reference.- Returns:
- the WAN target replication reference
 
- 
setWanReplicationRefSets the WAN target replication reference.- Parameters:
- wanReplicationRef- the WAN target replication reference
- Returns:
- this configuration
 
- 
getPartitionLostListenerConfigsGets the partition lost listener references added to cache configuration.- Returns:
- List of CachePartitionLostListenerConfig
 
- 
setPartitionLostListenerConfigspublic CacheSimpleConfig setPartitionLostListenerConfigs(List<CachePartitionLostListenerConfig> partitionLostListenerConfigs) Sets the PartitionLostListenerConfigs.- Parameters:
- partitionLostListenerConfigs- CachePartitionLostListenerConfig list
 
- 
addCachePartitionLostListenerConfigpublic CacheSimpleConfig addCachePartitionLostListenerConfig(CachePartitionLostListenerConfig listenerConfig) Adds the CachePartitionLostListenerConfig to partitionLostListenerConfigs.- Parameters:
- listenerConfig- CachePartitionLostListenerConfig to be added
 
- 
getSplitBrainProtectionNameGets the name of the associated split brain protection if any.- Returns:
- the name of the associated split brain protection if any
 
- 
setSplitBrainProtectionNameAssociates this cache configuration to a split brain protection.- Parameters:
- splitBrainProtectionName- name of the desired split brain protection
- Returns:
- the updated CacheSimpleConfig
 
- 
getMergePolicyConfigGets theMergePolicyConfigfor this map.- Returns:
- the MergePolicyConfigfor this map
 
- 
setMergePolicyConfigSets theMergePolicyConfigfor this map.- Returns:
- the updated map configuration
 
- 
getHotRestartConfigGets theHotRestartConfigfor thisCacheSimpleConfig- Returns:
- hot restart config
 
- 
getDataPersistenceConfigGets theDataPersistenceConfigfor thisCacheSimpleConfig- Returns:
- dataPersistenceConfig config
 
- 
setHotRestartConfigDeprecated.since 5.0 usesetDataPersistenceConfig(DataPersistenceConfig)Sets theHotRestartConfigfor thisCacheSimpleConfig- Parameters:
- hotRestartConfig- hot restart config
- Returns:
- this CacheSimpleConfiginstance
 
- 
setDataPersistenceConfigSets theDataPersistenceConfigfor thisCacheSimpleConfig- Parameters:
- dataPersistenceConfig- dataPersistenceConfig config
- Returns:
- this CacheSimpleConfiginstance
 
- 
getEventJournalConfigGets theEventJournalConfigfor thisCacheSimpleConfig- Returns:
- event journal config
 
- 
setEventJournalConfigSets theEventJournalConfigfor thisCacheSimpleConfig- Parameters:
- eventJournalConfig- event journal config
- Returns:
- this CacheSimpleConfiginstance
 
- 
isDisablePerEntryInvalidationEventspublic boolean isDisablePerEntryInvalidationEvents()Returns invalidation events disabled status for per entry.- Returns:
- trueif invalidation events are disabled for per entry,- falseotherwise
 
- 
setDisablePerEntryInvalidationEventspublic CacheSimpleConfig setDisablePerEntryInvalidationEvents(boolean disablePerEntryInvalidationEvents) Sets invalidation events disabled status for per entry.- Parameters:
- disablePerEntryInvalidationEvents- Disables invalidation event sending behaviour if it is- true, otherwise enables it
- Returns:
- this configuration
 
- 
getMerkleTreeConfigGets theMerkleTreeConfigfor thisCacheSimpleConfig- Returns:
- merkle tree config
 
- 
setMerkleTreeConfigSets theMerkleTreeConfigfor thisCacheSimpleConfig- Parameters:
- merkleTreeConfig- merkle tree config
- Returns:
- this CacheSimpleConfiginstance
 
- 
getUserCodeNamespaceRetrieve the User Code Deployment Namespace to be used forClassLoaderawareness during operations related to the structure associated with this configuration.- Specified by:
- getUserCodeNamespacein interface- UserCodeNamespaceAwareConfig<CacheSimpleConfig>
- Returns:
- Namespace Name for use with the UserCodeNamespaceService, ornullif there is no User Code Namespace to associate with.
 
- 
setUserCodeNamespaceAssociates the provided Namespace Name with this structure forClassLoaderawareness.The behaviour of setting this to nullis outlined in the documentation forUserCodeNamespaceAwareConfig.DEFAULT_NAMESPACE.- Specified by:
- setUserCodeNamespacein interface- UserCodeNamespaceAwareConfig<CacheSimpleConfig>
- Parameters:
- userCodeNamespace- The ID of the Namespace to associate with this structure.
- Returns:
- the updated CacheSimpleConfiginstance
- Since:
- 5.4
 
- 
getFactoryIdpublic int getFactoryId()Description copied from interface:IdentifiedDataSerializableReturns DataSerializableFactory factory ID for this class.- Specified by:
- getFactoryIdin interface- IdentifiedDataSerializable
- Returns:
- factory ID
 
- 
getClassIdpublic int getClassId()Description copied from interface:IdentifiedDataSerializableReturns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
- getClassIdin interface- IdentifiedDataSerializable
- Returns:
- type ID
 
- 
writeDataDescription copied from interface:DataSerializableWrites object fields to output stream- Specified by:
- writeDatain interface- DataSerializable
- Parameters:
- out- output
- Throws:
- IOException- if an I/O error occurs. In particular, an- IOExceptionmay be thrown if the output stream has been closed.
 
- 
readDataDescription copied from interface:DataSerializableReads fields from the input stream- Specified by:
- readDatain interface- DataSerializable
- Parameters:
- in- input
- Throws:
- IOException- if an I/O error occurs. In particular, an- IOExceptionmay be thrown if the input stream has been closed.
 
- 
equals
- 
hashCodepublic final int hashCode()
- 
toString
 
- 
setDataPersistenceConfig(DataPersistenceConfig)