public class StreamingData extends Object implements io.higgs.ws.client.WebSocketEventListener
| Modifier and Type | Field and Description |
|---|---|
protected DataSiftConfig |
config |
protected boolean |
connected |
static int |
CONNECTION_TIMEOUT |
static int |
CONNECTION_TIMEOUT_LIMIT |
protected short |
currentTimeout |
static boolean |
detectDeadConnection |
protected URI |
endpoint |
protected ErrorListener |
errorListener |
protected org.joda.time.DateTime |
lastSeen |
protected io.higgs.ws.client.WebSocketStream |
liveStream |
protected org.slf4j.Logger |
log |
protected short |
MAX_TIMEOUT |
protected StreamEventListener |
streamEventListener |
protected static Set<StreamingData> |
streams |
protected Map<Stream,StreamSubscription> |
subscriptions |
protected Set<StreamSubscription> |
unsentSubscriptions |
| Constructor and Description |
|---|
StreamingData(DataSiftConfig config) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
connect() |
protected void |
fireError(Throwable e) |
protected void |
fireInteraction(String hash,
Interaction interaction) |
protected void |
fireMessage(DataSiftMessage message) |
void |
onClose(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.websocketx.CloseWebSocketFrame frame) |
void |
onConnect(io.netty.channel.ChannelHandlerContext ctx) |
void |
onError(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause,
io.netty.handler.codec.http.FullHttpResponse response) |
StreamingData |
onError(ErrorListener listener)
Subscribes a callback to listen for exceptions that may occur during streaming.
|
void |
onMessage(io.netty.channel.ChannelHandlerContext ctx,
io.higgs.ws.client.WebSocketMessage msg) |
void |
onPing(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.websocketx.PingWebSocketFrame frame) |
void |
onStreamEvent(StreamEventListener streamEventListener) |
protected void |
pushUnsentSubscriptions() |
StreamingData |
subscribe(StreamSubscription subscription) |
StreamingData |
unsubscribe(Stream stream) |
protected URI endpoint
protected io.higgs.ws.client.WebSocketStream liveStream
protected DataSiftConfig config
protected Map<Stream,StreamSubscription> subscriptions
protected ErrorListener errorListener
protected StreamEventListener streamEventListener
protected boolean connected
protected Set<StreamSubscription> unsentSubscriptions
protected short MAX_TIMEOUT
protected short currentTimeout
protected org.joda.time.DateTime lastSeen
protected static Set<StreamingData> streams
public static boolean detectDeadConnection
public static int CONNECTION_TIMEOUT_LIMIT
public static int CONNECTION_TIMEOUT
protected org.slf4j.Logger log
public StreamingData(DataSiftConfig config)
public void onConnect(io.netty.channel.ChannelHandlerContext ctx)
onConnect in interface io.higgs.ws.client.WebSocketEventListenerpublic void onClose(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.websocketx.CloseWebSocketFrame frame)
onClose in interface io.higgs.ws.client.WebSocketEventListenerpublic void onPing(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.websocketx.PingWebSocketFrame frame)
onPing in interface io.higgs.ws.client.WebSocketEventListenerpublic void onMessage(io.netty.channel.ChannelHandlerContext ctx,
io.higgs.ws.client.WebSocketMessage msg)
onMessage in interface io.higgs.ws.client.WebSocketEventListenerpublic void onError(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause,
io.netty.handler.codec.http.FullHttpResponse response)
onError in interface io.higgs.ws.client.WebSocketEventListenerprotected void connect()
protected void fireInteraction(String hash, Interaction interaction)
protected void fireMessage(DataSiftMessage message)
protected void fireError(Throwable e)
public StreamingData onError(ErrorListener listener)
listener - an error callbackpublic void onStreamEvent(StreamEventListener streamEventListener)
public StreamingData subscribe(StreamSubscription subscription)
protected void pushUnsentSubscriptions()
public StreamingData unsubscribe(Stream stream)
Copyright © 2014. All Rights Reserved.