public class JettyWebSocketSessionAdapter extends AbstractWebSocketSesssionAdapter<org.eclipse.jetty.websocket.api.Session>
org.eclipse.jetty.websocket.api.Session
to
WebSocketSession
.Modifier and Type | Field and Description |
---|---|
private java.security.Principal |
principal |
private Session |
session |
logger
Constructor and Description |
---|
JettyWebSocketSessionAdapter() |
Modifier and Type | Method and Description |
---|---|
protected void |
closeInternal(CloseStatus 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.
|
void |
initSession(Session session) |
boolean |
isOpen()
Return whether the connection is still open.
|
boolean |
isSecure()
Return whether the underlying socket is using a secure transport.
|
protected void |
sendBinaryMessage(BinaryMessage message) |
protected void |
sendTextMessage(TextMessage message) |
void |
setPrincipal(java.security.Principal principal) |
void |
setRemoteAddress(java.lang.String address) |
void |
setRemoteHostName(java.lang.String address) |
void |
setUri(java.net.URI uri) |
close, close, sendMessage, toString
public void initSession(Session session)
initSession
in class AbstractWebSocketSesssionAdapter<org.eclipse.jetty.websocket.api.Session>
public java.lang.String getId()
WebSocketSession
public boolean isSecure()
WebSocketSession
public java.net.URI getUri()
WebSocketSession
public void setUri(java.net.URI uri)
public java.security.Principal getPrincipal()
WebSocketSession
Principal
instance containing the name of the
authenticated user. If the user has not been authenticated, the method returns
null
.public void setPrincipal(java.security.Principal principal)
public java.lang.String getRemoteHostName()
WebSocketSession
public void setRemoteHostName(java.lang.String address)
public java.lang.String getRemoteAddress()
WebSocketSession
public void setRemoteAddress(java.lang.String address)
public boolean isOpen()
WebSocketSession
protected void sendTextMessage(TextMessage message) throws java.io.IOException
sendTextMessage
in class AbstractWebSocketSesssionAdapter<org.eclipse.jetty.websocket.api.Session>
java.io.IOException
protected void sendBinaryMessage(BinaryMessage message) throws java.io.IOException
sendBinaryMessage
in class AbstractWebSocketSesssionAdapter<org.eclipse.jetty.websocket.api.Session>
java.io.IOException
protected void closeInternal(CloseStatus status) throws java.io.IOException
closeInternal
in class AbstractWebSocketSesssionAdapter<org.eclipse.jetty.websocket.api.Session>
java.io.IOException