|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.mqe.MQe | +--com.ibm.mqe.MQeFields | +--com.ibm.mqe.MQeMsgObject | +--com.ibm.mqe.MQeAdminMsg | +--com.ibm.mqe.administration.MQeQueueAdminMsg
This class is used to manage Websphere MQ Everyplace local queues.
The class extends MQeAdminMsg and provides the
implementation for managing local queues.For information on
basic administration concepts see MQeAdminMsg
The following actions are applicable on queues:
MQeAdminMsg.Action_Create
MQeAdminMsg.Action_Delete
MQeAdminMsg.Action_Inquire
MQeAdminMsg.Action_InquireAll
MQeAdminMsg.Action_Update
MQeAdminMsg.Action_AddAlias
MQeAdminMsg.Action_RemoveAlias
Queues are objects that hold messages, the messages are held in a message store owned by the queue. Typically, this message store would be a persistent storage device, such as a hard disk. However, other types of store can be used, such as a database. WebSphere MQ Everyplace relies on the fact that the queues have persistent store to be able to offer it’s assured message delivery, and so the use of any non-persistent storage, would invalidate the assured message delivery mechanism.
Local queues, as the name suggest are local to the owning queue manager.
The name of a queue is formed from the target queue manager name (for a
local queue this is the name of the queue manager that owns the queue) and
a unique name for the queue on that queue manager. Two fields in the
administration message are used to uniquely identify the queue, these are
the ascii fields MQeAdminMsg.Admin_Name
and Queue_QMgrName
.
Method setName(String, String)
can be used set these
two fields in the administration message.
The queue uses a queue store adapter to handle its communications with the storage device. Adapters are interfaces between WebSphere MQ Everyplace and hardware devices, such as disks or networks, or to software, such as databases. Adapters are designed to be pluggable components, allowing the queue store to be easily changed.
All types of queue other than those that are remote and synchronous
require a message store to store their messages. Each
queue can specify what type of store to use, and where it is located. The
queue characteristic Queue_FileDesc
is used to specify the type of
message store and to provide parameters for it. The file descriptor takes
the form:
A number of storage adapters are provided and include:
MQeDiskFieldsAdapter
to store
messages on a file system
MQeMemoryFieldsAdapter
to store
messages in memory
Please note that an alias can not be used to represent both the Message Store Class and the Adapter Class.
The choice of adapter determines the persistence and resilience of messages. For instance if a memory adapter is used then the messages are only as resilient as the memory. Memory may be a much faster medium than disk but is highly volatile compared to disk. Hence the choice of adapter is an important one.
If a message store is not defined when creating a queue, the default is to use the message store that was specified when the queue manager was created.
A queue has many other characteristics, these include:
These fields form the basis of WebSphere MQ Everyplace queue based security. As well as securing any messages on the queue, messages that are moved over a network will be secured with the level of security specified on the queue.
Queue_MaxMsgSize
for controlling the maximum number of
messages on a queue
Queue_Expiry
for controlling how long messages are allowed
to stay on a queue
Queue_Rule
allows a user defined queue rule class to customise
the behaviour of the queue
Multiple names or aliases can be assigned to a queue. When an application calls methods on a queue manager that require a queue name, the name may be an alias or the real queue name.
Some administration actions can only be performed when the queue is in a certain state, for instance:
This class acts as the base class for managing other types of queues.
For instance, MQeRemoteQueueAdminMsg
derives
from this class and handles management of remote queues.
The maximum message size, and maximum queue depths checks are only in place on a queue when there is no Queue Rule in place. Also for Synchronous Remote Queues, the Queue Depth check is not applied locally. The maximum message size check will however be made locally.
For an example of how to use this class, Example3
All other queue classes inherit from this class but not all of the properties inherited are suitable for actions on each queue class. The following table and the equivalent tables in the queue subclasses are intended to show which properties are relevant for administrative actions on each type of queue.
Field Summary | |
static java.lang.String |
Queue_Active
String used to identify the field in the message representing the active state of the queue. |
static byte |
Queue_Asynchronous
Constant for operation mode of asynchronous |
static java.lang.String |
Queue_AttrRule
String used to identify the field in the message representing the attribute rule. |
static java.lang.String |
Queue_Authenticator
String used to identify the field in the message representing the authenticator. |
static java.lang.String |
Queue_Compressor
String used to identify the field in the message representing the compressor. |
static java.lang.String |
Queue_CreationDate
String used to identify the field in the message representing the date the queue was created. |
static java.lang.String |
Queue_Cryptor
String used to identify the field in the message representing the cryptor to use. |
static java.lang.String |
Queue_CurrentSize
String used to identify the field in the message representing the current number of messages on the queue. |
static java.lang.String |
Queue_Description
String used to identify the field in the message representing the description of the queue. |
static java.lang.String |
Queue_Expiry
String used to identify the field in the message representing the expiry time for messages on the queue. |
static java.lang.String |
Queue_FileDesc
String used to identify the field in the message representing the file descriptor. |
static java.lang.String |
Queue_MaxMsgSize
String used to identify the field in the message representing the maximum size of messages allowed on the queue. |
static java.lang.String |
Queue_MaxQSize
String used to identify the field in the message representing the maximum number of messages allowed on the queue. |
static java.lang.String |
Queue_Mode
String used to identify the field in the message representing the operating mode of the queue. |
static int |
Queue_NoLimit
Value for no limit. |
static java.lang.String |
Queue_Priority
String used to identify the field in the message representing the default priority for messages on the queue. |
static java.lang.String |
Queue_QAliasNameList
String used to identify the field in the message representing a set of aliases for the queue. |
static java.lang.String |
Queue_QMgrName
String used to identify the field in the message representing the name of the target queue manager for the queue. |
static byte |
Queue_RegistryNone
Constant for registry type of None. |
static byte |
Queue_RegistryQMgr
Constant for registry type of Queue Manager. |
static byte |
Queue_RegistryQueue
Constant for registry type of Queue. |
static java.lang.String |
Queue_Rule
String used to identify the field in the message representing the queue rule. |
static byte |
Queue_Synchronous
Constant for operation mode of synchronous |
static java.lang.String |
Queue_TargetRegistry
String used to identify the field in the message representing the target registry type. |
Fields inherited from class com.ibm.mqe.MQeAdminMsg |
Action_AddAlias, Action_Create, Action_Delete, Action_Inquire, Action_InquireAll, Action_RemoveAlias, Action_Start, Action_Stop, Action_Unknown, Action_Update, Admin_Action, Admin_Class, Admin_Errors, Admin_MaxAttempts, Admin_Name, Admin_Parms, Admin_RC, Admin_Reason, Admin_TargetQMgr, RC_Fail, RC_Mixed, RC_Success |
Fields inherited from class com.ibm.mqe.MQeFields |
ArraySeparator, TypeArrayElements, TypeAscii, TypeBoolean, TypeByte, TypeDouble, TypeFields, TypeFloat, TypeInt, TypeLong, TypeShort, TypeUnicode, TypeUnTyped |
Constructor Summary | |
MQeQueueAdminMsg()
Default constructor |
|
MQeQueueAdminMsg(java.lang.String qMgrName,
java.lang.String qName)
This constructor takes the name of the queue that is to be managed and puts it into the admin msg. |
Method Summary | |
void |
addAlias(java.lang.String alias)
Setup the message to add an alias to the queue. |
void |
changeAlias(java.lang.String alias)
Adds an alias name to the aliases array. |
void |
removeAlias(java.lang.String alias)
Setup the message to remove an alias from the queue. |
void |
setName(java.lang.String queueManagerName,
java.lang.String queueName)
Sets the name of the queue that the action is to be peformed against. |
Methods inherited from class com.ibm.mqe.MQeAdminMsg |
characteristics, create, delete, duplicate, getAction, getErrorFields, getFieldInError, getInputFields, getMaxAttempts, getName, getOutputFields, getRC, getReason, getTargetQMgr, inquire, inquireAll, setAction, setMaxAttempts, setName, setTargetQMgr, update |
Methods inherited from class com.ibm.mqe.MQeMsgObject |
getMsgUIDFields, getOriginQMgr, getTimeStamp, putOriginQMgr, resetMsgUIDFields, unwrapMsgObject |
Methods inherited from class com.ibm.mqe.MQe |
abbreviate, alias, asciiToByte, byteToAscii, byteToHex, byteToHex, byteToInt, byteToLong, byteToShort, byteToUnicode, fileSeparator, getEventLogHandler, hexToAscii, hexToByte, intToByte, isCLDC, loadClass, loadObject, log, setEventLogHandler, setLoader, sliceByteArray, type, unicodeToByte, uniqueValue |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String Queue_QMgrName
The name of a queue is formed from the target queue manager name (for a
local queue this is the name of the queue manager that owns the queue) and
a unique name for the queue on that queue manager. Two fields in the
administration message are used to uniquely identify the queue, these are
the ascii fields MQeAdminMsg.Admin_Name
and Queue_QMgrName
.
Method setName(String, String)
can be used set these
two fields in the administration message.
Once set the queue manager name cannot be changed.
The field is of type ascii.
MQeAdminMsg.Admin_Name
,
Constant Field Valuespublic static final java.lang.String Queue_Active
Field is read only so only Inquire actions are valid.
The field is of type boolean.
public static final java.lang.String Queue_Description
The field is of type unicode
public static final java.lang.String Queue_FileDesc
All types of queue other than those that are remote and synchronous require a message store to store their messages. The file descriptor characteristic is used to specify the type of message store and to provide parameters for it. The file descriptor takes the form:
A number of storage adapters are provided and include:
MQeDiskFieldsAdapter
to store
messages on a file system
MQeMemoryFieldsAdapter
to store
messages in memory
For example, if alias MsgLog is set to com.ibm.mqe.adapters.MQeDiskFieldsAdapater then to store messages in directory d:\ServerQM123\Queues, the file descriptor would be: MsgLog:d:\ServerQM123\Queues
If a message store is not defined when creating a queue, the default value that was specified when the queue manager was created is used.
The parameters for the adapter are platform dependant. When setting the file descriptor:
The field is of type ascii.
public static final java.lang.String Queue_Cryptor
Messages held on a queue can be protected by an authenticator and cryptor. The messages can also be compressed by using a compressor. The fields relating to security characteristics are:
These fields form the basis of WebSphere MQ Everyplace queue based security. As well as securing any messages on the queue, messages that are moved over a network will be secured with the level of security specified on the queue.
This field holds the class name or alias of the cryptor to use. See package com.ibm.mqe.attributes for details on cryptors.
The cryptor can only be updated when the queue depth is 0.
The field is of type ascii.
public static final java.lang.String Queue_Authenticator
This field holds the class name or alias of the authenticator to use. One of the supplied autehenticators or a user writen authenticator can be used.
This is one of a number of security related fields, see
Queue_Cryptor
for more details.
This field can only be updated when the queue depth is 0.
The field is of type ascii.
Queue_Cryptor
,
Constant Field Valuespublic static final java.lang.String Queue_Compressor
This field holds the class name or alias of the compressor to use. See package com.ibm.mqe.attributes for details on cryptors.
This is one of a number of security related fields, see
Queue_Cryptor
for more details.
This field can only be updated when the queue depth is 0.
The field is of type ascii.
Queue_Cryptor
,
com.ibm.mqe.attributes,
Constant Field Valuespublic static final java.lang.String Queue_TargetRegistry
Possible values are:
Values other than None are only relevant when the authentictor
MQeWTLSCertAuthenticator
is used. When
this autheticator is used, it can use either the queue managers certificate
(Queue_RegistryQMgr) or the queues certificate (Queue_RegistryQueue) for
authentication purposes.
This is one of a number of security related fields, see
Queue_Cryptor
for more details.
This field can only be updated when the queue depth is 0.
The field is of type byte
Queue_Cryptor
,
Constant Field Valuespublic static final byte Queue_RegistryNone
Constant for registry type of None.
Queue_TargetRegistry
,
Constant Field Valuespublic static final byte Queue_RegistryQMgr
Constant for registry type of Queue Manager.
Queue_TargetRegistry
,
Constant Field Valuespublic static final byte Queue_RegistryQueue
Constant for registry type of Queue.
Queue_TargetRegistry
,
Constant Field Valuespublic static final java.lang.String Queue_AttrRule
This field holds the class name or alias of an attribute rule. The
rule is used to determine if a remote request coming in over a channel
is acceptable to the queue. For example see class MQeAttributeRule
.
If no rule has been specified and other security fields have been set, then
the default is taken from the queue managers channel attribute rule. This
can be set with administration message MQeQueueManagerAdminMsg
and field MQeQueueManagerAdminMsg.QMgr_ChnlAttrRules
.
This is one of a number of security related fields, see
Queue_Cryptor
for more details.
This field can only be updated when the queue depth is 0.
The field is of type ascii.
Queue_Cryptor
,
MQeAttributeRule
,
Constant Field Valuespublic static final java.lang.String Queue_Rule
This field holds the class name or alias of a queue rule. The behaviour
of the queue can be customised by a set rules. These rules take the form
of a user replaceable Java class. The base set of queue rules are defined
in class, MQeQueueRule
. During the operation of
the queue, the rules are called when certain events occur, for example,
when a message is put, a message expires, or a duplicate message arrives.
The rules then determine how the queue handles these events.
The field is of type ascii.
MQeQueueRule
,
Constant Field Valuespublic static final java.lang.String Queue_MaxMsgSize
This field allows the maximum size of a message allowed on the queue
to be specified. Messages greater than the maximum allowed are rejected.
The size of the message is determined by using the length of the
byte arry which is the result of calling the MQeFields.dump()
method on the message.
By default no maximum is set. The constant Queue_NoLimit
can
be used to specify a value of no maximum size.
The field is of type int.
public static final java.lang.String Queue_Priority
This field allows the default priority for messages put to the queue to be specified. If a message arrives with no priortiy set then it will take the queue's priority for the length of time that the message is on the queue. The minumum priority is 0, the maximum 9.
The field is of type byte.
public static final java.lang.String Queue_Mode
Queues can run in one of two modes synchronous or asynchrouns. Synchronous messaging provides a transmission service directly from the source application to the target queue, without queuing at the source queue manager. Asynchronous messaging is a transmission service from the source queue manager to the target queue, with queuing at the source queue manager.
Possible values for the field are:
This field has no meaning for local queues, so is only applicable to subclasses of MQeQueue like MQeRemoteQueue.
Once set the field cannot be changed.
The field is of type byte.
public static final byte Queue_Asynchronous
Constant for operation mode of asynchronous
Queue_Mode
,
Constant Field Valuespublic static final byte Queue_Synchronous
Constant for operation mode of synchronous
Queue_Mode
,
Constant Field Valuespublic static final java.lang.String Queue_Expiry
This field defines the maximum time that a message remains on a queue before it expires. The value is specified in milliseconds. If the message has an expiry time then the message's expiry time is used as opposed to the queue's expiry time.
A value less than or equal to zero means the queue has no expiry time.
The default is, the queue has no expiry time.
The field is of type long.
public static final java.lang.String Queue_MaxQSize
This field allows the maximum number of messages allowed on the queue to be specified. Once the maximum is reached, messages are rejected until the depth falls below the maximum.
By default no maximum is set. The constant Queue_NoLimit
can
be used to specify a value of no maximum depth.
The field is of type int.
public static final int Queue_NoLimit
Queue_MaxMsgSize
,
Queue_MaxQSize
,
Constant Field Valuespublic static final java.lang.String Queue_CurrentSize
Field is read only so only Inquire actions are valid.
The field is of type int.
public static final java.lang.String Queue_CreationDate
The value is based on the time since midnight GMT on Jan 1, 1970 GMT
Field is read only so only Inquire actions are valid.
The field is of type long.
public static final java.lang.String Queue_QAliasNameList
Multiple names or aliases can be assigned to a queue. This field holds the set of aliases.
The field is of type ascii array
Constructor Detail |
public MQeQueueAdminMsg() throws java.lang.Exception
Default constructor
java.lang.Exception
public MQeQueueAdminMsg(java.lang.String qMgrName, java.lang.String qName) throws java.lang.Exception
This constructor uses the setName(String,String)
method to
put the name into the administratoin message parameters field
qMgrName
- name of the target queue managerqName
- name of the Queue
java.lang.Exception
setName(String, String)
try { MQeQueueAdminMsg aMsg = new MQeQueueAdminMsg("ExampleQM", "ExampleQ"); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
Method Detail |
public void addAlias(java.lang.String alias) throws java.lang.Exception
A method that assists in setting up an administration message to add
one or more aliases to a queue. Multiple aliases can be
added in one message by calling the method multiple times. The message is
set to perform action MQeAdminMsg.Action_AddAlias
.
The following basic fields are set:
The following fields are set in the Admin_Parms field.
The name of the queue to add an alias to is specified using
method setName(String, String)
or using
the constructor that takes the resource name or by setting
the MQeAdminMsg.Admin_Name
and Queue_QMgrName
fields
alias
- the alias to add to the queue.
java.lang.Exception
MQeAdminMsg.Action_AddAlias
,
Queue_QAliasNameList
//Add aliases to a queue MQeQueueAdminMsg msg = new MQeQueueAdminMsg(); msg.setName("ExampleQM", "ExampleQ"); //Set the action required and its parameters into the message msg.addAlias("PayrollQ"); msg.addAlias("Branch1PayrollQ");
public void changeAlias(java.lang.String alias) throws java.lang.Exception
Adds an alias name to the aliases array.
alias
- alias name of queue
java.lang.Exception
public void removeAlias(java.lang.String alias) throws java.lang.Exception
A method that assists in setting up an administration message to remove
one or more aliases to a queue. Multiple aliases can be
removed in one message by calling the method multiple times. The message is
set to perform action MQeAdminMsg.Action_RemoveAlias
.
The following basic fields are set:
The following fields are set in the Admin_Parms field.
The name of the queue to remove an alias from is specified using
method setName(String, String)
or using
the constructor that takes the resource name or by setting
the MQeAdminMsg.Admin_Name
and Queue_QMgrName
fields
alias
- the alias to remove from the queue.
java.lang.Exception
MQeAdminMsg.Action_RemoveAlias
,
Queue_QAliasNameList
// Add aliases to a queue MQeQueueAdminMsg msg = new MQeQueueAdminMsg(); msg.setName("ExampleQM", "ExampleQ"); //Set the action required and its parameters into the message msg.removeAlias("PayrollQ"); msg.removeAlias("Branch1PayrollQ");
public void setName(java.lang.String queueManagerName, java.lang.String queueName) throws java.lang.Exception
Sets the name of the queue that the action is to be peformed against.
The following fields are set into the Admin_Parms field
queueName
- name of the queue
java.lang.Exception
// Delete a queue MQeFields parms = new MQeFields(); MQeQueueAdminMsg msg = new MQeQueueAdminMsg(); //Set the action required and its parameters into the message msg.delete(parms); msg.setName("ExampleQM", "ExampleQ");
|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |