Class Hierarchy All Classes All Fields and Methods

Class com.ibm.broker.config.proxy.ConfigManagerProxy

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

public class ConfigManagerProxy
extends AdministeredObject

This class allows applications to connect to and manipulate Configuration Managers. All domain objects are accessible through this one.

In order to use ConfigManagerProxy 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);
 

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

Responsibilities
  • Represents a container for all managed objects within a Configuration Manager's domain.
  • Each instance also represents a connection to a Configuration Manager.
  • Provides shortcuts to individual object types managed by the API, and to global Configuration Manager operations (e.g. system trace)
Internal Collaborators com.ibm.broker.config.proxy.TopologyProxy
com.ibm.broker.config.proxy.LogProxy
com.ibm.broker.config.proxy.TopicRootProxy
com.ibm.broker.config.proxy.ConfigManagerConnectionParameters
com.ibm.broker.config.proxy.SubscriptionsProxy


 Change Activity:
 -------- ----------- -------------   ------------------------------------
 Reason:  Date:       Originator:     Comments:
 -------- ----------- -------------   ------------------------------------
 f19590.1 2004-03-19  HDMPL           v6 Release

 

Field Index
Field Description
MAX_WAIT_TIME The maximum amount of time the Configuration Manager Proxy can be told to wait for Configuration Manager messages until a ConfigManagerProxyPropertyNotInitialisedException is thrown.
Method Index
Method Description
void beginUpdates() Tells the ConfigManagerProxy to hold back from sending any subsequent state-changing requests to the Configuration Manager, so multiple requests can be later sent off in a single message (or "batch").
void cancelDeployment() Tells the Configuration Manager to cancel ALL deployment actions in the domain that are currently in progress.
void clearUpdates() Tells the ConfigManagerProxy to discard any state-changing requests received since the last call to beginUpdates().
void deregisterListeners() Deregisters ALL external listeners associated with the current ConfigManagerProxy connection.
void disableConfigManagerProxyTracing() Stops Configuration Manager Proxy service tracing.
void disconnect() Deregisters all listeners registered to this ConfigManagerProxy instance and closes the link to the Config Manager.
void enableConfigManagerProxyTracing(String) Enables Configuration Manager Proxy service tracing, sending output to the file with the supplied name.
String getConfigManagerFullVersion() Returns the full version string of the Configuration Manager to which this Configuration Manager Proxy instance is connected.
String getConfigManagerOSArch() Returns a string describing the architecture of the Configuration Manager machine to which this Configuration Manager Proxy is connected.
String getConfigManagerOSName() Returns a string describing the name of the operating system running on the Configuration Manager machine to which this Configuration Manager Proxy is connected.
String getConfigManagerOSVersion() Returns a string describing the version of the operation system on the Configuration Manager machine to which this Configuration Manager Proxy is connected.
int getConfigManagerProxyVersion() Returns the version string for the Configuration Manager Proxy.
int getConfigManagerVersion() Returns the major version identifier of the Configuration Manager to which the Configuration Manager Proxy is connected.
ConfigurationObjectType getConfigurationObjectType() Returns the ConfigurationObjectType associated with this AdministeredObject type.
ConfigurationObjectType getConfigurationObjectTypeOfParent() Returns the ConfigurationObjectType associated with the logical parent of this AdministeredObject type.
ConfigManagerProxy getInstance(ConfigManagerConnectionParameters) Asks the Configuration Manager Proxy to connect to a Configuration Manager with the supplied parameters.
LogProxy getLog() Asks the Configuration Manager to register for all log records associated with the current user, through a LogProxy instance.
SubscriptionsProxy getSubscriptions(String, String, String, String, GregorianCalendar, GregorianCalendar) Generates a SubscriptionsProxy that represents those subscriptions fulfilling the supplied criteria.
TopicRootProxy getTopicRoot() Returns the RootTopicProxy object associated with this Configuration Manager.
TopologyProxy getTopology() Returns the TopologyProxy object associated with this Configuration Manager.
boolean isBatching() Returns true if and only if the creation of a batch is currently in progress.
boolean isIncompatible() Returns true if and only if the Configuration Manager Proxy has received a message from the Configuration Manager which indicates that the Configuration Manager is unable to process requests from this Configuration Manager Proxy because the versions are not compatible.
boolean isIncompatible(boolean) Returns true if and only if the Configuration Manager Proxy has received a message from the Configuration Manager which indicates that the Configuration Manager is unable to process requests from this Configuration Manager Proxy because the versions are not compatible.
void sendUpdates() Tells the ConfigManagerProxy to send to the Configuration Manager all requests received since the beginUpdates() call.
void sendUpdates(int) Tells the ConfigManagerProxy to send to the Configuration Manager all requests received since the beginUpdates() call.
void setLogger(String) If directed to gather Configuration Manager Proxy trace for IBM service, do not use this method - use enableTracing(String) and disableTracing() instead.
void setLogger(String, String) Initializes a Configuration Manager Proxy logger.
void setRetryCharacteristics(int, int, int) Sets the retry characteristics for the Configuration Manager Proxy.
void setRetryCharacteristics(long) Sets the retry characteristics for the Configuration Manager Proxy.
void startDebugSystemTrace() Asks the Configuration Manager to start debug system trace.
void startSystemTrace() Asks the Configuration Manager to start system trace.
void stopSystemTrace() Asks the Configuration Manager to stop system trace.
String toString() Displays the name of the object
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 subclass of AdministeredObject being used.

