public class JDBCMessageStore extends AbstractMessageStore
description, fileName, lock, messageStoreMBean, messageStoreObservers, name, parameters, sequence, synapseConfiguration, synapseEnvironment
Constructor and Description |
---|
JDBCMessageStore() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Delete all entries from table
|
void |
destroy()
Destroy Resources allocated
|
MessageContext |
get(int position)
Get the message at given position
Only can be done with MYSQL, and no use-case in current implementation
|
MessageContext |
get(String msgId)
Return the first element with given msg_id
|
List<MessageContext> |
getAll()
Get all messages in the table
|
MessageConsumer |
getConsumer()
Returns a Message Consumer for this message store.
|
MessageProducer |
getProducer()
Returns a Message Producer for this message store.
|
void |
init(SynapseEnvironment synapseEnvironment)
Initializes the JDBC Message Store
|
MessageContext |
peek()
Select and return the first element in current table
|
MessageContext |
remove()
Removes the first element from table
|
MessageContext |
remove(String msgId)
Remove the message with given msg_id
|
byte[] |
serialize(Object obj) |
void |
setParameters(Map<String,Object> parameters)
Set JDBC store parameters
|
int |
size()
Return number of messages in the store
|
boolean |
store(MessageContext messageContext)
Add a message to the end of the table.
|
dequeued, difference, enqueued, getArtifactContainerName, getDescription, getFileName, getLock, getName, getParameters, getType, isEdited, nextConsumerId, nextProducerId, notifyMessageAddition, notifyMessageRemoval, registerObserver, setArtifactContainerName, setDescription, setFileName, setIsEdited, setName, unregisterObserver
public void init(SynapseEnvironment synapseEnvironment)
init
in interface ManagedLifecycle
init
in class AbstractMessageStore
synapseEnvironment
- SynapseEnvironment for the storepublic MessageProducer getProducer()
MessageStore
MessageStore.getProducer()
public MessageConsumer getConsumer()
MessageStore
MessageStore.getConsumer()
public void setParameters(Map<String,Object> parameters)
setParameters
in interface MessageStore
setParameters
in class AbstractMessageStore
parameters
- - List of parameters to setpublic byte[] serialize(Object obj) throws IOException
IOException
public void destroy()
destroy
in interface ManagedLifecycle
destroy
in class AbstractMessageStore
public boolean store(MessageContext messageContext) throws SynapseException
messageContext
- message to insertSynapseException
public MessageContext peek() throws SynapseException
SynapseException
public MessageContext remove() throws NoSuchElementException
NoSuchElementException
public MessageContext remove(String msgId) throws SynapseException
msgId
- - message IDSynapseException
public void clear()
public MessageContext get(int position)
position
- - position of the message , starting value is 0public List<MessageContext> getAll()
public MessageContext get(String msgId)
msgId
- - Message IDpublic int size()
size
in interface MessageStore
size
in class AbstractMessageStore
Copyright © 2005–2017 Apache Software Foundation. All rights reserved.