Class MQMD1

java.lang.Object
com.ibm.mq.jmqi.JmqiObject
com.ibm.mq.headers.internal.Header
com.ibm.mq.headers.MQMD1
All Implemented Interfaces:
MQChainable, MQData, MQHeader
Direct Known Subclasses:
MQMD

public class MQMD1 extends com.ibm.mq.headers.internal.Header implements MQChainable
MQMD version 1 (message descriptor) header class. This has a specialized use as the MsgDesc member of an MQXQH (transmission queue) header. Instances of MQMD1 cannot be set to version 2, but an MQMD instance can be created from an MQMD1 instance.

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 tagMQMD {
                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
   }
 
See Also:
  • Nested Class Summary

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

    MQHeader.Field
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    size of an MQMD1 Header in bytes

    Fields inherited from class com.ibm.mq.headers.internal.Header

    DEFAULT_CCSID, DEFAULT_ENCODING, delegate

    Fields inherited from class com.ibm.mq.jmqi.JmqiObject

    COMP_JM, COMP_JN, COMP_JO
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs an MQMD1 instance with default field values.
    MQMD1(DataInput message)
    Constructs an MQMD1 instance populated from an byte stream representing an MQ Message as stored in the queue.
    MQMD1(DataInput message, int encoding, int characterSet)
    Constructs an MQMD1 instance populated from a DataInput source.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    duplicate the content of an MQMD header into this header
    void
    duplicate the content of this header into an MQMD header
     
    byte[]
    gets the Accounting token
    gets the Application data relating to identity
    gets the Application data relating to origin
    int
    gets the Backout counter
    int
    Get the Character set identifier of data that follows.
    byte[]
    gets the Correlation identifier
    int
    Get the numeric encoding of the data that follows.
    int
    gets the Message lifetime
    int
    gets the Feedback or reason code
    gets the Format name of message data
    byte[]
    gets the Message identifier
    int
    gets the Message type
    int
    gets the Message persistence
    int
    get the Message priority
    gets the Name of application that put the message
    int
    gets the Type of application that put the message
    gets the Date when message was put
    long
    gets the Date and Time when message was put
    gets the Time when message was put
    gets the Name of reply queue
    gets the Name of reply queue manager
    int
    gets the Options for report messages
    Get the structure identifier; the value will be MQMD_STRUC_ID
    gets the User identifier
    int
    Get the Structure version number
    boolean
    indicates whether the header has extension content
    int
     
    void
    nextCharacterSet(int value)
    Sets the CCSID of the next header or message content.
    int
     
    void
    nextEncoding(int value)
    Sets the numeric encoding of the next header or message content.
     
    void
    Sets the format of the next header or message content.
    void
    setAccountingToken(byte[] value)
    sets the Accounting token
    void
    sets the Application data relating to identity
    void
    sets the Application data relating to origin
    void
    setBackoutCount(int value)
    sets the Backout counter
    void
    setCodedCharSetId(int value)
    Set the Character set identifier of data that follows.
    void
    setCorrelId(byte[] value)
    sets the Correlation identifier
    void
    setEncoding(int value)
    Set the numeric encoding of the data that follows.
    void
    setExpiry(int value)
    sets the Message lifetime
    void
    setFeedback(int value)
    sets the Feedback or reason code
    void
    sets the Format name of message data
    void
    setMsgId(byte[] value)
    sets the Message identifier
    void
    setMsgType(int value)
    sets the Message type
    void
    setPersistence(int value)
    sets the Message persistence
    void
    setPriority(int value)
    sets the Message priority
    void
    sets the Name of application that put the message
    void
    setPutApplType(int value)
    sets the Type of application that put the message
    void
    sets the Date when message was put
    void
    setPutDateTime(long millis)
    sets the Date and Time when message was put
    void
    sets the Time when message was put
    void
    sets the Name of reply queue
    void
    sets the Name of reply queue manager
    void
    setReport(int value)
    sets the Options for report messages
    void
    sets the User identifier

    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 com.ibm.mq.jmqi.JmqiObject

    getJmqiEnvironment

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • MQMD1

      public MQMD1()
      Constructs an MQMD1 instance with default field values.
    • MQMD1

      public MQMD1(DataInput message) throws MQDataException, IOException
      Constructs an MQMD1 instance populated from an byte stream representing an MQ Message as stored in the queue.

      This is not suitable for application to an MQMessage object - create an empty MQMD1 object and use the copyfrom(com.ibm.mq.MQMD) method in this instance

      Parameters:
      message - the message to read
      Throws:
      MQDataException - if the message content does not yield a valid MQMD1 stucture
      IOException - if there is a problem reading the message content
    • MQMD1

      public MQMD1(DataInput message, int encoding, int characterSet) throws MQDataException, IOException
      Constructs an MQMD1 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 MQMD1 stucture
      IOException - if there is a problem reading the message content
  • Method Details

    • getStrucId

      public String getStrucId()
      Get the structure identifier; the value will be MQMD_STRUC_ID
      Returns:
      the structure identifier
    • getVersion

      public int getVersion()
      Get the Structure version number
      Returns:
      the Structure version number
    • getReport

      public int getReport()
      gets the Options for report messages
      Returns:
      the Options for report messages
    • setReport

      public void setReport(int value)
      sets the Options for report messages
      Parameters:
      value - the Options for report messages
    • getMsgType

      public int getMsgType()
      gets the Message type
      Returns:
      the Message type
    • setMsgType

      public void setMsgType(int value)
      sets the Message type
      Parameters:
      value - the Message type
    • getExpiry

      public int getExpiry()
      gets the Message lifetime
      Returns:
      the Message lifetime
    • setExpiry

      public void setExpiry(int value)
      sets the Message lifetime
      Parameters:
      value - the Message lifetime
    • getFeedback

      public int getFeedback()
      gets the Feedback or reason code
      Returns:
      the Feedback or reason code
    • setFeedback

      public void setFeedback(int value)
      sets the Feedback or reason code
      Parameters:
      value - the Feedback or reason code
    • getEncoding

      public int getEncoding()
      Get the numeric encoding of the data that follows.
      Returns:
      the numeric encoding. A combination of MQENC_* values.
    • setEncoding

      public void setEncoding(int value)
      Set the numeric encoding of the data that follows.
      Parameters:
      value - the numeric encoding. A combination of MQENC_* values.
    • getCodedCharSetId

      public int getCodedCharSetId()
      Get the Character set identifier of data that follows.
      Returns:
      the Character set identifier.
    • setCodedCharSetId

      public void setCodedCharSetId(int value)
      Set the Character set identifier of data that follows.
      Parameters:
      value - the Character set identifier.
    • getFormat

      public String getFormat()
      gets the Format name of message data
      Returns:
      the Format name of message data
    • setFormat

      public void setFormat(String value)
      sets the Format name of message data
      Parameters:
      value - the Format name of message data
    • getPriority

      public int getPriority()
      get the Message priority
      Returns:
      the Message priority
    • setPriority

      public void setPriority(int value)
      sets the Message priority
      Parameters:
      value - the Message priority
    • getPersistence

      public int getPersistence()
      gets the Message persistence
      Returns:
      the Message persistence
    • setPersistence

      public void setPersistence(int value)
      sets the Message persistence
      Parameters:
      value - the Message persistence
    • getMsgId

      public byte[] getMsgId()
      gets the Message identifier
      Returns:
      the Message identifier
    • setMsgId

      public void setMsgId(byte[] value)
      sets the Message identifier
      Parameters:
      value - the Message identifier
    • getCorrelId

      public byte[] getCorrelId()
      gets the Correlation identifier
      Returns:
      the Correlation identifier
    • setCorrelId

      public void setCorrelId(byte[] value)
      sets the Correlation identifier
      Parameters:
      value - the Correlation identifier
    • getBackoutCount

      public int getBackoutCount()
      gets the Backout counter
      Returns:
      the Backout counter
    • setBackoutCount

      public void setBackoutCount(int value)
      sets the Backout counter
      Parameters:
      value - the Backout counter
    • getReplyToQ

      public String getReplyToQ()
      gets the Name of reply queue
      Returns:
      the Name of reply queue
    • setReplyToQ

      public void setReplyToQ(String value)
      sets the Name of reply queue
      Parameters:
      value - the Name of reply queue
    • getReplyToQMgr

      public String getReplyToQMgr()
      gets the Name of reply queue manager
      Returns:
      the Name of reply queue manager
    • setReplyToQMgr

      public void setReplyToQMgr(String value)
      sets the Name of reply queue manager
      Parameters:
      value - the Name of reply queue manager
    • getUserIdentifier

      public String getUserIdentifier()
      gets the User identifier
      Returns:
      the User identifier
    • setUserIdentifier

      public void setUserIdentifier(String value)
      sets the User identifier
      Parameters:
      value - the User identifier
    • getAccountingToken

      public byte[] getAccountingToken()
      gets the Accounting token
      Returns:
      the Accounting token
    • setAccountingToken

      public void setAccountingToken(byte[] value)
      sets the Accounting token
      Parameters:
      value - the Accounting token
    • getApplIdentityData

      public String getApplIdentityData()
      gets the Application data relating to identity
      Returns:
      the Application data relating to identity
    • setApplIdentityData

      public void setApplIdentityData(String value)
      sets the Application data relating to identity
      Parameters:
      value - the Application data relating to identity
    • getPutApplType

      public int getPutApplType()
      gets the Type of application that put the message
      Returns:
      the Type of application that put the message
    • setPutApplType

      public void setPutApplType(int value)
      sets the Type of application that put the message
      Parameters:
      value - the Type of application that put the message
    • getPutApplName

      public String getPutApplName()
      gets the Name of application that put the message
      Returns:
      the Name of application that put the message
    • setPutApplName

      public void setPutApplName(String value)
      sets the Name of application that put the message
      Parameters:
      value - the Name of application that put the message
    • getPutDate

      public String getPutDate()
      gets the Date when message was put
      Returns:
      the Date when message was put
    • setPutDate

      public void setPutDate(String value)
      sets the Date when message was put
      Parameters:
      value - the Date when message was put
    • getPutTime

      public String getPutTime()
      gets the Time when message was put
      Returns:
      the Time when message was put
    • setPutTime

      public void setPutTime(String value)
      sets the Time when message was put
      Parameters:
      value - the Time when message was put
    • getPutDateTime

      public long getPutDateTime()
      gets the Date and Time when message was put
      Returns:
      the Date and Time when message was put, represented as the number of milliseconds since January 1, 1970, 00:00:00 GMT
    • setPutDateTime

      public void setPutDateTime(long millis)
      sets the Date and Time when message was put
      Parameters:
      millis - the Date and Time when message was put, represented as the number of milliseconds since January 1, 1970, 00:00:00 GMT
    • getApplOriginData

      public String getApplOriginData()
      gets the Application data relating to origin
      Returns:
      the Application data relating to origin
    • setApplOriginData

      public void setApplOriginData(String value)
      sets the Application data relating to origin
      Parameters:
      value - the Application data relating to origin
    • nextEncoding

      public int nextEncoding()
      Specified by:
      nextEncoding in interface MQChainable
      Returns:
      the numeric encoding of the next header or message content.
      See Also:
    • nextEncoding

      public void nextEncoding(int value)
      Description copied from interface: MQChainable
      Sets the numeric encoding of the next header or message content.
      Specified by:
      nextEncoding in interface MQChainable
      Parameters:
      value - numeric encoding
      See Also:
    • nextCharacterSet

      public int nextCharacterSet()
      Specified by:
      nextCharacterSet in interface MQChainable
      Returns:
      the CCSID of the next header or message content.
      See Also:
    • nextCharacterSet

      public void nextCharacterSet(int value)
      Description copied from interface: MQChainable
      Sets the CCSID of the next header or message content.
      Specified by:
      nextCharacterSet in interface MQChainable
      Parameters:
      value - character set
      See Also:
    • nextFormat

      public String nextFormat()
      Specified by:
      nextFormat in interface MQChainable
      Returns:
      the format of the next header or message content.
      See Also:
    • nextFormat

      public void nextFormat(String value)
      Description copied from interface: MQChainable
      Sets the format of the next header or message content.
      Specified by:
      nextFormat in interface MQChainable
      Parameters:
      value - format of the header or message content
      See Also:
    • format

      public String format()
      Specified by:
      format in interface MQChainable
      Returns:
      the format associated with this header object or message content.
      See Also:
    • hasExtensionContent

      public boolean hasExtensionContent()
      indicates whether the header has extension content
      Returns:
      true or false as appropriate
    • copyFrom

      public void copyFrom(MQMD md)
      duplicate the content of an MQMD header into this header
      Parameters:
      md - - the header to copy
    • copyTo

      public void copyTo(MQMD md) throws MQDataException
      duplicate the content of this header into an MQMD header
      Parameters:
      md - - the header to copy into
      Throws:
      MQDataException