Fields

MAX_WAIT_TIME

public static final long MAX_WAIT_TIME

The maximum amount of time the Configuration Manager Proxy can be told to wait for Configuration Manager messages until a ConfigManagerProxyPropertyNotInitialisedException is thrown. The actual value used can be set using ConfigManagerProxy.setRetryCharacteristics(long).

Methods

beginUpdates

public void beginUpdates() throws ConfigManagerProxyLoggedException

Tells the ConfigManagerProxy to hold back from sending any subsequent state-changing requests to the Configuration Manager, so multiple requests can be later sent off in a single message (or "batch"). Requests for information (for instance, requests to discover an object's attributes) will not be batched. The scope of this method is for any requests using this ConfigManagerProxy connection to the Configuration Manager.

cancelDeployment

public void cancelDeployment() throws ConfigManagerProxyLoggedException

Tells the Configuration Manager to cancel ALL deployment actions in the domain that are currently in progress. As a domain-wide action, this method should only be called in extreme circumstances.

clearUpdates

public void clearUpdates() 

Tells the ConfigManagerProxy to discard any state-changing requests received since the last call to beginUpdates(). If a batch was not in progress, or if the current batch has already been submitted using sendUpdates(), this call does nothing.

deregisterListeners

public void deregisterListeners() 

Deregisters ALL external listeners associated with the current ConfigManagerProxy connection.

Note: The same effect can be achieved by using ConfigManagerProxy.disconnect(). The difference is that this call doesn't close the link to the Configuration Manager- it is possible to use call this method and still make use of the APIs and the listener registration mechanism.

disableConfigManagerProxyTracing

public static void disableConfigManagerProxyTracing() 

Stops Configuration Manager Proxy service tracing.

Not to be confused with stopSystemTrace(), which enables tracing of the Configuration Manager.

disconnect

public void disconnect() 

Deregisters all listeners registered to this ConfigManagerProxy instance and closes the link to the Config Manager. This makes client APIs unusable. After calling this method, the only way to re-establish the link to the Config Manager is by reissuing the ConfigManagerProxy.getInstance() call.

enableConfigManagerProxyTracing

public static void enableConfigManagerProxyTracing(String filename) throws ConfigManagerProxyLoggedException

Enables Configuration Manager Proxy service tracing, sending output to the file with the supplied name. Enabling service trace will cause the Configuration Manager Proxy to work more slowly than usual.

Not to be confused with startSystemTrace() and startDebugSystemTrace(), which enables tracing of the Configuration Manager.

getConfigManagerFullVersion

public String getConfigManagerFullVersion() throws ConfigManagerProxyPropertyNotInitializedException

Returns the full version string of the Configuration Manager to which this Configuration Manager Proxy instance is connected. The format of the string is not guaranteed.

If the Configuration Manager Proxy is connected to a Configuration Manager of less than v6 level, this method returns null.

getConfigManagerOSArch

public String getConfigManagerOSArch() throws ConfigManagerProxyPropertyNotInitializedException

Returns a string describing the architecture of the Configuration Manager machine to which this Configuration Manager Proxy is connected. The returned value is the value of the 'os.arch' system property in the Configuration Manager.

If the Configuration Manager Proxy is connected to a Configuration Manager of less than v6 level, this method returns null.

getConfigManagerOSName

public String getConfigManagerOSName() throws ConfigManagerProxyPropertyNotInitializedException

Returns a string describing the name of the operating system running on the Configuration Manager machine to which this Configuration Manager Proxy is connected. The returned value is the value of the 'os.name' system property in the Configuration Manager.

If the Configuration Manager Proxy is connected to a Configuration Manager of less than v6 level, this method returns null.

getConfigManagerOSVersion

public String getConfigManagerOSVersion() throws ConfigManagerProxyPropertyNotInitializedException

Returns a string describing the version of the operation system on the Configuration Manager machine to which this Configuration Manager Proxy is connected. The returned value is the value of the 'os.version' system property in the Configuration Manager.

If the Configuration Manager Proxy is connected to a Configuration Manager of less than v6 level, this method returns null.

getConfigManagerProxyVersion

public static int getConfigManagerProxyVersion() 

Returns the version string for the Configuration Manager Proxy.

getConfigManagerVersion

public int getConfigManagerVersion() throws ConfigManagerProxyPropertyNotInitializedException

Returns the major version identifier of the Configuration Manager to which the Configuration Manager Proxy is connected. The returned value will be one of the following:

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. As the ConfigManagerProxy is the root of the hierarchy, this method returns null.

getInstance

public static ConfigManagerProxy getInstance(ConfigManagerConnectionParameters cmcp) throws ConfigManagerProxyLoggedException

Asks the Configuration Manager Proxy to connect to a Configuration Manager with the supplied parameters. The sole parameter to this method is a ConfigManagerConnectionParameters object, of which there are two implementors currently:

getLog

public LogProxy getLog() throws ConfigManagerProxyPropertyNotInitializedException

Asks the Configuration Manager to register for all log records associated with the current user, through a LogProxy instance.

getSubscriptions

public SubscriptionsProxy getSubscriptions(String topic,
                                           String brokers,
                                           String users,
                                           String subscriptionsPoints,
                                           GregorianCalendar startDate,
                                           GregorianCalendar endDate) throws ConfigManagerProxyLoggedException

Generates a SubscriptionsProxy that represents those subscriptions fulfilling the supplied criteria.

getTopicRoot

public TopicRootProxy getTopicRoot() throws ConfigManagerProxyPropertyNotInitializedException

Returns the RootTopicProxy object associated with this Configuration Manager.

getTopology

public TopologyProxy getTopology() throws ConfigManagerProxyPropertyNotInitializedException

Returns the TopologyProxy object associated with this Configuration Manager.

isBatching

public boolean isBatching() 

Returns true if and only if the creation of a batch is currently in progress.

isIncompatible

public boolean isIncompatible() 

Returns true if and only if the Configuration Manager Proxy has received a message from the Configuration Manager which indicates that the Configuration Manager is unable to process requests from this Configuration Manager Proxy because the versions are not compatible. If the ConfigManagerProxy object has not yet received any update from the Configuration Manager, the call will block until the first response (e.g. 'Proxy is incompatible' message) is received (or the timeout configured in ConfigManagerProxy.setRetryCharacteristics() occurs).

Note that the timeout condition will result in the response of false being returned, correctly indicating that no 'object-restricted' response has been received. Callers wishing to programmatically detect the timeout condition should use hasBeenUpdatedByConfigManager(true).

isIncompatible

public boolean isIncompatible(boolean waitIfNotUpdated) 

Returns true if and only if the Configuration Manager Proxy has received a message from the Configuration Manager which indicates that the Configuration Manager is unable to process requests from this Configuration Manager Proxy because the versions are not compatible.

sendUpdates

public void sendUpdates() throws ConfigManagerProxyLoggedException

Tells the ConfigManagerProxy to send to the Configuration Manager all requests received since the beginUpdates() call. After this method completes, subsequent requests will not be batched unless another beginUpdates() is called.

sendUpdates

public void sendUpdates(int correlationID) throws ConfigManagerProxyLoggedException

Tells the ConfigManagerProxy to send to the Configuration Manager all requests received since the beginUpdates() call. After this method completes, subsequent requests will not be batched unless another beginUpdates() is called.

setLogger

public static void setLogger(String className) throws ConfigManagerProxyLoggedException

If directed to gather Configuration Manager Proxy trace for IBM service, do not use this method - use enableTracing(String) and disableTracing() instead. Use startDebugSystemTrace(), startSystemTrace() and stopSystemTrace() to control Configuration Manager tracing. Use MessageFlowProxy.setUserTrace() to control tracing of message flows.

This method sets up an logger that does not require parameters.

setLogger

public static void setLogger(String className,
                             String params) throws ConfigManagerProxyLoggedException

Initializes a Configuration Manager Proxy logger. If directed to gather Configuration Manager Proxy trace for IBM service, do not use this method - use enableConfigManagerProxyTracing(String) and disableConfigManagerProxyTracing() instead. Use startDebugSystemTrace(), startSystemTrace() and stopSystemTrace() to control Configuration Manager tracing. Use MessageFlowProxy.setUserTrace() to control tracing of message flows.

setRetryCharacteristics

public static void setRetryCharacteristics(int maxRetries,
                                           int baseRetryWaitTime,
                                           int retryWaitTimeIncrement) 

Sets the retry characteristics for the Configuration Manager Proxy. These settings are used for all ConfigManagerProxy connections in the JVM.

The Configuration Manager Proxy may not always have been supplied a required piece of information that is needed to perform an operation (e.g. it can't return a broker's execution group list if that broker's information has not been supplied to it by the Configuration Manager). This can happen if the proxy has a slow link to the Configuration Manager, or if the Configuration Manager is heavily burdened or just not running.

Collectively, the parameters supplied to this method represent the maximum amount of time to wait for the required information to arrive before the exception is thrown. Specifically, three parameters are required which describe how many times the Configuration Manager Proxy should poll incoming messages from the Configuration Manager to see if the required information has arrived. The three parameters are: the number of times to retry, the initial amount of time to wait between failure (in milliseconds) and the amount of time to increase the wait time by on successive failure (again in milliseconds).

So supplying (10,1000,1000) to this method (which happens to be the default) means that retries will occur one, two, four, seven, eleven seconds after the first failure (and so on). If the required information still cannot be found after the number of maxRetries is exhausted, a ConfigManagerProxyPropertyNotInitializedException will be thrown to the calling application.

setRetryCharacteristics

public static void setRetryCharacteristics(long maxWaitTimeMs) 

Sets the retry characteristics for the Configuration Manager Proxy. These settings are used for all ConfigManagerProxy connections in the JVM.

The Configuration Manager Proxy may not always have been supplied a required piece of information that is needed to perform an operation (e.g. it can't return a broker's execution group list if that broker's information has not been supplied to it by the Configuration Manager). This can happen if the proxy has a slow link to the Configuration Manager, or if the Configuration Manager is heavily burdened or just not running.

startDebugSystemTrace

public void startDebugSystemTrace() throws ConfigManagerProxyLoggedException

Asks the Configuration Manager to start debug system trace.

startSystemTrace

public void startSystemTrace() throws ConfigManagerProxyLoggedException

Asks the Configuration Manager to start system trace. Not to be confused with enableTracing(), which enables tracing of the Configuration Manager Proxy application.

stopSystemTrace

public void stopSystemTrace() throws ConfigManagerProxyLoggedException

Asks the Configuration Manager to stop system trace. Not to be confused with disableTracing(), which enables tracing of the Configuration Manager Proxy application.

toString

public String toString() 

Displays the name of the object

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 subclass of AdministeredObject being used. This provides an easy way of supplying filters to the get*() methods. For example, broker1.getExecutionGroup(ExecutionGroup.withUUID("1234")); will return the Execution Group with UUID "1234" that exists in broker1.

Class Hierarchy All Classes All Fields and Methods