public interface WebSocketSession
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the WebSocket connection with status 1000, i.e.
|
void |
close(CloseStatus status)
Close the WebSocket connection with the given close status.
|
java.lang.String |
getAcceptedProtocol()
Return the negotiated sub-protocol or
null if none was specified or
negotiated successfully. |
java.util.Map<java.lang.String,java.lang.Object> |
getHandshakeAttributes()
Handshake request specific attributes.
|
HttpHeaders |
getHandshakeHeaders()
Return the headers used in the handshake request.
|
java.lang.String |
getId()
Return a unique session identifier.
|
java.net.InetSocketAddress |
getLocalAddress()
Return the address on which the request was received.
|
java.security.Principal |
getPrincipal()
Return a <code>Principal</code> instance containing the name of the
authenticated user.
|
java.net.InetSocketAddress |
getRemoteAddress()
Return the address of the remote client.
|
java.net.URI |
getUri()
Return the URI used to open the WebSocket connection.
|
boolean |
isOpen()
Return whether the connection is still open.
|
void |
sendMessage(WebSocketMessage<?> message)
Send a WebSocket message either
TextMessage or
BinaryMessage . |
java.lang.String getId()
java.net.URI getUri()
HttpHeaders getHandshakeHeaders()
java.util.Map<java.lang.String,java.lang.Object> getHandshakeAttributes()
HandshakeInterceptor
.java.security.Principal getPrincipal()
null
.java.net.InetSocketAddress getLocalAddress()
java.net.InetSocketAddress getRemoteAddress()
java.lang.String getAcceptedProtocol()
null
if none was specified or
negotiated successfully.boolean isOpen()
void sendMessage(WebSocketMessage<?> message) throws java.io.IOException
TextMessage
or
BinaryMessage
.java.io.IOException
void close() throws java.io.IOException
session.close(CloseStatus.NORMAL);
java.io.IOException
void close(CloseStatus status) throws java.io.IOException
java.io.IOException