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 theencoding
andcharacterSet
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, 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 void
clearMessage()
Discards any data in the message buffer and sets the cursor position to zero.void
deleteProperty(java.lang.String nameP)
Deletes a property with the specified name from the message.boolean
getBooleanProperty(java.lang.String name)
Returns the value of the boolean property with the specified name.boolean
getBooleanProperty(java.lang.String name, MQPropertyDescriptor descriptor)
Returns the value of the boolean property with the specified name, filling in the specified property descriptor.byte
getByteProperty(java.lang.String name)
Returns the value of the byte property with the specified name.byte
getByteProperty(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.int
getDataLength()
Gets the number of bytes of message data remaining to be read.int
getDataOffset()
Returns the current cursor position within the message data (the point at which read and write operations take effect).double
getDoubleProperty(java.lang.String name)
Returns the value of the double property with the specified name.double
getDoubleProperty(java.lang.String name, MQPropertyDescriptor descriptor)
Returns the value of the double property with the specified name, filling in the specified property descriptor.float
getFloatProperty(java.lang.String name)
Returns the value of the float property with the specified name.float
getFloatProperty(java.lang.String name, MQPropertyDescriptor descriptor)
Returns the value of the float property with the specified name, filling in the specified property descriptor.short
getInt2Property(java.lang.String name)
Synonym forgetShortProperty(String)
, provided for cross-language IBM MQ API compatibility.short
getInt2Property(java.lang.String name, MQPropertyDescriptor descriptor)
Synonym forgetShortProperty(String, MQPropertyDescriptor)
, provided for cross-language IBM MQ API compatibility.int
getInt4Property(java.lang.String name)
Synonym forgetIntProperty(String)
, provided for cross-language IBM MQ API compatibility.int
getInt4Property(java.lang.String name, MQPropertyDescriptor descriptor)
Synonym forgetIntProperty(String, MQPropertyDescriptor)
, provided for cross-language IBM MQ API compatibility.long
getInt8Property(java.lang.String name)
Synonym forgetLongProperty(String)
, provided for cross-language IBM MQ API compatibility.long
getInt8Property(java.lang.String name, MQPropertyDescriptor descriptor)
Synonym forgetLongProperty(String, MQPropertyDescriptor)
, provided for cross-language IBM MQ API compatibility.int
getIntProperty(java.lang.String name)
Returns the value of the int property with the specified name.int
getIntProperty(java.lang.String name, MQPropertyDescriptor descriptor)
Returns the value of the int property with the specified name, filling in the specified property descriptor.long
getLongProperty(java.lang.String name)
Returns the value of the long property with the specified name.long
getLongProperty(java.lang.String name, MQPropertyDescriptor descriptor)
Returns the value of the long property with the specified name, filling in the specified property descriptor.int
getMessageLength()
Gets the number of bytes of message data in this message.java.lang.Object
getObjectProperty(java.lang.String name)
Returns the value of the Java object property with the specified name.java.lang.Object
getObjectProperty(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.int
getPropertyValidation()
Specifies whether validation of properties should take place when a property of the message is set.short
getShortProperty(java.lang.String name)
Returns the value of the short property with the specified name.short
getShortProperty(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.String
getStringProperty(java.lang.String name)
Returns the value of the String property with the specified name.java.lang.String
getStringProperty(java.lang.String name, MQPropertyDescriptor descriptor)
Returns the value of the String property with the specified name, filling in the specified property descriptor.int
getTotalMessageLength()
Gets the total number of bytes in the message as stored on the message queue on which this message was held.boolean
readBoolean()
Reads a boolean from the current position in the message buffer.byte
readByte()
Reads a byte from the current position in the message buffer.char
readChar()
Reads a character from the current position in the message buffer.short
readDecimal2()
Reads a 2-byte packed decimal number in the range -999 to 999.int
readDecimal4()
Reads a 4-byte packed decimal number in the range -9,999,999 to 9,999,999.long
readDecimal8()
Reads an 8-byte packed decimal number in the range -999,999,999,999,999 to 999,999,999,999,999.double
readDouble()
Reads a double from the current position in the message buffer.float
readFloat()
Reads a float from the current position in the message buffer.void
readFully(byte[] b)
Fills a byte array with data from the message buffer.void
readFully(byte[] b, int off, int len)
Partly fills a byte array with data from the message buffer.int
readInt()
Reads an integer from the current position in the message buffer.short
readInt2()
Identical toreadShort()
.int
readInt4()
Synonym forreadInt()
, provided for cross-language WMQ API compatibility.long
readInt8()
Identical toreadLong()
.java.lang.String
readLine()
Reads a line of text from the message.long
readLong()
Reads an integer from the current position in the message buffer.java.lang.Object
readObject()
Reads an object carried in the message.short
readShort()
Reads a short from the current position in the message buffer.java.lang.String
readString(int length)
Deprecated.usereadStringOfCharLength(int)
method instead.java.lang.String
readStringOfByteLength(int numberOfBytes)
Reads a specified number of bytes and uses them to construct a new string using the character set specified bycharacterSet
.java.lang.String
readStringOfCharLength(int numberOfChars)
Reads a string in the codeset identified bycharacterSet
and converts it into Unicode.int
readUInt2()
Identical toreadUnsignedShort()
, provided for cross-language WMQ API compatibility.int
readUnsignedByte()
Reads an unsigned byte from the current position in the message buffer.int
readUnsignedShort()
Reads an unsigned short from the current position in the message buffer.java.lang.String
readUTF()
Reads a UTF format String from the current position in the message buffer.void
resizeBuffer(int size)
Indicates to the MQMessage class the size of buffer that might be required.void
seek(int seekOffset)
Moves the cursor to a new absolute position in the message buffer.void
setBooleanProperty(java.lang.String name, boolean value)
Sets a boolean property value with the specified name into the message, with the default property descriptor.void
setBooleanProperty(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.void
setByteProperty(java.lang.String name, byte value)
Sets a byte property value with the specified name into the message, with the default property descriptor.void
setByteProperty(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.void
setBytesProperty(java.lang.String name, byte[] value)
Sets a byte array property value with the specified name into the message, with the default property descriptor.void
setBytesProperty(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.void
setDataOffset(int offset)
Moves the cursor to a new absolute position in the message buffer.void
setDoubleProperty(java.lang.String name, double value)
Sets a double property value with the specified name into the message, with the default property descriptor.void
setDoubleProperty(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.void
setFloatProperty(java.lang.String name, float value)
Sets a float property value with the specified name into the message, with the default property descriptor.void
setFloatProperty(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.void
setInt2Property(java.lang.String name, MQPropertyDescriptor descriptor, short value)
Synonym forsetShortProperty(String, MQPropertyDescriptor, short)
, provided for cross-language IBM MQ API compatibility.void
setInt2Property(java.lang.String name, short value)
Synonym forsetShortProperty(String, short)
, provided for cross-language IBM MQ API compatibility.void
setInt4Property(java.lang.String name, int value)
Synonym forsetIntProperty(String, int)
, provided for cross-language IBM MQ API compatibility.void
setInt4Property(java.lang.String name, MQPropertyDescriptor descriptor, int value)
Synonym forsetIntProperty(String, MQPropertyDescriptor, int)
, provided for cross-language IBM MQ API compatibility.void
setInt8Property(java.lang.String name, long value)
Synonym forsetLongProperty(String, long)
, provided for cross-language IBM MQ API compatibility.void
setInt8Property(java.lang.String name, MQPropertyDescriptor descriptor, long value)
Synonym forsetLongProperty(String, MQPropertyDescriptor, long)
, provided for cross-language IBM MQ API compatibility.void
setIntProperty(java.lang.String name, int value)
Sets a int property value with the specified name into the message, with the default property descriptor.void
setIntProperty(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.void
setLongProperty(java.lang.String name, long value)
Sets a long property value with the specified name into the message, with the default property descriptor.void
setLongProperty(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.void
setObjectProperty(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.void
setObjectProperty(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.void
setPropertyValidation(int propertyValidation)
Specifies whether validation of properties should take place when a property of the message is set.void
setShortProperty(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.void
setShortProperty(java.lang.String name, short value)
Sets a short property value with the specified name into the message, with the default property descriptor.void
setStringProperty(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.void
setStringProperty(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.int
skipBytes(int n)
Moves the cursor forward in the message buffer.void
write(byte[] b)
Writes an array of bytes into the message buffer at the current position.void
write(byte[] b, int off, int len)
Writes a series of bytes into the message buffer at the current position.void
write(int b)
Writes a byte into the message buffer at the current position.void
writeBoolean(boolean v)
Writes a boolean into the message buffer at the current position.void
writeByte(int v)
Writes a byte into the message buffer at the current position.void
writeBytes(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 theDataOutput
interface.)
No data conversion is performed by this method. If you wish to write a string to the message with appropriate handling of the character set currently in force, usewriteString(String)
instead of this method.void
writeChar(int v)
Writes a Unicode character into the message buffer at the current position.void
writeChars(java.lang.String s)
Writes a String as a sequence of Unicode characters into the message buffer at the current position.void
writeDecimal2(short v)
Writes a 2-byte packed decimal format number into the message buffer at the current position.void
writeDecimal4(int v)
Writes a 4-byte packed decimal format number into the message buffer at the current position.void
writeDecimal8(long v)
Writes an 8-byte packed decimal format number into the message buffer at the current position.void
writeDouble(double v)
Writes a double into the message buffer at the current position.void
writeFloat(float v)
Writes a float into the message buffer at the current position.void
writeInt(int v)
Writes an int into the message buffer at the current position.void
writeInt2(int v)
Identical towriteShort()
, provided for cross-language WMQ API compatibility.void
writeInt4(int v)
Synonym forwriteInt()
, provided for cross-language WMQ API compatibility.void
writeInt8(long v)
Synonym forwriteLong()
, provided for cross-language WMQ API compatibility.void
writeLong(long v)
Writes a long into the message buffer at the current position.void
writeObject(java.lang.Object obj)
Writes an Object into the message.void
writeShort(int v)
Writes a short into the message buffer at the current position.void
writeString(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
.void
writeUTF(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.IOException
Gets 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.IOException
Gets 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.EOFException
Moves the cursor to a new absolute position in the message buffer. Subsequent reads and writes will start from this position in the buffer.- Parameters:
seekOffset
- the new value of the cursor position.- Throws:
java.io.EOFException
- if offset takes cursor outside the message data.
-
setDataOffset
public void setDataOffset(int offset) throws java.io.EOFException
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:
java.io.EOFException
- if offset takes cursor outside the message data.
-
getDataOffset
public int getDataOffset() throws java.io.IOException
Returns the current cursor position within the message data (the point at which read and write operations take effect).- Returns:
- the cursor position.
- Throws:
java.io.IOException
- if there is a problem with IO.
-
clearMessage
public void clearMessage() throws java.io.IOException
Discards 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.IOException
Indicates to the MQMessage class the size of buffer that might be required. If the message currently contains message data and the new size is less than the current size, the message data is truncated. If this message is subsequently used 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.EOFException
Reads a boolean from the current position in the message buffer.- Specified by:
readBoolean
in 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.EOFException
Reads a byte from the current position in the message buffer.- Specified by:
readByte
in 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.EOFException
Reads a character from the current position in the message buffer.- Specified by:
readChar
in 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.EOFException
Reads a double from the current position in the message buffer.- Specified by:
readDouble
in interfacejava.io.DataInput
- Returns:
- a big-endian double if
encoding
is 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.EOFException
Reads a float from the current position in the message buffer.- Specified by:
readFloat
in interfacejava.io.DataInput
- Returns:
- a big-endian float if
encoding
equals 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.IOException
Fills a byte array with data from the message buffer.- Specified by:
readFully
in 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.IOException
Partly fills a byte array with data from the message buffer.- Specified by:
readFully
in 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.EOFException
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:
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.EOFException
Reads a string in the codeset identified bycharacterSet
and 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.IOException
Reads an integer from the current position in the message buffer.- Specified by:
readInt
in interfacejava.io.DataInput
- Returns:
- a big-endian integer if
encoding
is 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.IOException
Synonym 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.IOException
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:
readLine
in 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.IOException
Reads an integer from the current position in the message buffer.- Specified by:
readLong
in interfacejava.io.DataInput
- Returns:
- a big-endian long if
encoding
is 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.IOException
Identical toreadLong()
. Provided for cross-language WMQ API compatibility.- Returns:
- a big-endian long if
encoding
is 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.IOException
Reads a short from the current position in the message buffer.- Specified by:
readShort
in interfacejava.io.DataInput
- Returns:
- a big-endian short if
encoding
is 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.IOException
Identical toreadShort()
. Provided for cross-language MQ API compatibility.- Returns:
- a big-endian short if
encoding
is 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.IOException
Reads a UTF format String from the current position in the message buffer.- Specified by:
readUTF
in interfacejava.io.DataInput
- Returns:
- the String.
- Throws:
java.io.IOException
- if there is a problem with IO.
-
readUnsignedByte
public int readUnsignedByte() throws java.io.IOException
Reads an unsigned byte from the current position in the message buffer.- Specified by:
readUnsignedByte
in 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.IOException
Reads an unsigned short from the current position in the message buffer.- Specified by:
readUnsignedShort
in interfacejava.io.DataInput
- Returns:
- an int that contains a big-endian short if
encoding
is 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.IOException
Identical toreadUnsignedShort()
, provided for cross-language WMQ API compatibility.- Returns:
- an int that contains a big-endian short if
encoding
is 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.IOException
Deprecated. usereadStringOfCharLength(int)
method instead.Reads a string in the codeset identified bycharacterSet
and 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.IOException
Reads a 2-byte packed decimal number in the range -999 to 999.- Returns:
- a big-endian short if
encoding
equals 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.IOException
Reads a 4-byte packed decimal number in the range -9,999,999 to 9,999,999.- Returns:
- a big-endian int if
encoding
equals 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.IOException
Reads an 8-byte packed decimal number in the range -999,999,999,999,999 to 999,999,999,999,999.- Returns:
- a big-endian long if
encoding
equals 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.IOException
Reads an object carried in the message.- Returns:
- the Object.
- Throws:
java.lang.ClassNotFoundException
java.io.InvalidClassException
java.io.StreamCorruptedException
java.io.OptionalDataException
java.io.IOException
-
skipBytes
public int skipBytes(int n) throws java.io.IOException, java.io.EOFException
Moves the cursor forward in the message buffer.- Specified by:
skipBytes
in 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.IOException
Writes a byte into the message buffer at the current position.- Specified by:
write
in 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.IOException
Writes an array of bytes into the message buffer at the current position.- Specified by:
write
in 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.IOException
Writes a series of bytes into the message buffer at the current position.- Specified by:
write
in 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.IOException
Writes a boolean into the message buffer at the current position.- Specified by:
writeBoolean
in 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.IOException
Writes a byte into the message buffer at the current position.- Specified by:
writeByte
in 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.IOException
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 theDataOutput
interface.)
No data conversion is performed by this method. If you wish to write a string to the message with appropriate handling of the character set currently in force, usewriteString(String)
instead of this method.Writes a String as a sequence of bytes into the message buffer at the current position.- Specified by:
writeBytes
in 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.IOException
Writes a Unicode character into the message buffer at the current position.- Specified by:
writeChar
in 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.IOException
Writes a String as a sequence of Unicode characters into the message buffer at the current position.- Specified by:
writeChars
in 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.IOException
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:
writeDouble
in 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.IOException
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:
writeFloat
in 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.IOException
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:
writeInt
in 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.IOException
Synonym 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.IOException
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:
writeLong
in 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.IOException
Synonym 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.IOException
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:
writeShort
in 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.IOException
Identical 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.IOException
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:
java.io.IOException
- if there is a problem with IO.
-
writeDecimal4
public void writeDecimal4(int v) throws java.io.IOException
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:
java.io.IOException
- if there is a problem with IO.
-
writeDecimal8
public void writeDecimal8(long v) throws java.io.IOException
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:
java.io.IOException
- if there is a problem with IO.
-
writeUTF
public void writeUTF(java.lang.String str) throws java.io.IOException
Writes a String in UTF format into the message buffer at the current position.- Specified by:
writeUTF
in 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.IOException
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:
java.io.IOException
- if there is a problem with IO.
-
writeObject
public void writeObject(java.lang.Object obj) throws java.io.IOException
Writes 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:
true
if property validation will take place
-
setPropertyValidation
public void setPropertyValidation(int propertyValidation)
Specifies whether validation of properties should take place when a property of the message is set. Possible values are:- MQCMHO_DEFAULT_VALIDATION, the default
- MQCMHO_VALIDATE
- MQCMHO_NO_VALIDATION
- Parameters:
propertyValidation
- set totrue
if property validation should take place
-
setBooleanProperty
public void setBooleanProperty(java.lang.String name, boolean value) throws MQException
Sets a boolean property value with the specified name into the message, with the default property descriptor.- Parameters:
name
- the name of the boolean property.value
- the boolean property value to set.- Throws:
MQException
- if the property name is invalid.
-
setBooleanProperty
public void setBooleanProperty(java.lang.String name, MQPropertyDescriptor descriptor, boolean value) throws MQException
Sets a boolean property value with the specified name into the message, with the specified property descriptor.- Parameters:
name
- the name of the boolean property.descriptor
- the attributes of the property itself.value
- the boolean property value to set.- Throws:
MQException
- if the property name is invalid.
-
setBytesProperty
public void setBytesProperty(java.lang.String name, byte[] value) throws MQException
Sets a byte array property value with the specified name into the message, with the default property descriptor.- Parameters:
name
- the name of the byte array property.value
- the byte array property value to set.- Throws:
MQException
- if the property name is invalid.
-
setBytesProperty
public void setBytesProperty(java.lang.String name, MQPropertyDescriptor descriptor, byte[] value) throws MQException
Sets a byte array property value with the specified name into the message, with the specified property descriptor.- Parameters:
name
- the name of the byte array property.descriptor
- the attributes of the property itself.value
- the byte array property value to set.- Throws:
MQException
- if the property name is invalid.
-
setByteProperty
public void setByteProperty(java.lang.String name, byte value) throws MQException
Sets a byte property value with the specified name into the message, with the default property descriptor.- Parameters:
name
- the name of the byte property.value
- the byte property value to set.- Throws:
MQException
- if the property name is invalid.
-
setByteProperty
public void setByteProperty(java.lang.String name, MQPropertyDescriptor descriptor, byte value) throws MQException
Sets a byte property value with the specified name into the message, with the specified property descriptor.- Parameters:
name
- the name of the byte property.descriptor
- the attributes of the property itself.value
- the byte property value to set.- Throws:
MQException
- if the property name is invalid.
-
setShortProperty
public void setShortProperty(java.lang.String name, short value) throws MQException
Sets a short property value with the specified name into the message, with the default property descriptor.- Parameters:
name
- the name of the short property.value
- the short property value to set.- Throws:
MQException
- if the property name is invalid.
-
setShortProperty
public void setShortProperty(java.lang.String name, MQPropertyDescriptor descriptor, short value) throws MQException
Sets a short property value with the specified name into the message, with the specified property descriptor.- Parameters:
name
- the name of the short property.descriptor
- the attributes of the property itself.value
- the short property value to set.- Throws:
MQException
- if the property name is invalid.
-
setInt2Property
public void setInt2Property(java.lang.String name, short value) throws MQException
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(java.lang.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
public void setIntProperty(java.lang.String name, int value) throws MQException
Sets a int property value with the specified name into the message, with the default property descriptor.- Parameters:
name
- the name of the int property.value
- the int property value to set.- Throws:
MQException
- if the property name is invalid.
-
setIntProperty
public void setIntProperty(java.lang.String name, MQPropertyDescriptor descriptor, int value) throws MQException
Sets a int property value with the specified name into the message, with the specified property descriptor.- Parameters:
name
- the name of the int property.descriptor
- the attributes of the property itself.value
- the int property value to set.- Throws:
MQException
- if the property name is invalid.
-
setInt4Property
public void setInt4Property(java.lang.String name, int value) throws MQException
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(java.lang.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
public void setLongProperty(java.lang.String name, long value) throws MQException
Sets a long property value with the specified name into the message, with the default property descriptor.- Parameters:
name
- the name of the long property.value
- the long property value to set.- Throws:
MQException
- if the property name is invalid.
-
setLongProperty
public void setLongProperty(java.lang.String name, MQPropertyDescriptor descriptor, long value) throws MQException
Sets a long property value with the specified name into the message, with the specified property descriptor.- Parameters:
name
- the name of the long property.descriptor
- the attributes of the property itself.value
- the long property value to set.- Throws:
MQException
- if the property name is invalid.
-
setInt8Property
public void setInt8Property(java.lang.String name, long value) throws MQException
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(java.lang.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
public void setFloatProperty(java.lang.String name, float value) throws MQException
Sets a float property value with the specified name into the message, with the default property descriptor.- Parameters:
name
- the name of the float property.value
- the float property value to set.- Throws:
MQException
- if the property name is invalid.
-
setFloatProperty
public void setFloatProperty(java.lang.String name, MQPropertyDescriptor descriptor, float value) throws MQException
Sets a float property value with the specified name into the message, with the specified property descriptor.- Parameters:
name
- the name of the float property.descriptor
- the attributes of the property itself.value
- the float property value to set.- Throws:
MQException
- if the property name is invalid.
-
setDoubleProperty
public void setDoubleProperty(java.lang.String name, double value) throws MQException
Sets a double property value with the specified name into the message, with the default property descriptor.- Parameters:
name
- the name of the double property.value
- the double property value to set.- Throws:
MQException
- if the property name is invalid.
-
setDoubleProperty
public void setDoubleProperty(java.lang.String name, MQPropertyDescriptor descriptor, double value) throws MQException
Sets a double property value with the specified name into the message, with the specified property descriptor.- Parameters:
name
- the name of the double property.descriptor
- the attributes of the property itself.value
- the double property value to set.- Throws:
MQException
- if the property name is invalid.
-
setStringProperty
public void setStringProperty(java.lang.String name, java.lang.String value) throws MQException
Sets a String property value with the specified name into the message, with the default property descriptor.- Parameters:
name
- the name of the String property.value
- the String property value to set.- Throws:
MQException
- if the property name is invalid.
-
setStringProperty
public void setStringProperty(java.lang.String name, MQPropertyDescriptor descriptor, java.lang.String value) throws MQException
Sets a String property value with the specified name into the message, with the specified property descriptor.- Parameters:
name
- the name of the String property.descriptor
- the attributes of the property itself.value
- the String property value to set.- Throws:
MQException
- if the property name is invalid.
-
setObjectProperty
public void setObjectProperty(java.lang.String name, java.lang.Object value) throws MQException
Sets a Java object property value with the specified name into the message, with the default property descriptor. Note that this method works only for the objectified primitive object types (Integer, Double, Long ...) and String objects. The property is set as if the set*Property method had been called directly e.g. Integer leads to an int property value being set, Long leads to a long property value being set etc.- Parameters:
name
- the name of the Java object property.value
- the Java object property value to set.- Throws:
MQException
- if the property name is invalid.
-
setObjectProperty
public void setObjectProperty(java.lang.String name, MQPropertyDescriptor descriptor, java.lang.Object value) throws MQException
Sets a Java object property value with the specified name into the message, with the specified property descriptor. Note that this method works only for the objectified primitive object types (Integer, Double, Long ...) and String objects. The property is set as if the set*Property method had been called directly e.g. Integer leads to an int property value being set, Long leads to a long property value being set etc.- Parameters:
name
- the name of the Java object property.descriptor
- the attributes of the property itself.value
- the Java object property value to set.- Throws:
MQException
- if the property name is invalid.
-
getBooleanProperty
public boolean getBooleanProperty(java.lang.String name) throws MQException
Returns the value of the boolean property with the specified name.- Parameters:
name
- the name of the boolean property.- Returns:
- the boolean property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getBooleanProperty
public boolean getBooleanProperty(java.lang.String name, MQPropertyDescriptor descriptor) throws MQException
Returns the value of the boolean property with the specified name, filling in the specified property descriptor.- Parameters:
name
- the name of the boolean property.descriptor
- the attributes of the property itself.- Returns:
- the boolean property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getBytesProperty
public byte[] getBytesProperty(java.lang.String name) throws MQException
Returns the value of the byte array property with the specified name.- Parameters:
name
- the name of the byte array property.- Returns:
- the byte array property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getBytesProperty
public byte[] getBytesProperty(java.lang.String name, MQPropertyDescriptor descriptor) throws MQException
Returns the value of the byte array property with the specified name, filling in the specified property descriptor.- Parameters:
name
- the name of the byte array property.descriptor
- the attributes of the property itself.- Returns:
- the byte array property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getByteProperty
public byte getByteProperty(java.lang.String name) throws MQException
Returns the value of the byte property with the specified name.- Parameters:
name
- the name of the byte property.- Returns:
- the byte property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getByteProperty
public byte getByteProperty(java.lang.String name, MQPropertyDescriptor descriptor) throws MQException
Returns the value of the byte property with the specified name, filling in the specified property descriptor.- Parameters:
name
- the name of the byte property.descriptor
- the attributes of the property itself.- Returns:
- the byte property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getShortProperty
public short getShortProperty(java.lang.String name) throws MQException
Returns the value of the short property with the specified name.- Parameters:
name
- the name of the short property.- Returns:
- the short property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getShortProperty
public short getShortProperty(java.lang.String name, MQPropertyDescriptor descriptor) throws MQException
Returns the value of the short property with the specified name, filling in the specified property descriptor.- Parameters:
name
- the name of the short property.descriptor
- the attributes of the property itself.- Returns:
- the short property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getInt2Property
public short getInt2Property(java.lang.String name) throws MQException
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
public short getInt2Property(java.lang.String name, MQPropertyDescriptor descriptor) throws MQException
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
public int getIntProperty(java.lang.String name) throws MQException
Returns the value of the int property with the specified name.- Parameters:
name
- the name of the int property.- Returns:
- the int property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getIntProperty
public int getIntProperty(java.lang.String name, MQPropertyDescriptor descriptor) throws MQException
Returns the value of the int property with the specified name, filling in the specified property descriptor.- Parameters:
name
- the name of the int property.descriptor
- the attributes of the property itself.- Returns:
- the int property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getInt4Property
public int getInt4Property(java.lang.String name) throws MQException
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
public int getInt4Property(java.lang.String name, MQPropertyDescriptor descriptor) throws MQException
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
public long getLongProperty(java.lang.String name) throws MQException
Returns the value of the long property with the specified name.- Parameters:
name
- the name of the long property.- Returns:
- the long property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getLongProperty
public long getLongProperty(java.lang.String name, MQPropertyDescriptor descriptor) throws MQException
Returns the value of the long property with the specified name, filling in the specified property descriptor.- Parameters:
name
- the name of the long property.descriptor
- the attributes of the property itself.- Returns:
- the long property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getInt8Property
public long getInt8Property(java.lang.String name) throws MQException
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
public long getInt8Property(java.lang.String name, MQPropertyDescriptor descriptor) throws MQException
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
public float getFloatProperty(java.lang.String name) throws MQException
Returns the value of the float property with the specified name.- Parameters:
name
- the name of the float property.- Returns:
- the float property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getFloatProperty
public float getFloatProperty(java.lang.String name, MQPropertyDescriptor descriptor) throws MQException
Returns the value of the float property with the specified name, filling in the specified property descriptor.- Parameters:
name
- the name of the float property.descriptor
- the attributes of the property itself.- Returns:
- the float property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getDoubleProperty
public double getDoubleProperty(java.lang.String name) throws MQException
Returns the value of the double property with the specified name.- Parameters:
name
- the name of the double property.- Returns:
- the double property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getDoubleProperty
public double getDoubleProperty(java.lang.String name, MQPropertyDescriptor descriptor) throws MQException
Returns the value of the double property with the specified name, filling in the specified property descriptor.- Parameters:
name
- the name of the double property.descriptor
- the attributes of the property itself.- Returns:
- the double property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getStringProperty
public java.lang.String getStringProperty(java.lang.String name) throws MQException
Returns the value of the String property with the specified name.- Parameters:
name
- the name of the String property.- Returns:
- the String property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getStringProperty
public java.lang.String getStringProperty(java.lang.String name, MQPropertyDescriptor descriptor) throws MQException
Returns the value of the String property with the specified name, filling in the specified property descriptor.- Parameters:
name
- the name of the String property.descriptor
- the attributes of the property itself.- Returns:
- the String property value for the specified name; if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist or the type conversion is invalid.
-
getObjectProperty
public java.lang.Object getObjectProperty(java.lang.String name) throws MQException
Returns the value of the Java object property with the specified name. This method can be used to return, in objectified format, an object that has been stored as a property in the message with the equivalentsetObjectProperty(String, Object)
method call, or its equivalent primitive#set*Property
method.- Parameters:
name
- the name of the Java object property.- Returns:
- the Java object property value for the specified name, in objectified format (for example, if the property was set as an int, an Integer is returned); if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist
-
getObjectProperty
public java.lang.Object getObjectProperty(java.lang.String name, MQPropertyDescriptor descriptor) throws MQException
Returns the value of the Java object property with the specified name, filling in the specified property descriptor. This method can be used to return, in objectified format, an object that has been stored as a property in the message with the equivalentsetObjectProperty(String, Object)
method call, or its equivalent primitive#set*Property
method.- Parameters:
name
- the name of the Java object property.descriptor
- the attributes of the property itself.- Returns:
- the Java object property value for the specified name, in objectified format (for example, if the property was set as an int, an Integer is returned); if there is no property by this name, an MQException is thrown.
- Throws:
MQException
- if property does not exist
-
getPropertyNames
public java.util.Enumeration<java.lang.String> getPropertyNames(java.lang.String nameP) throws MQException
Returns an Enumeration of all the property names matching the specified name. The wildcard character "%" can be used at the end of the name to filter the properties of the message, matching on zero or more characters, including the "." character.- Parameters:
nameP
- the name of the property to match on.- Returns:
- an enumeration of all the names of property values where the property name matches the specified name.
- Throws:
MQException
- if the property name is invalid.
-
deleteProperty
public void deleteProperty(java.lang.String nameP) throws MQException
Deletes a property with the specified name from the message.- Parameters:
nameP
- the name of the property to delete.- Throws:
MQException
- if the property name is invalid or does not exist.
-
-