|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mule.transport.AbstractConnector org.mule.transport.sftp.SftpConnector
public class SftpConnector
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 interface org.mule.api.transport.Connector |
---|
INT_VALUE_NOT_SET |
Fields inherited from interface org.mule.api.lifecycle.Disposable |
---|
PHASE_NAME |
Constructor Summary | |
---|---|
SftpConnector(MuleContext context)
|
Method Summary | |
---|---|
MessageReceiver |
createReceiver(FlowConstruct flow,
InboundEndpoint endpoint)
Create a Message receiver for this connector |
SftpClient |
createSftpClient(ImmutableEndpoint endpoint)
|
SftpClient |
createSftpClient(ImmutableEndpoint endpoint,
SftpNotifier notifier)
|
void |
destroyClient(ImmutableEndpoint endpoint,
SftpClient client)
|
protected void |
doConnect()
Template method where any connections should be made for the connector |
protected void |
doDisconnect()
Template method where any connected resources used by the connector should be disconnected |
protected void |
doDispose()
Template method to perform any work when destroying the connectoe |
protected void |
doInitialise()
|
protected void |
doStart()
Template method to perform any work when starting the connectoe |
protected void |
doStop()
Template method to perform any work when stopping the connectoe |
String |
getArchiveDir()
|
String |
getArchiveTempReceivingDir()
|
String |
getArchiveTempSendingDir()
|
boolean |
getCheckFileAge()
|
protected ObjectPool |
getClientPool(ImmutableEndpoint endpoint)
|
String |
getDuplicateHandling()
|
long |
getFileAge()
Returns the file age. |
FilenameParser |
getFilenameParser()
|
String |
getIdentityFile()
|
int |
getMaxConnectionPoolSize()
|
String |
getOutputPattern()
|
String |
getPassphrase()
|
long |
getPollingFrequency()
|
String |
getProtocol()
|
Long |
getSizeCheckWaitTime()
|
String |
getTempDirInbound()
|
String |
getTempDirOutbound()
|
boolean |
isAutoDelete()
|
boolean |
isEnableMessageEvents()
|
Boolean |
isKeepFileOnError()
|
Boolean |
isUseTempFileTimestampSuffix()
|
void |
releaseClient(ImmutableEndpoint endpoint,
SftpClient client)
|
void |
setArchiveDir(String archiveDir)
|
void |
setArchiveTempReceivingDir(String archiveTempReceivingDir)
|
void |
setArchiveTempSendingDir(String archiveTempSendingDir)
|
void |
setAutoDelete(boolean autoDelete)
|
void |
setDuplicateHandling(String duplicateHandling)
|
void |
setFileAge(long fileAge)
Sets the file age. |
void |
setFilenameParser(FilenameParser filenameParser)
|
void |
setIdentityFile(String identityFile)
|
void |
setKeepFileOnError(Boolean pKeepFileOnError)
|
void |
setMaxConnectionPoolSize(int maxConnectionPoolSize)
|
void |
setOutputPattern(String outputPattern)
|
void |
setPassphrase(String passphrase)
|
void |
setPollingFrequency(long pollingFrequency)
|
void |
setSizeCheckWaitTime(Long sizeCheckWaitTime)
|
void |
setTempDirInbound(String pTempDirInbound)
|
void |
setTempDirOutbound(String pTempDirOutbound)
|
void |
setUseTempFileTimestampSuffix(Boolean useTempFileTimestampSuffix)
|
boolean |
useConnectionPool()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String PROPERTY_POLLING_FREQUENCY
public static final String PROPERTY_DIRECTORY
public static final String PROPERTY_OUTPUT_PATTERN
public static final String PROPERTY_FILENAME
public static final String PROPERTY_ORIGINAL_FILENAME
public static final String PROPERTY_SELECT_EXPRESSION
public static final String PROPERTY_FILE_EXTENSION
public static final String PROPERTY_INCLUDE_SUBFOLDERS
public static final String PROPERTY_IDENTITY_FILE
public static final String PROPERTY_PASS_PHRASE
public static final String PROPERTY_FILE_AGE
public static final String PROPERTY_TEMP_DIR
public static final String PROPERTY_SIZE_CHECK_WAIT_TIME
public static final String PROPERTY_ARCHIVE_DIR
public static final String PROPERTY_ARCHIVE_TEMP_RECEIVING_DIR
public static final String PROPERTY_ARCHIVE_TEMP_SENDING_DIR
public static final String PROPERTY_DUPLICATE_HANDLING
public static final String PROPERTY_USE_TEMP_FILE_TIMESTAMP_SUFFIX
public static final String PROPERTY_DUPLICATE_HANDLING_THROW_EXCEPTION
public static final String PROPERTY_DUPLICATE_HANDLING_OVERWRITE
public static final String PROPERTY_DUPLICATE_HANDLING_ASS_SEQ_NO
public static final String PROPERTY_MAX_CONNECTION_POOL_SIZE
public static final String PROPERTY_KEEP_FILE_ON_ERROR
public static final int DEFAULT_POLLING_FREQUENCY
protected static final Log logger
Constructor Detail |
---|
public SftpConnector(MuleContext context)
Method Detail |
---|
public String getProtocol()
public MessageReceiver createReceiver(FlowConstruct flow, InboundEndpoint endpoint) throws Exception
AbstractConnector
createReceiver
in class AbstractConnector
flow
- the service that will receive events from this receiver, the
listenerendpoint
- the endpoint that defies this inbound communication
TransportServiceDescriptor
initialised using the service and endpoint.
Exception
- if there is a problem creating the receiver. This exception
really depends on the underlying transport, thus any exception
could be thrownpublic SftpClient createSftpClient(ImmutableEndpoint endpoint) throws Exception
Exception
public SftpClient createSftpClient(ImmutableEndpoint endpoint, SftpNotifier notifier) throws Exception
Exception
public boolean useConnectionPool()
public void releaseClient(ImmutableEndpoint endpoint, SftpClient client) throws Exception
Exception
public void destroyClient(ImmutableEndpoint endpoint, SftpClient client) throws Exception
Exception
protected ObjectPool getClientPool(ImmutableEndpoint endpoint)
protected void doConnect() throws Exception
AbstractConnector
doConnect
in class AbstractConnector
Exception
protected void doDisconnect() throws Exception
AbstractConnector
doDisconnect
in class AbstractConnector
Exception
protected void doDispose()
AbstractConnector
doDispose
in class AbstractConnector
protected void doInitialise() throws InitialisationException
doInitialise
in class AbstractConnector
InitialisationException
protected void doStart() throws MuleException
AbstractConnector
doStart
in class AbstractConnector
MuleException
- if the method failsprotected void doStop() throws MuleException
AbstractConnector
doStop
in class AbstractConnector
MuleException
- if the method failspublic long getPollingFrequency()
public void setPollingFrequency(long pollingFrequency)
public FilenameParser getFilenameParser()
public void setFilenameParser(FilenameParser filenameParser)
public String getOutputPattern()
public void setOutputPattern(String outputPattern)
public boolean isAutoDelete()
public void setAutoDelete(boolean autoDelete)
public String getIdentityFile()
public void setIdentityFile(String identityFile)
public String getPassphrase()
public void setPassphrase(String passphrase)
public long getFileAge()
public void setFileAge(long fileAge)
fileAge
- the fileAge in milliseconds to set.public boolean getCheckFileAge()
public String getTempDirInbound()
public void setTempDirInbound(String pTempDirInbound)
public String getTempDirOutbound()
public void setTempDirOutbound(String pTempDirOutbound)
public boolean isEnableMessageEvents()
isEnableMessageEvents
in class AbstractConnector
public void setDuplicateHandling(String duplicateHandling)
public String getDuplicateHandling()
public void setUseTempFileTimestampSuffix(Boolean useTempFileTimestampSuffix)
public Boolean isUseTempFileTimestampSuffix()
public void setSizeCheckWaitTime(Long sizeCheckWaitTime)
public Long getSizeCheckWaitTime()
public void setArchiveDir(String archiveDir)
public String getArchiveDir()
public void setArchiveTempReceivingDir(String archiveTempReceivingDir)
public String getArchiveTempReceivingDir()
public void setArchiveTempSendingDir(String archiveTempSendingDir)
public String getArchiveTempSendingDir()
public void setMaxConnectionPoolSize(int maxConnectionPoolSize)
maxConnectionPoolSize
public int getMaxConnectionPoolSize()
public Boolean isKeepFileOnError()
public void setKeepFileOnError(Boolean pKeepFileOnError)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |