Sun Adapter for Websphere MQ API

com.stc.connector.webspheremqadapter.message
Class Message

java.lang.Object
  extended by com.ibm.mq.MQMD
      extended by com.ibm.mq.MQMessage
          extended by com.stc.connector.webspheremqadapter.message.Message
All Implemented Interfaces:
com.stc.connector.persistence.bpel.PersistableData, IMessage, java.io.DataInput, java.io.DataOutput

public class Message
extends com.ibm.mq.MQMessage
implements IMessage

Represents a WebSphere MQ message, both its descriptor and data. This is the class exposed as part of the eWay's OTD(s). It subclasses MQMessage to add logging and to expose MQMessage public variables in the Java Collaboration Editor by giving them accessors and mutators (the Editor does not allow direct manipulation of fields, even if public).

Version:
$Revision: 1.5 $
See Also:
com.stc.connector.webspheremqadapter.message.MQOtd

Nested Class Summary
 class Message.MsgBody
          Facade for the data (buffer) portion of a Message.
 class Message.MsgHeader
          Facade that represents the descriptor portion of a Message.
 
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, userId
 
Constructor Summary
Message()
           
 
Method Summary
 void assignEwayConfiguration(MQClientConfiguration cfg)
          Associates an eWay configuration set to this message, for the purpose of giving users access to the eWay configuration.
 void assignSyncpointController(ISyncpointControl sc)
          Associate a syncpoint controller to this message, for the purpose of giving users access to a restricted representation of the controller at a later time, in order to roll back or commit the message.
 void clearMessage()
          Discards data in the message buffer and reset the data offset to zero.
 int getDataLength()
          Reports the number of bytes of data remaining to be read in the message.
 int getDataOffset()
          Returns the current position of the cursor within the message.
 EwayConfiguration getEwayConfiguration()
          Obtains a reference to the configuration object of the eWay that is associated with the message.
 int getMessageLength()
          Reports the total number of bytes in the stored message on the queue.
 IMessage.MsgBody getMsgBody()
          Obtain a reference to the MsgBody object representing the Message's content.
 IMessage.MsgHeader getMsgHeader()
          Obtain a reference to the MsgHeader object representing the message's descriptor.
 ISyncpointControl getSyncpointController()
          Retrieve the syncpoint controller associated to this Message.
 int getTotalMessageLength()
          If MQQueue.get() fails with a message-truncated error code, getTotalMessageLength() reports the total number of bytes in the stored message on the queue.
 void persist(com.stc.connector.persistence.bpel.DataOutput output)
           
 boolean readBoolean()
          Reads a (signed) byte from the present position in the message buffer.
 byte readByte()
          Reads a byte from the present position in the message buffer.
 char readChar()
          Reads a Unicode character from the present position in the message buffer.
 short readDecimal2()
          Reads a 2-byte packed decimal number (-999 to 999).
 int readDecimal4()
          Reads a 4-byte packed decimal number (-9999999 to 9999999).
 long readDecimal8()
          Reads an 8-byte packed decimal number (-999999999999999 to 999999999999999).
 double readDouble()
          Reads a double from the present position in the message buffer.
 float readFloat()
          Reads a float from the present position in the message buffer.
 void readFully(byte[] buffer)
          Fills the byte array with data from the message buffer.
 void readFully(byte[] buffer, int offset, int len)
          Fills the len elements of the byte array b with data from the message buffer, starting at offset off.
 int readInt()
          Reads an integer from the present position in the message buffer.
 short readInt2()
          Equivalent to readshort(), but readInt2 is provided for cross-language MQSeries API compatibility.
 int readInt4()
          Equivalent to readInt(), but readInt4 is provided for cross-language MQSeries API compatibility.
 long readInt8()
          Equivalent to readlong(), but readInt8 is provided for cross-language MQSeries API compatibility.
 java.lang.String readLine()
          Converts from the codeset defined in the characterSet member variable to Unicode, then reads in a line that has been terminated by \n, \r, \r\n, or EOF.
 long readLong()
          Reads a long from the present position in the message buffer.
 java.lang.Object readObject()
          Reads an object, its class, class signature, and the value of the non-transient and nonstatic fields of the class.
 short readShort()
          Reads a short from the present position in the message buffer.
 java.lang.String readString(int length)
          Reads a string in the codeset defined by the characterSet member variable.
 int readUInt2()
          Equivalent to readUnsignedShort(), but readUInt2 is provided for cross-language MQSeries API compatibility.
 int readUnsignedByte()
          Reads an unsigned byte from the present position in the message buffer.
 int readUnsignedShort()
          Reads an unsigned short from the present position in the message buffer.
 java.lang.String readUTF()
          Reads a UTF string, prefixed by a 2-byte length field, from the present position in the message buffer.
 void resizeBuffer(int size)
          Clues the MQMessage object as to the size of buffer that may be necessary for subsequent get operations.
 void restore(com.stc.connector.persistence.bpel.DataInput input)
           
 void seek(int pos)
          Relocates the cursor to the absolute position in the message buffer given by pos.
 void setDataOffset(int offset)
          Relocates the cursor to the absolute position in the message buffer.
 void setVersion(int version)
          Sets the version of the structure to be used.
 int skipBytes(int numberOfBytes)
          Advances n bytes in the message buffer.
 void write(byte[] byteArray)
          Writes a byte, an array of bytes, or a series of bytes into the message buffer at the present position.
 void write(byte[] byteArray, int offset, int len)
          Writes a byte, an array of bytes, or a series of bytes into the message buffer at the present position.
 void write(int byteValue)
          Writes a byte, an array of bytes, or a series of bytes into the message buffer at the present position.
 void writeBoolean(boolean boolValue)
          Writes a Boolean into the message buffer at the present position.
 void writeByte(int byteValue)
          Writes a byte into the message buffer at the present position.
 void writeBytes(java.lang.String stringValue)
          Writes the string to the message buffer as a sequence of bytes.
 void writeChar(int unicodeChar)
          Writes a Unicode character into the message buffer at the present position.
 void writeChars(java.lang.String str)
          Writes a string as a sequence of Unicode characters into the message buffer at the current position.
 void writeDecimal2(short decimal2Value)
          Writes a 2-byte packed decimal format number into the message buffer at the present position.
 void writeDecimal4(int decimal4Value)
          Writes an 4-byte packed decimal format number into the message buffer at the present position.
 void writeDecimal8(long decimal8Value)
          Writes an 8-byte packed decimal format number into the message buffer at the present position.
 void writeDouble(double doubleValue)
          Writes a double into the message buffer at the present position.
 void writeFloat(float floatValue)
          Writes a float into the message buffer at the present position.
 void writeInt(int intValue)
          Writes an integer into the message buffer at the present position.
 void writeInt2(int shortValue)
          Writes an integer into the message buffer at the present position.
 void writeInt4(int intValue)
          Writes an integer into the message buffer at the present position.
 void writeInt8(long longValue)
          Writes an integer into the message buffer at the present position.
 void writeLong(long longValue)
          Writes a long into the message buffer at the present position.
 void writeObject(java.lang.Object objValue)
          Writes the specified object, object class, class signature, and the values of the nontransient and non-static fields of the class and all its supertypes.
 void writeShort(int shortValue)
          Writes a short into the message buffer at the present position.
 void writeString(java.lang.String stringValue)
          Writes a string into the message buffer at the present position, converting it to the codeset identified by the characterSet member variable.
 void writeUTF(java.lang.String utfString)
          Writes a UTF string, prefixed by a 2-byte length field, into the message buffer at the present position.
 
Methods inherited from class com.ibm.mq.MQMessage
readMQMDE, unicodeFrom1051, writeMQMDE
 
Methods inherited from class com.ibm.mq.MQMD
getVersion, readFrom, writeTo
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Message

public Message()
Method Detail

getMsgBody

public IMessage.MsgBody getMsgBody()
Obtain a reference to the MsgBody object representing the Message's content.

Specified by:
getMsgBody in interface IMessage
Returns:
MsgBody object for the Message.
See Also:
Message.MsgBody

getMsgHeader

public IMessage.MsgHeader getMsgHeader()
Obtain a reference to the MsgHeader object representing the message's descriptor.

Specified by:
getMsgHeader in interface IMessage
Returns:
MsgHeader object for the Messge.
See Also:
Message.MsgHeader

assignEwayConfiguration

public void assignEwayConfiguration(MQClientConfiguration cfg)
Associates an eWay configuration set to this message, for the purpose of giving users access to the eWay configuration.

Specified by:
assignEwayConfiguration in interface IMessage
Parameters:
cfg - eWay configuration object

getEwayConfiguration

public EwayConfiguration getEwayConfiguration()
Obtains a reference to the configuration object of the eWay that is associated with the message.

Specified by:
getEwayConfiguration in interface IMessage
Returns:
Message's eWay Configuration object

assignSyncpointController

public void assignSyncpointController(ISyncpointControl sc)
Associate a syncpoint controller to this message, for the purpose of giving users access to a restricted representation of the controller at a later time, in order to roll back or commit the message.

Specified by:
assignSyncpointController in interface IMessage
Parameters:
sc - The syncpoint controller.

getSyncpointController

public ISyncpointControl getSyncpointController()
Retrieve the syncpoint controller associated to this Message. May be null.

Specified by:
getSyncpointController in interface IMessage
Returns:
ISyncpointControl - Returns the syncpoint controller.
Throws:
None.

getTotalMessageLength

public int getTotalMessageLength()
Description copied from interface: IMessage
If MQQueue.get() fails with a message-truncated error code, getTotalMessageLength() reports the total number of bytes in the stored message on the queue.

Parameters:
None.

Specified by:
getTotalMessageLength in interface IMessage
Overrides:
getTotalMessageLength in class com.ibm.mq.MQMessage
Returns:
int - Returns the total message length.
Throws:
None.
See Also:
MQMessage.getTotalMessageLength()

getMessageLength

public int getMessageLength()
                     throws java.io.IOException
Description copied from interface: IMessage
Reports the total number of bytes in the stored message on the queue.

Parameters:
None.

Specified by:
getMessageLength in interface IMessage
Overrides:
getMessageLength in class com.ibm.mq.MQMessage
Returns:
int - Returns the total number of bytes in the stored message on the queue
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.getMessageLength()

getDataLength

public int getDataLength()
                  throws java.io.IOException
Description copied from interface: IMessage
Reports the number of bytes of data remaining to be read in the message.

Parameters:
None.

Specified by:
getDataLength in interface IMessage
Overrides:
getDataLength in class com.ibm.mq.MQMessage
Returns:
int - Returns the number of bytes of data remaining to be read in the message.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.getDataLength()

seek

public void seek(int pos)
          throws java.io.IOException
Description copied from interface: IMessage
Relocates the cursor to the absolute position in the message buffer given by pos. Any further reads and writes act at this position in the buffer.

Specified by:
seek in interface IMessage
Overrides:
seek in class com.ibm.mq.MQMessage
Parameters:
pos - Gives the absolute position in the message buffer.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.seek(int)

setDataOffset

public void setDataOffset(int offset)
                   throws java.io.IOException
Description copied from interface: IMessage
Relocates the cursor to the absolute position in the message buffer. setDataOffset() is equivalent to seek(), allowing for cross-language compatibility with the other WebSphere MQ APIs.

Specified by:
setDataOffset in interface IMessage
Overrides:
setDataOffset in class com.ibm.mq.MQMessage
Parameters:
offset - Gives the absolute position in the message buffer.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.setDataOffset(int)

getDataOffset

public int getDataOffset()
                  throws java.io.IOException
Description copied from interface: IMessage
Returns the current position of the cursor within the message. This is the point at which read and write operations take effect.

Parameters:
None.

Specified by:
getDataOffset in interface IMessage
Overrides:
getDataOffset in class com.ibm.mq.MQMessage
Returns:
int - Returns the current cursor position.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.getDataOffset()

clearMessage

public void clearMessage()
                  throws java.io.IOException
Description copied from interface: IMessage
Discards data in the message buffer and reset the data offset to zero.

Parameters:
None.

Specified by:
clearMessage in interface IMessage
Overrides:
clearMessage in class com.ibm.mq.MQMessage
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.clearMessage()

resizeBuffer

public void resizeBuffer(int size)
                  throws java.io.IOException
Description copied from interface: IMessage
Clues the MQMessage object as to the size of buffer that may be necessary for subsequent get operations. When a message contains message data and the new size is less than the current size, the message data is truncated.

Specified by:
resizeBuffer in interface IMessage
Overrides:
resizeBuffer in class com.ibm.mq.MQMessage
Parameters:
size - The size of the buffer.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.resizeBuffer(int)

readBoolean

public boolean readBoolean()
                    throws java.io.EOFException,
                           java.io.IOException
Description copied from interface: IMessage
Reads a (signed) byte from the present position in the message buffer.

Parameters:
None.

Specified by:
readBoolean in interface IMessage
Specified by:
readBoolean in interface java.io.DataInput
Overrides:
readBoolean in class com.ibm.mq.MQMessage
Returns:
Boolean - Returns a byte from the current position in the message buffer.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readBoolean()

readByte

public byte readByte()
              throws java.io.IOException,
                     java.io.EOFException
Description copied from interface: IMessage
Reads a byte from the present position in the message buffer.

Parameters:
None.

Specified by:
readByte in interface IMessage
Specified by:
readByte in interface java.io.DataInput
Overrides:
readByte in class com.ibm.mq.MQMessage
Returns:
byte - Returns a byte from the current position in the message buffer.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readByte()

readChar

public char readChar()
              throws java.io.EOFException,
                     java.io.IOException
Description copied from interface: IMessage
Reads a Unicode character from the present position in the message buffer.

Parameters:
None.

Specified by:
readChar in interface IMessage
Specified by:
readChar in interface java.io.DataInput
Overrides:
readChar in class com.ibm.mq.MQMessage
Returns:
char - Returns a unicode character from the current position in the message buffer.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readChar()

readDouble

public double readDouble()
                  throws java.io.EOFException,
                         java.io.IOException
Description copied from interface: IMessage
Reads a double from the present position in the message buffer. Actions are determined by the value of the encoding member variable.

Parameters:
None.

Specified by:
readDouble in interface IMessage
Specified by:
readDouble in interface java.io.DataInput
Overrides:
readDouble in class com.ibm.mq.MQMessage
Returns:
double - Returns a double from the current position in the message buffer.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readDouble()

readFloat

public float readFloat()
                throws java.io.EOFException,
                       java.io.IOException
Description copied from interface: IMessage
Reads a float from the present position in the message buffer. Actions are determined by the value of the encoding member variable.

Parameters:
None.

Specified by:
readFloat in interface IMessage
Specified by:
readFloat in interface java.io.DataInput
Overrides:
readFloat in class com.ibm.mq.MQMessage
Returns:
float - Returns a float from the present position in the message buffer.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readFloat()

readFully

public void readFully(byte[] buffer)
               throws java.io.EOFException,
                      java.io.IOException
Description copied from interface: IMessage
Fills the byte array with data from the message buffer.

Specified by:
readFully in interface IMessage
Specified by:
readFully in interface java.io.DataInput
Overrides:
readFully in class com.ibm.mq.MQMessage
Parameters:
buffer - Data from the message buffer.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readFully(byte[])

readFully

public void readFully(byte[] buffer,
                      int offset,
                      int len)
               throws java.io.EOFException,
                      java.io.IOException
Description copied from interface: IMessage
Fills the len elements of the byte array b with data from the message buffer, starting at offset off.

Specified by:
readFully in interface IMessage
Specified by:
readFully in interface java.io.DataInput
Overrides:
readFully in class com.ibm.mq.MQMessage
Parameters:
buffer - Fills the byte array with data from the message buffer.
offset - The offset at which the fill starts.
len - Fills len elements of the byte array with data from the message buffer.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readFully(byte[], int, int)

readInt

public int readInt()
            throws java.io.EOFException,
                   java.io.IOException
Description copied from interface: IMessage
Reads an integer from the present position in the message buffer. Actions are determined by the value of the encoding member variable.

A value of MQC.MQENC_INTEGER_NORMAL reads a big-endian integer, a value of MQC.MQENC_INTEGER_REVERSED reads a little-endian integer.

Parameters:
None.

Specified by:
readInt in interface IMessage
Specified by:
readInt in interface java.io.DataInput
Overrides:
readInt in class com.ibm.mq.MQMessage
Returns:
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readInt()

readInt4

public int readInt4()
             throws java.io.EOFException,
                    java.io.IOException
Description copied from interface: IMessage
Equivalent to readInt(), but readInt4 is provided for cross-language MQSeries API compatibility.

Parameters:
None.

Specified by:
readInt4 in interface IMessage
Overrides:
readInt4 in class com.ibm.mq.MQMessage
Returns:
int - Returns an integer from the current position in the message buffer.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readInt4()

readLine

public java.lang.String readLine()
                          throws java.io.IOException
Description copied from interface: IMessage
Converts from the codeset defined in the characterSet member variable to Unicode, then reads in a line that has been terminated by \n, \r, \r\n, or EOF.

Parameters:
None.

Specified by:
readLine in interface IMessage
Specified by:
readLine in interface java.io.DataInput
Overrides:
readLine in class com.ibm.mq.MQMessage
Returns:
String - Returns the unicode characterSet.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readLine()

readLong

public long readLong()
              throws java.io.EOFException,
                     java.io.IOException
Description copied from interface: IMessage
Reads a long from the present position in the message buffer. Actions are determined by the value of the encoding member variable.

A value of MQC.MQENC_INTEGER_NORMAL reads a big-endian long, a value of MQC.MQENC_INTEGER_REVERSED reads a little-endian long.

Parameters:
None.

Specified by:
readLong in interface IMessage
Specified by:
readLong in interface java.io.DataInput
Overrides:
readLong in class com.ibm.mq.MQMessage
Returns:
long - Returns a long from the present position in the message buffer.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readLong()

readInt8

public long readInt8()
              throws java.io.EOFException,
                     java.io.IOException
Description copied from interface: IMessage
Equivalent to readlong(), but readInt8 is provided for cross-language MQSeries API compatibility.

Parameters:
None.

Specified by:
readInt8 in interface IMessage
Overrides:
readInt8 in class com.ibm.mq.MQMessage
Returns:
long - Returns a long from the present position in the message buffer.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readInt8()

readObject

public java.lang.Object readObject()
                            throws java.lang.ClassNotFoundException,
                                   java.io.InvalidClassException,
                                   java.io.StreamCorruptedException,
                                   java.io.OptionalDataException,
                                   java.io.IOException
Description copied from interface: IMessage
Reads an object, its class, class signature, and the value of the non-transient and nonstatic fields of the class.

Parameters:
None.

Specified by:
readObject in interface IMessage
Overrides:
readObject in class com.ibm.mq.MQMessage
Returns:
object - Returns an object, its class, class signature, and vield value.
Throws:
java.lang.ClassNotFoundException - Thrown when an error occurs.
java.io.InvalidClassException - Thrown when an error occurs.
java.io.StreamCorruptedException - Thrown when an error occurs.
java.io.OptionalDataException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readObject()

readShort

public short readShort()
                throws java.io.EOFException,
                       java.io.IOException
Description copied from interface: IMessage
Reads a short from the present position in the message buffer. Actions are determined by the value of the encoding member variable.

A value of MQC.MQENC_INTEGER_NORMAL reads a big-endian short, a value of MQC.MQENC_INTEGER_REVERSED reads a little-endian short.

Parameters:
None.

Specified by:
readShort in interface IMessage
Specified by:
readShort in interface java.io.DataInput
Overrides:
readShort in class com.ibm.mq.MQMessage
Returns:
short - Returns a short from the present position in the message buffer.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readShort()

readInt2

public short readInt2()
               throws java.io.EOFException,
                      java.io.IOException
Description copied from interface: IMessage
Equivalent to readshort(), but readInt2 is provided for cross-language MQSeries API compatibility.

Parameters:
None.

Specified by:
readInt2 in interface IMessage
Overrides:
readInt2 in class com.ibm.mq.MQMessage
Returns:
short - Returns a short from the present position in the message buffer.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readInt2()

readUTF

public java.lang.String readUTF()
                         throws java.io.IOException
Description copied from interface: IMessage
Reads a UTF string, prefixed by a 2-byte length field, from the present position in the message buffer.

Parameters:
None.

Specified by:
readUTF in interface IMessage
Specified by:
readUTF in interface java.io.DataInput
Overrides:
readUTF in class com.ibm.mq.MQMessage
Returns:
String - Returns a UTF String, beginning with a 2-byte length field, from the present position in the message buffer.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readUTF()

readUnsignedByte

public int readUnsignedByte()
                     throws java.io.EOFException,
                            java.io.IOException
Description copied from interface: IMessage
Reads an unsigned byte from the present position in the message buffer.

Parameters:
None.

Specified by:
readUnsignedByte in interface IMessage
Specified by:
readUnsignedByte in interface java.io.DataInput
Overrides:
readUnsignedByte in class com.ibm.mq.MQMessage
Returns:
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readUnsignedByte()

readUnsignedShort

public int readUnsignedShort()
                      throws java.io.EOFException,
                             java.io.IOException
Description copied from interface: IMessage
Reads an unsigned short from the present position in the message buffer. Actions are determined by the value of the encoding member variable.

A value of MQC.MQENC_INTEGER_NORMAL reads a big-endian unsigned short, a value of MQC.MQENC_INTEGER_REVERSED reads a little-endian unsigned short.

Parameters:
None.

Specified by:
readUnsignedShort in interface IMessage
Specified by:
readUnsignedShort in interface java.io.DataInput
Overrides:
readUnsignedShort in class com.ibm.mq.MQMessage
Returns:
int - Returns an unsigned byte from the present position in the message buffer.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readUnsignedShort()

readUInt2

public int readUInt2()
              throws java.io.EOFException,
                     java.io.IOException
Description copied from interface: IMessage
Equivalent to readUnsignedShort(), but readUInt2 is provided for cross-language MQSeries API compatibility.

Parameters:
None.

Specified by:
readUInt2 in interface IMessage
Overrides:
readUInt2 in class com.ibm.mq.MQMessage
Returns:
int - Returns an unsigned int from the present position in the message buffer.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readUInt2()

readString

public java.lang.String readString(int length)
                            throws java.io.EOFException,
                                   java.io.IOException
Description copied from interface: IMessage
Reads a string in the codeset defined by the characterSet member variable. Convert the string into Unicode.

Specified by:
readString in interface IMessage
Overrides:
readString in class com.ibm.mq.MQMessage
Parameters:
length - The number of characters to read (not the same as the number of bytes).
Returns:
String - Returns the Unicode value of the string in the codeset defined by the characterSet member variable.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readString(int)

readDecimal2

public short readDecimal2()
                   throws java.io.EOFException,
                          java.io.IOException
Description copied from interface: IMessage
Reads a 2-byte packed decimal number (-999 to 999). Actions are determined by the value of the encoding member variable.

Parameters:
None.

Specified by:
readDecimal2 in interface IMessage
Overrides:
readDecimal2 in class com.ibm.mq.MQMessage
Returns:
short - Returns a 2-byte packed decimal number.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readDecimal2()

readDecimal4

public int readDecimal4()
                 throws java.io.EOFException,
                        java.io.IOException
Description copied from interface: IMessage
Reads a 4-byte packed decimal number (-9999999 to 9999999). Actions are determined by the value of the encoding member variable.

A value of MQC.MQENC_DECIMAL_NORMAL reads a big-endian packed decimal number, and a value of MQC.MQENC_DECIMAL_REVERSED reads a little-endian packed decimal number.

Parameters:
None.

Specified by:
readDecimal4 in interface IMessage
Overrides:
readDecimal4 in class com.ibm.mq.MQMessage
Returns:
int - Returns a 4-byte packed decimal number.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readDecimal4()

readDecimal8

public long readDecimal8()
                  throws java.io.EOFException,
                         java.io.IOException
Description copied from interface: IMessage
Reads an 8-byte packed decimal number (-999999999999999 to 999999999999999). Actions are determined by the value of the encoding member variable.

A value of MQC.MQENC_DECIMAL_NORMAL reads a big-endian packed decimal number, and a value of MQC.MQENC_DECIMAL_REVERSED reads a little-endian packed decimal number.

Parameters:
None.

Specified by:
readDecimal8 in interface IMessage
Overrides:
readDecimal8 in class com.ibm.mq.MQMessage
Returns:
long - Returns an 8-byte packed decimal number.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.readDecimal8()

setVersion

public void setVersion(int version)
                throws MQException
Description copied from interface: IMessage
Sets the version of the structure to be used. Values may include MQC.MQMD_VERSION_1 or MQC.MQMD_VERSION_2.

This method is used when it is necessary to force a client to use a version 1 structure when connected to a queue manager that is able to handling version 2 structures. In all other situations, the client determines the correct version by querying the queue manager's capabilities.

Specified by:
setVersion in interface IMessage
Overrides:
setVersion in class com.ibm.mq.MQMD
Parameters:
version - The version number.
Throws:
MQException - Thrown when an error occurs.
See Also:
MQMD.setVersion(int)

skipBytes

public int skipBytes(int numberOfBytes)
              throws java.io.EOFException,
                     java.io.IOException
Description copied from interface: IMessage
Advances n bytes in the message buffer. Block until all the bytes are skipped, the end of message buffer is detected, or an exception is thrown.

Specified by:
skipBytes in interface IMessage
Specified by:
skipBytes in interface java.io.DataInput
Overrides:
skipBytes in class com.ibm.mq.MQMessage
Parameters:
numberOfBytes - Move forward n bytes in the message buffer.
Returns:
int - Returns the number of bytes skipped, which is always n.
Throws:
java.io.EOFException - Thrown when an error occurs.
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.skipBytes(int)

write

public void write(int byteValue)
           throws java.io.IOException
Description copied from interface: IMessage
Writes a byte, an array of bytes, or a series of bytes into the message buffer at the present position. len bytes are written, taken from offset off in the array b.

Specified by:
write in interface IMessage
Specified by:
write in interface java.io.DataOutput
Overrides:
write in class com.ibm.mq.MQMessage
Parameters:
byteValue -
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.write(int)

write

public void write(byte[] byteArray)
           throws java.io.IOException
Description copied from interface: IMessage
Writes a byte, an array of bytes, or a series of bytes into the message buffer at the present position. len bytes are written, taken from offset off in the array b.

Specified by:
write in interface IMessage
Specified by:
write in interface java.io.DataOutput
Overrides:
write in class com.ibm.mq.MQMessage
Parameters:
byteArray - The number of characters to read (not the same as the number of bytes).
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.write(byte[])

write

public void write(byte[] byteArray,
                  int offset,
                  int len)
           throws java.io.IOException
Description copied from interface: IMessage
Writes a byte, an array of bytes, or a series of bytes into the message buffer at the present position. len bytes are written, taken from offset off in the array b.

Specified by:
write in interface IMessage
Specified by:
write in interface java.io.DataOutput
Overrides:
write in class com.ibm.mq.MQMessage
Parameters:
byteArray - The number of characters to read (not the same as the number of bytes).
offset - The offset in the array.
len - The number of bytes to be written.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.write(byte[], int, int)

writeBoolean

public void writeBoolean(boolean boolValue)
                  throws java.io.IOException
Description copied from interface: IMessage
Writes a Boolean into the message buffer at the present position.

Specified by:
writeBoolean in interface IMessage
Specified by:
writeBoolean in interface java.io.DataOutput
Overrides:
writeBoolean in class com.ibm.mq.MQMessage
Parameters:
boolValue - The Boolean value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeBoolean(boolean)

writeByte

public void writeByte(int byteValue)
               throws java.io.IOException
Description copied from interface: IMessage
Writes a byte into the message buffer at the present position.

Specified by:
writeByte in interface IMessage
Specified by:
writeByte in interface java.io.DataOutput
Overrides:
writeByte in class com.ibm.mq.MQMessage
Parameters:
byteValue - The byte value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeByte(int)

writeBytes

public void writeBytes(java.lang.String stringValue)
                throws java.io.IOException
Description copied from interface: IMessage
Writes the string to the message buffer as a sequence of bytes. Each character is written out in sequence by discarding its high eight bits.

Specified by:
writeBytes in interface IMessage
Specified by:
writeBytes in interface java.io.DataOutput
Overrides:
writeBytes in class com.ibm.mq.MQMessage
Parameters:
stringValue - The String value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeBytes(java.lang.String)

writeChar

public void writeChar(int unicodeChar)
               throws java.io.IOException
Description copied from interface: IMessage
Writes a Unicode character into the message buffer at the present position.

Specified by:
writeChar in interface IMessage
Specified by:
writeChar in interface java.io.DataOutput
Overrides:
writeChar in class com.ibm.mq.MQMessage
Parameters:
unicodeChar - The Unicode character value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeChar(int)

writeChars

public void writeChars(java.lang.String str)
                throws java.io.IOException
Description copied from interface: IMessage
Writes a string as a sequence of Unicode characters into the message buffer at the current position.

Specified by:
writeChars in interface IMessage
Specified by:
writeChars in interface java.io.DataOutput
Overrides:
writeChars in class com.ibm.mq.MQMessage
Parameters:
str - The String value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeChars(java.lang.String)

writeDouble

public void writeDouble(double doubleValue)
                 throws java.io.IOException
Description copied from interface: IMessage
Writes a double into the message buffer at the present position. The actions of this method are determined by the value of the encoding member variable.

A value of MQC.MQENC_FLOAT_IEEE_NORMAL or MQC.MQENC_FLOAT_IEEE_REVERSED write IEEE standard floats in big-endian and little-endian formats respectively. A value of MQC.MQENC_FLOAT_S390 writes a System/390 format floating point number. The range of IEEE doubles is greater than the range of S/390 double precision floating point numbers. Very large numbers cannot be converted.

Specified by:
writeDouble in interface IMessage
Specified by:
writeDouble in interface java.io.DataOutput
Overrides:
writeDouble in class com.ibm.mq.MQMessage
Parameters:
doubleValue - The number of characters to read (not the same as the number of bytes).
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeDouble(double)

writeFloat

public void writeFloat(float floatValue)
                throws java.io.IOException
Description copied from interface: IMessage
Writes a float into the message buffer at the present position. The actions of this method are determined by the value of the encoding member variable.

A Value of MQC.MQENC_FLOAT_IEEE_NORMAL or MQC.MQENC_FLOAT_IEEE_REVERSED write IEEE standard floats in big-endian and little-endian formats respectively. A value of MQC.MQENC_FLOAT_S390 writes a System/390 format floating point number.

Specified by:
writeFloat in interface IMessage
Specified by:
writeFloat in interface java.io.DataOutput
Overrides:
writeFloat in class com.ibm.mq.MQMessage
Parameters:
floatValue - The float value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeFloat(float)

writeInt

public void writeInt(int intValue)
              throws java.io.IOException
Description copied from interface: IMessage
Writes an integer into the message buffer at the present position. The actions of this method are determined by the value of the encoding member variable.

A value of MQC.MQENC_INTEGER_NORMAL writes a big-endian integer. A value of MQC.MQENC_INTEGER_REVERSED writes a little-endian integer.

Specified by:
writeInt in interface IMessage
Specified by:
writeInt in interface java.io.DataOutput
Overrides:
writeInt in class com.ibm.mq.MQMessage
Parameters:
intValue - The int value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeInt(int)

writeInt4

public void writeInt4(int intValue)
               throws java.io.IOException
Description copied from interface: IMessage
Writes an integer into the message buffer at the present position. The actions of this method are determined by the value of the encoding member variable.

Specified by:
writeInt4 in interface IMessage
Overrides:
writeInt4 in class com.ibm.mq.MQMessage
Parameters:
intValue - The int value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeInt4(int)

writeLong

public void writeLong(long longValue)
               throws java.io.IOException
Description copied from interface: IMessage
Writes a long into the message buffer at the present position. The actions of this method are determined by the value of the encoding member variable.

A value of MQC.MQENC_INTEGER_NORMAL writes a big-endian long. A value of MQC.MQENC_INTEGER_REVERSED writes a little-endian long.

Specified by:
writeLong in interface IMessage
Specified by:
writeLong in interface java.io.DataOutput
Overrides:
writeLong in class com.ibm.mq.MQMessage
Parameters:
longValue - The long value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeLong(long)

writeInt8

public void writeInt8(long longValue)
               throws java.io.IOException
Description copied from interface: IMessage
Writes an integer into the message buffer at the present position. The actions of this method are determined by the value of the encoding member variable.

Specified by:
writeInt8 in interface IMessage
Overrides:
writeInt8 in class com.ibm.mq.MQMessage
Parameters:
longValue - The long value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeInt8(long)

writeObject

