|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Provides interface for a mail queue.
This interface models a mail queue which stores mail messages waiting for processing and delivery to local mailboxes or remote hosts.
Method Summary | |
SMTPMessage |
dequeueMessage(Node node)
Dequeues a message for the given node. |
void |
enqueueMessage(SMTPMessage message,
Node node,
long time)
Enqueues the message for the given node and time. |
SMTPMessage |
getMessageInstance()
Returns a new SMTPMessage instance. |
void |
listMessages(boolean details,
java.io.PrintWriter out)
Lists all messages in the queue. |
java.util.Iterator |
listNodes()
Lists all active nodes. |
Method Detail |
public SMTPMessage getMessageInstance() throws MailException
SMTPMessage
instance.
MailException
- if an error occuredpublic void listMessages(boolean details, java.io.PrintWriter out) throws MailException
A short or detailed information is printed out about each message waiting in the queue.
details
- true to print message details, false otherwiseout
- the output stream
MailException
- if an error occuredpublic void enqueueMessage(SMTPMessage message, Node node, long time) throws MailException
The message as well as its recipient collection are stored to the mail queue and may
be returned later via the dequeueMessage(Node)
method, if the recipients are targeted
for the given node and other conditions are met, too. In other words, the message
is scheduled to be processed for the given node at the specified time.
message
- the messagenode
- the node to enqueue the message fortime
- the time for next processing or delivery attempt
MailException
- if an error occuredpublic SMTPMessage dequeueMessage(Node node) throws MailException
Only those messages may be returned which had been enqueued for the given node and time
less or equal the current system time, unless the node's Node.getForceDelivery()
returns true. Furthemore, messages which had been already processed for the same Node
object previously must not be returned. A returned message's SMTPMessage.getRecipients()
method may return only those recipients which are targeted for the given node.
After dequeueing the recipients are removed from the queue processing and may be included
in it again only by calling enqueueMessage(SMTPMessage, Node, long)
on the same
message object.
node
- the node to dequeue a message for
MailException
- if an error occuredpublic java.util.Iterator listNodes()
A node is active only if it contains any messages for processing. The returned iteration contains java.lang.String objects with the node names.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |