Package org.cometd.client.http.common
Class AbstractHttpClientTransport
- java.lang.Object
-
- org.cometd.common.AbstractTransport
-
- org.cometd.client.transport.ClientTransport
-
- org.cometd.client.transport.HttpClientTransport
-
- org.cometd.client.http.common.AbstractHttpClientTransport
-
- All Implemented Interfaces:
Transport
- Direct Known Subclasses:
JettyHttpClientTransport
,OkHttpClientTransport
public abstract class AbstractHttpClientTransport extends HttpClientTransport
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.cometd.client.transport.ClientTransport
ClientTransport.Factory, ClientTransport.FailureHandler, ClientTransport.FailureInfo
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAME
static java.lang.String
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 Modifier Constructor Description protected
AbstractHttpClientTransport(java.lang.String url, java.util.Map<java.lang.String,java.lang.Object> options)
Deprecated.protected
AbstractHttpClientTransport(java.lang.String url, java.util.Map<java.lang.String,java.lang.Object> options, java.util.concurrent.ScheduledExecutorService scheduler)
-
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.boolean
accept(java.lang.String bayeuxVersion)
protected long
calculateMaxNetworkDelay(java.util.List<Message.Mutable> messages)
protected java.util.Map<java.lang.String,java.lang.Object>
getAdvice()
int
getMaxMessageSize()
void
init()
protected boolean
isAborted()
protected boolean
isAppendMessageType()
protected java.lang.String
newRequestURI(java.util.List<Message.Mutable> messages)
protected void
processResponseContent(TransportListener listener, java.util.List<Message.Mutable> requestMessages, java.lang.String content)
protected void
processResponseMessages(TransportListener listener, java.util.List<Message.Mutable> messages)
protected void
processWrongResponseCode(TransportListener listener, java.util.List<Message.Mutable> messages, int code)
protected void
setAdvice(java.util.Map<java.lang.String,java.lang.Object> advice)
void
terminate()
Terminates this transport, usually by closing network connections opened directly by this transport.-
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, send, setMaxNetworkDelay, setURL, shutdownScheduler
-
Methods inherited from class org.cometd.common.AbstractTransport
getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefix
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
PREFIX
public static final java.lang.String PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractHttpClientTransport
@Deprecated protected AbstractHttpClientTransport(java.lang.String url, java.util.Map<java.lang.String,java.lang.Object> options)
Deprecated.- Parameters:
url
- the CometD server URLoptions
- the transport options
-
AbstractHttpClientTransport
protected AbstractHttpClientTransport(java.lang.String url, java.util.Map<java.lang.String,java.lang.Object> options, java.util.concurrent.ScheduledExecutorService scheduler)
-
-
Method Detail
-
accept
public boolean accept(java.lang.String bayeuxVersion)
- Specified by:
accept
in classClientTransport
-
init
public void init()
- Overrides:
init
in classClientTransport
-
terminate
public void terminate()
Description copied from class:ClientTransport
Terminates this transport, usually by closing network connections opened directly by this transport.- Overrides:
terminate
in classClientTransport
- See Also:
ClientSession.disconnect()
-
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.- Specified by:
abort
in classClientTransport
- Parameters:
failure
- the cause of the abort- See Also:
BayeuxClient.abort()
-
isAborted
protected boolean isAborted()
-
getMaxMessageSize
public int getMaxMessageSize()
-
isAppendMessageType
protected boolean isAppendMessageType()
-
newRequestURI
protected java.lang.String newRequestURI(java.util.List<Message.Mutable> messages)
-
getAdvice
protected java.util.Map<java.lang.String,java.lang.Object> getAdvice()
-
setAdvice
protected void setAdvice(java.util.Map<java.lang.String,java.lang.Object> advice)
-
calculateMaxNetworkDelay
protected long calculateMaxNetworkDelay(java.util.List<Message.Mutable> messages)
-
processResponseContent
protected void processResponseContent(TransportListener listener, java.util.List<Message.Mutable> requestMessages, java.lang.String content)
-
processResponseMessages
protected void processResponseMessages(TransportListener listener, java.util.List<Message.Mutable> messages)
-
processWrongResponseCode
protected void processWrongResponseCode(TransportListener listener, java.util.List<Message.Mutable> messages, int code)
-
-