public void writeObject(java.lang.Object objValue)
                 throws java.io.IOException
Description copied from interface: IMessage
Writes the specified object, object class, class signature, and the values of the nontransient and non-static fields of the class and all its supertypes.

Specified by:
writeObject in interface IMessage
Overrides:
writeObject in class com.ibm.mq.MQMessage
Parameters:
objValue - The object value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeObject(java.lang.Object)

writeShort

public void writeShort(int shortValue)
                throws java.io.IOException
Description copied from interface: IMessage
Writes a short into the message buffer at the present position. The actions of this method are determined by the value of the encoding member variable.

A value of MQC.MQENC_INTEGER_NORMAL writes a big-endian short. A value of MQC.MQENC_INTEGER_REVERSED writes a little-endian short.

Specified by:
writeShort in interface IMessage
Specified by:
writeShort in interface java.io.DataOutput
Overrides:
writeShort in class com.ibm.mq.MQMessage
Parameters:
shortValue - The short value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeShort(int)

writeInt2

public void writeInt2(int shortValue)
               throws java.io.IOException
Description copied from interface: IMessage
Writes an integer into the message buffer at the present position. The actions of this method are determined by the value of the encoding member variable.

Specified by:
writeInt2 in interface IMessage
Overrides:
writeInt2 in class com.ibm.mq.MQMessage
Parameters:
shortValue - The short value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeInt2(int)

writeDecimal2

public void writeDecimal2(short decimal2Value)
                   throws java.io.IOException
Description copied from interface: IMessage
Writes a 2-byte packed decimal format number into the message buffer at the present position. The actions of this method are determined by the value of the encoding member variable.

A value of MQC.MQENC_DECIMAL_NORMAL writes a big-endian packed decimal. A value of MQC.MQENC_DECIMAL_REVERSED writes a little-endian packed decimal.

Specified by:
writeDecimal2 in interface IMessage
Overrides:
writeDecimal2 in class com.ibm.mq.MQMessage
Parameters:
decimal2Value - The 2-byte decimal value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeDecimal2(short)

writeDecimal4

public void writeDecimal4(int decimal4Value)
                   throws java.io.IOException
Description copied from interface: IMessage
Writes an 4-byte packed decimal format number into the message buffer at the present position. The actions of this method are determined by the value of the encoding member variable.

A value of MQC.MQENC_DECIMAL_NORMAL writes a big-endian packed decimal. A value of MQC.MQENC_DECIMAL_REVERSED writes a little-endian packed decimal.

Specified by:
writeDecimal4 in interface IMessage
Overrides:
writeDecimal4 in class com.ibm.mq.MQMessage
Parameters:
decimal4Value - The 4-byte decimal value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeDecimal4(int)

writeDecimal8

public void writeDecimal8(long decimal8Value)
                   throws java.io.IOException
Description copied from interface: IMessage
Writes an 8-byte packed decimal format number into the message buffer at the present position. The actions of this method are determined by the value of the encoding member variable.

A value of MQC.MQENC_DECIMAL_NORMAL writes a big-endian packed decimal. A value of MQC.MQENC_DECIMAL_REVERSED writes a little-endian packed decimal.

Specified by:
writeDecimal8 in interface IMessage
Overrides:
writeDecimal8 in class com.ibm.mq.MQMessage
Parameters:
decimal8Value - The 8-byte decimal value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeDecimal8(long)

writeUTF

public void writeUTF(java.lang.String utfString)
              throws java.io.IOException
Description copied from interface: IMessage
Writes a UTF string, prefixed by a 2-byte length field, into the message buffer at the present position.

Specified by:
writeUTF in interface IMessage
Specified by:
writeUTF in interface java.io.DataOutput
Overrides:
writeUTF in class com.ibm.mq.MQMessage
Parameters:
utfString - The String value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeUTF(java.lang.String)

writeString

public void writeString(java.lang.String stringValue)
                 throws java.io.IOException
Description copied from interface: IMessage
Writes a string into the message buffer at the present position, converting it to the codeset identified by the characterSet member variable.

Specified by:
writeString in interface IMessage
Overrides:
writeString in class com.ibm.mq.MQMessage
Parameters:
stringValue - The String value.
Throws:
java.io.IOException - Thrown when an error occurs.
See Also:
MQMessage.writeString(java.lang.String)

persist

public void persist(com.stc.connector.persistence.bpel.DataOutput output)
             throws java.lang.Exception
Specified by:
persist in interface com.stc.connector.persistence.bpel.PersistableData
Throws:
java.lang.Exception

restore

public void restore(com.stc.connector.persistence.bpel.DataInput input)
             throws java.lang.Exception
Specified by:
restore in interface com.stc.connector.persistence.bpel.PersistableData
Throws:
java.lang.Exception

Sun Adapter for Websphere MQ API

Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.