Package org.cometd.websocket.client
Class WebSocketTransport
java.lang.Object
org.cometd.common.AbstractTransport
org.cometd.client.transport.ClientTransport
org.cometd.client.transport.HttpClientTransport
org.cometd.websocket.client.common.AbstractWebSocketTransport
org.cometd.websocket.client.WebSocketTransport
- All Implemented Interfaces:
Transport
,MessageClientTransport
public class WebSocketTransport extends AbstractWebSocketTransport
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WebSocketTransport.Factory
protected class
WebSocketTransport.WebSocketDelegate
Nested classes/interfaces inherited from class org.cometd.websocket.client.common.AbstractWebSocketTransport
AbstractWebSocketTransport.Delegate
Nested classes/interfaces inherited from class org.cometd.client.transport.ClientTransport
ClientTransport.FailureHandler, ClientTransport.FailureInfo
-
Field Summary
Fields inherited from class org.cometd.websocket.client.common.AbstractWebSocketTransport
_lock, CONNECT_TIMEOUT_OPTION, IDLE_TIMEOUT_OPTION, NAME, PREFIX, PROTOCOL_OPTION, STICKY_RECONNECT_OPTION
Fields inherited from class org.cometd.client.transport.ClientTransport
JSON_CONTEXT_OPTION, logger, MAX_MESSAGE_SIZE_OPTION, MAX_NETWORK_DELAY_OPTION, SCHEDULER_OPTION, URL_OPTION
-
Constructor Summary
Constructors Constructor Description WebSocketTransport(String url, Map<String,Object> options, ScheduledExecutorService scheduler, javax.websocket.WebSocketContainer webSocketContainer)
WebSocketTransport(Map<String,Object> options, ScheduledExecutorService scheduler, javax.websocket.WebSocketContainer webSocketContainer)
-
Method Summary
Modifier and Type Method Description boolean
accept(String version)
protected AbstractWebSocketTransport.Delegate
connect(String uri, TransportListener listener, List<Message.Mutable> messages)
protected AbstractWebSocketTransport.Delegate
connect(javax.websocket.WebSocketContainer container, javax.websocket.ClientEndpointConfig configuration, String uri)
void
init()
protected WebSocketTransport.WebSocketDelegate
newDelegate()
protected void
onHandshakeRequest(Map<String,List<String>> headers)
protected void
onHandshakeResponse(javax.websocket.HandshakeResponse response)
Methods inherited from class org.cometd.websocket.client.common.AbstractWebSocketTransport
abort, getConnectTimeout, getDelegate, getIdleTimeout, getProtocol, isStickyReconnect, send, setMessageTransportListener, setURL, storeCookies, terminate
Methods inherited from class org.cometd.client.transport.HttpClientTransport
getCookies, getCookieStore, setCookieStore, storeCookies
Methods inherited from class org.cometd.client.transport.ClientTransport
generateJSON, getMaxNetworkDelay, getURL, parseMessages, setMaxNetworkDelay
Methods inherited from class org.cometd.common.AbstractTransport
getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefix
-
Constructor Details
-
WebSocketTransport
public WebSocketTransport(Map<String,Object> options, ScheduledExecutorService scheduler, javax.websocket.WebSocketContainer webSocketContainer) -
WebSocketTransport
public WebSocketTransport(String url, Map<String,Object> options, ScheduledExecutorService scheduler, javax.websocket.WebSocketContainer webSocketContainer)
-
-
Method Details
-
accept
- Specified by:
accept
in classClientTransport
-
init
public void init()- Overrides:
init
in classAbstractWebSocketTransport
-
connect
protected AbstractWebSocketTransport.Delegate connect(String uri, TransportListener listener, List<Message.Mutable> messages)- Specified by:
connect
in classAbstractWebSocketTransport
-
connect
protected AbstractWebSocketTransport.Delegate connect(javax.websocket.WebSocketContainer container, javax.websocket.ClientEndpointConfig configuration, String uri) throws IOException- Throws:
IOException
-
newDelegate
-
onHandshakeRequest
-
onHandshakeResponse
protected void onHandshakeResponse(javax.websocket.HandshakeResponse response)
-