public class ConnectionManager extends Object
| Modifier and Type | Field and Description |
|---|---|
protected DataSiftConfig |
config |
protected boolean |
connected |
protected static boolean |
CONNECTION_DETECTOR_RUNNING |
static int |
CONNECTION_TIMEOUT |
static int |
CONNECTION_TIMEOUT_LIMIT |
static Set<com.datasift.client.stream.DataSiftConnection> |
connections |
static boolean |
detectDeadConnection |
protected URI |
endpoint |
protected ErrorListener |
errorListener |
protected org.slf4j.Logger |
log |
protected int |
MAX_STREAMS_PER_CONNECTION |
protected StreamEventListener |
streamEventListener |
| Constructor and Description |
|---|
ConnectionManager(DataSiftConfig config) |
| Modifier and Type | Method and Description |
|---|---|
static void |
detectDeadConnections()
Starts a thread which checks periodically for dead connections and force them to re-connect.
|
protected com.datasift.client.stream.DataSiftConnection |
obtainConnectionFor(Stream stream) |
ConnectionManager |
onError(ErrorListener listener)
Subscribes a callback to listen for exceptions that may occur during streaming.
|
void |
onStreamEvent(StreamEventListener streamEventListener) |
ConnectionManager |
subscribe(StreamSubscription subscription) |
ConnectionManager |
unsubscribe(Stream stream) |
protected URI endpoint
protected DataSiftConfig config
protected ErrorListener errorListener
protected StreamEventListener streamEventListener
protected boolean connected
public static boolean detectDeadConnection
public static int CONNECTION_TIMEOUT_LIMIT
public static int CONNECTION_TIMEOUT
protected static boolean CONNECTION_DETECTOR_RUNNING
protected org.slf4j.Logger log
public static final Set<com.datasift.client.stream.DataSiftConnection> connections
protected final int MAX_STREAMS_PER_CONNECTION
public ConnectionManager(DataSiftConfig config)
public static void detectDeadConnections()
protected com.datasift.client.stream.DataSiftConnection obtainConnectionFor(Stream stream)
public ConnectionManager onError(ErrorListener listener)
listener - an error callbackpublic void onStreamEvent(StreamEventListener streamEventListener)
public ConnectionManager subscribe(StreamSubscription subscription)
public ConnectionManager unsubscribe(Stream stream)
Copyright © 2015. All Rights Reserved.