com.ibm.mq.headers

Class MQRFH

  • java.lang.Object
    • com.ibm.mq.jmqi.JmqiObject
      • com.ibm.mq.headers.internal.Header
        • com.ibm.mq.headers.MQRFH
  • All Implemented Interfaces:
    com.ibm.mq.headers.internal.CachingHeader, MQChainable, MQData, MQHeader


    public class MQRFH
    extends com.ibm.mq.headers.internal.Header
    implements com.ibm.mq.headers.internal.CachingHeader, MQChainable
    MQRFH header class.
            struct tagMQRFH {
                    MQCHAR4  StrucId;         /* Structure identifier
                    MQLONG   Version;         /* Structure version number
                    MQLONG   StrucLength;     /* Total length of MQRFH including NameValueString
                    MQLONG   Encoding;        /* Numeric encoding of data that follows NameValueString
                    MQLONG   CodedCharSetId;  /* Character set identifier of data that follows NameValueString
                    MQCHAR8  Format;          /* Format name of data that follows NameValueString
                    MQLONG   Flags;           /* Flags
            };
     
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static interface  MQRFH.NameValuePair 
    • Field Summary

      • 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
      • Fields inherited from interface com.ibm.mq.headers.internal.CachingHeader

        sccsid
    • Constructor Summary

      Constructors 
      Constructor and Description
      MQRFH()
      Constructs an MQRFH instance with default field values.
      MQRFH(java.io.DataInput message)
      Constructs an MQRFH instance populated from an MQMessage.
      MQRFH(java.io.DataInput message, int encoding, int characterSet)
      Constructs an MQRFH instance populated from a DataInput source.
      MQRFH(java.lang.String nameValueString) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String format() 
      int getCodedCharSetId()
      Get the Character set identifier of data that follows.
      int getEncoding()
      Get the numeric encoding of the data that follows.
      int getFlags()
      get the flags from the RFH header
      java.lang.String getFormat()
      Get the format name of data that follows NameValueString
      java.lang.String getNamedValue(java.lang.String name) 
      java.lang.String getNameValueData()
      get the NameValue data
      java.lang.String getStrucId()
      Get the structure identifier; the value will be MQRFH_STRUC_ID
      int getStrucLength()
      Get the length of the structure.
      int getVersion()
      Get the Structure version number
      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 setCodedCharSetId(int value)
      Set the Character set identifier of data that follows.
      void setEncoding(int value)
      Set the numeric encoding of the data that follows.
      void setFlags(int value)
      set the flags on the RFH header
      void setFormat(java.lang.String value)
      Set the format name of data that follows NameValueString
      void setNameValueString(java.lang.String value)
      set the NameValue data
      int size() 
      • 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, 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
      • Methods inherited from interface com.ibm.mq.headers.internal.CachingHeader

        discardCachedContent, readCachedContent, writeCachedContent
    • Constructor Detail

      • MQRFH

        public MQRFH(java.lang.String nameValueString)
        Parameters:
        nameValueString - Constructs an MQRFH with default values and a NameValueString, which must consist of zero or more whitespace-separated name value pairs. The strucLength field is updated automatically.
      • MQRFH

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

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

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

      • getNamedValue

        public java.lang.String getNamedValue(java.lang.String name)
                                       throws java.io.IOException
        Parameters:
        name -
        Returns:
        the first occurrence of the named value from the NameValueString.
        Throws:
        java.io.IOException
      • size

        public int size()
        Specified by:
        size in interface MQData
        Overrides:
        size in class com.ibm.mq.headers.internal.Header
        Returns:
        the size in bytes occupied by this data element in a message.
        See Also:
        Header.size()
      • getStrucId

        public java.lang.String getStrucId()
        Get the structure identifier; the value will be MQRFH_STRUC_ID
        Returns:
        the structure identifier
      • getVersion

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

        public int getStrucLength()
        Get the length of the structure.
        Returns:
        the structure length.
      • 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. MQCCSI_Q_MGR is not allowable, so we map that to MQCCSI_INHERIT (I think this is the simplest fix)
        Parameters:
        value - the Character set identifier.
      • getFormat

        public java.lang.String getFormat()
        Get the format name of data that follows NameValueString
        Returns:
        the format name
      • setFormat

        public void setFormat(java.lang.String value)
        Set the format name of data that follows NameValueString
        Parameters:
        value - the format name
      • getFlags

        public int getFlags()
        get the flags from the RFH header
        Returns:
        the flags
      • setFlags

        public void setFlags(int value)
        set the flags on the RFH header
        Parameters:
        value - the flags
      • getNameValueData

        public java.lang.String getNameValueData()
        get the NameValue data
        Returns:
        the NameValue data
      • setNameValueString

        public void setNameValueString(java.lang.String value)
        set the NameValue data
        Parameters:
        value - the NameValue data
      • 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()
(c) Copyright IBM Corp. 2008, 2016. All Rights Reserved.