org.springframework.integration.sftp.outbound
Class SftpSendingMessageHandler

java.lang.Object
  extended by org.springframework.integration.util.AbstractExpressionEvaluator
      extended by org.springframework.integration.sftp.outbound.SftpSendingMessageHandler
All Implemented Interfaces:
BeanFactoryAware, InitializingBean, MessageHandler

public class SftpSendingMessageHandler
extends AbstractExpressionEvaluator
implements MessageHandler, InitializingBean

Sends message payloads to a remote SFTP endpoint. Assumes that the payload of the inbound message is of type File.

Since:
2.0

Constructor Summary
SftpSendingMessageHandler(SftpSessionPool pool)
           
 
Method Summary
 void afterPropertiesSet()
           
 void handleMessage(Message<?> message)
          Handles the message if possible.
 void setCharset(java.lang.String charset)
           
 void setFileNameGenerator(FileNameGenerator fileNameGenerator)
           
 void setRemoteDirectoryExpression(Expression remoteDirectoryExpression)
           
 void setTemporaryBufferFolder(Resource temporaryBufferFolder)
           
 
Methods inherited from class org.springframework.integration.util.AbstractExpressionEvaluator
evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getEvaluationContext, setBeanFactory, setBeanResolver, setConversionService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SftpSendingMessageHandler

public SftpSendingMessageHandler(SftpSessionPool pool)
Method Detail

setTemporaryBufferFolder

public void setTemporaryBufferFolder(Resource temporaryBufferFolder)

setFileNameGenerator

public void setFileNameGenerator(FileNameGenerator fileNameGenerator)

setRemoteDirectoryExpression

public void setRemoteDirectoryExpression(Expression remoteDirectoryExpression)

setCharset

public void setCharset(java.lang.String charset)

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
java.lang.Exception

handleMessage

public void handleMessage(Message<?> message)
Description copied from interface: MessageHandler
Handles the message if possible. If the handler cannot deal with the message this will result in a MessageRejectedException e.g. in case of a Selective Consumer. When a consumer tries to handle a message, but fails to do so, a MessageHandlingException is thrown. In the last case it is recommended to treat the message as tainted and go into an error scenario.

When the handling results in a failure of another message being sent (e.g. a "reply" message), that failure will trigger a MessageDeliveryException.

Specified by:
handleMessage in interface MessageHandler
Parameters:
message - the message to be handled