Package org.cometd.client.http.okhttp
Class OkHttpClientTransport
- java.lang.Object
-
- org.cometd.common.AbstractTransport
-
- org.cometd.client.transport.ClientTransport
-
- org.cometd.client.transport.HttpClientTransport
-
- org.cometd.client.http.common.AbstractHttpClientTransport
-
- org.cometd.client.http.okhttp.OkHttpClientTransport
-
- All Implemented Interfaces:
Transport
public class OkHttpClientTransport extends AbstractHttpClientTransport
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OkHttpClientTransport.Factory
-
Nested classes/interfaces inherited from class org.cometd.client.transport.ClientTransport
ClientTransport.FailureHandler, ClientTransport.FailureInfo
-
-
Field Summary
-
Fields inherited from class org.cometd.client.http.common.AbstractHttpClientTransport
NAME, PREFIX
-
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 OkHttpClientTransport(java.lang.String url, java.util.Map<java.lang.String,java.lang.Object> options, java.util.concurrent.ScheduledExecutorService scheduler, okhttp3.OkHttpClient client)
OkHttpClientTransport(java.lang.String url, java.util.Map<java.lang.String,java.lang.Object> options, okhttp3.OkHttpClient client)
OkHttpClientTransport(java.util.Map<java.lang.String,java.lang.Object> options, okhttp3.OkHttpClient client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abort(java.lang.Throwable failure)
Aborts this transport, usually by cancelling all pending Bayeux messages that require a response, such as/meta/connect
s, without waiting for a response.protected void
customize(okhttp3.Request.Builder request, Promise<okhttp3.Request.Builder> promise)
protected okhttp3.OkHttpClient
getOkHttpClient()
void
init()
void
send(TransportListener listener, java.util.List<Message.Mutable> messages)
-
Methods inherited from class org.cometd.client.http.common.AbstractHttpClientTransport
accept, calculateMaxNetworkDelay, getAdvice, getMaxMessageSize, isAborted, isAppendMessageType, newRequestURI, processResponseContent, processResponseMessages, processWrongResponseCode, setAdvice, 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, setURL, shutdownScheduler
-
Methods inherited from class org.cometd.common.AbstractTransport
getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefix
-
-
-
-
Constructor Detail
-
OkHttpClientTransport
public OkHttpClientTransport(java.util.Map<java.lang.String,java.lang.Object> options, okhttp3.OkHttpClient client)
-
OkHttpClientTransport
public OkHttpClientTransport(java.lang.String url, java.util.Map<java.lang.String,java.lang.Object> options, okhttp3.OkHttpClient client)
-
OkHttpClientTransport
public OkHttpClientTransport(java.lang.String url, java.util.Map<java.lang.String,java.lang.Object> options, java.util.concurrent.ScheduledExecutorService scheduler, okhttp3.OkHttpClient client)
-
-
Method Detail
-
getOkHttpClient
protected okhttp3.OkHttpClient getOkHttpClient()
-
init
public void init()
- Overrides:
init
in classAbstractHttpClientTransport
-
abort
public void abort(java.lang.Throwable failure)
Description copied from class:ClientTransport
Aborts this transport, usually by cancelling all pending Bayeux messages that require a response, such as/meta/connect
s, without waiting for a response.- Overrides:
abort
in classAbstractHttpClientTransport
- Parameters:
failure
- the cause of the abort- See Also:
BayeuxClient.abort()
-
send
public void send(TransportListener listener, java.util.List<Message.Mutable> messages)
- Specified by:
send
in classClientTransport
-
customize
protected void customize(okhttp3.Request.Builder request, Promise<okhttp3.Request.Builder> promise)
-
-