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 |
getId()
Return a unique session identifier.
|
java.security.Principal |
getPrincipal()
Return a
Principal instance containing the name of the
authenticated user. |
java.lang.String |
getRemoteAddress()
Return the IP address of the endpoint on the other end.
|
java.lang.String |
getRemoteHostName()
Return the host name of the endpoint on the other end.
|
java.net.URI |
getUri()
Return the URI used to open the WebSocket connection.
|
boolean |
isOpen()
Return whether the connection is still open.
|
boolean |
isSecure()
Return whether the underlying socket is using a secure transport.
|
void |
sendMessage(WebSocketMessage<?> message)
Send a WebSocket message either
TextMessage or
BinaryMessage . |
java.lang.String getId()
java.net.URI getUri()
boolean isSecure()
java.security.Principal getPrincipal()
Principal
instance containing the name of the
authenticated user. If the user has not been authenticated, the method returns
null
.java.lang.String getRemoteHostName()
java.lang.String getRemoteAddress()
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