public abstract class AbstractClientChannel extends AbstractChannel implements ClientChannel
AbstractChannel.GracefulChannelCloseable, AbstractChannel.GracefulStateAbstractCloseable.StateClientChannel.StreamingAttributeStore.AttributeKey<T>| Modifier and Type | Field and Description |
|---|---|
protected ChannelAsyncInputStream |
asyncErr |
protected ChannelAsyncOutputStream |
asyncIn |
protected ChannelAsyncInputStream |
asyncOut |
protected OutputStream |
err |
protected AtomicReference<String> |
exitSignalHolder |
protected AtomicReference<Integer> |
exitStatusHolder |
protected InputStream |
in |
protected InputStream |
invertedErr |
protected OutputStream |
invertedIn |
protected InputStream |
invertedOut |
protected AtomicBoolean |
opened |
protected String |
openFailureLang |
protected String |
openFailureMsg |
protected int |
openFailureReason |
protected OpenFuture |
openFuture |
protected OutputStream |
out |
protected ClientChannel.Streaming |
streaming |
protected String |
type |
channelListenerProxy, channelListeners, eofReceived, eofSent, gracefulFuture, gracefulState, initialized, RESPONSE_BUFFER_GROWTH_FACTOR, servicecloseFuture, lock, statelogCHANNEL_EXEC, CHANNEL_SHELL, CHANNEL_SUBSYSTEMEMPTYCLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT| Modifier | Constructor and Description |
|---|---|
protected |
AbstractClientChannel(String type) |
protected |
AbstractClientChannel(String type,
Collection<? extends RequestHandler<Channel>> handlers) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addChannelSignalRequestHandlers(EventNotifier<String> notifier) |
protected abstract void |
doOpen() |
protected void |
doWriteData(byte[] data,
int off,
long len) |
protected void |
doWriteExtendedData(byte[] data,
int off,
long len) |
IoInputStream |
getAsyncErr() |
IoOutputStream |
getAsyncIn() |
IoInputStream |
getAsyncOut() |
Set<ClientChannelEvent> |
getChannelState() |
OutputStream |
getErr() |
String |
getExitSignal() |
Integer |
getExitStatus() |
InputStream |
getIn() |
protected Closeable |
getInnerCloseable() |
InputStream |
getInvertedErr() |
OutputStream |
getInvertedIn()
Access to an output stream to send data directly to the remote channel.
|
InputStream |
getInvertedOut() |
OutputStream |
getOut() |
ClientChannel.Streaming |
getStreaming() |
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 |
handleWindowAdjust(Buffer buffer)
Invoked when
SSH_MSG_CHANNEL_WINDOW_ADJUST received |
OpenFuture |
open() |
OpenFuture |
open(int recipient,
long rwSize,
long packetSize,
Buffer buffer)
For a server channel, this method will actually open the channel
|
void |
setErr(OutputStream err) |
void |
setIn(InputStream in)
Set an input stream that will be read by this channel and forwarded to
the remote channel.
|
void |
setOut(OutputStream out) |
void |
setStreaming(ClientChannel.Streaming streaming) |
protected <C extends Collection<ClientChannelEvent>> |
updateCurrentChannelState(C state) |
Set<ClientChannelEvent> |
waitFor(Collection<ClientChannelEvent> mask,
long timeout)
Waits until any of the specified events in the mask is signaled
|
addChannelListener, addPendingRequest, addRequestHandler, close, configureWindow, doCloseImmediately, getAttribute, getChannelListenerProxy, getExecutorService, getId, getLocalWindow, getParentPropertyResolver, getProperties, getRecipient, getRemoteWindow, getRequestHandlers, getSession, handleChannelRequest, handleClose, handleData, handleEof, handleExtendedData, handleFailure, handleInternalRequest, handleRequest, handleSuccess, handleUnknownChannelRequest, init, invokeChannelSignaller, isEofSent, isEofSignalled, isInitialized, isShutdownOnExit, notifyStateChanged, notifyStateChanged, preClose, removeAttribute, removeChannelListener, removePendingRequest, removeRequestHandler, resolveAttribute, sendEof, sendResponse, sendWindowAdjust, setAttribute, setExecutorService, setRecipient, setShutdownOnExit, signalChannelClosed, signalChannelClosed, signalChannelInitialized, signalChannelInitialized, signalChannelOpenFailure, signalChannelOpenFailure, signalChannelOpenSuccess, signalChannelOpenSuccess, toString, validateIncomingDataSize, writePacketdoCloseGracefullyaddCloseFutureListener, builder, isClosed, isClosing, removeCloseFutureListenergetSimplifiedLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddRequestHandler, addRequestHandlers, getId, getLocalWindow, getRecipient, getRemoteWindow, getRequestHandlers, getSession, handleClose, handleData, handleEof, handleExtendedData, handleFailure, handleRequest, handleSuccess, init, isEofSignalled, isInitialized, removeRequestHandler, removeRequestHandlersaddChannelListener, 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, removeCloseFutureListenerprotected final AtomicBoolean opened
protected final String type
protected ClientChannel.Streaming streaming
protected ChannelAsyncOutputStream asyncIn
protected ChannelAsyncInputStream asyncOut
protected ChannelAsyncInputStream asyncErr
protected InputStream in
protected OutputStream invertedIn
protected OutputStream out
protected InputStream invertedOut
protected OutputStream err
protected InputStream invertedErr
protected final AtomicReference<Integer> exitStatusHolder
protected final AtomicReference<String> exitSignalHolder
protected int openFailureReason
protected String openFailureMsg
protected String openFailureLang
protected OpenFuture openFuture
protected AbstractClientChannel(String type)
protected AbstractClientChannel(String type, Collection<? extends RequestHandler<Channel>> handlers)
protected void addChannelSignalRequestHandlers(EventNotifier<String> notifier)
public ClientChannel.Streaming getStreaming()
getStreaming in interface ClientChannelpublic void setStreaming(ClientChannel.Streaming streaming)
setStreaming in interface ClientChannelpublic IoOutputStream getAsyncIn()
getAsyncIn in interface ClientChannelpublic IoInputStream getAsyncOut()
getAsyncOut in interface ClientChannelpublic IoInputStream getAsyncErr()
getAsyncErr in interface ClientChannelpublic OutputStream getInvertedIn()
ClientChannelClientChannel.setIn(java.io.InputStream) method
and having the channel polling for data in that stream.getInvertedIn in interface ClientChannelpublic InputStream getIn()
public void setIn(InputStream in)
ClientChannelClientChannel.getInvertedIn() method instead and write data directly.setIn in interface ClientChannelin - an InputStream to be polled and forwardedpublic InputStream getInvertedOut()
getInvertedOut in interface ClientChannelpublic OutputStream getOut()
public void setOut(OutputStream out)
setOut in interface ClientChannelpublic InputStream getInvertedErr()
getInvertedErr in interface ClientChannelpublic OutputStream getErr()
public void setErr(OutputStream err)
setErr in interface ClientChannelprotected Closeable getInnerCloseable()
getInnerCloseable in class AbstractChannelpublic Set<ClientChannelEvent> waitFor(Collection<ClientChannelEvent> mask, long timeout)
ClientChannelwaitFor in interface ClientChannelmask - The ClientChannelEvents masktimeout - The timeout to wait (msec.) - if non-positive then foreverClientChannelEvent.TIMEOUT
if timeout expired before the expected event was signaledpublic Set<ClientChannelEvent> getChannelState()
getChannelState in interface ClientChannelClientChannel.waitFor(Collection, long)protected <C extends Collection<ClientChannelEvent>> C updateCurrentChannelState(C state)
public OpenFuture open() throws IOException
open in interface ClientChannelIOExceptionpublic OpenFuture open(int recipient, long rwSize, long packetSize, Buffer buffer)
Channelrecipient - 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 requestpublic void handleOpenSuccess(int recipient,
long rwSize,
long packetSize,
Buffer buffer)
Channelrecipient - 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 decodedprotected abstract void doOpen()
throws IOException
IOExceptionpublic void handleOpenFailure(Buffer buffer)
Channelbuffer - Incoming Buffer that triggered the call.
Note: the buffer's read position is exactly
after the information that read to this call
was decodedprotected void doWriteData(byte[] data,
int off,
long len)
throws IOException
doWriteData in class AbstractChannelIOExceptionprotected void doWriteExtendedData(byte[] data,
int off,
long len)
throws IOException
doWriteExtendedData in class AbstractChannelIOExceptionpublic void handleWindowAdjust(Buffer buffer) throws IOException
ChannelSSH_MSG_CHANNEL_WINDOW_ADJUST receivedhandleWindowAdjust in class AbstractChannelbuffer - The rest of the message data Buffer after
decoding the channel identifiersIOException - If failed to handle the messagepublic Integer getExitStatus()
getExitStatus in interface ClientChannelnull if not signaledpublic String getExitSignal()
getExitSignal in interface ClientChannelnull if not signaledCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.