|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.exolab.jms.persistence.PersistenceAdapter
|
+--org.exolab.jms.persistence.ObjectAdapter
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.
For this release the PageManager is used as the underlying database.
PMDSessionManager,
PMDHashMap,
PMDVector,
PersistentObject, Serialized Form| Constructor Summary | |
ObjectAdapter(java.lang.String dbName,
int minListSize,
int minMsgSize,
int minCacheSize)
Constructs a databse with the given name, if one does not exist, otherwise opens the existing database. |
|
| 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 this persistent data store. |
int |
getDurableConsumerMessageCount(java.sql.Connection connection,
java.lang.String topic,
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 queue)
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()
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 |
| Constructor Detail |
public ObjectAdapter(java.lang.String dbName,
int minListSize,
int minMsgSize,
int minCacheSize)
throws PersistenceException
PersistenceException - for any database error| Method Detail |
public void close()
close in class PersistenceAdapter
public long getLastId(java.sql.Connection connection)
throws PersistenceException
PersistenceAdaptergetLastId in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterPersistenceException -
public void updateIds(java.sql.Connection connection,
long id)
throws PersistenceException
PersistenceAdapterupdateIds in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to useid - The id to set in the database.PersistenceException -
public void addMessage(java.sql.Connection connection,
MessageImpl message)
throws PersistenceException
PersistenceAdapteraddMessage in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to useMessageImpl - the new message to addPersistenceException -
public void updateMessage(java.sql.Connection connection,
MessageImpl message)
throws PersistenceException
PersistenceAdapterupdateMessage in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to useMessageImpl - the new message to updatePersistenceException -
public void removeMessage(java.sql.Connection connection,
java.lang.String id)
throws PersistenceException
PersistenceAdapterremoveMessage in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usename - - the identity of the message to remove.PersistenceException -
public MessageImpl getMessage(java.sql.Connection connection,
java.lang.String id)
throws PersistenceException
PersistenceAdaptergetMessage in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to useString - The id of the message to search forPersistenceException -
public java.util.Vector getUnprocessedMessages(java.sql.Connection connection)
throws PersistenceException
PersistenceAdaptergetUnprocessedMessages in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usePersistenceException -
public java.util.Vector getMessages(java.sql.Connection connection,
PersistentMessageHandle handle)
throws PersistenceException
PersistenceAdaptergetMessages in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usehandle - - the persistent handle to resolvePersistenceException -
public void addMessageHandle(java.sql.Connection connection,
PersistentMessageHandle handle)
throws PersistenceException
PersistenceAdapteraddMessageHandle in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usehandle - - the persistent handle to addPersistenceException -
public void updateMessageHandle(java.sql.Connection connection,
PersistentMessageHandle handle)
throws PersistenceException
PersistenceAdapterupdateMessageHandle in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usehandle - - the persistent handle to updatePersistenceException -
public void removeMessageHandle(java.sql.Connection connection,
PersistentMessageHandle handle)
throws PersistenceException
PersistenceAdapterremoveMessageHandle in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usehandle - - the persistent handle to removePersistenceException - 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 PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usedestination - - the destination to referencename - - the consumer namePersistenceException -
public void addDurableConsumer(java.sql.Connection connection,
java.lang.String topic,
java.lang.String consumer)
throws PersistenceException
PersistenceAdapteraddDurableConsumer in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usetopic - - the name of the topicname - - the name of the consumerPersistenceException -
public void removeDurableConsumer(java.sql.Connection connection,
java.lang.String consumer)
throws PersistenceException
PersistenceAdapterremoveDurableConsumer in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to useconsumer - - the consumer namePersistenceException -
public boolean durableConsumerExists(java.sql.Connection connection,
java.lang.String name)
throws PersistenceException
PersistenceAdapterdurableConsumerExists in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usename - - durable consumer namePersistenceException -
public java.util.Enumeration getDurableConsumers(java.sql.Connection connection,
java.lang.String topic)
throws PersistenceException
PersistenceAdaptergetDurableConsumers in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usetopic - - the topic to queryPersistenceException -
public java.util.HashMap getAllDurableConsumers(java.sql.Connection connection)
throws PersistenceException
PersistenceAdaptergetAllDurableConsumers in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usePersistenceException -
public void addDestination(java.sql.Connection connection,
java.lang.String name,
boolean queue)
throws PersistenceException
PersistenceAdapteraddDestination in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usename - - the destination namequeue - - true if it pertains to a queuePersistenceException -
public void removeDestination(java.sql.Connection connection,
java.lang.String name)
throws PersistenceException
PersistenceAdapterremoveDestination in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usedestination - - the name of the destinationPersistenceException -
public boolean checkDestination(java.sql.Connection connection,
java.lang.String name)
throws PersistenceException
PersistenceAdaptercheckDestination in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usename - - the name to queryPersistenceException -
public java.util.Enumeration getAllDestinations(java.sql.Connection connection)
throws PersistenceException
PersistenceAdaptergetAllDestinations in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usePersistenceException -
public int getQueueMessageCount(java.sql.Connection connection,
java.lang.String queue)
throws PersistenceException
PersistenceAdaptergetQueueMessageCount in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usename - - the name of the queuePersistenceException -
public int getDurableConsumerMessageCount(java.sql.Connection connection,
java.lang.String topic,
java.lang.String name)
throws PersistenceException
PersistenceAdaptergetDurableConsumerMessageCount in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usedestination - - the destination namename - - the name of the durable subscriberPersistenceException -
public void removeExpiredMessages(java.sql.Connection connection)
throws PersistenceException
PersistenceAdapterremoveExpiredMessages in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usePersistenceException -
public void removeExpiredMessageHandles(java.sql.Connection connection,
java.lang.String consumer)
throws PersistenceException
PersistenceAdapterremoveExpiredMessageHandles in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to useconsumer - - the durable consumer namePersistenceException -
public java.util.Vector getNonExpiredMessages(java.sql.Connection connection,
JmsDestination destination)
throws PersistenceException
PersistenceAdapterPersistentMessageHandle objects,
for the specified destination.getNonExpiredMessages in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterconnection - - the connection to usedestination - - the destination in questionPersistenceException - public int purgeMessages()
PersistenceAdapterpurgeMessages in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapter
public void addUser(java.sql.Connection connection,
User user)
throws PersistenceException
addUser in class PersistenceAdapter
public java.util.Enumeration getAllUsers(java.sql.Connection connection)
throws PersistenceException
getAllUsers in class PersistenceAdapter
public User getUser(java.sql.Connection connection,
User user)
throws PersistenceException
getUser in class PersistenceAdapter
public void removeUser(java.sql.Connection connection,
User user)
throws PersistenceException
removeUser in class PersistenceAdapter
public void updateUser(java.sql.Connection connection,
User user)
throws PersistenceException
updateUser in class PersistenceAdapter
public java.sql.Connection getConnection()
throws PersistenceException
PersistenceAdaptergetConnection in class PersistenceAdapterorg.exolab.jms.persistence.PersistenceAdapterPersistenceException - - if it cannot retrieve a connectionpublic org.exolab.core.foundation.HandleIfc getHandle()
EventHandlerEventManager then you must support this
method, otherwise this method can simply return null.getHandle in interface EventHandlerorg.exolab.jms.events.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 EventHandlerorg.exolab.jms.events.EventHandlerevent - the event to handlecallback - the callback objecttime - the absolute time, in ms, that the event
fired.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||