Websphere MQ Everyplace

examples.midp.exampleapp.messageservice
Class MQeMessageServiceParameters

java.lang.Object
  |
  +--examples.midp.exampleapp.messageservice.MQeMessageServiceParameters
All Implemented Interfaces:
MQeMessageServiceConstants

public class MQeMessageServiceParameters
extends java.lang.Object
implements MQeMessageServiceConstants

An MQe queue manager requires a set of parameters in order to be started. These parameters have been encapsulated within this class.

The parameters required by a queue manager are stored in an MQeFields object and fall into the following 3 groups:

 QueueManager
  Information on the queue manager
    - queue manager's name
    - queue manager's description

 Registry
  Holds information about the registry
    - a path to the location of the registry
    - whether is it public or private
    - the registry's attributes (e.g. the PIN for a private registry)

 ChannelManager
  Contains information specific to the channel manager
    - channel timeout
    - max number of channels

 Default paramaters are set in buildDefaultParms().

 -------------------------------------------------------------

 Alias
  Contains aliases for classes so, for example,
  "com.ibm.mqe.adapters.MQeDiskFieldsAdapter" can be referred to as "Adapter".
  This is the equivalent of the [alias] section found in an ini file.
 


Field Summary
static java.lang.String Section_Alias
           
static java.lang.String Section_ChannelManager
           
static java.lang.String Section_Listener
           
static java.lang.String Section_Registry
           
static short[] version
           
 
Fields inherited from interface examples.midp.exampleapp.messageservice.MQeMessageServiceConstants
DEFAULT_BASEDIRNAME, DEFAULT_CHANNEL, DEFAULT_CHANNELATTRRULES, DEFAULT_COMPRESSOR, DEFAULT_CRYPTOR, DEFAULT_EVENTLOG, DEFAULT_FASTNETWORK, DEFAULT_FILEREGISTRY, DEFAULT_LISTENERADAPTER, DEFAULT_LISTENERPORT, DEFAULT_MAXCHANNELS, DEFAULT_MSGLOG, DEFAULT_NETWORK, DEFAULT_PIN, DEFAULT_PRIVATEREGISTRY, DEFAULT_QUEUEMANAGER, DEFAULT_TIMEINTERVAL, DEFAULT_TRACE, DEFAULT_TRANSPORTER
 
Constructor Summary
MQeMessageServiceParameters()
           
 
Method Summary
 void buildDefaultParms()
          Setup a default set of parameters needed to start a queue manager running in either client or server mode.
protected  java.lang.String getBaseDir()
          Returns the root directory of the queue manager.
protected  int getChannelTimeout()
          Returns the timeout value of the channel.
protected  java.lang.String getListenerAdapter()
          Returns the listener adapter to be used.
protected  int getListenerPort()
          Returns the port that the listener should listen on.
protected  int getMaxChannels()
          Returns the maximum number of channels allowed.
protected  java.lang.String getQMname()
          Returns the name of the local queue manager.
 MQeFields getQMparms()
          Returns the queuemanager's startup parameters or a clean MQeFields.
protected  MQeFields getSection(java.lang.String section)
          Returns a named section from the parameters.
 void setAlias(java.lang.String alias, java.lang.String value)
          Add an alias to the parameters.
 void setBaseDir(java.lang.String baseDir)
          Sets the base directory.
 void setChannelTimeout(int timeout)
          Sets the timeout value of the channel.
 void setListenerAdapter(java.lang.String adapter)
          Sets the adapter to be used by the listener.
 void setListenerPort(int port)
          Sets the port that the listener will be listening on.
 void setMaxChannels(int maxChannels)
          Set the maximum number of channels allowed.
 void setQMname(java.lang.String qmgrName)
          Sets the name of the local queue manager and then setup the startup parameters that are used to start the named queue manager.
protected  void setRegistryAttribute(java.lang.String alias, java.lang.String value)
          Sets an attribute in the registry section
 void setRegistryDir(java.lang.String registryDir)
          Sets the directory that the registry is located in.
protected  void setRegistryType(java.lang.String registryType)
          Sets the type of registry that will be used.
 void setRegistryTypePrivate()
          Sets the registry to be a private registry and sets the PIN required by the registry.
 void setRegistryTypePublic()
          Sets the registry to be a public registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static short[] version

Section_ChannelManager

public static final java.lang.String Section_ChannelManager
See Also:
Constant Field Values

Section_Listener

public static final java.lang.String Section_Listener
See Also:
Constant Field Values

Section_Alias

public static final java.lang.String Section_Alias
See Also:
Constant Field Values

Section_Registry

public static final java.lang.String Section_Registry
See Also:
Constant Field Values
Constructor Detail

MQeMessageServiceParameters

public MQeMessageServiceParameters()
Method Detail

buildDefaultParms

public void buildDefaultParms()
                       throws java.lang.Exception
Setup a default set of parameters needed to start a queue manager running in either client or server mode. This method only need be called if the parameters were not passed using an alternative means like an ini file.

Returns:
void
Throws:
java.lang.Exception

getSection

protected MQeFields getSection(java.lang.String section)
Returns a named section from the parameters.

Parameters:
section - The name of the section to return (use one of the section constants)
Returns:
MQeFields

getBaseDir

protected java.lang.String getBaseDir()
Returns the root directory of the queue manager.

Returns:
String

getChannelTimeout

protected int getChannelTimeout()
                         throws java.lang.Exception
Returns the timeout value of the channel.

Returns:
int
java.lang.Exception

getListenerAdapter

protected java.lang.String getListenerAdapter()
                                       throws java.lang.Exception
Returns the listener adapter to be used.

Returns:
String
java.lang.Exception

getListenerPort

protected int getListenerPort()
                       throws java.lang.Exception
Returns the port that the listener should listen on.

Returns:
int
java.lang.Exception

getMaxChannels

protected int getMaxChannels()
                      throws java.lang.Exception
Returns the maximum number of channels allowed.

Returns:
int
java.lang.Exception

getQMparms

public MQeFields getQMparms()
Returns the queuemanager's startup parameters or a clean MQeFields.

Returns:
MQeFields

getQMname

protected java.lang.String getQMname()
Returns the name of the local queue manager.

Returns:
String

setAlias

public void setAlias(java.lang.String alias,
                     java.lang.String value)
Add an alias to the parameters.

Parameters:
alias - The alias
value - The value of the alias
Returns:
void

setRegistryAttribute

protected void setRegistryAttribute(java.lang.String alias,
                                    java.lang.String value)
Sets an attribute in the registry section

Parameters:
alias - The alias
value - The value of the alias
Returns:
void

setBaseDir

public void setBaseDir(java.lang.String baseDir)
Sets the base directory.

Parameters:
baseDir - The root dir of the queue manager
Returns:
void

setChannelTimeout

public void setChannelTimeout(int timeout)
                       throws java.lang.Exception
Sets the timeout value of the channel.

Parameters:
timeout - The channel timeout
Returns:
void
Throws:
java.lang.Exception

setListenerAdapter

public void setListenerAdapter(java.lang.String adapter)
                        throws java.lang.Exception
Sets the adapter to be used by the listener. Normally, an ini file has a : at the end of the adapter name (but this doesnt).

Parameters:
adapter - The adapter to listen with
Returns:
void
Throws:
java.lang.Exception

setListenerPort

public void setListenerPort(int port)
                     throws java.lang.Exception
Sets the port that the listener will be listening on.

Parameters:
port - The port to listen on
Returns:
void
Throws:
java.lang.Exception

setMaxChannels

public void setMaxChannels(int maxChannels)
                    throws java.lang.Exception
Set the maximum number of channels allowed.

Parameters:
maxChannels - The maximum number of concurrent channels
Returns:
void
Throws:
java.lang.Exception

setQMname

public void setQMname(java.lang.String qmgrName)
               throws java.lang.Exception
Sets the name of the local queue manager and then setup the startup parameters that are used to start the named queue manager.

Alternatively the setQMgrIniFile method can be used to obtain the queue manager name and startup parms from an init file.

Parameters:
qmgrName - The new name of the local queue manager
Returns:
void
Throws:
java.lang.Exception

setRegistryDir

public void setRegistryDir(java.lang.String registryDir)
                    throws java.lang.Exception
Sets the directory that the registry is located in.

Parameters:
registryDir - The registry dir
Returns:
void
Throws:
java.lang.Exception

setRegistryType

protected void setRegistryType(java.lang.String registryType)
                        throws java.lang.Exception
Sets the type of registry that will be used.

Parameters:
registryType - The type of registry
java.lang.Exception

setRegistryTypePrivate

public void setRegistryTypePrivate()
                            throws java.lang.Exception
Sets the registry to be a private registry and sets the PIN required by the registry.

Most cryptors require you to have a private registry.

Returns:
void
Throws:
java.lang.Exception

setRegistryTypePublic

public void setRegistryTypePublic()
                           throws java.lang.Exception
Sets the registry to be a public registry.

Returns:
void
Throws:
java.lang.Exception

Websphere MQ Everyplace