public class ExecWebSocketListener extends Object implements ExecWatch, AutoCloseable, WebSocket.Listener
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.| Modifier and Type | Class and Description |
|---|---|
static interface |
ExecWebSocketListener.MessageHandler |
| Constructor and Description |
|---|
ExecWebSocketListener(PodOperationContext context) |
ExecWebSocketListener(PodOperationContext context,
Executor executor) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
CompletableFuture<Integer> |
exitCode() |
InputStream |
getError() |
InputStream |
getErrorChannel() |
OutputStream |
getInput() |
InputStream |
getOutput() |
void |
onClose(WebSocket webSocket,
int code,
String reason) |
void |
onError(WebSocket webSocket,
Throwable t,
boolean connectionError) |
void |
onMessage(WebSocket webSocket,
ByteBuffer bytes) |
void |
onMessage(WebSocket webSocket,
String text) |
void |
onOpen(WebSocket webSocket) |
static int |
parseExitCode(io.fabric8.kubernetes.api.model.Status status) |
void |
resize(int cols,
int rows) |
static String |
toString(ByteBuffer buffer) |
public ExecWebSocketListener(PodOperationContext context)
public ExecWebSocketListener(PodOperationContext context, Executor executor)
public static String toString(ByteBuffer buffer)
public void close()
public void onOpen(WebSocket webSocket)
onOpen in interface WebSocket.Listenerpublic void onError(WebSocket webSocket, Throwable t, boolean connectionError)
onError in interface WebSocket.Listenerpublic void onMessage(WebSocket webSocket, String text)
onMessage in interface WebSocket.Listenerpublic void onMessage(WebSocket webSocket, ByteBuffer bytes)
onMessage in interface WebSocket.Listenerpublic void onClose(WebSocket webSocket, int code, String reason)
onClose in interface WebSocket.Listenerpublic OutputStream getInput()
public InputStream getOutput()
public InputStream getError()
public InputStream getErrorChannel()
getErrorChannel in interface ExecWatchpublic static int parseExitCode(io.fabric8.kubernetes.api.model.Status status)
public CompletableFuture<Integer> exitCode()
Copyright © 2015–2023 Red Hat. All rights reserved.