public final class UndertowSession extends Object implements javax.websocket.Session
Session
implementation which makes use of the high-level WebSocket API of undertow under the hood.Modifier and Type | Method and Description |
---|---|
<T> void | addMessageHandler(Class<T> clazz, javax.websocket.MessageHandler.Partial<T> handler) |
<T> void | addMessageHandler(Class<T> clazz, javax.websocket.MessageHandler.Whole<T> handler) |
void | addMessageHandler(javax.websocket.MessageHandler messageHandler) |
void | close() |
void | close(javax.websocket.CloseReason closeReason) |
void | closeInternal() |
void | closeInternal(javax.websocket.CloseReason closeReason) |
void | forceClose() |
javax.websocket.RemoteEndpoint.Async | getAsyncRemote() |
javax.websocket.RemoteEndpoint.Basic | getBasicRemote() |
ServerWebSocketContainer | getContainer() |
Encoding | getEncoding() |
Executor | getExecutor() |
String | getId() |
int | getMaxBinaryMessageBufferSize() |
long | getMaxIdleTimeout() |
int | getMaxTextMessageBufferSize() |
Set<javax.websocket.MessageHandler> | getMessageHandlers() |
List<javax.websocket.Extension> | getNegotiatedExtensions() |
String | getNegotiatedSubprotocol() |
Set<javax.websocket.Session> | getOpenSessions() |
Map<String,String> | getPathParameters() |
String | getProtocolVersion() |
String | getQueryString() |
Map<String,List<String>> | getRequestParameterMap() |
URI | getRequestURI() |
Principal | getUserPrincipal() |
Map<String,Object> | getUserProperties() |
WebSocketChannel | getWebSocketChannel() |
boolean | isOpen() |
boolean | isSecure() |
void | removeMessageHandler(javax.websocket.MessageHandler messageHandler) |
void | setMaxBinaryMessageBufferSize(int i) |
void | setMaxIdleTimeout(long milliseconds) |
void | setMaxTextMessageBufferSize(int i) |
void | setReceiveListener(org.xnio.ChannelListener<WebSocketChannel> handler) sets the recieve listener This should only be used for annotated endpoints. |
public ServerWebSocketContainer getContainer()
getContainer
in interface javax.websocket.Session
public void addMessageHandler(javax.websocket.MessageHandler messageHandler) throws IllegalStateException
addMessageHandler
in interface javax.websocket.Session
IllegalStateException
public <T> void addMessageHandler(Class<T> clazz, javax.websocket.MessageHandler.Whole<T> handler)
addMessageHandler
in interface javax.websocket.Session
public <T> void addMessageHandler(Class<T> clazz, javax.websocket.MessageHandler.Partial<T> handler)
addMessageHandler
in interface javax.websocket.Session
public Set<javax.websocket.MessageHandler> getMessageHandlers()
getMessageHandlers
in interface javax.websocket.Session
public void removeMessageHandler(javax.websocket.MessageHandler messageHandler)
removeMessageHandler
in interface javax.websocket.Session
public void setReceiveListener(org.xnio.ChannelListener<WebSocketChannel> handler)
handler
- The handlerpublic String getProtocolVersion()
getProtocolVersion
in interface javax.websocket.Session
public String getNegotiatedSubprotocol()
getNegotiatedSubprotocol
in interface javax.websocket.Session
public boolean isSecure()
isSecure
in interface javax.websocket.Session
public boolean isOpen()
isOpen
in interface javax.websocket.Session
public long getMaxIdleTimeout()
getMaxIdleTimeout
in interface javax.websocket.Session
public void setMaxIdleTimeout(long milliseconds)
setMaxIdleTimeout
in interface javax.websocket.Session
public String getId()
getId
in interface javax.websocket.Session
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface javax.websocket.Session
IOException
public void close(javax.websocket.CloseReason closeReason) throws IOException
close
in interface javax.websocket.Session
IOException
public void closeInternal() throws IOException
IOException
public void closeInternal(javax.websocket.CloseReason closeReason) throws IOException
IOException
public void forceClose()
public URI getRequestURI()
getRequestURI
in interface javax.websocket.Session
public Map<String,List<String>> getRequestParameterMap()
getRequestParameterMap
in interface javax.websocket.Session
public String getQueryString()
getQueryString
in interface javax.websocket.Session
public Map<String,String> getPathParameters()
getPathParameters
in interface javax.websocket.Session
public Map<String,Object> getUserProperties()
getUserProperties
in interface javax.websocket.Session
public Principal getUserPrincipal()
getUserPrincipal
in interface javax.websocket.Session
public void setMaxBinaryMessageBufferSize(int i)
setMaxBinaryMessageBufferSize
in interface javax.websocket.Session
public int getMaxBinaryMessageBufferSize()
getMaxBinaryMessageBufferSize
in interface javax.websocket.Session
public void setMaxTextMessageBufferSize(int i)
setMaxTextMessageBufferSize
in interface javax.websocket.Session
public int getMaxTextMessageBufferSize()
getMaxTextMessageBufferSize
in interface javax.websocket.Session
public javax.websocket.RemoteEndpoint.Async getAsyncRemote()
getAsyncRemote
in interface javax.websocket.Session
public javax.websocket.RemoteEndpoint.Basic getBasicRemote()
getBasicRemote
in interface javax.websocket.Session
public Set<javax.websocket.Session> getOpenSessions()
getOpenSessions
in interface javax.websocket.Session
public List<javax.websocket.Extension> getNegotiatedExtensions()
getNegotiatedExtensions
in interface javax.websocket.Session
public Encoding getEncoding()
public WebSocketChannel getWebSocketChannel()
public Executor getExecutor()
Copyright © 2020 JBoss by Red Hat. All rights reserved.