org.apache.ftpserver.listener
Interface Listener

All Known Implementing Classes:
AbstractListener, NioListener

public interface Listener

Interface for the component responsible for waiting for incoming socket requests and kicking off FtpIoSessions

Version:
$Rev$, $Date$
Author:
The Apache MINA Project (dev@mina.apache.org)

Method Summary
 java.util.Set<FtpIoSession> getActiveSessions()
          Returns the currently active sessions for this listener.
 java.util.List<java.net.InetAddress> getBlockedAddresses()
          Retrieves the InetAddress for which this listener blocks connections
 java.util.List<org.apache.mina.filter.firewall.Subnet> getBlockedSubnets()
          Retrieves the Subnets for this listener blocks connections
 DataConnectionConfiguration getDataConnectionConfiguration()
          Get configuration for data connections made within this listener
 int getIdleTimeout()
          Get the number of seconds during which no network activity is allowed before a session is closed due to inactivity.
 int getPort()
          Get the port on which this listener is waiting for requests.
 java.lang.String getServerAddress()
          Get the InetAddress used for binding the local socket.
 SslConfiguration getSslConfiguration()
          Get the SslConfiguration used for this listener
 boolean isImplicitSsl()
          Is this listener in SSL mode automatically or must the client explicitly request to use SSL
 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 start(FtpServerContext serverContext)
          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.
 

Method Detail

start

void start(FtpServerContext serverContext)
Start the listener, will initiate the listener waiting on the socket. The method should not return until the listener has started accepting socket requests.

Parameters:
serverContext - The current FtpServerContext
Throws:
java.lang.Exception - On error during start up

stop

void stop()
Stop the listener, it should no longer except socket requests. The method should not return until the listener has stopped accepting socket requests.


isStopped

boolean isStopped()
Checks if the listener is currently started.

Returns:
True if the listener is started

suspend

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


resume

void resume()
Resumes a suspended listener. The method should not return until the listener has started accepting socket requests.


isSuspended

boolean isSuspended()
Checks if the listener is currently suspended

Returns:
True if the listener is suspended

getActiveSessions

java.util.Set<FtpIoSession> getActiveSessions()
Returns the currently active sessions for this listener. If no sessions are active, an empty Set would be returned.

Returns:
The currently active sessions

isImplicitSsl

boolean isImplicitSsl()
Is this listener in SSL mode automatically or must the client explicitly request to use SSL

Returns:
true is the listener is automatically in SSL mode, false otherwise

getSslConfiguration

SslConfiguration getSslConfiguration()
Get the SslConfiguration used for this listener

Returns:
The current SslConfiguration

getPort

int getPort()
Get the port on which this listener is waiting for requests. For listeners where the port is automatically assigned, this will return the bound port.

Returns:
The port

getServerAddress

java.lang.String getServerAddress()
Get the InetAddress used for binding the local socket. Defaults to null, that is, the server binds to all available network interfaces

Returns:
The local socket InetAddress, if set

getDataConnectionConfiguration

DataConnectionConfiguration getDataConnectionConfiguration()
Get configuration for data connections made within this listener

Returns:
The data connection configuration

getIdleTimeout

int getIdleTimeout()
Get the number of seconds during which no network activity is allowed before a session is closed due to inactivity.

Returns:
The idle time out

getBlockedAddresses

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

Returns:
The list of InetAddresses

getBlockedSubnets

java.util.List<org.apache.mina.filter.firewall.Subnet> getBlockedSubnets()
Retrieves the Subnets for this listener blocks connections

Returns:
The list of Subnets


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.