com.ibm.mq.headers

Class MQMD

  1. java.lang.Object
  2. extended bycom.ibm.mq.jmqi.JmqiObject
  3. extended bycom.ibm.mq.headers.internal.Header
  4. extended bycom.ibm.mq.headers.MQMD1
  5. extended bycom.ibm.mq.headers.MQMD
All implemented interfaces:
MQChainable, MQData, MQHeader

  1. public class MQMD
  2. extends MQMD1
MQMD (message descriptor) header class. This class represents both version 1 and version 2 MQMD structures. The default version is version 2.

In addition to being able to read or write its content from a message body or byte stream, this class can get or set field values from the MQMD portion of an MQMessage object using the copyFrom or copyTo methods.

   struct tag MQMD {
                MQCHAR4   StrucId;           // Structure identifier
                MQLONG    Version;           // Structure version number
                MQLONG    Report;            // Options for report messages
                MQLONG    MsgType;           // Message type
                MQLONG    Expiry;            // Message lifetime
                MQLONG    Feedback;          // Feedback or reason code
                MQLONG    Encoding;          // Numeric encoding of message data
                MQLONG    CodedCharSetId;    // Character set identifier of message data
                MQCHAR8   Format;            // Format name of message data
                MQLONG    Priority;          // Message priority
                MQLONG    Persistence;       // Message persistence
                MQBYTE24  MsgId;             // Message identifier
                MQBYTE24  CorrelId;          // Correlation identifier
                MQLONG    BackoutCount;      // Backout counter
                MQCHAR48  ReplyToQ;          // Name of reply queue
                MQCHAR48  ReplyToQMgr;       // Name of reply queue manager
                MQCHAR12  UserIdentifier;    // User identifier
                MQBYTE32  AccountingToken;   // Accounting token
                MQCHAR32  ApplIdentityData;  // Application data relating to identity
                MQLONG    PutApplType;       // Type of application that put the message
                MQCHAR28  PutApplName;       // Name of application that put the message
                MQCHAR8   PutDate;           // Date when message was put
                MQCHAR8   PutTime;           // Time when message was put
                MQCHAR4   ApplOriginData;    // Application data relating to origin
 
                MQBYTE24  GroupId;           // Group identifier
                MQLONG    MsgSeqNumber;      // Sequence number of logical message within group
                MQLONG    Offset;            // Offset of data in physical message from start of logical message
                MQLONG    MsgFlags;          // Message flags
                MQLONG    OriginalLength;    // Length of original message
   }
 

Nested Class Summary

Nested classes/interfaces inherited from interface com.ibm.mq.headers.MQHeader
MQHeader.Field

Field Summary

Modifier and Type Field and Description
  1. static
  2. int
SIZE1
Size of a Version 1 MQMD structure in bytes
  1. static
  2. int
SIZE2
Size of a version 2 MQMD structure in bytes
Fields inherited from class com.ibm.mq.headers.MQMD1
SIZE
Fields inherited from class com.ibm.mq.headers.internal.Header
DEFAULT_CCSID, DEFAULT_ENCODING
Fields inherited from class com.ibm.mq.jmqi.JmqiObject
COMP_JM, COMP_JN, COMP_JO

Constructor Summary

Constructor and Description
MQMD()
Constructs an MQMD instance with default field values.
MQMD(java.io.DataInput message)
Constructs an MQMD instance populated from an MQMessage.
MQMD(java.io.DataInput message,int encoding,int characterSet)
Constructs an MQMD instance populated from a DataInput source.
MQMD(int version)
Constructs an MQMD instance of the given version with default field values.
MQMD(MQMD1 md)
Constucts an MQMD populated from the content of an MQMD or MQMD1 instance.

Method Summary

Modifier and Type Method and Description
  1. MQMD
coalesce(MQMDE mde,boolean relink)
Sets the MQMD extension fields in this MQMD from an MQMDE.
  1. void
copyFrom(MQMD md)
  1. void
copyTo(MQMD md)
  1. byte[]
getGroupId()
gets the Group identifier
  1. int
getMsgFlags()
gets the Message flags
  1. int
getMsgSeqNumber()
gets the Sequence number of logical message within group
  1. int
getOffset()
gets the Offset of data in physical message from start of logical message
  1. int
getOriginalLength()
gets the Length of original message
  1. boolean
hasExtensionContent()
Indicates whether the MQMD has Extension Content
  1. void
setGroupId(byte[] value)
sets the Group identifier
  1. void
setMsgFlags(int value)
sets the Message flags
  1. void
setMsgSeqNumber(int value)
sets the Sequence number of logical message within group
  1. void
setOffset(int value)
sets the Offset of data in physical message from start of logical message
  1. void
