|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.objectxp.msg.Message
This class represents a generic Message. The message may be sent using various transport mechanisms (e.g. SMTP, GSM).
SmtpMessage,
SmsMessage,
Serialized Form| Field Summary | |
static java.lang.String |
ACK_TIME
See getProperty(String key) for more information |
static int |
MT_BINARY
Message type: binary data |
static int |
MT_STATUS
Message type: Status report. |
static int |
MT_TEXT
Message type: text (Default) |
static int |
SENDER_TYPE_ALPHA
Sender address is alphanumeric |
static int |
SENDER_TYPE_GUESS
Type (numeric/alphanumeric) of sender address will be guessed |
static int |
SENDER_TYPE_NUMBER
Sender address is a numeric |
| Constructor Summary | |
Message()
Creates an empty message |
|
| Method Summary | |
java.lang.Object |
clone()
Returns an exact copy of the Message |
byte[] |
getBytes()
Get the raw message data. |
java.lang.String |
getID()
Returns the ID of this message. |
java.lang.String |
getMessage()
Get the message body. |
java.lang.Object |
getProperty(java.lang.String key)
Returns the value of the specified key that is associated with this message. |
java.lang.String |
getRecipient()
Get the recipient of this message. |
java.lang.String |
getSender()
Get the sender of this message. |
int |
getSenderType()
Returns the Type of sender address. |
java.util.Date |
getTimestamp()
Get the date where the message was sent / received. |
int |
getType()
Returns the message type. |
void |
setID(java.lang.String id)
Set the ID of the Message. |
void |
setMessage(byte[] bytes)
Set the message data. |
void |
setMessage(java.lang.String message)
Set the message body. |
java.lang.Object |
setProperty(java.lang.String key,
java.lang.Object value)
Associate a key/value pair with this message. |
void |
setRecipient(java.lang.String recipient)
Set the recipient for this message. |
void |
setSender(java.lang.String sender)
Set the sender of this message. |
void |
setSenderType(int type)
Set the type of the sender address. |
void |
setType(int type)
Set the message type. |
java.lang.String |
toString()
Constructs a string representation of this Message |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int MT_TEXT
public static final int MT_BINARY
public static final int MT_STATUS
public static final int SENDER_TYPE_ALPHA
public static final int SENDER_TYPE_NUMBER
public static final int SENDER_TYPE_GUESS
public static final java.lang.String ACK_TIME
getProperty(String key) for more information
| Constructor Detail |
public Message()
| Method Detail |
public java.lang.String getID()
public void setID(java.lang.String id)
id - the Message ID to setpublic void setType(int type)
type - the type of message (MT_TEXT or MT_BINARY)
java.lang.IllegalArgumentException - if an invalid type is specifiedpublic int getType()
public void setRecipient(java.lang.String recipient)
recipient - address of the recipientpublic java.lang.String getRecipient()
public java.lang.String getSender()
public void setSender(java.lang.String sender)
public java.lang.String getMessage()
public byte[] getBytes()
public void setMessage(java.lang.String message)
message - the message.public void setMessage(byte[] bytes)
bytes - the raw message data.public java.lang.Object getProperty(java.lang.String key)
Use the key ACK_TIME to get the time it took for the SMSC to
acknowledge a sent SMS. The value returned for ACK_TIME is of type Long.
public java.lang.Object setProperty(java.lang.String key,
java.lang.Object value)
public java.util.Date getTimestamp()
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedExceptionpublic java.lang.String toString()
public void setSenderType(int type)
throws java.lang.IllegalArgumentException
Notice: The GsmSmsService does not support alphanumeric originators, therefore setting the sender type has no effect for Messages sent through GsmSmsService.
type - the address type. Allowed parameters are: SENDER_TYPE_ALPHA,
SENDER_TYPE_NUMBER, SENDER_TYPE_GUESS.
java.lang.IllegalArgumentExceptionpublic int getSenderType()
SENDER_TYPE_ALPHA, SENDER_TYPE_NUMBER or
SENDER_TYPE_GUESS.
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||