org.springframework.integration.ftp.session
Class AbstractFtpSessionFactory<T extends org.apache.commons.net.ftp.FTPClient>

java.lang.Object
  extended by org.springframework.integration.ftp.session.AbstractFtpSessionFactory<T>
All Implemented Interfaces:
SessionFactory
Direct Known Subclasses:
DefaultFtpSessionFactory, DefaultFtpsSessionFactory

public abstract class AbstractFtpSessionFactory<T extends org.apache.commons.net.ftp.FTPClient>
extends java.lang.Object
implements SessionFactory

Base class for FTP SessionFactory implementations.

Since:
2.0

Field Summary
protected  int bufferSize
           
protected  int clientMode
           
protected  org.apache.commons.net.ftp.FTPClientConfig config
           
static java.lang.String DEFAULT_REMOTE_WORKING_DIRECTORY
           
protected  int fileType
           
protected  java.lang.String host
           
protected  java.lang.String password
           
protected  int port
           
protected  java.lang.String username
           
 
Constructor Summary
AbstractFtpSessionFactory()
           
 
Method Summary
protected abstract  T createClientInstance()
           
 Session getSession()
           
protected  void postProcessClientAfterConnect(T t)
          Will handle additional initialization after client.connect() method was invoked, but before any action on the client has been taken
protected  void postProcessClientBeforeConnect(T client)
          Will handle additional initialization before client.connect() method was invoked.
 void setBufferSize(int bufferSize)
           
 void setClientMode(int clientMode)
          ACTIVE_LOCAL_DATA_CONNECTION_MODE = 0
A constant indicating the FTP session is expecting all transfers to occur between the client (local) and server and that the server should connect to the client's data port to initiate a data transfer.
 void setConfig(org.apache.commons.net.ftp.FTPClientConfig config)
           
 void setFileType(int fileType)
          File types defined by FTP constants: FTP.ASCII_FILE_TYPE FTP.EBCDIC_FILE_TYPE FTP.BINARY_FILE_TYPE (DEFAULT) FTP.LOCAL_FILE_TYPE
 void setHost(java.lang.String host)
           
 void setPassword(java.lang.String pass)
           
 void setPort(int port)
           
 void setUsername(java.lang.String user)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_REMOTE_WORKING_DIRECTORY

public static final java.lang.String DEFAULT_REMOTE_WORKING_DIRECTORY
See Also:
Constant Field Values

config

protected org.apache.commons.net.ftp.FTPClientConfig config

username

protected java.lang.String username

host

protected java.lang.String host

password

protected java.lang.String password

port

protected int port

bufferSize

protected int bufferSize

clientMode

protected int clientMode

fileType

protected int fileType
Constructor Detail

AbstractFtpSessionFactory

public AbstractFtpSessionFactory()
Method Detail

setFileType

public void setFileType(int fileType)
File types defined by FTP constants:

Parameters:
fileType -

setConfig

public void setConfig(org.apache.commons.net.ftp.FTPClientConfig config)

setBufferSize

public void setBufferSize(int bufferSize)

setHost

public void setHost(java.lang.String host)

setPort

public void setPort(int port)

setUsername

public void setUsername(java.lang.String user)

setPassword

public void setPassword(java.lang.String pass)

setClientMode

public void setClientMode(int clientMode)
ACTIVE_LOCAL_DATA_CONNECTION_MODE = 0
A constant indicating the FTP session is expecting all transfers to occur between the client (local) and server and that the server should connect to the client's data port to initiate a data transfer. This is the default data connection mode when and FTPClient instance is created. PASSIVE_LOCAL_DATA_CONNECTION_MODE = 2
A constant indicating the FTP session is expecting all transfers to occur between the client (local) and server and that the server is in passive mode, requiring the client to connect to the server's data port to initiate a transfer.


getSession

public Session getSession()
Specified by:
getSession in interface SessionFactory

createClientInstance

protected abstract T createClientInstance()

postProcessClientAfterConnect

protected void postProcessClientAfterConnect(T t)
                                      throws java.io.IOException
Will handle additional initialization after client.connect() method was invoked, but before any action on the client has been taken

Throws:
java.io.IOException

postProcessClientBeforeConnect

protected void postProcessClientBeforeConnect(T client)
                                       throws java.io.IOException
Will handle additional initialization before client.connect() method was invoked.

Throws:
java.io.IOException