Class ServletWebSocketSession
java.lang.Object
io.micronaut.servlet.websocket.ServletWebSocketSession
- All Implemented Interfaces:
io.micronaut.core.convert.ConversionServiceProvider, io.micronaut.core.convert.value.ConvertibleValues<Object>, io.micronaut.core.convert.value.MutableConvertibleValues<Object>, io.micronaut.core.value.ValueResolver<CharSequence>, io.micronaut.websocket.WebSocketSession, AutoCloseable, Iterable<Map.Entry<String,Object>>
@Internal
public final class ServletWebSocketSession
extends Object
implements io.micronaut.websocket.WebSocketSession
A
WebSocketSession backed by a jakarta.websocket.Session.
All outbound writes go through a single queue with at most one send outstanding on the container. Jakarta containers reject a second asynchronous send while one is still in flight, whereas Micronaut application code and the broadcaster may send from any thread at any time.
- Since:
- 6.2.0
- Author:
- graemerocher
-
Field Summary
Fields inherited from interface io.micronaut.core.convert.value.ConvertibleValues
EMPTY -
Method Summary
Modifier and TypeMethodDescriptionio.micronaut.core.convert.value.MutableConvertibleValues<Object> clear()voidclose()voidclose(io.micronaut.websocket.CloseReason closeReason) <T> Optional<T> get(CharSequence name, io.micronaut.core.convert.ArgumentConversionContext<T> conversionContext) io.micronaut.core.convert.value.MutableConvertibleValues<Object> getId()jakarta.websocket.SessionSet<? extends io.micronaut.websocket.WebSocketSession> io.micronaut.core.convert.value.ConvertibleMultiValues<String> io.micronaut.core.convert.value.ConvertibleValues<Object> booleanisOpen()booleanisSecure()booleannames()io.micronaut.core.convert.value.MutableConvertibleValues<Object> put(CharSequence key, @Nullable Object value) io.micronaut.core.convert.value.MutableConvertibleValues<Object> remove(CharSequence key) <T> org.reactivestreams.Publisher<T> send(T message, io.micronaut.http.MediaType mediaType) <T> CompletableFuture<T> sendAsync(T message, io.micronaut.http.MediaType mediaType) sendPingAsync(byte[] content) toString()values()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.micronaut.core.convert.value.ConvertibleValues
asMap, asMap, asProperties, contains, forEach, getConversionService, getValue, getValueType, isEmpty, iterator, subMap, subMap, subMapMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface io.micronaut.core.convert.value.MutableConvertibleValues
putAll, putAllMethods inherited from interface io.micronaut.core.value.ValueResolver
get, get, getMethods inherited from interface io.micronaut.websocket.WebSocketSession
send, sendAsync, sendSync, sendSync
-
Method Details
-
getNativeSession
public jakarta.websocket.Session getNativeSession()- Returns:
- The underlying Jakarta WebSocket session
-
getId
- Specified by:
getIdin interfaceio.micronaut.websocket.WebSocketSession
-
getAttributes
- Specified by:
getAttributesin interfaceio.micronaut.websocket.WebSocketSession
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceio.micronaut.websocket.WebSocketSession
-
isWritable
public boolean isWritable()- Specified by:
isWritablein interfaceio.micronaut.websocket.WebSocketSession
-
isSecure
public boolean isSecure()- Specified by:
isSecurein interfaceio.micronaut.websocket.WebSocketSession
-
getOpenSessions
- Specified by:
getOpenSessionsin interfaceio.micronaut.websocket.WebSocketSession
-
getRequestURI
- Specified by:
getRequestURIin interfaceio.micronaut.websocket.WebSocketSession
-
getProtocolVersion
- Specified by:
getProtocolVersionin interfaceio.micronaut.websocket.WebSocketSession
-
getSubprotocol
-
getRequestParameters
- Specified by:
getRequestParametersin interfaceio.micronaut.websocket.WebSocketSession
-
getUriVariables
- Specified by:
getUriVariablesin interfaceio.micronaut.websocket.WebSocketSession
-
getUserPrincipal
-
send
public <T> org.reactivestreams.Publisher<T> send(T message, io.micronaut.http.MediaType mediaType) - Specified by:
sendin interfaceio.micronaut.websocket.WebSocketSession
-
sendAsync
- Specified by:
sendAsyncin interfaceio.micronaut.websocket.WebSocketSession
-
sendPingAsync
- Specified by:
sendPingAsyncin interfaceio.micronaut.websocket.WebSocketSession
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceio.micronaut.websocket.WebSocketSession
-
close
public void close(io.micronaut.websocket.CloseReason closeReason) - Specified by:
closein interfaceio.micronaut.websocket.WebSocketSession
-
put
public io.micronaut.core.convert.value.MutableConvertibleValues<Object> put(CharSequence key, @Nullable Object value) - Specified by:
putin interfaceio.micronaut.core.convert.value.MutableConvertibleValues<Object>
-
remove
- Specified by:
removein interfaceio.micronaut.core.convert.value.MutableConvertibleValues<Object>
-
clear
-
names
-
values
- Specified by:
valuesin interfaceio.micronaut.core.convert.value.ConvertibleValues<Object>
-
get
public <T> Optional<T> get(CharSequence name, io.micronaut.core.convert.ArgumentConversionContext<T> conversionContext) - Specified by:
getin interfaceio.micronaut.core.value.ValueResolver<CharSequence>
-
toString
-