Package com.blackrook.redis
Class RedisInfo
- java.lang.Object
-
- com.blackrook.redis.RedisInfo
-
public class RedisInfo extends Object
Contains info about a single Redis server.- Author:
- Matthew Tropiano
-
-
Constructor Summary
Constructors Constructor Description RedisInfo(String host, int port)
Creates a Redis info object, no timeout, nor password.RedisInfo(String host, int port, int db)
Creates a Redis info object, no timeout, nor password.RedisInfo(String host, int port, int db, int timeout)
Creates a Redis info object, no password.RedisInfo(String host, int port, String password)
Creates a Redis info object, no timeout.RedisInfo(String host, int port, String password, int db)
Creates a Redis info object, no timeout.RedisInfo(String host, int port, String password, int db, int timeout)
Creates a Redis info object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDB()
String
getHost()
String
getPassword()
int
getPort()
int
getTimeout()
-
-
-
Constructor Detail
-
RedisInfo
public RedisInfo(String host, int port)
Creates a Redis info object, no timeout, nor password.- Parameters:
host
- the server hostname or address.port
- the server connection port.
-
RedisInfo
public RedisInfo(String host, int port, String password)
Creates a Redis info object, no timeout.- Parameters:
host
- the server hostname or address.port
- the server connection port.password
- the server database password.
-
RedisInfo
public RedisInfo(String host, int port, int db)
Creates a Redis info object, no timeout, nor password.- Parameters:
host
- the server hostname or address.port
- the server connection port.db
- the database index.
-
RedisInfo
public RedisInfo(String host, int port, String password, int db)
Creates a Redis info object, no timeout.- Parameters:
host
- the server hostname or address.port
- the server connection port.password
- the server database password.db
- the database index.
-
RedisInfo
public RedisInfo(String host, int port, int db, int timeout)
Creates a Redis info object, no password.- Parameters:
host
- the server hostname or address.port
- the server connection port.db
- the database index.timeout
- the server socket connection timeout in milliseconds. 0 is no timeout.
-
RedisInfo
public RedisInfo(String host, int port, String password, int db, int timeout)
Creates a Redis info object.- Parameters:
host
- the server hostname or address.port
- the server connection port.password
- the server database password.db
- the database to use for this connection.timeout
- the server socket connection timeout in milliseconds. 0 is no timeout.
-
-
Method Detail
-
getHost
public String getHost()
- Returns:
- the server hostname or address
-
getPort
public int getPort()
- Returns:
- the server connection port.
-
getPassword
public String getPassword()
- Returns:
- the server database password. If null, no password is submitted.
-
getTimeout
public int getTimeout()
- Returns:
- Gets the server connection timeout in milliseconds. 0 is no timeout.
-
getDB
public int getDB()
- Returns:
- the database id for the connection to use.
-
-