public class MQQueue extends MQDestination
MQQueue provides inquire, set, put and get operations for WebSphere MQ queues. The inquire and
set capabilities are inherited from MQManagedObject.
Use MQQueueManager.accessQueue() to gain access to
an MQQueue object.
alternateUserId, closeOptions, connectionReference, isOpen, name, openOptions| Constructor and Description |
|---|
MQQueue(MQQueueManager qMgr,
java.lang.String queueName,
int openOptions,
java.lang.String queueManagerName,
java.lang.String dynamicQueueName,
java.lang.String alternateUserId)
Public constructor which allows users to create MQQueue subclasses.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the object.
|
int |
getCurrentDepth()
Gets the number of messages currently on the queue.
|
int |
getDefinitionType()
Indicates how the queue was defined.
|
int |
getInhibitGet()
Indicates whether get operations are allowed for this queue.
|
int |
getInhibitPut()
Indicates whether put operations are allowed for this queue.
|
int |
getMaximumDepth()
Gets the maximum number of messages that can exist on the queue at any one time.
|
int |
getMaximumMessageLength()
Gets the maximum length of the application data of a message on this queue.
|
int |
getOpenInputCount()
Gets the number of currently valid handles for removing messages from the queue.
|
int |
getOpenOutputCount()
Gets the number of currently valid handles for adding messages to the queue.
|
int |
getQueueType()
Gets the type of this queue.
|
int |
getShareability()
Indicates whether the queue can be opened multiple times for input.
|
int |
getTriggerControl()
Indicates whether trigger messages are written to an initiation queue.
|
java.lang.String |
getTriggerData()
Gets the data for the trigger message that is written to the initiation queue.
|
int |
getTriggerDepth()
Gets the number of messages that have to be on the queue to generate a trigger message.
|
int |
getTriggerMessagePriority()
Gets the message priority below which messages do not cause trigger messages.
|
int |
getTriggerType()
Indicates the conditions under which trigger messages are written.
|
void |
putForwardMessage(MQMessage message)
Put a message being forwarded onto the queue using default put message options and message as
the original message
|
void |
putForwardMessage(MQMessage message,
MQPutMessageOptions putMessageOptions)
Put a message being forwarded onto the queue using message as the original message
|
void |
putReplyMessage(MQMessage message)
Put a reply message onto the queue using default put message options and message as the
original message
|
void |
putReplyMessage(MQMessage message,
MQPutMessageOptions putMessageOptions)
Put a reply message onto the queue using message as the original message
|
void |
putReportMessage(MQMessage message)
Put a report message onto the queue using default put message options and message as the
original message
|
void |
putReportMessage(MQMessage message,
MQPutMessageOptions putMessageOptions)
Put a report message onto the queue using message as the original message
|
void |
setInhibitGet(int inhibit)
Controls whether get operations are allowed for this queue.
|
void |
setInhibitPut(int inhibit)
Controls whether put operations are allowed for this queue.
|
void |
setTriggerControl(int trigger)
Controls whether trigger messages are written to an initiation queue.
|
void |
setTriggerData(java.lang.String data)
Sets the data for the trigger message that is written to the initiation queue.
|
void |
setTriggerDepth(int depth)
Sets the number of messages that have to be on the queue to generate a trigger message.
|
void |
setTriggerMessagePriority(int priority)
Sets the message priority below which messages do not cause trigger messages.
|
void |
setTriggerType(int type)
Sets the conditions under which trigger messages are written.
|
get, get, get, getCreationDateTime, getDestinationType, getQueueManagerCmdLevel, put, put, setQueueManagerCmdLevelgetAlternateUserId, getAttributeString, getCloseOptions, getConnectionReference, getDescription, getName, getOpenOptions, getResolvedObjectString, getResolvedQName, getResolvedType, inquire, inquire, isOpen, set, setAttributeString, setCloseOptionspublic MQQueue(MQQueueManager qMgr, java.lang.String queueName, int openOptions, java.lang.String queueManagerName, java.lang.String dynamicQueueName, java.lang.String alternateUserId) throws MQException
qMgr - the object which represents the queue manager on which the queue resides.queueName - name of the queue to open.openOptions - options which control the opening of the queue. Valid options are:
CMQC.MQOO_ALTERNATE_USER_AUTHORITY
CMQC.MQOO_BIND_AS_Q_DEF
CMQC.MQOO_BIND_NOT_FIXED
CMQC.MQOO_BIND_ON_OPEN
CMQC.MQOO_BROWSE
CMQC.MQOO_FAIL_IF_QUIESCING
CMQC.MQOO_INPUT_AS_Q_DEF
CMQC.MQOO_INPUT_SHARED
CMQC.MQOO_INPUT_EXCLUSIVE
CMQC.MQOO_INQUIRE
CMQC.MQOO_OUTPUT
CMQC.MQOO_PASS_ALL_CONTEXT
CMQC.MQOO_PASS_IDENTITY_CONTEXT
CMQC.MQOO_SAVE_ALL_CONTEXT
CMQC.MQOO_SET
CMQC.MQOO_SET_ALL_CONTEXT
CMQC.MQOO_SET_IDENTITY_CONTEXT
CMQC.MQOO_RESOLVE_LOCAL_Q
If more than one option is required, the values can be combined using either the '+' or '|' operator.
queueManagerName - name of the queue manager on which the queue is defined. If it is blank
or null the queue manager to which this MQQueueManager object is connected is used.dynamicQueueName - specifies the name of the dynamic queue to be created. It is ignored
unless queueName specifies the name of a model queue, in which case it must not be
blank or null. If the last non-blank character in the name is an asterisk (*), the
queue manager replaces the asterisk with a string of characters that guarantees that
the name generated for the queue is unique on this queue manager.alternateUserId - the alternative user ID used to check the authorization for the open if
CMQC.MQOO_ALTERNATE_USER_AUTHORITYis
specified in openOptions.MQException - if the queue cannot be opened.public void putForwardMessage(MQMessage message) throws MQException, java.io.IOException
message - to be forwardedMQException - If the MQI call failsjava.io.IOException - If there is an IO errorpublic void putForwardMessage(MQMessage message, MQPutMessageOptions putMessageOptions) throws MQException, java.io.IOException
message - to be forwardedputMessageOptions - for the MQPUTMQException - If the MQI call failsjava.io.IOException - If there is an IO errorpublic void putReplyMessage(MQMessage message) throws MQException, java.io.IOException
message - - Original Message.MQException - If the MQ call failsjava.io.IOException - If there is an IO errorpublic void putReplyMessage(MQMessage message, MQPutMessageOptions putMessageOptions) throws MQException, java.io.IOException
message - - Original Message.putMessageOptions - for MQPUT.MQException - If the MQ call failsjava.io.IOException - If there is an IO errorpublic void putReportMessage(MQMessage message) throws MQException, java.io.IOException
message - - Original Message.MQException - If the MQ call failsjava.io.IOException - If there is an IO errorpublic void putReportMessage(MQMessage message, MQPutMessageOptions putMessageOptions) throws MQException, java.io.IOException
message - - Original MessageputMessageOptions - for MQPUTMQException - If the MQ call failsjava.io.IOException - If there is an IO errorpublic void close()
throws MQException
close in class MQManagedObjectMQException - if the WebSphere MQ call fails.public int getQueueType()
throws MQException
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public int getCurrentDepth()
throws MQException
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public int getDefinitionType()
throws MQException
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public int getMaximumDepth()
throws MQException
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public int getMaximumMessageLength()
throws MQException
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public int getOpenInputCount()
throws MQException
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public int getOpenOutputCount()
throws MQException
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public int getShareability()
throws MQException
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public int getInhibitPut()
throws MQException
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public void setInhibitPut(int inhibit)
throws MQException
inhibit - the permissible values are:
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public int getInhibitGet()
throws MQException
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public void setInhibitGet(int inhibit)
throws MQException
inhibit - the permissible values are:
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public int getTriggerControl()
throws MQException
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public void setTriggerControl(int trigger)
throws MQException
trigger - the permissible values are:
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public java.lang.String getTriggerData()
throws MQException
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public void setTriggerData(java.lang.String data)
throws MQException
data - sets the data in free-format. The maximum permissible length of the string is given
by CMQC.MQ_TRIGGER_DATA_LENGTH.MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public int getTriggerDepth()
throws MQException
CMQC.MQTT_DEPTH.MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public void setTriggerDepth(int depth)
throws MQException
CMQC.MQTT_DEPTH.depth - the number of messages.MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public int getTriggerMessagePriority()
throws MQException
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public void setTriggerMessagePriority(int priority)
throws MQException
priority - the message priority. 0 means that all messages contribute to the generation of
trigger messages.MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public int getTriggerType()
throws MQException
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.public void setTriggerType(int type)
throws MQException
type - the possible values are:
MQException - if you call this method after you have closed the queue, to indicate
that the queue is no longer accessible.