org.apache.servicemix.ftp
Class FTPClientPool

java.lang.Object
  extended by org.apache.servicemix.ftp.SocketClientPoolSupport
      extended by org.apache.servicemix.ftp.FTPClientPool
All Implemented Interfaces:
org.apache.commons.pool.PoolableObjectFactory, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

public class FTPClientPool
extends SocketClientPoolSupport

A pool of FTP clients for the Jakarta Commons Net library

Version:
$Revision: 426415 $

Field Summary
static java.lang.String DEFAULT_CONTROL_ENCODING
           
static int DEFAULT_DATA_TIMEOUT
           
 
Constructor Summary
FTPClientPool()
           
 
Method Summary
 void activateObject(java.lang.Object object)
           
protected  void connect(org.apache.commons.net.SocketClient client)
           
protected  org.apache.commons.net.SocketClient createSocketClient()
           
protected  void disconnect(org.apache.commons.net.SocketClient client)
           
 org.apache.commons.net.ftp.FTPClientConfig getConfig()
           
 java.lang.String getControlEncoding()
           
 int getDataTimeout()
           
 java.lang.String getPassword()
           
 java.lang.String getUsername()
           
 boolean isBinaryMode()
           
 boolean isPassiveMode()
           
 void passivateObject(java.lang.Object object)
           
 void setBinaryMode(boolean binaryMode)
          Use binary mode transfers.
 void setConfig(org.apache.commons.net.ftp.FTPClientConfig config)
          Configure a custom FTPClientConfig instance to allow more fine-grained control over the FTP connections in the pool.
 void setControlEncoding(java.lang.String controlEncoding)
          Configure the encoding used in the FTP control connections.
 void setDataTimeout(int dataTimeout)
          Specifies a timeout used on the FTP data connection.
 void setPassiveMode(boolean passiveMode)
          Use passive mode FTP transfers.
 void setPassword(java.lang.String password)
          Set the password for logging into the FTP server.
 void setUsername(java.lang.String username)
          Set the login to use to access the FTP server.
 boolean validateObject(java.lang.Object object)
           
 
Methods inherited from class org.apache.servicemix.ftp.SocketClientPoolSupport
afterPropertiesSet, borrowClient, destroy, destroyObject, getAddress, getHost, getLocalAddress, getLocalPort, getPool, getPort, makeObject, returnClient, setAddress, setHost, setLocalAddress, setLocalPort, setPool, setPort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DATA_TIMEOUT

public static final int DEFAULT_DATA_TIMEOUT
See Also:
Constant Field Values

DEFAULT_CONTROL_ENCODING

public static final java.lang.String DEFAULT_CONTROL_ENCODING
See Also:
Constant Field Values
Constructor Detail

FTPClientPool

public FTPClientPool()
Method Detail

validateObject

public boolean validateObject(java.lang.Object object)
Specified by:
validateObject in interface org.apache.commons.pool.PoolableObjectFactory
Overrides:
validateObject in class SocketClientPoolSupport

activateObject

public void activateObject(java.lang.Object object)
                    throws java.lang.Exception
Specified by:
activateObject in interface org.apache.commons.pool.PoolableObjectFactory
Overrides:
activateObject in class SocketClientPoolSupport
Throws:
java.lang.Exception

passivateObject

public void passivateObject(java.lang.Object object)
                     throws java.lang.Exception
Specified by:
passivateObject in interface org.apache.commons.pool.PoolableObjectFactory
Overrides:
passivateObject in class SocketClientPoolSupport
Throws:
java.lang.Exception

getUsername

public java.lang.String getUsername()

setUsername

public void setUsername(java.lang.String username)
Set the login to use to access the FTP server.

Parameters:
username -

getPassword

public java.lang.String getPassword()

setPassword

public void setPassword(java.lang.String password)
Set the password for logging into the FTP server.

Parameters:
password - to set.

isBinaryMode

public boolean isBinaryMode()

setBinaryMode

public void setBinaryMode(boolean binaryMode)
Use binary mode transfers. Defaults to true.

Parameters:
binaryMode - is a boolean setting the type of data transfer to binary. Default value is true.

isPassiveMode

public boolean isPassiveMode()
Returns:
the passiveMode

setPassiveMode

public void setPassiveMode(boolean passiveMode)
Use passive mode FTP transfers. Defaults to false

Parameters:
passiveMode - is a boolean setting the type into passive mode.

getConfig

public org.apache.commons.net.ftp.FTPClientConfig getConfig()

setConfig

public void setConfig(org.apache.commons.net.ftp.FTPClientConfig config)
Configure a custom FTPClientConfig instance to allow more fine-grained control over the FTP connections in the pool.

Parameters:
config - the config implementation to use.

getControlEncoding

public java.lang.String getControlEncoding()
Returns:
the controlEncoding

setControlEncoding

public void setControlEncoding(java.lang.String controlEncoding)
Configure the encoding used in the FTP control connections. Defaults to ISO-8859-1

Parameters:
controlEncoding - the controlEncoding to set

getDataTimeout

public int getDataTimeout()
Returns:
the dataTimeout

setDataTimeout

public void setDataTimeout(int dataTimeout)
Specifies a timeout used on the FTP data connection. Defaults to 120000

Parameters:
dataTimeout - after which the connection should be closed. .

connect

protected void connect(org.apache.commons.net.SocketClient client)
                throws java.lang.Exception
Overrides:
connect in class SocketClientPoolSupport
Throws:
java.lang.Exception

disconnect

protected void disconnect(org.apache.commons.net.SocketClient client)
                   throws java.lang.Exception
Overrides:
disconnect in class SocketClientPoolSupport
Throws:
java.lang.Exception

createSocketClient

protected org.apache.commons.net.SocketClient createSocketClient()
Specified by:
createSocketClient in class SocketClientPoolSupport


Copyright © 2005-2012 FuseSource. All Rights Reserved.