|
OSMQ v2.0.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectosmq.util.ImmutableImpl
osmq.messages.MessageBean
A MessageBean is an implementation of the Message interface, and an alternative to the DataSetMessageBean implementation (DATASET). It has header attributes, but unlike the DataSetMessage, the body is not necessarily a record with multiple elements, but rather contains any array of bytes.
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 |
Constructor Summary | |
MessageBean()
|
|
MessageBean(byte[] body)
|
|
MessageBean(java.lang.String bodytext)
|
Method Summary | |
byte[] |
_duplicate(byte[] original)
|
java.lang.Object |
clone()
|
byte[] |
getClientBytes()
Returns the client (body) data as an array of bytes. |
java.lang.String |
getClientText()
Returns the client (body) data as a text String |
long |
getCorrelationNumber()
Gets the identifier used to identify a group of transactions as related. |
java.lang.String |
getCorrelationString()
|
DataRecord |
getDataRecord()
Returns the client (body) data as a DataRecord. |
char |
getFormat()
Identifies the body format as either text or binary. |
MessageHeader |
getHeader()
Returns the message header values. |
byte[] |
getHeaderBytes()
Returns the header data as an array of bytes. |
java.lang.String |
getKey()
Returns the unique identifier for the data contained in the message. |
int |
getKeyAsInt()
|
byte[] |
getMessageAsBytes()
Returns the message (header and body) as an array of bytes |
java.lang.String |
getMessageAsString()
Returns the message (header and body) as a text String. |
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. |
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 whether the message type is a NOTIFICATION or REQUEST . |
boolean |
hasAssignedCorrelationNumber()
Determines if there is a correlation identifier value. |
boolean |
hasAssignedKey()
Determines if there is a key value identifier. |
boolean |
hasAssignedOriginator()
Determines whether a position has a value (versus null) |
boolean |
hasAssignedRecipient()
Determine if there is a recipient identifier value. |
boolean |
hasAssignedTopic()
Determines if there is a topic identifier value. |
static void |
main(java.lang.String[] args)
|
void |
setClientBytes(byte[] data)
Sets the client (body) data from values in a message body. |
void |
setClientText(java.lang.String s)
Sets the body values to a String. |
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 |
setDataRecord(DataRecord record)
Sets the body values to a DataRecord. |
void |
setFormat(char t)
Sets the attributes that identifies the type of data contained in the message body. |
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 |
setKey(java.lang.String s)
Sets the unique identifier for the data contained in the message. |
void |
setKeyAsInt(int n)
|
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 |
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 t)
Sets the transaction identifer. |
void |
setTransactionAsChar(char c)
|
void |
setType(char t)
Sets the event type. |
Methods inherited from class osmq.util.ImmutableImpl |
isImmutable |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface osmq.util.Immutable |
isImmutable |
Constructor Detail |
public MessageBean()
public MessageBean(java.lang.String bodytext)
public MessageBean(byte[] body)
Method Detail |
public void setImmutable()
setImmutable
in interface Immutable
setImmutable
in class ImmutableImpl
ImmutableException
public void setHeader(MessageHeader header)
ImmutableDataException
- if the message is immutable.public MessageHeader getHeader()
public byte[] getHeaderBytes()
public void setHeaderBytes(byte[] value)
ImmutableDataException
- if the message is immutable.public byte[] getClientBytes()
public void setClientBytes(byte[] data)
ImmutableDataException
- if the message is immutable.public java.lang.String getClientText()
public void setClientText(java.lang.String s)
ImmutableDataException
- if the message is immutable.public java.lang.String getMessageAsString()
public void setDataRecord(DataRecord record)
ImmutableDataException
- if the message is immutable.public DataRecord getDataRecord()
public java.lang.String getTopic()
getTopic
in interface MessageAttributes
public void setTopic(java.lang.String topic)
setTopic
in interface MessageAttributes
ImmutableDataException
- if the message is immutable.public java.lang.String getKey()
getKey
in interface MessageAttributes
public void setKey(java.lang.String s)
setKey
in interface MessageAttributes
s
- the unique key valuepublic void setKeyAsInt(int n)
setKeyAsInt
in interface MessageAttributes
public int getKeyAsInt()
getKeyAsInt
in interface MessageAttributes
public java.lang.String getTransaction()
Standard events used for down-stream subscribers that maintain databases are DataSetMessage.EVENT_ADD, DataSetMessage.EVENT_DELETE and DataSetMessage.and EVENT_UPDATE.
getTransaction
in interface MessageAttributes
public char getTransactionAsChar()
getTransactionAsChar
in interface MessageAttributes
public void setTransaction(java.lang.String t)
setTransaction
in interface MessageAttributes
t
- the transaction valuepublic void setTransactionAsChar(char c)
setTransactionAsChar
in interface MessageAttributes
public long getCorrelationNumber()
getCorrelationNumber
in interface MessageAttributes
public void setCorrelationNumber(long n)
setCorrelationNumber
in interface MessageAttributes
n
- the correlation identifierpublic java.lang.String getCorrelationString()
getCorrelationString
in interface MessageAttributes
public void setCorrelationString(java.lang.String s)
setCorrelationString
in interface MessageAttributes
s
- the correlation identifiersetCorrelationNumber(long)
public java.lang.String getOriginator()
getOriginator
in interface MessageAttributes
public void setOriginator(java.lang.String t)
Normally, this value is not set by an application, and defaults to the client identifier used to attach to the message broker.
setOriginator
in interface MessageAttributes
t
- the message originator (sender)public java.lang.String getRecipient()
getRecipient
in interface MessageAttributes
public void setRecipient(java.lang.String t)
setRecipient
in interface MessageAttributes
public char getType()
getType
in interface MessageAttributes
MessageAttributes.setType(char)
public void setType(char t)
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.)
setType
in interface MessageAttributes
setRecipient(String t)
public void setTimeStamp(long n)
NOTE This value should be set by the underlying client middleware, and not the application.
setTimeStamp
in interface MessageAttributes
n
- the time as a long.public void setSequenceNumber(long n)
NOTE This value should be set by the underlying client middleware, and not the application.
setSequenceNumber
in interface MessageAttributes
public long getTimeStamp()
getTimeStamp
in interface MessageAttributes
public long getSequenceNumber()
getSequenceNumber
in interface MessageAttributes
public char getFormat()
getFormat
in interface MessageAttributes
public void setFormat(char t)
MessageAttributes
Valid values include
FORMAT_UNKNOWN ('U')
FORMAT_TEXT ('T')
FORMAT_DATASET ('D')
FORMAT_BINARY ('B')
DataSetMessages default to a format of FORMAT_DATASET.
setFormat
in interface MessageAttributes
public boolean hasAssignedRecipient()
hasAssignedRecipient
in interface MessageAttributes
public boolean hasAssignedTopic()
hasAssignedTopic
in interface MessageAttributes
public boolean hasAssignedCorrelationNumber()
hasAssignedCorrelationNumber
in interface MessageAttributes
public boolean hasAssignedKey()
hasAssignedKey
in interface MessageAttributes
public boolean hasAssignedOriginator()
hasAssignedOriginator
in interface MessageAttributes
java.lang.ArrayIndexOutOfBoundsException
- if p is not a valid element position.public byte[] _duplicate(byte[] original)
public byte[] getMessageAsBytes()
getMessageAsBytes
in interface Message
public java.lang.Object clone()
clone
in interface MessageAttributes
public static void main(java.lang.String[] args)
|
(c) 2000 - 2003 MQue Systems All Rights Reserved |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |