org.springframework.integration.gemfire.store
Class GemfireMessageStore

java.lang.Object
  extended by org.springframework.integration.gemfire.store.GemfireMessageStore
All Implemented Interfaces:
MessageStore

public class GemfireMessageStore
extends java.lang.Object
implements MessageStore

Since:
2.1

Constructor Summary
GemfireMessageStore(com.gemstone.gemfire.cache.Region<java.util.UUID,Message<?>> region)
           
 
Method Summary
<T> Message<T>
addMessage(Message<T> message)
          Put the provided Message into the MessageStore.
 Message<?> getMessage(java.util.UUID id)
          Return the Message with the given id, or null if no Message with that id exists in the MessageStore.
 long getMessageCount()
          Optional attribute giving the number of messages in the store.
 Message<?> removeMessage(java.util.UUID id)
          Remove the Message with the given id from the MessageStore, if present, and return it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GemfireMessageStore

public GemfireMessageStore(com.gemstone.gemfire.cache.Region<java.util.UUID,Message<?>> region)
Method Detail

getMessage

public Message<?> getMessage(java.util.UUID id)
Description copied from interface: MessageStore
Return the Message with the given id, or null if no Message with that id exists in the MessageStore.

Specified by:
getMessage in interface MessageStore

addMessage

public <T> Message<T> addMessage(Message<T> message)
Description copied from interface: MessageStore
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 MessageStore.getMessage(UUID) and MessageStore.removeMessage(UUID) behave properly. Since messages are immutable, putting the same message more than once is a no-op.

Specified by:
addMessage in interface MessageStore
Returns:
the message that was stored

removeMessage

public Message<?> removeMessage(java.util.UUID id)
Description copied from interface: MessageStore
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.

Specified by:
removeMessage in interface MessageStore

getMessageCount

@ManagedAttribute
public long getMessageCount()
Description copied from interface: MessageStore
Optional attribute giving the number of messages in the store. Implementations may decline to respond by throwing an exception.

Specified by:
getMessageCount in interface MessageStore
Returns:
the number of messages