public interface Channel extends ChannelListenerManager, PropertyResolver, AttributeStore, Closeable
AttributeStore.AttributeKey<T>| Modifier and Type | Field and Description |
|---|---|
static String |
CHANNEL_EXEC |
static String |
CHANNEL_SHELL |
static String |
CHANNEL_SUBSYSTEM |
EMPTYCLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT| Modifier and Type | Method and Description |
|---|---|
void |
addRequestHandler(RequestHandler<Channel> handler) |
default void |
addRequestHandlers(Collection<? extends RequestHandler<Channel>> handlers) |
int |
getId() |
Window |
getLocalWindow() |
int |
getRecipient() |
Window |
getRemoteWindow() |
List<RequestHandler<Channel>> |
getRequestHandlers() |
Session |
getSession() |
void |
handleClose()
Invoked when
SSH_MSG_CHANNEL_CLOSE received |
void |
handleData(Buffer buffer)
Invoked when
SSH_MSG_CHANNEL_DATA received |
void |
handleEof()
Invoked when
SSH_MSG_CHANNEL_EOF received |
void |
handleExtendedData(Buffer buffer)
Invoked when
SSH_MSG_CHANNEL_EXTENDED_DATA received |
void |
handleFailure()
Invoked when
SSH_MSG_CHANNEL_FAILURE received |
void |
handleOpenFailure(Buffer buffer)
For a client channel, this method will be called internally by the
session when the server has rejected this channel opening.
|
void |
handleOpenSuccess(int recipient,
long rwSize,
long packetSize,
Buffer buffer)
For a client channel, this method will be called internally by the
session when the confirmation has been received.
|
void |
handleRequest(Buffer buffer)
Invoked when
SSH_MSG_CHANNEL_REQUEST received |
void |
handleSuccess()
Invoked when
SSH_MSG_CHANNEL_SUCCESS received |
void |
handleWindowAdjust(Buffer buffer)
Invoked when
SSH_MSG_CHANNEL_WINDOW_ADJUST received |
void |
init(ConnectionService service,
Session session,
int id)
Invoked when the local channel is initial created
|
boolean |
isEofSignalled() |
boolean |
isInitialized() |
OpenFuture |
open(int recipient,
long rwSize,
long packetSize,
Buffer buffer)
For a server channel, this method will actually open the channel
|
void |
removeRequestHandler(RequestHandler<Channel> handler) |
default void |
removeRequestHandlers(Collection<? extends RequestHandler<Channel>> handlers) |
addChannelListener, getChannelListenerProxy, removeChannelListenergetBoolean, getBooleanProperty, getInteger, getIntProperty, getLong, getLongProperty, getObject, getParentPropertyResolver, getProperties, getString, getStringPropertygetAttribute, removeAttribute, resolveAttribute, resolveAttribute, resolveAttribute, resolveAttribute, setAttributeaddCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListenerstatic final String CHANNEL_EXEC
static final String CHANNEL_SHELL
static final String CHANNEL_SUBSYSTEM
int getId()
int getRecipient()
Window getLocalWindow()
Window getRemoteWindow()
List<RequestHandler<Channel>> getRequestHandlers()
void addRequestHandler(RequestHandler<Channel> handler)
default void addRequestHandlers(Collection<? extends RequestHandler<Channel>> handlers)
void removeRequestHandler(RequestHandler<Channel> handler)
default void removeRequestHandlers(Collection<? extends RequestHandler<Channel>> handlers)
void handleClose()
throws IOException
SSH_MSG_CHANNEL_CLOSE receivedIOException - If failed to handle the messagevoid handleWindowAdjust(Buffer buffer) throws IOException
SSH_MSG_CHANNEL_WINDOW_ADJUST receivedbuffer - The rest of the message data Buffer after
decoding the channel identifiersIOException - If failed to handle the messagevoid handleRequest(Buffer buffer) throws IOException
SSH_MSG_CHANNEL_REQUEST receivedbuffer - The rest of the message data Buffer after
decoding the channel identifiersIOException - If failed to handle the messagevoid handleData(Buffer buffer) throws IOException
SSH_MSG_CHANNEL_DATA receivedbuffer - The rest of the message data Buffer after
decoding the channel identifiersIOException - If failed to handle the messagevoid handleExtendedData(Buffer buffer) throws IOException
SSH_MSG_CHANNEL_EXTENDED_DATA receivedbuffer - The rest of the message data Buffer after
decoding the channel identifiersIOException - If failed to handle the messagevoid handleEof()
throws IOException
SSH_MSG_CHANNEL_EOF receivedIOException - If failed to handle the messagevoid handleSuccess()
throws IOException
SSH_MSG_CHANNEL_SUCCESS receivedIOException - If failed to handle the messagevoid handleFailure()
throws IOException
SSH_MSG_CHANNEL_FAILURE receivedIOException - If failed to handle the messagevoid init(ConnectionService service, Session session, int id) throws IOException
service - The ConnectionService through which the channel is initializedsession - The Session associated with the channelid - The locally assigned channel identifierIOException - If failed to process the initializationboolean isInitialized()
true if call to init(ConnectionService, Session, int) was
successfully completedboolean isEofSignalled()
true if the peer signaled that it will not send any
more dataOpenFuture open(int recipient, long rwSize, long packetSize, Buffer buffer)
recipient - Recipient identifierrwSize - Read/Write window size (uint32)packetSize - Preferred maximum packet size (uint32)buffer - Incoming Buffer that triggered the call.
Note: the buffer's read position is exactly
after the information that read to this call
was decodedOpenFuture for the channel open requestvoid handleOpenSuccess(int recipient,
long rwSize,
long packetSize,
Buffer buffer)
throws IOException
recipient - Recipient identifierrwSize - Read/Write window size (uint32)packetSize - Preferred maximum packet size (uint32)buffer - Incoming Buffer that triggered the call.
Note: the buffer's read position is exactly
after the information that read to this call
was decodedIOException - If failed to handle the successvoid handleOpenFailure(Buffer buffer) throws IOException
buffer - Incoming Buffer that triggered the call.
Note: the buffer's read position is exactly
after the information that read to this call
was decodedIOException - If failed to handle the successCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.