com.ibm.broker.config.proxy
Class SubscriptionsProxy

java.lang.Object
  extended by com.ibm.broker.config.proxy.AdministeredObject
      extended by com.ibm.broker.config.proxy.SubscriptionsProxy

public class SubscriptionsProxy
extends AdministeredObject

Represents a query of the Configuration Manager's broker subscriptions table, and the results.

In order to use SubscriptionsProxy objects, applications must first obtain handles to them. Here is an example of how to do this:

     ConfigManagerConnectionParameters cmcp =
         new MQConfigManagerConnectionParameters("localhost", 1414, "QMGR");
     ConfigManagerProxy cmp = ConfigManagerProxy.getInstance(cmcp);
 
     String topics = null;                            // all topics
     String brokers = "BROKER%";                      // all brokers beginning 'BROKER'
     String users = null;                             // all users
     String subsPoints = null;                        // all subscriptions points
     GregorianCalendar start = null;                  // no start date
     GregorianCalendar end = new GregorianCalendar(); // to the present
     SubscriptionsProxy s = cmp.getSubscriptions(topics, brokers,
                                                 users, subsPoints,
                                                 start, end);
 
Each ConfigManagerProxy can have multiple subscriptions queries active.

Note: Once a SubscriptionsProxy is populated with the results of a query (that is, when hasBeenUpdatedByConfigManager() returns true) - the object will receive no further updates from the Configuration Manager. This means that, even if the set of active subscriptions changes, the SubscriptionsProxy returned will only reflect the state of the subscriptions table at the point the query was made. Applications must call ConfigManagerProxy.getSubscriptions() again in order to receive updated information.

com.ibm.broker.config.proxy.SubscriptionsProxy extends com.ibm.broker.config.proxy.AdministeredObject

Responsibilities Represents an SQL query of the Configuration Manager's Subscriptions table and its results.
Internal Collaborators None

 Change Activity:
 --------   ----------- -------------   ------------------------------------
 Reason:    Date:       Originator:     Comments:
 --------   ----------- -------------   ------------------------------------
 25103.1    2004-03-22  HDMPL           v6 Release
 44739.7    2007-07-30  HDMPL           v6.1 Release:
                                         Methods now return genericized types where relevant
                                         Added adoptBroker(String, String, String)

 

Version:
Config/com/ibm/broker/config/proxy/SubscriptionsProxy.java, CMP, S000 1.25

Method Summary
 void addAccessControlEntries(AccessControlEntry[] accessControlList)
          Adds this list to the list of access control entries that applies to this object.
 void deleteSubscriptions(Subscription[] subs)
          Asks the Configuration Manager to delete the supplied subscriptions.
 java.util.Enumeration<Subscription> elements()
          Returns an Enumeration of all Subscription objects available to the user that match this query.
 AccessControlEntry[] getAccessControlEntries()
          Creates and returns a set of AccessControlEntry objects that describes the set of (principal,permission) tuples that have been applied specifically to this object.
 ConfigurationObjectType getConfigurationObjectType()
          Returns the ConfigurationObjectType associated with this AdministeredObject type.
 ConfigurationObjectType getConfigurationObjectTypeOfParent()
          Returns the ConfigurationObjectType associated with the logical parent of this AdministeredObject type.
 int getSize()
          Returns the number of Subscription objects available to the user.
 Subscription getSubscription(int position)
          Returns the Subscription at the supplied position in the list.
 void removeAccessControlEntries(AccessControlEntry[] accessControlList)
          Deletes this list from the list of access control entries that applies to this object.
 void setAccessControlEntries(AccessControlEntry[] accessControlList)
          Sets the complete list of access control entries that apply to this object.
 
Methods inherited from class com.ibm.broker.config.proxy.AdministeredObject
deregisterListener, deregisterListener, elements, getLastBIPMessages, getLastCompletionCode, getLastUpdateUser, getLongDescription, getManagedSubcomponent, getManagedSubcomponentFromStringRepresentation, getManagedSubcomponents, getManagedSubcomponents, getManagedSubcomponents, getManagedSubcomponents, getManagedSubcomponentsAsStrings, getManagedSubcomponentsAsStrings, getName, getNumberOfSubcomponents, getParent, getProperties, getProperty, getProperty, getProperty, getProperty, getRepositoryTimestamp, getShortDescription, getTimeOfLastCompletionCode, getTimeOfLastUpdate, getType, getUUID, hasBeenRestrictedByConfigManager, hasBeenRestrictedByConfigManager, hasBeenUpdatedByConfigManager, hasBeenUpdatedByConfigManager, isAwaitingSubmissionForCreation, isAwaitingSubmissionForDeletion, isDeployed, isShared, refresh, registerListener, registerListener, registerListener, setLongDescription, setName, setProperties, setShortDescription, toString, toVerboseString, unsubscribeFromConfigurationManagerUpdates, withName, withUUID
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getSize

public int getSize()
            throws ConfigManagerProxyPropertyNotInitializedException
Returns the number of Subscription objects available to the user.

Returns:
int Number of Subscription objects viewable.
Throws:
ConfigManagerProxyPropertyNotInitializedException - if the requested property is not yet known.

