Class ActionWebSocket.InternalActionListener

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void onClose​(java.net.http.WebSocket webSocket, int statusCode, java.lang.String reason)
      Called right before the websocket is about to close.
      void onError​(java.net.http.WebSocket webSocket, java.lang.Throwable t)
      Called when an Exception is detected.
      void onMessage​(java.net.http.WebSocket webSocket, HiroMessage message)
      Handle incoming action messages.
      void onOpen​(java.net.http.WebSocket webSocket)
      Called right after the websocket has been opened.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InternalActionListener

        public InternalActionListener​(ActionWebSocketListener listener)
        Constructor
        Parameters:
        listener - The listener which received messages.
    • Method Detail

      • onOpen

        public void onOpen​(java.net.http.WebSocket webSocket)
        Description copied from interface: SpecificWebSocketListener
        Called right after the websocket has been opened. Does nothing on default.
        Specified by:
        onOpen in interface SpecificWebSocketListener
        Parameters:
        webSocket - Reference to the websocket.
      • onMessage

        public void onMessage​(java.net.http.WebSocket webSocket,
                              HiroMessage message)
                       throws HiroException,
                              java.io.IOException,
                              java.lang.InterruptedException
        Handle incoming action messages.
        Specified by:
        onMessage in interface SpecificWebSocketListener
        Parameters:
        webSocket - Reference to the websocket.
        message - The incoming HiroMessage.
        Throws:
        HiroException - On protocol errors
        java.io.IOException - On IO or JSON parsing errors.
        java.lang.InterruptedException - When a sleep gets interrupted.
      • onClose

        public void onClose​(java.net.http.WebSocket webSocket,
                            int statusCode,
                            java.lang.String reason)
        Description copied from interface: SpecificWebSocketListener
        Called right before the websocket is about to close. Does nothing on default.
        Specified by:
        onClose in interface SpecificWebSocketListener
        Parameters:
        webSocket - Reference to the websocket.
        statusCode - Status code sent from the remote side.
        reason - Reason text sent from the remote side.
      • onError

        public void onError​(java.net.http.WebSocket webSocket,
                            java.lang.Throwable t)
        Description copied from interface: SpecificWebSocketListener
        Called when an Exception is detected. Does nothing on default.
        Specified by:
        onError in interface SpecificWebSocketListener
        Parameters:
        webSocket - Reference to the websocket.
        t - The Throwable thrown.