public class NearCacheConfig extends Object implements DataSerializable, Serializable
| Modifier and Type | Class and Description | 
|---|---|
| static class  | NearCacheConfig.LocalUpdatePolicyLocal Update Policy enum. | 
| Modifier and Type | Field and Description | 
|---|---|
| static String | DEFAULT_EVICTION_POLICYDeprecated. 
 since 3.8, please use  EvictionConfig.DEFAULT_EVICTION_POLICY | 
| static int | DEFAULT_MAX_IDLE_SECONDSDefault value of the idle time for eviction in seconds. | 
| static int | DEFAULT_MAX_SIZEDeprecated. 
 since 3.8, please use  EvictionConfig.DEFAULT_MAX_ENTRY_COUNT_FOR_ON_HEAP_MAP | 
| static InMemoryFormat | DEFAULT_MEMORY_FORMATDefault value for the in-memory format. | 
| static int | DEFAULT_TTL_SECONDSDefault value of the time to live in seconds. | 
| Constructor and Description | 
|---|
| NearCacheConfig() | 
| NearCacheConfig(int timeToLiveSeconds,
               int maxIdleSeconds,
               boolean invalidateOnChange,
               InMemoryFormat inMemoryFormat) | 
| NearCacheConfig(int timeToLiveSeconds,
               int maxIdleSeconds,
               boolean invalidateOnChange,
               InMemoryFormat inMemoryFormat,
               EvictionConfig evictionConfig) | 
| NearCacheConfig(int timeToLiveSeconds,
               int maxSize,
               String evictionPolicy,
               int maxIdleSeconds,
               boolean invalidateOnChange,
               InMemoryFormat inMemoryFormat)Deprecated. 
 since 3.8,
 please use  NearCacheConfig(int, int, boolean, InMemoryFormat) | 
| NearCacheConfig(int timeToLiveSeconds,
               int maxSize,
               String evictionPolicy,
               int maxIdleSeconds,
               boolean invalidateOnChange,
               InMemoryFormat inMemoryFormat,
               EvictionConfig evictionConfig)Deprecated. 
 since 3.8,
 please use  NearCacheConfig(int, int, boolean, InMemoryFormat, EvictionConfig) | 
| NearCacheConfig(NearCacheConfig config) | 
| NearCacheConfig(String name) | 
| Modifier and Type | Method and Description | 
|---|---|
| NearCacheConfigReadOnly | getAsReadOnly() | 
| EvictionConfig | getEvictionConfig()The eviction configuration. | 
| String | getEvictionPolicy()Deprecated. 
 since 3.8, use  getEvictionConfig()andEvictionConfig.getEvictionPolicy()instead | 
| InMemoryFormat | getInMemoryFormat()Gets the data type used to store entries. | 
| NearCacheConfig.LocalUpdatePolicy | getLocalUpdatePolicy() | 
| int | getMaxIdleSeconds()Maximum number of seconds each entry can stay in the Near Cache as untouched (not-read). | 
| int | getMaxSize()Deprecated. 
 since 3.8, use  getEvictionConfig()andEvictionConfig.getSize()instead | 
| String | getName()Gets the name of the Near Cache. | 
| NearCachePreloaderConfig | getPreloaderConfig() | 
| int | getTimeToLiveSeconds()Gets the maximum number of seconds for each entry to stay in the Near Cache. | 
| boolean | isCacheLocalEntries()If true, cache local entries also. | 
| boolean | isInvalidateOnChange()True to evict the cached entries if the entries are changed (updated or removed). | 
| void | readData(ObjectDataInput in)Reads fields from the input stream | 
| NearCacheConfig | setCacheLocalEntries(boolean cacheLocalEntries)True to cache local entries also. | 
| NearCacheConfig | setEvictionConfig(EvictionConfig evictionConfig)Sets the eviction configuration. | 
| NearCacheConfig | setEvictionPolicy(String evictionPolicy)Deprecated. 
 since 3.8, use  setEvictionConfig(EvictionConfig)andEvictionConfig.setEvictionPolicy(EvictionPolicy)instead | 
| NearCacheConfig | setInMemoryFormat(InMemoryFormat inMemoryFormat)Sets the data type used to store entries. | 
| NearCacheConfig | setInMemoryFormat(String inMemoryFormat) | 
| NearCacheConfig | setInvalidateOnChange(boolean invalidateOnChange)True to evict the cached entries if the entries are changed (updated or removed). | 
| NearCacheConfig | setLocalUpdatePolicy(NearCacheConfig.LocalUpdatePolicy localUpdatePolicy) | 
| NearCacheConfig | setMaxIdleSeconds(int maxIdleSeconds)Maximum number of seconds each entry can stay in the Near Cache as untouched (not-read). | 
| NearCacheConfig | setMaxSize(int maxSize)Deprecated. 
 since 3.8, use  setEvictionConfig(EvictionConfig)andEvictionConfig.setSize(int)instead | 
| NearCacheConfig | setName(String name)Sets the name of the Near Cache. | 
| NearCacheConfig | setPreloaderConfig(NearCachePreloaderConfig preloaderConfig) | 
| NearCacheConfig | setTimeToLiveSeconds(int timeToLiveSeconds)Sets the maximum number of seconds for each entry to stay in the Near Cache. | 
| String | toString() | 
| void | writeData(ObjectDataOutput out)Writes object fields to output stream | 
public static final int DEFAULT_TTL_SECONDS
public static final int DEFAULT_MAX_IDLE_SECONDS
public static final InMemoryFormat DEFAULT_MEMORY_FORMAT
public static final int DEFAULT_MAX_SIZE
EvictionConfig.DEFAULT_MAX_ENTRY_COUNT_FOR_ON_HEAP_MAPpublic static final String DEFAULT_EVICTION_POLICY
EvictionConfig.DEFAULT_EVICTION_POLICYpublic NearCacheConfig()
public NearCacheConfig(String name)
public NearCacheConfig(int timeToLiveSeconds,
                       int maxIdleSeconds,
                       boolean invalidateOnChange,
                       InMemoryFormat inMemoryFormat)
public NearCacheConfig(int timeToLiveSeconds,
                       int maxIdleSeconds,
                       boolean invalidateOnChange,
                       InMemoryFormat inMemoryFormat,
                       EvictionConfig evictionConfig)
public NearCacheConfig(int timeToLiveSeconds,
                       int maxSize,
                       String evictionPolicy,
                       int maxIdleSeconds,
                       boolean invalidateOnChange,
                       InMemoryFormat inMemoryFormat)
NearCacheConfig(int, int, boolean, InMemoryFormat)public NearCacheConfig(int timeToLiveSeconds,
                       int maxSize,
                       String evictionPolicy,
                       int maxIdleSeconds,
                       boolean invalidateOnChange,
                       InMemoryFormat inMemoryFormat,
                       EvictionConfig evictionConfig)
NearCacheConfig(int, int, boolean, InMemoryFormat, EvictionConfig)public NearCacheConfig(NearCacheConfig config)
public NearCacheConfigReadOnly getAsReadOnly()
public String getName()
public NearCacheConfig setName(String name)
name - The name of the Near Cache.public int getTimeToLiveSeconds()
public NearCacheConfig setTimeToLiveSeconds(int timeToLiveSeconds)
timeToLiveSeconds - The maximum number of seconds for each entry to stay in the Near Cache.public int getMaxSize()
getEvictionConfig() and EvictionConfig.getSize() insteadpublic NearCacheConfig setMaxSize(int maxSize)
setEvictionConfig(EvictionConfig) and EvictionConfig.setSize(int) insteadmaxSize - The maximum number of seconds for each entry to stay in the Near Cache.public String getEvictionPolicy()
getEvictionConfig() and EvictionConfig.getEvictionPolicy() insteadpublic NearCacheConfig setEvictionPolicy(String evictionPolicy)
setEvictionConfig(EvictionConfig)
 and EvictionConfig.setEvictionPolicy(EvictionPolicy) insteadevictionPolicy - The eviction policy for the Near Cache.public int getMaxIdleSeconds()
public NearCacheConfig setMaxIdleSeconds(int maxIdleSeconds)
maxIdleSeconds - Maximum number of seconds each entry can stay in the Near Cache as
                       untouched (not-read).public boolean isInvalidateOnChange()
public NearCacheConfig setInvalidateOnChange(boolean invalidateOnChange)
invalidateOnChange - True to evict the cached entries if the entries are
                           changed (updated or removed), false otherwise.public InMemoryFormat getInMemoryFormat()
public NearCacheConfig setInMemoryFormat(InMemoryFormat inMemoryFormat)
inMemoryFormat - The data type used to store entries.public boolean isCacheLocalEntries()
public NearCacheConfig setCacheLocalEntries(boolean cacheLocalEntries)
cacheLocalEntries - True to cache local entries also.public NearCacheConfig.LocalUpdatePolicy getLocalUpdatePolicy()
public NearCacheConfig setLocalUpdatePolicy(NearCacheConfig.LocalUpdatePolicy localUpdatePolicy)
public NearCacheConfig setInMemoryFormat(String inMemoryFormat)
public EvictionConfig getEvictionConfig()
public NearCacheConfig setEvictionConfig(EvictionConfig evictionConfig)
evictionConfig - The eviction configuration.public NearCachePreloaderConfig getPreloaderConfig()
public NearCacheConfig setPreloaderConfig(NearCachePreloaderConfig preloaderConfig)
public void writeData(ObjectDataOutput out) throws IOException
DataSerializablewriteData in interface DataSerializableout - outputIOExceptionpublic void readData(ObjectDataInput in) throws IOException
DataSerializablereadData in interface DataSerializablein - inputIOExceptionCopyright © 2016 Hazelcast, Inc.. All Rights Reserved.