Class WsConfig


  • public class WsConfig
    extends Object
    Holds the different WebSocket handlers for a specific WsEntry or the WebSocket logger.
    • Constructor Summary

      Constructors 
      Constructor Description
      WsConfig()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void onBinaryMessage​(io.javalin.websocket.WsBinaryMessageHandler wsBinaryMessageHandler)
      Add a WsBinaryMessageHandler to the WsHandler.
      void onClose​(io.javalin.websocket.WsCloseHandler wsCloseHandler)
      Add a WsCloseHandler to the WsHandler.
      void onConnect​(io.javalin.websocket.WsConnectHandler wsConnectHandler)
      Add a WsConnectHandler to the WsHandler.
      void onError​(io.javalin.websocket.WsErrorHandler wsErrorHandler)
      Add a wsErrorHandler to the WsHandler.
      void onMessage​(io.javalin.websocket.WsMessageHandler wsMessageHandler)
      Add a WsMessageHandler to the WsHandler.
    • Constructor Detail

      • WsConfig

        public WsConfig()
    • Method Detail

      • onConnect

        public void onConnect​(@NotNull
                              io.javalin.websocket.WsConnectHandler wsConnectHandler)
        Add a WsConnectHandler to the WsHandler. The handler is called when a WebSocket client connects.
      • onMessage

        public void onMessage​(@NotNull
                              io.javalin.websocket.WsMessageHandler wsMessageHandler)
        Add a WsMessageHandler to the WsHandler. The handler is called when a WebSocket client sends a String message.
      • onBinaryMessage

        public void onBinaryMessage​(@NotNull
                                    io.javalin.websocket.WsBinaryMessageHandler wsBinaryMessageHandler)
        Add a WsBinaryMessageHandler to the WsHandler. The handler is called when a WebSocket client sends a binary message.
      • onClose

        public void onClose​(@NotNull
                            io.javalin.websocket.WsCloseHandler wsCloseHandler)
        Add a WsCloseHandler to the WsHandler. The handler is called when a WebSocket client closes the connection. The handler is not called in case of network issues, only when the client actively closes the connection (or times out).
      • onError

        public void onError​(@NotNull
                            io.javalin.websocket.WsErrorHandler wsErrorHandler)
        Add a wsErrorHandler to the WsHandler. The handler is called when an error is detected.