|
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.mqemqmessage.MQeMQMsgObject
This section describes the Java class used to represent a Websphere MQ style message object within WebSphere MQ Everyplace. It can be used to create and read Websphere MQs style message objects.
The class has getxxx() and setxxx() methods for all the Websphere MQ message header fields. For efficiency however, only fields that have been set to a non-default value are actually contained in the message object .
The class also defines few fields which correspond to the information related to headers added by JMS applications.
This class is a descendant of MQeMsgObject
.
Function:
This class represents a WebSphere MQ style message. It is designed for use with messages which flow between WebSphere MQ and WMQe applications and use the WebSphere MQ message format.
The default message transformer in the WMQe/WMQ Bridge will create a MQeMQMsgObject when it transforms a WebSphere MQ message which is not marked as being in WMQe format.
If an MQeMQMsgObject arrives at the bridge from WMQe, the default message transformer will map the message header values and data directly into a WebSphere MQ message.
The following list shows how a message coming from a WebSphere MQ system maps to the WMQe Format, and vice-versa.
WMQe field name: FIELD_NAME_MQ_DATA
byte array
data.
If this field is not in the message, then a zero-length byte array is assumed.
WMQe field name: MQe.Msg_Priority
integer
field. Values 0-9 inclusive.
The value has the same meaning as in the WMQ message header.
If the message is constructed without this field, then a value of
DEF_PRIORITY
is returned from the get method indicating that
the priority has not been set, and that a default should be assumed.
WMQe field name: MQe.Msg_MsgID
byte array
field. Normally set to 24 bytes long to match
that used by WMQ.
If the message is constructed without this field, then a value of DEF_MESSAGE_ID
is assumed.
WMQe field name: MQe.Msg_CorrelID
byte array
field. Normally set to 24 bytes long to match that used
by WMQ.
If the message is constructed without this field, then a value of DEF_CORRELATION_ID
is assumed.
WMQe field name: MQe.Msg_ReplyToQ
ASCII String
field.
The queue to which reply messages are sent, as a result of this
message being processed.
If this field is missing from the message, then a value of DEF_REPLY_TO_QUEUE_NAME
is assumed.
WMQe field name: MQe.Msg_ReplyToQMgr
ASCII String
field.
The queue manager to which reply messages are sent,
as a result of this message being processde.
If this field is missing from the message, then a value of DEF_REPLY_TO_QUEUE_MANAGER_NAME
is assumed.
WMQe field name: FIELD_NAME_MQ_REPORT
integer
field.
See the WMQ programming reference for more detail.
If this field is missing from the message, then a value of DEF_REPORT
is assumed.
WMQe field name: MQe.Msg_Style
integer
field.
If this field is missing from the message, then a value of MQe.Msg_Style_Datagram
is assumed.
WMQe field name: MQe.Msg_ExpireTime
integer
field or a long
field.
If this field is missing from the message, then a value of DEF_EXPIRY
is assumed.
WMQe field name: FIELD_NAME_MQ_FEEDBACK
integer
field.
If this field is missing from the message, then a value of DEF_FEEDBACK
is assumed.
WMQe field name: FIELD_NAME_MQ_CHARACTER_SET
integer
field.
If this field is missing from the message, then a value of DEF_CHARACTER_SET
is assumed.
WMQe field name: FIELD_NAME_MQ_ENCODING
integer
field.
If this field is missing from the message, then a value of DEF_ENCODING
is assumed.
WMQe field name: FIELD_NAME_MQ_FORMAT
The field is encoded as an Unicode String
string. Normally 8 characters long.
If this field is missing from the message, then a value of DEF_FORMAT
is assumed.
WMQe field name: FIELD_NAME_MQ_PERSISTENCE
This is an integer
field.
If this field is missing then a value of DEF_PERSISTENCE
is assumed.
WMQe field name: FIELD_NAME_MQ_BACKOUT_COUNT
This is an integer
field.
If this field is missing then a value of DEF_BACKOUT_COUNT
is assumed.
WMQe field name: FIELD_NAME_MQ_USER_ID
The field is an Unicode String
field, usually of length 12 to match that used by WMQ.
If this field is missing then a value of DEF_USER_ID
is assumed.
WMQe field name: FIELD_NAME_MQ_ACCOUNTING_TOKEN
The field is of type byte array
.
If this field is missing, then a value of DEF_ACCOUNTING_TOKEN
is assumed.
WMQe field name: FIELD_NAME_MQ_APP_ID_DATA
This is a an Unicode String
field.
If this field is missing, then a value of DEF_APPLICATION_ID_DATA
is assumed.
WMQe field name: FIELD_NAME_MQ_PUT_APP_TYPE
This is an integer
field.
If this field is missing from the message, then a value of DEF_PUT_APPLICATION_TYPE
is assumed.
WMQe field name: FIELD_NAME_MQ_PUT_APP_NAME
This is an Unicode String
field.
If this field is missing from the message, then a value of DEF_PUT_APPLICATION_NAME
is assumed.
WMQe field name: FIELD_NAME_MQ_GROUP_ID
This is a byte array
field.
If this field is missing from the message, then a value of DEF_GROUP_ID
is assumed.
WMQe field name: FIELD_NAME_MQ_PUT_DATE_TIME
This is a field of type long
.
If this field is missing from the message, then the current time at the point the information is required is returned.
WMQe field name: FIELD_NAME_MQ_APP_ORIG_DATA
This is a Unicode String
field.
If this field is missing from the message, then a default value of DEF_APPLICATION_ORIGIN_DATA
is assumed.
WMQe field name: FIELD_NAME_MQ_MSG_SEQUENCE_NUM
This is an integer
field.
If this field is missing from the message, then a default value of DEF_SEQUENCE_NUMBER
is assumed.
WMQe field name: FIELD_NAME_MQ_OFFSET
This field is of type integer
.
If this field is missing from the message, then a default value of DEF_OFFSET
is assumed.
WMQe field name: FIELD_NAME_MQ_MSG_FLAGS
This is an integer
field. If the field is not defined in the message, then a value of
DEF_MESSAGE_FLAGS
is assumed.
WMQe field name: FIELD_NAME_MQ_ORIGINAL_LENGTH
This is an integer
field. If the field is not defined in the message, then a value of
DEF_ORIGINAL_LENGTH
is assumed.
Field Summary | |
static byte[] |
DEF_ACCOUNTING_TOKEN
|
static java.lang.String |
DEF_APPLICATION_ID_DATA
|
static java.lang.String |
DEF_APPLICATION_ORIGIN_DATA
The default value used for the FIELD_NAME_MQ_APP_ORIG_DATA field if it has not been
specified explicitly in the message. |
static int |
DEF_BACKOUT_COUNT
The default value used for the FIELD_NAME_MQ_BACKOUT_COUNT field if it has not been set
in the message. |
static int |
DEF_CHARACTER_SET
The default value used for the FIELD_NAME_MQ_CHARACTER_SET field if it has not been
set in the message. |
static byte[] |
DEF_CORRELATION_ID
The default value used for the MQe.Msg_CorrelID field if it has not been
set in the message. |
static int |
DEF_ENCODING
The default encoding assumed if it has not been set in the message. |
static int |
DEF_EXPIRY
The default expiry time used if it has not been set in the message. |
static int |
DEF_FEEDBACK
The default feedback options used if none are set in the message. |
static java.lang.String |
DEF_FORMAT
The default "format" information assumed if none are set in the message. |
static byte[] |
DEF_GROUP_ID
The default value used for the FIELD_NAME_MQ_GROUP_ID field if not set in the message. |
static int |
DEF_MESSAGE_FLAGS
The default message flag settings, used if the FIELD_NAME_MQ_MSG_FLAGS field is not
set in the message. |
static byte[] |
DEF_MESSAGE_ID
The default value used for the MQe.Msg_MsgID field if it has
not been set in the message. |
static int |
DEF_MESSAGE_TYPE
The default message type if none is set in the message. |
static int |
DEF_OFFSET
The default offset assumed to be in the message if the FIELD_NAME_MQ_OFFSET field
has not been set in the message. |
static int |
DEF_ORIGINAL_LENGTH
The default message length. |
static int |
DEF_PERSISTENCE
The default value used for the FIELD_NAME_MQ_PERSISTENCE field if it is not
set in the message. |
static int |
DEF_PRIORITY
The default value used for the MQe.Msg_Priority field if it has not been
set in the message. |
static java.lang.String |
DEF_PUT_APPLICATION_NAME
The default value used for the FIELD_NAME_MQ_PUT_APP_NAME field if it has
not been set in the message. |
static int |
DEF_PUT_APPLICATION_TYPE
|
static java.lang.String |
DEF_REPLY_TO_QUEUE_MANAGER_NAME
|
static java.lang.String |
DEF_REPLY_TO_QUEUE_NAME
The default value used for the MQe.Msg_ReplyToQ field if it has not been
set in the message. |
static int |
DEF_REPORT
The default value used for reporting options; indicates that no reporting options are set. |
static int |
DEF_SEQUENCE_NUMBER
The default sequence number used if the FIELD_NAME_MQ_MSG_SEQUENCE_NUM field is not
set in the message. |
static java.lang.String |
DEF_USER_ID
|
static java.lang.String |
FIELD_NAME_MQ_ACCOUNTING_TOKEN
The name of an optional byte array field used to hold the accounting token associated
with this message, as defined in the WMQ reference material. |
static java.lang.String |
FIELD_NAME_MQ_APP_ID_DATA
The name of an optional Unicode String field which holds appliation data relating to identity. |
static java.lang.String |
FIELD_NAME_MQ_APP_ORIG_DATA
The name of an optional Unicode String field which holds application data relating to the original
source of the data. |
static java.lang.String |
FIELD_NAME_MQ_BACKOUT_COUNT
The name of an optional integer field used to indicates how many times the message has
been backed-out, as defined in the WMQ reference manuals. |
static java.lang.String |
FIELD_NAME_MQ_CHARACTER_SET
The name of an optional integer field used to hold the coded character set the data is encoded in. |
static java.lang.String |
FIELD_NAME_MQ_DATA
The name of the optional byte array field which holds the message payload. |
static java.lang.String |
FIELD_NAME_MQ_ENCODING
The name of an optional integer field used to hold the data encoding used for the message data. |
static java.lang.String |
FIELD_NAME_MQ_FEEDBACK
The name of an optional integer field used to hold the feedback, or reason code. |
static java.lang.String |
FIELD_NAME_MQ_FORMAT
The name of an optional Unicode String field used to indicate the
format of the message data, as defined by the WMQ reference manuals. |
static java.lang.String |
FIELD_NAME_MQ_GROUP_ID
The name of the optional byte array field which holds group identifier information,
as defined in the WMQ reference material. |
static java.lang.String |
FIELD_NAME_MQ_MSG_FLAGS
The name of the optional integer field which holds message flags,
as defined by the WMQ reference material. |
static java.lang.String |
FIELD_NAME_MQ_MSG_SEQUENCE_NUM
The name of the optional integer field which holds the sequence number of the logical message
within a group of messages, as defined by the WMQ reference material. |
static java.lang.String |
FIELD_NAME_MQ_OFFSET
The name of the optional integer field which holds the offset of the data in the physical
message from the start of a logical message, as defined by the WMQ reference material. |
static java.lang.String |
FIELD_NAME_MQ_ORIGINAL_LENGTH
The name of the optional integer field which holds the length of the original message. |
static java.lang.String |
FIELD_NAME_MQ_PERSISTENCE
The name of an optional integer field used to indicate whether the message
is persistent or not, as defined by the WMQ reference manuals. |
static java.lang.String |
FIELD_NAME_MQ_PUT_APP_NAME
The name of an optional Unicode String field which indicates the name of the
application which put the message. |
static java.lang.String |
FIELD_NAME_MQ_PUT_APP_TYPE
The name of an optional integer field which indicates the type of the application which put the message. |
static java.lang.String |
FIELD_NAME_MQ_PUT_DATE_TIME
The name of an optional long field which holds the combined value of the time and
date the message was put, as a Java Epoc. |
static java.lang.String |
FIELD_NAME_MQ_REPORT
The name of an optional integer field used to hold the reporting options a message will use
when being conveyed on an WMQ system. |
static java.lang.String |
FIELD_NAME_MQ_USER_ID
The name of an optional Unicode String field used to hold the name of the user who generated
the message, as defined in the WMQ reference manuals. |
Fields inherited from class com.ibm.mqe.MQeFields |
ArraySeparator, TypeArrayElements, TypeAscii, TypeBoolean, TypeByte, TypeDouble, TypeFields, TypeFloat, TypeInt, TypeLong, TypeShort, TypeUnicode, TypeUnTyped |
Constructor Summary | |
MQeMQMsgObject()
This creates a new MQeMQMsgObject. |
|
MQeMQMsgObject(MQeMsgObject msg)
This creates a new MQeMQMsgObject, wrapping a supplied message into the new object and setting the properties from the supplied message. |
Method Summary | |
java.lang.String |
dumpAllToString()
Dumps all the field values from the message to a string. |
java.lang.String |
dumpToString()
Dumps the field values in the message object to a string. |
boolean |
equals(byte[] b1,
byte[] b2)
Compares two byte arrays for equality. |
byte[] |
getAccountingToken()
Gets the value of the accounting token - this corresponds to a field in the WMQ standard message header (MQMD). |
java.lang.String |
getApplicationIdData()
Gets the value of the application ID data - this corresponds to a field in the WMQ standard message header (MQMD). |
java.lang.String |
getApplicationOriginData()
Gets the value of the application origin data - this corresponds to a field in the WMQ standard message header (MQMD). |
int |
getBackoutCount()
Gets thevalue of the backout count - this corresponds to a field in the WMQ standard message header (MQMD). |
int |
getCharacterSet()
Gets thevalue of the coded character set identifier - this corresponds to a field in the WMQ standard message header (MQMD). |
byte[] |
getCorrelationId()
Gets the value of the correlation id - this corresponds to a field in the WMQ standard message header (MQMD). |
byte[] |
getData()
Gets the message data - this corresponds to the payload of the WMQ message. |
int |
getEncoding()
Gets the encoding value - this corresponds to a field in the WMQ standard message header (MQMD). |
int |
getExpiry()
Gets the expiry value - this corresponds to a field in the WMQ standard message header (MQMD). |
int |
getFeedback()
Gets the feedback value - this corresponds to a field in the WMQ standard message header (MQMD). |
java.lang.String |
getFormat()
Gets the value of the format - this corresponds to a field in the WMQ standard message header (MQMD). |
byte[] |
getGroupId()
Gets the value of the group ID - this corresponds to a field in the WMQ standard message header (MQMD). |
int |
getMessageFlags()
Gets the value of the message flags - this corresponds to a field in the WMQ standard message header (MQMD). |
byte[] |
getMessageId()
Gets the value of the message ID - this corresponds to a field in the WMQ standard message header (MQMD). |
int |
getMessageSequenceNumber()
Gets the value of the message sequence number - this corresponds to a field in the WMQ standard message header (MQMD). |
int |
getMessageType()
Gets the message type (i.e. |
int |
getOffset()
Gets the value of the offset - this corresponds to a field in the WMQ standard message header (MQMD). |
int |
getOriginalLength()
Gets the original length - this corresponds to a field in the WMQ standard message header (MQMD). |
int |
getPersistence()
Gets the persistence value - this corresponds to a field in the WMQ standard message header (MQMD). |
int |
getPriority()
Gets the priority - this corresponds to a field in the WMQ standard message header (MQMD). |
java.lang.String |
getPutApplicationName()
Gets the put application name - this corresponds to a field in the WMQ standard message header (MQMD). |
int |
getPutApplicationType()
Gets the put application type - this corresponds to a field in the WMQ standard message header (MQMD). |
java.util.Calendar |
getPutDateTime()
Gets the put date and time - this corresponds to a field in the WMQ standard message header (MQMD). |
java.lang.String |
getReplyToQueueManagerName()
Gets the reply-to queue manager name - this corresponds to a field in the WMQ standard message header (MQMD). |
java.lang.String |
getReplyToQueueName()
Gets the reply-to queue name - this corresponds to a field in the WMQ standard message header (MQMD). |
int |
getReport()
Gets the report value - this corresponds to a field in the WMQ standard message header (MQMD). |
java.lang.String |
getUserId()
Gets the value of the user ID - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setAccountingToken(byte[] accountingToken)
Sets the value of the accounting token - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setApplicationIdData(java.lang.String applicationIdData)
Sets the application ID data - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setApplicationOriginData(java.lang.String applicationOriginData)
Sets the application origin data - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setBackoutCount(int backoutCount)
Sets the value of the backout count - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setCharacterSet(int characterSet)
Sets the value of the coded character set identifier - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setCorrelationId(byte[] correlationId)
Sets the value of the correlation ID - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setData(byte[] data)
Sets the message data - this corresponds to the payload of the WMQ message. |
void |
setEncoding(int encoding)
Sets the encoding value - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setExpiry(int expiry)
Sets the expiry value - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setFeedback(int feedback)
Sets the feedback value - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setFormat(java.lang.String format)
Sets the format value - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setGroupId(byte[] groupId)
Sets the value of the group ID - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setMessageFlags(int flags)
Sets the value of the message flags - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setMessageId(byte[] messageId)
Sets the value of the message ID - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setMessageSequenceNumber(int seqNo)
Sets the value of the message sequence number - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setMessageType(int messageType)
Sets the message type (i.e. |
void |
setOffset(int offset)
Sets the value of the offset - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setOriginalLength(int len)
Sets the value of the original length - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setPersistence(int persistence)
Sets the persistence value - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setPriority(int priority)
Sets the priority value - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setPutApplicationName(java.lang.String putApplicationName)
Sets the put application name - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setPutApplicationType(int putApplicationType)
Sets the put application type - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setPutDateTime(java.util.Calendar calendar)
Sets the put date and time - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setReplyToQueueManagerName(java.lang.String replyToQMName)
Sets the reply-to queue manager name - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setReplyToQueueName(java.lang.String replyToQueueName)
Sets the reply-to queue name - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setReport(int report)
Sets the report value - this corresponds to a field in the WMQ standard message header (MQMD). |
void |
setUserId(java.lang.String userId)
Sets the value of the user ID - this corresponds to a field in the WMQ standard message header (MQMD). |
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 int DEF_ORIGINAL_LENGTH
FIELD_NAME_MQ_ORIGINAL_LENGTH
has not been set.
public static final int DEF_MESSAGE_FLAGS
FIELD_NAME_MQ_MSG_FLAGS
field is not
set in the message.
public static final int DEF_SEQUENCE_NUMBER
FIELD_NAME_MQ_MSG_SEQUENCE_NUM
field is not
set in the message.
public static final int DEF_OFFSET
FIELD_NAME_MQ_OFFSET
field
has not been set in the message.
public static final int DEF_REPORT
FIELD_NAME_MQ_REPORT
field is not set in the message.
public static final int DEF_MESSAGE_TYPE
MQe.Msg_Style
field is not set in the message.
public static final int DEF_EXPIRY
This value means that the message never expires.
Used if the MQe.Msg_ExpireTime
field is not in the message.
public static final int DEF_FEEDBACK
public static final int DEF_ENCODING
public static final java.lang.String DEF_FORMAT
A value of 8 space characters is the default.
public static final int DEF_PRIORITY
MQe.Msg_Priority
field if it has not been
set in the message.
This indicates that the priority field has not been set.
public static final int DEF_PERSISTENCE
FIELD_NAME_MQ_PERSISTENCE
field if it is not
set in the message.
This indicates that a message IS persistent.
public static final byte[] DEF_MESSAGE_ID
MQe.Msg_MsgID
field if it has
not been set in the message.
It is a byte array, 24 elements long. Each element has a value of 0.
public static final byte[] DEF_CORRELATION_ID
MQe.Msg_CorrelID
field if it has not been
set in the message.
It is of type byte array, 24 elements long. Each element has a value of 0.
public static final int DEF_BACKOUT_COUNT
FIELD_NAME_MQ_BACKOUT_COUNT
field if it has not been set
in the message.
public static final java.lang.String DEF_REPLY_TO_QUEUE_NAME
MQe.Msg_ReplyToQ
field if it has not been
set in the message.
It has a value of 48 spaces.
public static final java.lang.String DEF_REPLY_TO_QUEUE_MANAGER_NAME
public static final java.lang.String DEF_USER_ID
public static final byte[] DEF_ACCOUNTING_TOKEN
public static final java.lang.String DEF_APPLICATION_ID_DATA
public static final int DEF_PUT_APPLICATION_TYPE
public static final java.lang.String DEF_PUT_APPLICATION_NAME
FIELD_NAME_MQ_PUT_APP_NAME
field if it has
not been set in the message.
public static final java.lang.String DEF_APPLICATION_ORIGIN_DATA
FIELD_NAME_MQ_APP_ORIG_DATA
field if it has not been
specified explicitly in the message.
The value holds 4 space characters.
public static final byte[] DEF_GROUP_ID
FIELD_NAME_MQ_GROUP_ID
field if not set in the message.
public static final int DEF_CHARACTER_SET
FIELD_NAME_MQ_CHARACTER_SET
field if it has not been
set in the message.
Indicates a Unicode character set.
public static final java.lang.String FIELD_NAME_MQ_REPORT
integer
field used to hold the reporting options a message will use
when being conveyed on an WMQ system.
See the WMQ programming reference for more detial of the available reporting options. Note that this field is not used by the WMQe messaging fabric.
If this field is missing from the message, then a value of DEF_REPORT
is assumed.
public static final java.lang.String FIELD_NAME_MQ_FEEDBACK
integer
field used to hold the feedback, or reason code.
See the WMQ programming reference material for a more detailed explanation.
If this field is missing from the message, then a value of DEF_FEEDBACK
is assumed.
public static final java.lang.String FIELD_NAME_MQ_ENCODING
integer
field used to hold the data encoding used for the message data.
If this field is missing from the message, then a value of DEF_ENCODING
is assumed.
public static final java.lang.String FIELD_NAME_MQ_CHARACTER_SET
integer
field used to hold the coded character set the data is encoded in.
If this field is missing from the message, then a value of DEF_CHARACTER_SET
is assumed.
public static final java.lang.String FIELD_NAME_MQ_FORMAT
Unicode String
field used to indicate the
format of the message data, as defined by the WMQ reference manuals.
Normally 8 characters long.
If this field is missing from the message, then a value of DEF_FORMAT
is assumed.
public static final java.lang.String FIELD_NAME_MQ_PERSISTENCE
integer
field used to indicate whether the message
is persistent or not, as defined by the WMQ reference manuals.
WMQe does not use this field, it has an effect only when the message is being conveyed to, from or over an WMQ queue manager.
If this field is missing then a value of DEF_PERSISTENCE
is assumed.
public static final java.lang.String FIELD_NAME_MQ_BACKOUT_COUNT
integer
field used to indicates how many times the message has
been backed-out, as defined in the WMQ reference manuals.
WMQe does not use this field, it has an effect only when the message is being conveyed to, from or over an WMQ queue manager.
If this field is missing then a value of DEF_BACKOUT_COUNT
is assumed.
public static final java.lang.String FIELD_NAME_MQ_USER_ID
Unicode String
field used to hold the name of the user who generated
the message, as defined in the WMQ reference manuals.
The field is usually of length 12 to match that used by WMQ.
If this field is missing then a value of DEF_USER_ID
is assumed.
public static final java.lang.String FIELD_NAME_MQ_ACCOUNTING_TOKEN
byte array
field used to hold the accounting token associated
with this message, as defined in the WMQ reference material.
If this field is missing, then a value of DEF_ACCOUNTING_TOKEN
is assumed.
public static final java.lang.String FIELD_NAME_MQ_APP_ID_DATA
Unicode String
field which holds appliation data relating to identity.
If this field is missing, then a value of DEF_APPLICATION_ID_DATA
is assumed.
public static final java.lang.String FIELD_NAME_MQ_PUT_APP_TYPE
integer
field which indicates the type of the application which put the message.
The values of this field are defined by the WMQ reference manuals.
If this field is missing from the message, then a value of DEF_PUT_APPLICATION_TYPE
is assumed.
public static final java.lang.String FIELD_NAME_MQ_PUT_APP_NAME
Unicode String
field which indicates the name of the
application which put the message.
If this field is missing from the message, then a value of DEF_PUT_APPLICATION_NAME
is assumed.
public static final java.lang.String FIELD_NAME_MQ_APP_ORIG_DATA
Unicode String
field which holds application data relating to the original
source of the data.
If this field is missing from the message, then a default value of DEF_APPLICATION_ORIGIN_DATA
is assumed.
public static final java.lang.String FIELD_NAME_MQ_PUT_DATE_TIME
long
field which holds the combined value of the time and
date the message was put, as a Java Epoc.
Milliseconds since 1 Jan 1970.
If this field is missing from the message, then the current time at the point the information is required is returned.
public static final java.lang.String FIELD_NAME_MQ_DATA
byte array
field which holds the message payload.
If this field is not in the message, then a zero-length byte array is assumed.
public static final java.lang.String FIELD_NAME_MQ_GROUP_ID
byte array
field which holds group identifier information,
as defined in the WMQ reference material.
If this field is missing from the message, then a value of DEF_GROUP_ID
is assumed.
public static final java.lang.String FIELD_NAME_MQ_MSG_SEQUENCE_NUM
integer
field which holds the sequence number of the logical message
within a group of messages, as defined by the WMQ reference material.
If this field is missing from the message, then a default value of DEF_SEQUENCE_NUMBER
is assumed.
public static final java.lang.String FIELD_NAME_MQ_OFFSET
integer
field which holds the offset of the data in the physical
message from the start of a logical message, as defined by the WMQ reference material.
If this field is missing from the message, then a default value of DEF_OFFSET
is assumed.
public static final java.lang.String FIELD_NAME_MQ_MSG_FLAGS
integer
field which holds message flags,
as defined by the WMQ reference material.
If the field is not defined in the message, then a value of DEF_MESSAGE_FLAGS
is assumed.
public static final java.lang.String FIELD_NAME_MQ_ORIGINAL_LENGTH
integer
field which holds the length of the original message.
This is an integer field. If the field is not defined in the message, then a value of
DEF_ORIGINAL_LENGTH
is assumed.
Constructor Detail |
public MQeMQMsgObject() throws java.lang.Exception
java.lang.Exception
- Propagated from the super-class
constructor, MQeMsgObject.MQeMQMsgObject MQMsg = new MQeMQMsgObject();
public MQeMQMsgObject(MQeMsgObject msg) throws java.lang.Exception
This creates a new MQeMQMsgObject, wrapping a supplied message into the new object and setting the properties from the supplied message.
msg
- The message object to be wrapped.
java.lang.Exception
- Propagated from the super-class
constructor, MQeMsgObject.MQeMQMsgObject MQeMQMsg = new MQeMQMsgObject(MQeMsg);
Method Detail |
public int getReport() throws java.lang.Exception
Gets the report value - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the Report header field; values
are expected to be generated from suitable constants in the com.ibm.mq.MQC
class.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); int report = 0; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; report = mqMsgObj.getReport(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return report;
public int getMessageType() throws java.lang.Exception
Gets the message type (i.e. datagram, request, reply, report) - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the MsgType header field; values
are expected to be suitable constants in the com.ibm.mqe.MQe
class.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); int msgType = 0; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; msgType = mqMsgObj.getMessageType(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return msgType;
public int getExpiry() throws java.lang.Exception
Gets the expiry value - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the Expiry header field. The value is in tenths of a second, as is used in Websphere MQ messages (it is not in milliseconds, which is used for the WebSphere MQ Everyplace expiry time).
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); int expiry = 0; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; expiry = mqMsgObj.getExpiry(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return expiry;
public int getFeedback() throws java.lang.Exception
Gets the feedback value - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the Feedback header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); int feedback = 0; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; feedback = mqMsgObj.getFeedback(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return feedback;
public int getEncoding() throws java.lang.Exception
Gets the encoding value - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the Encoding header field; values
are expected to be suitable constants in the com.ibm.mq.MQC
class.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); int encode = 0; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; encode = mqMsgObj.getEncoding(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return encode;
public int getCharacterSet() throws java.lang.Exception
Gets thevalue of the coded character set identifier - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the CodedCharSetId header field; values
are expected to be suitable constants in the com.ibm.mq.MQC
class.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); int charSet = 0; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; charSet = mqMsgObj.getCharacterSet(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return charSet;
public java.lang.String getFormat() throws java.lang.Exception
Gets the value of the format - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the Format header field; values
are expected to be suitable constants in the com.ibm.mq.MQC
class.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); String format = " "; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; format = mqMsgObj.getFormat(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return format;
public int getPriority() throws java.lang.Exception
Gets the priority - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the Priority header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); int priority = 0; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; priority = mqMsgObj.getPriority(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return priority;
public int getPersistence() throws java.lang.Exception
Gets the persistence value - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the Persistence header field; values
are expected to be suitable constants in the com.ibm.mq.MQC
class.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); int persistence = 0; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; persistence = mqMsgObj.getPersistence(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return persistence;
public byte[] getMessageId() throws java.lang.Exception
Gets the value of the message ID - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the MsgId header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); byte[] msgId = null; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; msgId = mqMsgObj.getMessageId(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return msgId;
public byte[] getCorrelationId() throws java.lang.Exception
Gets the value of the correlation id - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the CorrelId header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); byte[] correlId = null; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; correlId = mqMsgObj.getCorrelationId(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return correlId;
public int getBackoutCount() throws java.lang.Exception
Gets thevalue of the backout count - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the BackoutCount header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); int backoutCount = 0; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; backoutCount = mqMsgObj.getBackoutCount(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return backoutCount;
public java.lang.String getReplyToQueueName() throws java.lang.Exception
Gets the reply-to queue name - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the ReplyToQ header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); String replyToQueueName = " "; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; replyToQueueName = mqMsgObj.getReplyToQueueName(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return replyToQueueName;
public java.lang.String getReplyToQueueManagerName() throws java.lang.Exception
Gets the reply-to queue manager name - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the ReplyToQMgr header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); String replyToQueueMgrName = " "; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; replyToQueueMgrName = mqMsgObj.getReplyToQueueManagerName(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return replyToQueueMgrName;
public java.lang.String getUserId() throws java.lang.Exception
Gets the value of the user ID - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the UserIdentifier header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); String userId = " "; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; userId = mqMsgObj.getUserId(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return userId;
public byte[] getAccountingToken() throws java.lang.Exception
Gets the value of the accounting token - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the AccountingToken header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); byte[] accountToken = null; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; accountToken = mqMsgObj.getAccountingToken(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return accountToken;
public java.lang.String getApplicationIdData() throws java.lang.Exception
Gets the value of the application ID data - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the ApplIdentityData header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); String appIdData = " "; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; appIdData = mqMsgObj.getApplicationIdData(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return appIdData;
public int getPutApplicationType() throws java.lang.Exception
Gets the put application type - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the PutApplType header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); int putApplType = 0; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; putApplType = mqMsgObj.getPutApplicationType(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return putApplType;
public java.lang.String getPutApplicationName() throws java.lang.Exception
Gets the put application name - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the PutApplName header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); String putApplName = " "; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; putApplName = mqMsgObj.getPutApplicationName(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return putApplName;
public java.lang.String getApplicationOriginData() throws java.lang.Exception
Gets the value of the application origin data - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the ApplOriginData header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); String appOriginData = " "; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; appOriginData = mqMsgObj.getApplicationOriginData(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return appOriginData;
public byte[] getGroupId() throws java.lang.Exception
Gets the value of the group ID - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the GroupId header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); byte[] groupId = null; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; groupId = mqMsgObj.getGroupId(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return groupId;
public java.util.Calendar getPutDateTime() throws java.lang.Exception
Gets the put date and time - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the PutDate and PutTime header fields. The value is returned as a Gregorian Calendar object, for consistency with the WebSphere MQ Classes for Java.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); Calendar putDateTime = Calendar.getInstance(); try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; putDateTime = mqMsgObj.getPutDateTime(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return putDateTime;
public int getMessageSequenceNumber() throws java.lang.Exception
Gets the value of the message sequence number - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the MsgSeqNumber header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); int msgSeqNo = 0; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; msgSeqNo = mqMsgObj.getMessageSequenceNumber(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return msgSeqNo;
public int getOffset() throws java.lang.Exception
Gets the value of the offset - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the Offset header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); int offset = 0; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; offset = mqMsgObj.getOffset(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return offset;
public int getMessageFlags() throws java.lang.Exception
Gets the value of the message flags - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the MsgFlags header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); int msgFlags = 0; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; msgFlags = mqMsgObj.getMessageFlags(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return msgFlags;
public int getOriginalLength() throws java.lang.Exception
Gets the original length - this corresponds to a field in the WMQ standard message header (MQMD).
This method returns the value of the OriginalLength header field.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); int originalLength = 0; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; originalLength = mqMsgObj.getOriginalLength(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return originalLength;
public byte[] getData() throws java.lang.Exception
Gets the message data - this corresponds to the payload of the WMQ message.
This method returns the message data. The application must know how to interpret the data.
java.lang.Exception
- If there is an error reading the value
from the message object.MQeMQMsgObject msgObj = new MQeMQMsgObject(); byte[] msgData = null; try { if (msgObj instanceof MQeMQMsgObject) { MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; msgData = mqMsgObj.getData(); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return msgData;
public void setReport(int report) throws java.lang.Exception
Sets the report value - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the Report header field in the WebSphere MQ style message.
report
- The value to be set in the report field; values must be generated
from suitable constants in the com.ibm.mq.MQC
class,
e.g. MQC.MQRO_NEW_MSG_ID | MQC.MQRO_COPY_MSG_ID_TO_CORREL_ID | MQC.MQRO_DEAD_LETTER_Q.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); report = 0; mqeMsgObj.setReport(report); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setMessageType(int messageType) throws java.lang.Exception
Sets the message type (i.e. datagram, request, reply, report) - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the MsgType header field in the WebSphere MQ style message. It also sets the message style for use within the WebSphere MQ Everyplace system itself.
messageType
- The value to be set in the
message type field;
values must be taken from suitable constants in the com.ibm.mqe.MQe
class,
e.g. MQe.Msg_Style_Datagram.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); messageType = 8; mqeMsgObj.setMessageType(messageType); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setExpiry(int expiry) throws java.lang.Exception
Sets the expiry value - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the Expiry header field in the WebSphere MQ style message. It also sets the expiry time of the message for use within the WebSphere MQ Everyplace system itself.
expiry
- An integer containing the value to be set in the expiry field.
The value should be in tenths of a second, as is used in WebSphere MQ messages
(not in milliseconds, which is used for WebSphere MQ Everyplace expiry time).
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); expiry = -1; mqeMsgObj.setExpiry(expiry); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setFeedback(int feedback) throws java.lang.Exception
Sets the feedback value - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the Feedback header field in the WebSphere MQ style message.
feedback
- An integer containing the value to be set in the feedback field.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); feedback = 0; mqeMsgObj.setFeedback(feedback); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setEncoding(int encoding) throws java.lang.Exception
Sets the encoding value - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the Encoding header field in the WebSphere MQ style message.
encoding
- The value to be set in the encoding field;
values must be taken from suitable constants in the com.ibm.mq.MQC
class,
e.g. MQC.MQENC_INTEGER_NORMAL.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); encoding = 0x0100 + 0x0010 + 0x0001; mqeMsgObj.setEncoding(encoding); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setCharacterSet(int characterSet) throws java.lang.Exception
Sets the value of the coded character set identifier - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the CodedCharSetId header field in the WebSphere MQ style message.
characterSet
- The value to be set in the coded character set identifier field;
values must be taken from suitable constants in the com.ibm.mq.MQC
class,
e.g. MQC.MQCCSI_Q_MGR.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); characterSet = 256; mqeMsgObj.setCharacterSet(characterSet); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setFormat(java.lang.String format) throws java.lang.Exception
Sets the format value - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the Format header field in the WebSphere MQ style message.
format
- The value to be set in the format field;
values must be taken from suitable constants in the com.ibm.mq.MQC
class,
e.g. MQC.MQFMT_NONE. The default value is MQC.MQFMT_NONE.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); format = " "; mqeMsgObj.setFormat(format); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setPriority(int priority) throws java.lang.Exception
Sets the priority value - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the Priority header field in the WebSphere MQ style message. It also sets the priority of the message for use within the WebSphere MQ Everyplace system itself.
priority
- An integer containing the value to be set in the priority field.
The value should be between 0 and 9 (inclusive).
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); priority = -1; mqeMsgObj.setPriority(priority); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setPersistence(int persistence) throws java.lang.Exception
Sets the persistence value - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the Persistence header field in the WebSphere MQ style message.
persistence
- The value to be set in the persistence
field; values must be taken from suitable constants in the com.ibm.mq.MQC
class,
e.g. MQC.MQPER_PERSISTENT_AS_Q_DEF.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); persistence = 2; mqeMsgObj.setPersistence(persistence); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setMessageId(byte[] messageId) throws java.lang.Exception
Sets the value of the message ID - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the MsgId header field in the WebSphere MQ style message.
messageId
- A byte array containing the value to be set in the message ID field.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); messageId = new byte[3]; mqeMsgObj.setMessageId(messageId); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setCorrelationId(byte[] correlationId) throws java.lang.Exception
Sets the value of the correlation ID - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the CorrelId header field in the WebSphere MQ style message. It also sets the Correlation ID for use within the WebSphere MQ Everyplace system itself.
correlationId
- A byte array containing the value to be set in the
correlation ID field.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); correlationId = new byte[3]; mqeMsgObj.setCorrelationId(correlationId); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setBackoutCount(int backoutCount) throws java.lang.Exception
Sets the value of the backout count - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the BackoutCount header field in the WebSphere MQ style message.
backoutCount
- An integer containing the value to be set in the backout
count field.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); backoutCount = 4; mqeMsgObj.setBackoutCount(backoutCount); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setReplyToQueueName(java.lang.String replyToQueueName) throws java.lang.Exception
Sets the reply-to queue name - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the ReplyToQ header field in the WebSphere MQ style message.
replyToQueueName
- A String containing the value to be set in the
reply-to queue name field.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); replyToQueueName = " "; mqeMsgObj.setReplyToQueueName(replyToQueueName); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setReplyToQueueManagerName(java.lang.String replyToQMName) throws java.lang.Exception
Sets the reply-to queue manager name - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the ReplyToQMgr header field in the WebSphere MQ style message.
replyToQMName
- A String containing the value to be set in the reply-to
queue manager name field.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); replyToQMName = " "; mqeMsgObj.setReplyToQueueManagerName(replyToQMName); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setUserId(java.lang.String userId) throws java.lang.Exception
Sets the value of the user ID - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the UserIdentifier header field in the WebSphere MQ style message.
userId
- A String containing the value to be set in the user ID field.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); userId = " "; mqeMsgObj.setUserId(userId); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setAccountingToken(byte[] accountingToken) throws java.lang.Exception
Sets the value of the accounting token - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the AccountingToken header field in the WebSphere MQ style message.
accountingToken
- A byte array containing the value to be set in the
accounting token field.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); accountingToken = new byte[3]; mqeMsgObj.setAccountingToken(accountingToken); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setApplicationIdData(java.lang.String applicationIdData) throws java.lang.Exception
Sets the application ID data - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the ApplIdData header field in the WebSphere MQ style message.
applicationIdData
- A String containing the value to be set in the
application ID data field.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); String applIdData = " "; mqeMsgObj.setApplicationIdData(applIdData); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setPutApplicationType(int putApplicationType) throws java.lang.Exception
Sets the put application type - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the PutApplType header field in the WebSphere MQ style message.
putApplicationType
- An integer containing the value to be set in the
put application type field.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); putApplicationType = 0; mqeMsgObj.setPutApplicationType(putApplicationType); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setPutApplicationName(java.lang.String putApplicationName) throws java.lang.Exception
Sets the put application name - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the PutApplName header field in the WebSphere MQ style message.
putApplicationName
- A String containing the value to be set in the put
application name field.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); putApplicationName = "WebSphere MQ Everyplace"; mqeMsgObj.setPutApplicationName(putApplicationName); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setApplicationOriginData(java.lang.String applicationOriginData) throws java.lang.Exception
Sets the application origin data - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the ApplOriginData header field in the WebSphere MQ style message.
applicationOriginData
- A String containing the value to be set in the
application origin data field.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); String applOriginData = " "; mqeMsgObj.setApplicationOriginData(applOriginData); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setGroupId(byte[] groupId) throws java.lang.Exception
Sets the value of the group ID - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the GroupId header field in the WebSphere MQ style message.
groupId
- A byte array containing the value to be set in the group ID field.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); groupId = new byte[3]; mqeMsgObj.setGroupId(groupId); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setPutDateTime(java.util.Calendar calendar) throws java.lang.Exception
Sets the put date and time - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the PutDate and PutTime header fields in the WebSphere MQ style message. A Calendar object is used to specify the date and time, for consistency with the WebSphere MQ Classes for Java.
calendar
- A Calendar object containing the value to be set
in the put date and time fields.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); calendar = Calendar.getInstance(); mqeMsgObj.setPutDateTime(calendar); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setMessageSequenceNumber(int seqNo) throws java.lang.Exception
Sets the value of the message sequence number - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the MsgSeqNumber header field in the WebSphere MQ style message.
seqNo
- An integer containing the value to be set in the message
sequence number field.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); seqNo = 5; mqeMsgObj.setMessageSequenceNumber(seqNo); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setOffset(int offset) throws java.lang.Exception
Sets the value of the offset - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the Offset header field in the WebSphere MQ style message.
offset
- An integer containing the value to be set in the Offset field.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); offset = 28; mqeMsgObj.setOffset(offset); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setMessageFlags(int flags) throws java.lang.Exception
Sets the value of the message flags - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the MsgFlags header field in the WebSphere MQ style message.
flags
- An integer containing the value to be set in the message flags field.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); messageFlags = 9; mqeMsgObj.setMessageFlags(messageFlags); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setOriginalLength(int len) throws java.lang.Exception
Sets the value of the original length - this corresponds to a field in the WMQ standard message header (MQMD).
This method sets the value of the OriginalLength header field in the WebSphere MQ style message.
len
- An integer containing the value to be set in the original length field.
java.lang.Exception
- If there is an error setting the value in the
message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); len = 3026; mqeMsgObj.setOriginalLength(len); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public void setData(byte[] data) throws java.lang.Exception
Sets the message data - this corresponds to the payload of the WMQ message.
This method sets the message data in the WebSphere MQ style message.
data
- A byte array containing the message data.
java.lang.Exception
- If there is an error setting the value
in the message object.try { MQeMQMsgObject mqeMsgObj = new MQeMQMsgObject(); data = new byte[3021]; mqeMsgObj.setData(data); } catch (Exception e) { System.err.println("Failure ! " + e.toString()); }
public boolean equals(byte[] b1, byte[] b2)
Compares two byte arrays for equality.
This compares two byte arrays for equality. They are considered equal if they are the same length and each byte in one array is equal to the corresponding byte in the other array.
b1
- The first byte array for comparison.b2
- The second byte array for comparison.
byte[] correlId = new byte[3]; MQeMQMsgObject msgObj = new MQeMQMsgObject(); MQeMQMsgObject mqMsgObj = (MQeMQMsgObject) msgObj; try { if (mqMsgObj.equals(mqMsgObj.getCorrelationId(), correlId)) { System.out.println("The two CorrelationIds are equal"); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); return false; } return true;
public java.lang.String dumpToString()
Dumps the field values in the message object to a string.
This method dumps header fields from the WebSphere MQ style message with their corresponding field values to a string, together with the value of the data field. It is useful when debugging.
This method dumps only the fields that have been set to non-default
values. The dumpAllToString()
method dumps all the header fields to a string.
String
containing the field names and values and the data value.MQeMQMsgObject msgObj = new MQeMQMsgObject(); try { if (msgObj instanceof MQeMQMsgObject) { System.out.println(((MQeMQMsgObject) msgObj).dumpToString()); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return msgObj.dumpToString();
public java.lang.String dumpAllToString()
Dumps all the field values from the message to a string.
This method dumps all the header fields from the WebSphere MQ style
message with their corresponding field values to a string, together with the
value of the data field. It is useful when debugging.
This method dumps all the header fields to a string.
The dumpToString()
method dumps only the fields that have been set to non-default values.
MQeMQMsgObject msgObj = new MQeMQMsgObject(); try { if (msgObj instanceof MQeMQMsgObject) { System.out.println(((MQeMQMsgObject) msgObj).dumpAllToString()); } } catch (Exception e) { System.err.println("Failure ! " + e.toString()); } return msgObj.dumpAllToString();
|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |