com.pusher.client.connection.websocket
Class WebSocketClientWrapper
java.lang.Object
org.java_websocket.WebSocketAdapter
org.java_websocket.client.WebSocketClient
com.pusher.client.connection.websocket.WebSocketClientWrapper
- All Implemented Interfaces:
- Runnable, WebSocketListener
public class WebSocketClientWrapper
- extends WebSocketClient
A thin wrapper around the WebSocketClient class from the Java-WebSocket library. The purpose of this
class is to enable the WebSocketConnection class to be unit tested by swapping out an instance of
this wrapper for a mock version.
Methods inherited from class org.java_websocket.client.WebSocketClient |
close, closeBlocking, connect, connectBlocking, createProxyChannel, getConnection, getDraft, getLocalSocketAddress, getReadyState, getRemoteSocketAddress, getURI, getWebSocketFactory, onCloseInitiated, onClosing, onMessage, onWebsocketClose, onWebsocketCloseInitiated, onWebsocketClosing, onWebsocketError, onWebsocketMessage, onWebsocketMessage, onWebsocketOpen, onWriteDemand, run, send, send, setProxy, setWebSocketFactory |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WebSocketClientWrapper
public WebSocketClientWrapper(URI uri,
WebSocketListener proxy)
throws SSLException
- Throws:
SSLException
onOpen
public void onOpen(ServerHandshake handshakedata)
- Specified by:
onOpen
in class WebSocketClient
onMessage
public void onMessage(String message)
- Specified by:
onMessage
in class WebSocketClient
onClose
public void onClose(int code,
String reason,
boolean remote)
- Specified by:
onClose
in class WebSocketClient
onError
public void onError(Exception ex)
- Specified by:
onError
in class WebSocketClient
Copyright © 2013 Pusher. All Rights Reserved.