|
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 MQe applications and use the WebSphere MQ message format.
The default message transformer in the MQe/MQ 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.
MQe field name: FIELD_NAME_MQ_DATA
If this field is not in the message, then a zero-length byte array is assumed.
MQe field name: MQe.Msg_Priority
The value has the same meaning as the MQSeries 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.
MQe field name: MQe.Msg_MsgID
If the message is constructed without this field, then a value of DEF_MESSAGE_ID
is assumed.
MQe field name: MQe.Msg_CorrelID
If the message is constructed without this field, then a value of DEF_CORRELATION_ID
is assumed.
MQe field name: MQe.Msg_ReplyToQ
If this field is missing from the message, then a value of DEF_REPLY_TO_QUEUE_NAME
is assumed.
MQe field name: MQe.Msg_ReplyToQMgr
If this field is missing from the message, then a value of DEF_REPLY_TO_QUEUE_MANAGER_NAME
is assumed.
MQe field name: FIELD_NAME_MQ_REPORT
If this field is missing from the message, then a value of DEF_REPORT
is assumed.
MQe field name: MQe.Msg_Style
If this field is missing from the message, then a value of MQe.Msg_Style_Datagram
is assumed.
MQe field name: MQe.Msg_ExpireTime
If this field is missing from the message, then a value of DEF_EXPIRY
is assumed.
MQe field name: FIELD_NAME_MQ_FEEDBACK
If this field is missing from the message, then a value of DEF_FEEDBACK
is assumed.
MQe field name: FIELD_NAME_MQ_CHARACTER_SET
If this field is missing from the message, then a value of DEF_CHARACTER_SET
is assumed.
MQe field name: FIELD_NAME_MQ_ENCODING
If this field is missing from the message, then a value of DEF_ENCODING
is assumed.
MQe field name: FIELD_NAME_MQ_FORMAT
The field is encoded as an Ascii string. Normally 8 characters long.
If this field is missing from the message, then a value of DEF_FORMAT
is assumed.
MQe field name: FIELD_NAME_MQ_PERSISTENCE
This is an integer field.
If this field is missing then a value of DEF_PERSISTENCE
is assumed.
MQe 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.
MQe field name: FIELD_NAME_MQ_USER_ID
The field is an ASCII field, usually of length 12 to match that used by MQSeries.
If this field is missing then a value of DEF_USER_ID
is assumed.
MQe field name: FIELD_NAME_MQ_ACCONTING_TOKEN
The field is of type byte array.
If this field is missing, then a value of DEF_ACCOUNTING_TOKEN
is assumed.
MQe field name: FIELD_NAME_MQ_APP_ID_DATA
This is a an Ascii string field.
If this field is missing, then a value of DEF_APPLICATION_ID_DATA
is assumed.
MQe 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.
MQe field name: FIELD_NAME_MQ_PUT_APP_NAME
This is an Ascii string field.
If this field is missing from the message, then a value of DEF_PUT_APPLICATION_NAME
is assumed.
MQe 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.
MQe 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.
MQe field name: FIELD_NAME_MQ_APP_ORIG_DATA
This is a Unicode field.
If this field is missing from the message, then a default value of DEF_APPLICATION_ORIGIN_DATA
is assumed.
MQe 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.
MQe 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.
MQe 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.
MQe 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 specified
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
specified explicitly in the message. |
static byte[] |
DEF_CORRELATION_ID
The default value used for the MQe.Msg_CorrelID field if it has not been
specified. |
static int |
DEF_ENCODING
The default encoding assumed if no encoding is explicitly set in the message. |
static int |
DEF_EXPIRY
The default expiry time used if none is set in the message explicitly. |
static int |
DEF_FEEDBACK
The default feedback options used if none are set explicitly in the message. |
static java.lang.String |
DEF_FORMAT
The default "format" information assumed if none is explicitly set in the message. |
static byte[] |
DEF_GROUP_ID
The default value used for the FIELD_NAME_MQ_GROUP_ID field if it has not been specified
explicitly 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 explicitly. |
static byte[] |
DEF_MESSAGE_ID
The default value used for the MQe.Msg_MsgID field if it has not been specified. |
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 unless the FIELD_NAME_MQ_OFFSET field is set. |
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 in the message. |
static int |
DEF_PRIORITY
The default value used for the MQe.Msg_Priority field if it has not been specified. |
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
specified 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
specified. |
static int |
DEF_REPORT
The default value used for reporting options. |
static int |
DEF_SEQUENCE_NUMBER
The default sequence number used if the FIELD_NAME_MQ_MSG_SEQUENCE_NUM field is not
in the mesage. |
static java.lang.String |
DEF_USER_ID
|
static java.lang.String |
FIELD_NAME_MQ_ACCONTING_TOKEN
The name of an optional byte array field used to hold the accounting token associated with this message, as defined in the MQSeries reference material. |
static java.lang.String |
FIELD_NAME_MQ_APP_ID_DATA
The name of an optional Ascii 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 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 MQSeries 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 Ascii string field used to indicate the format of the message data, as defined by the MQSeries 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 MQSeries 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 MQSeries 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 MQSeries 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 MQSeries 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 MQSeries reference manuals. |
static java.lang.String |
FIELD_NAME_MQ_PUT_APP_NAME
The name of an optional Ascii 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 MQSeries system. |
static java.lang.String |
FIELD_NAME_MQ_USER_ID
The name of an optional Ascii field used to hold the name of the user who generated the message, as defined in the MQSeries 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 taking the MQeMsgObject as an argument. |
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 from the message header. |
java.lang.String |
getApplicationIdData()
Gets the application ID data from the message header. |
java.lang.String |
getApplicationOriginData()
Gets the application origin data from the message header. |
int |
getBackoutCount()
Gets the backout count from the message header. |
int |
getCharacterSet()
Gets the coded character-set identifier from the message header. |
byte[] |
getCorrelationId()
Gets the Correlation Id from the message header. |
byte[] |
getData()
Gets the message data. |
int |
getEncoding()
Gets the encoding value from the message header. |
int |
getExpiry()
Gets the expiry value from the message header. |
int |
getFeedback()
Gets the feedback value from the message header. |
java.lang.String |
getFormat()
Gets the format value from the message header. |
byte[] |
getGroupId()
Gets the value of the group ID from the message header. |
int |
getMessageFlags()
Gets the value of the message flags from the message header. |
byte[] |
getMessageId()
Gets the message ID from the message header. |
int |
getMessageSequenceNumber()
Gets the message sequence number from the message header. |
int |
getMessageType()
Gets the message type from the message header. |
int |
getOffset()
Gets the value of the offset from the message header. |
int |
getOriginalLength()
Gets the original length from the message header. |
int |
getPersistence()
Gets the persistence value from the message header. |
int |
getPriority()
Gets the priority from the message header. |
java.lang.String |
getPutApplicationName()
Gets the put application name from the message header. |
int |
getPutApplicationType()
Gets the put application type from the message header. |
java.util.Calendar |
getPutDateTime()
Gets the put date and time from the message header. |
java.lang.String |
getReplyToQueueManagerName()
Gets the reply-to queue manager name from the message header. |
java.lang.String |
getReplyToQueueName()
Gets the reply-to queue name from the message header. |
int |
getReport()
Gets the report value from the message header. |
java.lang.String |
getUserId()
Gets the user ID from the message header. |
void |
setAccountingToken(byte[] accountingToken)
Sets the value of the accounting token in the message header. |
void |
setApplicationIdData(java.lang.String applicationIdData)
Sets the application ID data in the message header. |
void |
setApplicationOriginData(java.lang.String applicationOriginData)
Sets the application origin data in the message header. |
void |
setBackoutCount(int backoutCount)
Sets the backout count in the message header. |
void |
setCharacterSet(int characterSet)
Sets the coded character-set identifier in the message header. |
void |
setCorrelationId(byte[] correlationId)
Sets the correlation ID in the message header. |
void |
setData(byte[] data)
Sets the message data. |
void |
setEncoding(int encoding)
Sets the encoding value in the message header. |
void |
setExpiry(int expiry)
Sets the expiry value in the message header. |
void |
setFeedback(int feedback)
Sets the feedback value in the message header. |
void |
setFormat(java.lang.String format)
Sets the format value in the message header. |
void |
setGroupId(byte[] groupId)
Sets the value of the group ID in the message header. |
void |
setMessageFlags(int flags)
Sets the value of the message flags in the message header. |
void |
setMessageId(byte[] messageId)
Sets the message ID in the message header. |
void |
setMessageSequenceNumber(int seqNo)
Sets the message sequence number in the message header. |
void |
setMessageType(int messageType)
Sets the message type in the message header. |
void |
setOffset(int offset)
Sets the value of the offset in the message header. |
void |
setOriginalLength(int len)
Sets the original length in the message header. |
void |
setPersistence(int persistence)
Sets the persistence value in the message header. |
void |
setPriority(int priority)
Sets the priority in the message header. |
void |
setPutApplicationName(java.lang.String putApplicationName)
Sets the put application name in the message header. |
void |
setPutApplicationType(int putApplicationType)
Sets the put application type in the message header. |
void |
setPutDateTime(java.util.Calendar calendar)
Sets the put date and time in the message header. |
void |
setReplyToQueueManagerName(java.lang.String replyToQMName)
Sets the reply-to queue manager name in the message header. |
void |
setReplyToQueueName(java.lang.String replyToQueueName)
Sets the reply-to queue Name in the message header. |
void |
setReport(int report)
Sets the report value in the message header. |
void |
setUserId(java.lang.String userId)
Sets the user ID in the message header. |
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 explicitly.
public static final int DEF_SEQUENCE_NUMBER
FIELD_NAME_MQ_MSG_SEQUENCE_NUM
field is not
in the mesage.
public static final int DEF_OFFSET
FIELD_NAME_MQ_OFFSET
field is set.
public static final int DEF_REPORT
FIELD_NAME_MQ_REPORT
field is not in the message.
public static final int DEF_MESSAGE_TYPE
MQe.Msg_Style
field is not 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 specified.
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 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 specified.
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
specified.
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 specified
in the message.
public static final java.lang.String DEF_REPLY_TO_QUEUE_NAME
MQe.Msg_ReplyToQ
field if it has not been
specified.
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
specified 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 it has not been specified
explicitly in the message.
public static final int DEF_CHARACTER_SET
FIELD_NAME_MQ_CHARACTER_SET
field if it has not been
specified explicitly in the message.
Indicates a unicode character set.
public static final java.lang.String FIELD_NAME_MQ_REPORT
See the MQSeries programming reference for more detial of the available reporting options. Note that this field is not used by the MQe 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
See the MQSeries 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
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
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
The field is encoded as an Ascii string. 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
MQe does not use this field, it has an effect only when the message is being conveyed to, from or over an MQSeries 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
MQe does not use this field, it has an effect only when the message is being conveyed to, from or over an MQSeries 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
The field is an ASCII field, usually of length 12 to match that used by MQSeries.
If this field is missing then a value of DEF_USER_ID
is assumed.
public static final java.lang.String FIELD_NAME_MQ_ACCONTING_TOKEN
The field is of type byte array.
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
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
The values of this field are defined by the MQSeries 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
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
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
Milliseconds since 1 jan 1970.
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.
public static final java.lang.String FIELD_NAME_MQ_DATA
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
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
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
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
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
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
This creates a new MQeMQMsgObject.
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 taking the MQeMsgObject as an argument.
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 from the message header.
This method returns the value of the Report header field.
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 from the message header.
This method returns the value of the MsgType header field.
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 from the message header.
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 from the message header.
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 from the message header.
This method returns the value of the Encoding header field.
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 the coded character-set identifier from the message header.
This method returns the value of the CodedCharSetId header field.
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 format value from the message header.
This method returns the value of the Format header field.
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 from the message header.
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 from the message header.
This method returns the value of the Persistence header field.
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 message ID from the message header.
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 Correlation Id from the message header.
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 the backout count from the message header.
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 from the message header.
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 from the message header.
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 user ID from the message header.
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 from the message header.
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 application ID data from the message header.
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 from the message header.
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 from the message header.
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 application origin data from the message header.
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 from the message header.
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 from the message header.
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 message sequence number from the message header.
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 from the message header.
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 from the message header.
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 from the message header.
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 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 in the message header.
This method sets the value of the Report header field in the Websphere MQ style message.
report
- An integer containing the value to be set in the report field.
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 in the message header.
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
- An integer containing the value to be set in the
message type field.
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 in the message header.
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 in the message header.
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 in the message header.
This method sets the value of the Encoding header field in the Websphere MQ style message.
encoding
- An integer containing the value to be set in the encoding field.
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 coded character-set identifier in the message header.
This method sets the value of the CodedCharSetId header field in the Websphere MQ style message.
characterSet
- An integer containing the value to be set in the
coded character set identifier field.
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 in the message header.
This method sets the value of the Format header field in the Websphere MQ style message.
format
- A String containing the value to be set in the format field.
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 in the message header.
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 in the message header.
This method sets the value of the Persistence header field in the Websphere MQ style message.
persistence
- An integer containing the value to be set in the persistence
field.
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 message ID in the message header.
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 correlation ID in the message header.
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 backout count in the message header.
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 in the message header.
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 in the message header.
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 user ID in the message header.
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 in the message header.
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 in the message header.
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 in the message header.
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 in the message header.
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 in the message header.
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 in the message header.
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 in the message header.
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 message sequence number in the message header.
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 in the message header.
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 in the message header.
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 original length in the message header.
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 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.
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 |