Class MQMessage
- java.lang.Object
-
- com.ibm.mq.jmqi.JmqiObject
-
- com.ibm.mq.MQMD
-
- com.ibm.mq.MQMessage
-
- All Implemented Interfaces:
- java.io.DataInput, java.io.DataOutput
public class MQMessage extends MQMD implements java.io.DataInput, java.io.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 theencodingandcharacterSetfields. 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, userId
-
-
Constructor Summary
Constructors Constructor and Description MQMessage()The default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description voidclearMessage()Discards any data in the message buffer and sets the cursor position to zero.voiddeleteProperty(java.lang.String nameP)Deletes a property with the specified name from the message.booleangetBooleanProperty(java.lang.String name)Returns the value of the boolean property with the specified name.booleangetBooleanProperty(java.lang.String name, MQPropertyDescriptor descriptor)Returns the value of the boolean property with the specified name, filling in the specified property descriptor.bytegetByteProperty(java.lang.String name)Returns the value of the byte property with the specified name.bytegetByteProperty(java.lang.String name, MQPropertyDescriptor descriptor)Returns the value of the byte property with the specified name, filling in the specified property descriptor.byte[]getBytesProperty(java.lang.String name)Returns the value of the byte array property with the specified name.byte[]getBytesProperty(java.lang.String name, MQPropertyDescriptor descriptor)Returns the value of the byte array property with the specified name, filling in the specified property descriptor.intgetDataLength()Gets the number of bytes of message data remaining to be read.intgetDataOffset()Returns the current cursor position within the message data (the point at which read and write operations take effect).doublegetDoubleProperty(java.lang.String name)Returns the value of the double property with the specified name.doublegetDoubleProperty(java.lang.String name, MQPropertyDescriptor descriptor)Returns the value of the double property with the specified name, filling in the specified property descriptor.floatgetFloatProperty(java.lang.String name)Returns the value of the float property with the specified name.floatgetFloatProperty(java.lang.String name, MQPropertyDescriptor descriptor)Returns the value of the float property with the specified name, filling in the specified property descriptor.shortgetInt2Property(java.lang.String name)Synonym forgetShortProperty(String), provided for cross-language IBM MQ API compatibility.shortgetInt2Property(java.lang.String name, MQPropertyDescriptor descriptor)Synonym forgetShortProperty(String, MQPropertyDescriptor), provided for cross-language IBM MQ API compatibility.intgetInt4Property(java.lang.String name)Synonym forgetIntProperty(String), provided for cross-language IBM MQ API compatibility.intgetInt4Property(java.lang.String name, MQPropertyDescriptor descriptor)Synonym forgetIntProperty(String, MQPropertyDescriptor), provided for cross-language IBM MQ API compatibility.longgetInt8Property(java.lang.String name)Synonym forgetLongProperty(String), provided for cross-language IBM MQ API compatibility.longgetInt8Property(java.lang.String name, MQPropertyDescriptor descriptor)Synonym forgetLongProperty(String, MQPropertyDescriptor), provided for cross-language IBM MQ API compatibility.intgetIntProperty(java.lang.String name)Returns the value of the int property with the specified name.intgetIntProperty(java.lang.String name, MQPropertyDescriptor descriptor)Returns the value of the int property with the specified name, filling in the specified property descriptor.longgetLongProperty(java.lang.String name)Returns the value of the long property with the specified name.longgetLongProperty(java.lang.String name, MQPropertyDescriptor descriptor)Returns the value of the long property with the specified name, filling in the specified property descriptor.intgetMessageLength()Gets the number of bytes of message data in this message.java.lang.ObjectgetObjectProperty(java.lang.String name)Returns the value of the Java object property with the specified name.java.lang.ObjectgetObjectProperty(java.lang.String name, MQPropertyDescriptor descriptor)Returns the value of the Java object property with the specified name, filling in the specified property descriptor.java.util.Enumeration<java.lang.String>getPropertyNames(java.lang.String nameP)Returns an Enumeration of all the property names matching the specified name.intgetPropertyValidation()Specifies whether validation of properties should take place when a property of the message is set.shortgetShortProperty(java.lang.String name)Returns the value of the short property with the specified name.shortgetShortProperty(java.lang.String name, MQPropertyDescriptor descriptor)Returns the value of the short property with the specified name, filling in the specified property descriptor.java.lang.StringgetStringProperty(java.lang.String name)Returns the value of the String property with the specified name.java.lang.StringgetStringProperty(java.lang.String name, MQPropertyDescriptor descriptor)Returns the value of the String property with the specified name, filling in the specified property descriptor.intgetTotalMessageLength()Gets the total number of bytes in the message as stored on the message queue on which this message was held.booleanreadBoolean()Reads 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.shortreadDecimal2()Reads a 2-byte packed decimal number in the range -999 to 999.intreadDecimal4()Reads a 4-byte packed decimal number in the range -9,999,999 to 9,999,999.longreadDecimal8()Reads an 8-byte packed decimal number in the range -999,999,999,999,999 to 999,999,999,999,999.doublereadDouble()Reads a double from the current position in the message buffer.floatreadFloat()Reads 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().java.lang.StringreadLine()Reads a line of text from the message.longreadLong()Reads an integer from the current position in the message buffer.java.lang.ObjectreadObject()Reads an object carried in the message.shortreadShort()Reads a short from the current position in the message buffer.java.lang.StringreadString(int length)Deprecated.usereadStringOfCharLength(int)method instead.java.lang.StringreadStringOfByteLength(int numberOfBytes)Reads a specified number of bytes and uses them to construct a new string using the character set specified bycharacterSet.java.lang.StringreadStringOfCharLength(int numberOfChars)Reads a string in the codeset identified bycharacterSetand converts it into Unicode.intreadUInt2()Identical toreadUnsignedShort(), provided for cross-language WMQ API compatibility.intreadUnsignedByte()Reads an unsigned byte from the current position in the message buffer.intreadUnsignedShort()Reads an unsigned short from the current position in the message buffer.java.lang.StringreadUTF()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(java.lang.String name, boolean value)Sets a boolean property value with the specified name into the message, with the default property descriptor.voidsetBooleanProperty(java.lang.String name, MQPropertyDescriptor descriptor, boolean value)Sets a boolean property value with the specified name into the message, with the specified property descriptor.voidsetByteProperty(java.lang.String name, byte value)Sets a byte property value with the specified name into the message, with the default property descriptor.voidsetByteProperty(java.lang.String name, MQPropertyDescriptor descriptor, byte value)Sets a byte property value with the specified name into the message, with the specified property descriptor.voidsetBytesProperty(java.lang.String name, byte[] value)Sets a byte array property value with the specified name into the message, with the default property descriptor.voidsetBytesProperty(java.lang.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(java.lang.String name, double value)Sets a double property value with the specified name into the message, with the default property descriptor.voidsetDoubleProperty(java.lang.String name, MQPropertyDescriptor descriptor, double value)Sets a double property value with the specified name into the message, with the specified property descriptor.voidsetFloatProperty(java.lang.String name, float value)Sets a float property value with the specified name into the message, with the default property descriptor.voidsetFloatProperty(java.lang.String name, MQPropertyDescriptor descriptor, float value)Sets a float property value with the specified name into the message, with the specified property descriptor.voidsetInt2Property(java.lang.String name, MQPropertyDescriptor descriptor, short value)Synonym forsetShortProperty(String, MQPropertyDescriptor, short), provided for cross-language IBM MQ API compatibility.voidsetInt2Property(java.lang.String name, short value)Synonym forsetShortProperty(String, short), provided for cross-language IBM MQ API compatibility.voidsetInt4Property(java.lang.String name, int value)Synonym forsetIntProperty(String, int), provided for cross-language IBM MQ API compatibility.voidsetInt4Property(java.lang.String name, MQPropertyDescriptor descriptor, int value)Synonym forsetIntProperty(String, MQPropertyDescriptor, int), provided for cross-language IBM MQ API compatibility.voidsetInt8Property(java.lang.String name, long value)Synonym forsetLongProperty(String, long), provided for cross-language IBM MQ API compatibility.voidsetInt8Property(java.lang.String name, MQPropertyDescriptor descriptor, long value)Synonym forsetLongProperty(String, MQPropertyDescriptor, long), provided for cross-language IBM MQ API compatibility.voidsetIntProperty(java.lang.String name, int value)Sets a int property value with the specified name into the message, with the default property descriptor.voidsetIntProperty(java.lang.String name, MQPropertyDescriptor descriptor, int value)Sets a int property value with the specified name into the message, with the specified property descriptor.voidsetLongProperty(java.lang.String name, long value)Sets a long property value with the specified name into the message, with the default property descriptor.voidsetLongProperty(java.lang.String name, MQPropertyDescriptor descriptor, long value)Sets a long property value with the specified name into the message, with the specified property descriptor.voidsetObjectProperty(java.lang.String name, MQPropertyDescriptor descriptor, java.lang.Object value)Sets a Java object property value with the specified name into the message, with the specified property descriptor.voidsetObjectProperty(java.lang.String name, java.lang.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(java.lang.String name, MQPropertyDescriptor descriptor, short value)Sets a short property value with the specified name into the message, with the specified property descriptor.voidsetShortProperty(java.lang.String name, short value)Sets a short property value with the specified name into the message, with the default property descriptor.voidsetStringProperty(java.lang.String name, MQPropertyDescriptor descriptor, java.lang.String value)Sets a String property value with the specified name into the message, with the specified property descriptor.voidsetStringProperty(java.lang.String name, java.lang.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(java.lang.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. (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.voidwriteChar(int v)Writes a Unicode character into the message buffer at the current position.voidwriteChars(java.lang.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(java.lang.Object obj)Writes an Object into the message.voidwriteShort(int v)Writes a short into the message buffer at the current position.voidwriteString(java.lang.String s)Writes a java.lang.String into the message buffer at the current position, encoding it using the coded character set identified bycharacterSet.voidwriteUTF(java.lang.String str)Writes a String in UTF format into the message buffer at the current position.-
Methods inherited from class com.ibm.mq.MQMD
getVersion, setVersion
-
-
-
-
Constructor Detail
-
MQMessage
public MQMessage()
The default constructor. This creates a message with default message descriptor information and an empty message buffer.
-
-
Method Detail
-
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
public int getMessageLength() throws java.io.IOExceptionGets the number of bytes of message data in this message.- Returns:
- the number of bytes.
- Throws:
java.io.IOException- if there is a problem with IO.
-
getDataLength
public int getDataLength() throws java.io.IOExceptionGets the number of bytes of message data remaining to be read.- Returns:
- int the number of bytes remaining
- Throws:
java.io.IOException- if there is a problem with IO.
-
seek
public void seek(int seekOffset) throws java.io.EOFExceptionMoves 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:
java.io.EOFException- if offset takes cursor outside the message data.
-
setDataOffset
public void setDataOffset(int offset) throws java.io.EOFExceptionMoves 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:
java.io.EOFException- if offset takes cursor outside the message data.
-
getDataOffset
public int getDataOffset() throws java.io.IOExceptionReturns the current cursor position within the message data (the point at which read and write operations take effect).- Returns:
- the cursor position.
- Throws:
java.io.IOException- if there is a problem with IO.
-
clearMessage
public void clearMessage() throws java.io.IOExceptionDiscards any data in the message buffer and sets the cursor position to zero.- Throws:
java.io.IOException- if there is a problem with IO.
-
resizeBuffer
public void resizeBuffer(int size) throws java.io.IOExceptionIndicates 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:
java.io.IOException- if there is a problem with IO.
-
readBoolean
public boolean readBoolean() throws java.io.IOException, java.io.EOFExceptionReads a boolean from the current position in the message buffer.- Specified by:
readBooleanin interfacejava.io.DataInput- Returns:
- the boolean.
- Throws:
java.io.IOException- if there is a problem with IO.java.io.EOFException- if the read goes beyond the end of file.
-
readByte
public byte readByte() throws java.io.IOException, java.io.EOFExceptionReads a byte from the current position in the message buffer.- Specified by:
readBytein interfacejava.io.DataInput- Returns:
- the (signed) byte.
- Throws:
java.io.IOException- if there is a problem with IO.java.io.EOFException- if the read goes beyond the end of file.
-
readChar
public char readChar() throws java.io.IOException, java.io.EOFExceptionReads a character from the current position in the message buffer.- Specified by:
readCharin interfacejava.io.DataInput- Returns:
- the Unicode character.
- Throws:
java.io.IOException- if there is a problem with IO.java.io.EOFException- if the read goes beyond the end of file.
-
readDouble
public double readDouble() throws java.io.IOException, java.io.EOFExceptionReads a double from the current position in the message buffer.- Specified by:
readDoublein interfacejava.io.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:
java.io.IOException- if encoding is not equal to either of these values.java.io.EOFException- if the read goes beyond the end of file.
-
readFloat
public float readFloat() throws java.io.IOException, java.io.EOFExceptionReads a float from the current position in the message buffer.- Specified by:
readFloatin interfacejava.io.DataInput- 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:
java.io.IOException- if encoding is none of these.java.io.EOFException- if the read goes beyond the end of file.
-
readFully
public void readFully(byte[] b) throws java.io.IOExceptionFills a byte array with data from the message buffer.- Specified by:
readFullyin interfacejava.io.DataInput- Parameters:
b- the byte array.- Throws:
java.io.IOException- if there is a problem with IO.
-
readFully
public void readFully(byte[] b, int off, int len) throws java.io.IOExceptionPartly fills a byte array with data from the message buffer.- Specified by:
readFullyin interfacejava.io.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:
java.io.IOException- if there is a problem with IO.
-
readStringOfByteLength
public java.lang.String readStringOfByteLength(int numberOfBytes) throws java.io.IOException, java.io.EOFExceptionReads 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:
java.io.IOException- if there is a problem with IO.java.io.EOFException- if the read goes beyond the end of file.
-
readStringOfCharLength
public java.lang.String readStringOfCharLength(int numberOfChars) throws java.io.IOException, java.io.EOFExceptionReads 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:
java.io.IOException- if there is a problem with IO.java.io.EOFException- if the read goes beyond the end of file.
-
readInt
public int readInt() throws java.io.IOExceptionReads an integer from the current position in the message buffer.- Specified by:
readIntin interfacejava.io.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:
java.io.IOException- if there is a problem with IO.
-
readInt4
public int readInt4() throws java.io.IOExceptionSynonym forreadInt(), provided for cross-language WMQ API compatibility.- Returns:
- int The integer read
- Throws:
java.io.IOException- if there is a problem with IO.
-
readLine
public java.lang.String readLine() throws java.io.IOExceptionReads 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 interfacejava.io.DataInput- Returns:
- the returned string, in Unicode.
- Throws:
java.io.IOException- if there is a problem with IO.
-
readLong
public long readLong() throws java.io.IOExceptionReads an integer from the current position in the message buffer.- Specified by:
readLongin interfacejava.io.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:
java.io.IOException- if encoding is not equal to either of these values.
-
readInt8
public long readInt8() throws java.io.IOExceptionIdentical 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:
java.io.IOException- if encoding is not equal to either of these values.
-
readShort
public short readShort() throws java.io.IOExceptionReads a short from the current position in the message buffer.- Specified by:
readShortin interfacejava.io.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:
java.io.IOException- if encoding is not equal to either of these values.
-
readInt2
public short readInt2() throws java.io.IOExceptionIdentical 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:
java.io.IOException- if there is a problem with IO.
-
readUTF
public java.lang.String readUTF() throws java.io.IOExceptionReads a UTF format String from the current position in the message buffer.- Specified by:
readUTFin interfacejava.io.DataInput- Returns:
- the String.
- Throws:
java.io.IOException- if there is a problem with IO.
-
readUnsignedByte
public int readUnsignedByte() throws java.io.IOExceptionReads an unsigned byte from the current position in the message buffer.- Specified by:
readUnsignedBytein interfacejava.io.DataInput- Returns:
- an int that contains the value.
- Throws:
java.io.IOException- if there is a problem with IO.
-
readUnsignedShort
public int readUnsignedShort() throws java.io.IOExceptionReads an unsigned short from the current position in the message buffer.- Specified by:
readUnsignedShortin interfacejava.io.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:
java.io.IOException- if encoding is not equal to either of these values.
-
readUInt2
public int readUInt2() throws java.io.IOExceptionIdentical 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:
java.io.IOException- if there is a problem with IO.
-
readString
public java.lang.String readString(int length) throws java.io.IOExceptionDeprecated. 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:
java.io.IOException
-
readDecimal2
public short readDecimal2() throws java.io.IOExceptionReads 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:
java.io.IOException- if there is a problem with IO.
-
readDecimal4
public int readDecimal4() throws java.io.IOExceptionReads 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:
java.io.IOException- if there is a problem with IO.
-
readDecimal8
public long readDecimal8() throws java.io.IOExceptionReads 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:
java.io.IOException- if there is a problem with IO.
-
readObject
public java.lang.Object readObject() throws java.lang.ClassNotFoundException, java.io.InvalidClassException, java.io.StreamCorruptedException, java.io.OptionalDataException, java.io.IOExceptionReads an object carried in the message.- Returns:
- the Object.
- Throws:
java.lang.ClassNotFoundExceptionjava.io.InvalidClassExceptionjava.io.StreamCorruptedExceptionjava.io.OptionalDataExceptionjava.io.IOException
-
skipBytes
public int skipBytes(int n) throws java.io.IOException, java.io.EOFExceptionMoves the cursor forward in the message buffer.- Specified by:
skipBytesin interfacejava.io.DataInput- Parameters:
n- the number of bytes to move.- Returns:
- the number of bytes actually moved.
- Throws:
java.io.IOException- if there is a problem with IO.java.io.EOFException- if the skip goes beyond the end of file.
-
write
public void write(int b) throws java.io.IOExceptionWrites a byte into the message buffer at the current position.- Specified by:
writein interfacejava.io.DataOutput- Parameters:
b- the byte to be written- Throws:
java.io.IOException- if there is a problem with IO.
-
write
public void write(byte[] b) throws java.io.IOExceptionWrites an array of bytes into the message buffer at the current position.- Specified by:
writein interfacejava.io.DataOutput- Parameters:
b- the array to be written.- Throws:
java.io.IOException- if there is a problem with IO.
-
write
public void write(byte[] b, int off, int len) throws java.io.IOExceptionWrites a series of bytes into the message buffer at the current position.- Specified by:
writein interfacejava.io.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:
java.io.IOException- if there is a problem with IO.
-
writeBoolean
public void writeBoolean(boolean v) throws java.io.IOExceptionWrites a boolean into the message buffer at the current position.- Specified by:
writeBooleanin interfacejava.io.DataOutput- Parameters:
v- the boolean to be written.- Throws:
java.io.IOException- if there is a problem with IO.
-
writeByte
public void writeByte(int v) throws java.io.IOExceptionWrites a byte into the message buffer at the current position.- Specified by:
writeBytein interfacejava.io.DataOutput- Parameters:
v- the byte to be written.- Throws:
java.io.IOException- if there is a problem with IO.
-
writeBytes
public void writeBytes(java.lang.String s) throws java.io.IOExceptionDeprecated. 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 interfacejava.io.DataOutput- Parameters:
s- the String to be written.- Throws:
java.io.IOException- if there is a problem with IO.
-
writeChar
public void writeChar(int v) throws java.io.IOExceptionWrites a Unicode character into the message buffer at the current position.- Specified by:
writeCharin interfacejava.io.DataOutput- Parameters:
v- the character to be written, expressed as an int.- Throws:
java.io.IOException- if there is a problem with IO.
-
writeChars
public void writeChars(java.lang.String s) throws java.io.IOExceptionWrites a String as a sequence of Unicode characters into the message buffer at the current position.- Specified by:
writeCharsin interfacejava.io.DataOutput- Parameters:
s- the String to be written.- Throws:
java.io.IOException- if there is a problem with IO.
-
writeDouble
public void writeDouble(double v) throws java.io.IOExceptionWrites 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 interfacejava.io.DataOutput- Parameters:
v- the double to be written.- Throws:
java.io.IOException- if there is a problem with IO.
-
writeFloat
public void writeFloat(float v) throws java.io.IOExceptionWrites 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 interfacejava.io.DataOutput- Parameters:
v- the float to be written.- Throws:
java.io.IOException- if there is a problem with IO.
-
writeInt
public void writeInt(int v) throws java.io.IOExceptionWrites 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 interfacejava.io.DataOutput- Parameters:
v- the int to be written.- Throws:
java.io.IOException- if there is a problem with IO.
-
writeInt4
public void writeInt4(int v) throws java.io.IOExceptionSynonym forwriteInt(), provided for cross-language WMQ API compatibility.- Parameters:
v- the int to be written- Throws:
java.io.IOException- if there is a problem with IO.
-
writeLong
public void writeLong(long v) throws java.io.IOExceptionWrites 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 interfacejava.io.DataOutput- Parameters:
v- the long to be written.- Throws:
java.io.IOException- if there is a problem with IO.
-
writeInt8
public void writeInt8(long v) throws java.io.IOExceptionSynonym forwriteLong(), provided for cross-language WMQ API compatibility.- Parameters:
v- the long to be written- Throws:
java.io.IOException- if there is a problem with IO.
-
writeShort
public void writeShort(int v) throws java.io.IOExceptionWrites 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 interfacejava.io.DataOutput- Parameters:
v- the short to be written.- Throws:
java.io.IOException- if there is a problem with IO.
-
writeInt2
public void writeInt2(int v) throws java.io.IOExceptionIdentical towriteShort(), provided for cross-language WMQ API compatibility.- Parameters:
v- the long to be written.- Throws:
java.io.IOException- if there is a problem with IO.
-
writeDecimal2
public void writeDecimal2(short v) throws java.io.IOExceptionWrites 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:
java.io.IOException- if there is a problem with IO.
-
writeDecimal4
public void writeDecimal4(int v) throws java.io.IOExceptionWrites 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:
java.io.IOException- if there is a problem with IO.
-
writeDecimal8
public void writeDecimal8(long v) throws java.io.IOExceptionWrites 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:
java.io.IOException- if there is a problem with IO.
-
writeUTF
public void writeUTF(java.lang.String str) throws java.io.IOExceptionWrites a String in UTF format into the message buffer at the current position.- Specified by:
writeUTFin interfacejava.io.DataOutput- Parameters:
str- the String to be written.- Throws:
java.io.IOException- if there is a problem with IO.
-
writeString
public void writeString(java.lang.String s) throws java.io.IOExceptionWrites 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:
java.io.IOException- if there is a problem with IO.
-
writeObject
public void writeObject(java.lang.Object obj) throws java.io.IOExceptionWrites an Object into the message.- Parameters:
obj- the Object to be written.- Throws:
java.io.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
public void setBooleanProperty(java.lang.String name, boolean value) throws MQExceptionSets 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(java.lang.String name, MQPropertyDescriptor descriptor, boolean value) throws MQExceptionSets 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(java.lang.String name, byte[] value) throws MQExceptionSets 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(java.lang.String name, MQPropertyDescriptor descriptor, byte[] value) throws MQExceptionSets 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(java.lang.String name, byte value) throws MQExceptionSets 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(java.lang.String name, MQPropertyDescriptor descriptor, byte value) throws MQExceptionSets 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(java.lang.String name, short value) throws MQExceptionSets 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(java.lang.String name, MQPropertyDescriptor descriptor, short value) throws MQExceptionSets 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(java.lang.String name, short value) throws MQExceptionSynonym 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(java.lang.String name, MQPropertyDescriptor descriptor, short value) throws MQExceptionSynonym 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
public void setIntProperty(java.lang.String name, int value) throws MQExceptionSets 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(java.lang.String name, MQPropertyDescriptor descriptor, int value) throws MQExceptionSets 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(java.lang.String name, int value) throws MQExceptionSynonym 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(java.lang.String name, MQPropertyDescriptor descriptor, int value) throws MQExceptionSynonym 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
public void setLongProperty(java.lang.String name, long value) throws MQExceptionSets 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(java.lang.String name, MQPropertyDescriptor descriptor, long value) throws MQExceptionSets 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(java.lang.String name, long value) throws MQExceptionSynonym 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(java.lang.String name, MQPropertyDescriptor descriptor, long value) throws MQExceptionSynonym 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
public void setFloatProperty(java.lang.String name, float value) throws MQExceptionSets 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(java.lang.String name, MQPropertyDescriptor descriptor, float value) throws MQExceptionSets 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(java.lang.String name, double value) throws MQExceptionSets 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(java.lang.String name, MQPropertyDescriptor descriptor, double value) throws MQExceptionSets 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(java.lang.String name, java.lang.String value) throws MQExceptionSets 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(java.lang.String name, MQPropertyDescriptor descriptor, java.lang.String value) throws MQExceptionSets 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(java.lang.String name, java.lang.Object value) throws MQExceptionSets 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(java.lang.String name, MQPropertyDescriptor descriptor, java.lang.Object value) throws MQExceptionSets 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(java.lang.String name) throws MQExceptionReturns 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(java.lang.String name, MQPropertyDescriptor descriptor) throws MQExceptionReturns 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(java.lang.String name) throws MQExceptionReturns 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(java.lang.String name, MQPropertyDescriptor descriptor) throws MQExceptionReturns 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(java.lang.String name) throws MQExceptionReturns 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(java.lang.String name, MQPropertyDescriptor descriptor) throws MQExceptionReturns 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(java.lang.String name) throws MQExceptionReturns 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(java.lang.String name, MQPropertyDescriptor descriptor) throws MQExceptionReturns 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(java.lang.String name) throws MQExceptionSynonym 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
public short getInt2Property(java.lang.String name, MQPropertyDescriptor descriptor) throws MQExceptionSynonym 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
public int getIntProperty(java.lang.String name) throws MQExceptionReturns 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(java.lang.String name, MQPropertyDescriptor descriptor) throws MQExceptionReturns 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(java.lang.String name) throws MQExceptionSynonym 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
public int getInt4Property(java.lang.String name, MQPropertyDescriptor descriptor) throws MQExceptionSynonym 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
public long getLongProperty(java.lang.String name) throws MQExceptionReturns 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(java.lang.String name, MQPropertyDescriptor descriptor) throws MQExceptionReturns 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(java.lang.String name) throws MQExceptionSynonym 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
public long getInt8Property(java.lang.String name, MQPropertyDescriptor descriptor) throws MQExceptionSynonym 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
public float getFloatProperty(java.lang.String name) throws MQExceptionReturns 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(java.lang.String name, MQPropertyDescriptor descriptor) throws MQExceptionReturns 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(java.lang.String name) throws MQExceptionReturns 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(java.lang.String name, MQPropertyDescriptor descriptor) throws MQExceptionReturns 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 java.lang.String getStringProperty(java.lang.String name) throws MQExceptionReturns 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 java.lang.String getStringProperty(java.lang.String name, MQPropertyDescriptor descriptor) throws MQExceptionReturns 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 java.lang.Object getObjectProperty(java.lang.String name) throws MQExceptionReturns 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
public java.lang.Object getObjectProperty(java.lang.String name, MQPropertyDescriptor descriptor) throws MQExceptionReturns 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
public java.util.Enumeration<java.lang.String> getPropertyNames(java.lang.String nameP) throws MQExceptionReturns 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(java.lang.String nameP) throws MQExceptionDeletes 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.
-
-