com.ibm.broker.config.proxy

Class ConfigManagerProxy


  • Deprecated. 
    It is recommended to use the BrokerProxy class to interact with brokers. Use the V6.x Configuration Manager Proxy classes to interact with Configuration Managers.

    public class ConfigManagerProxy
    extends AdministeredObject

    This class has been deprecated. As of WebSphere Message Broker V7, Configuration Managers are no longer used and applications should use the BrokerProxy class to connect directly with brokers.

    For example:

         BrokerProxy b = BrokerProxy.getInstance(
             new IntegrationNodeConnectionParameters("localhost", 4414)); 
     

    This class allows applications to connect to and manipulate brokers in a manner that is compatible with the Configuration Manager Proxy interface of previous versions. Existing applications that use the ConfigManagerProxy.getInstance() method are able to connect, view and manipulate V7 brokers if they supply the connection properties of the broker rather than the Configuration Manager. When the ConfigManagerProxy class is used to connect to a broker in this way, the V7 broker will populate and return a dummy ConfigManagerProxy instance. Then, calling the ConfigManagerProxy.getTopology() method on this instance will cause the broker to populate and return a dummy Publish/Subscribe topology that contains a single reference to the connected broker. The returned TopologyProxy object can then be used to access the properties of the actual broker to which the application is connected.

    Not all ConfigManagerProxy methods behave in an identical manner to the previous versions of the product. See the Javadoc for each method for more information.

    Particularly, note that when connected through the ConfigManagerProxy root object, by default any attempts to modify the broker's configuration will be made synchronously, which means that the IBM Integration API (CMP) application will pause for up to 60s while the configuration change is made. This is to emulate the single-threaded nature of the old Configuration Manager. This behavior is configurable using BrokerProxy.setSynchronous().

    
     Change Activity:
     -------- ----------- -------------   ------------------------------------
     Reason:  Date:       Originator:     Comments:
     -------- ----------- -------------   ------------------------------------
     f19590.1 2004-03-19  HDMPL           v6 release
     f44739.7 2007-07-30  HDMPL           v6.1 release:
                                             Methods now return genericized types where relevant
                                             Added setAutoDiscoveryIntervalMins(int)
                                             Added getAutoDiscoveryIntervalMins()
     f51619.1 2008-07-14  HDMPL           v7 release:
                                             Deprecated class
    
     
    • Field Detail

      • MAX_WAIT_TIME

        public static final long MAX_WAIT_TIME
        Deprecated. This constant is no longer used. It has been replaced by the constant BrokerProxy.MAX_WAIT_TIME.
        See Also:
        Constant Field Values
    • Method Detail

      • getInstance

        public static ConfigManagerProxy getInstance(ConfigManagerConnectionParameters cmcp)
                                              throws ConfigManagerProxyLoggedException
        Deprecated. Use BrokerProxy.getInstance(BrokerConnectionParameters) instead.
        Asks the IBM Integration API (CMP) to connect to a broker with the supplied parameters, in a manner that is compatible with previous versions of the product. The sole parameter to this method is a ConfigManagerConnectionParameters object, of which there are two implementors:
        • MQConfigManagerConnectionParameters, which requires an IP Address, port and queue manager name in order to be constructed, and
        • MQPropertyFileConfigManagerConnectionParameters, which uses the contents of a .configmgr file to provide the required connection parameters.
        This method is provided for compatibility with applications from previous versions. The object returned will contain dummy values that have been filled in by the connected broker. This object can be used, via the TopologyProxy class, to access the BrokerProxy to which the application is connected.
        Parameters:
        cmcp - An object describing the connection parameters to the broker. Cannot be null.
        Returns:
        ConfigManagerProxy a object that represents the connection to a broker.
        Throws:
        ConfigManagerProxyLoggedException - if a connection could not be established for whatever reason.
      • disconnect

        public void disconnect()
        Deprecated. 
        Deregisters all listeners registered to this ConfigManagerProxy instance and closes the link to the broker. This makes client APIs unusable. After calling this method, the only way to re-establish the link to the broker is by reissuing the ConfigManagerProxy.getInstance() call.
      • deregisterListeners

        public void deregisterListeners()
        Deprecated. 
        Deregisters ALL external listeners associated with the current 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 broker- it is possible to use call this method and still make use of the APIs and the listener registration mechanism.

      • getTopology

        public TopologyProxy getTopology()
                                  throws ConfigManagerProxyPropertyNotInitializedException
        Deprecated. The concept of a publish/subscribe topology has been removed. The return value from this method will be a dummy object that describes a topology containing a single BrokerProxy object (the broker to which the application is connected).
        Returns a TopologyProxy object containing a single broker reference.
        Returns:
        TopologyProxy
        Throws:
        ConfigManagerProxyPropertyNotInitializedException - if the dummy topology could not be created because the information was not supplied from the broker before a timeout occurred.
      • getConfigManagerProxyVersion

        public static int getConfigManagerProxyVersion()
        Deprecated. Use BrokerProxy.getAdministrationAPIVersion() instead
        Returns the major version string for the IBM Integration API (CMP). (the constant AttributeConstants.VERSION_7). If an application calls this method while running against a different version of the API, a different value might be returned.
        Returns:
        int
      • getTopicRoot

        public TopicRootProxy getTopicRoot()
                                    throws ConfigManagerProxyPropertyNotInitializedException
        Deprecated. The concept of a topic hierarchy has been removed. The return value from this method will be a dummy object that describes an empty topic tree.
        Returns the root of an empty topic tree.
        Returns:
        TopicRootProxy a reference to the root of a dummy topic tree.
        Throws:
        ConfigManagerProxyPropertyNotInitializedException - if the dummy topic tree could not be determined because the information was not supplied from the broker before a timeout occurred.
      • getSubscriptions

        public SubscriptionsProxy getSubscriptions(java.lang.String topic,
                                                   java.lang.String brokers,
                                                   java.lang.String users,
                                                   java.lang.String subscriptionsPoints,
                                                   java.util.GregorianCalendar startDate,
                                                   java.util.GregorianCalendar endDate)
                                            throws ConfigManagerProxyLoggedException
        Deprecated. Subscriptions are no longer managed by WebSphere Message Broker. The return value from this method will be an dummy SubscriptionsProxy object with zero elements.
        Returns a dummy SubscriptionsProxy object that contains zero elements.
        Parameters:
        topic - Not used
        brokers - Not used
        users - Not used
        subscriptionsPoints - Not used
        startDate - Not used
        endDate - Not used
        Returns:
        SubscriptionsProxy Empty object
        Throws:
        ConfigManagerProxyLoggedException - if the request could not be sent to the broker.
      • getConfigurationObjectTypeOfParent

        public ConfigurationObjectType getConfigurationObjectTypeOfParent()
        Deprecated. 
        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.
        Specified by:
        getConfigurationObjectTypeOfParent in class AdministeredObject
        Returns:
        ConfigurationObjectType associated with the logical parent of this class.
      • setRetryCharacteristics

        public static void setRetryCharacteristics(int maxRetries,
                                                   int baseRetryWaitTime,
                                                   int retryWaitTimeIncrement)
        Deprecated. Use BrokerProxy.setRetryCharacteristics(long) instead.
        Sets the retry characteristics for the IBM Integration API (CMP). These settings are used for all broker connections in the JVM.

        The IBM Integration API (CMP) might 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). This can happen if the proxy has a slow link to the broker, or if the broker 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 Administraton API should poll incoming messages from the broker 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.

        Parameters:
        maxRetries - the maximum number of consecutive failures before an exception is thrown to the calling application.
        baseRetryWaitTime - The initial time to wait between retries (in milliseconds)
        retryWaitTimeIncrement - How much to increase the retry wait time by after each consecutive failure.
      • setRetryCharacteristics

        public static void setRetryCharacteristics(long maxWaitTimeMs)
        Deprecated. Use BrokerProxy.setRetryCharacteristics(long) instead.
        Sets the retry characteristics for the IBM Integration API (CMP). These settings are used for all broker connections in the JVM.

        The IBM Integration API (CMP) might 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). This can happen if the proxy has a slow link to the broker, or if the broker is heavily burdened or just not running.

        Parameters:
        maxWaitTimeMs - the maximum length of time the IBM Integration API (CMP) can wait for a response from the broker before a ConfigManagerProxyPropertyNotInitalizedException is thrown. The maximum value allowed value is BrokerProxy.MAX_WAIT_TIME If the supplied value is greater than this, BrokerProxy.MAX_WAIT_TIME will be used instead.
      • enableConfigManagerProxyTracing

        public static void enableConfigManagerProxyTracing(java.lang.String filename)
                                                    throws ConfigManagerProxyLoggedException
        Deprecated. Use BrokerProxy.enableAdministrationAPITracing(String) instead.
        Enables IBM Integration API (CMP) service tracing, sending output to the file with the supplied name. Enabling service trace will cause the IBM Integration API (CMP) to work more slowly than usual.
        Parameters:
        filename - File spec of the output file, which cannot be null.
        Throws:
        ConfigManagerProxyLoggedException - if the logger could not be instantiated.
      • disableConfigManagerProxyTracing

        public static void disableConfigManagerProxyTracing()
        Deprecated. Use BrokerProxy.disableAdministrationAPITracing() instead.
        Stops IBM Integration API (CMP) service tracing.
      • setLogger

        public static void setLogger(java.lang.String className,
                                     java.lang.String params)
                              throws ConfigManagerProxyLoggedException
        Deprecated. Use BrokerProxy.enableAdministrationAPITracing(String) instead.
        Initializes an IBM Integration API (CMP) logger.
        Parameters:
        className - Fully qualified name of the logger class (must extend com.ibm.broker.config.proxy.Logger) A null or blank value here will disable logging.
        params - any parameters required by the logger
        Throws:
        ConfigManagerProxyLoggedException - if the logger could not be instantiated.
      • setLogger

        public static void setLogger(java.lang.String className)
                              throws ConfigManagerProxyLoggedException
        Deprecated. Use BrokerProxy.enableAdministrationAPITracing(String) instead.
        Initializes an IBM Integration API (CMP) logger. This method sets up an logger that does not require parameters.
        Parameters:
        className - Fully qualified name of the logger class (must extend com.ibm.broker.config.proxy.Logger). A null or blank value here will disable logging.
        Throws:
        ConfigManagerProxyLoggedException - if the logger could not be instantiated.
      • beginUpdates

        public void beginUpdates()
                          throws ConfigManagerProxyLoggedException
        Deprecated. 
        Tells the IBM Integration API (CMP) to hold back from sending any subsequent state-changing requests to the broker, 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 broker.
        Throws:
        ConfigManagerProxyLoggedException - if a batch is already in progress.
        See Also:
        sendUpdates(), clearUpdates(), isBatching()
      • sendUpdates

        public void sendUpdates()
                         throws ConfigManagerProxyLoggedException
        Deprecated. 
        Tells the IBM Integration API (CMP) to send to the broker all requests received since the beginUpdates() call. After this method completes, subsequent requests will not be batched unless another beginUpdates() is called.
        Throws:
        ConfigManagerProxyLoggedException - If a batch was not in progress, if the batch contained no requests, or if the request could not be sent to the broker.
        See Also:
        beginUpdates(), clearUpdates(), isBatching()
      • sendUpdates

        public void sendUpdates(int correlationID)
                         throws ConfigManagerProxyLoggedException
        Deprecated. 
        Tells the IBM Integration API (CMP) to send to the broker all requests received since the beginUpdates() call. After this method completes, subsequent requests will not be batched unless another beginUpdates() is called.
        Parameters:
        correlationID - Identifier that will accompany any actionresponse messages sent back to the caller through the AdministeredObjectListener interface.
        Throws:
        ConfigManagerProxyLoggedException - if a batch was not in progress, if the batch contained no requests or if the request could not be sent to the broker.
        See Also:
        beginUpdates(), sendUpdates(), clearUpdates(), isBatching()
      • clearUpdates

        public void clearUpdates()
        Deprecated. 
        Tells the IBM Integration API (CMP) 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.
        See Also:
        beginUpdates(), sendUpdates(), isBatching()
      • isBatching

        public boolean isBatching()
        Deprecated. 
        Returns true if and only if the creation of a batch is currently in progress.
        Returns:
        boolean status of batch mode
        See Also:
        beginUpdates(), sendUpdates(), clearUpdates()
      • isIncompatible

        public boolean isIncompatible()
        Deprecated. As of WebSphere Message Broker V7, the IBM Integration API (CMP) is unable to communicate with environments of V6.1 and earlier, so this method will always return false.
        Returns true if and only if the IBM Integration API (CMP) has received a message from the broker which indicates that the broker is unable to process requests from this version of the IBM Integration API (CMP) because the versions are not compatible. If the CMP has not yet received any update from the broker, the call will block until the first response 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).

        Returns:
        boolean true if and only if the broker is unable to successfully communicate with this API.
      • isIncompatible

        public boolean isIncompatible(boolean waitIfNotUpdated)
        Deprecated. As of WebSphere Message Broker V7, the IBM Integration API (CMP) is unable to communicate with environments of V6.1 and earlier, so this method will always return false.
        Returns true if and only if the IBM Integration API (CMP) has received a message from the broker which indicates that the broker is unable to process requests from this IBM Integration API (CMP) because the versions are not compatible.
        Parameters:
        waitIfNotUpdated - If this is set to true and the administered object has not yet received an update from the broker, the call will block until the first response is received (or the timeout configured in ConfigManagerProxy.setRetryCharacteristics() occurs).
        Returns:
        boolean true if and only if the broker is unable to successfully communicate with this API because of a version incompatibility.
      • withUUID

        public static java.util.Properties withUUID(java.lang.String uuid)
        Deprecated. 
        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.
        Parameters:
        uuid - property to set
        Returns:
        Properties a new Properties object with the relevant key/value pairs set.
      • getAccessControlEntries

        public AccessControlEntry[] getAccessControlEntries()
        Deprecated. This method is unique to Configuration Manager connections, and as such is no longer used as of WebSphere Message Broker V7.
        This method returns an array with no elements.