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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterConnectionClosed(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.CloseStatus status)
     
    void
    afterConnectionEstablished(org.springframework.web.socket.WebSocketSession session)
     

    Methods inherited from class org.springframework.web.socket.handler.AbstractWebSocketHandler

    handleMessage, handleTransportError, supportsPartialMessages

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ChatHandler

      public ChatHandler()
  • Method Details

    • afterConnectionEstablished

      public void afterConnectionEstablished(@NonNull org.springframework.web.socket.WebSocketSession session) throws Exception
      Specified by:
      afterConnectionEstablished in interface org.springframework.web.socket.WebSocketHandler
      Overrides:
      afterConnectionEstablished in class org.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:
      afterConnectionClosed in interface org.springframework.web.socket.WebSocketHandler
      Overrides:
      afterConnectionClosed in class org.springframework.web.socket.handler.AbstractWebSocketHandler
      Throws:
      Exception