com.ibm.broker.config.proxy
Class SubscriptionQuery

java.lang.Object
  extended by com.ibm.broker.config.proxy.SubscriptionQuery

public class SubscriptionQuery
extends java.lang.Object

This class allows applications to query the subscriptions a broker currently holds. Here is an example of how the class can be used:

     ConfigManagerConnectionParameters cmcp =
         new MQConfigManagerConnectionParameters("localhost", 1414, "QMGR");
     ConfigManagerProxy cmp = ConfigManagerProxy.getInstance(cmcp);
     TopologyProxy tp = cmp.getTopology();
     BrokerProxy bp = tp.getBrokerByName("BROKER1");
     SubscriptionQuery sq = bp.createSubscriptionQuery();
     sq.setString(SubscriptionParameters.TOPIC, "topicA");
     SubscriptionsProxy sp = sq.executeQuery();
 

com.ibm.broker.config.proxy.SubscriptionsQuery

Responsibilities Allows applications to query a broker's subscriptions.
Internal Collaborators com.ibm.broker.config.proxy.SubscriptionsProxy

 Change Activity:
 -------- ----------- -------------   ------------------------------------
 Reason:  Date:       Originator:     Comments:
 -------- ----------- -------------   ------------------------------------
 45920    2007-07-30  HDMPL           v6.1 release
 

Version:
Config/com/ibm/broker/config/proxy/SubscriptionQuery.java, CMP, S000 1.2

Method Summary
 SubscriptionsProxy executeQuery()
          Executes the subscription query specified by this SubscriptionQuery object against the broker.
 void setBytes(java.lang.String parameterName, byte[] bytes)
          Sets a parameter of type byte[] in this SubscriptionQuery object.
 void setDate(java.lang.String parameterName, java.util.GregorianCalendar date)
          Sets a parameter of type GregorianCalendar in this SubscriptionQuery object.
 void setQueryLimit(int queryLimit)
          Sets the query limit for this SubscriptionQuery.
 void setString(java.lang.String parameterName, java.lang.String string)
          Sets a parameter of type java.lang.String in this SubscriptionQuery object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setQueryLimit

public void setQueryLimit(int queryLimit)
Sets the query limit for this SubscriptionQuery. This sets the maxium number of subscription objects that will be returned when the query is executed.

Parameters:
queryLimit - The query limit.

setString

public void setString(java.lang.String parameterName,
                      java.lang.String string)
Sets a parameter of type java.lang.String in this SubscriptionQuery object. The parameter must one of the java.lang.String parameters declarded in the class SubscriptionParameter.

Parameters:
parameterName - The parameter to be set.
string - The string value to set the parameter to. '%' can be used within the string to denote a wildcard.
Throws:
java.lang.IllegalArgumentException - If the parameter being set is not of type java.lang.String

setBytes

public void setBytes(java.lang.String parameterName,
                     byte[] bytes)
Sets a parameter of type byte[] in this SubscriptionQuery object. The parameter must one of the byte[] parameters declarded in the class SubscriptionParameter.

Parameters:
parameterName - The parameter to be set.
string - The byte[] value to set the parameter to.
Throws:
java.lang.IllegalArgumentException - If the parameter being set is not of type byte[]

setDate

public void setDate(java.lang.String parameterName,
                    java.util.GregorianCalendar date)
Sets a parameter of type GregorianCalendar in this SubscriptionQuery object. The parameter must one of the GregorianCalendar parameters declarded in the class SubscriptionParameters.

Parameters:
parameterName - The parameter to be set.
string - The byte[] value to set the parameter to.
Throws:
java.lang.IllegalArgumentException - If the parameter being set is not of type GregorianCalendar

executeQuery

public SubscriptionsProxy executeQuery()
                                throws ConfigManagerProxyLoggedException,
                                       ConfigManagerProxyPropertyNotInitializedException
Executes the subscription query specified by this SubscriptionQuery object against the broker.

Returns:
SubscriptionsProxy Object containing the Subscription Objects that matched the subscription query. The object will be asynchronously populated with the matching results.
Throws:
ConfigManagerProxyLoggedException
ConfigManagerProxyPropertyNotInitializedException