Spring Integration

org.springframework.integration.store
Interface MessageStore

All Known Implementing Classes:
JdbcMessageStore, SimpleMessageStore

public interface MessageStore

Strategy interface for storing and retrieving messages.

Since:
2.0
Author:
Mark Fisher, Iwein Fuld, Dave Syer

Method Summary
<T> Message<T>
addMessage(Message<T> message)
          Put the provided Message into the MessageStore.
 Message<?> getMessage(UUID id)
          Return the Message with the given id, or null if no Message with that id exists in the MessageStore.
 Message<?> removeMessage(UUID id)
          Remove the Message with the given id from the MessageStore, if present, and return it.
 

Method Detail

getMessage

Message<?> getMessage(UUID id)
Return the Message with the given id, or null if no Message with that id exists in the MessageStore.


addMessage

<T> Message<T> addMessage(Message<T> message)
Put the provided Message into the MessageStore. The store may need to mutate the message internally, and if it does then the return value can be different than the input. The id of the return value will be used as an index so that the getMessage(UUID) and removeMessage(UUID) behave properly. Since messages are immutable, putting the same message more than once is a no-op.

Returns:
the message that was stored

removeMessage

Message<?> removeMessage(UUID id)
Remove the Message with the given id from the MessageStore, if present, and return it. If no Message with that id is present in the store, this will return null.


Spring Integration

Copyright © 2010. All Rights Reserved.