1 /*
2 * Copyright (C) The Apache Software Foundation. All rights reserved.
3 *
4 * This software is published under the terms of the Apache Software License
5 * version 1.1, a copy of which has been included with this distribution in
6 * the LICENSE file.
7 */
8 package org.apache.mailet;
9
10 import javax.mail.MessagingException;
11 import javax.mail.internet.MimeMessage;
12 import java.io.Serializable;
13 import java.util.Collection;
14
15 /***
16 * Wrap a MimeMessage with routing information (from SMTP) such
17 * as SMTP specified recipients, sender, and ip address and hostname
18 * of sending server. It also contains its state which represents
19 * which processor in the mailet container it is currently running.
20 * Special processor names are "root" and "error".
21 *
22 * @author Federico Barbieri <scoobie@systemy.it>
23 * @author Serge Knystautas <sergek@lokitech.com>
24 * @version 0.9
25 */
26 public interface Mail extends Serializable, Cloneable {
27 String GHOST = "ghost";
28 String DEFAULT = "root";
29 String ERROR = "error";
30 String TRANSPORT = "transport";
31
32 /***
33 * Returns the MimeMessage stored in this message
34 *
35 * @return the MimeMessage that this Mail object wraps
36 * @throws MessagingException - an error occured while loading this object
37 */
38 MimeMessage getMessage() throws MessagingException;
39
40 /***
41 * Returns a Collection of MailAddress objects that are recipients of this message
42 *
43 * @return a Collection of MailAddress objects that are recipients of this message
44 */
45 Collection getRecipients();
46
47 /***
48 * The sender of the message, as specified by the MAIL FROM header, or internally defined
49 *
50 * @return a MailAddress of the sender of this message
51 */
52 MailAddress getSender();
53
54 /***
55 * The current state of the message, such as GHOST, ERROR, or DEFAULT
56 *
57 * @return the state of this message
58 */
59 String getState();
60
61 /***
62 * The remote hostname of the server that connected to send this message
63 *
64 * @return a String of the hostname of the server that connected to send this message
65 */
66 String getRemoteHost();
67
68 /***
69 * The remote ip address of the server that connected to send this message
70 *
71 * @return a String of the ip address of the server that connected to send this message
72 */
73 String getRemoteAddr();
74
75 /***
76 * The error message, if any, associated with this message. Not sure why this is needed.
77 *
78 * @return a String of a descriptive error message
79 */
80 String getErrorMessage();
81
82 /***
83 * Sets the error message associated with this message. Not sure why this is needed.
84 *
85 * @param msg - a descriptive error message
86 */
87 void setErrorMessage(String msg);
88
89 /***
90 * Sets the MimeMessage associated with this message via the object.
91 *
92 * @param message - the new MimeMessage that this Mail object will wrap
93 */
94 void setMessage(MimeMessage message);
95
96 /***
97 * Sets the state of this message.
98 *
99 * @param state - the new state of this message
100 */
101 void setState(String state);
102 }
This page was automatically generated by Maven