Class AbstractWebSocketTransport
java.lang.Object
org.cometd.common.AbstractTransport
org.cometd.client.transport.ClientTransport
org.cometd.client.transport.HttpClientTransport
org.cometd.client.websocket.common.AbstractWebSocketTransport
- All Implemented Interfaces:
Transport
,MessageClientTransport
- Direct Known Subclasses:
JettyWebSocketTransport
,OkHttpWebSocketTransport
,WebSocketTransport
public abstract class AbstractWebSocketTransport
extends HttpClientTransport
implements MessageClientTransport
-
Nested Class Summary
Nested classes/interfaces inherited from class org.cometd.client.transport.ClientTransport
ClientTransport.Factory, ClientTransport.FailureHandler, ClientTransport.FailureInfo
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
protected static final String
static final String
static final int
static final String
static final int
static final String
static final String
static final String
static final String
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
ModifierConstructorDescriptionprotected
AbstractWebSocketTransport
(String url, Map<String, Object> options, ScheduledExecutorService scheduler) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 abstract AbstractWebSocketTransport.Delegate
connect
(String uri, TransportListener listener, List<Message.Mutable> messages) long
protected AbstractWebSocketTransport.Delegate
long
void
init()
boolean
boolean
protected void
protected <T> T
void
send
(TransportListener listener, List<Message.Mutable> messages) void
setMessageTransportListener
(TransportListener listener) void
void
Terminates this transport, usually by closing network connections opened directly by this transport.Methods inherited from class org.cometd.client.transport.HttpClientTransport
getCookies, getHttpCookieStore, setHttpCookieStore, storeCookies
Methods inherited from class org.cometd.client.transport.ClientTransport
accept, generateJSON, getJSONContextClient, getMaxNetworkDelay, getScheduler, getURL, initScheduler, parseMessages, setMaxNetworkDelay, shutdownScheduler
Methods inherited from class org.cometd.common.AbstractTransport
getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefix
-
Field Details
-
PREFIX
- See Also:
-
NAME
- See Also:
-
PROTOCOL_OPTION
- See Also:
-
PERMESSAGE_DEFLATE_OPTION
- See Also:
-
CONNECT_TIMEOUT_OPTION
- See Also:
-
IDLE_TIMEOUT_OPTION
- See Also:
-
STICKY_RECONNECT_OPTION
- See Also:
-
MAX_CLOSE_REASON_LENGTH
public static final int MAX_CLOSE_REASON_LENGTH- See Also:
-
NORMAL_CLOSE_CODE
public static final int NORMAL_CLOSE_CODE- See Also:
-
COOKIE_HEADER
- See Also:
-
-
Constructor Details
-
AbstractWebSocketTransport
protected AbstractWebSocketTransport(String url, Map<String, Object> options, ScheduledExecutorService scheduler)
-
-
Method Details
-
setMessageTransportListener
- Specified by:
setMessageTransportListener
in interfaceMessageClientTransport
- Parameters:
listener
- the listener that handles unsolicited messages from the server
-
setURL
- Overrides:
setURL
in classClientTransport
-
init
public void init()- Overrides:
init
in classClientTransport
-
locked
-
locked
-
getProtocol
-
isPerMessageDeflateEnabled
public boolean isPerMessageDeflateEnabled() -
getIdleTimeout
public long getIdleTimeout() -
getConnectTimeout
public long getConnectTimeout() -
isStickyReconnect
public boolean isStickyReconnect() -
abort
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:
-
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:
-
getDelegate
-
send
- Specified by:
send
in classClientTransport
-
connect
protected abstract AbstractWebSocketTransport.Delegate connect(String uri, TransportListener listener, List<Message.Mutable> messages)
-