// Path: src/main/java/com/officedrop/redis/failover/jedis/ConnectionException.java
// public class ConnectionException extends RuntimeException {
// 
//     public ConnectionException(final Throwable cause) {
//         super(cause);
//     }
// 
// }
// 
// Path: src/main/java/com/officedrop/redis/failover/jedis/JedisActions.java
// public interface JedisActions extends JedisCommands {
// 
//     public Long del(final String... keys);
// 
//     public String quit();
// 
//     public String ping();
// 
//     public String slaveof(final String host, final int port);
// 
//     public String slaveofNoOne();
// 
//     public String info();
// 
// }
// 
// Path: src/main/java/com/officedrop/redis/failover/jedis/JedisClientFactory.java
// public interface JedisClientFactory {
// 
//     public JedisClient create( HostConfiguration configuration  );
// 
// }


import com.officedrop.redis.failover.jedis.ConnectionException;
import com.officedrop.redis.failover.jedis.JedisActions;
import com.officedrop.redis.failover.jedis.JedisClientFactory;
import com.officedrop.redis.failover.utils.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.StringReader;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;
package com.officedrop.redis.failover;



/**
 * User: Maurício Linhares
 * Date: 12/24/12
 * Time: 6:22 PM
 */
public class Node {

    private static final Logger log = LoggerFactory.getLogger(Node.class);

    private JedisActions client;
    private volatile int currentErrorCount = 0;
    private volatile boolean shutdown;
    private final long sleepDelay;
    private final List<NodeListener> listeners = new CopyOnWriteArrayList<NodeListener>();
    private final int maxErrors;
// Path: src/main/java/com/officedrop/redis/failover/jedis/ConnectionException.java
// public class ConnectionException extends RuntimeException {
// 
//     public ConnectionException(final Throwable cause) {
//         super(cause);
//     }
// 
// }
// 
// Path: src/main/java/com/officedrop/redis/failover/jedis/JedisActions.java
// public interface JedisActions extends JedisCommands {
// 
//     public Long del(final String... keys);
// 
//     public String quit();
// 
//     public String ping();
// 
//     public String slaveof(final String host, final int port);
// 
//     public String slaveofNoOne();
// 
//     public String info();
// 
// }
// 
// Path: src/main/java/com/officedrop/redis/failover/jedis/JedisClientFactory.java
// public interface JedisClientFactory {
// 
//     public JedisClient create( HostConfiguration configuration  );
// 
// }


// Path: src/main/java/com/officedrop/redis/failover/Node.java
import com.officedrop.redis.failover.jedis.ConnectionException;
import com.officedrop.redis.failover.jedis.JedisActions;
import com.officedrop.redis.failover.jedis.JedisClientFactory;
import com.officedrop.redis.failover.utils.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.StringReader;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;

package com.officedrop.redis.failover;



/**
 * User: Maurício Linhares
 * Date: 12/24/12
 * Time: 6:22 PM
 */
public class Node {

    private static final Logger log = LoggerFactory.getLogger(Node.class);

    private JedisActions client;
    private volatile int currentErrorCount = 0;
    private volatile boolean shutdown;
    private final long sleepDelay;
    private final List<NodeListener> listeners = new CopyOnWriteArrayList<NodeListener>();
    private final int maxErrors;
    private final HostConfiguration hostConfiguration;