Package org.apache.synapse.message.store
Interface MessageStore
-
- All Superinterfaces:
ManagedLifecycle
,Nameable
,SynapseArtifact
- All Known Implementing Classes:
AbstractMessageStore
,InMemoryStore
,JDBCMessageStore
,JmsStore
,RabbitMQStore
,ResequenceMessageStore
public interface MessageStore extends ManagedLifecycle, Nameable, SynapseArtifact
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addParameter(String name, String key)
Adds message store specific parametersvoid
addParameterKey(String name, String key)
Adds message store parameter registry keysvoid
clear()
Delete all the Messages in the Message StoreMessageContext
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 itList<MessageContext>
getAll()
Get the All messages in the Message store without removing them from the queueString
getArtifactContainerName()
Get the name of the artifact container from which the message store deployedMessageConsumer
getConsumer()
Returns a Message Consumer for this message store.String
getFileName()
get the file name that the message store is configuredString
getParameterKey(String name)
Gets parameter registry key from the parameter nameMap<String,String>
getParameterKeyMap()
Gets registry key mappings for the parametersMap<String,Object>
getParameters()
get the implementation specific parameters of the Message storeMessageProducer
getProducer()
Returns a Message Producer for this message store.int
getType()
Returns the type of this message store.boolean
isEdited()
Whether the message store edited through the management consoleMessageContext
remove()
Retrieves and removes the first Message in this store.MessageContext
remove(String messageID)
Delete and return the MessageContext with given Message idvoid
setArtifactContainerName(String artifactContainerName)
Set the name of the artifact container from which the message store deployedvoid
setFileName(String filename)
Set the name of the file that the Message store is configuredvoid
setIsEdited(boolean isEdited)
Set whether the message store edited through the management consolevoid
setParameters(Map<String,Object> parameters)
set the implementation specific parametersint
size()
Returns the number of Messages in this store.-
Methods inherited from interface org.apache.synapse.ManagedLifecycle
destroy, init
-
Methods inherited from interface org.apache.synapse.SynapseArtifact
getDescription, setDescription
-
-
-
-
Method Detail
-
getProducer
MessageProducer getProducer() throws SynapseException
Returns a Message Producer for this message store.- Returns:
- A non-null message producer that can produce messages to this message store.
- Throws:
SynapseException
-
getConsumer
MessageConsumer getConsumer() throws SynapseException
Returns a Message Consumer for this message store.- Returns:
- A non-null message consumer that can read messages from this message store.
- Throws:
SynapseException
-
setParameters
void setParameters(Map<String,Object> parameters)
set the implementation specific parameters- Parameters:
parameters
- A map of parameters or null
-
getParameters
Map<String,Object> getParameters()
get the implementation specific parameters of the Message store- Returns:
- a properties map
-
addParameter
void addParameter(String name, String key)
Adds message store specific parameters- Parameters:
name
- parameter namekey
- parameter key value
-
addParameterKey
void addParameterKey(String name, String key)
Adds message store parameter registry keys- Parameters:
name
- parameter namekey
- parameter registry key value
-
getParameterKey
String getParameterKey(String name)
Gets parameter registry key from the parameter name- Parameters:
name
- parameter name- Returns:
- registry key of parameter value
-
getParameterKeyMap
Map<String,String> getParameterKeyMap()
Gets registry key mappings for the parameters- Returns:
- registry key maps for parameter values
-
setFileName
void setFileName(String filename)
Set the name of the file that the Message store is configured- Parameters:
filename
- Name of the file where this artifact is defined
-
getFileName
String getFileName()
get the file name that the message store is configured- Returns:
- Name of the file where this artifact is defined
-
getType
int getType()
Returns the type of this message store.
The type of a message store can be one of following types,
Constants.JMS_MS
,Constants.INMEMORY_MS
, orConstants.JDBC_MS
- Returns:
- Type of the message store.
-
remove
MessageContext remove() throws NoSuchElementException
Retrieves and removes the first Message in this store. Message ordering will depend on the underlying implementation- Returns:
- first message context in the store
- Throws:
NoSuchElementException
- if store is empty
-
clear
void clear()
Delete all the Messages in the Message Store
-
remove
MessageContext remove(String messageID)
Delete and return the MessageContext with given Message id- Parameters:
messageID
- message id of the Message- Returns:
- MessageContext instance
-
size
int size()
Returns the number of Messages in this store.- Returns:
- the number of Messages in this Store
-
get
MessageContext get(int index)
Return the Message in given index position (this may depend on the implementation)- Parameters:
index
- position of the message- Returns:
- Message in given index position
-
getAll
List<MessageContext> getAll()
Get the All messages in the Message store without removing them from the queue- Returns:
- List of all Messages
-
get
MessageContext get(String messageId)
Get the Message with the given ID from the Message store without removing it- Parameters:
messageId
- A message ID string- Returns:
- Message with given ID
-
isEdited
boolean isEdited()
Whether the message store edited through the management console- Returns:
- true if Message Store config is locally edited
-
setIsEdited
void setIsEdited(boolean isEdited)
Set whether the message store edited through the management console- Parameters:
isEdited
- true if Message Store config is locally edited
-
getArtifactContainerName
String getArtifactContainerName()
Get the name of the artifact container from which the message store deployed- Returns:
- Name of artifact container
-
setArtifactContainerName
void setArtifactContainerName(String artifactContainerName)
Set the name of the artifact container from which the message store deployed- Parameters:
artifactContainerName
- name of artifact container
-
-