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

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

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

Provides persistency for JmsDestination instances.

Version:
$Revision: 1.2 $ $Date: 2005/10/20 14:07:03 $
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
DestinationStore(java.sql.Connection connection)
          Construct a new DestinationStore.
 
Method Summary
 void add(org.exolab.jms.client.JmsDestination destination)
          Add a new destination to the database, assigning it a unique identity.
 StoreIterator exportCollection()
          Export the destinations.
 org.exolab.jms.client.JmsDestination get(long destinationId)
          Returns the destination associated with the specified identifier.
 java.util.List getDestinations()
          Returns the list of destination objects.
 long getId(org.exolab.jms.client.JmsDestination destination)
          Returns the destination identifier for a given destination.
 void importCollection(StoreIterator iterator)
          Import destinations into the store.
protected  void load()
          Load all destinations.
 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

DestinationStore

public DestinationStore(java.sql.Connection connection)
                 throws org.exolab.jms.persistence.PersistenceException
Construct a new DestinationStore.
Parameters:
connection - the database connection
Throws:
org.exolab.jms.persistence.PersistenceException - for any persistence error
Method Detail

exportCollection

public StoreIterator exportCollection()
                               throws javax.jms.JMSException,
                                      org.exolab.jms.persistence.PersistenceException
Export the destinations.
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 destinations into the store.
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

add

public void add(org.exolab.jms.client.JmsDestination destination)
         throws org.exolab.jms.persistence.PersistenceException
Add a new destination to the database, assigning it a unique identity.
Parameters:
destination - the destination to add
Throws:
org.exolab.jms.persistence.PersistenceException - for any persistence error

get

public org.exolab.jms.client.JmsDestination get(long destinationId)
Returns the destination associated with the specified identifier.
Parameters:
destinationId - the destination identifier
Returns:
the destination, or null if no corresponding destination exists

getId

public long getId(org.exolab.jms.client.JmsDestination destination)
Returns the destination identifier for a given destination.
Parameters:
destination - the destination
Returns:
the destination identifier, or -1 if no corresponding destination exists

getDestinations

public java.util.List getDestinations()
Returns the list of destination objects.
Returns:
a list of javax.jms.Destination instances

load

protected void load()
             throws org.exolab.jms.persistence.PersistenceException
Load all destinations.
Throws:
org.exolab.jms.persistence.PersistenceException - for any persistence error


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