org.apache.ftpserver.listener.nio
Class NioListener

java.lang.Object
  extended by org.apache.ftpserver.listener.AbstractListener
      extended by org.apache.ftpserver.listener.nio.NioListener
All Implemented Interfaces:
Listener

public class NioListener
extends AbstractListener

The default Listener implementation.


Constructor Summary
NioListener()
           
 
Method Summary
 java.util.Set<FtpIoSession> getActiveSessions()
          Returns the currently active sessions for this listener.
 java.util.List<java.net.InetAddress> getBlockedAddresses()
          Retrives the InetAddress for which this listener blocks connections
 java.util.List<org.apache.mina.filter.firewall.Subnet> getBlockedSubnets()
          Retrives the Subnets for which this acceptor blocks connections
 java.util.concurrent.ExecutorService getFilterExecutor()
          Get the ExecutorService used for processing requests.
 FtpHandler getHandler()
           
 int getIdleTimeout()
           
 boolean isStopped()
          Checks if the listener is currently started.
 boolean isSuspended()
          Checks if the listener is currently suspended
 void resume()
          Resumes a suspended listener.
 void setBlockedAddresses(java.util.List<java.net.InetAddress> blockedAddresses)
          Sets the InetAddress that this listener will block from connecting
 void setBlockedSubnets(java.util.List<org.apache.mina.filter.firewall.Subnet> blockedSubnets)
          Sets the Subnets that this listener will block from connecting
 void setFilterExecutor(java.util.concurrent.ExecutorService filterExecutor)
          Set the ExecutorService used for processing requests
 void setHandler(FtpHandler handler)
           
 void setIdleTimeout(int idleTimeout)
           
 void start(FtpServerContext context)
          Start the listener, will initiate the listener waiting on the socket.
 void stop()
          Stop the listener, it should no longer except socket requests.
 void suspend()
          Temporarily stops the listener from accepting socket requests.
 
Methods inherited from class org.apache.ftpserver.listener.AbstractListener
getDataConnectionConfiguration, getPort, getServerAddress, getSslConfiguration, isImplicitSsl, setDataConnectionConfiguration, setImplicitSsl, setPort, setServerAddress, setSslConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NioListener

public NioListener()
Method Detail

getIdleTimeout

public int getIdleTimeout()

setIdleTimeout

public void setIdleTimeout(int idleTimeout)

start

public void start(FtpServerContext context)
           throws java.lang.Exception
Description copied from interface: Listener
Start the listener, will initiate the listener waiting on the socket. The method should not return until the listener has started accepting socket requests.

Throws:
java.lang.Exception - On error during start up
See Also:
Listener.start(FtpServerContext)

stop

public void stop()
Description copied from interface: Listener
Stop the listener, it should no longer except socket requests. The method should not return until the listener has stopped accepting socket requests.

See Also:
Listener.stop()

isStopped

public boolean isStopped()
Description copied from interface: Listener
Checks if the listener is currently started.

Returns:
True if the listener is started
See Also:
Listener.isStopped()

isSuspended

public boolean isSuspended()
Description copied from interface: Listener
Checks if the listener is currently suspended

Returns:
True if the listener is suspended
See Also:
Listener.isSuspended()

resume

public void resume()
Description copied from interface: Listener
Resumes a suspended listener. The method should not return until the listener has started accepting socket requests.

See Also:
Listener.resume()

suspend

public void suspend()
Description copied from interface: Listener
Temporarily stops the listener from accepting socket requests. Resume the listener by using the Listener.resume() method. The method should not return until the listener has stopped accepting socket requests.

See Also:
Listener.suspend()

getFilterExecutor

public java.util.concurrent.ExecutorService getFilterExecutor()
Get the ExecutorService used for processing requests. The default value is a cached thread pool.

Returns:
The ExecutorService

setFilterExecutor

public void setFilterExecutor(java.util.concurrent.ExecutorService filterExecutor)
Set the ExecutorService used for processing requests

Parameters:
filterExecutor - The ExecutorService

getHandler

public FtpHandler getHandler()

setHandler

public void setHandler(FtpHandler handler)

getBlockedAddresses

public java.util.List<java.net.InetAddress> getBlockedAddresses()
Retrives the InetAddress for which this listener blocks connections

Returns:
The list of InetAddresses

setBlockedAddresses

public void setBlockedAddresses(java.util.List<java.net.InetAddress> blockedAddresses)
Sets the InetAddress that this listener will block from connecting

Parameters:
blockedAddresses - The list of InetAddresses

getBlockedSubnets

public java.util.List<org.apache.mina.filter.firewall.Subnet> getBlockedSubnets()
Retrives the Subnets for which this acceptor blocks connections

Returns:
The list of Subnets

setBlockedSubnets

public void setBlockedSubnets(java.util.List<org.apache.mina.filter.firewall.Subnet> blockedSubnets)
Sets the Subnets that this listener will block from connecting

Parameters:
blockedAddresses - The list of Subnets

getActiveSessions

public java.util.Set<FtpIoSession> getActiveSessions()
Description copied from interface: Listener
Returns the currently active sessions for this listener. If no sessions are active, an empty Set would be returned.

Returns:
The currently active sessions
See Also:
Listener.getActiveSessions()


Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.