Class JettyWebSocketSession
java.lang.Object
org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession<org.eclipse.jetty.websocket.api.Session>
org.springframework.web.reactive.socket.adapter.JettyWebSocketSession
- All Implemented Interfaces:
- WebSocketSession
public class JettyWebSocketSession
extends AbstractWebSocketSession<org.eclipse.jetty.websocket.api.Session>
Spring 
WebSocketSession implementation that adapts to a Jetty
 WebSocket Session.- Since:
- 5.0
- Author:
- Violeta Georgieva, Rossen Stoyanchev
- 
Field SummaryFields inherited from class org.springframework.web.reactive.socket.adapter.AbstractWebSocketSessionlogger
- 
Constructor SummaryConstructorsConstructorDescriptionJettyWebSocketSession(org.eclipse.jetty.websocket.api.Session session, HandshakeInfo info, DataBufferFactory factory) JettyWebSocketSession(org.eclipse.jetty.websocket.api.Session session, HandshakeInfo info, DataBufferFactory factory, @Nullable reactor.core.publisher.Sinks.Empty<Void> completionSink) 
- 
Method SummaryModifier and TypeMethodDescriptionreactor.core.publisher.Mono<Void> close(CloseStatus status) Close the WebSocket session with the given status.reactor.core.publisher.Mono<CloseStatus> Provides access to theCloseStatuswith which the session is closed either locally or remotely, or completes empty if the session ended without a status.booleanisOpen()Whether the underlying connection is open.reactor.core.publisher.Flux<WebSocketMessage> receive()Provides access to the stream of inbound messages.reactor.core.publisher.Mono<Void> send(Publisher<WebSocketMessage> messages) Give a source of outgoing messages, write the messages and return aMono<Void>that completes when the source completes and writing is done.protected reactor.core.publisher.Mono<Void> sendMessage(WebSocketMessage message) Methods inherited from class org.springframework.web.reactive.socket.adapter.AbstractWebSocketSessionbinaryMessage, bufferFactory, getAttributes, getDelegate, getHandshakeInfo, getId, getLogPrefix, pingMessage, pongMessage, textMessage, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.web.reactive.socket.WebSocketSessionclose
- 
Constructor Details- 
JettyWebSocketSessionpublic JettyWebSocketSession(org.eclipse.jetty.websocket.api.Session session, HandshakeInfo info, DataBufferFactory factory) 
- 
JettyWebSocketSessionpublic JettyWebSocketSession(org.eclipse.jetty.websocket.api.Session session, HandshakeInfo info, DataBufferFactory factory, @Nullable reactor.core.publisher.Sinks.Empty<Void> completionSink) 
 
- 
- 
Method Details- 
isOpenpublic boolean isOpen()Description copied from interface:WebSocketSessionWhether the underlying connection is open.
- 
closeDescription copied from interface:WebSocketSessionClose the WebSocket session with the given status.- Parameters:
- status- the close status
 
- 
closeStatusDescription copied from interface:WebSocketSessionProvides access to theCloseStatuswith which the session is closed either locally or remotely, or completes empty if the session ended without a status.
- 
receiveDescription copied from interface:WebSocketSessionProvides access to the stream of inbound messages.This stream receives a completion or error signal when the connection is closed. In a typical WebSocketHandlerimplementation this stream is composed into the overall processing flow, so that when the connection is closed, handling will end.See the class-level doc of WebSocketHandlerand the reference for more details and examples of how to handle the session.- Specified by:
- receivein interface- WebSocketSession
- Specified by:
- receivein class- AbstractWebSocketSession<org.eclipse.jetty.websocket.api.Session>
 
- 
sendDescription copied from interface:WebSocketSessionGive a source of outgoing messages, write the messages and return aMono<Void>that completes when the source completes and writing is done.See the class-level doc of WebSocketHandlerand the reference for more details and examples of how to handle the session.- Specified by:
- sendin interface- WebSocketSession
- Specified by:
- sendin class- AbstractWebSocketSession<org.eclipse.jetty.websocket.api.Session>
 
- 
sendMessage
 
-