public class Config extends Object
Modifier and Type | Method and Description |
---|---|
static Config |
fromJSON(File file)
Read config object stored in JSON format from
File |
static Config |
fromJSON(InputStream inputStream)
Read config object stored in JSON format from
InputStream |
static Config |
fromJSON(Reader reader)
Read config object stored in JSON format from
Reader |
static Config |
fromJSON(String content)
Read config object stored in JSON format from
String |
static Config |
fromJSON(URL url)
Read config object stored in JSON format from
URL |
static Config |
fromYAML(File file)
Read config object stored in YAML format from
File |
static Config |
fromYAML(InputStream inputStream)
Read config object stored in YAML format from
InputStream |
static Config |
fromYAML(Reader reader)
Read config object stored in YAML format from
Reader |
static Config |
fromYAML(String content)
Read config object stored in YAML format from
String |
static Config |
fromYAML(URL url)
Read config object stored in YAML format from
URL |
Codec |
getCodec() |
io.netty.channel.EventLoopGroup |
getEventLoopGroup() |
int |
getThreads() |
boolean |
isClusterConfig() |
boolean |
isUseLinuxNativeEpoll() |
Config |
setCodec(Codec codec)
Redis key/value codec.
|
Config |
setEventLoopGroup(io.netty.channel.EventLoopGroup eventLoopGroup)
Use external EventLoopGroup.
|
Config |
setThreads(int threads) |
Config |
setUseLinuxNativeEpoll(boolean useLinuxNativeEpoll)
Activates an unix socket if servers binded to loopback interface.
|
String |
toJSON()
Convert current configuration to JSON format
|
String |
toYAML()
Convert current configuration to YAML format
|
ClusterServersConfig |
useClusterServers()
Init cluster servers configuration
|
ClusterServersConfig |
useClusterServers(ClusterServersConfig config)
Init cluster servers configuration by config object.
|
ElasticacheServersConfig |
useElasticacheServers()
Init AWS Elasticache servers configuration.
|
ElasticacheServersConfig |
useElasticacheServers(ElasticacheServersConfig config)
Init AWS Elasticache servers configuration by config object.
|
MasterSlaveServersConfig |
useMasterSlaveServers()
Init master/slave servers configuration.
|
MasterSlaveServersConfig |
useMasterSlaveServers(MasterSlaveServersConfig config)
Init master/slave servers configuration by config object.
|
SentinelServersConfig |
useSentinelServers()
Init sentinel servers configuration.
|
SentinelServersConfig |
useSentinelServers(SentinelServersConfig sentinelServersConfig)
Init sentinel servers configuration by config object.
|
SingleServerConfig |
useSingleServer()
Init single server configuration.
|
SingleServerConfig |
useSingleServer(SingleServerConfig config)
Init single server configuration by config object.
|
public Config()
public Config(Config oldConf)
public Config setCodec(Codec codec)
Codec
public Codec getCodec()
public ClusterServersConfig useClusterServers()
public ClusterServersConfig useClusterServers(ClusterServersConfig config)
public ElasticacheServersConfig useElasticacheServers()
public ElasticacheServersConfig useElasticacheServers(ElasticacheServersConfig config)
public SingleServerConfig useSingleServer()
public SingleServerConfig useSingleServer(SingleServerConfig config)
public SentinelServersConfig useSentinelServers()
public SentinelServersConfig useSentinelServers(SentinelServersConfig sentinelServersConfig)
public MasterSlaveServersConfig useMasterSlaveServers()
public MasterSlaveServersConfig useMasterSlaveServers(MasterSlaveServersConfig config)
public boolean isClusterConfig()
public int getThreads()
public Config setThreads(int threads)
public Config setUseLinuxNativeEpoll(boolean useLinuxNativeEpoll)
useLinuxNativeEpoll
- public boolean isUseLinuxNativeEpoll()
public Config setEventLoopGroup(io.netty.channel.EventLoopGroup eventLoopGroup)
EpollEventLoopGroup
or
NioEventLoopGroup
can be used.eventLoopGroup
- public io.netty.channel.EventLoopGroup getEventLoopGroup()
public static Config fromJSON(String content) throws IOException
String
content
- IOException
public static Config fromJSON(InputStream inputStream) throws IOException
InputStream
inputStream
- IOException
public static Config fromJSON(File file) throws IOException
File
file
- IOException
public static Config fromJSON(URL url) throws IOException
URL
url
- IOException
public static Config fromJSON(Reader reader) throws IOException
Reader
reader
- IOException
public String toJSON() throws IOException
IOException
public static Config fromYAML(String content) throws IOException
String
content
- IOException
public static Config fromYAML(InputStream inputStream) throws IOException
InputStream
inputStream
- IOException
public static Config fromYAML(File file) throws IOException
File
file
- IOException
public static Config fromYAML(URL url) throws IOException
URL
url
- IOException
public static Config fromYAML(Reader reader) throws IOException
Reader
reader
- IOException
public String toYAML() throws IOException
IOException
Copyright © 2014–2016. All rights reserved.