org.mule.providers.ftp
Class FtpConnector

java.lang.Object
  extended byorg.mule.providers.AbstractConnector
      extended byorg.mule.providers.AbstractServiceEnabledConnector
          extended byorg.mule.providers.ftp.FtpConnector
All Implemented Interfaces:
Disposable, ExceptionListener, Initialisable, UMOConnectable, UMOConnector

public class FtpConnector
extends AbstractServiceEnabledConnector


Nested Class Summary
protected  class FtpConnector.FtpConnectionFactory
           
 
Field Summary
static String PROPERTY_BINARY_TRANSFER
           
static String PROPERTY_FILENAME
           
static String PROPERTY_OUTPUT_PATTERN
           
static String PROPERTY_PASSIVE_MODE
           
static String PROPERTY_POLLING_FREQUENCY
           
 
Fields inherited from class org.mule.providers.AbstractServiceEnabledConnector
serviceDescriptor, serviceOverrides
 
Fields inherited from class org.mule.providers.AbstractConnector
connected, connecting, createDispatcherPerRequest, createMultipleTransactedReceivers, defaultInboundTransformer, defaultOutboundTransformer, defaultResponseTransformer, dispatcherFactory, dispatchers, disposed, disposing, exceptionListener, initialised, logger, name, receivers, serverSide, sessionHandler, started, startOnConnect
 
Fields inherited from interface org.mule.umo.provider.UMOConnector
INT_VALUE_NOT_SET
 
Constructor Summary
FtpConnector()
           
 
Method Summary
 UMOMessageReceiver createReceiver(UMOComponent component, UMOEndpoint endpoint)
           
 void destroyFtp(UMOEndpointURI uri, FTPClient client)
           
protected  void doStop()
          Template method to perform any work when stopping the connectoe
 void enterActiveOrPassiveMode(FTPClient client, UMOImmutableEndpoint endpoint)
          Passive mode is OFF by default.
 FilenameParser getFilenameParser()
           
 FTPClient getFtp(UMOEndpointURI uri)
           
protected  ObjectPool getFtpPool(UMOEndpointURI uri)
           
 String getOutputPattern()
           
 long getPollingFrequency()
           
 String getProtocol()
           
 boolean isBinary()
          Getter for FTP transfer type.
 boolean isPassive()
          Getter for FTP passive mode.
 boolean isValidateConnections()
          Whether to test FTP connection on each take from pool.
 void releaseFtp(UMOEndpointURI uri, FTPClient client)
           
 void setBinary(boolean binary)
          Setter for FTP transfer type.
 void setFilenameParser(FilenameParser filenameParser)
           
 void setOutputPattern(String outputPattern)
           
 void setPassive(boolean passive)
          Setter for FTP passive mode.
 void setPollingFrequency(long pollingFrequency)
           
 void setupFileType(FTPClient client, UMOImmutableEndpoint endpoint)
          Transfer type is BINARY by default.
 void setValidateConnections(boolean validateConnections)
          Whether to test FTP connection on each take from pool.
 
Methods inherited from class org.mule.providers.AbstractServiceEnabledConnector
doInitialise, getMessageAdapter, getServiceDescriptor, getServiceOverrides, getStreamMessageAdapter, initFromServiceDescriptor, initialiseFromUrl, setServiceOverrides
 
Methods inherited from class org.mule.providers.AbstractConnector
checkDisposed, connect, createDispatcher, destroyReceiver, disconnect, dispose, disposeDispatchers, disposeReceivers, doConnect, doDisconnect, doDispose, doStart, exceptionThrown, fireNotification, getConnectEventId, getConnectionDescription, getConnectionStrategy, getDefaultInboundTransformer, getDefaultOutboundTransformer, getDefaultResponseTransformer, getDispatcher, getDispatcher, getDispatcherFactory, getDispatchers, getDispatcherThreadingProfile, getExceptionListener, getName, getReceiver, getReceiver, getReceiverKey, getReceivers, getReceivers, getReceiverThreadingProfile, getReplyToHandler, getSessionHandler, getSupportedProtocols, handleException, handleWorkException, initialise, isConnected, isCreateDispatcherPerRequest, isCreateMultipleTransactedReceivers, isDisposed, isDisposing, isEnableMessageEvents, isRemoteSyncEnabled, isServerSide, isStarted, isUseSingleDispatcherThreadPool, isUseSingleReceiverThreadPool, lookupDispatcher, lookupReceiver, registerListener, registerSupportedProtocol, registerSupportedProtocolWithotPrefix, setConnectionStrategy, setCreateDispatcherPerRequest, setCreateMultipleTransactedReceivers, setDefaultInboundTransformer, setDefaultOutboundTransformer, setDefaultResponseTransformer, setDispatcherFactory, setDispatcherThreadingProfile, setEnableMessageEvents, setExceptionListener, setName, setReceiverThreadingProfile, setServerSide, setSessionHandler, setSupportedProtocols, setUseSingleDispatcherThreadPool, setUseSingleReceiverThreadPool, startConnector, stopConnector, supportsProtocol, unregisterListener, unregisterSupportedProtocol, workAccepted, workCompleted, workRejected, workStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_POLLING_FREQUENCY

public static final String PROPERTY_POLLING_FREQUENCY
See Also:
Constant Field Values

PROPERTY_FILENAME

public static final String PROPERTY_FILENAME
See Also:
Constant Field Values

PROPERTY_OUTPUT_PATTERN

public static final String PROPERTY_OUTPUT_PATTERN
See Also:
Constant Field Values

PROPERTY_PASSIVE_MODE

public static final String PROPERTY_PASSIVE_MODE
See Also:
Constant Field Values

PROPERTY_BINARY_TRANSFER

public static final String PROPERTY_BINARY_TRANSFER
See Also:
Constant Field Values
Constructor Detail

FtpConnector

public FtpConnector()
Method Detail

getProtocol

public String getProtocol()
Specified by:
getProtocol in interface UMOConnector
Specified by:
getProtocol in class AbstractConnector

createReceiver

public UMOMessageReceiver createReceiver(UMOComponent component,
                                         UMOEndpoint endpoint)
                                  throws Exception
Overrides:
createReceiver in class AbstractServiceEnabledConnector
Throws:
Exception

getPollingFrequency

public long getPollingFrequency()
Returns:
Returns the pollingFrequency.

setPollingFrequency

public void setPollingFrequency(long pollingFrequency)
Parameters:
pollingFrequency - The pollingFrequency to set.

getFtp

public FTPClient getFtp(UMOEndpointURI uri)
                 throws Exception
Throws:
Exception

releaseFtp

public void releaseFtp(UMOEndpointURI uri,
                       FTPClient client)
                throws Exception
Throws:
Exception

destroyFtp

public void destroyFtp(UMOEndpointURI uri,
                       FTPClient client)
                throws Exception
Throws:
Exception

getFtpPool

protected ObjectPool getFtpPool(UMOEndpointURI uri)

doStop

protected void doStop()
               throws UMOException
Description copied from class: AbstractConnector
Template method to perform any work when stopping the connectoe

Overrides:
doStop in class AbstractConnector
Throws:
UMOException - if the method fails

getOutputPattern

public String getOutputPattern()
Returns:
Returns the outputPattern.

setOutputPattern

public void setOutputPattern(String outputPattern)
Parameters:
outputPattern - The outputPattern to set.

getFilenameParser

public FilenameParser getFilenameParser()
Returns:
Returns the filenameParser.

setFilenameParser

public void setFilenameParser(FilenameParser filenameParser)
Parameters:
filenameParser - The filenameParser to set.

isPassive

public boolean isPassive()
Getter for FTP passive mode.

Returns:
true if using FTP passive mode

setPassive

public void setPassive(boolean passive)
Setter for FTP passive mode.

Parameters:
passive - passive mode flag

enterActiveOrPassiveMode

public void enterActiveOrPassiveMode(FTPClient client,
                                     UMOImmutableEndpoint endpoint)
Passive mode is OFF by default. The value is taken from the connector settings. In case there are any overriding properties set on the endpoint, those will be used.

See Also:
setPassive(boolean)

isValidateConnections

public boolean isValidateConnections()
Whether to test FTP connection on each take from pool.


setValidateConnections

public void setValidateConnections(boolean validateConnections)
Whether to test FTP connection on each take from pool. This takes care of a failed (or restarted) FTP server at the expense of an additional NOOP command packet being sent, but increases overall availability.

Disable to gain slight performance gain or if you are absolutely sure of the FTP server availability.

The default value is true


isBinary

public boolean isBinary()
Getter for FTP transfer type.

Returns:
true if using FTP binary type

setBinary

public void setBinary(boolean binary)
Setter for FTP transfer type.

Parameters:
binary - binary type flag

setupFileType

public void setupFileType(FTPClient client,
                          UMOImmutableEndpoint endpoint)
                   throws Exception
Transfer type is BINARY by default. The value is taken from the connector settings. In case there are any overriding properties set on the endpoint, those will be used.

The alternative type is ASCII.

Throws:
Exception
See Also:
setBinary(boolean)


Copyright © 2003-2006 MuleSource Inc.. All Rights Reserved.