Class ExecWebSocketListener

  • All Implemented Interfaces:
    io.fabric8.kubernetes.client.dsl.ExecWatch, io.fabric8.kubernetes.client.http.WebSocket.Listener, Closeable, AutoCloseable

    public class ExecWebSocketListener
    extends Object
    implements io.fabric8.kubernetes.client.dsl.ExecWatch, AutoCloseable, io.fabric8.kubernetes.client.http.WebSocket.Listener
    A WebSocket.Listener for exec operations. This listener, is only responsible for the resources it creates. Externally passed resource, will not get closed, by this listener. All other resources will be cleaned up once, ONLY when the close() method is called. ExecListener methods, onClose() and onFailure are mutually exclusive and are meant to be called once and only once. Failures that propagate after a close() operation will not be propagated.
    • Constructor Detail

      • ExecWebSocketListener

        public ExecWebSocketListener​(PodOperationContext context,
                                     Executor executor,
                                     io.fabric8.kubernetes.client.utils.KubernetesSerialization serialization)
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface io.fabric8.kubernetes.client.dsl.ExecWatch
      • onOpen

        public void onOpen​(io.fabric8.kubernetes.client.http.WebSocket webSocket)
        Specified by:
        onOpen in interface io.fabric8.kubernetes.client.http.WebSocket.Listener
      • onError

        public void onError​(io.fabric8.kubernetes.client.http.WebSocket webSocket,
                            Throwable t)
        Specified by:
        onError in interface io.fabric8.kubernetes.client.http.WebSocket.Listener
      • onMessage

        public void onMessage​(io.fabric8.kubernetes.client.http.WebSocket webSocket,
                              String text)
        Specified by:
        onMessage in interface io.fabric8.kubernetes.client.http.WebSocket.Listener
      • onMessage

        public void onMessage​(io.fabric8.kubernetes.client.http.WebSocket webSocket,
                              ByteBuffer bytes)
        Specified by:
        onMessage in interface io.fabric8.kubernetes.client.http.WebSocket.Listener
      • onClose

        public void onClose​(io.fabric8.kubernetes.client.http.WebSocket webSocket,
                            int code,
                            String reason)
        Specified by:
        onClose in interface io.fabric8.kubernetes.client.http.WebSocket.Listener
      • getInput

        public OutputStream getInput()
        Specified by:
        getInput in interface io.fabric8.kubernetes.client.dsl.ExecWatch
      • getOutput

        public InputStream getOutput()
        Specified by:
        getOutput in interface io.fabric8.kubernetes.client.dsl.ExecWatch
      • getError

        public InputStream getError()
        Specified by:
        getError in interface io.fabric8.kubernetes.client.dsl.ExecWatch
      • getErrorChannel

        public InputStream getErrorChannel()
        Specified by:
        getErrorChannel in interface io.fabric8.kubernetes.client.dsl.ExecWatch
      • resize

        public void resize​(int cols,
                           int rows)
        Specified by:
        resize in interface io.fabric8.kubernetes.client.dsl.ExecWatch
      • parseExitCode

        public static int parseExitCode​(io.fabric8.kubernetes.api.model.Status status)
      • exitCode

        public CompletableFuture<Integer> exitCode()
        Specified by:
        exitCode in interface io.fabric8.kubernetes.client.dsl.ExecWatch