Class ChatHandler
java.lang.Object
org.springframework.web.socket.handler.AbstractWebSocketHandler
org.springframework.web.socket.handler.TextWebSocketHandler
vn.edu.uit.csbu.software_design.software_design_backend.chat.ChatHandler
- All Implemented Interfaces:
org.springframework.web.socket.WebSocketHandler
public class ChatHandler
extends org.springframework.web.socket.handler.TextWebSocketHandler
The `ChatHandler` class in Java manages WebSocket connections for chat rooms, handling connection
establishment, message processing, and disconnection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterConnectionClosed(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.CloseStatus status) voidafterConnectionEstablished(org.springframework.web.socket.WebSocketSession session) Methods inherited from class org.springframework.web.socket.handler.AbstractWebSocketHandler
handleMessage, handleTransportError, supportsPartialMessages
-
Constructor Details
-
ChatHandler
public ChatHandler()
-
-
Method Details
-
afterConnectionEstablished
public void afterConnectionEstablished(@NonNull 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
-
afterConnectionClosed
public void afterConnectionClosed(@NonNull org.springframework.web.socket.WebSocketSession session, @NonNull 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
-