com.ibm.mq.headers

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:
    MQMD
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int SIZE
      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 and Description
      MQMD1()
      Constructs an MQMD1 instance with default field values.
      MQMD1(java.io.DataInput message)
      Constructs an MQMD1 instance populated from an byte stream representing an MQ Message as stored in the queue.
      MQMD1(java.io.DataInput message, int encoding, int characterSet)
      Constructs an MQMD1 instance populated from a DataInput source.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void copyFrom(MQMD md)
      duplicate the content of an MQMD header into this header
      void copyTo(MQMD md)
      duplicate the content of this header into an MQMD header
      java.lang.String format() 
      byte[] getAccountingToken()
      gets the Accounting token
      java.lang.String getApplIdentityData()
      gets the Application data relating to identity
      java.lang.String getApplOriginData()
      gets the Application data relating to origin
      int getBackoutCount()
      gets the Backout counter
      int getCodedCharSetId()
      Get the Character set identifier of data that follows.
      byte[] getCorrelId()
      gets the Correlation identifier
      int getEncoding()
      Get the numeric encoding of the data that follows.
      int getExpiry()
      gets the Message lifetime
      int getFeedback()
      gets the Feedback or reason code
      java.lang.String getFormat()
      gets the Format name of message data
      byte[] getMsgId()
      gets the Message identifier
      int getMsgType()
      gets the Message type
      int getPersistence()
      gets the Message persistence
      int getPriority()
      get the Message priority
      java.lang.String getPutApplName()
      gets the Name of application that put the message
      int getPutApplType()
      gets the Type of application that put the message
      java.lang.String getPutDate()
      gets the Date when message was put
      long getPutDateTime()
      gets the Date and Time when message was put
      java.lang.String getPutTime()
      gets the Time when message was put
      java.lang.String getReplyToQ()
      gets the Name of reply queue
      java.lang.String getReplyToQMgr()
      gets the Name of reply queue manager
      int getReport()
      gets the Options for report messages
      java.lang.String getStrucId()
      Get the structure identifier; the value will be MQMD_STRUC_ID
      java.lang.String getUserIdentifier()
      gets the User identifier
      int getVersion()
      Get the Structure version number
      boolean hasExtensionContent()
      indicates whether the header has extension content
      int nextCharacterSet() 
      void nextCharacterSet(int value)
      Sets the CCSID of the next header or message content.
      int nextEncoding() 
      void nextEncoding(int value)
      Sets the numeric encoding of the next header or message content.
      java.lang.String nextFormat() 
      void nextFormat(java.lang.String value)
      Sets the format of the next header or message content.
      void setAccountingToken(byte[] value)
      sets the Accounting token
      void setApplIdentityData(java.lang.String value)
      sets the Application data relating to identity
      void setApplOriginData(java.lang.String value)
      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 setFormat(java.lang.String value)
      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 setPutApplName(java.lang.String value)
      sets the Name of application that put the message
      void setPutApplType(int value)
      sets the Type of application that put the message
      void setPutDate(java.lang.String value)
      sets the Date when message was put
      void setPutDateTime(long millis)
      sets the Date and Time when message was put
      void setPutTime(java.lang.String value)
      sets the Time when message was put
      void setReplyToQ(java.lang.String value)
      sets the Name of reply queue
      void setReplyToQMgr(java.lang.String value)
      sets the Name of reply queue manager
      void setReport(int value)
      sets the Options for report messages
      void setUserIdentifier(java.lang.String value)
      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 java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MQMD1

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

        public MQMD1(java.io.DataInput message)
              throws MQDataException,
                     java.io.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
        java.io.IOException - if there is a problem reading the message content
      • MQMD1

        public MQMD1(java.io.DataInput message,
                     int encoding,
                     int characterSet)
              throws MQDataException,
                     java.io.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
        java.io.IOException - if there is a problem reading the message content
    • Method Detail

      • getStrucId

        public java.lang.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 java.lang.String getFormat()
        gets the Format name of message data
        Returns:
        the Format name of message data
      • setFormat

        public void setFormat(java.lang.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 java.lang.String getReplyToQ()
        gets the Name of reply queue
        Returns:
        the Name of reply queue
      • setReplyToQ

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

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

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

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

        public void setUserIdentifier(java.lang.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 java.lang.String getApplIdentityData()
        gets the Application data relating to identity
        Returns:
        the Application data relating to identity
      • setApplIdentityData

        public void setApplIdentityData(java.lang.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 java.lang.String getPutApplName()
        gets the Name of application that put the message
        Returns:
        the Name of application that put the message
      • setPutApplName

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

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

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

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

        public void setPutTime(java.lang.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 java.lang.String getApplOriginData()
        gets the Application data relating to origin
        Returns:
        the Application data relating to origin
      • setApplOriginData

        public void setApplOriginData(java.lang.String value)
        sets the Application data relating to origin
        Parameters:
        value - the Application data relating to origin
      • format

        public java.lang.String format()
        Specified by:
        format in interface MQChainable
        Returns:
        the format associated with this header object or message content.
        See Also:
        MQChainable.format()
      • 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
(c) Copyright IBM Corp. 2008, 2016. All Rights Reserved.