|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.persistence.PersistenceAdapter
This adapter is a wrapper class around the persistency mechanism. It isolates the client from the working specifics of the database, by providing a simple straight forward interface. Future changes to the database will only require changes to the adapter.
RDBMSAdapter
Constructor Summary | |
PersistenceAdapter()
|
Method Summary | |
abstract void |
addDestination(java.sql.Connection connection,
java.lang.String name,
boolean queue)
Add a new destination to the database. |
abstract void |
addDurableConsumer(java.sql.Connection connection,
java.lang.String topic,
java.lang.String consumer)
Add the specified durable consumer |
abstract void |
addMessage(java.sql.Connection connection,
MessageImpl message)
Add a new message to the database. |
abstract void |
addMessageHandle(java.sql.Connection connection,
MessageHandle handle)
Add the specified persistent message handle. |
abstract void |
addUser(java.sql.Connection connection,
User user)
|
abstract boolean |
checkDestination(java.sql.Connection connection,
java.lang.String name)
Determine if a particular destination name exists |
abstract void |
close()
Close the database if open. |
abstract boolean |
durableConsumerExists(java.sql.Connection connection,
java.lang.String name)
Check if the durable consumer exists |
abstract java.util.Enumeration |
getAllDestinations(java.sql.Connection connection)
Get a list of all destinations stored in the database |
abstract java.util.HashMap |
getAllDurableConsumers(java.sql.Connection connection)
Return a dictionary of all registered durable consumers. |
abstract java.util.Enumeration |
getAllUsers(java.sql.Connection connection)
|
abstract java.sql.Connection |
getConnection()
Return a connection to this persistent data store. |
abstract int |
getDurableConsumerMessageCount(java.sql.Connection connection,
java.lang.String destination,
java.lang.String name)
Return the number of unsent message for the specified durable consumer. |
abstract java.util.Enumeration |
getDurableConsumers(java.sql.Connection connection,
java.lang.String topic)
Get an enumerated list of all durable consumers for the specified JmsTopic destination |
abstract long |
getLastId(java.sql.Connection connection)
Check to see if the root is created. |
abstract MessageImpl |
getMessage(java.sql.Connection connection,
java.lang.String id)
Get a message from the persistence store. |
abstract java.util.Vector |
getMessageHandles(java.sql.Connection connection,
JmsDestination destination,
java.lang.String name)
Get all the persistent message handles for the specified destination and consumer name. |
abstract java.util.Vector |
getMessages(java.sql.Connection connection,
MessageHandle handle)
Get at least the next message given the specified persistent handle. |
abstract java.util.Vector |
getNonExpiredMessages(java.sql.Connection connection,
JmsDestination destination)
Retrieve a list of unexpired MessageHandle objects,
for the specified destination. |
abstract int |
getQueueMessageCount(java.sql.Connection connection,
java.lang.String name)
Get the number of unsent messages for a the specified queue |
abstract java.util.Vector |
getUnprocessedMessages(java.sql.Connection connection)
Return a list of unprocessed messages. |
abstract User |
getUser(java.sql.Connection connection,
User user)
|
abstract int |
purgeMessages()
Purge all processed messages from the database. |
abstract void |
removeDestination(java.sql.Connection connection,
java.lang.String destination)
Remove the destination with the specified name and all registered consumers from the database. |
abstract void |
removeDurableConsumer(java.sql.Connection connection,
java.lang.String consumer)
Remove the durable consumer for the specified topic. |
abstract void |
removeExpiredMessageHandles(java.sql.Connection connection,
java.lang.String consumer)
Remove all expired messages handles associated with this durable consumer. |
abstract void |
removeExpiredMessages(java.sql.Connection connection)
Remove all expired messages and associated references from the database. |
abstract void |
removeMessage(java.sql.Connection connection,
java.lang.String id)
Remove the message with the specified identity from the database |
abstract void |
removeMessageHandle(java.sql.Connection connection,
MessageHandle handle)
Remove the specified persistent message handle. |
abstract void |
removeUser(java.sql.Connection connection,
User user)
|
abstract void |
updateIds(java.sql.Connection connection,
long id)
Update the given id. |
abstract void |
updateMessage(java.sql.Connection connection,
MessageImpl message)
Update this message in the database |
abstract void |
updateMessageHandle(java.sql.Connection connection,
MessageHandle handle)
Update the specified persistent message handle. |
abstract void |
updateUser(java.sql.Connection connection,
User user)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PersistenceAdapter()
Method Detail |
public abstract void close()
public abstract long getLastId(java.sql.Connection connection) throws PersistenceException
PersistenceException
- public abstract void updateIds(java.sql.Connection connection, long id) throws PersistenceException
connection
- - the connection to useid
- The id to set in the database.PersistenceException
- public abstract void addMessage(java.sql.Connection connection, MessageImpl message) throws PersistenceException
connection
- the connection to usemessage
- the new message to addPersistenceException
- public abstract void updateMessage(java.sql.Connection connection, MessageImpl message) throws PersistenceException
connection
- the connection to usemessage
- the message to updatePersistenceException
- public abstract void removeMessage(java.sql.Connection connection, java.lang.String id) throws PersistenceException
connection
- - the connection to useid
- the identity of the message to removePersistenceException
- public abstract void removeExpiredMessages(java.sql.Connection connection) throws PersistenceException
connection
- - the connection to usePersistenceException
- public abstract void removeExpiredMessageHandles(java.sql.Connection connection, java.lang.String consumer) throws PersistenceException
connection
- - the connection to useconsumer
- - the durable consumer namePersistenceException
- public abstract java.util.Vector getNonExpiredMessages(java.sql.Connection connection, JmsDestination destination) throws PersistenceException
MessageHandle
objects,
for the specified destination.connection
- - the connection to usedestination
- - the destination in questionPersistenceException
- public abstract MessageImpl getMessage(java.sql.Connection connection, java.lang.String id) throws PersistenceException
connection
- - the connection to useid
- the id of the message to search forPersistenceException
- public abstract java.util.Vector getMessages(java.sql.Connection connection, MessageHandle handle) throws PersistenceException
connection
- - the connection to usehandle
- - the persistent handle to resolvePersistenceException
- public abstract java.util.Vector getUnprocessedMessages(java.sql.Connection connection) throws PersistenceException
connection
- - the connection to usePersistenceException
- public abstract void addMessageHandle(java.sql.Connection connection, MessageHandle handle) throws PersistenceException
connection
- - the connection to usehandle
- - the persistent handle to addPersistenceException
- public abstract void updateMessageHandle(java.sql.Connection connection, MessageHandle handle) throws PersistenceException
connection
- - the connection to usehandle
- - the persistent handle to updatePersistenceException
- public abstract void removeMessageHandle(java.sql.Connection connection, MessageHandle handle) throws PersistenceException
connection
- - the connection to usehandle
- - the persistent handle to removePersistenceException
- PersistenceException
- public abstract java.util.Vector getMessageHandles(java.sql.Connection connection, JmsDestination destination, java.lang.String name) throws PersistenceException
The returned messages reference unacked or unsent messages
NEED A STRATEGY WHEN WE HAVE LOTS OF MESSAGE HANDLES
connection
- - the connection to usedestination
- - the destination to referencename
- - the consumer namePersistenceException
- public abstract void addDurableConsumer(java.sql.Connection connection, java.lang.String topic, java.lang.String consumer) throws PersistenceException
connection
- - the connection to usetopic
- - the name of the topicconsumer
- the name of the consumerPersistenceException
- public abstract void removeDurableConsumer(java.sql.Connection connection, java.lang.String consumer) throws PersistenceException
connection
- - the connection to useconsumer
- - the consumer namePersistenceException
- public abstract boolean durableConsumerExists(java.sql.Connection connection, java.lang.String name) throws PersistenceException
connection
- - the connection to usename
- - durable consumer namePersistenceException
- public abstract java.util.Enumeration getDurableConsumers(java.sql.Connection connection, java.lang.String topic) throws PersistenceException
connection
- - the connection to usetopic
- - the topic to queryPersistenceException
- public abstract java.util.HashMap getAllDurableConsumers(java.sql.Connection connection) throws PersistenceException
connection
- - the connection to usePersistenceException
- public abstract void addDestination(java.sql.Connection connection, java.lang.String name, boolean queue) throws PersistenceException
connection
- - the connection to usename
- - the destination namequeue
- - true if it pertains to a queuePersistenceException
- public abstract void removeDestination(java.sql.Connection connection, java.lang.String destination) throws PersistenceException
connection
- - the connection to usedestination
- - the name of the destinationPersistenceException
- public abstract boolean checkDestination(java.sql.Connection connection, java.lang.String name) throws PersistenceException
connection
- - the connection to usename
- - the name to queryPersistenceException
- public abstract java.util.Enumeration getAllDestinations(java.sql.Connection connection) throws PersistenceException
connection
- - the connection to usePersistenceException
- public abstract int getQueueMessageCount(java.sql.Connection connection, java.lang.String name) throws PersistenceException
connection
- - the connection to usename
- - the name of the queuePersistenceException
- public abstract int getDurableConsumerMessageCount(java.sql.Connection connection, java.lang.String destination, java.lang.String name) throws PersistenceException
connection
- - the connection to usedestination
- - the destination namename
- - the name of the durable subscriberPersistenceException
- public abstract int purgeMessages()
public abstract java.sql.Connection getConnection() throws PersistenceException
PersistenceException
- - if it cannot retrieve a connectionpublic abstract java.util.Enumeration getAllUsers(java.sql.Connection connection) throws PersistenceException
public abstract void addUser(java.sql.Connection connection, User user) throws PersistenceException
public abstract void removeUser(java.sql.Connection connection, User user) throws PersistenceException
public abstract void updateUser(java.sql.Connection connection, User user) throws PersistenceException
public abstract User getUser(java.sql.Connection connection, User user) throws PersistenceException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |