WBI BrokersTM
Config Manager Proxy API

com.ibm.broker.config.proxy
Class MQPropertyFileConfigManagerConnectionParameters

java.lang.Object
  extended bycom.ibm.broker.config.proxy.MQPropertyFileConfigManagerConnectionParameters
All Implemented Interfaces:
ConfigManagerConnectionParameters

public class MQPropertyFileConfigManagerConnectionParameters
extends Object
implements ConfigManagerConnectionParameters

Provides the connection parameters to a Configuration Manager by reading a properties file that contains the hostname, queue manager, port and security exit information. The class is able to parse *.configmgr files (as created in the toolkit) as well as the mqsicfgutil.ini format.

There are two ways of connecting to a Configuration Manager using this class. The preferred method is by specifying the location of a *.configmgr file:

     ConfigManagerConnectionParameters cmcp = new
         MQPropertyFileConfigManagerConnectionParameters("cm1.configmgr");
     ConfigManagerProxy.getInstance(cmcp);
 
However, the empty constructor may also be used, which will attempt to connect to a Configuration Manager using the information in the file mqsicfgutil.ini. This method is not recommended for new applications.
    ConfigManagerProxy.getInstance(
        new MQPropertyFileConfigManagerConnectionParameters() );
 

NOTE: As the .configmgr file is XML, an XML parser is needs to be available on the CLASSPATH in order to load such a file. Config Manager Proxy applications using a v1.3-based JRE will need to manually add such a parser to the CLASSPATH in order to use this class.

class com.ibm.broker.config.proxy.MQPropertyFileConfigManagerConnectionParameters implements com.ibm.broker.config.proxy.ConfigManagerConnectionParameters

Responsibilities Represents a set of connection parameters to a WebSphere MQ based Configuration Manager.
Collaborators MQConfigManagerConnectionParameters

 Change Activity:
 -------- ----------- -------------   ------------------------------------
 Reason:  Date:       Originator:     Comments:
 -------- ----------- -------------   ------------------------------------
 25103.7  2004-03-24  HDMPL           v6 Release

 


Constructor Summary
MQPropertyFileConfigManagerConnectionParameters()
          Constructs a new instance that refers to connection properties in the file 'mqsicfgutil.ini' in the JRE's current directory.
MQPropertyFileConfigManagerConnectionParameters(String filename)
          Constructs a new instance that refers to connection properties in the file with the supplied fully qualified name.
 
Method Summary
 void disableDomainAwareness()
          Prevents Windows domain awareness support from initialising for this instance.
static void disableMQJavaClientTracing()
          Disables WebSphere MQ Java Client tracing
static void enableMQJavaClientTracing(String filename)
          Sends level 5 WebSphere MQ Java Client tracing to the specified file.
 String generateUniqueDeployID()
          Sets the deploy ID for the current connection to a unique String and returns it.
 String getDeployID()
          Returns the string used to uniquely map each deployment request back to this ConfigManagerProxy connection.
 com.ibm.broker.config.common.CommsMessageSerializer getProtocol()
          This method is required by the Config Manager Proxy and should not be called by user applications.
 com.ibm.broker.config.proxy.Receiver getReceiver()
          This method is required by the Config Manager Proxy and should not be called by user applications.
 com.ibm.broker.config.proxy.Sender getSender()
          This method is required by the Config Manager Proxy and should not be called by user applications.
 String getSessionIDString()
          Returns a String representation of the Session ID for this MQ Connection.
 String getUserID()
          Crosses the JNI to return the correctly formatted MQSeries userId & domain.
 void setAdvancedConnectionParameters(String channelName, String requestQueueName, String responseQueueName, int maxRetries, int retryWaitMillis, String deployID, byte[] sessionID)
          Sets the 'advanced' options for a connection to MQ.
 String toString()
          For diagnostic information, this method displays the current connection parameters.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MQPropertyFileConfigManagerConnectionParameters

public MQPropertyFileConfigManagerConnectionParameters(String filename)
Constructs a new instance that refers to connection properties in the file with the supplied fully qualified name. If the file cannot be read for whatever reason, the call to ConfigManagerProxy.getInstance() will throw a ConfigManagerProxyLoggedException.

Parameters:
filename - Path and file name of the parameter file, which must be in the *.configmgr format. Supplying a null or blank parameter here has the same effect as calling the empty constructor.

MQPropertyFileConfigManagerConnectionParameters

public MQPropertyFileConfigManagerConnectionParameters()
Constructs a new instance that refers to connection properties in the file 'mqsicfgutil.ini' in the JRE's current directory. If the file cannot be read for whatever reason, the call to ConfigManagerProxy.getInstance() will throw a ConfigManagerProxyLoggedException.

Method Detail

setAdvancedConnectionParameters

public void setAdvancedConnectionParameters(String channelName,
                                            String requestQueueName,
                                            String responseQueueName,
                                            int maxRetries,
                                            int retryWaitMillis,
                                            String deployID,
                                            byte[] sessionID)
Sets the 'advanced' options for a connection to MQ.

Parameters:
channelName - The name of the MQSeries Server Connection channel to use. If this is set to null, the existing value will be used.
requestQueueName - The name of the MQSeries queue to which messages will be put. If this is set to null, the existing value will be used.
responseQueueName - The name of the MQSeries queue from which messages will be got. If this is set to null, the existing value will be used.
maxRetries - The number of times the MQSender should retry after consecutive failures. If this is set to -1, the existing value will be used.
retryWaitMillis - The time (in milliseconds) the MQSender should wait inbetween retries. If this is set to -1, the existing value will be used.
deployID - The String used to map deployment requests uniquely back to this connection. If this is set to null the existing value will be used.
sessionID - A byte array containing an identifier that uniquely identifies this connection to the Config Manager. This will be used as a correlId, and so should be no longer than 24 bytes. If this is set to null, the existing value will be used.

getSender

public com.ibm.broker.config.proxy.Sender getSender()
                                             throws ConfigManagerProxyLoggedException
This method is required by the Config Manager Proxy and should not be called by user applications. Returns an instance of the Sender associated with this type.

Specified by:
getSender in interface ConfigManagerConnectionParameters
Returns:
Sender an object capable of transmitting a byte array to a Config Manager.
Throws:
ConfigManagerProxyLoggedException - if the security exit could not be instantiated

getReceiver

public com.ibm.broker.config.proxy.Receiver getReceiver()
                                                 throws ConfigManagerProxyLoggedException
This method is required by the Config Manager Proxy and should not be called by user applications. Returns an instance of the Receiver associated with this type.

Specified by:
getReceiver in interface ConfigManagerConnectionParameters
Returns:
Sender an object capable of receiving byte arrays from a Config Manager.
Throws:
ConfigManagerProxyLoggedException - if the security exit could not be instantiated

getProtocol

public com.ibm.broker.config.common.CommsMessageSerializer getProtocol()
This method is required by the Config Manager Proxy and should not be called by user applications. Returns an instance of the wire protocol associated with this connection.

Specified by:
getProtocol in interface ConfigManagerConnectionParameters
Returns:
CommsMessageSerializer - an object capable of turning Comms Messages into byte streams.

toString

public String toString()
For diagnostic information, this method displays the current connection parameters.


getDeployID

public String getDeployID()
Returns the string used to uniquely map each deployment request back to this ConfigManagerProxy connection. Most of the time the current userid is a sufficient deployID, as the field is only used to get back the correct log records related to each deployment.

Specified by:
getDeployID in interface ConfigManagerConnectionParameters
Returns:
String Deployment identifier

disableDomainAwareness

public void disableDomainAwareness()
Prevents Windows domain awareness support from initialising for this instance. If disabled, the userid will be obtained from the user.name property in the JVM. If required, this method must be called before ConfigManagerProxy.getInstance().


getUserID

public String getUserID()
Crosses the JNI to return the correctly formatted MQSeries userId & domain. If domain awareness has been disabled, or if the LogonInfo classes or DLL could not be loaded, the value of the system property 'user.name' will be returned.

Specified by:
getUserID in interface ConfigManagerConnectionParameters
Returns:
String userId (and possibly domain, using '@' as a separator).

enableMQJavaClientTracing

public static final void enableMQJavaClientTracing(String filename)
Sends level 5 WebSphere MQ Java Client tracing to the specified file.

Parameters:
filename - of the trace file

disableMQJavaClientTracing

public static final void disableMQJavaClientTracing()
Disables WebSphere MQ Java Client tracing


getSessionIDString

public String getSessionIDString()
Returns a String representation of the Session ID for this MQ Connection.

Returns:
String representation of the session ID.

generateUniqueDeployID

public String generateUniqueDeployID()
Sets the deploy ID for the current connection to a unique String and returns it.

Returns:
String the generated deploy ID

WBI BrokersTM
Config Manager Proxy API