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

java.lang.Object
  |
  +--org.exolab.jms.tools.migration.proxy.Consumers

public class Consumers
extends java.lang.Object

Provides persistency for Consumer instances.

Version:
$Revision: 1.6 $ $Date: 2001/09/18 22:54:44 $
Author:
Tim Anderson

Constructor Summary
Consumers(Context context)
          Construct a new Consumers instance
 
Method Summary
 void add(Consumer consumer)
          Add a new consumer
protected  void addMessages(long consumerId, long destinationId, Subscription subscription)
          Add messages for a subscription
protected  void addSubscriptions(long consumerId, Consumer consumer)
          Add subscriptions for a consumer
 Consumer get(long consumerId)
          Returns a consumer for a given identifier
 java.util.List getConsumerIds()
          Returns all consumer identifiers
protected  void getMessages(long consumerId, long destinationId, Subscription subscription)
          Get messages for a subscription
protected  void getSubscriptions(long consumerId, Consumer consumer)
          Get subscriptions for a consumer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Consumers

public Consumers(Context context)
Construct a new Consumers instance
Parameters:
context - context information
Method Detail

add

public void add(Consumer consumer)
         throws java.sql.SQLException
Add a new consumer
Parameters:
consumer - the consumer to add
Throws:
java.sql.SQLException - if a database error is encountered

get

public Consumer get(long consumerId)
             throws java.sql.SQLException
Returns a consumer for a given identifier
Parameters:
consumerId - the identity of the consumer
Returns:
the consumer corresponding to consumerId or null if no such consumer exists
Throws:
java.sql.SQLException - if a database error is encountered

getConsumerIds

public java.util.List getConsumerIds()
                              throws java.sql.SQLException
Returns all consumer identifiers
Returns:
a list of consumer identifiers
Throws:
java.sql.SQLException - if a database error is encountered

addSubscriptions

protected void addSubscriptions(long consumerId,
                                Consumer consumer)
                         throws java.sql.SQLException
Add subscriptions for a consumer
Parameters:
consumerId - the identity of the consumer
name - the consumer name
Throws:
java.sql.SQLException - if a database error is encountered

addMessages

protected void addMessages(long consumerId,
                           long destinationId,
                           Subscription subscription)
                    throws java.sql.SQLException
Add messages for a subscription
Parameters:
consumerId - the identity of the consumer
destinationId - the identify of the destination
subscription - the consumer subscription
Throws:
java.sql.SQLException - if a database error is encountered

getSubscriptions

protected void getSubscriptions(long consumerId,
                                Consumer consumer)
                         throws java.sql.SQLException
Get subscriptions for a consumer
Parameters:
consumerId - the identity of the consumer
consumer - the consumer to populate
Throws:
java.sql.SQLException - if a database error is encountered

getMessages

protected void getMessages(long consumerId,
                           long destinationId,
                           Subscription subscription)
                    throws java.sql.SQLException
Get messages for a subscription
Parameters:
consumerId - the identity of the consumer
destinationId - the identify of the destination
subscription - the consumer subscription
Throws:
java.sql.SQLException - if a database error is encountered


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