Package com.sshtools.synergy.ssh
Class SocketListeningForwardingChannelFactoryImpl<T extends SshContext>
java.lang.Object
com.sshtools.synergy.nio.ClientAcceptor
com.sshtools.synergy.ssh.SocketListeningForwardingChannelFactoryImpl<T>
- All Implemented Interfaces:
ForwardingChannelFactory<T>
public abstract class SocketListeningForwardingChannelFactoryImpl<T extends SshContext>
extends ClientAcceptor
implements ForwardingChannelFactory<T>
This class implements the standard socket based forwarding for the SSHD.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SocketAddressprotected Stringprotected Stringprotected ConnectionProtocol<T>protected intprotected ServerSocketChannel -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbelongsTo(ConnectionProtocol<T> connection) Does this factory belong to the connection provided?intbindInterface(String addressToBind, int portToBind, ConnectionProtocol<?> connection, String channelType) intbindInterface(String addressToBind, int portToBind, ConnectionProtocol<T> connection) A client has requested that the server start listening and forward any subsequent connections to the client.protected abstract ForwardingChannel<T>createChannel(String channelType, SshConnection con, String addressToBind, int portToBind, SocketChannel sc, T context) booleanfinishAccept(SelectionKey key, ListeningInterface li) Complete the accept operation.voidStop accepting clientsvoidstopListening(boolean dropActiveTunnels) Stop listening on active interfaces.Methods inherited from class com.sshtools.synergy.nio.ClientAcceptor
finishAcceptMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sshtools.synergy.ssh.ForwardingChannelFactory
getChannelType, getStartedEventCode, getStoppedEventCode
-
Field Details
-
addressToBind
-
portToBind
protected int portToBind -
socketChannel
-
connection
-
addr
-
channelType
-
activeRemoteForwardings
protected SocketListeningForwardingChannelFactoryImpl.ActiveTunnelManager<T extends SshContext> activeRemoteForwardings
-
-
Constructor Details
-
SocketListeningForwardingChannelFactoryImpl
public SocketListeningForwardingChannelFactoryImpl()
-
-
Method Details
-
getActiveTunnelManager
- Specified by:
getActiveTunnelManagerin interfaceForwardingChannelFactory<T extends SshContext>
-
belongsTo
Description copied from interface:ForwardingChannelFactoryDoes this factory belong to the connection provided?- Specified by:
belongsToin interfaceForwardingChannelFactory<T extends SshContext>- Parameters:
connection- ConnectionProtocol- Returns:
- boolean
-
bindInterface
public int bindInterface(String addressToBind, int portToBind, ConnectionProtocol<T> connection) throws IOException Description copied from interface:ForwardingChannelFactoryA client has requested that the server start listening and forward any subsequent connections to the client.- Specified by:
bindInterfacein interfaceForwardingChannelFactory<T extends SshContext>- Parameters:
addressToBind- StringportToBind- intconnection- ConnectionProtocol- Throws:
IOException
-
bindInterface
public int bindInterface(String addressToBind, int portToBind, ConnectionProtocol<?> connection, String channelType) throws IOException - Specified by:
bindInterfacein interfaceForwardingChannelFactory<T extends SshContext>- Throws:
IOException
-
finishAccept
Description copied from class:ClientAcceptorComplete the accept operation.- Specified by:
finishAcceptin classClientAcceptor- Parameters:
key- SelectionKey- Returns:
- boolean
-
createChannel
protected abstract ForwardingChannel<T> createChannel(String channelType, SshConnection con, String addressToBind, int portToBind, SocketChannel sc, T context) -
stopListening
public void stopListening(boolean dropActiveTunnels) Description copied from interface:ForwardingChannelFactoryStop listening on active interfaces.- Specified by:
stopListeningin interfaceForwardingChannelFactory<T extends SshContext>- Parameters:
dropActiveTunnels- boolean
-
stopAccepting
public void stopAccepting()Description copied from class:ClientAcceptorStop accepting clients- Specified by:
stopAcceptingin classClientAcceptor
-