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
    Description
    static interface 
     

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

    MQHeader.Field
  • 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
    Description
    Constructs an MQRFH instance with default field values.
    MQRFH(DataInput message)
    Constructs an MQRFH instance populated from an MQMessage.
    MQRFH(DataInput message, int encoding, int characterSet)
    Constructs an MQRFH instance populated from a DataInput source.
    MQRFH(String nameValueString)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    int
    Get the Character set identifier of data that follows.
    int
    Get the numeric encoding of the data that follows.
    int
    get the flags from the RFH header
    Get the format name of data that follows NameValueString
     
    get the NameValue data
    Get the structure identifier; the value will be MQRFH_STRUC_ID
    int
    Get the length of the structure.
    int
    Get the Structure version number
    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
    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
    Set the format name of data that follows NameValueString
    void
    set the NameValue data
    int
     

    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 Details

    • MQRFH

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

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

    • getNamedValue

      public String getNamedValue(String name) throws IOException
      Parameters:
      name -
      Returns:
      the first occurrence of the named value from the NameValueString.
      Throws:
      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 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 String getFormat()
      Get the format name of data that follows NameValueString
      Returns:
      the format name
    • setFormat

      public void setFormat(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 String getNameValueData()
      get the NameValue data
      Returns:
      the NameValue data
    • setNameValueString

      public void setNameValueString(String value)
      set the NameValue data
      Parameters:
      value - the NameValue data
    • 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: