Package com.sshtools.server.callback
Class CallbackForwardingChannel<T extends com.sshtools.synergy.ssh.SshContext>
java.lang.Object
com.sshtools.synergy.ssh.ChannelNG<T>
com.sshtools.synergy.ssh.ForwardingChannel<T>
com.sshtools.server.callback.CallbackForwardingChannel<T>
- All Implemented Interfaces:
com.sshtools.common.ssh.Channel
public class CallbackForwardingChannel<T extends com.sshtools.synergy.ssh.SshContext>
extends com.sshtools.synergy.ssh.ForwardingChannel<T>
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sshtools.synergy.ssh.ChannelNG
com.sshtools.synergy.ssh.ChannelNG.ChannelInputStream
-
Field Summary
Fields inherited from class com.sshtools.synergy.ssh.ForwardingChannel
hostToConnect, originatingHost, originatingPort, portToConnect
Fields inherited from class com.sshtools.synergy.ssh.ChannelNG
cache, con, connection, localWindow, remoteWindow
-
Constructor Summary
ConstructorsConstructorDescriptionCallbackForwardingChannel
(com.sshtools.common.ssh.Context ctx, com.sshtools.common.ssh.SshConnection callbackClient) CallbackForwardingChannel
(com.sshtools.common.ssh.Context ctx, com.sshtools.common.ssh.SshConnection callbackClient, String hostToConnect, int portToConnect) CallbackForwardingChannel
(String channelType, com.sshtools.common.ssh.SshConnection con, String hostToConnect, int portToConnect) Constructs a forwarding channel of the type "forwarded-tcpip" -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
protected byte[]
Create the forwarding channel.protected void
protected void
protected void
onChannelData
(ByteBuffer data) protected void
protected void
protected void
Called when the channel has been confirmed as open.protected void
protected void
onChannelRequest
(String type, boolean wantreply, byte[] requestdata) protected void
protected void
Called when the forwarded sockets selector has been registered with a {@link com,maverick.nio.SelectorThread}.protected void
protected byte[]
openChannel
(byte[] requestdata) Open a forwarding channel.void
setBoundChannel
(CallbackForwardingChannel<?> channel) Methods inherited from class com.sshtools.synergy.ssh.ForwardingChannel
checkWindowSpace, getHost, getOriginatingHost, getOriginatingPort, getPort
Methods inherited from class com.sshtools.synergy.ssh.ChannelNG
addEventListener, canClose, clearIdleState, close, close, close, createCache, disposeCache, evaluateWindowSpace, getChannelType, getCloseFuture, getConnection, getConnectionProtocol, getContext, getInputStream, getLastActivity, getLocalId, getLocalPacket, getLocalWindow, getMaxiumRemotePacketSize, getMaxiumRemoteWindowSize, getOpenFuture, getOutputStream, getRemoteId, getRemotePacket, getRemoteWindow, getSessionIdentifier, getTimeout, haltIncomingData, isAutoConsume, isClosed, isClosing, isConnected, isIncomingDataHalted, isLocalEOF, isOpen, isRemoteEOF, log, log, log, log, logMessage, logMessage, onChannelError, onExtendedData, onRemoteClose, onWindowAdjust, processChannelRequestResponse, registerExtendedDataType, resetIdleState, resumeIncomingData, sendChannelDataAndBlock, sendChannelDataAndBlock, sendChannelDataAndBlock, sendChannelDataAndBlock, sendChannelDataAndBlock, sendChannelDataAndBlock, sendChannelRequest, sendChannelRequest, sendData, sendEOF, sendExtendedData, sendExtendedData, sendRequestResponse, sendWindowAdjust, sendWindowAdjust, setTimeout
-
Constructor Details
-
CallbackForwardingChannel
public CallbackForwardingChannel(com.sshtools.common.ssh.Context ctx, com.sshtools.common.ssh.SshConnection callbackClient) -
CallbackForwardingChannel
public CallbackForwardingChannel(com.sshtools.common.ssh.Context ctx, com.sshtools.common.ssh.SshConnection callbackClient, String hostToConnect, int portToConnect) -
CallbackForwardingChannel
public CallbackForwardingChannel(String channelType, com.sshtools.common.ssh.SshConnection con, String hostToConnect, int portToConnect) Constructs a forwarding channel of the type "forwarded-tcpip"- Parameters:
addressToBind
- StringportToBind
- intsocketChannel
- SocketChannel
-
-
Method Details
-
setBoundChannel
-
createChannel
Create the forwarding channel.- Specified by:
createChannel
in classcom.sshtools.synergy.ssh.ChannelNG<T extends com.sshtools.synergy.ssh.SshContext>
- Returns:
- byte[]
- Throws:
IOException
-
openChannel
protected byte[] openChannel(byte[] requestdata) throws com.sshtools.common.nio.WriteOperationRequest, com.sshtools.common.ssh.ChannelOpenException Open a forwarding channel.- Specified by:
openChannel
in classcom.sshtools.synergy.ssh.ChannelNG<T extends com.sshtools.synergy.ssh.SshContext>
- Parameters:
requestdata
- byte[]- Returns:
- byte[]
- Throws:
com.sshtools.common.nio.WriteOperationRequest
com.sshtools.common.ssh.ChannelOpenException
-
checkPermissions
protected boolean checkPermissions() -
onRegistrationComplete
protected void onRegistrationComplete()Called when the forwarded sockets selector has been registered with a {@link com,maverick.nio.SelectorThread}. -
onChannelOpenConfirmation
protected void onChannelOpenConfirmation()Called when the channel has been confirmed as open.- Specified by:
onChannelOpenConfirmation
in classcom.sshtools.synergy.ssh.ChannelNG<T extends com.sshtools.synergy.ssh.SshContext>
-
onChannelData
- Overrides:
onChannelData
in classcom.sshtools.synergy.ssh.ChannelNG<T extends com.sshtools.synergy.ssh.SshContext>
-
onChannelOpenFailure
protected void onChannelOpenFailure()- Overrides:
onChannelOpenFailure
in classcom.sshtools.synergy.ssh.ChannelNG<T extends com.sshtools.synergy.ssh.SshContext>
-
onChannelFree
protected void onChannelFree()- Specified by:
onChannelFree
in classcom.sshtools.synergy.ssh.ChannelNG<T extends com.sshtools.synergy.ssh.SshContext>
-
onChannelClosed
protected void onChannelClosed()- Specified by:
onChannelClosed
in classcom.sshtools.synergy.ssh.ChannelNG<T extends com.sshtools.synergy.ssh.SshContext>
-
onChannelOpen
protected void onChannelOpen()- Specified by:
onChannelOpen
in classcom.sshtools.synergy.ssh.ChannelNG<T extends com.sshtools.synergy.ssh.SshContext>
-
onChannelClosing
protected void onChannelClosing()- Specified by:
onChannelClosing
in classcom.sshtools.synergy.ssh.ChannelNG<T extends com.sshtools.synergy.ssh.SshContext>
-
onChannelRequest
- Specified by:
onChannelRequest
in classcom.sshtools.synergy.ssh.ChannelNG<T extends com.sshtools.synergy.ssh.SshContext>
-
onRemoteEOF
protected void onRemoteEOF()- Specified by:
onRemoteEOF
in classcom.sshtools.synergy.ssh.ChannelNG<T extends com.sshtools.synergy.ssh.SshContext>
-
onLocalEOF
protected void onLocalEOF()- Specified by:
onLocalEOF
in classcom.sshtools.synergy.ssh.ChannelNG<T extends com.sshtools.synergy.ssh.SshContext>
-