public interface MessageStore extends SynapseArtifact, Nameable, ManagedLifecycle
Modifier and Type | Method and Description |
---|---|
void |
clear()
Delete all the Messages in the Message Store
|
MessageContext |
get(int index)
Return the Message in given index position
(this may depend on the implementation)
|
MessageContext |
get(String messageId)
Get the Message with the given ID from the Message store without removing it
|
List<MessageContext> |
getAll()
Get the All messages in the Message store without removing them from the queue
|
String |
getFileName()
get the file name that the message store is configured
|
Map<String,Object> |
getParameters()
get the implementation specific parameters of the Message store
|
boolean |
offer(MessageContext messageContext)
Inserts the Message into this store if it is possible to do so immediately
without violating capacity restrictions.
|
MessageContext |
peek()
Retrieves but not removes the first Message in this store.
|
MessageContext |
poll()
Retrieves and removes the first Message in this store.
|
void |
registerObserver(MessageStoreObserver observer)
Register a MessageStore observer instance with the MessageStore
to receive events.
|
MessageContext |
remove()
Retrieves and removes the first Message in this store.
|
MessageContext |
remove(String messageID)
Delete and return the MessageContext with given Message id
|
void |
setFileName(String filename)
Set the name of the file that the Message store is configured
|
void |
setParameters(Map<String,Object> parameters)
set the implementation specific parameters
|
int |
size()
Returns the number of Messages in this store.
|
void |
unregisterObserver(MessageStoreObserver observer)
Un register an Message store instance from the message store
to stop receiving events
|
getDescription, setDescription
destroy, init
boolean offer(MessageContext messageContext)
messageContext
- MessageContext to be savedMessageContext poll()
MessageContext peek()
MessageContext remove() throws NoSuchElementException
NoSuchElementException
- if store is emptyvoid clear()
MessageContext remove(String messageID)
messageID
- message id of the Messageint size()
MessageContext get(int index)
index
- position of the messageList<MessageContext> getAll()
MessageContext get(String messageId)
messageId
- A message ID stringvoid setParameters(Map<String,Object> parameters)
parameters
- A map of parameters or nullMap<String,Object> getParameters()
void setFileName(String filename)
filename
- Name of the file where this artifact is definedString getFileName()
void registerObserver(MessageStoreObserver observer)
observer
- instance to be registeredvoid unregisterObserver(MessageStoreObserver observer)
observer
- instance to be unregisteredCopyright © 2005-2017 Apache Software Foundation. All Rights Reserved.