Class WebSocketTransport
java.lang.Object
org.cometd.common.AbstractTransport
org.cometd.client.transport.ClientTransport
org.cometd.client.transport.HttpClientTransport
org.cometd.client.websocket.common.AbstractWebSocketTransport
org.cometd.client.websocket.jakarta.WebSocketTransport
- All Implemented Interfaces:
Transport
,MessageClientTransport
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
class
Nested classes/interfaces inherited from class org.cometd.client.websocket.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.client.websocket.common.AbstractWebSocketTransport
CONNECT_TIMEOUT_OPTION, COOKIE_HEADER, IDLE_TIMEOUT_OPTION, MAX_CLOSE_REASON_LENGTH, NAME, NORMAL_CLOSE_CODE, PERMESSAGE_DEFLATE_OPTION, PREFIX, PROTOCOL_OPTION, STICKY_RECONNECT_OPTION
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
ConstructorDescriptionWebSocketTransport
(String url, Map<String, Object> options, ScheduledExecutorService scheduler, jakarta.websocket.WebSocketContainer webSocketContainer) WebSocketTransport
(Map<String, Object> options, ScheduledExecutorService scheduler, jakarta.websocket.WebSocketContainer webSocketContainer) -
Method Summary
Modifier and TypeMethodDescriptionboolean
protected AbstractWebSocketTransport.Delegate
connect
(jakarta.websocket.WebSocketContainer container, jakarta.websocket.ClientEndpointConfig configuration, String uri) protected AbstractWebSocketTransport.Delegate
connect
(String uri, TransportListener listener, List<Message.Mutable> messages) void
init()
protected WebSocketTransport.WebSocketDelegate
protected void
onHandshakeRequest
(Map<String, List<String>> headers) protected void
onHandshakeResponse
(jakarta.websocket.HandshakeResponse response) Methods inherited from class org.cometd.client.websocket.common.AbstractWebSocketTransport
abort, getConnectTimeout, getDelegate, getIdleTimeout, getProtocol, isPerMessageDeflateEnabled, isStickyReconnect, locked, locked, send, setMessageTransportListener, setURL, terminate
Methods inherited from class org.cometd.client.transport.HttpClientTransport
getCookies, getHttpCookieStore, setHttpCookieStore, storeCookies
Methods inherited from class org.cometd.client.transport.ClientTransport
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
-
Constructor Details
-
WebSocketTransport
public WebSocketTransport(Map<String, Object> options, ScheduledExecutorService scheduler, jakarta.websocket.WebSocketContainer webSocketContainer) -
WebSocketTransport
public WebSocketTransport(String url, Map<String, Object> options, ScheduledExecutorService scheduler, jakarta.websocket.WebSocketContainer webSocketContainer)
-
-
Method Details
-
accept
- Specified by:
accept
in classClientTransport
-
init
public void init()- Overrides:
init
in classAbstractWebSocketTransport
-
connect
protected AbstractWebSocketTransport.Delegate connect(String uri, TransportListener listener, List<Message.Mutable> messages) - Specified by:
connect
in classAbstractWebSocketTransport
-
connect
protected AbstractWebSocketTransport.Delegate connect(jakarta.websocket.WebSocketContainer container, jakarta.websocket.ClientEndpointConfig configuration, String uri) throws IOException - Throws:
IOException
-
newDelegate
-
onHandshakeRequest
-
onHandshakeResponse
protected void onHandshakeResponse(jakarta.websocket.HandshakeResponse response)
-