Interface ExecListener


  • public interface ExecListener
    Provides callbacks for exec websocket events mainly for logging and testing

    long running operations should not be called as these methods are called directly from the IO thread.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static interface  ExecListener.Response  
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void onClose​(int code, String reason)
      Called when the server sends a close message.
      default void onExit​(int code, io.fabric8.kubernetes.api.model.Status status)
      Called after a Status message is seen on channel 3.
      default void onFailure​(Throwable t, ExecListener.Response failureResponse)
      Called when the transport or protocol layer of this web socket errors during communication.
      default void onOpen()
      Called when the request has successfully been upgraded to a web socket.
    • Method Detail

      • onOpen

        default void onOpen()
        Called when the request has successfully been upgraded to a web socket.
      • onFailure

        default void onFailure​(Throwable t,
                               ExecListener.Response failureResponse)
        Called when the transport or protocol layer of this web socket errors during communication.
        Parameters:
        t - Throwable
        failureResponse - non-null if the failure is caused by the handshake
      • onClose

        void onClose​(int code,
                     String reason)
        Called when the server sends a close message.
        Parameters:
        code - The RFC-compliant status code.
        reason - Reason for close or an empty string.
      • onExit

        default void onExit​(int code,
                            io.fabric8.kubernetes.api.model.Status status)
        Called after a Status message is seen on channel 3.

        See https://github.com/kubernetes/kubernetes/issues/89899 - which explains there's currently no way to indicate end of input over a websocket, so you may not get an exit code when using stdIn.

        See also ExecWatch.exitCode()

        Parameters:
        code - the exit code, -1 will be used if the code cannot be determined
        status - may be null if no valid status was received