OSMQ
v2.0.1

osmq.messages
Interface DataSetMessage

All Superinterfaces:
java.lang.Cloneable, osmq.datarows.DataRow, Immutable, KeyedData, osmq.datarows.KeyedDataRow, Message, MessageAttributes, java.io.Serializable
All Known Implementing Classes:
DataSetMessageBean

public interface DataSetMessage
extends Message, osmq.datarows.DataRow, osmq.datarows.KeyedDataRow, java.lang.Cloneable, java.io.Serializable

An entity relational message (DataSetMessage) contains entity data values, and supports mapping those data values to/from Java data types, and routing them as a unit to remote processes.


Field Summary
 
Fields inherited from interface osmq.messages.MessageAttributes
CONTENT_FORMAT, CORRELATION_ID, DATA_KEY, ORIGINATOR, RECIPIENT, SEND_TIMESTAMP, SENDER_SEQ, TOPIC, TOTAL_ATTRIBUTES, TRANS_ADD, TRANS_DELETE, TRANS_UPDATE, TRANSACTION, TYPE
 
Method Summary
 void clear(int posn)
          Clears the value at the designated position, setting it to null (or zero if numeric)
 void clearBody()
          Clear all the body elements in the DataSetMessage object to null (or zero if numeric)
 void clearHeader()
          Clear all the header elements in the DataSetMessage object to null (or zero if numeric)
 java.lang.Object clone()
           
 java.math.BigDecimal getBigDecimal(int posn)
          Returns the value at the designated position in the message body as a BigDecimal
 boolean getBoolean(int posn)
          Returns the value at the designated position in the message body as a boolean
 byte getByte(int posn)
          Returns the value at the designated position in the message body as a byte
 char getChar(int posn)
          Returns the value at the designated position in the message body as a char
 byte[] getClientBytes()
          Returns the client (body) data as an array of bytes.
 long getCorrelationNumber()
          Gets the identifier used to identify a group of transactions as related.
 java.lang.String getCorrelationString()
           
 java.util.Date getDate(int posn)
          Returns the value at the designated position in the message body as a java.util.Date
 double getDouble(int posn)
          Returns the value at the designated position in the message body as a double
 int getElementCount()
          Returns the number of positions in the message body (including those that are empty)
 java.lang.String getElementsAsString()
          Returns the message body as a delimited String.
 float getFloat(int posn)
          Returns the value at the designated position in the message body as a float
 char getFormat()
          Identifies the body format as either dataset, text or binary.
 java.lang.String getFormattedDateString(int posn)
          Returns the value at the designated position in the message object as a formatted date string in CCYY-MM-DD format.
 MessageHeader getHeader()
          Returns the message header values.
 byte[] getHeaderBytes()
          Returns the header data as an array of bytes.
 int getInt(int posn)
          Returns the value at the designated position in the message body as an integer.
 java.lang.String getKey()
          Returns the unique identifier for the data contained in the message.
 int getKeyAsInt()
           
 long getLong(int posn)
          Returns the value at the designated position in the message body as a long integer
 byte[] getMessageAsBytes()
          Returns the message header and body as an array of bytes.
 java.lang.Object getObject(int posn)
          Returns the value of the designated position in the message body.
 int getOffsetIndex()
          Returns the base index currently used to reference elements in the message body.
 java.lang.String getOriginator()
          Returns the identifier of the message sender (publisher).
 java.lang.String getRecipient()
          Returns the identifier of the message recipient, or null if the message is intended for all subscriber to the message topic.
 long getSequenceNumber()
          Returns the relative sequence number of this message.
 short getShort(int posn)
          Returns the value at the designated position in the message body as a short integer
 java.sql.Date getSQLDate(int posn)
          Returns the value at the designated position in the message object as an SQL date
 java.lang.String getString(int posn)
          Returns the value of the designated position in the message body as a String
 long getTimeStamp()
          Returns a timestamp indicating when the message was sent.
 java.lang.String getTopic()
          Returns the topic of the message.
 java.lang.String getTransaction()
          Returns the identifier of the event or activity that caused the transaction to be generated.
 char getTransactionAsChar()
          Returns the first character of the event identifer, or a null character if there is no event identifer
 char getType()
          Identifies the message event type -- normally either MessageType.NOTIFICATION or MessageType.REQUEST.
 java.lang.String getUnformattedDateString(int posn)
          Returns the value at the designated position in the message object as an unformatted date string in CCYYMMDD format.
 java.lang.String getUpperCaseString(int posn)
          Returns the value at the designated position in the message body as a String with all characters forced into upper case.
 boolean hasAssignedCorrelationNumber()
          Determines if there is a correlation identifier value.
 boolean hasAssignedKey()
          Determines if there is a key value identifier.
 boolean hasAssignedOriginator()
          Determines if there is an originator identifier.
 boolean hasAssignedRecipient()
          Determine if there is a recipient identifier value.
 boolean hasAssignedTopic()
          Determines if there is a topic identifier value.
 boolean hasAValue(int posn)
          Determines whether a position has a value (versus null)
 boolean isEmpty(int posn)
          Determines if a position has no value (is empty)
 boolean isImmutable()
          Returns true if this is an immutable message.
 void setBigDecimal(int posn, java.math.BigDecimal value)
          Sets the element at the designated position in the message body to a BigDecimal value
 void setBoolean(int posn, boolean value)
          Sets the element at the designated position in the message body to a boolean value
 void setByte(int posn, byte value)
          Sets the element at the designated position in the message body to a byte value
 void setChar(int posn, char value)
          Sets the element at the designated position in the message body to a char value
 void setClientBytes(byte[] data)
          Sets the client (body) data from an array of bytes.
 void setClientBytes(DataRecord ds)
          Sets the client (body) data from values in a message body.
 void setCorrelationNumber(long n)
          Sets the identifier used to identify a group of transactions as related.
 void setCorrelationString(java.lang.String s)
          Sets the identifier used to identify a group of transactions as related.
 void setDate(int posn, java.util.Date value)
          Sets the element at the designated position in the message body to a Date value
 void setDateString(int posn, java.lang.String value)
          Sets the element at the designated position in the message body to an date value.
 void setDecimalString(int posn, java.lang.String value)
          Sets the element at the designated position to a String value that represents a decimal value.
 void setDouble(int posn, double value)
          Sets the element at the designated position in the message body to a double value
 void setElementCount(int sz)
           
 void setFloat(int posn, float value)
          Sets the element at the designated position in the message body to a float value
 void setFormat(char t)
          Sets the body format identifier.
 void setHeader(MessageHeader header)
          Sets the message header values.
 void setHeaderBytes(byte[] value)
          Sets the header data from an array of bytes.
 void setImmutable()
          Sets the message state to immutable. The values of an immutable message cannot be modified.
 void setInt(int posn, int value)
          Sets the element at the designated position in the message body to an int value
 void setKey(java.lang.String s)
          Sets the unique identifier for the data contained in the message.
 void setKeyAsInt(int n)
          Sets the unique identifier for the data contained in the message.
 void setLong(int posn, long value)
          Sets the element at the designated position in the message body to a long value
 void setNull(int posn)
          Sets the value at the designated position in the message body to null
 void setObject(int posn, java.lang.Object value)
          Sets the value at the designated position in the message body
 void setOffsetIndex(int value)
          Sets the base index used to reference elements in the message body.
 void setOriginator(java.lang.String t)
          Sets the identifier of the message sender (publisher).
 void setRecipient(java.lang.String t)
          Sets the unique recipient that will receive the message.
 void setSequenceNumber(long n)
          Sets the sequence number for this message.
 void setShort(int posn, short value)
          Sets the element at the designated position in the message body to a short value
 void setString(int posn, java.lang.String s)
          Sets the element at the designated position in the message body to a String value
 void setTimeStamp(long n)
          Sets the time the message was publisherd.
 void setTopic(java.lang.String topic)
          Sets the topic that identifies the message contents.
 void setTransaction(java.lang.String e)
          Sets the transaction identifer.
 void setTransactionAsChar(char c)
          Sets the transaction identifer to a char value.
 void setTrimmedString(int posn, java.lang.String s)
          Sets the element at the designated position to a String value.
 void setType(char t)
          Sets the message type.
 void setUpperCaseString(int posn, java.lang.String value)
          Sets the element at the designated position in the message body to an upper-case String value
 java.lang.String toString()
           
 boolean wasNull()
          Returns true if the lastfetched element was a null object, or an object with a string length of zero.
 
