com.ibm.broker.config.proxy
Class CollectiveProxy

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

public class CollectiveProxy
extends AdministeredObject

Represents a totally connected set of pub/sub brokers.

In order to use CollectiveProxy 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);
     TopologyProxy t = cmp.getTopology();
     CollectiveProxy b = t.getCollectiveByName("COL1");
 

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

Responsibilities Represents a list of Brokers that are totally connected.
Internal Collaborators None

 Change Activity:
 -------- ----------- -------------   ------------------------------------
 Reason:  Date:       Originator:     Comments:
 -------- ----------- -------------   ------------------------------------
 25103.1  2004-03-19  HDMPL           v6 Release
 44739.7  2007-07-30  HDMPL           v6.1 release:
                                         Methods now return genericized types where relevant

 

Version:
Config/com/ibm/broker/config/proxy/CollectiveProxy.java, CMP, S000 1.39

Method Summary
 void addBrokers(java.lang.String[] list)
          Adds an array of broker UUIDs to this collective's list of members and sends the results to the Configuration Manager.
 boolean containsBroker(java.lang.String targetUUID)
          Returns true if and only if the broker with the supplied UUID is a member of the collective.
 java.util.Enumeration<java.lang.String> getBrokerUUIDs()
          Returns a Enumeration of all the brokers in the collective's list.
 ConfigurationObjectType getConfigurationObjectType()
          Returns the ConfigurationObjectType associated with this AdministeredObject type.
 ConfigurationObjectType getConfigurationObjectTypeOfParent()
          Returns the ConfigurationObjectType associated with the logical parent of this AdministeredObject type.
 void moveBroker(java.lang.String name, CollectiveProxy newProxy)
          Atomically removes the broker with the supplied name from the current collective and adds it to the supplied instance.
 void removeBrokers(java.lang.String[] list)
          Removes a list of broker UUIDs from this collective's list of members and sends the results to the Configuration Manager.
static java.util.Properties withName(java.lang.String name)
          Returns a new Properties object that has the name attribute set to the supplied String, and the type attribute to be the name of the subclass of AdministeredObject being used.
static java.util.Properties withUUID(java.lang.String uuid)
          Returns a new Properties object that has the UUID attribute set to the supplied String, and the type attribute to be the name of the subclass of AdministeredObject being used.
 
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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getBrokerUUIDs

public java.util.Enumeration<java.lang.String> getBrokerUUIDs()
                                                       throws ConfigManagerProxyPropertyNotInitializedException
Returns a Enumeration of all the brokers in the collective's list.

Returns:
Enumeration of broker UUID Strings.
Throws:
ConfigManagerProxyPropertyNotInitializedException - if the requested property is not yet known.

containsBroker

public boolean containsBroker(java.lang.String targetUUID)
                       throws ConfigManagerProxyPropertyNotInitializedException
Returns true if and only if the broker with the supplied UUID is a member of the collective.

Parameters:
targetUUID - String containing the UUID of the broker whose membership status of this collective is sought.
Throws:
ConfigManagerProxyPropertyNotInitializedException - if the requested property is not yet known.

addBrokers

public void addBrokers(java.lang.String[] list)
                throws ConfigManagerProxyLoggedException
Adds an array of broker UUIDs to this collective's list of members and sends the results to the Configuration Manager.

Parameters:
list - List of broker UUIDs to add to the CollectiveProxy.
Throws:
ConfigManagerProxyLoggedException - if the new list of members could not be sent to the Configuration Manager.

removeBrokers

public void removeBrokers(java.lang.String[] list)
                   throws ConfigManagerProxyLoggedException

Removes a list of broker UUIDs from this collective's list of members and sends the results to the Configuration Manager.

Parameters:
list - List of brokers to remove from the CollectiveProxy.
Throws:
ConfigManagerProxyLoggedException - if the new list of members could not be sent to the Configuration Manager.

moveBroker

public void moveBroker(java.lang.String name,
                       CollectiveProxy newProxy)
                throws ConfigManagerProxyLoggedException,
                       ConfigManagerProxyPropertyNotInitializedException

Atomically removes the broker with the supplied name from the current collective and adds it to the supplied instance. Requires that a "batch" of operations (controlled using ConfigManagerProxy. beginUpdates(), clearUpdates() and sendUpdates() is NOT already in progress.

Parameters:
name - The name of the broker to remove from this Collective
newProxy - The collective to which the broker should be added.
Throws:
ConfigManagerProxyPropertyNotInitializedException - if the topic corresponding to the supplied name could not be loaded because information on the parent topic (i.e. this) has not yet been supplied.
ConfigManagerProxyLoggedException - - if the broker with the supplied name does not exist as a child of the current collective, if a batch of requests was already in progress, or if the target is the same as the current collective.

withUUID

public static java.util.Properties withUUID(java.lang.String uuid)
Returns a new Properties object that has the UUID attribute set to the supplied String, and the type attribute to be the name of the subclass of AdministeredObject being used. This provides an easy way of supplying filters to the ManagedSubcomponent calls. For example, broker1.getExecutionGroup(ExecutionGroup.withUUID("1234")); will return the Execution Group with UUID "1234" that exists in broker1.

Parameters:
uuid - The UUID to be added to the returned Properties object.
Returns:
java.util.Properties - a new Properties object with the relevant key/value pairs set.

withName

public static java.util.Properties withName(java.lang.String name)
Returns a new Properties object that has the name attribute set to the supplied String, and the type attribute to be the name of the subclass of AdministeredObject being used. This provides an easy way of supplying filters to the get calls. For example, broker1.getExecutionGroup(ExecutionGroup.withName("eg1")); will return the Execution Group with Name "eg1" that exists in broker1.

Parameters:
name - The name to be added to the returned Properties object.
Returns:
java.util.Properties - a new Properties object with the relevant key/value pairs set.

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.