Class MQMessage
- All Implemented Interfaces:
DataInput,DataOutput
encodingand characterSet
fields. The remaining fields contain control information that accompanies the application message
data when a message travels between sending and receiving applications.-
Field Summary
Fields inherited from class com.ibm.mq.MQMD
accountingToken, applicationIdData, applicationOriginData, backoutCount, characterSet, correlationId, encoding, expiry, feedback, format, groupId, messageFlags, messageId, messageSequenceNumber, messageType, offset, originalLength, persistence, priority, putApplicationName, putApplicationType, putDateTime, replyToQueueManagerName, replyToQueueName, report, unmappableAction, unMappableReplacement, userIdFields inherited from class com.ibm.mq.jmqi.JmqiObject
COMP_JM, COMP_JN, COMP_JO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDiscards any data in the message buffer and sets the cursor position to zero.voiddeleteProperty(String nameP) Deletes a property with the specified name from the message.booleangetBooleanProperty(String name) Returns the value of the boolean property with the specified name.booleangetBooleanProperty(String name, MQPropertyDescriptor descriptor) Returns the value of the boolean property with the specified name, filling in the specified property descriptor.bytegetByteProperty(String name) Returns the value of the byte property with the specified name.bytegetByteProperty(String name, MQPropertyDescriptor descriptor) Returns the value of the byte property with the specified name, filling in the specified property descriptor.byte[]getBytesProperty(String name) Returns the value of the byte array property with the specified name.byte[]getBytesProperty(String name, MQPropertyDescriptor descriptor) Returns the value of the byte array property with the specified name, filling in the specified property descriptor.intGets the number of bytes of message data remaining to be read.intReturns the current cursor position within the message data (the point at which read and write operations take effect).doublegetDoubleProperty(String name) Returns the value of the double property with the specified name.doublegetDoubleProperty(String name, MQPropertyDescriptor descriptor) Returns the value of the double property with the specified name, filling in the specified property descriptor.floatgetFloatProperty(String name) Returns the value of the float property with the specified name.floatgetFloatProperty(String name, MQPropertyDescriptor descriptor) Returns the value of the float property with the specified name, filling in the specified property descriptor.shortgetInt2Property(String name) Synonym forgetShortProperty(String), provided for cross-language IBM MQ API compatibility.shortgetInt2Property(String name, MQPropertyDescriptor descriptor) Synonym forgetShortProperty(String, MQPropertyDescriptor), provided for cross-language IBM MQ API compatibility.intgetInt4Property(String name) Synonym forgetIntProperty(String), provided for cross-language IBM MQ API compatibility.intgetInt4Property(String name, MQPropertyDescriptor descriptor) Synonym forgetIntProperty(String, MQPropertyDescriptor), provided for cross-language IBM MQ API compatibility.longgetInt8Property(String name) Synonym forgetLongProperty(String), provided for cross-language IBM MQ API compatibility.longgetInt8Property(String name, MQPropertyDescriptor descriptor) Synonym forgetLongProperty(String, MQPropertyDescriptor), provided for cross-language IBM MQ API compatibility.intgetIntProperty(String name) Returns the value of the int property with the specified name.intgetIntProperty(String name, MQPropertyDescriptor descriptor) Returns the value of the int property with the specified name, filling in the specified property descriptor.longgetLongProperty(String name) Returns the value of the long property with the specified name.longgetLongProperty(String name, MQPropertyDescriptor descriptor) Returns the value of the long property with the specified name, filling in the specified property descriptor.intGets the number of bytes of message data in this message.getObjectProperty(String name) Returns the value of the Java object property with the specified name.getObjectProperty(String name, MQPropertyDescriptor descriptor) Returns the value of the Java object property with the specified name, filling in the specified property descriptor.getPropertyNames(String nameP) Returns an Enumeration of all the property names matching the specified name.intSpecifies whether validation of properties should take place when a property of the message is set.shortgetShortProperty(String name) Returns the value of the short property with the specified name.shortgetShortProperty(String name, MQPropertyDescriptor descriptor) Returns the value of the short property with the specified name, filling in the specified property descriptor.getStringProperty(String name) Returns the value of the String property with the specified name.getStringProperty(String name, MQPropertyDescriptor descriptor) Returns the value of the String property with the specified name, filling in the specified property descriptor.intGets the total number of bytes in the message as stored on the message queue on which this message was held.booleanReads a boolean from the current position in the message buffer.bytereadByte()Reads a byte from the current position in the message buffer.charreadChar()Reads a character from the current position in the message buffer.shortReads a 2-byte packed decimal number in the range -999 to 999.intReads a 4-byte packed decimal number in the range -9,999,999 to 9,999,999.longReads an 8-byte packed decimal number in the range -999,999,999,999,999 to 999,999,999,999,999.doubleReads a double from the current position in the message buffer.floatReads a float from the current position in the message buffer.voidreadFully(byte[] b) Fills a byte array with data from the message buffer.voidreadFully(byte[] b, int off, int len) Partly fills a byte array with data from the message buffer.intreadInt()Reads an integer from the current position in the message buffer.shortreadInt2()Identical toreadShort().intreadInt4()Synonym forreadInt(), provided for cross-language WMQ API compatibility.longreadInt8()Identical toreadLong().readLine()Reads a line of text from the message.longreadLong()Reads an integer from the current position in the message buffer.Reads an object carried in the message.shortReads a short from the current position in the message buffer.readString(int length) Deprecated.readStringOfByteLength(int numberOfBytes) Reads a specified number of bytes and uses them to construct a new string using the character set specified bycharacterSet.readStringOfCharLength(int numberOfChars) Reads a string in the codeset identified bycharacterSetand converts it into Unicode.intIdentical toreadUnsignedShort(), provided for cross-language WMQ API compatibility.intReads an unsigned byte from the current position in the message buffer.intReads an unsigned short from the current position in the message buffer.readUTF()Reads a UTF format String from the current position in the message buffer.voidresizeBuffer(int size) Indicates to the MQMessage class the size of buffer that might be required.voidseek(int seekOffset) Moves the cursor to a new absolute position in the message buffer.voidsetBooleanProperty(String name, boolean value) Sets a boolean property value with the specified name into the message, with the default property descriptor.voidsetBooleanProperty(String name, MQPropertyDescriptor descriptor, boolean value) Sets a boolean property value with the specified name into the message, with the specified property descriptor.voidsetByteProperty(String name, byte value) Sets a byte property value with the specified name into the message, with the default property descriptor.voidsetByteProperty(String name, MQPropertyDescriptor descriptor, byte value) Sets a byte property value with the specified name into the message, with the specified property descriptor.voidsetBytesProperty(String name, byte[] value) Sets a byte array property value with the specified name into the message, with the default property descriptor.voidsetBytesProperty(String name, MQPropertyDescriptor descriptor, byte[] value) Sets a byte array property value with the specified name into the message, with the specified property descriptor.voidsetDataOffset(int offset) Moves the cursor to a new absolute position in the message buffer.voidsetDoubleProperty(String name, double value) Sets a double property value with the specified name into the message, with the default property descriptor.voidsetDoubleProperty(String name, MQPropertyDescriptor descriptor, double value) Sets a double property value with the specified name into the message, with the specified property descriptor.voidsetFloatProperty(String name, float value) Sets a float property value with the specified name into the message, with the default property descriptor.voidsetFloatProperty(String name, MQPropertyDescriptor descriptor, float value) Sets a float property value with the specified name into the message, with the specified property descriptor.voidsetInt2Property(String name, short value) Synonym forsetShortProperty(String, short), provided for cross-language IBM MQ API compatibility.voidsetInt2Property(String name, MQPropertyDescriptor descriptor, short value) Synonym forsetShortProperty(String, MQPropertyDescriptor, short), provided for cross-language IBM MQ API compatibility.voidsetInt4Property(String name, int value) Synonym forsetIntProperty(String, int), provided for cross-language IBM MQ API compatibility.voidsetInt4Property(String name, MQPropertyDescriptor descriptor, int value) Synonym forsetIntProperty(String, MQPropertyDescriptor, int), provided for cross-language IBM MQ API compatibility.voidsetInt8Property(String name, long value) Synonym forsetLongProperty(String, long), provided for cross-language IBM MQ API compatibility.voidsetInt8Property(String name, MQPropertyDescriptor descriptor, long value) Synonym forsetLongProperty(String, MQPropertyDescriptor, long), provided for cross-language IBM MQ API compatibility.voidsetIntProperty(String name, int value) Sets a int property value with the specified name into the message, with the default property descriptor.voidsetIntProperty(String name, MQPropertyDescriptor descriptor, int value) Sets a int property value with the specified name into the message, with the specified property descriptor.voidsetLongProperty(String name, long value) Sets a long property value with the specified name into the message, with the default property descriptor.voidsetLongProperty(String name, MQPropertyDescriptor descriptor, long value) Sets a long property value with the specified name into the message, with the specified property descriptor.voidsetObjectProperty(String name, MQPropertyDescriptor descriptor, Object value) Sets a Java object property value with the specified name into the message, with the specified property descriptor.voidsetObjectProperty(String name, Object value) Sets a Java object property value with the specified name into the message, with the default property descriptor.voidsetPropertyValidation(int propertyValidation) Specifies whether validation of properties should take place when a property of the message is set.voidsetShortProperty(String name, short value) Sets a short property value with the specified name into the message, with the default property descriptor.voidsetShortProperty(String name, MQPropertyDescriptor descriptor, short value) Sets a short property value with the specified name into the message, with the specified property descriptor.voidsetStringProperty(String name, MQPropertyDescriptor descriptor, String value) Sets a String property value with the specified name into the message, with the specified property descriptor.voidsetStringProperty(String name, String value) Sets a String property value with the specified name into the message, with the default property descriptor.intskipBytes(int n) Moves the cursor forward in the message buffer.voidwrite(byte[] b) Writes an array of bytes into the message buffer at the current position.voidwrite(byte[] b, int off, int len) Writes a series of bytes into the message buffer at the current position.voidwrite(int b) Writes a byte into the message buffer at the current position.voidwriteBoolean(boolean v) Writes a boolean into the message buffer at the current position.voidwriteByte(int v) Writes a byte into the message buffer at the current position.voidwriteBytes(String s) Deprecated.This implements theDataOutput.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.voidwriteChar(int v) Writes a Unicode character into the message buffer at the current position.voidwriteChars(String s) Writes a String as a sequence of Unicode characters into the message buffer at the current position.voidwriteDecimal2(short v) Writes a 2-byte packed decimal format number into the message buffer at the current position.voidwriteDecimal4(int v) Writes a 4-byte packed decimal format number into the message buffer at the current position.voidwriteDecimal8(long v) Writes an 8-byte packed decimal format number into the message buffer at the current position.voidwriteDouble(double v) Writes a double into the message buffer at the current position.voidwriteFloat(float v) Writes a float into the message buffer at the current position.voidwriteInt(int v) Writes an int into the message buffer at the current position.voidwriteInt2(int v) Identical towriteShort(), provided for cross-language WMQ API compatibility.voidwriteInt4(int v) Synonym forwriteInt(), provided for cross-language WMQ API compatibility.voidwriteInt8(long v) Synonym forwriteLong(), provided for cross-language WMQ API compatibility.voidwriteLong(long v) Writes a long into the message buffer at the current position.voidwriteObject(Object obj) Writes an Object into the message.voidwriteShort(int v) Writes a short into the message buffer at the current position.voidWrites a java.lang.String into the message buffer at the current position, encoding it using the coded character set identified bycharacterSet.voidWrites a String in UTF format into the message buffer at the current position.Methods inherited from class com.ibm.mq.MQMD
getVersion, setVersionMethods inherited from class com.ibm.mq.jmqi.JmqiObject
getJmqiEnvironment
-
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 anMQQueue.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
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
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
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
Moves the cursor to a new absolute position in the message buffer. This method is identical toseek(), 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
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
Discards any data in the message buffer and sets the cursor position to zero.- Throws:
IOException- if there is a problem with IO.
-
resizeBuffer
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 withMQQueue.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
Reads a boolean from the current position in the message buffer.- Specified by:
readBooleanin interfaceDataInput- Returns:
- the boolean.
- Throws:
IOException- if there is a problem with IO.EOFException- if the read goes beyond the end of file.
-
readByte
Reads a byte from the current position in the message buffer.- Specified by:
readBytein interfaceDataInput- Returns:
- the (signed) byte.
- Throws:
IOException- if there is a problem with IO.EOFException- if the read goes beyond the end of file.
-
readChar
Reads a character from the current position in the message buffer.- Specified by:
readCharin interfaceDataInput- Returns:
- the Unicode character.
- Throws:
IOException- if there is a problem with IO.EOFException- if the read goes beyond the end of file.
-
readDouble
Reads a double from the current position in the message buffer.- Specified by:
readDoublein interfaceDataInput- 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
Reads a float from the current position in the message buffer.- Specified by:
readFloatin interfaceDataInput- Returns:
- a big-endian float if
encodingequals MQConstants.MQENC_INTEGER_NORMAL, a little-endian float if it equals MQConstants.MQENC_INTEGER_REVERSED, or azSeries 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
Fills a byte array with data from the message buffer.- Specified by:
readFullyin interfaceDataInput- Parameters:
b- the byte array.- Throws:
IOException- if there is a problem with IO.
-
readFully
Partly fills a byte array with data from the message buffer.- Specified by:
readFullyin interfaceDataInput- 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
Reads a specified number of bytes and uses them to construct a new string using the character set specified bycharacterSet. 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
Reads a string in the codeset identified bycharacterSetand 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
Reads an integer from the current position in the message buffer.- Specified by:
readIntin interfaceDataInput- 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
Synonym forreadInt(), provided for cross-language WMQ API compatibility.- Returns:
- int The integer read
- Throws:
IOException- if there is a problem with IO.
-
readLine
Reads a line of text from the message. Converts from the codeset identified incharacterSet, 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:
readLinein interfaceDataInput- Returns:
- the returned string, in Unicode.
- Throws:
IOException- if there is a problem with IO.
-
readLong
Reads an integer from the current position in the message buffer.- Specified by:
readLongin interfaceDataInput- 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
Identical toreadLong(). 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
Reads a short from the current position in the message buffer.- Specified by:
readShortin interfaceDataInput- 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
Identical toreadShort(). 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
Reads a UTF format String from the current position in the message buffer.- Specified by:
readUTFin interfaceDataInput- Returns:
- the String.
- Throws:
IOException- if there is a problem with IO.
-
readUnsignedByte
Reads an unsigned byte from the current position in the message buffer.- Specified by:
readUnsignedBytein interfaceDataInput- Returns:
- an int that contains the value.
- Throws:
IOException- if there is a problem with IO.
-
readUnsignedShort
Reads an unsigned short from the current position in the message buffer.- Specified by:
readUnsignedShortin interfaceDataInput- 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
Identical toreadUnsignedShort(), 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
Deprecated.usereadStringOfCharLength(int)method instead.Reads a string in the codeset identified bycharacterSetand 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
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
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
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
public Object readObject() throws ClassNotFoundException, InvalidClassException, StreamCorruptedException, OptionalDataException, IOExceptionReads an object carried in the message.- Returns:
- the Object.
- Throws:
ClassNotFoundExceptionInvalidClassExceptionStreamCorruptedExceptionOptionalDataExceptionIOException
-
skipBytes
Moves the cursor forward in the message buffer.- Specified by:
skipBytesin interfaceDataInput- 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
Writes a byte into the message buffer at the current position.- Specified by:
writein interfaceDataOutput- Parameters:
b- the byte to be written- Throws:
IOException- if there is a problem with IO.
-
write
Writes an array of bytes into the message buffer at the current position.- Specified by:
writein interfaceDataOutput- Parameters:
b- the array to be written.- Throws:
IOException- if there is a problem with IO.
-
write
Writes a series of bytes into the message buffer at the current position.- Specified by:
writein interfaceDataOutput- 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
Writes a boolean into the message buffer at the current position.- Specified by:
writeBooleanin interfaceDataOutput- Parameters:
v- the boolean to be written.- Throws:
IOException- if there is a problem with IO.
-
writeByte
Writes a byte into the message buffer at the current position.- Specified by:
writeBytein interfaceDataOutput- Parameters:
v- the byte to be written.- Throws:
IOException- if there is a problem with IO.
-
writeBytes
Deprecated.This implements theDataOutput.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 theDataOutputinterface.)
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, usewriteString(String)instead of this method.Writes a String as a sequence of bytes into the message buffer at the current position.- Specified by:
writeBytesin interfaceDataOutput- Parameters:
s- the String to be written.- Throws:
IOException- if there is a problem with IO.
-
writeChar
Writes a Unicode character into the message buffer at the current position.- Specified by:
writeCharin interfaceDataOutput- Parameters:
v- the character to be written, expressed as an int.- Throws:
IOException- if there is a problem with IO.
-
writeChars
Writes a String as a sequence of Unicode characters into the message buffer at the current position.- Specified by:
writeCharsin interfaceDataOutput- Parameters:
s- the String to be written.- Throws:
IOException- if there is a problem with IO.
-
writeDouble
Writes a double into the message buffer at the current position. The behavior of this method is determined byencoding.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 ofzSeries double precision floating point numbers, and that very large numbers cannot be converted.- Specified by:
writeDoublein interfaceDataOutput- Parameters:
v- the double to be written.- Throws:
IOException- if there is a problem with IO.
-
writeFloat
Writes a float into the message buffer at the current position. The behavior of this method is determined byencoding.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 ofzSeries double precision floating point numbers, and that very large numbers cannot be converted.- Specified by:
writeFloatin interfaceDataOutput- Parameters:
v- the float to be written.- Throws:
IOException- if there is a problem with IO.
-
writeInt
Writes an int into the message buffer at the current position. The behavior of this method is determined byencoding.Values of MQConstants.MQENC_INTEGER_NORMAL and MQConstants.MQENC_INTEGER_REVERSED write integers in big-endian and little-endian formats respectively.
- Specified by:
writeIntin interfaceDataOutput- Parameters:
v- the int to be written.- Throws:
IOException- if there is a problem with IO.
-
writeInt4
Synonym forwriteInt(), provided for cross-language WMQ API compatibility.- Parameters:
v- the int to be written- Throws:
IOException- if there is a problem with IO.
-
writeLong
Writes a long into the message buffer at the current position. The behavior of this method is determined byencoding.Values of MQConstants.MQENC_INTEGER_NORMAL and MQConstants.MQENC_INTEGER_REVERSED write longs in big-endian and little-endian formats respectively.
- Specified by:
writeLongin interfaceDataOutput- Parameters:
v- the long to be written.- Throws:
IOException- if there is a problem with IO.
-
writeInt8
Synonym forwriteLong(), provided for cross-language WMQ API compatibility.- Parameters:
v- the long to be written- Throws:
IOException- if there is a problem with IO.
-
writeShort
Writes a short into the message buffer at the current position. The behavior of this method is determined byencoding.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:
writeShortin interfaceDataOutput- Parameters:
v- the short to be written.- Throws:
IOException- if there is a problem with IO.
-
writeInt2
Identical towriteShort(), provided for cross-language WMQ API compatibility.- Parameters:
v- the long to be written.- Throws:
IOException- if there is a problem with IO.
-
writeDecimal2
Writes a 2-byte packed decimal format number into the message buffer at the current position. The behavior of this method is determined byencoding. 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
Writes a 4-byte packed decimal format number into the message buffer at the current position. The behavior of this method is determined byencoding. 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
Writes an 8-byte packed decimal format number into the message buffer at the current position. The behavior of this method is determined byencoding. 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
Writes a String in UTF format into the message buffer at the current position.- Specified by:
writeUTFin interfaceDataOutput- Parameters:
str- the String to be written.- Throws:
IOException- if there is a problem with IO.
-
writeString
Writes a java.lang.String into the message buffer at the current position, encoding it using the coded character set identified bycharacterSet.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
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:
trueif 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 totrueif property validation should take place
-
setBooleanProperty
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
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
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
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
Synonym forsetShortProperty(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 forsetShortProperty(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
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
Synonym forsetIntProperty(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 forsetIntProperty(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
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
Synonym forsetLongProperty(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 forsetLongProperty(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
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
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
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
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
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
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
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
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
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
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
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
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
Synonym forgetShortProperty(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
Synonym forgetShortProperty(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
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
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
Synonym forgetIntProperty(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
Synonym forgetIntProperty(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
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
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
Synonym forgetLongProperty(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
Synonym forgetLongProperty(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
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
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
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
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
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
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
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 equivalentsetObjectProperty(String, Object)method call, or its equivalent primitive#set*Propertymethod.- 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
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 equivalentsetObjectProperty(String, Object)method call, or its equivalent primitive#set*Propertymethod.- 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
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
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.
-
readStringOfCharLength(int)method instead.