|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SK.gnome.dwarf.mail.smtp.SMTPMessage
This is an abstract SMTP message.
This object represents both the SMTP envelope information and raw message content
of a queued message. Furthemore, it provides also a parsed MimePart
view of the
message content via the getMimePart()
method. SMTPMessage objects are
stored and maintained by the mail queue. New object instances may be used to create and
send a new RFC 822 messages, as well.
Each MailQueue
implementation must extend this class to declare an usefull
SMTPMessage class.
Constructor Summary | |
protected |
SMTPMessage()
Creates a new SMTPMessage. |
Method Summary | |
protected void |
addRecipient(Recipient rcpt)
Adds the given recipient to the message. |
void |
addRecipient(Recipient recipient,
java.util.Collection expanded)
Adds the given recipient to the message. |
protected void |
addRecipients(java.util.Collection rcpts)
Adds the given recipients to the message. |
boolean |
get8bitMIME()
Returns the 8BITMIME SMTP parameter. |
java.lang.String |
getAuth()
Returns the AUTH SMTP parameter. |
java.net.InetAddress |
getClientAddress()
Returns the SMTP client address. |
java.lang.String |
getClientDomain()
Returns the domain name of the SMTP client as provided in the HELO/EHLO command. |
long |
getCurrentDeliveryDelay(Recipient recipient)
Returns the current delivery delay for the given recipient. |
java.lang.String |
getDate()
Returns the internal message time formatted as per RFC 822. |
boolean |
getDeliverBy()
Returns the DELIVERBY SMTP parameter. |
char |
getDeliverByMode()
Returns the BYTIME SMTP parameter. |
int |
getDeliverByTime()
Returns the BYTIME SMTP parameter. |
boolean |
getDeliverByTrace()
Returns the BYTRACE SMTP parameter. |
protected int |
getDeliveryDelay()
Returns the delivery delay in milliseconds. |
java.lang.String |
getDSNEnvid()
Returns the DSNENVID SMTP parameter. |
java.lang.String |
getDSNRet()
Returns the DSNRET SMTP parameter. |
java.lang.String |
getFrom()
Returns the SMTP reverse-path value. |
abstract java.io.InputStream |
getInputStream()
Returns the message content. |
abstract long |
getMessageSize()
Returns the message size. |
abstract MimePart |
getMimePart()
Returns a parsed MIME interpretation of the message. |
java.lang.String |
getProtocol()
Returns the submission protocol. |
java.util.Collection |
getRecipients()
Returns the message recipients. |
int |
getRecipientsSize()
|
java.net.InetAddress |
getServerAddress()
Returns the local SMTP server's address. |
java.lang.String |
getSMTPid()
Returns the SMTP identification string. |
long |
getTime()
Returns the internal message time. |
boolean |
isFinished()
Whether the message is finished. |
protected abstract boolean |
isStored()
Whether the message is store in the mail queue. |
void |
set8bitMIME(boolean enable)
Sets the 8BITMIME parameter. |
protected void |
setAuth(java.lang.String auth)
Sets the AUTH parameter value. |
protected void |
setClientAddress(java.net.InetAddress address)
Sets the SMTP client address. |
protected void |
setClientDomain(java.lang.String domain)
Sets the SMTP client domain name. |
abstract void |
setContent(java.io.InputStream in)
Sets the content of the message. |
protected void |
setDeliverBy(boolean value)
Sets the DELIVERBY parameter. |
protected void |
setDeliverByMode(char mode)
Sets the BYMODE parameter. |
protected void |
setDeliverByTime(int time)
Sets the BYTIME parameter. |
protected void |
setDeliverByTrace(boolean set)
Sets the BYTRACE parameter. |
void |
setDeliveryDelay(int delay)
Sets the delivery delay of the message in milliseconds. |
void |
setDSNEnvid(java.lang.String envid)
Sets the DSNENVID parameter. |
void |
setDSNRet(java.lang.String ret)
Sets the DSNRET parameter. |
void |
setFrom(java.lang.String from)
Sets the SMTP reverse-path value. |
protected void |
setProtocol(java.lang.String protocol)
Sets the protocol identification. |
protected void |
setServerAddress(java.net.InetAddress address)
Sets the local SMTP server's address. |
protected void |
setSMTPid(java.lang.String smtpId)
Sets the SMTP identification of the message. |
protected void |
setTime(long time)
Sets the internal message time. |
protected abstract void |
store()
Stores this message to the mail queue. |
protected abstract void |
storeRecipients(java.util.Collection recipients)
Updates the given recipients in the mail queue. |
java.lang.String |
toString()
Returns a string representation of the message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected SMTPMessage()
Method Detail |
public long getTime()
MailAgentMessage
Returns the system time in the moment the message was created.
getTime
in interface MailAgentMessage
public java.lang.String getDate()
MailAgentMessage
Returns the system time in the moment the message was created.
getDate
in interface MailAgentMessage
public final java.lang.String getSMTPid()
MailAgentMessage
Each message instance has a unique identification string.
getSMTPid
in interface MailAgentMessage
public java.lang.String getProtocol()
MailAgentMessage
One of the "LMTP", "SMTP", "ESMTP" or "LOCAL" values may be returned.
getProtocol
in interface MailAgentMessage
public java.lang.String getClientDomain()
MailAgentMessage
getClientDomain
in interface MailAgentMessage
public java.net.InetAddress getClientAddress()
MailAgentMessage
getClientAddress
in interface MailAgentMessage
public java.net.InetAddress getServerAddress()
MailAgentMessage
getServerAddress
in interface MailAgentMessage
public void setFrom(java.lang.String from)
Value of the from argument must be a valid RFC 822 address without the display-name part.
from
- the RFC 822 addresspublic java.lang.String getFrom()
MailAgentMessage
getFrom
in interface MailAgentMessage
public void set8bitMIME(boolean enable)
This parameter enables the pure 8bit transfer of a MIME content. It must be supported by the corresponding ESMTP extension.
enable
- true to enable the 8bit MIME transfer, false otherwisepublic boolean get8bitMIME()
MailAgentMessage
get8bitMIME
in interface MailAgentMessage
public java.lang.String getAuth()
MailAgentMessage
getAuth
in interface MailAgentMessage
public void setDSNRet(java.lang.String ret)
It must be supported by the corresponding ESMTP extension (DSN).
ret
- the parameter valuepublic java.lang.String getDSNRet()
MailAgentMessage
getDSNRet
in interface MailAgentMessage
public void setDSNEnvid(java.lang.String envid)
It must be supported by the corresponding ESMTP extension (DSN).
envid
- the parameter valuepublic java.lang.String getDSNEnvid()
MailAgentMessage
getDSNEnvid
in interface MailAgentMessage
public boolean getDeliverBy()
MailAgentMessage
getDeliverBy
in interface MailAgentMessage
public int getDeliverByTime()
MailAgentMessage
getDeliverByTime
in interface MailAgentMessage
public char getDeliverByMode()
MailAgentMessage
getDeliverByMode
in interface MailAgentMessage
public boolean getDeliverByTrace()
MailAgentMessage
getDeliverByTrace
in interface MailAgentMessage
public void setDeliveryDelay(int delay)
When greater than zero the message delivery will be delayed for the specified amount of time. This is useful when preventing mail looping in some very special cases.
delay
- the delay inpublic long getCurrentDeliveryDelay(Recipient recipient)
MailAgentMessage
getCurrentDeliveryDelay
in interface MailAgentMessage
recipient
- the recipient
public java.util.Collection getRecipients()
public int getRecipientsSize()
public void addRecipient(Recipient recipient, java.util.Collection expanded)
recipient
- the recipientexpanded
- list of expanded recipients if the recipient is in fact an alias namepublic boolean isFinished()
A message is finished only if all its recipients are finished.
public abstract void setContent(java.io.InputStream in) throws java.io.IOException
Stores the bytes provided by the input stream as the message octets. The input data must be formatted as per RFC 822. The method must not perform any syntax chcecking nor interpret the incoming data in any other way.
in
- inpput stream to read the message from
java.io.IOException
- if the content could not be setpublic abstract long getMessageSize()
MailAgentMessage
This is the exact size of the whole unparsed message, including the header.
getMessageSize
in interface MailAgentMessage
public abstract java.io.InputStream getInputStream() throws java.io.IOException
MailAgentMessage
Returns the whole unparsed message octets, including the header.
getInputStream
in interface MailAgentMessage
java.io.IOException
- if an I/O error occuredpublic abstract MimePart getMimePart() throws MailException
MailAgentMessage
getMimePart
in interface MailAgentMessage
MailException
- if an error occuredpublic java.lang.String toString()
protected abstract boolean isStored()
protected abstract void store() throws MailException
Stores the whole message including the recipient collection.
MailException
- if an error occuredprotected abstract void storeRecipients(java.util.Collection recipients) throws MailException
Updates only information about the given recipients. The recipients collection is always a subset of the original message recipient collection stored in the mail queue.
recipients
- the recipients to update
MailException
- if an error occuredprotected int getDeliveryDelay()
protected void setTime(long time)
time
- the internal timeprotected void setSMTPid(java.lang.String smtpId)
smtpId
- the SMTP idprotected void setProtocol(java.lang.String protocol)
protocol
- the protovolprotected void setClientDomain(java.lang.String domain)
domain
- the domain nameprotected void setClientAddress(java.net.InetAddress address)
address
- the client addressprotected void setServerAddress(java.net.InetAddress address)
address
- the server addressprotected void setAuth(java.lang.String auth)
It must be supported by the corresponding ESMTP extension (AUTH).
auth
- the parameter valueprotected void setDeliverBy(boolean value)
It must be supported by the corresponding ESMTP extension (DELIVERBY).
value
- the parameter valueprotected void setDeliverByTime(int time)
It must be supported by the corresponding ESMTP extension (DELIVERBY).
time
- the parameter valueprotected void setDeliverByMode(char mode)
It must be supported by the corresponding ESMTP extension (DELIVERBY).
mode
- the parameter valueprotected void setDeliverByTrace(boolean set)
It must be supported by the corresponding ESMTP extension (DELIVERBY).
set
- the parameter valueprotected void addRecipient(Recipient rcpt)
rcpt
- the recipientprotected void addRecipients(java.util.Collection rcpts)
rcpts
- the recipients
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |