Spring Integration

org.springframework.integration.sftp
Class SftpSendingMessageHandler

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

public class SftpSendingMessageHandler
extends Object
implements MessageHandler, InitializingBean

Sending a message payload to a remote SFTP endpoint. For now, we assume that the payload of the inbound message is of type File. Perhaps we could support a payload of java.io.InputStream with a Header designating the file name?

Author:
Josh Long

Constructor Summary
SftpSendingMessageHandler(SftpSessionPool pool)
           
 
Method Summary
 void afterPropertiesSet()
           
 String getRemoteDirectory()
           
 void handleMessage(Message<?> message)
          Handles the message if possible.
 void setCharset(String charset)
           
 void setFileNameGenerator(FileNameGenerator fileNameGenerator)
           
 void setRemoteDirectory(String remoteDirectory)
           
 void setTemporaryBufferFolder(Resource temporaryBufferFolder)
           
 
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

afterPropertiesSet

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

getRemoteDirectory

public String getRemoteDirectory()

setTemporaryBufferFolder

public void setTemporaryBufferFolder(Resource temporaryBufferFolder)

setFileNameGenerator

public void setFileNameGenerator(FileNameGenerator fileNameGenerator)

setCharset

public void setCharset(String charset)

handleMessage

public void handleMessage(Message<?> message)
                   throws MessageRejectedException,
                          MessageHandlingException,
                          MessageDeliveryException
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
Throws:
MessageRejectedException - if the handler doesn't accept the message
MessageHandlingException - when something fails during the handling
MessageDeliveryException - when this handler failed to deliver the reply related to the handling of the message

setRemoteDirectory

public void setRemoteDirectory(String remoteDirectory)

Spring Integration

Copyright © 2010. All Rights Reserved.