|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.qpid.server.store.DerbyMessageStore
public class DerbyMessageStore
An implementation of a MessageStore
that uses Apache Derby as the persistance
mechanism.
TODO extract the SQL statements into a generic JDBC store
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.qpid.server.store.DurableConfigurationStore |
---|
DurableConfigurationStore.Source |
Nested classes/interfaces inherited from interface org.apache.qpid.server.store.TransactionLog |
---|
TransactionLog.StoreFuture, TransactionLog.Transaction |
Field Summary | |
---|---|
static String |
ENVIRONMENT_PATH_PROPERTY
|
Fields inherited from interface org.apache.qpid.server.store.MessageStore |
---|
IMMEDIATE_FUTURE |
Constructor Summary | |
---|---|
DerbyMessageStore()
|
Method Summary | |
---|---|
void |
abortTran(org.apache.qpid.server.store.DerbyMessageStore.ConnectionWrapper connWrapper)
|
StoredMessage |
addMessage(StorableMessageMetaData metaData)
|
void |
bindQueue(Exchange exchange,
org.apache.qpid.framing.AMQShortString routingKey,
AMQQueue queue,
org.apache.qpid.framing.FieldTable args)
Binds the specified queue to an exchange with a routing key. |
void |
close()
Called to close and cleanup any resources used by the message store. |
void |
commitTran(org.apache.qpid.server.store.DerbyMessageStore.ConnectionWrapper connWrapper)
|
TransactionLog.StoreFuture |
commitTranAsync(org.apache.qpid.server.store.DerbyMessageStore.ConnectionWrapper connWrapper)
|
void |
configureConfigStore(String name,
ConfigurationRecoveryHandler recoveryHandler,
Configuration storeConfiguration,
LogSubject logSubject)
Called after instantiation in order to configure the message store. |
void |
configureMessageStore(String name,
MessageStoreRecoveryHandler recoveryHandler,
Configuration storeConfiguration,
LogSubject logSubject)
Called after instantiation in order to configure the message store. |
void |
configureTransactionLog(String name,
TransactionLogRecoveryHandler recoveryHandler,
Configuration storeConfiguration,
LogSubject logSubject)
|
void |
createExchange(Exchange exchange)
Makes the specified exchange persistent. |
void |
createQueue(AMQQueue queue)
Makes the specified queue persistent. |
void |
createQueue(AMQQueue queue,
org.apache.qpid.framing.FieldTable arguments)
Makes the specified queue persistent. |
void |
dequeueMessage(org.apache.qpid.server.store.DerbyMessageStore.ConnectionWrapper connWrapper,
TransactionLogResource queue,
Long messageId)
|
void |
enqueueMessage(org.apache.qpid.server.store.DerbyMessageStore.ConnectionWrapper connWrapper,
TransactionLogResource queue,
Long messageId)
|
int |
getContent(long messageId,
int offset,
ByteBuffer dst)
|
StoredMessage |
getMessage(long messageNumber)
|
(package private) StorableMessageMetaData |
getMetaData(long messageId)
|
Long |
getNewMessageId()
|
boolean |
isPersistent()
Is this store capable of persisting the data |
TransactionLog.Transaction |
newTransaction()
|
void |
recover(ConfigurationRecoveryHandler recoveryHandler)
|
void |
removeExchange(Exchange exchange)
Removes the specified persistent exchange. |
void |
removeMessage(long messageId)
|
void |
removeQueue(AMQQueue queue)
Removes the specified queue from the persistent store. |
void |
unbindQueue(Exchange exchange,
org.apache.qpid.framing.AMQShortString routingKey,
AMQQueue queue,
org.apache.qpid.framing.FieldTable args)
Unbinds the specified from an exchange under a particular routing key. |
void |
updateQueue(AMQQueue queue)
Updates the specified queue in the persistent store, IF it is already present. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ENVIRONMENT_PATH_PROPERTY
Constructor Detail |
---|
public DerbyMessageStore()
Method Detail |
---|
public void configureConfigStore(String name, ConfigurationRecoveryHandler recoveryHandler, Configuration storeConfiguration, LogSubject logSubject) throws Exception
DurableConfigurationStore
configureConfigStore
in interface DurableConfigurationStore
name
- The name to be used by this storemrecoveryHandler
- Handler to be called as the store recovers on start upstoreConfiguration
- The apache commons configuration object.
Exception
- If any error occurs that means the store is unable to configure itself.public void configureMessageStore(String name, MessageStoreRecoveryHandler recoveryHandler, Configuration storeConfiguration, LogSubject logSubject) throws Exception
MessageStore
configureMessageStore
in interface MessageStore
name
- The name to be used by this storemrecoveryHandler
- Handler to be called as the store recovers on start upstoreConfiguration
- The apache commons configuration object.
Exception
- If any error occurs that means the store is unable to configure itself.public void configureTransactionLog(String name, TransactionLogRecoveryHandler recoveryHandler, Configuration storeConfiguration, LogSubject logSubject) throws Exception
configureTransactionLog
in interface TransactionLog
Exception
public void recover(ConfigurationRecoveryHandler recoveryHandler) throws org.apache.qpid.AMQException
org.apache.qpid.AMQException
public void close() throws Exception
MessageStore
close
in interface MessageStore
Exception
- If the close fails.public StoredMessage addMessage(StorableMessageMetaData metaData)
addMessage
in interface MessageStore
public StoredMessage getMessage(long messageNumber)
public void removeMessage(long messageId)
public void createExchange(Exchange exchange) throws org.apache.qpid.AMQStoreException
DurableConfigurationStore
createExchange
in interface DurableConfigurationStore
exchange
- The exchange to persist.
org.apache.qpid.AMQStoreException
- If the operation fails for any reason.public void removeExchange(Exchange exchange) throws org.apache.qpid.AMQStoreException
DurableConfigurationStore
removeExchange
in interface DurableConfigurationStore
exchange
- The exchange to remove.
org.apache.qpid.AMQStoreException
- If the operation fails for any reason.public void bindQueue(Exchange exchange, org.apache.qpid.framing.AMQShortString routingKey, AMQQueue queue, org.apache.qpid.framing.FieldTable args) throws org.apache.qpid.AMQStoreException
DurableConfigurationStore
bindQueue
in interface DurableConfigurationStore
exchange
- The exchange to bind to.routingKey
- The routing key to bind by.queue
- The queue to bind.args
- Additional parameters.
org.apache.qpid.AMQStoreException
- if the operation fails for any reason.public void unbindQueue(Exchange exchange, org.apache.qpid.framing.AMQShortString routingKey, AMQQueue queue, org.apache.qpid.framing.FieldTable args) throws org.apache.qpid.AMQStoreException
DurableConfigurationStore
unbindQueue
in interface DurableConfigurationStore
exchange
- The exchange to unbind from.routingKey
- The routing key to unbind.queue
- The queue to unbind.args
- Additonal parameters.
org.apache.qpid.AMQStoreException
- If the operation fails for any reason.public void createQueue(AMQQueue queue) throws org.apache.qpid.AMQStoreException
DurableConfigurationStore
createQueue
in interface DurableConfigurationStore
queue
- The queue to store.
org.apache.qpid.AMQStoreException
- If the operation fails for any reason.public void createQueue(AMQQueue queue, org.apache.qpid.framing.FieldTable arguments) throws org.apache.qpid.AMQStoreException
DurableConfigurationStore
createQueue
in interface DurableConfigurationStore
queue
- The queue to store.arguments
- The additional arguments to the binding
org.apache.qpid.AMQStoreException
- If the operation fails for any reason.public void updateQueue(AMQQueue queue) throws org.apache.qpid.AMQStoreException
updateQueue
in interface DurableConfigurationStore
queue
- The queue to update the entry for.
org.apache.qpid.AMQStoreException
- If the operation fails for any reason.public void removeQueue(AMQQueue queue) throws org.apache.qpid.AMQStoreException
DurableConfigurationStore
removeQueue
in interface DurableConfigurationStore
queue
- The queue to remove.
org.apache.qpid.AMQStoreException
- If the operation fails for any reason.public TransactionLog.Transaction newTransaction()
newTransaction
in interface TransactionLog
public void enqueueMessage(org.apache.qpid.server.store.DerbyMessageStore.ConnectionWrapper connWrapper, TransactionLogResource queue, Long messageId) throws org.apache.qpid.AMQStoreException
org.apache.qpid.AMQStoreException
public void dequeueMessage(org.apache.qpid.server.store.DerbyMessageStore.ConnectionWrapper connWrapper, TransactionLogResource queue, Long messageId) throws org.apache.qpid.AMQStoreException
org.apache.qpid.AMQStoreException
public void commitTran(org.apache.qpid.server.store.DerbyMessageStore.ConnectionWrapper connWrapper) throws org.apache.qpid.AMQStoreException
org.apache.qpid.AMQStoreException
public TransactionLog.StoreFuture commitTranAsync(org.apache.qpid.server.store.DerbyMessageStore.ConnectionWrapper connWrapper) throws org.apache.qpid.AMQStoreException
org.apache.qpid.AMQStoreException
public void abortTran(org.apache.qpid.server.store.DerbyMessageStore.ConnectionWrapper connWrapper) throws org.apache.qpid.AMQStoreException
org.apache.qpid.AMQStoreException
public Long getNewMessageId()
StorableMessageMetaData getMetaData(long messageId) throws SQLException
SQLException
public int getContent(long messageId, int offset, ByteBuffer dst)
public boolean isPersistent()
MessageStore
isPersistent
in interface MessageStore
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |