|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.messaging.BinaryMessage
public class BinaryMessage
An interface representing a binary message.
An interface representing a binary message.
This is a subinterface of
Message which contains methods to get and set the
binary data payload. The setPayloadData()
method sets the value of the payload in the
data container without any checking whether the value
is valid in any way.
Methods for manipulating the address portion of
the message are inherited from Message.
Object instances implementing this interface are just containers for the data that is passed in.
| Field Summary | |
|---|---|
protected byte[] |
data
|
protected java.lang.String |
msisdn
|
protected long |
timeStamp
|
| Constructor Summary | |
|---|---|
protected |
BinaryMessage(java.lang.String msisdn,
byte[] data)
|
| Method Summary | |
|---|---|
java.lang.String |
getAddress()
Returns the address associated with this message. |
byte[] |
getPayloadData()
Returns the message payload data as an array of bytes. |
java.util.Date |
getTimestamp()
Returns the timestamp indicating when this message has been sent. |
void |
setAddress(java.lang.String addr)
Sets the address associated with this message, that is, the address returned by the getAddress method. |
void |
setPayloadData(byte[] data)
Sets the payload data of this message. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String msisdn
protected byte[] data
protected long timeStamp
| Constructor Detail |
|---|
protected BinaryMessage(java.lang.String msisdn,
byte[] data)
| Method Detail |
|---|
public byte[] getPayloadData()
Returns null, if the payload for the message
is not set.
The returned byte array is a reference to the
byte array of this message and the same reference
is returned for all calls to this method made before the
next call to setPayloadData.
setPayloadData(byte[])public void setPayloadData(byte[] data)
null.
Setting the payload using this method only sets the
reference to the byte array. Changes made to the contents
of the byte array subsequently affect the contents of this
BinaryMessage object. Therefore, applications
should not reuse this byte array before the message is sent and the
MessageConnection.send method returns.
data - - payload data as a byte arraygetPayloadData()public java.lang.String getAddress()
MessageIf this is a message to be sent, then this address is the recipient's address.
If this is a message that has been received, then this address is the sender's address.
Returns null, if the address for the message
is not set.
Note: This design allows responses to be
sent to a received message by reusing the
same Message object and just replacing the
payload. The address field can normally be
kept untouched (unless the messaging protocol
requires some special handling of the address).
The returned address uses the same URL string
syntax that Connector.open() uses to
obtain this MessageConnection.
getAddress in interface MessageMessage.setAddress(String)public void setAddress(java.lang.String addr)
MessagegetAddress method.
The address may be set to null.
The address MUST use the same URL string
syntax that Connector.open() uses to obtain
this MessageConnection.
setAddress in interface Messageaddr - - address for the messageMessage.getAddress()public java.util.Date getTimestamp()
Message
getTimestamp in interface Message
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||