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


Method Summary
 java.util.Set<FtpIoSession> getActiveSessions()
          Returns the currently active sessions for this listener.
 DataConnectionConfiguration getDataConnectionConfiguration()
          Get configuration for data connections made within this listener
 int getPort()
          Get the port on which this listener is waiting for requests.
 java.net.InetAddress 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 setDataConnectionConfiguration(DataConnectionConfiguration dataConnectionConfig)
          Set configuration for data connections made within this listener
 void setImplicitSsl(boolean implicitSsl)
          Should this listener be in SSL mode automatically or must the client explicitly request to use SSL
 void setPort(int port)
          Set the port on which this listener will accept requests.
 void setServerAddress(java.net.InetAddress serverAddress)
          Set the InetAddress used for binding the local socket.
 void setSslConfiguration(SslConfiguration sslConfiguration)
          Set the SslConfiguration used for this 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)
           throws java.lang.Exception
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

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

setImplicitSsl

void setImplicitSsl(boolean implicitSsl)
Should this listener be in SSL mode automatically or must the client explicitly request to use SSL

Parameters:
implicitSsl - true is the listener should automatically be in SSL mode, false otherwise

getSslConfiguration

SslConfiguration getSslConfiguration()
Get the SslConfiguration used for this listener

Returns:
The current SslConfiguration

setSslConfiguration

void setSslConfiguration(SslConfiguration sslConfiguration)
Set the SslConfiguration used for this listener

Parameters:
sslConfiguration - The 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

setPort

void setPort(int port)
Set the port on which this listener will accept requests. Or set to 0 (zero) is the port should be automatically assigned

Parameters:
port - The port to use.

getServerAddress

java.net.InetAddress 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

setServerAddress

void setServerAddress(java.net.InetAddress serverAddress)
Set the InetAddress used for binding the local socket. Defaults to null, that is, the server binds to all available network interfaces

Parameters:
serverAddress - The local socket InetAddress

getDataConnectionConfiguration

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

Returns:
The data connection configuration

setDataConnectionConfiguration

void setDataConnectionConfiguration(DataConnectionConfiguration dataConnectionConfig)
Set configuration for data connections made within this listener

Parameters:
dataConnectionConfig - The data connection configuration


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