Class OkHttpWebsocketTransport
- 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.okhttp.OkHttpWebsocketTransport
-
- All Implemented Interfaces:
Transport
,MessageClientTransport
public class OkHttpWebsocketTransport extends AbstractWebSocketTransport
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OkHttpWebsocketTransport.Factory
protected class
OkHttpWebsocketTransport.OkHttpDelegate
-
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 OkHttpWebsocketTransport(String uri, Map<String,Object> options, ScheduledExecutorService scheduler, okhttp3.OkHttpClient okHttpClient)
OkHttpWebsocketTransport(Map<String,Object> options, okhttp3.OkHttpClient okHttpClient)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(String s)
protected AbstractWebSocketTransport.Delegate
connect(String uri, TransportListener listener, List<Message.Mutable> messages)
static Map<String,List<String>>
headersToMap(okhttp3.Headers headers)
void
init()
protected OkHttpWebsocketTransport.OkHttpDelegate
newDelegate()
protected void
onHandshakeRequest(String uri, okhttp3.Request.Builder upgradeRequest)
protected void
onHandshakeResponse(okhttp3.Response 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
-
OkHttpWebsocketTransport
public OkHttpWebsocketTransport(Map<String,Object> options, okhttp3.OkHttpClient okHttpClient)
-
OkHttpWebsocketTransport
public OkHttpWebsocketTransport(String uri, Map<String,Object> options, ScheduledExecutorService scheduler, okhttp3.OkHttpClient okHttpClient)
-
-
Method Detail
-
init
public void init()
- Overrides:
init
in classAbstractWebSocketTransport
-
accept
public boolean accept(String s)
- Specified by:
accept
in classClientTransport
-
connect
protected AbstractWebSocketTransport.Delegate connect(String uri, TransportListener listener, List<Message.Mutable> messages)
- Specified by:
connect
in classAbstractWebSocketTransport
-
newDelegate
protected OkHttpWebsocketTransport.OkHttpDelegate newDelegate()
-
onHandshakeRequest
protected void onHandshakeRequest(String uri, okhttp3.Request.Builder upgradeRequest)
-
onHandshakeResponse
protected void onHandshakeResponse(okhttp3.Response response)
-
-