|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.messaging.TextMessage
public class TextMessage
An interface representing a text message.
An interface representing a text message.
This is a subinterface of
Message which
contains methods to get and set the text payload. The
setPayloadText 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.
Text messages using this interface
deal with Strings encoded in Java.
The underlying implementation will convert the
Strings into a suitable encoding for the messaging
protocol in question. Different protocols recognize different character
sets. To ensure that characters are transmitted
correctly across the network, an application should use the
character set(s) recognized by the protocol.
If an application is unaware of the protocol, or uses a
character set that the protocol does not recognize, then some characters
might be transmitted incorrectly.
| Field Summary | |
|---|---|
protected String |
data
|
protected String |
msisdn
|
protected long |
timeStamp
|
| Constructor Summary | |
|---|---|
protected |
TextMessage(String msisdn,
String data)
|
| Method Summary | |
|---|---|
String |
getAddress()
Returns the address associated with this message. |
String |
getPayloadText()
Returns the message payload data as a String. |
Date |
getTimestamp()
Returns the timestamp indicating when this message has been sent. |
void |
setAddress(String addr)
Sets the address associated with this message, that is, the address returned by the getAddress method. |
void |
setPayloadText(String 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 String msisdn
protected String data
protected long timeStamp
| Constructor Detail |
|---|
protected TextMessage(String msisdn,
String data)
| Method Detail |
|---|
public String getPayloadText()
String.
setPayloadText(java.lang.String)public void setPayloadText(String data)
null.
data - - payload data as a StringgetPayloadText()public 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(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 Date getTimestamp()
Message
getTimestamp in interface Message
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||