Package com.predic8.membrane.core.util
Class RedisConnector
java.lang.Object
com.predic8.membrane.core.util.RedisConnector
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
public class RedisConnector
extends Object
implements org.springframework.beans.factory.InitializingBean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidintintgetHost()redis.clients.jedis.Jedisintredis.clients.jedis.params.GetExParamsredis.clients.jedis.JedisPoolgetPool()intgetPort()intgetUser()booleanisSsl()booleanvoidsetConnectionNumber(int connectionNumber) voidsetDbNumber(int dbNumber) voidvoidsetMasterName(String masterName) The name of the master node to use when using Redis Sentinels.voidsetMinIdleConnection(int minIdleConnection) voidsetParams(redis.clients.jedis.params.GetExParams params) voidsetPassword(String password) voidsetPort(int port) voidsetSsl(boolean ssl) voidsetTimeout(int timeout) voidvoidsetUseSentinels(boolean useSentinels) Whether to use Redis Sentinels to discover the master Redis node.
-
Constructor Details
-
RedisConnector
public RedisConnector()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
getJedisWithDb
public redis.clients.jedis.Jedis getJedisWithDb() -
getPool
public redis.clients.jedis.JedisPool getPool() -
getConnectionNumber
public int getConnectionNumber() -
setConnectionNumber
public void setConnectionNumber(int connectionNumber) -
getMinIdleConnection
public int getMinIdleConnection() -
setMinIdleConnection
public void setMinIdleConnection(int minIdleConnection) -
getParams
public redis.clients.jedis.params.GetExParams getParams() -
setParams
public void setParams(redis.clients.jedis.params.GetExParams params) -
getTimeout
public int getTimeout() -
setTimeout
public void setTimeout(int timeout) - Description
- Timeout value when connecting to Redis instance. Default is 10000 milliseconds. Unit is in milliseconds
-
getUser
-
setUser
- Description
- Username to use when connecting redis.
-
getPassword
-
setPassword
- Description
- Password to use when connecting redis.
-
isSsl
public boolean isSsl() -
setSsl
public void setSsl(boolean ssl) - Description
- Used for enabling ssl. Default value is false
-
getHost
-
setHost
- Description
- Host name to connect to, or multiple host names separated by spaces ' '.
-
getPort
public int getPort() -
setPort
public void setPort(int port) - Description
- Port number to connect to
-
getDbNumber
public int getDbNumber() -
setDbNumber
public void setDbNumber(int dbNumber) - Description
- Database number to use
-
isUseSentinels
public boolean isUseSentinels() -
setUseSentinels
public void setUseSentinels(boolean useSentinels) Whether to use Redis Sentinels to discover the master Redis node. When this is used, the host and port properties are used to specify the sentinels.- Default
- false
-
getMasterName
-
setMasterName
The name of the master node to use when using Redis Sentinels.- Default
- mymaster
-