Package org.cometd.websocket.client
Class JettyWebSocketTransport
- 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.JettyWebSocketTransport
-
- All Implemented Interfaces:
Transport
,MessageClientTransport
,org.eclipse.jetty.websocket.client.io.UpgradeListener
public class JettyWebSocketTransport extends AbstractWebSocketTransport implements org.eclipse.jetty.websocket.client.io.UpgradeListener
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JettyWebSocketTransport.Factory
protected class
JettyWebSocketTransport.JettyWebSocketDelegate
-
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
CONNECT_TIMEOUT_OPTION, COOKIE_HEADER, IDLE_TIMEOUT_OPTION, MAX_CLOSE_REASON_LENGTH, NAME, NORMAL_CLOSE_CODE, 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 JettyWebSocketTransport(String url, Map<String,Object> options, ScheduledExecutorService scheduler, org.eclipse.jetty.websocket.client.WebSocketClient webSocketClient)
JettyWebSocketTransport(Map<String,Object> options, ScheduledExecutorService scheduler, org.eclipse.jetty.websocket.client.WebSocketClient webSocketClient)
-
Method Summary
All Methods Instance Methods Concrete Methods 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(org.eclipse.jetty.websocket.client.WebSocketClient client, org.eclipse.jetty.websocket.client.ClientUpgradeRequest request, String uri)
void
init()
protected AbstractWebSocketTransport.Delegate
newDelegate()
void
onHandshakeRequest(org.eclipse.jetty.websocket.api.UpgradeRequest request)
void
onHandshakeResponse(org.eclipse.jetty.websocket.api.UpgradeResponse response)
-
Methods inherited from class org.cometd.websocket.client.common.AbstractWebSocketTransport
abort, getConnectTimeout, getDelegate, getIdleTimeout, getProtocol, isStickyReconnect, locked, locked, 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 Detail
-
JettyWebSocketTransport
public JettyWebSocketTransport(Map<String,Object> options, ScheduledExecutorService scheduler, org.eclipse.jetty.websocket.client.WebSocketClient webSocketClient)
-
JettyWebSocketTransport
public JettyWebSocketTransport(String url, Map<String,Object> options, ScheduledExecutorService scheduler, org.eclipse.jetty.websocket.client.WebSocketClient webSocketClient)
-
-
Method Detail
-
accept
public boolean accept(String version)
- 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(org.eclipse.jetty.websocket.client.WebSocketClient client, org.eclipse.jetty.websocket.client.ClientUpgradeRequest request, String uri) throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
newDelegate
protected AbstractWebSocketTransport.Delegate newDelegate()
-
onHandshakeRequest
public void onHandshakeRequest(org.eclipse.jetty.websocket.api.UpgradeRequest request)
- Specified by:
onHandshakeRequest
in interfaceorg.eclipse.jetty.websocket.client.io.UpgradeListener
-
onHandshakeResponse
public void onHandshakeResponse(org.eclipse.jetty.websocket.api.UpgradeResponse response)
- Specified by:
onHandshakeResponse
in interfaceorg.eclipse.jetty.websocket.client.io.UpgradeListener
-
-