Package org.apache.sshd.common.forward
Class DefaultForwarderFactory
- java.lang.Object
-
- org.apache.sshd.common.forward.DefaultForwarderFactory
-
- All Implemented Interfaces:
ForwardingFilterFactory
,PortForwardingEventListenerManager
public class DefaultForwarderFactory extends java.lang.Object implements ForwardingFilterFactory, PortForwardingEventListenerManager
The defaultForwardingFilterFactory
implementation.
-
-
Field Summary
Fields Modifier and Type Field Description static DefaultForwarderFactory
INSTANCE
private PortForwardingEventListener
listenerProxy
private java.util.Collection<PortForwardingEventListener>
listeners
-
Constructor Summary
Constructors Constructor Description DefaultForwarderFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPortForwardingEventListener(PortForwardingEventListener listener)
Add a port forwarding listenerForwardingFilter
create(ConnectionService service)
Creates the forwarder to be used for TCP/IP port forwards for this session.PortForwardingEventListener
getPortForwardingEventListenerProxy()
void
removePortForwardingEventListener(PortForwardingEventListener listener)
Remove a port forwarding listener
-
-
-
Field Detail
-
INSTANCE
public static final DefaultForwarderFactory INSTANCE
-
listeners
private final java.util.Collection<PortForwardingEventListener> listeners
-
listenerProxy
private final PortForwardingEventListener listenerProxy
-
-
Method Detail
-
getPortForwardingEventListenerProxy
public PortForwardingEventListener getPortForwardingEventListenerProxy()
- Specified by:
getPortForwardingEventListenerProxy
in interfacePortForwardingEventListenerManager
- Returns:
- A proxy listener representing all the currently registered listener through this manager
-
addPortForwardingEventListener
public void addPortForwardingEventListener(PortForwardingEventListener listener)
Description copied from interface:PortForwardingEventListenerManager
Add a port forwarding listener- Specified by:
addPortForwardingEventListener
in interfacePortForwardingEventListenerManager
- Parameters:
listener
- ThePortForwardingEventListener
to add - nevernull
-
removePortForwardingEventListener
public void removePortForwardingEventListener(PortForwardingEventListener listener)
Description copied from interface:PortForwardingEventListenerManager
Remove a port forwarding listener- Specified by:
removePortForwardingEventListener
in interfacePortForwardingEventListenerManager
- Parameters:
listener
- ThePortForwardingEventListener
to remove - ignored ifnull
-
create
public ForwardingFilter create(ConnectionService service)
Description copied from interface:ForwardingFilterFactory
Creates the forwarder to be used for TCP/IP port forwards for this session.- Specified by:
create
in interfaceForwardingFilterFactory
- Parameters:
service
- theConnectionService
the connections are forwarded through- Returns:
- the
ForwardingFilter
that will listen for connections and set up forwarding
-
-