Package com.sshtools.j2ssh.forwarding
Class ForwardingListener
java.lang.Object
com.sshtools.j2ssh.forwarding.ForwardingConfiguration
com.sshtools.j2ssh.forwarding.ForwardingListener
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
ForwardingClient.ClientForwardingListener
- Version:
- $Revision: 1.30 $
- Author:
- $author$
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sshtools.j2ssh.forwarding.ForwardingConfiguration
ForwardingConfiguration.ForwardingConfigurationMonitor
-
Field Summary
Fields inherited from class com.sshtools.j2ssh.forwarding.ForwardingConfiguration
addressToBind, hostToConnect, listenerList, monitor, name, portToBind, portToConnect, state
-
Constructor Summary
ConstructorsConstructorDescriptionForwardingListener
(ConnectionProtocol connection, String addressToBind, int portToBind) Creates a new ForwardingListener object.ForwardingListener
(String name, ConnectionProtocol connection, String addressToBind, int portToBind, String hostToConnect, int portToConnect) Creates a new ForwardingListener object. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ForwardingSocketChannel
createChannel
(String hostToConnect, int portToConnect, Socket socket) int
boolean
boolean
void
run()
void
start()
void
stop()
Methods inherited from class com.sshtools.j2ssh.forwarding.ForwardingConfiguration
addForwardingConfigurationListener, createForwardingBindingChannel, createForwardingIOChannel, createForwardingSocketChannel, getActiveForwardingSocketChannels, getAddressToBind, getHostToConnect, getName, getPortToBind, getPortToConnect, getState, isForwarding, removeForwardingConfigurationListener
-
Constructor Details
-
ForwardingListener
public ForwardingListener(String name, ConnectionProtocol connection, String addressToBind, int portToBind, String hostToConnect, int portToConnect) Creates a new ForwardingListener object.- Parameters:
name
-connection
-addressToBind
-portToBind
-hostToConnect
-portToConnect
-
-
ForwardingListener
Creates a new ForwardingListener object.- Parameters:
connection
-addressToBind
-portToBind
-
-
-
Method Details
-
getLocalPort
public int getLocalPort()- Returns:
-
isListening
public boolean isListening()- Returns:
-
run
public void run() -
isRunning
public boolean isRunning()- Returns:
-
start
- Overrides:
start
in classForwardingConfiguration
- Throws:
IOException
-
stop
public void stop()- Overrides:
stop
in classForwardingConfiguration
-
createChannel
protected abstract ForwardingSocketChannel createChannel(String hostToConnect, int portToConnect, Socket socket) throws ForwardingConfigurationException - Parameters:
hostToConnect
-portToConnect
-socket
-- Returns:
- Throws:
ForwardingConfigurationException
-