public class SessionHandler
extends java.lang.Object
| Constructor and Description |
|---|
SessionHandler(WsUtils wsUtils,
WsConnectionConfigProps configProps,
reactor.core.publisher.EmitterProcessor<SessionHandler> clientConnectedEventBus,
reactor.core.publisher.EmitterProcessor<SessionHandler> clientDisconnectedEventBus)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Blocking close for a websocket session.
|
java.lang.String |
getClientInfo() |
org.springframework.web.reactive.socket.WebSocketSession |
getSession() |
java.lang.String |
getSessionId() |
reactor.core.publisher.Mono<java.lang.Void> |
handle(org.springframework.web.reactive.socket.WebSocketSession webSocketSession)
Handle the session.
|
boolean |
isConnected() |
void |
notifyConnect() |
void |
notifyDisconnect() |
reactor.core.publisher.DirectProcessor<org.springframework.web.reactive.socket.WebSocketMessage> |
pong() |
reactor.core.publisher.DirectProcessor<java.lang.String> |
receive() |
void |
send(org.springframework.web.reactive.socket.WebSocketMessage msg)
Send the raw websocket message.
|
void |
send(org.springframework.web.reactive.socket.WebSocketMessage msg,
org.springframework.web.reactive.socket.WebSocketSession webSocketSession)
Send the raw websocket message.
|
void |
sendJsonString(java.lang.Object messageObj)
Send a object in json format.
|
void |
sendJsonString(java.lang.Object messageObj,
org.springframework.web.reactive.socket.WebSocketSession customSession)
Send a object in json format.
|
void |
sendText(java.lang.String message)
Send a string to client.
|
void |
sendText(java.lang.String message,
org.springframework.web.reactive.socket.WebSocketSession webSocketSession)
Send a string to client.
|
public SessionHandler(WsUtils wsUtils, WsConnectionConfigProps configProps, reactor.core.publisher.EmitterProcessor<SessionHandler> clientConnectedEventBus, reactor.core.publisher.EmitterProcessor<SessionHandler> clientDisconnectedEventBus)
wsUtils - WsUtilsconfigProps - WsConnectionConfigPropsclientConnectedEventBus - EmitterProcessorclientDisconnectedEventBus - EmitterProcessorpublic reactor.core.publisher.Mono<java.lang.Void> handle(org.springframework.web.reactive.socket.WebSocketSession webSocketSession)
webSocketSession - WebSocketSessionpublic void sendJsonString(java.lang.Object messageObj)
messageObj - Objectpublic void sendJsonString(java.lang.Object messageObj,
org.springframework.web.reactive.socket.WebSocketSession customSession)
messageObj - Objectpublic void sendText(java.lang.String message)
message - stringpublic void sendText(java.lang.String message,
org.springframework.web.reactive.socket.WebSocketSession webSocketSession)
message - stringpublic void send(org.springframework.web.reactive.socket.WebSocketMessage msg)
msg - WebSocketMessagepublic void send(org.springframework.web.reactive.socket.WebSocketMessage msg,
org.springframework.web.reactive.socket.WebSocketSession webSocketSession)
msg - WebSocketMessagepublic reactor.core.publisher.DirectProcessor<org.springframework.web.reactive.socket.WebSocketMessage> pong()
public void close()
public java.lang.String getClientInfo()
public reactor.core.publisher.DirectProcessor<java.lang.String> receive()
public void notifyConnect()
public void notifyDisconnect()
public java.lang.String getSessionId()
public boolean isConnected()
public org.springframework.web.reactive.socket.WebSocketSession getSession()