public final class ClientWebSocketContainer extends IntegrationWebSocketContainer implements SmartLifecycle
IntegrationWebSocketContainer
implementation for the client
Web-Socket connection.
Represent the composition over an internal ConnectionManagerSupport
implementation.
Accepts the clientSession
WebSocketSession
on
ClientWebSocketContainer.IntegrationWebSocketConnectionManager.openConnection()
event, which can be accessed from this container using getSession(String)
.
logger, sessions, webSocketHandler
Constructor and Description |
---|
ClientWebSocketContainer(WebSocketClient client,
String uriTemplate,
Object... uriVariables) |
Modifier and Type | Method and Description |
---|---|
int |
getPhase() |
WebSocketSession |
getSession(String sessionId)
Return the
clientSession WebSocketSession . |
boolean |
isAutoStartup() |
boolean |
isRunning() |
void |
setAutoStartup(boolean autoStartup) |
void |
setConnectionTimeout(int connectionTimeout)
Set the connection timeout in seconds; default: 10.
|
void |
setHeaders(HttpHeaders headers) |
void |
setHeadersMap(Map<String,String> headers) |
void |
setOrigin(String origin) |
void |
setPhase(int phase) |
void |
start() |
void |
stop() |
void |
stop(Runnable callback) |
addSupportedProtocols, closeSession, destroy, getSessions, getSubProtocols, setMessageListener, setSendBufferSizeLimit, setSendTimeLimit, setSupportedProtocols
public ClientWebSocketContainer(WebSocketClient client, String uriTemplate, Object... uriVariables)
public void setOrigin(String origin)
public void setHeaders(HttpHeaders headers)
public void setConnectionTimeout(int connectionTimeout)
connectionTimeout
- the timeout in seconds.public WebSocketSession getSession(String sessionId)
clientSession
WebSocketSession
.
Independently of provided argument, this method always returns only the
established clientSession
getSession
in class IntegrationWebSocketContainer
sessionId
- the sessionId
. Can be null
.clientSession
, if established.public void setAutoStartup(boolean autoStartup)
public void setPhase(int phase)
public boolean isAutoStartup()
isAutoStartup
in interface SmartLifecycle
public void stop(Runnable callback)
stop
in interface SmartLifecycle