|
jSyncManager Simple Java Server | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jSyncManager.SJS.Adapters.SMTPServer.Message
public class Message
This class provides an object representation of an e-mail message. It has several get methods which make it easy to access different properties of a typical e-mail.
Field Summary | |
---|---|
protected java.lang.StringBuffer |
body
Message body |
protected Address |
from
Sending address of the message |
protected java.util.Date |
received
The date when this message was received |
protected java.util.Date |
sent
The date when this message was sent |
protected java.util.List<Address> |
to
Receiving address of the message |
Constructor Summary | |
---|---|
Message()
Constructor, default empty constructor |
|
Message(Address from,
java.util.List<Address> to,
java.lang.String body)
A constructor which takes a from/to (sender/receiver), and body and initializes the sent/received dates to null. |
|
Message(java.util.Date sent,
java.util.Date received,
Address from,
java.util.List<Address> to,
java.lang.String body)
A constructor which takes a from/to (sender/receiver), body, and send/receive dates as arguments. |
Method Summary | |
---|---|
void |
addTo(Address address)
Returns the address of the receiver of a message |
void |
appendData(java.lang.String data)
Appends data to the end of the message body |
java.lang.String |
getBody()
Returns the body content of a message |
Address |
getFrom()
Returns the address of the sender of a message |
java.util.Date |
getReceivedDate()
Returns the date which this received was sent |
java.util.Date |
getSentDate()
Returns the date which this message was sent |
java.util.List<Address> |
getTo()
Returns the address of the receiver of a message |
java.util.Iterator<Address> |
getToIter()
Returns the address of the receiver of a message |
void |
setFrom(Address from)
Sets the from address of this message |
void |
setFrom(java.lang.String from)
Sets the from address of this message |
void |
setReceived(java.util.Date received)
Sets the received date of this message |
void |
setSent(java.util.Date sent)
Sets the sent date of this message |
void |
setTo(java.util.List<Address> to)
Sets the to address of this message |
java.lang.String |
toString()
Returns a string representation of the message in a common format |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Address from
protected java.util.List<Address> to
protected java.util.Date received
protected java.util.Date sent
protected java.lang.StringBuffer body
Constructor Detail |
---|
public Message()
public Message(java.util.Date sent, java.util.Date received, Address from, java.util.List<Address> to, java.lang.String body)
sent
- the date at which this message was sentreceived
- the date at which this message was receivedfrom
- the address of the senderto
- the address of the receiverbody
- the body content of the messagepublic Message(Address from, java.util.List<Address> to, java.lang.String body)
from
- the address of the senderto
- the address of the receiverbody
- the body content of the messageMethod Detail |
---|
public Address getFrom()
public void setFrom(java.lang.String from)
from
- The address as a Stringpublic void setFrom(Address from)
from
- The address as a Stringpublic void setReceived(java.util.Date received)
received
- date as a Datepublic void setSent(java.util.Date sent)
sent
- date as a Datepublic void setTo(java.util.List<Address> to)
to
- The to address as an Adddresspublic java.util.List<Address> getTo()
public java.util.Iterator<Address> getToIter()
public void addTo(Address address)
address
- the address of the receiver of a messagepublic void appendData(java.lang.String data)
data
- The string data to append to the message bodypublic java.lang.String getBody()
public java.util.Date getSentDate()
public java.util.Date getReceivedDate()
public java.lang.String toString()
toString
in class java.lang.Object
|
jSyncManager Simple Java Server | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |