|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ning.http.client.websocket.DefaultWebSocketListener
public class DefaultWebSocketListener
Default WebSocketListener implementation. Most methods are no-ops. This allows for quick override customization without clutter of methods that the developer isn't interested in dealing with.
Field Summary | |
---|---|
protected WebSocket |
webSocket
|
Constructor Summary | |
---|---|
DefaultWebSocketListener()
|
Method Summary | |
---|---|
void |
onClose(WebSocket websocket)
Invoked when the WebSocket is close. |
void |
onError(Throwable t)
Invoked when the WebSocket is open. |
void |
onFragment(byte[] fragment,
boolean last)
Invoked when bytes of a fragmented message are available. |
void |
onFragment(String fragment,
boolean last)
Invoked when WebSocket text fragments are received. |
void |
onMessage(byte[] message)
Invoked when bytes are available. |
void |
onMessage(String message)
Invoked when WebSocket text message are received. |
void |
onOpen(WebSocket websocket)
Invoked when the WebSocket is open. |
void |
onPing(byte[] message)
Invoked when a ping message is received |
void |
onPong(byte[] message)
Invoked when a pong message is received |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected WebSocket webSocket
Constructor Detail |
---|
public DefaultWebSocketListener()
Method Detail |
---|
public void onMessage(byte[] message)
onMessage
in interface WebSocketByteListener
message
- a byte array.public void onFragment(byte[] fragment, boolean last)
onFragment
in interface WebSocketByteListener
fragment
- byte[] fragment.last
- if this fragment is the last in the series.public void onPing(byte[] message)
onPing
in interface WebSocketPingListener
message
- a byte arraypublic void onPong(byte[] message)
onPong
in interface WebSocketPongListener
message
- a byte arraypublic void onMessage(String message)
onMessage
in interface WebSocketTextListener
message
- a String
messagepublic void onFragment(String fragment, boolean last)
onFragment
in interface WebSocketTextListener
fragment
- text fragmentlast
- if this fragment is the last of the series.public void onOpen(WebSocket websocket)
WebSocket
is open.
onOpen
in interface WebSocketListener
public void onClose(WebSocket websocket)
WebSocket
is close.
onClose
in interface WebSocketListener
public void onError(Throwable t)
WebSocket
is open.
onError
in interface WebSocketListener
t
- a Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |