KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > net > axis > transport > mailto > MailMessage


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  *
7  * Created on Jul 2, 2004
8  */

9 package org.jboss.net.axis.transport.mailto;
10
11 import java.io.InputStream JavaDoc;
12
13 import javax.mail.MessagingException JavaDoc;
14 import javax.mail.Session JavaDoc;
15 import javax.mail.internet.MimeMessage JavaDoc;
16
17 /**
18  * <dl>
19  * <dt><b>Title: </b><dd>JBoss.Net Email Message</dd>
20  * <p>
21  * <dt><b>Description: </b><dd>This is a MimeMessage that allows a mesage ID to be manually by the sender.</dd>
22  * <p>
23  * </dl>
24  * @author <a HREF="mailto:jasone@greenrivercomputing.com">Jason Essington</a>
25  * @version $Revision: 1.1 $
26  */

27 public class MailMessage extends MimeMessage JavaDoc
28 {
29    protected String JavaDoc messageID;
30
31    /**
32     * @param arg0
33     * @throws javax.mail.MessagingException
34     */

35    public MailMessage(MimeMessage JavaDoc arg0) throws MessagingException JavaDoc
36    {
37       super(arg0);
38       // TODO Auto-generated constructor stub
39
}
40    /**
41     * @param arg0
42     */

43    public MailMessage(Session JavaDoc arg0)
44    {
45       super(arg0);
46       // TODO Auto-generated constructor stub
47
}
48    /**
49     * @param arg0
50     * @param arg1
51     * @throws javax.mail.MessagingException
52     */

53    public MailMessage(Session JavaDoc arg0, InputStream JavaDoc arg1) throws MessagingException JavaDoc
54    {
55       super(arg0, arg1);
56       // TODO Auto-generated constructor stub
57
}
58
59    /**
60     * If we have set our own messageID, we should use that other wise go ahead and use the one generated by javamail.
61     * @see javax.mail.internet.MimeMessage#updateHeaders()
62     */

63    protected void updateHeaders() throws MessagingException JavaDoc
64    {
65       super.updateHeaders();
66       if (messageID != null)
67          setHeader("Message-ID", messageID);
68    }
69
70    /**
71     * Returns the current message ID.
72     */

73    public String JavaDoc getMessageID()
74    {
75       return this.messageID;
76    }
77
78    /**
79     * Set the message ID for this message.
80     * @param id
81     */

82    public void setMessageID(String JavaDoc id)
83    {
84       this.messageID = id;
85    }
86 }
Popular Tags