Class StringWebSocketClient

    • Constructor Detail

      • StringWebSocketClient

        public StringWebSocketClient()
    • Method Detail

      • getEndpoint

        @Nullable
        public java.net.URI getEndpoint()
      • isListening

        public boolean isListening()
      • connect

        public void connect​(java.net.URI endpoint)
        Connects web socket client.
        Parameters:
        endpoint - The full address of an endpoint to connect to. Usually starts with 'ws://'.
      • onOpen

        public void onOpen()
      • onClose

        public void onClose​(int code,
                            java.lang.String reason)
        Specified by:
        onClose in interface org.openqa.selenium.remote.http.WebSocket.Listener
      • onError

        public void onError​(java.lang.Throwable t)
        Specified by:
        onError in interface org.openqa.selenium.remote.http.WebSocket.Listener
      • onText

        public void onText​(java.lang.CharSequence data)
        Specified by:
        onText in interface org.openqa.selenium.remote.http.WebSocket.Listener
      • getMessageHandlers

        public java.util.List<java.util.function.Consumer<java.lang.String>> getMessageHandlers()
        Description copied from interface: CanHandleMessages
        Returns a list of all registered web socket messages handlers.
        Specified by:
        getMessageHandlers in interface CanHandleMessages<java.lang.String>
        Returns:
        The list of web socket message handlers.
      • getErrorHandlers

        public java.util.List<java.util.function.Consumer<java.lang.Throwable>> getErrorHandlers()
        Description copied from interface: CanHandleErrors
        Returns a list of all registered web socket error handlers.
        Specified by:
        getErrorHandlers in interface CanHandleErrors
        Returns:
        The list of web socket error handlers.
      • getConnectionHandlers

        public java.util.List<java.lang.Runnable> getConnectionHandlers()
        Description copied from interface: CanHandleConnects
        Returns a list of all registered web socket connection handlers.
        Specified by:
        getConnectionHandlers in interface CanHandleConnects
        Returns:
        The list of web socket connection handlers.
      • getDisconnectionHandlers

        public java.util.List<java.lang.Runnable> getDisconnectionHandlers()
        Description copied from interface: CanHandleDisconnects
        Returns a list of all registered web socket disconnection handlers.
        Specified by:
        getDisconnectionHandlers in interface CanHandleDisconnects
        Returns:
        The list of web socket disconnection handlers.
      • removeAllHandlers

        public void removeAllHandlers()
        Remove all the registered handlers.