org.apache.ftpserver.listener
Class ListenerFactory

java.lang.Object
  extended by org.apache.ftpserver.listener.ListenerFactory

public class ListenerFactory
extends Object

Factory for listeners. Listeners themselves are immutable and must be created using this factory.

Author:
Apache MINA Project

Constructor Summary
ListenerFactory()
          Default constructor
ListenerFactory(Listener listener)
          Copy constructor, will copy properties from the provided listener.
 
Method Summary
 Listener createListener()
          Create a listener based on the settings of this factory.
 List<InetAddress> getBlockedAddresses()
          Deprecated. Replaced by the IpFilter. Retrieves the InetAddress for which listeners created by this factory blocks connections
 List<org.apache.mina.filter.firewall.Subnet> getBlockedSubnets()
          Deprecated. Replaced by the IpFilter. Retrives the Subnets for which listeners created by this factory blocks connections
 DataConnectionConfiguration getDataConnectionConfiguration()
          Get configuration for data connections made within listeners created by this factory
 int getIdleTimeout()
          Get the number of seconds during which no network activity is allowed before a session is closed due to inactivity.
 IpFilter getIpFilter()
          Returns the currently configured IP filter, if any.
 int getPort()
          Get the port on which listeners created by this factory is waiting for requests.
 String getServerAddress()
          Get the InetAddress used for binding the local socket.
 SslConfiguration getSslConfiguration()
          Get the SslConfiguration used for listeners created by this factory
 boolean isImplicitSsl()
          Is listeners created by this factory in SSL mode automatically or must the client explicitly request to use SSL
 void setBlockedAddresses(List<InetAddress> blockedAddresses)
          Deprecated. Replaced by the IpFilter. Sets the InetAddress that listeners created by this factory will block from connecting
 void setBlockedSubnets(List<org.apache.mina.filter.firewall.Subnet> blockedSubnets)
          Deprecated. Replaced by the IpFilter. Sets the Subnets that listeners created by this factory will block from connecting
 void setDataConnectionConfiguration(DataConnectionConfiguration dataConnectionConfig)
          Set configuration for data connections made within listeners created by this factory
 void setIdleTimeout(int idleTimeout)
          Set the number of seconds during which no network activity is allowed before a session is closed due to inactivity.
 void setImplicitSsl(boolean implicitSsl)
          Should listeners created by this factory be in SSL mode automatically or must the client explicitly request to use SSL
 void setIpFilter(IpFilter ipFilter)
          Sets the IP filter to the given filter.
 void setPort(int port)
          Set the port on which listeners created by this factory will accept requests.
 void setServerAddress(String serverAddress)
          Set the InetAddress used for binding the local socket.
 void setSslConfiguration(SslConfiguration ssl)
          Set the SslConfiguration to use by listeners created by this factory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListenerFactory

public ListenerFactory()
Default constructor


ListenerFactory

public ListenerFactory(Listener listener)
Copy constructor, will copy properties from the provided listener.

Parameters:
listener - The listener which properties will be used for this factory
Method Detail

createListener

public Listener createListener()
Create a listener based on the settings of this factory. The listener is immutable.

Returns:
The created listener

isImplicitSsl

public boolean isImplicitSsl()
Is listeners created by this factory in SSL mode automatically or must the client explicitly request to use SSL

Returns:
true is listeners created by this factory is automatically in SSL mode, false otherwise

setImplicitSsl

public void setImplicitSsl(boolean implicitSsl)
Should listeners created by this factory be in SSL mode automatically or must the client explicitly request to use SSL

Parameters:
implicitSsl - true is listeners created by this factory should automatically be in SSL mode, false otherwise

getPort

public int getPort()
Get the port on which listeners created by this factory is waiting for requests.

Returns:
The port

setPort

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

Parameters:
port - The port to use.

getServerAddress

public 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

setServerAddress

public void setServerAddress(String 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

getSslConfiguration

public SslConfiguration getSslConfiguration()
Get the SslConfiguration used for listeners created by this factory

Returns:
The SslConfiguration

setSslConfiguration

public void setSslConfiguration(SslConfiguration ssl)
Set the SslConfiguration to use by listeners created by this factory

Parameters:
ssl - The SslConfiguration

getDataConnectionConfiguration

public DataConnectionConfiguration getDataConnectionConfiguration()
Get configuration for data connections made within listeners created by this factory

Returns:
The data connection configuration

setDataConnectionConfiguration

public void setDataConnectionConfiguration(DataConnectionConfiguration dataConnectionConfig)
Set configuration for data connections made within listeners created by this factory

Parameters:
dataConnectionConfig - The data connection configuration

getIdleTimeout

public 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

setIdleTimeout

public void setIdleTimeout(int idleTimeout)
Set the number of seconds during which no network activity is allowed before a session is closed due to inactivity.

Parameters:
idleTimeout - The idle timeout in seconds

getBlockedAddresses

@Deprecated
public List<InetAddress> getBlockedAddresses()
Deprecated. Replaced by the IpFilter. Retrieves the InetAddress for which listeners created by this factory blocks connections

Returns:
The list of InetAddresses

setBlockedAddresses

@Deprecated
public void setBlockedAddresses(List<InetAddress> blockedAddresses)
Deprecated. Replaced by the IpFilter. Sets the InetAddress that listeners created by this factory will block from connecting

Parameters:
blockedAddresses - The list of InetAddresses

getBlockedSubnets

@Deprecated
public List<org.apache.mina.filter.firewall.Subnet> getBlockedSubnets()
Deprecated. Replaced by the IpFilter. Retrives the Subnets for which listeners created by this factory blocks connections

Returns:
The list of Subnets

setBlockedSubnets

@Deprecated
public void setBlockedSubnets(List<org.apache.mina.filter.firewall.Subnet> blockedSubnets)
Deprecated. Replaced by the IpFilter. Sets the Subnets that listeners created by this factory will block from connecting

Parameters:
blockedSubnets - The list of Subnets
blockedAddresses -

getIpFilter

public IpFilter getIpFilter()
Returns the currently configured IP filter, if any.

Returns:
the currently configured IP filter, if any. Returns null, if no IP filter is configured.

setIpFilter

public void setIpFilter(IpFilter ipFilter)
Sets the IP filter to the given filter.

Parameters:
ipFilter - the IP filter.


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