setOriginalLength(int value)
sets the Length of original message
Methods inherited from class com.ibm.mq.headers.MQMD1
format, getAccountingToken, getApplIdentityData, getApplOriginData, getBackoutCount, getCodedCharSetId, getCorrelId, getEncoding, getExpiry, getFeedback, getFormat, getMsgId, getMsgType, getPersistence, getPriority, getPutApplName, getPutApplType, getPutDate, getPutDateTime, getPutTime, getReplyToQ, getReplyToQMgr, getReport, getStrucId, getUserIdentifier, getVersion, nextCharacterSet, nextCharacterSet, nextEncoding, nextEncoding, nextFormat, nextFormat, setAccountingToken, setApplIdentityData, setApplOriginData, setBackoutCount, setCodedCharSetId, setCorrelId, setEncoding, setExpiry, setFeedback, setFormat, setMsgId, setMsgType, setPersistence, setPriority, setPutApplName, setPutApplType, setPutDate, setPutDateTime, setPutTime, setReplyToQ, setReplyToQMgr, setReport, setUserIdentifier
Methods inherited from class com.ibm.mq.headers.internal.Header
characterSet, encoding, fields, getBytesValue, getCharValue, getCharValue, getIntValue, getJmqiEnv, getStringValue, getValue, headerType, read, read, read, setBytesValue, setCharValue, setCharValue, setIntValue, setStringValue, setValue, size, store, store, toString, type, validate, write, write
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

SIZE1

  1. public static final int SIZE1
Size of a Version 1 MQMD structure in bytes
See Also:

SIZE2

  1. public static final int SIZE2
Size of a version 2 MQMD structure in bytes
See Also:

Constructor Detail

MQMD

  1. public MQMD()
Constructs an MQMD instance with default field values.

MQMD

  1. public MQMD(java.io.DataInput message)
  2. throws MQDataException
  3. java.io.IOException
Constructs an MQMD instance populated from an MQMessage.
Parameters:
message - the message to read
Throws:
MQDataException - if the message content does not yield a valid MQMD stucture
java.io.IOException - if there is a problem reading the message content

MQMD

  1. public MQMD(java.io.DataInput message,
  2. int encoding,
  3. int characterSet)
  4. throws MQDataException
  5. java.io.IOException
Constructs an MQMD instance populated from a DataInput source.
Parameters:
message - the MQMessage or other DataInput source to read
encoding - the initial numeric encoding of the data in the message
characterSet - the initial CCSID of the data in the message
Throws:
MQDataException - if the message content does not yield a valid MQMD stucture
java.io.IOException - if there is a problem reading the message content

MQMD

  1. public MQMD(MQMD1 md)
  2. throws java.io.IOException
Constucts an MQMD populated from the content of an MQMD or MQMD1 instance.
Throws:
java.io.IOException

MQMD

  1. public MQMD(int version)
Constructs an MQMD instance of the given version with default field values.

Method Detail

getGroupId

  1. public byte[] getGroupId()
gets the Group identifier
Returns:
the Group identifier

setGroupId

  1. public void setGroupId(byte[] value)
sets the Group identifier
Parameters:
value - the Group identifier

getMsgSeqNumber

  1. public int getMsgSeqNumber()
gets the Sequence number of logical message within group
Returns:
the Sequence number of logical message within group

setMsgSeqNumber

  1. public void setMsgSeqNumber(int value)
sets the Sequence number of logical message within group
Parameters:
value - the Sequence number of logical message within group

getOffset

  1. public int getOffset()
gets the Offset of data in physical message from start of logical message
Returns:
the Offset of data in physical message from start of logical message

setOffset

  1. public void setOffset(int value)
sets the Offset of data in physical message from start of logical message
Parameters:
value - the Offset of data in physical message from start of logical message

getMsgFlags

  1. public int getMsgFlags()
gets the Message flags
Returns:
the Message flags

setMsgFlags

  1. public void setMsgFlags(int value)
sets the Message flags
Parameters:
value - the Message flags

getOriginalLength

  1. public int getOriginalLength()
gets the Length of original message
Returns:
the Length of original message

setOriginalLength

  1. public void setOriginalLength(int value)
sets the Length of original message
Parameters:
value - the Length of original message

copyFrom

  1. public void copyFrom(MQMD md)
Description copied from class: MQMD1
duplicate the content of an MQMD header into this header
Overrides:
copyFrom in class MQMD1
Parameters:
md - - the header to copy
See Also:

copyTo

  1. public void copyTo(MQMD md)
  2. throws MQDataException
Description copied from class: MQMD1
duplicate the content of this header into an MQMD header
Overrides:
copyTo in class MQMD1
Parameters:
md - - the header to copy into
Throws:
See Also:

coalesce

  1. public MQMD coalesce(MQMDE mde,
  2. boolean relink)
Sets the MQMD extension fields in this MQMD from an MQMDE. If the relink flag is set, the Format, Encoding and CodedCharSetId fields of the MQMD are also replaced with the values from the MQMDE.

hasExtensionContent

  1. public boolean hasExtensionContent( )
Indicates whether the MQMD has Extension Content
Overrides:
Returns:
true or false as appropriate