|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exolab.jms.persistence.PersistenceAdapter
org.exolab.jms.persistence.RDBMSAdapter
public class RDBMSAdapter
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. Furure changes to the database will only require changes to the adapter.
| Field Summary | |
|---|---|
static java.lang.String |
SCHEMA_VERSION
The schema version number. |
| Method Summary | |
|---|---|
void |
addDestination(java.sql.Connection connection,
java.lang.String name,
boolean queue)
Add a new destination to the database. |
void |
addDurableConsumer(java.sql.Connection connection,
java.lang.String topic,
java.lang.String consumer)
Add the specified durable consumer |
void |
addMessage(java.sql.Connection connection,
MessageImpl message)
Add a new message to the database. |
void |
addMessageHandle(java.sql.Connection connection,
PersistentMessageHandle handle)
Add the specified persistent message handle. |
void |
addUser(java.sql.Connection connection,
User user)
|
boolean |
checkDestination(java.sql.Connection connection,
java.lang.String name)
Determine if a particular destination name exists |
void |
close()
Close the database if open. |
boolean |
durableConsumerExists(java.sql.Connection connection,
java.lang.String name)
Check if the durable consumer exists |
java.util.Enumeration |
getAllDestinations(java.sql.Connection connection)
Get a list of all destinations stored in the database |
java.util.HashMap |
getAllDurableConsumers(java.sql.Connection connection)
Return a dictionary of all registered durable consumers. |
java.util.Enumeration |
getAllUsers(java.sql.Connection connection)
|
java.sql.Connection |
getConnection()
Return a connection to the database from the pool of connections. |
DBConnectionManager |
getDBConnectionManager()
Return a reference to the DBConnectionManager |
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. |
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 |
org.exolab.core.foundation.HandleIfc |
getHandle()
Return a handle to this event handler for the purpose of storing and restoring it. |
long |
getLastId(java.sql.Connection connection)
Check to see if the root is created. |
MessageImpl |
getMessage(java.sql.Connection connection,
java.lang.String id)
Get a message from the persistence store. |
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. |
java.util.Vector |
getMessages(java.sql.Connection connection,
PersistentMessageHandle handle)
Get at least the next message given the specified persistent handle. |
java.util.Vector |
getNonExpiredMessages(java.sql.Connection connection,
JmsDestination destination)
Retrieve a list of unexpired PersistentMessageHandle objects,
for the specified destination. |
int |
getQueueMessageCount(java.sql.Connection connection,
java.lang.String name)
Get the number of unsent messages for a the specified queue |
java.util.Vector |
getUnprocessedMessages(java.sql.Connection connection)
Return a list of unprocessed messages. |
User |
getUser(java.sql.Connection connection,
User user)
|
void |
handleEvent(int event,
java.lang.Object callback,
long time)
Handle the specified event, generated by the EventManager. |
int |
purgeMessages()
Incrementally purge all processed messages from the database. |
void |
removeDestination(java.sql.Connection connection,
java.lang.String name)
Remove the destination with the specified name and all registered consumers from the database. |
void |
removeDurableConsumer(java.sql.Connection connection,
java.lang.String consumer)
Remove the durable consumer for the specified topic. |
void |
removeExpiredMessageHandles(java.sql.Connection connection,
java.lang.String consumer)
Remove all expired messages handles associated with this durable consumer. |
void |
removeExpiredMessages(java.sql.Connection connection)
Remove all expired messages and associated references from the database. |
void |
removeMessage(java.sql.Connection connection,
java.lang.String id)
Remove the message with the specified identity from the database |
void |
removeMessageHandle(java.sql.Connection connection,
PersistentMessageHandle handle)
Remove the specified persistent message handle. |
void |
removeUser(java.sql.Connection connection,
User user)
|
void |
updateIds(java.sql.Connection connection,
long id)
Update the given id. |
void |
updateMessage(java.sql.Connection connection,
MessageImpl message)
Update this message in the database |
void |
updateMessageHandle(java.sql.Connection connection,
PersistentMessageHandle handle)
Update the specified persistent message handle. |
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 |
| Field Detail |
|---|
public static final java.lang.String SCHEMA_VERSION
| Method Detail |
|---|
public void close()
close in class PersistenceAdapter
public long getLastId(java.sql.Connection connection)
throws PersistenceException
PersistenceAdapter
getLastId in class PersistenceAdapterPersistenceException
public void updateIds(java.sql.Connection connection,
long id)
throws PersistenceException
PersistenceAdapter
updateIds in class PersistenceAdapterconnection - - the connection to useid - The id to set in the database.
PersistenceException
public void addMessage(java.sql.Connection connection,
MessageImpl message)
throws PersistenceException
PersistenceAdapter
addMessage in class PersistenceAdapterconnection - - the connection to use
PersistenceException
public void updateMessage(java.sql.Connection connection,
MessageImpl message)
throws PersistenceException
PersistenceAdapter
updateMessage in class PersistenceAdapterconnection - - the connection to use
PersistenceException
public java.util.Vector getUnprocessedMessages(java.sql.Connection connection)
throws PersistenceException
PersistenceAdapter
getUnprocessedMessages in class PersistenceAdapterconnection - - the connection to use
PersistenceException
public void removeMessage(java.sql.Connection connection,
java.lang.String id)
throws PersistenceException
PersistenceAdapter
removeMessage in class PersistenceAdapterconnection - - the connection to use
PersistenceException
public MessageImpl getMessage(java.sql.Connection connection,
java.lang.String id)
throws PersistenceException
PersistenceAdapter
getMessage in class PersistenceAdapterconnection - - the connection to use
PersistenceException
public java.util.Vector getMessages(java.sql.Connection connection,
PersistentMessageHandle handle)
throws PersistenceException
PersistenceAdapter
getMessages in class PersistenceAdapterconnection - - the connection to usehandle - - the persistent handle to resolve
PersistenceException
public void addMessageHandle(java.sql.Connection connection,
PersistentMessageHandle handle)
throws PersistenceException
PersistenceAdapter
addMessageHandle in class PersistenceAdapterconnection - - the connection to usehandle - - the persistent handle to add
PersistenceException
public void updateMessageHandle(java.sql.Connection connection,
PersistentMessageHandle handle)
throws PersistenceException
PersistenceAdapter
updateMessageHandle in class PersistenceAdapterconnection - - the connection to usehandle - - the persistent handle to update
PersistenceException
public void removeMessageHandle(java.sql.Connection connection,
PersistentMessageHandle handle)
throws PersistenceException
PersistenceAdapter
removeMessageHandle in class PersistenceAdapterconnection - - the connection to usehandle - - the persistent handle to remove
PersistenceException
public java.util.Vector getMessageHandles(java.sql.Connection connection,
JmsDestination destination,
java.lang.String name)
throws PersistenceException
PersistenceAdapterThe returned messages reference unacked or unsent messages
NEED A STRATEGY WHEN WE HAVE LOTS OF MESSAGE HANDLES
getMessageHandles in class PersistenceAdapterconnection - - the connection to usedestination - - the destination to referencename - - the consumer name
PersistenceException
public void addDurableConsumer(java.sql.Connection connection,
java.lang.String topic,
java.lang.String consumer)
throws PersistenceException
PersistenceAdapter
addDurableConsumer in class PersistenceAdapterconnection - - the connection to usetopic - - the name of the topic
PersistenceException
public void removeDurableConsumer(java.sql.Connection connection,
java.lang.String consumer)
throws PersistenceException
PersistenceAdapter
removeDurableConsumer in class PersistenceAdapterconnection - - the connection to useconsumer - - the consumer name
PersistenceException
public java.util.Enumeration getDurableConsumers(java.sql.Connection connection,
java.lang.String topic)
throws PersistenceException
PersistenceAdapter
getDurableConsumers in class PersistenceAdapterconnection - - the connection to usetopic - - the topic to query
PersistenceException
public java.util.HashMap getAllDurableConsumers(java.sql.Connection connection)
throws PersistenceException
PersistenceAdapter
getAllDurableConsumers in class PersistenceAdapterconnection - - the connection to use
PersistenceException
public boolean durableConsumerExists(java.sql.Connection connection,
java.lang.String name)
throws PersistenceException
PersistenceAdapter
durableConsumerExists in class PersistenceAdapterconnection - - the connection to usename - - durable consumer name
PersistenceException
public void addDestination(java.sql.Connection connection,
java.lang.String name,
boolean queue)
throws PersistenceException
PersistenceAdapter
addDestination in class PersistenceAdapterconnection - - the connection to usename - - the destination namequeue - - true if it pertains to a queue
PersistenceException
public void removeDestination(java.sql.Connection connection,
java.lang.String name)
throws PersistenceException
PersistenceAdapter
removeDestination in class PersistenceAdapterconnection - - the connection to usename - - the name of the destination
PersistenceException
public java.util.Enumeration getAllDestinations(java.sql.Connection connection)
throws PersistenceException
PersistenceAdapter
getAllDestinations in class PersistenceAdapterconnection - - the connection to use
PersistenceException
public boolean checkDestination(java.sql.Connection connection,
java.lang.String name)
throws PersistenceException
PersistenceAdapter
checkDestination in class PersistenceAdapterconnection - - the connection to usename - - the name to query
PersistenceException
public int getQueueMessageCount(java.sql.Connection connection,
java.lang.String name)
throws PersistenceException
PersistenceAdapter
getQueueMessageCount in class PersistenceAdapterconnection - - the connection to usename - - the name of the queue
PersistenceException
public int getDurableConsumerMessageCount(java.sql.Connection connection,
java.lang.String destination,
java.lang.String name)
throws PersistenceException
PersistenceAdapter
getDurableConsumerMessageCount in class PersistenceAdapterconnection - - the connection to usedestination - - the destination namename - - the name of the durable subscriber
PersistenceException
public void removeExpiredMessages(java.sql.Connection connection)
throws PersistenceException
PersistenceAdapter
removeExpiredMessages in class PersistenceAdapterconnection - - the connection to use
PersistenceException
public void removeExpiredMessageHandles(java.sql.Connection connection,
java.lang.String consumer)
throws PersistenceException
PersistenceAdapter
removeExpiredMessageHandles in class PersistenceAdapterconnection - - the connection to useconsumer - - the durable consumer name
PersistenceException
public java.util.Vector getNonExpiredMessages(java.sql.Connection connection,
JmsDestination destination)
throws PersistenceException
PersistenceAdapterPersistentMessageHandle objects,
for the specified destination.
getNonExpiredMessages in class PersistenceAdapterconnection - - the connection to usedestination - - the destination in question
PersistenceExceptionpublic org.exolab.core.foundation.HandleIfc getHandle()
EventHandlerEventManager then you must support this
method, otherwise this method can simply return null.
getHandle in interface EventHandler
public void handleEvent(int event,
java.lang.Object callback,
long time)
EventHandlerEventManager.
The event handler pressumably knows how to handle the callback object
and should cast it appropriately before using it.
This methodshould not throw any exceptions
handleEvent in interface EventHandlerevent - the event to handlecallback - the callback objecttime - the absolute time, in ms, that the event
fired.
public java.sql.Connection getConnection()
throws PersistenceException
getConnection in class PersistenceAdapterPersistenceException - - if it cannot retrieve a connectionpublic DBConnectionManager getDBConnectionManager()
public void addUser(java.sql.Connection connection,
User user)
throws PersistenceException
addUser in class PersistenceAdapterPersistenceException
public java.util.Enumeration getAllUsers(java.sql.Connection connection)
throws PersistenceException
getAllUsers in class PersistenceAdapterPersistenceException
public User getUser(java.sql.Connection connection,
User user)
throws PersistenceException
getUser in class PersistenceAdapterPersistenceException
public void removeUser(java.sql.Connection connection,
User user)
throws PersistenceException
removeUser in class PersistenceAdapterPersistenceException
public void updateUser(java.sql.Connection connection,
User user)
throws PersistenceException
updateUser in class PersistenceAdapterPersistenceExceptionpublic int purgeMessages()
purgeMessages in class PersistenceAdapter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||