getSubscription

public Subscription getSubscription(int position)
                             throws java.lang.ArrayIndexOutOfBoundsException,
                                    ConfigManagerProxyPropertyNotInitializedException
Returns the Subscription at the supplied position in the list.

Parameters:
position - Number of the Subscription to return. The first entry in the SubscriptionProxy is at position 1.
Returns:
Subscription The entry at the given element
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the value of the supplied position is less than one or greater than the number of viewable entries.
ConfigManagerProxyPropertyNotInitializedException - if the requested property is not yet known.

deleteSubscriptions

public void deleteSubscriptions(Subscription[] subs)
                         throws ConfigManagerProxyLoggedException
Asks the Configuration Manager to delete the supplied subscriptions.

Note: Any response message from the Configuration Manager resulting from this method will be sent to listeners of the ConfigManagerProxy object, because Subscriptions and SubscriptionsProxies cannot have AdministeredObjectListeners.

Parameters:
subs - Array of subscription objects to delete.
Throws:
ConfigManagerProxyLoggedException - if the request could not be sent to the Configuration Manager.

elements

public java.util.Enumeration<Subscription> elements()
                                             throws ConfigManagerProxyPropertyNotInitializedException
Returns an Enumeration of all Subscription objects available to the user that match this query.

Returns:
Enumeration of available Subscription objects
Throws:
ConfigManagerProxyPropertyNotInitializedException - if the requested property is not yet known.

getConfigurationObjectType

public ConfigurationObjectType getConfigurationObjectType()
Returns the ConfigurationObjectType associated with this AdministeredObject type.

Specified by:
getConfigurationObjectType in class AdministeredObject
Returns:
ConfigurationObjectType associated with this class.

getConfigurationObjectTypeOfParent

public ConfigurationObjectType getConfigurationObjectTypeOfParent()
Returns the ConfigurationObjectType associated with the logical parent of this AdministeredObject type.

Specified by:
getConfigurationObjectTypeOfParent in class AdministeredObject
Returns:
ConfigurationObjectType associated with the logical parent of this class.

getAccessControlEntries

public AccessControlEntry[] getAccessControlEntries()
Creates and returns a set of AccessControlEntry objects that describes the set of (principal,permission) tuples that have been applied specifically to this object.

This method does not return details of permissions that have been implicitly granted by inherited access control entries.

Returns:
AccessControlEntry[] array of AccessControlEntry objects that apply to this object.
Throws:
ConfigManagerProxyPropertyNotInitializedException - if this objects list of Access Control Entries was not supplied by the Configuration Manager before a timeout occurred.

setAccessControlEntries

public void setAccessControlEntries(AccessControlEntry[] accessControlList)
                             throws ConfigManagerProxyLoggedException
Sets the complete list of access control entries that apply to this object. Null elements in the array are ignored. If the array itself is null or empty, all access control entries for this object are removed.

This method submits only changed access control entries to the Configuration Manager. It converts the supplied array into a set of access control entries to add and a set of access control entries to remove, based on the information currently supplied from the Configuration Manager. The add and remove operations are processed separately by the Configuration Manager as two atomic, transactional requests.

If the Configuration Manager to which the Configuration Manager Proxy is connected is of a version less than v6, this method will have no effect.

Parameters:
accessControlList - Array of access control entries which are to apply to this object.
Throws:
ConfigManagerProxyLoggedException - if the request to update the object could not be sent to the Configuration Manager.
ConfigManagerProxyPropertyNotInitializedException - if this objects current list of Access Control Entries was not supplied by the Configuration Manager before a timeout occurred.

addAccessControlEntries

public void addAccessControlEntries(AccessControlEntry[] accessControlList)
                             throws ConfigManagerProxyLoggedException
Adds this list to the list of access control entries that applies to this object. Null elements in the array are ignored.

This operation is completely transactional. If the Configuration Manager successfully processes this request, all access control entries from the supplied array will be associated with this administered object. If not, the access control list for this object will have not been modified.

If the Configuration Manager to which the Configuration Manager Proxy is connected is of a version less than v6, this method will have no effect.

Parameters:
accessControlList - Array of access control entries which are to be added to this object.
Throws:
ConfigManagerProxyLoggedException
ConfigManagerProxyLoggedException - if the request to update the object could not be sent to the Configuration Manager.

removeAccessControlEntries

public void removeAccessControlEntries(AccessControlEntry[] accessControlList)
                                throws ConfigManagerProxyLoggedException
Deletes this list from the list of access control entries that applies to this object. Null elements in the array are ignored. In addition, if any elements of the array are not associated with the administered object, they will be ignored.

This operation is completely transactional. If the Configuration Manager successfully processes this request, no access control entries from the supplied array will be associated with this administered object. If not, the access control list for this object will have not been modified.

If the Configuration Manager to which the Configuration Manager Proxy is connected is of a version less than v6, this method will have no effect.

Parameters:
accessControlList - Array of access control entries which are to be removed from this object.
Throws:
ConfigManagerProxyLoggedException - if the request to update the object could not be sent to the Configuration Manager.