01: //The contents of this file are subject to the Mozilla Public License Version 1.1
02: //(the "License"); you may not use this file except in compliance with the
03: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
04: //
05: //Software distributed under the License is distributed on an "AS IS" basis,
06: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
07: //for the specific language governing rights and
08: //limitations under the License.
09: //
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;
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: * Contains additional attributes useful for sending
26: * messages.
27: * <p>
28: * This includes a list of recipients and a UID uniquely
29: * identifying an account.
30: * <p>
31: *
32: * @author fdietz, tstich
33: */
34: public class SendableHeader extends ColumbaHeader {
35: public SendableHeader() {
36: super ();
37: }
38:
39: public int getAccountUid() {
40: return ((Integer) attributes.get("columba.accountuid"))
41: .intValue();
42: }
43:
44: /**
45: * List of String representing the mail addresses.
46: *
47: *
48: * @return List of address Strings
49: */
50: public List getRecipients() {
51: return ((List) attributes.get("columba.recipients"));
52: }
53:
54: public void setAccountUid(int uid) {
55: attributes.put("columba.accountuid", new Integer(uid));
56: }
57:
58: public void setRecipients(List rcpt) {
59: attributes.put("columba.recipients", rcpt);
60: }
61:
62: public Object 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: }
|