org.exolab.jms.tools.migration.proxy
Class MessageStore

java.lang.Object
  |
  +--org.exolab.jms.tools.migration.proxy.MessageStore
All Implemented Interfaces:
org.exolab.jms.tools.migration.proxy.DBConstants, Store

public class MessageStore
extends java.lang.Object
implements Store, org.exolab.jms.tools.migration.proxy.DBConstants

Provides persistency for Message instances.

Version:
$Revision: 1.1 $ $Date: 2005/09/04 07:07:12 $
Author:
Tim Anderson

Field Summary
static java.lang.String CONSUMER_TABLE
           
static java.lang.String DESTINATION_TABLE
           
static java.lang.String MESSAGE_HANDLE_TABLE
           
static java.lang.String MESSAGE_PROPERTIES_TABLE
           
static java.lang.String MESSAGE_TABLE
           
static java.lang.String PROPERTIES_TABLE
           
static java.lang.String SUBSCRIPTION_TABLE
           
static java.lang.String USER_TABLE
           
 
Constructor Summary
MessageStore(DestinationStore destinations, java.sql.Connection connection)
          Construct a new MessageStore.
 
Method Summary
 void add(javax.jms.Message message)
          Add a message.
 StoreIterator exportCollection()
          Export the collection.
 javax.jms.Message get(java.lang.String messageId)
          Returns a message for a given identifier.
 java.util.List getMessageIds()
          Returns all message identifiers.
 void importCollection(StoreIterator iterator)
          Import a collection.
 int size()
          Returns the number of elements in the collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTIES_TABLE

public static final java.lang.String PROPERTIES_TABLE

DESTINATION_TABLE

public static final java.lang.String DESTINATION_TABLE

MESSAGE_TABLE

public static final java.lang.String MESSAGE_TABLE

MESSAGE_PROPERTIES_TABLE

public static final java.lang.String MESSAGE_PROPERTIES_TABLE

CONSUMER_TABLE

public static final java.lang.String CONSUMER_TABLE

SUBSCRIPTION_TABLE

public static final java.lang.String SUBSCRIPTION_TABLE

MESSAGE_HANDLE_TABLE

public static final java.lang.String MESSAGE_HANDLE_TABLE

USER_TABLE

public static final java.lang.String USER_TABLE
Constructor Detail

MessageStore

public MessageStore(DestinationStore destinations,
                    java.sql.Connection connection)
Construct a new MessageStore.
Parameters:
destinations - the destination store
connection - the database connection.
Method Detail

exportCollection

public StoreIterator exportCollection()
                               throws javax.jms.JMSException,
                                      org.exolab.jms.persistence.PersistenceException
Export the collection.
Specified by:
exportCollection in interface Store
Returns:
an iterator over the collection
Throws:
javax.jms.JMSException - for any JMS error
org.exolab.jms.persistence.PersistenceException - for any persistence error

importCollection

public void importCollection(StoreIterator iterator)
                      throws javax.jms.JMSException,
                             org.exolab.jms.persistence.PersistenceException
Import a collection.
Specified by:
importCollection in interface Store
Parameters:
iterator - an iterator over the collection
Throws:
javax.jms.JMSException - for any JMS error
org.exolab.jms.persistence.PersistenceException - for any persistence error

size

public int size()
         throws org.exolab.jms.persistence.PersistenceException
Returns the number of elements in the collection.
Specified by:
size in interface Store
Returns:
the number of elements in the collection
Throws:
org.exolab.jms.persistence.PersistenceException - for any persistence error

add

public void add(javax.jms.Message message)
         throws javax.jms.JMSException,
                org.exolab.jms.persistence.PersistenceException
Add a message.
Parameters:
message - the message to add
Throws:
javax.jms.JMSException - for any JMS error
org.exolab.jms.persistence.PersistenceException - for any persistence error

get

public javax.jms.Message get(java.lang.String messageId)
                      throws javax.jms.JMSException,
                             org.exolab.jms.persistence.PersistenceException
Returns a message for a given identifier.
Parameters:
messageId - the identity of the message
Returns:
the message corresponding to messageId or null if no such message exists
Throws:
org.exolab.jms.persistence.PersistenceException - for any persistence error

getMessageIds

public java.util.List getMessageIds()
                             throws org.exolab.jms.persistence.PersistenceException
Returns all message identifiers.
Returns:
a list of message identifiers
Throws:
org.exolab.jms.persistence.PersistenceException - for any persistence error


Copyright © 1999-2007 The OpenJMS Group. All Rights Reserved.