KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > mail > message > SendableHeader


1 //The contents of this file are subject to the Mozilla Public License Version 1.1
2
//(the "License"); you may not use this file except in compliance with the
3
//License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
4
//
5
//Software distributed under the License is distributed on an "AS IS" basis,
6
//WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
7
//for the specific language governing rights and
8
//limitations under the License.
9
//
10
//The Original Code is "The Columba Project"
11
//
12
//The Initial Developers of the Original Code are Frederik Dietz and Timo Stich.
13
//Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
14
//
15
//All Rights Reserved.
16
package org.columba.mail.message;
17
18 import java.util.List JavaDoc;
19
20 import org.columba.ristretto.message.Attributes;
21 import org.columba.ristretto.message.Flags;
22 import org.columba.ristretto.message.Header;
23
24
25 /**
26  * Contains additional attributes useful for sending
27  * messages.
28  * <p>
29  * This includes a list of recipients and a UID uniquely
30  * identifying an account.
31  * <p>
32  *
33  * @author fdietz, tstich
34  */

35 public class SendableHeader extends ColumbaHeader {
36     public SendableHeader() {
37         super();
38     }
39
40     public int getAccountUid() {
41         return ((Integer JavaDoc) attributes.get("columba.accountuid")).intValue();
42     }
43
44     /**
45      * List of String representing the mail addresses.
46      *
47      *
48      * @return List of address Strings
49      */

50     public List JavaDoc getRecipients() {
51         return ((List JavaDoc) attributes.get("columba.recipients"));
52     }
53
54     public void setAccountUid(int uid) {
55         attributes.put("columba.accountuid", new Integer JavaDoc(uid));
56     }
57
58     public void setRecipients(List JavaDoc rcpt) {
59         attributes.put("columba.recipients", rcpt);
60     }
61
62     public Object JavaDoc clone() {
63         SendableHeader clone = new SendableHeader();
64         clone.attributes = (Attributes) this.attributes.clone();
65         clone.flags = (Flags) this.flags.clone();
66         clone.header = (Header) this.header.clone();
67
68         return clone;
69     }
70 }
71
Popular Tags