Methods inherited from interface osmq.datarows.DataRow
isNull
 

Method Detail

setOffsetIndex

public void setOffsetIndex(int value)
Sets the base index used to reference elements in the message body. If not set explicitly, this index defaults to 1.

Specified by:
setOffsetIndex in interface osmq.datarows.DataRow
Parameters:
value - the new base index value

getOffsetIndex

public int getOffsetIndex()
Returns the base index currently used to reference elements in the message body.

Specified by:
getOffsetIndex in interface osmq.datarows.DataRow
See Also:
setOffsetIndex(int)

isImmutable

public boolean isImmutable()
Returns true if this is an immutable message. The attributes and values of an immutable message cannot be changed, and attempts to modify them results in an ImmutableException being thrown.

Specified by:
isImmutable in interface Immutable
See Also:
setImmutable()

clear

public void clear(int posn)
Clears the value at the designated position, setting it to null (or zero if numeric)

Specified by:
clear in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
Throws:
ImmutableDataException - if the message is immutable.
See Also:
clearBody()

getObject

public java.lang.Object getObject(int posn)
Returns the value of the designated position in the message body.

Specified by:
getObject in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
Returns:
the value as an Object or null if the position is empty.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.

getChar

public char getChar(int posn)
Returns the value at the designated position in the message body as a char

Specified by:
getChar in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
Returns:
the value as a char or 0 if the position is empty.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.

getByte

public byte getByte(int posn)
Returns the value at the designated position in the message body as a byte

Specified by:
getByte in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
Returns:
the value as a byte or 0 if the position is empty.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.

getBoolean

public boolean getBoolean(int posn)
Returns the value at the designated position in the message body as a boolean

Specified by:
getBoolean in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
Returns:
the value as a boolean or a null if the position is empty.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.

getFloat

public float getFloat(int posn)
Returns the value at the designated position in the message body as a float

Specified by:
getFloat in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
Returns:
the position value as a double or 0.0 if the position is empty.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.

getDouble

public double getDouble(int posn)
Returns the value at the designated position in the message body as a double

Specified by:
getDouble in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
Returns:
the position value as a double or 0.0 if the position is empty.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.

getBigDecimal

public java.math.BigDecimal getBigDecimal(int posn)
Returns the value at the designated position in the message body as a BigDecimal

Specified by:
getBigDecimal in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
Returns:
the position value as a BigDecimal or null if the position is empty.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.

getInt

public int getInt(int posn)
Returns the value at the designated position in the message body as an integer.

Specified by:
getInt in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
Returns:
the value as an int or a 0 if the position is empty.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.

getLong

public long getLong(int posn)
Returns the value at the designated position in the message body as a long integer

Specified by:
getLong in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
Returns:
the position value as a short or 0 if the position is empty.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if columnIndex is not a valid element position.

getShort

public short getShort(int posn)
Returns the value at the designated position in the message body as a short integer

Specified by:
getShort in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
Returns:
the position value as a short or 0 if the position is empty.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if columnIndex is not a valid element position.

getString

public java.lang.String getString(int posn)
Returns the value of the designated position in the message body as a String

Specified by:
getString in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
Returns:
the position value as a String or a null String if the position is empty.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.

getUpperCaseString

public java.lang.String getUpperCaseString(int posn)
Returns the value at the designated position in the message body as a String with all characters forced into upper case.

Specified by:
getUpperCaseString in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
Returns:
the value as a String or a null if the position is empty.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid element position.

getDate

public java.util.Date getDate(int posn)
Returns the value at the designated position in the message body as a java.util.Date

Specified by:
getDate in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
Returns:
the position value as a java.util.Date, or null if the position is empty.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if columnIndex is not a valid element position.
See Also:
setDate(int, Date)

getSQLDate

public java.sql.Date getSQLDate(int posn)
Returns the value at the designated position in the message object as an SQL date

Specified by:
getSQLDate in interface osmq.datarows.DataRow
Returns:
the position value as a java.sql.Date object, or null if the position is empty.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.
See Also:
setDateString(int, String)

getFormattedDateString

public java.lang.String getFormattedDateString(int posn)
Returns the value at the designated position in the message object as a formatted date string in CCYY-MM-DD format.

Specified by:
getFormattedDateString in interface osmq.datarows.DataRow
Returns:
the position value as a String or null if the position is empty.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.
See Also:
setDateString(int, String)

getUnformattedDateString

public java.lang.String getUnformattedDateString(int posn)
Returns the value at the designated position in the message object as an unformatted date string in CCYYMMDD format. (This is the normal storage format for a date).

Specified by:
getUnformattedDateString in interface osmq.datarows.DataRow
Returns:
the position value as a String or null if the position is empty.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.
See Also:
setDateString(int, String)

hasAValue

public boolean hasAValue(int posn)
Determines whether a position has a value (versus null)

Specified by:
hasAValue in interface osmq.datarows.DataRow
Parameters:
posn - the position containing the value to be tested
Returns:
true of there is a non-null value at position p, else false
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.

isEmpty

public boolean isEmpty(int posn)
Determines if a position has no value (is empty)

Specified by:
isEmpty in interface osmq.datarows.DataRow
Parameters:
posn - the position containing the value to be tested
Returns:
true if there is a null value (no value) at position p, else false
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.

setObject

public void setObject(int posn,
                      java.lang.Object value)
Sets the value at the designated position in the message body

Specified by:
setObject in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
value - the element's new value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if p is not a valid element position.
ImmutableException - if the message object is immutable.

setString

public void setString(int posn,
                      java.lang.String s)
Sets the element at the designated position in the message body to a String value

Specified by:
setString in interface osmq.datarows.DataRow
Parameters:
posn - the element's relative position (1 to n)
s - the element's new value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if p is not a valid element position.
ImmutableException - if the message object is immutable.

setTrimmedString

public void setTrimmedString(int posn,
                             java.lang.String s)
Description copied from interface: osmq.datarows.DataRow
Sets the element at the designated position to a String value. Setting the value also eliminates any leading or trailing spaces.

Specified by:
setTrimmedString in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
s - the element's new value

setNull

public void setNull(int posn)
Sets the value at the designated position in the message body to null

Specified by:
setNull in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
Throws:
java.lang.ArrayIndexOutOfBoundsException - if p is not a valid element position.
ImmutableException - if the message object is immutable.

setByte

public void setByte(int posn,
                    byte value)
Sets the element at the designated position in the message body to a byte value

Specified by:
setByte in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
value - the element's new value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.
ImmutableException - if the message is immutable.

setBoolean

public void setBoolean(int posn,
                       boolean value)
Sets the element at the designated position in the message body to a boolean value

Specified by:
setBoolean in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
value - the element's new value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.
ImmutableException - if the message is immutable.

setChar

public void setChar(int posn,
                    char value)
Sets the element at the designated position in the message body to a char value

Specified by:
setChar in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
value - the element's new value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.
ImmutableException - if the message is immutable.

setFloat

public void setFloat(int posn,
                     float value)
Sets the element at the designated position in the message body to a float value

Specified by:
setFloat in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
value - the element's new value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.
ImmutableException - if the message is immutable.

setDouble

public void setDouble(int posn,
                      double value)
Sets the element at the designated position in the message body to a double value

Specified by:
setDouble in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
value - the element's new value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.
ImmutableException - if the message is immutable.

setDecimalString

public void setDecimalString(int posn,
                             java.lang.String value)
Description copied from interface: osmq.datarows.DataRow
Sets the element at the designated position to a String value that represents a decimal value. Setting the element ensures that the string has a decimal component, and excessive non-significant decimal values (trailing zeros) are dropped. A value of "5" will result in a string value of "5.0" and a value of "5.400" will result in a string value of "5.4".

Specified by:
setDecimalString in interface osmq.datarows.DataRow
Parameters:
value - the element's new value

setBigDecimal

public void setBigDecimal(int posn,
                          java.math.BigDecimal value)
Sets the element at the designated position in the message body to a BigDecimal value

Specified by:
setBigDecimal in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
value - the element's new value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.
ImmutableException - if the message is immutable.

setDate

public void setDate(int posn,
                    java.util.Date value)
Sets the element at the designated position in the message body to a Date value

Specified by:
setDate in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
value - the element's new value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.
ImmutableException - if the message is immutable.

setInt

public void setInt(int posn,
                   int value)
Sets the element at the designated position in the message body to an int value

Specified by:
setInt in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
value - the element's new value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.
ImmutableException - if the message is immutable.

setLong

public void setLong(int posn,
                    long value)
Sets the element at the designated position in the message body to a long value

Specified by:
setLong in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
value - the element's new value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.
ImmutableException - if the message is immutable.

setShort

public void setShort(int posn,
                     short value)
Sets the element at the designated position in the message body to a short value

Specified by:
setShort in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
value - the element's new value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.
ImmutableException - if the message is immutable.

setUpperCaseString

public void setUpperCaseString(int posn,
                               java.lang.String value)
Sets the element at the designated position in the message body to an upper-case String value

Specified by:
setUpperCaseString in interface osmq.datarows.DataRow
Parameters:
posn - the first position is 1, the second is 2, ...
value - the element's new value
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.
ImmutableException - if the message object is immutable.

setDateString

public void setDateString(int posn,
                          java.lang.String value)
Sets the element at the designated position in the message body to an date value.

Specified by:
setDateString in interface osmq.datarows.DataRow
Parameters:
value - the element's new value in CCYYMMDD or CCYY-MM-DD format. (If the string contains hyphens, they are removed.)
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.
ImmutableException - if the message object is immutable.

clearBody

public void clearBody()
Clear all the body elements in the DataSetMessage object to null (or zero if numeric)

Throws:
ImmutableException - if the message is immutable.

clearHeader

public void clearHeader()
Clear all the header elements in the DataSetMessage object to null (or zero if numeric)

Throws:
ImmutableException - if the message is immutable.

setImmutable

public void setImmutable()
Sets the message state to immutable. The values of an immutable message cannot be modified. Any attempt to modify those values will result in an ImmutableException being thrown.

Specified by:
setImmutable in interface Immutable
See Also:
ImmutableException

setHeader

public void setHeader(MessageHeader header)
Sets the message header values.

Throws:
ImmutableDataException - if the message is immutable.

getHeader

public MessageHeader getHeader()
Returns the message header values.


getHeaderBytes

public byte[] getHeaderBytes()
Returns the header data as an array of bytes.


setHeaderBytes

public void setHeaderBytes(byte[] value)
Sets the header data from an array of bytes.

Throws:
ImmutableDataException - if the message is immutable.

getClientBytes

public byte[] getClientBytes()
Returns the client (body) data as an array of bytes.


setClientBytes

public void setClientBytes(DataRecord ds)
Sets the client (body) data from values in a message body. Changes made to the DataRecord will change the corresponding values in the message body.

Throws:
ImmutableDataException - if the message is immutable.

setClientBytes

public void setClientBytes(byte[] data)
Sets the client (body) data from an array of bytes.

Throws:
ImmutableDataException - if the message is immutable.

getMessageAsBytes

public byte[] getMessageAsBytes()
Returns the message header and body as an array of bytes.

Specified by:
getMessageAsBytes in interface Message

getElementsAsString

public java.lang.String getElementsAsString()
Returns the message body as a delimited String.


wasNull

public boolean wasNull()
Returns true if the lastfetched element was a null object, or an object with a string length of zero. (The last fetched is the element referenced by the last getXXX() method call.)


getTopic

public java.lang.String getTopic()
Returns the topic of the message.

Specified by:
getTopic in interface MessageAttributes
Returns:
A string containing the topic. The topic defines the message contents for a subscriber (number of elements and the data type of each element).

setTopic

public void setTopic(java.lang.String topic)
Sets the topic that identifies the message contents.

Specified by:
setTopic in interface MessageAttributes
Throws:
ImmutableDataException - if the message is immutable.

getKey

public java.lang.String getKey()
Returns the unique identifier for the data contained in the message. (This "key" is relative to the the topic.)

Specified by:
getKey in interface MessageAttributes
Returns:
A string containing the unique identifier.

setKey

public void setKey(java.lang.String s)
Sets the unique identifier for the data contained in the message. (This "key" is relative to the the topic.)

Specified by:
setKey in interface MessageAttributes
Parameters:
s - the unique key value

setKeyAsInt

public void setKeyAsInt(int n)
Sets the unique identifier for the data contained in the message. (This "key" is relative to the the topic.)

Specified by:
setKeyAsInt in interface MessageAttributes
Parameters:
n - the unique key value

getKeyAsInt

public int getKeyAsInt()
Specified by:
getKeyAsInt in interface MessageAttributes

getTransaction

public java.lang.String getTransaction()
Returns the identifier of the event or activity that caused the transaction to be generated. This is a value that is based on the topic.

Standard events used for down-stream subscribers that maintain databases are DataSetMessage.TRANSACTION_ADD, DataSetMessage.TRANSACTION_DELETE and DataSetMessage.and TRANSACTION_UPDATE.

Specified by:
getTransaction in interface MessageAttributes
Returns:
A string containing the transaction event.

getTransactionAsChar

public char getTransactionAsChar()
Returns the first character of the event identifer, or a null character if there is no event identifer

Specified by:
getTransactionAsChar in interface MessageAttributes
Returns:
A char containing the transaction event.

setTransaction

public void setTransaction(java.lang.String e)
Sets the transaction identifer. This identifier is useful to subscribers that perform database updates based on topical messages. (The identifiers typically translate into add/update/delete functions)

Specified by:
setTransaction in interface MessageAttributes

setTransactionAsChar

public void setTransactionAsChar(char c)
Sets the transaction identifer to a char value.

Specified by:
setTransactionAsChar in interface MessageAttributes
See Also:
setTransaction(String)

getCorrelationNumber

public long getCorrelationNumber()
Gets the identifier used to identify a group of transactions as related. The relationship is likely a unit-of-work that resulted in tranaction-related topics being generated. This is an optional header attribute.

Specified by:
getCorrelationNumber in interface MessageAttributes
Returns:
An int containing the correlation identifier.

setCorrelationNumber

public void setCorrelationNumber(long n)
Sets the identifier used to identify a group of transactions as related. The relationship is likely a unit-of-work that resulted in tranaction-related topics being generated. This is an optional header attribute, and is set automatically by the Publisher.

Specified by:
setCorrelationNumber in interface MessageAttributes
Parameters:
n - the correlation identifier

getCorrelationString

public java.lang.String getCorrelationString()
Specified by:
getCorrelationString in interface MessageAttributes

setCorrelationString

public void setCorrelationString(java.lang.String s)
Sets the identifier used to identify a group of transactions as related.

Specified by:
setCorrelationString in interface MessageAttributes
Parameters:
s - the correlation identifier
See Also:
setCorrelationNumber(long)

getOriginator

public java.lang.String getOriginator()
Returns the identifier of the message sender (publisher). The sender identifies a unique client process (instance).

Specified by:
getOriginator in interface MessageAttributes
Returns:
A string containing the message sender.

setOriginator

public void setOriginator(java.lang.String t)
Sets the identifier of the message sender (publisher). The sender identifies a unique client process (instance).

Normally, this value is not set by an application, and defaults to the client identifier used to attach to the message broker.

Specified by:
setOriginator in interface MessageAttributes
Parameters:
t - the message originator (sender)

getRecipient

public java.lang.String getRecipient()
Returns the identifier of the message recipient, or null if the message is intended for all subscriber to the message topic.

Specified by:
getRecipient in interface MessageAttributes
Returns:
A string containing the recipient identifier.

setRecipient

public void setRecipient(java.lang.String t)
Sets the unique recipient that will receive the message. If a recipient value is set, only that recipient will receive the message. (Point-to-point messaging). Setting the recipient should be reserved for clients requesting a service (type of TYPE_REQUEST) and for OLTP systems that receive a request that is being rejected. In the latter case, the OLTP system would send a point-to-point rejection message to the originator of the request.

Specified by:
setRecipient in interface MessageAttributes

getType

public char getType()
Identifies the message event type -- normally either MessageType.NOTIFICATION or MessageType.REQUEST.

Specified by:
getType in interface MessageAttributes
Returns:
A char containing either the value MessageType.NOTIFICATION or MessageType.REQUEST, MessageType.DENIAL, MessageType.BATCH_CONTROL or MessageType.TOPIC_CHG.
See Also:
MessageAttributes.setType(char)

setType

public void setType(char t)
Sets the message type. The message type is the category of event that caused a message to be generated. Standard typess include MessageAttributes.TYPE_NOTIFICATION and MessageAttributes.TYPE_REQUEST.

TYPE_NOTIFICATION messages are published by OLTP systems after it commits a transaction. (Batch applications can also publisher TYPE_NOTIFICATION messages.)

TYPE_REQUEST messages are point-to-point routed client requests for service. (Point-to-point messages are sent to a single recipient, and have the recipient identified in the message header, verus publish-subscribe messages that have no recipeint and are published to all subscribers to the message topic.)

Specified by:
setType in interface MessageAttributes
See Also:
setRecipient(String t)

setTimeStamp

public void setTimeStamp(long n)
Sets the time the message was publisherd. This function is called by the message publisher after client submits the message for delivery.

NOTE This value should be set by the underlying client middleware, and not the application.

Specified by:
setTimeStamp in interface MessageAttributes
Parameters:
n - the time as a long.

setSequenceNumber

public void setSequenceNumber(long n)
Sets the sequence number for this message.

NOTE This value should be set by the underlying client middleware, and not the application.

Specified by:
setSequenceNumber in interface MessageAttributes

getTimeStamp

public long getTimeStamp()
Returns a timestamp indicating when the message was sent.

Specified by:
getTimeStamp in interface MessageAttributes
Returns:
A long containing the time in milli-seconds.

getSequenceNumber

public long getSequenceNumber()
Returns the relative sequence number of this message. When a message is sent by a client, it denotes the relative sending sequence. When a message is received, it denotes the relative sequence of all messages fetched by the recipient, regardless of the sender.

Specified by:
getSequenceNumber in interface MessageAttributes
Returns:
A long identifying the message sequence.

getFormat

public char getFormat()
Identifies the body format as either dataset, text or binary. Valid values include

MessageAttributes.FORMAT_UNKNOWN

MessageAttributes.FORMAT_TEXT

MessageAttributes.FORMAT_DATASET

MessageAttributes.FORMAT_BINARY

DataSetMessages default to a format of MessageAttributes.FORMAT_DATASET.

Specified by:
getFormat in interface MessageAttributes

setFormat

public void setFormat(char t)
Sets the body format identifier. Body formats are either dataset, text or binary. Valid values include

MessageAttributes.FORMAT_UNKNOWN

MessageAttributes.FORMAT_TEXT

MessageAttributes.FORMAT_DATASET

MessageAttributes.FORMAT_BINARY

Specified by:
setFormat in interface MessageAttributes
Throws:
java.lang.IllegalArgumentException - if attempt to set value other than MessageAttributes.FORMAT_DATASET

hasAssignedRecipient

public boolean hasAssignedRecipient()
Determine if there is a recipient identifier value.

Specified by:
hasAssignedRecipient in interface MessageAttributes
Returns:
true if there is a non-null recipient identifier.

hasAssignedTopic

public boolean hasAssignedTopic()
Determines if there is a topic identifier value.

Specified by:
hasAssignedTopic in interface MessageAttributes
Returns:
true if there is a non-null topic identifier.

hasAssignedCorrelationNumber

public boolean hasAssignedCorrelationNumber()
Determines if there is a correlation identifier value.

Specified by:
hasAssignedCorrelationNumber in interface MessageAttributes
Returns:
true if there is a non-null numeric correlation identifier.

hasAssignedKey

public boolean hasAssignedKey()
Determines if there is a key value identifier.

Specified by:
hasAssignedKey in interface MessageAttributes
Returns:
true if there is a non-null key identifier.

hasAssignedOriginator

public boolean hasAssignedOriginator()
Determines if there is an originator identifier.

Specified by:
hasAssignedOriginator in interface MessageAttributes
Returns:
true if the originator has been set to a non-null value, else false

toString

public java.lang.String toString()

getElementCount

public int getElementCount()
Returns the number of positions in the message body (including those that are empty)

Specified by:
getElementCount in interface osmq.datarows.DataRow
Returns:
the number of body elements
Throws:
java.lang.ArrayIndexOutOfBoundsException - if positionIndex is not a valid position.

setElementCount

public void setElementCount(int sz)

clone

public java.lang.Object clone()
Specified by:
clone in interface MessageAttributes

(c) 2000 - 2003 MQue Systems
All Rights Reserved