public class FeedCommProcessor extends Object implements com.squareup.okhttp.ws.WebSocketListener
| Constructor and Description |
|---|
FeedCommProcessor(HttpClientBuilder httpClientBuilder,
MonitorServiceConfiguration config,
String feedId,
MonitorService discoveryService) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Connects to the websocket endpoint.
|
void |
destroy()
Call this when you know this processor object will never be used again.
|
void |
disconnect() |
boolean |
isConnected() |
void |
onClose(int reasonCode,
String reason) |
void |
onFailure(IOException e,
com.squareup.okhttp.Response response) |
void |
onMessage(okio.BufferedSource payload,
com.squareup.okhttp.ws.WebSocket.PayloadType payloadType) |
void |
onOpen(com.squareup.okhttp.ws.WebSocket webSocket,
com.squareup.okhttp.Response response) |
void |
onPong(okio.Buffer buffer) |
void |
sendAsync(org.hawkular.bus.common.BasicMessageWithExtraData<? extends org.hawkular.bus.common.BasicMessage> messageWithData)
Sends a message to the server asynchronously.
|
void |
sendSync(org.hawkular.bus.common.BasicMessageWithExtraData<? extends org.hawkular.bus.common.BasicMessage> messageWithData)
Sends a message to the server synchronously.
|
public FeedCommProcessor(HttpClientBuilder httpClientBuilder, MonitorServiceConfiguration config, String feedId, MonitorService discoveryService)
public boolean isConnected()
public void connect()
throws Exception
destroyed, then the connect request is ignored.Exception - on failurepublic void disconnect()
public void destroy()
public void sendAsync(org.hawkular.bus.common.BasicMessageWithExtraData<? extends org.hawkular.bus.common.BasicMessage> messageWithData)
message - the message to sendpublic void sendSync(org.hawkular.bus.common.BasicMessageWithExtraData<? extends org.hawkular.bus.common.BasicMessage> messageWithData)
throws Exception
message - the message to sendIOException - if the message failed to be sentExceptionpublic void onOpen(com.squareup.okhttp.ws.WebSocket webSocket,
com.squareup.okhttp.Response response)
onOpen in interface com.squareup.okhttp.ws.WebSocketListenerpublic void onClose(int reasonCode,
String reason)
onClose in interface com.squareup.okhttp.ws.WebSocketListenerpublic void onFailure(IOException e, com.squareup.okhttp.Response response)
onFailure in interface com.squareup.okhttp.ws.WebSocketListenerpublic void onMessage(okio.BufferedSource payload,
com.squareup.okhttp.ws.WebSocket.PayloadType payloadType)
throws IOException
onMessage in interface com.squareup.okhttp.ws.WebSocketListenerIOExceptionpublic void onPong(okio.Buffer buffer)
onPong in interface com.squareup.okhttp.ws.WebSocketListenerCopyright © 2015–2016 Red Hat, Inc.. All rights reserved.