Package com.ibm.mq

Class MQMessage

java.lang.Object
com.ibm.mq.jmqi.JmqiObject
com.ibm.mq.MQMD
com.ibm.mq.MQMessage
All Implemented Interfaces:
DataInput, DataOutput

public class MQMessage extends MQMD implements DataInput, DataOutput
MQMessage represents both the message descriptor and the data for an IBM MQ message. It has a group of methods for reading data from a message and a group of methods for writing data into a message. The format of numbers and strings used by these read and write methods is controlled by the encodingand characterSet fields. The remaining fields contain control information that accompanies the application message data when a message travels between sending and receiving applications.
  • Constructor Details

    • MQMessage

      public MQMessage()
      The default constructor. This creates a message with default message descriptor information and an empty message buffer.
  • Method Details

    • getTotalMessageLength

      public int getTotalMessageLength()
      Gets the total number of bytes in the message as stored on the message queue on which this message was held. This method reports the total size of the message on the queue when an MQQueue.get()method fails with an error code that indicates that the message has been truncated.
      Returns:
      the total number of bytes in the message
    • getMessageLength

      public int getMessageLength() throws IOException
      Gets the number of bytes of message data in this message.
      Returns:
      the number of bytes.
      Throws:
      IOException - if there is a problem with IO.
    • getDataLength

      public int getDataLength() throws IOException
      Gets the number of bytes of message data remaining to be read.
      Returns:
      int the number of bytes remaining
      Throws:
      IOException - if there is a problem with IO.
    • seek

      public void seek(int seekOffset) throws EOFException
      Moves the cursor to a new absolute position in the message buffer. Subsequent reads and writes will start from this position in the buffer.
      Parameters:
      seekOffset - the new value of the cursor position.
      Throws:
      EOFException - if offset takes cursor outside the message data.
    • setDataOffset

      public void setDataOffset(int offset) throws EOFException
      Moves the cursor to a new absolute position in the message buffer. This method is identical to seek(), and is provided for cross-language compatibility with the other WMQ APIs.
      Parameters:
      offset - the new value of the cursor position.
      Throws:
      EOFException - if offset takes cursor outside the message data.
    • getDataOffset

      public int getDataOffset() throws IOException
      Returns the current cursor position within the message data (the point at which read and write operations take effect).
      Returns:
      the cursor position.
      Throws:
      IOException - if there is a problem with IO.
    • clearMessage

      public void clearMessage() throws IOException
      Discards any data in the message buffer and sets the cursor position to zero.
      Throws:
      IOException - if there is a problem with IO.
    • resizeBuffer

      public void resizeBuffer(int size) throws IOException
      Indicates to the MQMessage class the size of buffer that might be required. If the message currently contains message data and the new size is less than the current size, the message data is truncated. If this message is subsequently used with MQQueue.get(MQMessage, MQGetMessageOptions) , then this is the size of buffer allocated for the get request.
      Parameters:
      size - the new size of the buffer
      Throws:
      IOException - if there is a problem with IO.
    • readBoolean

      public boolean readBoolean() throws IOException, EOFException
      Reads a boolean from the current position in the message buffer.
      Specified by:
      readBoolean in interface DataInput
      Returns:
      the boolean.
      Throws:
      IOException - if there is a problem with IO.
      EOFException - if the read goes beyond the end of file.
    • readByte

      public byte readByte() throws IOException, EOFException
      Reads a byte from the current position in the message buffer.
      Specified by:
      readByte in interface DataInput
      Returns:
      the (signed) byte.
      Throws:
      IOException - if there is a problem with IO.
      EOFException - if the read goes beyond the end of file.
    • readChar

      public char readChar() throws IOException, EOFException
      Reads a character from the current position in the message buffer.
      Specified by:
      readChar in interface DataInput
      Returns:
      the Unicode character.
      Throws:
      IOException - if there is a problem with IO.
      EOFException - if the read goes beyond the end of file.
    • readDouble

      public double readDouble() throws IOException, EOFException
      Reads a double from the current position in the message buffer.
      Specified by:
      readDouble in interface DataInput
      Returns:
      a big-endian double if encodingis equal to MQConstants.MQENC_INTEGER_NORMAL, or a little-endian double if it is equal to MQConstants.MQENC_INTEGER_REVERSED.
      Throws:
      IOException - if encoding is not equal to either of these values.
      EOFException - if the read goes beyond the end of file.
    • readFloat

      public float readFloat() throws IOException, EOFException
      Reads a float from the current position in the message buffer.
      Specified by:
      readFloat in interface DataInput
      Returns:
      a big-endian float if encodingequals MQConstants.MQENC_INTEGER_NORMAL, a little-endian float if it equals MQConstants.MQENC_INTEGER_REVERSED, or a zSeries format floating point number if it equals MQConstants.MQENC_FLOAT_S390.
      Throws:
      IOException - if encoding is none of these.
      EOFException - if the read goes beyond the end of file.
    • readFully

      public void readFully(byte[] b) throws IOException
      Fills a byte array with data from the message buffer.
      Specified by:
      readFully in interface DataInput
      Parameters:
      b - the byte array.
      Throws:
      IOException - if there is a problem with IO.
    • readFully

      public void readFully(byte[] b, int off, int len) throws IOException
      Partly fills a byte array with data from the message buffer.
      Specified by:
      readFully in interface DataInput
      Parameters:
      b - the byte array.
      off - the offset into the message buffer where the reading starts.
      len - the number of bytes to be read.
      Throws:
      IOException - if there is a problem with IO.
    • readStringOfByteLength

      public String readStringOfByteLength(int numberOfBytes) throws IOException, EOFException
      Reads a specified number of bytes and uses them to construct a new string using the character set specified by characterSet. When the given bytes are not valid in the given charset, the behavior of this method is dependant on the implementation of the JRE.

      Where the byte length of a string is known, the entire String should be read in a single invocation of this method, thus avoiding problems where byte and char boundaries do not coincide.

      Parameters:
      numberOfBytes - The number of bytes to read.
      Returns:
      the string.
      Throws:
      IOException - if there is a problem with IO.
      EOFException - if the read goes beyond the end of file.
    • readStringOfCharLength

      public String readStringOfCharLength(int numberOfChars) throws IOException, EOFException
      Reads a string in the codeset identified by characterSetand converts it into Unicode.
      Parameters:
      numberOfChars - The number of characters to read (which might differ from the number of bytes according to the codeset, because some codesets use more than one byte per character).
      Returns:
      the string.
      Throws:
      IOException - if there is a problem with IO.
      EOFException - if the read goes beyond the end of file.
    • readInt

      public int readInt() throws IOException
      Reads an integer from the current position in the message buffer.
      Specified by:
      readInt in interface DataInput
      Returns:
      a big-endian integer if encodingis equal to MQConstants.MQENC_INTEGER_NORMAL, or a little-endian integer if it is equal to MQConstants.MQENC_INTEGER_REVERSED.
      Throws:
      IOException - if there is a problem with IO.
    • readInt4

      public int readInt4() throws IOException
      Synonym for readInt(), provided for cross-language WMQ API compatibility.
      Returns:
      int The integer read
      Throws:
      IOException - if there is a problem with IO.
    • readLine

      public String readLine() throws IOException
      Reads a line of text from the message. Converts from the codeset identified in characterSet, and then reads in a line that has been terminated by \n, \r, \r\n, EOF or the end of a UTF string.
      Specified by:
      readLine in interface DataInput
      Returns:
      the returned string, in Unicode.
      Throws:
      IOException - if there is a problem with IO.
    • readLong

      public long readLong() throws IOException
      Reads an integer from the current position in the message buffer.
      Specified by:
      readLong in interface DataInput
      Returns:
      a big-endian long if encodingis equal to MQConstants.MQENC_INTEGER_NORMAL, or a little-endian long if it is equal to MQConstants.MQENC_INTEGER_REVERSED.
      Throws:
      IOException - if encoding is not equal to either of these values.
    • readInt8

      public long readInt8() throws IOException
      Identical to readLong(). Provided for cross-language WMQ API compatibility.
      Returns:
      a big-endian long if encodingis equal to MQConstants.MQENC_INTEGER_NORMAL, or a little-endian long if it is equal to MQConstants.MQENC_INTEGER_REVERSED.
      Throws:
      IOException - if encoding is not equal to either of these values.
    • readShort

      public short readShort() throws IOException
      Reads a short from the current position in the message buffer.
      Specified by:
      readShort in interface DataInput
      Returns:
      a big-endian short if encodingis equal to MQConstants.MQENC_INTEGER_NORMAL, or a little-endian short if it is equal to MQConstants.MQENC_INTEGER_REVERSED.
      Throws:
      IOException - if encoding is not equal to either of these values.
    • readInt2

      public short readInt2() throws IOException
      Identical to readShort(). Provided for cross-language MQ API compatibility.
      Returns:
      a big-endian short if encodingis equal to MQConstants.MQENC_INTEGER_NORMAL, or a little-endian short if it is equal to MQConstants.MQENC_INTEGER_REVERSED.
      Throws:
      IOException - if there is a problem with IO.
    • readUTF

      public String readUTF() throws IOException
      Reads a UTF format String from the current position in the message buffer.
      Specified by:
      readUTF in interface DataInput
      Returns:
      the String.
      Throws:
      IOException - if there is a problem with IO.
    • readUnsignedByte

      public int readUnsignedByte() throws IOException
      Reads an unsigned byte from the current position in the message buffer.
      Specified by:
      readUnsignedByte in interface DataInput
      Returns:
      an int that contains the value.
      Throws:
      IOException - if there is a problem with IO.
    • readUnsignedShort

      public int readUnsignedShort() throws IOException
      Reads an unsigned short from the current position in the message buffer.
      Specified by:
      readUnsignedShort in interface DataInput
      Returns:
      an int that contains a big-endian short if encodingis equal to MQConstants.MQENC_INTEGER_NORMAL, or a little-endian short if it is equal to MQConstants.MQENC_INTEGER_REVERSED.
      Throws:
      IOException - if encoding is not equal to either of these values.
    • readUInt2

      public int readUInt2() throws IOException
      Identical to readUnsignedShort(), provided for cross-language WMQ API compatibility.
      Returns:
      an int that contains a big-endian short if encodingis equal to MQConstants.MQENC_INTEGER_NORMAL, or a little-endian short if it is equal to MQConstants.MQENC_INTEGER_REVERSED.
      Throws:
      IOException - if there is a problem with IO.
    • readString

      public String readString(int length) throws IOException
      Deprecated.
      use readStringOfCharLength(int)method instead.
      Reads a string in the codeset identified by characterSetand converts it into Unicode.
      Parameters:
      length - The number of characters to read (which might differ from the number of bytes according to the codeset, since some codesets use more than one byte per character).
      Returns:
      a String in the appropriate codeset
      Throws:
      IOException
    • readDecimal2

      public short readDecimal2() throws IOException
      Reads a 2-byte packed decimal number in the range -999 to 999.
      Returns:
      a big-endian short if encodingequals MQConstants.MQENC_DECIMAL_NORMAL or a little-endian short if it equals MQConstants.MQENC_DECIMAL_REVERSED.
      Throws:
      IOException - if there is a problem with IO.
    • readDecimal4

      public int readDecimal4() throws IOException
      Reads a 4-byte packed decimal number in the range -9,999,999 to 9,999,999.
      Returns:
      a big-endian int if encodingequals MQConstants.MQENC_DECIMAL_NORMAL or a little-endian int if it equals MQConstants.MQENC_DECIMAL_REVERSED.
      Throws:
      IOException - if there is a problem with IO.
    • readDecimal8

      public long readDecimal8() throws IOException
      Reads an 8-byte packed decimal number in the range -999,999,999,999,999 to 999,999,999,999,999.
      Returns:
      a big-endian long if encodingequals MQConstants.MQENC_DECIMAL_NORMAL or a little-endian long if it equals MQConstants.MQENC_DECIMAL_REVERSED.
      Throws:
      IOException - if there is a problem with IO.
    • readObject

      Reads an object carried in the message.
      Returns:
      the Object.
      Throws:
      ClassNotFoundException
      InvalidClassException
      StreamCorruptedException
      OptionalDataException
      IOException
    • skipBytes

      public int skipBytes(int n) throws IOException, EOFException
      Moves the cursor forward in the message buffer.
      Specified by:
      skipBytes in interface DataInput
      Parameters:
      n - the number of bytes to move.
      Returns:
      the number of bytes actually moved.
      Throws:
      IOException - if there is a problem with IO.
      EOFException - if the skip goes beyond the end of file.
    • write

      public void write(int b) throws IOException
      Writes a byte into the message buffer at the current position.
      Specified by:
      write in interface DataOutput
      Parameters:
      b - the byte to be written
      Throws:
      IOException - if there is a problem with IO.
    • write

      public void write(byte[] b) throws IOException
      Writes an array of bytes into the message buffer at the current position.
      Specified by:
      write in interface DataOutput
      Parameters:
      b - the array to be written.
      Throws:
      IOException - if there is a problem with IO.
    • write

      public void write(byte[] b, int off, int len) throws IOException
      Writes a series of bytes into the message buffer at the current position.
      Specified by:
      write in interface DataOutput
      Parameters:
      b - the array from which the bytes are written.
      off - the offset to the first byte in the array to be written.
      len - the number of bytes to be written.
      Throws:
      IOException - if there is a problem with IO.
    • writeBoolean

      public void writeBoolean(boolean v) throws IOException
      Writes a boolean into the message buffer at the current position.
      Specified by:
      writeBoolean in interface DataOutput
      Parameters:
      v - the boolean to be written.
      Throws:
      IOException - if there is a problem with IO.
    • writeByte

      public void writeByte(int v) throws IOException
      Writes a byte into the message buffer at the current position.
      Specified by:
      writeByte in interface DataOutput
      Parameters:
      v - the byte to be written.
      Throws:
      IOException - if there is a problem with IO.
    • writeBytes

      public void writeBytes(String s) throws IOException
      Deprecated.
      This implements the DataOutput.writeBytes(String) method which is not a general string writing routine - it writes the low-order bytes from the characters in the String to the Message, discarding the high-order bytes. (In MQ, it is hard to see where behaviour would be desirable, but it is mandatory as MQMessage implements the DataOutput interface.)
      No data conversion is performed by this method. If you wish to write a string to the message with appropriate handling of the character set currently in force, use writeString(String) instead of this method.
      Writes a String as a sequence of bytes into the message buffer at the current position.

      Specified by:
      writeBytes in interface DataOutput
      Parameters:
      s - the String to be written.
      Throws:
      IOException - if there is a problem with IO.
    • writeChar

      public void writeChar(int v) throws IOException
      Writes a Unicode character into the message buffer at the current position.
      Specified by:
      writeChar in interface DataOutput
      Parameters:
      v - the character to be written, expressed as an int.
      Throws:
      IOException - if there is a problem with IO.
    • writeChars

      public void writeChars(String s) throws IOException
      Writes a String as a sequence of Unicode characters into the message buffer at the current position.
      Specified by:
      writeChars in interface DataOutput
      Parameters:
      s - the String to be written.
      Throws:
      IOException - if there is a problem with IO.
    • writeDouble

      public void writeDouble(double v) throws IOException
      Writes a double into the message buffer at the current position. The behavior of this method is determined by encoding.

      Values of MQConstants.MQENC_FLOAT_IEEE_NORMAL and MQENC_IEEE_FLOAT_REVERSED write IEEE standard floats in big-endian and little-endian formats respectively.

      A value of MQConstants.MQENC_FLOAT_S390 writes a zSeries format floating point number. Note that the range of IEEE doubles is greater than the range of zSeries double precision floating point numbers, and that very large numbers cannot be converted.

      Specified by:
      writeDouble in interface DataOutput
      Parameters:
      v - the double to be written.
      Throws:
      IOException - if there is a problem with IO.
    • writeFloat

      public void writeFloat(float v) throws IOException
      Writes a float into the message buffer at the current position. The behavior of this method is determined by encoding.

      Values of MQConstants.MQENC_FLOAT_IEEE_NORMAL and MQENC_IEEE_FLOAT_REVERSED write IEEE standard floats in big-endian and little-endian formats respectively.

      A value of MQConstants.MQENC_FLOAT_S390 writes a zSeries format floating point number. Note that the range of IEEE doubles is greater than the range of zSeries double precision floating point numbers, and that very large numbers cannot be converted.

      Specified by:
      writeFloat in interface DataOutput
      Parameters:
      v - the float to be written.
      Throws:
      IOException - if there is a problem with IO.
    • writeInt

      public void writeInt(int v) throws IOException
      Writes an int into the message buffer at the current position. The behavior of this method is determined by encoding.

      Values of MQConstants.MQENC_INTEGER_NORMAL and MQConstants.MQENC_INTEGER_REVERSED write integers in big-endian and little-endian formats respectively.

      Specified by:
      writeInt in interface DataOutput
      Parameters:
      v - the int to be written.
      Throws:
      IOException - if there is a problem with IO.
    • writeInt4

      public void writeInt4(int v) throws IOException
      Synonym for writeInt(), provided for cross-language WMQ API compatibility.
      Parameters:
      v - the int to be written
      Throws:
      IOException - if there is a problem with IO.
    • writeLong

      public void writeLong(long v) throws IOException
      Writes a long into the message buffer at the current position. The behavior of this method is determined by encoding.

      Values of MQConstants.MQENC_INTEGER_NORMAL and MQConstants.MQENC_INTEGER_REVERSED write longs in big-endian and little-endian formats respectively.

      Specified by:
      writeLong in interface DataOutput
      Parameters:
      v - the long to be written.
      Throws:
      IOException - if there is a problem with IO.
    • writeInt8

      public void writeInt8(long v) throws IOException
      Synonym for writeLong(), provided for cross-language WMQ API compatibility.
      Parameters:
      v - the long to be written
      Throws:
      IOException - if there is a problem with IO.
    • writeShort

      public void writeShort(int v) throws IOException
      Writes a short into the message buffer at the current position. The behavior of this method is determined by encoding.

      Values of MQConstants.MQENC_INTEGER_NORMAL and MQConstants.MQENC_INTEGER_REVERSED write shorts in big-endian and little-endian formats respectively.

      A value of MQConstants.MQENC_FLOAT_S390 writes a zSeries format floating point number.

      Specified by:
      writeShort in interface DataOutput
      Parameters:
      v - the short to be written.
      Throws:
      IOException - if there is a problem with IO.
    • writeInt2

      public void writeInt2(int v) throws IOException
      Identical to writeShort(), provided for cross-language WMQ API compatibility.
      Parameters:
      v - the long to be written.
      Throws:
      IOException - if there is a problem with IO.
    • writeDecimal2

      public void writeDecimal2(short v) throws IOException
      Writes a 2-byte packed decimal format number into the message buffer at the current position. The behavior of this method is determined by encoding. A value of MQConstants.MQENC_DECIMAL_NORMAL writes a big-endian packed decimal and a value of MQConstants.MQENC_DECIMAL_REVERSED writes a little-endian packed decimal.
      Parameters:
      v - is the number to be written in the range -999 to 999.
      Throws:
      IOException - if there is a problem with IO.
    • writeDecimal4

      public void writeDecimal4(int v) throws IOException
      Writes a 4-byte packed decimal format number into the message buffer at the current position. The behavior of this method is determined by encoding. A value of MQConstants.MQENC_DECIMAL_NORMAL writes a big-endian packed decimal and a value of MQConstants.MQENC_DECIMAL_REVERSED writes a little-endian packed decimal.
      Parameters:
      v - is the number to be written in the range -9,999,999 to 9,999,999.
      Throws:
      IOException - if there is a problem with IO.
    • writeDecimal8

      public void writeDecimal8(long v) throws IOException
      Writes an 8-byte packed decimal format number into the message buffer at the current position. The behavior of this method is determined by encoding. A value of MQConstants.MQENC_DECIMAL_NORMAL writes a big-endian packed decimal and a value of MQConstants.MQENC_DECIMAL_REVERSED writes a little-endian packed decimal.
      Parameters:
      v - is the number to be written int the range -999,999,999,999,999 to 999,999,999,999,999.
      Throws:
      IOException - if there is a problem with IO.
    • writeUTF

      public void writeUTF(String str) throws IOException
      Writes a String in UTF format into the message buffer at the current position.
      Specified by:
      writeUTF in interface DataOutput
      Parameters:
      str - the String to be written.
      Throws:
      IOException - if there is a problem with IO.
    • writeString

      public void writeString(String s) throws IOException
      Writes a java.lang.String into the message buffer at the current position, encoding it using the coded character set identified by characterSet.

      If characterSet is set to the default value of MQCCSI_Q_MGR, then the coded character set used to encode the java.lang.String depends on the platform that the application is running on:

      • If the application is running on z/OS, then the java.lang.String will be encoded using coded character set identifier 500.
      • For all other platforms, the java.lang.String will be encoded using coded character set identifier 819.
      Parameters:
      s - the java.lang.String to be written.
      Throws:
      IOException - if there is a problem with IO.
    • writeObject

      public void writeObject(Object obj) throws IOException
      Writes an Object into the message.
      Parameters:
      obj - the Object to be written.
      Throws:
      IOException - if there is a problem with IO.
    • getPropertyValidation

      public int getPropertyValidation()
      Specifies whether validation of properties should take place when a property of the message is set. Possible values are:
      • MQCMHO_DEFAULT_VALIDATION, the default
      • MQCMHO_VALIDATE
      • MQCMHO_NO_VALIDATION
      Returns:
      true if property validation will take place
    • setPropertyValidation

      public void setPropertyValidation(int propertyValidation)
      Specifies whether validation of properties should take place when a property of the message is set. Possible values are:
      • MQCMHO_DEFAULT_VALIDATION, the default
      • MQCMHO_VALIDATE
      • MQCMHO_NO_VALIDATION
      Parameters:
      propertyValidation - set to true if property validation should take place
    • setBooleanProperty

      public void setBooleanProperty(String name, boolean value) throws MQException
      Sets a boolean property value with the specified name into the message, with the default property descriptor.
      Parameters:
      name - the name of the boolean property.
      value - the boolean property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setBooleanProperty

      public void setBooleanProperty(String name, MQPropertyDescriptor descriptor, boolean value) throws MQException
      Sets a boolean property value with the specified name into the message, with the specified property descriptor.
      Parameters:
      name - the name of the boolean property.
      descriptor - the attributes of the property itself.
      value - the boolean property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setBytesProperty

      public void setBytesProperty(String name, byte[] value) throws MQException
      Sets a byte array property value with the specified name into the message, with the default property descriptor.
      Parameters:
      name - the name of the byte array property.
      value - the byte array property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setBytesProperty

      public void setBytesProperty(String name, MQPropertyDescriptor descriptor, byte[] value) throws MQException
      Sets a byte array property value with the specified name into the message, with the specified property descriptor.
      Parameters:
      name - the name of the byte array property.
      descriptor - the attributes of the property itself.
      value - the byte array property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setByteProperty

      public void setByteProperty(String name, byte value) throws MQException
      Sets a byte property value with the specified name into the message, with the default property descriptor.
      Parameters:
      name - the name of the byte property.
      value - the byte property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setByteProperty

      public void setByteProperty(String name, MQPropertyDescriptor descriptor, byte value) throws MQException
      Sets a byte property value with the specified name into the message, with the specified property descriptor.
      Parameters:
      name - the name of the byte property.
      descriptor - the attributes of the property itself.
      value - the byte property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setShortProperty

      public void setShortProperty(String name, short value) throws MQException
      Sets a short property value with the specified name into the message, with the default property descriptor.
      Parameters:
      name - the name of the short property.
      value - the short property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setShortProperty

      public void setShortProperty(String name, MQPropertyDescriptor descriptor, short value) throws MQException
      Sets a short property value with the specified name into the message, with the specified property descriptor.
      Parameters:
      name - the name of the short property.
      descriptor - the attributes of the property itself.
      value - the short property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setInt2Property

      public void setInt2Property(String name, short value) throws MQException
      Synonym for setShortProperty(String, short), provided for cross-language IBM MQ API compatibility.
      Parameters:
      name - the name of the short property.
      value - the short property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setInt2Property

      public void setInt2Property(String name, MQPropertyDescriptor descriptor, short value) throws MQException
      Synonym for setShortProperty(String, MQPropertyDescriptor, short), provided for cross-language IBM MQ API compatibility.
      Parameters:
      name - the name of the short property.
      descriptor - the attributes of the property itself.
      value - the short property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setIntProperty

      public void setIntProperty(String name, int value) throws MQException
      Sets a int property value with the specified name into the message, with the default property descriptor.
      Parameters:
      name - the name of the int property.
      value - the int property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setIntProperty

      public void setIntProperty(String name, MQPropertyDescriptor descriptor, int value) throws MQException
      Sets a int property value with the specified name into the message, with the specified property descriptor.
      Parameters:
      name - the name of the int property.
      descriptor - the attributes of the property itself.
      value - the int property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setInt4Property

      public void setInt4Property(String name, int value) throws MQException
      Synonym for setIntProperty(String, int), provided for cross-language IBM MQ API compatibility.
      Parameters:
      name - the name of the int property.
      value - the int property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setInt4Property

      public void setInt4Property(String name, MQPropertyDescriptor descriptor, int value) throws MQException
      Synonym for setIntProperty(String, MQPropertyDescriptor, int), provided for cross-language IBM MQ API compatibility.
      Parameters:
      name - the name of the int property.
      descriptor - the attributes of the property itself.
      value - the int property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setLongProperty

      public void setLongProperty(String name, long value) throws MQException
      Sets a long property value with the specified name into the message, with the default property descriptor.
      Parameters:
      name - the name of the long property.
      value - the long property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setLongProperty

      public void setLongProperty(String name, MQPropertyDescriptor descriptor, long value) throws MQException
      Sets a long property value with the specified name into the message, with the specified property descriptor.
      Parameters:
      name - the name of the long property.
      descriptor - the attributes of the property itself.
      value - the long property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setInt8Property

      public void setInt8Property(String name, long value) throws MQException
      Synonym for setLongProperty(String, long), provided for cross-language IBM MQ API compatibility.
      Parameters:
      name - the name of the long property.
      value - the long property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setInt8Property

      public void setInt8Property(String name, MQPropertyDescriptor descriptor, long value) throws MQException
      Synonym for setLongProperty(String, MQPropertyDescriptor, long), provided for cross-language IBM MQ API compatibility.
      Parameters:
      name - the name of the long property.
      descriptor - the attributes of the property itself.
      value - the long property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setFloatProperty

      public void setFloatProperty(String name, float value) throws MQException
      Sets a float property value with the specified name into the message, with the default property descriptor.
      Parameters:
      name - the name of the float property.
      value - the float property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setFloatProperty

      public void setFloatProperty(String name, MQPropertyDescriptor descriptor, float value) throws MQException
      Sets a float property value with the specified name into the message, with the specified property descriptor.
      Parameters:
      name - the name of the float property.
      descriptor - the attributes of the property itself.
      value - the float property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setDoubleProperty

      public void setDoubleProperty(String name, double value) throws MQException
      Sets a double property value with the specified name into the message, with the default property descriptor.
      Parameters:
      name - the name of the double property.
      value - the double property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setDoubleProperty

      public void setDoubleProperty(String name, MQPropertyDescriptor descriptor, double value) throws MQException
      Sets a double property value with the specified name into the message, with the specified property descriptor.
      Parameters:
      name - the name of the double property.
      descriptor - the attributes of the property itself.
      value - the double property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setStringProperty

      public void setStringProperty(String name, String value) throws MQException
      Sets a String property value with the specified name into the message, with the default property descriptor.
      Parameters:
      name - the name of the String property.
      value - the String property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setStringProperty

      public void setStringProperty(String name, MQPropertyDescriptor descriptor, String value) throws MQException
      Sets a String property value with the specified name into the message, with the specified property descriptor.
      Parameters:
      name - the name of the String property.
      descriptor - the attributes of the property itself.
      value - the String property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setObjectProperty

      public void setObjectProperty(String name, Object value) throws MQException
      Sets a Java object property value with the specified name into the message, with the default property descriptor. Note that this method works only for the objectified primitive object types (Integer, Double, Long ...) and String objects. The property is set as if the set*Property method had been called directly e.g. Integer leads to an int property value being set, Long leads to a long property value being set etc.
      Parameters:
      name - the name of the Java object property.
      value - the Java object property value to set.
      Throws:
      MQException - if the property name is invalid.
    • setObjectProperty

      public void setObjectProperty(String name, MQPropertyDescriptor descriptor, Object value) throws MQException
      Sets a Java object property value with the specified name into the message, with the specified property descriptor. Note that this method works only for the objectified primitive object types (Integer, Double, Long ...) and String objects. The property is set as if the set*Property method had been called directly e.g. Integer leads to an int property value being set, Long leads to a long property value being set etc.
      Parameters:
      name - the name of the Java object property.
      descriptor - the attributes of the property itself.
      value - the Java object property value to set.
      Throws:
      MQException - if the property name is invalid.
    • getBooleanProperty

      public boolean getBooleanProperty(String name) throws MQException
      Returns the value of the boolean property with the specified name.
      Parameters:
      name - the name of the boolean property.
      Returns:
      the boolean property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getBooleanProperty

      public boolean getBooleanProperty(String name, MQPropertyDescriptor descriptor) throws MQException
      Returns the value of the boolean property with the specified name, filling in the specified property descriptor.
      Parameters:
      name - the name of the boolean property.
      descriptor - the attributes of the property itself.
      Returns:
      the boolean property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getBytesProperty

      public byte[] getBytesProperty(String name) throws MQException
      Returns the value of the byte array property with the specified name.
      Parameters:
      name - the name of the byte array property.
      Returns:
      the byte array property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getBytesProperty

      public byte[] getBytesProperty(String name, MQPropertyDescriptor descriptor) throws MQException
      Returns the value of the byte array property with the specified name, filling in the specified property descriptor.
      Parameters:
      name - the name of the byte array property.
      descriptor - the attributes of the property itself.
      Returns:
      the byte array property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getByteProperty

      public byte getByteProperty(String name) throws MQException
      Returns the value of the byte property with the specified name.
      Parameters:
      name - the name of the byte property.
      Returns:
      the byte property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getByteProperty

      public byte getByteProperty(String name, MQPropertyDescriptor descriptor) throws MQException
      Returns the value of the byte property with the specified name, filling in the specified property descriptor.
      Parameters:
      name - the name of the byte property.
      descriptor - the attributes of the property itself.
      Returns:
      the byte property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getShortProperty

      public short getShortProperty(String name) throws MQException
      Returns the value of the short property with the specified name.
      Parameters:
      name - the name of the short property.
      Returns:
      the short property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getShortProperty

      public short getShortProperty(String name, MQPropertyDescriptor descriptor) throws MQException
      Returns the value of the short property with the specified name, filling in the specified property descriptor.
      Parameters:
      name - the name of the short property.
      descriptor - the attributes of the property itself.
      Returns:
      the short property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getInt2Property

      public short getInt2Property(String name) throws MQException
      Synonym for getShortProperty(String), provided for cross-language IBM MQ API compatibility.
      Parameters:
      name - the name of the short property.
      Returns:
      the short property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getInt2Property

      public short getInt2Property(String name, MQPropertyDescriptor descriptor) throws MQException
      Synonym for getShortProperty(String, MQPropertyDescriptor), provided for cross-language IBM MQ API compatibility.
      Parameters:
      name - the name of the short property.
      descriptor - the attributes of the property itself.
      Returns:
      the short property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getIntProperty

      public int getIntProperty(String name) throws MQException
      Returns the value of the int property with the specified name.
      Parameters:
      name - the name of the int property.
      Returns:
      the int property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getIntProperty

      public int getIntProperty(String name, MQPropertyDescriptor descriptor) throws MQException
      Returns the value of the int property with the specified name, filling in the specified property descriptor.
      Parameters:
      name - the name of the int property.
      descriptor - the attributes of the property itself.
      Returns:
      the int property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getInt4Property

      public int getInt4Property(String name) throws MQException
      Synonym for getIntProperty(String), provided for cross-language IBM MQ API compatibility.
      Parameters:
      name - the name of the int property.
      Returns:
      the int property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getInt4Property

      public int getInt4Property(String name, MQPropertyDescriptor descriptor) throws MQException
      Synonym for getIntProperty(String, MQPropertyDescriptor), provided for cross-language IBM MQ API compatibility.
      Parameters:
      name - the name of the int property.
      descriptor - the attributes of the property itself.
      Returns:
      the int property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getLongProperty

      public long getLongProperty(String name) throws MQException
      Returns the value of the long property with the specified name.
      Parameters:
      name - the name of the long property.
      Returns:
      the long property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getLongProperty

      public long getLongProperty(String name, MQPropertyDescriptor descriptor) throws MQException
      Returns the value of the long property with the specified name, filling in the specified property descriptor.
      Parameters:
      name - the name of the long property.
      descriptor - the attributes of the property itself.
      Returns:
      the long property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getInt8Property

      public long getInt8Property(String name) throws MQException
      Synonym for getLongProperty(String), provided for cross-language IBM MQ API compatibility.
      Parameters:
      name - the name of the long property.
      Returns:
      the long property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getInt8Property

      public long getInt8Property(String name, MQPropertyDescriptor descriptor) throws MQException
      Synonym for getLongProperty(String, MQPropertyDescriptor), provided for cross-language IBM MQ API compatibility.
      Parameters:
      name - the name of the long property.
      descriptor - the attributes of the property itself.
      Returns:
      the long property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getFloatProperty

      public float getFloatProperty(String name) throws MQException
      Returns the value of the float property with the specified name.
      Parameters:
      name - the name of the float property.
      Returns:
      the float property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getFloatProperty

      public float getFloatProperty(String name, MQPropertyDescriptor descriptor) throws MQException
      Returns the value of the float property with the specified name, filling in the specified property descriptor.
      Parameters:
      name - the name of the float property.
      descriptor - the attributes of the property itself.
      Returns:
      the float property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getDoubleProperty

      public double getDoubleProperty(String name) throws MQException
      Returns the value of the double property with the specified name.
      Parameters:
      name - the name of the double property.
      Returns:
      the double property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getDoubleProperty

      public double getDoubleProperty(String name, MQPropertyDescriptor descriptor) throws MQException
      Returns the value of the double property with the specified name, filling in the specified property descriptor.
      Parameters:
      name - the name of the double property.
      descriptor - the attributes of the property itself.
      Returns:
      the double property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getStringProperty

      public String getStringProperty(String name) throws MQException
      Returns the value of the String property with the specified name.
      Parameters:
      name - the name of the String property.
      Returns:
      the String property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getStringProperty

      public String getStringProperty(String name, MQPropertyDescriptor descriptor) throws MQException
      Returns the value of the String property with the specified name, filling in the specified property descriptor.
      Parameters:
      name - the name of the String property.
      descriptor - the attributes of the property itself.
      Returns:
      the String property value for the specified name; if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist or the type conversion is invalid.
    • getObjectProperty

      public Object getObjectProperty(String name) throws MQException
      Returns the value of the Java object property with the specified name. This method can be used to return, in objectified format, an object that has been stored as a property in the message with the equivalent setObjectProperty(String, Object) method call, or its equivalent primitive #set*Property method.
      Parameters:
      name - the name of the Java object property.
      Returns:
      the Java object property value for the specified name, in objectified format (for example, if the property was set as an int, an Integer is returned); if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist
    • getObjectProperty

      public Object getObjectProperty(String name, MQPropertyDescriptor descriptor) throws MQException
      Returns the value of the Java object property with the specified name, filling in the specified property descriptor. This method can be used to return, in objectified format, an object that has been stored as a property in the message with the equivalent setObjectProperty(String, Object) method call, or its equivalent primitive #set*Property method.
      Parameters:
      name - the name of the Java object property.
      descriptor - the attributes of the property itself.
      Returns:
      the Java object property value for the specified name, in objectified format (for example, if the property was set as an int, an Integer is returned); if there is no property by this name, an MQException is thrown.
      Throws:
      MQException - if property does not exist
    • getPropertyNames

      public Enumeration<String> getPropertyNames(String nameP) throws MQException
      Returns an Enumeration of all the property names matching the specified name. The wildcard character "%" can be used at the end of the name to filter the properties of the message, matching on zero or more characters, including the "." character.
      Parameters:
      nameP - the name of the property to match on.
      Returns:
      an enumeration of all the names of property values where the property name matches the specified name.
      Throws:
      MQException - if the property name is invalid.
    • deleteProperty

      public void deleteProperty(String nameP) throws MQException
      Deletes a property with the specified name from the message.
      Parameters:
      nameP - the name of the property to delete.
      Throws:
      MQException - if the property name is invalid or does not exist.