Class EncryptedTextWebSocketHandler<T extends WebSocketClientInfo>
java.lang.Object
org.springframework.web.socket.handler.AbstractWebSocketHandler
org.springframework.web.socket.handler.TextWebSocketHandler
com.gsitm.ustra.web.socket.handlers.EncryptedTextWebSocketHandler<T>
- All Implemented Interfaces:
org.springframework.web.socket.WebSocketHandler
public abstract class EncryptedTextWebSocketHandler<T extends WebSocketClientInfo>
extends org.springframework.web.socket.handler.TextWebSocketHandler
텍스트 기반의 web socket 핸들러
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CommandMessageListener<T>[]Command message listenersprotected static final Map<org.springframework.web.socket.WebSocketSession,WebSocketClientInfo> 접속 세션protected Executor비동기 처리 시 사용할 executorprotected String암호화 키 -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEncryptedTextWebSocketHandler(Executor executor, String secret, CommandMessageListener<T>... commandMessageListeners) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterConnectionClosed(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.CloseStatus status) voidafterConnectionEstablished(org.springframework.web.socket.WebSocketSession session) protected TcreateClientInfo(org.springframework.web.socket.WebSocketSession session) websocket session에서 클라이언트 정보 생성protected voidhandleTextMessage(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.TextMessage message) protected voidsendCommandMessage(org.springframework.web.socket.WebSocketSession session, CommandMessage message) 메시지 전송Methods inherited from class org.springframework.web.socket.handler.TextWebSocketHandler
handleBinaryMessageMethods inherited from class org.springframework.web.socket.handler.AbstractWebSocketHandler
handleMessage, handlePongMessage, handleTransportError, supportsPartialMessages
-
Field Details
-
CONNECTION_SESSIONS
protected static final Map<org.springframework.web.socket.WebSocketSession,WebSocketClientInfo> CONNECTION_SESSIONS접속 세션 -
executor
비동기 처리 시 사용할 executor -
commandMessageListeners
Command message listeners -
secret
암호화 키
-
-
Constructor Details
-
EncryptedTextWebSocketHandler
@SafeVarargs protected EncryptedTextWebSocketHandler(Executor executor, String secret, CommandMessageListener<T>... commandMessageListeners)
-
-
Method Details
-
createClientInfo
websocket session에서 클라이언트 정보 생성- Parameters:
session- 세션- Returns:
- WebSocketClientInfo
-
afterConnectionEstablished
public void afterConnectionEstablished(org.springframework.web.socket.WebSocketSession session) throws Exception - Specified by:
afterConnectionEstablishedin interfaceorg.springframework.web.socket.WebSocketHandler- Overrides:
afterConnectionEstablishedin classorg.springframework.web.socket.handler.AbstractWebSocketHandler- Throws:
Exception
-
handleTextMessage
protected void handleTextMessage(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.TextMessage message) throws Exception - Overrides:
handleTextMessagein classorg.springframework.web.socket.handler.AbstractWebSocketHandler- Throws:
Exception
-
afterConnectionClosed
public void afterConnectionClosed(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.CloseStatus status) throws Exception - Specified by:
afterConnectionClosedin interfaceorg.springframework.web.socket.WebSocketHandler- Overrides:
afterConnectionClosedin classorg.springframework.web.socket.handler.AbstractWebSocketHandler- Throws:
Exception
-
sendCommandMessage
protected void sendCommandMessage(org.springframework.web.socket.WebSocketSession session, CommandMessage message) 메시지 전송- Parameters:
session- 세션message- 메시지
-