Class WebSocketTransport
- java.lang.Object
-
- org.cometd.common.AbstractTransport
-
- org.cometd.client.transport.ClientTransport
-
- org.cometd.client.transport.HttpClientTransport
-
- org.cometd.client.websocket.common.AbstractWebSocketTransport
-
- org.cometd.client.websocket.javax.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
class
WebSocketTransport.WebSocketDelegate
-
Nested classes/interfaces inherited from class org.cometd.client.websocket.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.client.websocket.common.AbstractWebSocketTransport
CONNECT_TIMEOUT_OPTION, COOKIE_HEADER, IDLE_TIMEOUT_OPTION, MAX_CLOSE_REASON_LENGTH, NAME, NORMAL_CLOSE_CODE, PERMESSAGE_DEFLATE_OPTION, PREFIX, PROTOCOL_OPTION, STICKY_RECONNECT_OPTION
-
Fields inherited from class org.cometd.client.transport.ClientTransport
JSON_CONTEXT_OPTION, MAX_MESSAGE_SIZE_OPTION, MAX_NETWORK_DELAY_OPTION, MAX_SEND_BAYEUX_MESSAGE_SIZE_OPTION, SCHEDULER_OPTION, URL_OPTION
-
-
Constructor Summary
Constructors Constructor Description WebSocketTransport(java.lang.String url, java.util.Map<java.lang.String,java.lang.Object> options, java.util.concurrent.ScheduledExecutorService scheduler, javax.websocket.WebSocketContainer webSocketContainer)
WebSocketTransport(java.util.Map<java.lang.String,java.lang.Object> options, java.util.concurrent.ScheduledExecutorService scheduler, javax.websocket.WebSocketContainer webSocketContainer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(java.lang.String version)
protected AbstractWebSocketTransport.Delegate
connect(java.lang.String uri, TransportListener listener, java.util.List<Message.Mutable> messages)
protected AbstractWebSocketTransport.Delegate
connect(javax.websocket.WebSocketContainer container, javax.websocket.ClientEndpointConfig configuration, java.lang.String uri)
void
init()
protected WebSocketTransport.WebSocketDelegate
newDelegate()
protected void
onHandshakeRequest(java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers)
protected void
onHandshakeResponse(javax.websocket.HandshakeResponse response)
-
Methods inherited from class org.cometd.client.websocket.common.AbstractWebSocketTransport
abort, getConnectTimeout, getDelegate, getIdleTimeout, getProtocol, isPerMessageDeflateEnabled, isStickyReconnect, locked, locked, send, setMessageTransportListener, setURL, terminate
-
Methods inherited from class org.cometd.client.transport.HttpClientTransport
getCookies, getCookieStore, setCookieStore, storeCookies
-
Methods inherited from class org.cometd.client.transport.ClientTransport
generateJSON, getJSONContextClient, getMaxNetworkDelay, getScheduler, getURL, initScheduler, parseMessages, setMaxNetworkDelay, shutdownScheduler
-
Methods inherited from class org.cometd.common.AbstractTransport
getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefix
-
-
-
-
Constructor Detail
-
WebSocketTransport
public WebSocketTransport(java.util.Map<java.lang.String,java.lang.Object> options, java.util.concurrent.ScheduledExecutorService scheduler, javax.websocket.WebSocketContainer webSocketContainer)
-
WebSocketTransport
public WebSocketTransport(java.lang.String url, java.util.Map<java.lang.String,java.lang.Object> options, java.util.concurrent.ScheduledExecutorService scheduler, javax.websocket.WebSocketContainer webSocketContainer)
-
-
Method Detail
-
accept
public boolean accept(java.lang.String version)
- Specified by:
accept
in classClientTransport
-
init
public void init()
- Overrides:
init
in classAbstractWebSocketTransport
-
connect
protected AbstractWebSocketTransport.Delegate connect(java.lang.String uri, TransportListener listener, java.util.List<Message.Mutable> messages)
- Specified by:
connect
in classAbstractWebSocketTransport
-
connect
protected AbstractWebSocketTransport.Delegate connect(javax.websocket.WebSocketContainer container, javax.websocket.ClientEndpointConfig configuration, java.lang.String uri) throws java.io.IOException
- Throws:
java.io.IOException
-
newDelegate
protected WebSocketTransport.WebSocketDelegate newDelegate()
-
onHandshakeRequest
protected void onHandshakeRequest(java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers)
-
onHandshakeResponse
protected void onHandshakeResponse(javax.websocket.HandshakeResponse response)
-
-