public class CacheConfig extends Object
Constructor and Description |
---|
CacheConfig()
Creates config object with
ttl = 0 and maxIdleTime = 0 . |
CacheConfig(long ttl,
long maxIdleTime)
Creates config object.
|
Modifier and Type | Method and Description |
---|---|
static Map<String,CacheConfig> |
fromJSON(File file)
Read config objects stored in JSON format from
File |
static Map<String,CacheConfig> |
fromJSON(InputStream inputStream)
Read config objects stored in JSON format from
InputStream |
static Map<String,CacheConfig> |
fromJSON(Reader reader)
Read config objects stored in JSON format from
Reader |
static Map<String,CacheConfig> |
fromJSON(String content)
Read config objects stored in JSON format from
String |
static Map<String,CacheConfig> |
fromJSON(URL url)
Read config objects stored in JSON format from
URL |
static Map<String,CacheConfig> |
fromYAML(File file)
Read config objects stored in YAML format from
File |
static Map<String,CacheConfig> |
fromYAML(InputStream inputStream)
Read config objects stored in YAML format from
InputStream |
static Map<String,CacheConfig> |
fromYAML(Reader reader)
Read config objects stored in YAML format from
Reader |
static Map<String,CacheConfig> |
fromYAML(String content)
Read config objects stored in YAML format from
String |
static Map<String,CacheConfig> |
fromYAML(URL url)
Read config objects stored in YAML format from
URL |
long |
getMaxIdleTime() |
long |
getTTL() |
void |
setMaxIdleTime(long maxIdleTime)
Set max idle time for key\value entry in milliseconds.
|
void |
setTTL(long ttl)
Set time to live for key\value entry in milliseconds.
|
static String |
toJSON(Map<String,CacheConfig> config)
Convert current configuration to JSON format
|
static String |
toYAML(Map<String,CacheConfig> config)
Convert current configuration to YAML format
|
public CacheConfig()
ttl = 0
and maxIdleTime = 0
.public CacheConfig(long ttl, long maxIdleTime)
ttl
- - time to live for key\value entry in milliseconds.
If 0
then time to live doesn't affect entry expiration.maxIdleTime
- - max idle time for key\value entry in milliseconds.
if maxIdleTime
and ttl
params are equal to 0
then entry stores infinitely.
public long getTTL()
public void setTTL(long ttl)
ttl
- - time to live for key\value entry in milliseconds.
If 0
then time to live doesn't affect entry expiration.public long getMaxIdleTime()
public void setMaxIdleTime(long maxIdleTime)
maxIdleTime
- - max idle time for key\value entry in milliseconds.
If 0
then max idle time doesn't affect entry expiration.public static Map<String,CacheConfig> fromJSON(String content) throws IOException
String
content
- of configIOException
- errorpublic static Map<String,CacheConfig> fromJSON(InputStream inputStream) throws IOException
InputStream
inputStream
- of configIOException
- errorpublic static Map<String,CacheConfig> fromJSON(File file) throws IOException
File
file
- of configIOException
- errorpublic static Map<String,CacheConfig> fromJSON(URL url) throws IOException
URL
url
- of configIOException
- errorpublic static Map<String,CacheConfig> fromJSON(Reader reader) throws IOException
Reader
reader
- of configIOException
- errorpublic static String toJSON(Map<String,CacheConfig> config) throws IOException
config
- objectIOException
- errorpublic static Map<String,CacheConfig> fromYAML(String content) throws IOException
String
content
- of configIOException
- errorpublic static Map<String,CacheConfig> fromYAML(InputStream inputStream) throws IOException
InputStream
inputStream
- of configIOException
- errorpublic static Map<String,CacheConfig> fromYAML(File file) throws IOException
File
file
- of configIOException
- errorpublic static Map<String,CacheConfig> fromYAML(URL url) throws IOException
URL
url
- of configIOException
- errorpublic static Map<String,CacheConfig> fromYAML(Reader reader) throws IOException
Reader
reader
- of configIOException
- errorpublic static String toYAML(Map<String,CacheConfig> config) throws IOException
config
- mapIOException
- errorCopyright © 2014–2017 The Redisson Project. All rights reserved.