public class OkHttpClientTransport extends AbstractHttpClientTransport
Modifier and Type | Class and Description |
---|---|
static class |
OkHttpClientTransport.Factory |
ClientTransport.FailureHandler, ClientTransport.FailureInfo
NAME, PREFIX
JSON_CONTEXT_OPTION, MAX_MESSAGE_SIZE_OPTION, MAX_NETWORK_DELAY_OPTION, MAX_SEND_BAYEUX_MESSAGE_SIZE_OPTION, SCHEDULER_OPTION, URL_OPTION
Constructor and Description |
---|
OkHttpClientTransport(Map<String,Object> options,
okhttp3.OkHttpClient client) |
OkHttpClientTransport(String url,
Map<String,Object> options,
okhttp3.OkHttpClient client) |
OkHttpClientTransport(String url,
Map<String,Object> options,
ScheduledExecutorService scheduler,
okhttp3.OkHttpClient client) |
Modifier and Type | Method and Description |
---|---|
void |
abort(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,
List<Message.Mutable> messages) |
accept, calculateMaxNetworkDelay, getAdvice, getMaxMessageSize, isAborted, isAppendMessageType, newRequestURI, processResponseContent, processResponseMessages, processWrongResponseCode, setAdvice, terminate
getCookies, getCookieStore, setCookieStore, storeCookies
generateJSON, getJSONContextClient, getMaxNetworkDelay, getScheduler, getURL, initScheduler, parseMessages, setMaxNetworkDelay, setURL, shutdownScheduler
getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefix
public OkHttpClientTransport(Map<String,Object> options, okhttp3.OkHttpClient client)
public OkHttpClientTransport(String url, Map<String,Object> options, okhttp3.OkHttpClient client)
public OkHttpClientTransport(String url, Map<String,Object> options, ScheduledExecutorService scheduler, okhttp3.OkHttpClient client)
protected okhttp3.OkHttpClient getOkHttpClient()
public void init()
init
in class AbstractHttpClientTransport
public void abort(Throwable failure)
ClientTransport
/meta/connect
s, without waiting for a response.abort
in class AbstractHttpClientTransport
failure
- the cause of the abortBayeuxClient.abort()
public void send(TransportListener listener, List<Message.Mutable> messages)
send
in class ClientTransport
protected void customize(okhttp3.Request.Builder request, Promise<okhttp3.Request.Builder> promise)
Copyright © 2008–2024 The CometD Project. All rights reserved.