org.mule.transport.sftp
Class SftpConnector
java.lang.Object
org.mule.transport.AbstractConnector
org.mule.transport.sftp.SftpConnector
- All Implemented Interfaces:
- EventListener, javax.resource.spi.work.WorkListener, Disposable, Initialisable, Lifecycle, LifecycleStateEnabled, Startable, Stoppable, NameableObject, NamedObject, Connectable, Connector
public class SftpConnector
- extends AbstractConnector
SftpConnector sends and receives file messages over sftp using jsch
library Improves on SFTP with VFS Connector in the following ways: 1. Streams
files instead of reading them into memory. The SftpMessageReceiver is a
"non-materializing stream receiver" which does not read the file to memory. The
SftpMessageDispatcher also never materializes the stream and delegates the jsch
library for materialization. 3. Uses jsch library directly instead of using VFS as
middle-man. 3. More explicit connection lifefecyle management. 4. Leverages sftp
stat to determine if a file size changes (simpler and also less memory intensive)
| Fields inherited from class org.mule.transport.AbstractConnector |
createMultipleTransactedReceivers, DEFAULT_NUM_CONCURRENT_TX_RECEIVERS, dispatcherFactory, dispatcherPoolFactory, dispatchers, initialStateStopped, lifecycleManager, muleContext, muleMessageFactory, name, numberOfConcurrentTransactedReceivers, receivers, requesterFactory, requesters, serviceDescriptor, serviceOverrides, sessionHandler, startOnConnect |
| Methods inherited from class org.mule.transport.AbstractConnector |
clearDispatchers, clearRequesters, configureDispatcherPool, connect, createDispatcherMessageProcessor, createMuleMessageFactory, createScheduler, destroyReceiver, disconnect, dispose, disposeReceivers, disposeWorkManagers, doUnregisterListener, fireNotification, getConnectEventId, getConnectionDescription, getDefaultExchangePattern, getDefaultInboundTransformers, getDefaultOutboundTransformers, getDefaultResponseTransformers, getDispatcherFactory, getDispatcherPoolFactory, getDispatcherThreadingProfile, getDispatcherWorkManager, getInboundExchangePatterns, getLifecycleState, getMaxDispatchersActive, getMaxRequestersActive, getMaxTotalDispatchers, getMuleContext, getMuleMessageFactory, getName, getNumberOfConcurrentTransactedReceivers, getOutboundExchangePatterns, getOutputStream, getReceiver, getReceiverKey, getReceivers, getReceivers, getReceiverThreadingProfile, getReceiverWorkManager, getReplyToHandler, getRequesterFactory, getRequesterThreadingProfile, getRequesterWorkManager, getRetryPolicyTemplate, getScheduler, getServiceDescriptor, getServiceOverrides, getSessionHandler, getSupportedProtocols, handleWorkException, initFromServiceDescriptor, initialise, initialiseFromUrl, initWorkManagers, isConnected, isConnecting, isCreateMultipleTransactedReceivers, isDisposed, isInitialised, isInitialStateStopped, isResponseEnabled, isStarted, isStarting, isStopped, isStopping, isValidateConnections, lookupReceiver, registerListener, registerSupportedMetaProtocol, registerSupportedProtocol, registerSupportedProtocolWithoutPrefix, request, request, setConnected, setConnecting, setCreateMultipleTransactedReceivers, setDispatcherFactory, setDispatcherPoolFactory, setDispatcherPoolMaxWait, setDispatcherPoolWhenExhaustedAction, setDispatcherThreadingProfile, setDynamicNotification, setInitialStateStopped, setMaxDispatchersActive, setMaxRequestersActive, setName, setNumberOfConcurrentTransactedReceivers, setReceiverThreadingProfile, setRequesterFactory, setRequesterPoolMaxWait, setRequesterPoolWhenExhaustedAction, setRequesterThreadingProfile, setRetryPolicyTemplate, setServiceOverrides, setSessionHandler, setSupportedProtocols, setupDispatchReturn, setupRequestReturn, setValidateConnections, shutdownScheduler, start, startAfterConnect, stop, supportsProtocol, toString, unregisterListener, unregisterSupportedProtocol, updateCachedNotificationHandler, validateConnection, workAccepted, workCompleted, workRejected, workStarted |
PROPERTY_POLLING_FREQUENCY
public static final String PROPERTY_POLLING_FREQUENCY
- See Also:
- Constant Field Values
PROPERTY_DIRECTORY
public static final String PROPERTY_DIRECTORY
- See Also:
- Constant Field Values
PROPERTY_OUTPUT_PATTERN
public static final String PROPERTY_OUTPUT_PATTERN
- See Also:
- Constant Field Values
PROPERTY_FILENAME
public static final String PROPERTY_FILENAME
- See Also:
- Constant Field Values
PROPERTY_ORIGINAL_FILENAME
public static final String PROPERTY_ORIGINAL_FILENAME
- See Also:
- Constant Field Values
PROPERTY_SELECT_EXPRESSION
public static final String PROPERTY_SELECT_EXPRESSION
- See Also:
- Constant Field Values
PROPERTY_FILE_EXTENSION
public static final String PROPERTY_FILE_EXTENSION
- See Also:
- Constant Field Values
PROPERTY_INCLUDE_SUBFOLDERS
public static final String PROPERTY_INCLUDE_SUBFOLDERS
- See Also:
- Constant Field Values
PROPERTY_IDENTITY_FILE
public static final String PROPERTY_IDENTITY_FILE
- See Also:
- Constant Field Values
PROPERTY_PASS_PHRASE
public static final String PROPERTY_PASS_PHRASE
- See Also:
- Constant Field Values
PROPERTY_FILE_AGE
public static final String PROPERTY_FILE_AGE
- See Also:
- Constant Field Values
PROPERTY_TEMP_DIR
public static final String PROPERTY_TEMP_DIR
- See Also:
- Constant Field Values
PROPERTY_SIZE_CHECK_WAIT_TIME
public static final String PROPERTY_SIZE_CHECK_WAIT_TIME
- See Also:
- Constant Field Values
PROPERTY_ARCHIVE_DIR
public static final String PROPERTY_ARCHIVE_DIR
- See Also:
- Constant Field Values
PROPERTY_ARCHIVE_TEMP_RECEIVING_DIR
public static final String PROPERTY_ARCHIVE_TEMP_RECEIVING_DIR
- See Also:
- Constant Field Values
PROPERTY_ARCHIVE_TEMP_SENDING_DIR
public static final String PROPERTY_ARCHIVE_TEMP_SENDING_DIR
- See Also:
- Constant Field Values
PROPERTY_DUPLICATE_HANDLING
public static final String PROPERTY_DUPLICATE_HANDLING
- See Also:
- Constant Field Values
PROPERTY_USE_TEMP_FILE_TIMESTAMP_SUFFIX
public static final String PROPERTY_USE_TEMP_FILE_TIMESTAMP_SUFFIX
- See Also:
- Constant Field Values
PROPERTY_DUPLICATE_HANDLING_THROW_EXCEPTION
public static final String PROPERTY_DUPLICATE_HANDLING_THROW_EXCEPTION
- See Also:
- Constant Field Values
PROPERTY_DUPLICATE_HANDLING_OVERWRITE
public static final String PROPERTY_DUPLICATE_HANDLING_OVERWRITE
- See Also:
- Constant Field Values
PROPERTY_DUPLICATE_HANDLING_ASS_SEQ_NO
public static final String PROPERTY_DUPLICATE_HANDLING_ASS_SEQ_NO
- See Also:
- Constant Field Values
PROPERTY_MAX_CONNECTION_POOL_SIZE
public static final String PROPERTY_MAX_CONNECTION_POOL_SIZE
- See Also:
- Constant Field Values
PROPERTY_KEEP_FILE_ON_ERROR
public static final String PROPERTY_KEEP_FILE_ON_ERROR
- See Also:
- Constant Field Values
DEFAULT_POLLING_FREQUENCY
public static final int DEFAULT_POLLING_FREQUENCY
- See Also:
- Constant Field Values
logger
protected static final Log logger
- logger used by this class
SftpConnector
public SftpConnector(MuleContext context)
getProtocol
public String getProtocol()
createReceiver
public MessageReceiver createReceiver(FlowConstruct flow,
InboundEndpoint endpoint)
throws Exception
- Overrides:
createReceiver in class AbstractConnector
- Throws:
Exception
createSftpClient
public SftpClient createSftpClient(ImmutableEndpoint endpoint)
throws Exception
- Throws:
Exception
createSftpClient
public SftpClient createSftpClient(ImmutableEndpoint endpoint,
SftpNotifier notifier)
throws Exception
- Throws:
Exception
useConnectionPool
public boolean useConnectionPool()
- Returns:
- True if connection pooling is used, otherwise false
releaseClient
public void releaseClient(ImmutableEndpoint endpoint,
SftpClient client)
throws Exception
- Throws:
Exception
destroyClient
public void destroyClient(ImmutableEndpoint endpoint,
SftpClient client)
throws Exception
- Throws:
Exception
getClientPool
protected ObjectPool getClientPool(ImmutableEndpoint endpoint)
doConnect
protected void doConnect()
throws Exception
- Specified by:
doConnect in class AbstractConnector
- Throws:
Exception
doDisconnect
protected void doDisconnect()
throws Exception
- Specified by:
doDisconnect in class AbstractConnector
- Throws:
Exception
doDispose
protected void doDispose()
- Specified by:
doDispose in class AbstractConnector
doInitialise
protected void doInitialise()
throws InitialisationException
- Specified by:
doInitialise in class AbstractConnector
- Throws:
InitialisationException
doStart
protected void doStart()
throws MuleException
- Specified by:
doStart in class AbstractConnector
- Throws:
MuleException
doStop
protected void doStop()
throws MuleException
- Specified by:
doStop in class AbstractConnector
- Throws:
MuleException
getPollingFrequency
public long getPollingFrequency()
setPollingFrequency
public void setPollingFrequency(long pollingFrequency)
getFilenameParser
public FilenameParser getFilenameParser()
setFilenameParser
public void setFilenameParser(FilenameParser filenameParser)
getOutputPattern
public String getOutputPattern()
setOutputPattern
public void setOutputPattern(String outputPattern)
isAutoDelete
public boolean isAutoDelete()
setAutoDelete
public void setAutoDelete(boolean autoDelete)
getIdentityFile
public String getIdentityFile()
setIdentityFile
public void setIdentityFile(String identityFile)
getPassphrase
public String getPassphrase()
setPassphrase
public void setPassphrase(String passphrase)
getFileAge
public long getFileAge()
- Returns the file age.
- Returns:
- Returns the fileAge in milliseconds.
setFileAge
public void setFileAge(long fileAge)
- Sets the file age.
- Parameters:
fileAge - the fileAge in milliseconds to set.
getCheckFileAge
public boolean getCheckFileAge()
getTempDirInbound
public String getTempDirInbound()
setTempDirInbound
public void setTempDirInbound(String pTempDirInbound)
getTempDirOutbound
public String getTempDirOutbound()
setTempDirOutbound
public void setTempDirOutbound(String pTempDirOutbound)
isEnableMessageEvents
public boolean isEnableMessageEvents()
- Overrides:
isEnableMessageEvents in class AbstractConnector
setDuplicateHandling
public void setDuplicateHandling(String duplicateHandling)
getDuplicateHandling
public String getDuplicateHandling()
setUseTempFileTimestampSuffix
public void setUseTempFileTimestampSuffix(Boolean useTempFileTimestampSuffix)
isUseTempFileTimestampSuffix
public Boolean isUseTempFileTimestampSuffix()
setSizeCheckWaitTime
public void setSizeCheckWaitTime(Long sizeCheckWaitTime)
getSizeCheckWaitTime
public Long getSizeCheckWaitTime()
setArchiveDir
public void setArchiveDir(String archiveDir)
getArchiveDir
public String getArchiveDir()
setArchiveTempReceivingDir
public void setArchiveTempReceivingDir(String archiveTempReceivingDir)
getArchiveTempReceivingDir
public String getArchiveTempReceivingDir()
setArchiveTempSendingDir
public void setArchiveTempSendingDir(String archiveTempSendingDir)
getArchiveTempSendingDir
public String getArchiveTempSendingDir()
setMaxConnectionPoolSize
public void setMaxConnectionPoolSize(int maxConnectionPoolSize)
- See Also:
maxConnectionPoolSize
getMaxConnectionPoolSize
public int getMaxConnectionPoolSize()
- Returns:
- the max connection pool size. If the system parameter
mule.sftp.transport.maxConnectionPoolSize is set, that value will be
used instead.
isKeepFileOnError
public Boolean isKeepFileOnError()
setKeepFileOnError
public void setKeepFileOnError(Boolean pKeepFileOnError)
Copyright © 2003-2011 MuleSoft, Inc.. All Rights Reserved.