Class Hierarchy All Classes All Fields and Methods

Class com.ibm.broker.config.proxy.TopicProxy

java.lang.Object
        com.ibm.broker.config.proxy.AdministeredObject
                com.ibm.broker.config.proxy.TopicProxy

public class TopicProxy
extends AdministeredObject

Represents a node in the topic hierarchy.

In order to use TopicProxy 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);
     TopicRootProxy t1 = cmp.getTopicRoot();
     TopicProxy t2 = t1.getChildTopicByName("shares");
     TopicProxy t3 = t2.getChildTopicByName("tech");
     TopicProxy t4 = t3.getChildTopicByName("ibm");
 

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

Responsibilities Represents a node in the topic tree. Is also a container of sub-topics. Sub-topics are also represented as TopicProxy objects, and the result is a Topic hierarchy.
Internal Collaborators None


 Change Activity:
 -------- ----------- ------------- ------------------------------------
 Reason:  Date:       Originator:   Comments:
 -------- ----------- ------------- ------------------------------------
 f25103.1 2004-03-18  HDMPL         v6 Release
 

Inner Class Index
Class Description
TopicProxy.Policy A small class that represents a policy for a given topic.
TopicProxy.QoP A small structure that represents all the possible types of a topic's quality of protection.
Method Index
Method Description
void addDefaultPolicy(TopicProxy.Policy) Adds the default Topic Policy.
void addPolicies(TopicProxy.Policy[]) Adds an array of policies to this topic's list of policies and sends the results to the Configuration Manager.
TopicProxy createChildTopic(String) Creates a topic of the supplied name so that it sits under the current topic.
void deleteChildTopic(String) Removes the topic with the supplied name (and its children) from the current topic.
TopicProxy getChildTopic(Properties) Returns the first TopicProxy object directly (that is, one level) underneath the current one that matches the supplied filter.
TopicProxy getChildTopicByName(String) Returns the TopicProxy object with the supplied name, or null if a topic of that name does not exist or if the supplied argument was null.
Enumeration getChildTopics(Properties) Returns an enumeration of all TopicProxy objects directly (that is, one level) underneath the current one that match the supplied filter.
ConfigurationObjectType getConfigurationObjectType() Returns the ConfigurationObjectType associated with this AdministeredObject type.
ConfigurationObjectType getConfigurationObjectTypeOfParent() Returns the ConfigurationObjectType associated with the logical parent of this AdministeredObject type.
TopicProxy.Policy getDefaultPolicy() Returns the default Topic Policy.
String getMulticastEnabled() Returns the multicast 'enabled' string associated with this topic.
boolean getMulticastEncrypted() Returns the multicast 'encrypted' flag associated with this topic.
String getMulticastIPv4GroupAddress() Returns the IPv4 multicast group address associated with this topic.
String getMulticastIPv6GroupAddress() This method is reserved for future use.
boolean getMulticastQualityOfService() Returns the multicast 'qualityOfService' flag associated with this topic.
int getNumberOfPolicies() Returns the number of TopicProxy.Policy objects in the topic's list, excluding any default policy.
Enumeration getPolicies() Returns a Enumeration of all the TopicProxy.Policy objects in the topic's list.
TopicProxy.QoP getQualityOfProtectionLevel() Returns the Quality of Protection level associated with this topic.
String getTopicName() Returns the name of the topic
void moveTopic(String, TopicProxy) Atomically removes the topic tree with the supplied name from the current TopicProxy and adds it to the supplied instance.
void removeDefaultPolicy() Removes the default Topic Policy.
void removePolicies(TopicProxy.Policy[]) Removes a list of policies from this topic's list of policies and sends the results to the Configuration Manager.
void setDefaultPolicy(TopicProxy.Policy) Sets the default Topic Policy.
void setMulticastEnabled(String) Sets the multicast 'enabled' value for the topic.
void setMulticastEncrypted(boolean) Sets the multicast 'encrypted' flag for the topic.
void setMulticastGroupAddress(String, String) Sets the multicast group addresses for the topic.
void setMulticastQualityOfService(boolean) Sets the multicast QoS flag for the topic.
void setQualityOfProtectionLevel(TopicProxy.QoP) Sets the Quality of Protection level for the topic.
Properties withName(String) 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 Topic class.
Properties withUUID(String) 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 Topic class.

Methods

addDefaultPolicy

public void addDefaultPolicy(TopicProxy.Policy defaultPolicy) throws ConfigManagerProxyLoggedException

Adds the default Topic Policy.

addPolicies

public void addPolicies(TopicProxy.Policy[] list) throws ConfigManagerProxyLoggedException

Adds an array of policies to this topic's list of policies and sends the results to the Configuration Manager.

createChildTopic

public TopicProxy createChildTopic(String name) throws ConfigManagerProxyLoggedException

Creates a topic of the supplied name so that it sits under the current topic. The access permissions of the child are (by default) set to those of the parent.

If a topic already exists with the supplied name, the existing topic is returned.

deleteChildTopic

public void deleteChildTopic(String name) throws ConfigManagerProxyLoggedException, ConfigManagerProxyPropertyNotInitializedException

Removes the topic with the supplied name (and its children) from the current topic. If more than one topic with the supplied name exists, all instances are removed.

getChildTopic

public TopicProxy getChildTopic(Properties props) throws ConfigManagerProxyPropertyNotInitializedException

Returns the first TopicProxy object directly (that is, one level) underneath the current one that matches the supplied filter.

getChildTopicByName

public TopicProxy getChildTopicByName(String topicName) throws ConfigManagerProxyPropertyNotInitializedException

Returns the TopicProxy object with the supplied name, or null if a topic of that name does not exist or if the supplied argument was null.

getChildTopics

public Enumeration getChildTopics(Properties props) throws ConfigManagerProxyPropertyNotInitializedException

Returns an enumeration of all TopicProxy objects directly (that is, one level) underneath the current one that match the supplied filter. So calling this method on the "shares" topic with no filter inside the following hierarchy...

 shares = { tech, retail, oil }
 tech = { billco, ibm }
 retail = { ... }
 
...would return an Enumeration of three TopicProxy objects representing tech, retail and oil.

getConfigurationObjectType

public ConfigurationObjectType getConfigurationObjectType() 

Returns the ConfigurationObjectType associated with this AdministeredObject type.

getConfigurationObjectTypeOfParent

public ConfigurationObjectType getConfigurationObjectTypeOfParent() 

Returns the ConfigurationObjectType associated with the logical parent of this AdministeredObject type.

getDefaultPolicy

public TopicProxy.Policy getDefaultPolicy() throws ConfigManagerProxyPropertyNotInitializedException

Returns the default Topic Policy.

getMulticastEnabled

public String getMulticastEnabled() throws ConfigManagerProxyPropertyNotInitializedException

Returns the multicast 'enabled' string associated with this topic. The returned value is one of (AttributeConstants.) TOPIC_MULTICASTENABLE_DISABLE, TOPIC_MULTICASTENABLE_ENABLE and TOPIC_MULTICASTENABLE_INHERIT.

getMulticastEncrypted

public boolean getMulticastEncrypted() throws ConfigManagerProxyPropertyNotInitializedException

Returns the multicast 'encrypted' flag associated with this topic.

getMulticastIPv4GroupAddress

public String getMulticastIPv4GroupAddress() throws ConfigManagerProxyPropertyNotInitializedException

Returns the IPv4 multicast group address associated with this topic.

getMulticastIPv6GroupAddress

public String getMulticastIPv6GroupAddress() throws ConfigManagerProxyPropertyNotInitializedException

This method is reserved for future use.

getMulticastQualityOfService

public boolean getMulticastQualityOfService() throws ConfigManagerProxyPropertyNotInitializedException

Returns the multicast 'qualityOfService' flag associated with this topic.

getNumberOfPolicies

public int getNumberOfPolicies() throws ConfigManagerProxyPropertyNotInitializedException

Returns the number of TopicProxy.Policy objects in the topic's list, excluding any default policy. The returned value will be the number of elements in the enumeration supplied by getPolicies() (assuming the set of policies does not change).

getPolicies

public Enumeration getPolicies() throws ConfigManagerProxyPropertyNotInitializedException

Returns a Enumeration of all the TopicProxy.Policy objects in the topic's list.

getQualityOfProtectionLevel

public TopicProxy.QoP getQualityOfProtectionLevel() throws ConfigManagerProxyPropertyNotInitializedException

Returns the Quality of Protection level associated with this topic.

getTopicName

public String getTopicName() throws ConfigManagerProxyPropertyNotInitializedException

Returns the name of the topic

moveTopic

public void moveTopic(String name,
                      TopicProxy newProxy) throws ConfigManagerProxyLoggedException, ConfigManagerProxyPropertyNotInitializedException

Atomically removes the topic tree with the supplied name from the current TopicProxy 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.

Simple checks are made to ensure that the source topic doesn't equal the target topic, and that the child name is not the target. However it is still possible to end up with circular references if you try to copy a topic tree into one of its children. Such a call may succeed and you might find that some topics can no longer be referenced. Hence, care should be taken by the caller to ensure that this does not happen.

removeDefaultPolicy

public void removeDefaultPolicy() throws ConfigManagerProxyLoggedException

Removes the default Topic Policy.

removePolicies

public void removePolicies(TopicProxy.Policy[] list) throws ConfigManagerProxyLoggedException, ConfigManagerProxyPropertyNotInitializedException

Removes a list of policies from this topic's list of policies and sends the results to the Configuration Manager.

setDefaultPolicy

public void setDefaultPolicy(TopicProxy.Policy defaultPolicy) throws ConfigManagerProxyLoggedException

Sets the default Topic Policy. Validates that Publish, Subscribe and Persistence attributes of the defaultPolicy are not set to INHERIT.

setMulticastEnabled

public void setMulticastEnabled(String isEnabled) throws ConfigManagerProxyLoggedException

Sets the multicast 'enabled' value for the topic. Valid values are (AttributeConstants.) TRUE, FALSE and TOPIC_MULTICAST_ENABLE_INHERIT.

setMulticastEncrypted

public void setMulticastEncrypted(boolean isEncrypted) throws ConfigManagerProxyLoggedException

Sets the multicast 'encrypted' flag for the topic.

setMulticastGroupAddress

public void setMulticastGroupAddress(String ipv4GroupAddress,
                                     String ipv6GroupAddress) throws ConfigManagerProxyLoggedException

Sets the multicast group addresses for the topic.

setMulticastQualityOfService

public void setMulticastQualityOfService(boolean isReliable) throws ConfigManagerProxyLoggedException

Sets the multicast QoS flag for the topic.

setQualityOfProtectionLevel

public void setQualityOfProtectionLevel(TopicProxy.QoP newQoP) throws ConfigManagerProxyLoggedException

Sets the Quality of Protection level for the topic.

withName

public static Properties withName(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 Topic class. This provides an easy way of supplying filters to the get*() calls. For example, t.getChildTopics(TopicProxy.withName("tech")); will return the Topic with Name "tech" that exists in t.

withUUID

public static Properties withUUID(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 Topic class. This provides an easy way of supplying filters to the get*() calls. For example, t.getChildTopics(TopicProxy.withUUID("1234")); will return the Topic with UUID "1234" that exists in t.

Class Hierarchy All Classes All Fields and Methods