Fix Netty err with Redis?
This commit is contained in:
parent
f44e19f6d5
commit
32e8e2deb8
@ -19,7 +19,7 @@ import me.braydon.feather.database.IDatabase;
|
|||||||
* @see RedisURI for the credentials class
|
* @see RedisURI for the credentials class
|
||||||
* @see <a href="https://redis.io">Redis Official Site</a>
|
* @see <a href="https://redis.io">Redis Official Site</a>
|
||||||
*/
|
*/
|
||||||
public class Redis implements IDatabase<StatefulRedisConnection<String, String>, RedisURI> {
|
public class Redis implements IDatabase<StatefulRedisConnection<String, String>, String> {
|
||||||
/**
|
/**
|
||||||
* The current {@link RedisClient} instance.
|
* The current {@link RedisClient} instance.
|
||||||
*/
|
*/
|
||||||
@ -43,14 +43,13 @@ public class Redis implements IDatabase<StatefulRedisConnection<String, String>,
|
|||||||
/**
|
/**
|
||||||
* Initialize a connection to this database.
|
* Initialize a connection to this database.
|
||||||
*
|
*
|
||||||
* @param credentials the optional credentials to use
|
* @param uri the optional credentials to use
|
||||||
* @throws IllegalArgumentException if no credentials are provided
|
* @throws IllegalArgumentException if no credentials are provided
|
||||||
* @throws IllegalStateException if already connected
|
* @throws IllegalStateException if already connected
|
||||||
* @see RedisURI for credentials
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void connect(RedisURI credentials) throws IllegalArgumentException, IllegalStateException {
|
public void connect(String uri) throws IllegalArgumentException, IllegalStateException {
|
||||||
if (credentials == null) { // We need valid credentials
|
if (uri == null) { // We need valid credentials
|
||||||
throw new IllegalArgumentException("No credentials defined");
|
throw new IllegalArgumentException("No credentials defined");
|
||||||
}
|
}
|
||||||
if (isConnected()) { // Already connected
|
if (isConnected()) { // Already connected
|
||||||
@ -62,7 +61,7 @@ public class Redis implements IDatabase<StatefulRedisConnection<String, String>,
|
|||||||
if (connection != null) { // We have a connection, close it first
|
if (connection != null) { // We have a connection, close it first
|
||||||
connection.close();
|
connection.close();
|
||||||
}
|
}
|
||||||
client = RedisClient.create(credentials); // Create a new client
|
client = RedisClient.create(uri); // Create a new client
|
||||||
connection = client.connect(); // Connect to the Redis server
|
connection = client.connect(); // Connect to the Redis server
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user