View Javadoc

1   /*
2    * This file is part of Domingo
3    * an Open Source Java-API to Lotus Notes/Domino
4    * hosted at http://domingo.sourceforge.net
5    *
6    * Copyright (c) 2003-2007 Beck et al. projects GmbH Munich, Germany (http://www.bea.de)
7    *
8    * This library is free software; you can redistribute it and/or
9    * modify it under the terms of the GNU Lesser General Public
10   * License as published by the Free Software Foundation; either
11   * version 2.1 of the License, or (at your option) any later version.
12   *
13   * This library is distributed in the hope that it will be useful,
14   * but WITHOUT ANY WARRANTY; without even the implied warranty of
15   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16   * Lesser General Public License for more details.
17   *
18   * You should have received a copy of the GNU Lesser General Public
19   * License along with this library; if not, write to the Free Software
20   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21   */
22  
23  package de.bea.domingo.groupware;
24  
25  import java.util.Iterator;
26  
27  /***
28   * Interface to the mail functionality of a Notes mail database.
29   *
30   * @author <a href=mailto:kriede@users.sourceforge.net>Kurt Riede</a>
31   */
32  public interface Mailbox {
33  
34      /***
35       * Returns the name of the owner of a mailbox.
36       *
37       * @return name of owner
38       */
39      String getOwner();
40  
41      /***
42       * Returns an iterator over all mails in the Inbox.
43       *
44       * @return iterator over all mails in the Inbox
45       */
46      Iterator getInbox();
47  
48      /***
49       * Returns an iterator over all mails in the Inbox.
50       *
51       * <p>Depending on how the inbox is sorted (ascending or descending by
52       * date), choose where to start reading mails.</p>
53       *
54       * @param reverseOrder whether to start at the beginning or at the end
55       * @return iterator over all mails in the Inbox
56       */
57      Iterator getInbox(final boolean reverseOrder);
58  
59  
60      /***
61       * Creates a new Memo.
62       *
63       * @return the new Memo instance
64       */
65      Email newEmail();
66  
67      /***
68       * Sends a memo.
69       *
70       * @param memo the memo to send
71       */
72      void saveAsDraft(final Email memo);
73  
74      /***
75       * Sends a memo.
76       *
77       * @param memo the memo to send
78       */
79      void send(final Email memo);
80  
81      /***
82       * Creates a new memo as a forward of an existing memo.
83       *
84       * @param memo the memo to forward
85       * @return forward memo
86       */
87      Email forward(final Email memo);
88  
89      /***
90       * Creates a new memo as a forward to an existing memo.
91       *
92       * @param memo an existing memo
93       * @param withAttachments forward with or without attachments
94       * @return the reply memo
95       */
96      Email forward(final Email memo, final boolean withAttachments);
97  
98          /***
99       * Creates a new memo as a reply to the sender of the original memo.
100      *
101      * @param memo the memo to forward
102      * @param withHistory if the original mail should be included
103      * @param withAttachments if attachments should be included
104      * @return reply memo
105      */
106     Email reply(final Email memo, final boolean withHistory, final boolean withAttachments);
107 
108     /***
109      * Creates a new memo as a reply to all original recipients of the original memo.
110      *
111      * @param memo the memo to forward
112      * @param withHistory if the original mail should be included
113      * @param withAttachments if attachments should be included
114      * @return reply memo
115      */
116     Email replyToAll(final Email memo, final boolean withHistory, final boolean withAttachments);
117 
118     /***
119      * Deletes an existing memo.
120      *
121      * @param memo a memo to delete
122      */
123     void remove(final Email memo);
124 
125     /***
126      * Deletes an existing memo.
127      *
128      * @param memo a memo digest to delete
129      */
130     void remove(final EmailDigest memo);
131 
132     /***
133      * Returns the email represented by the given email-digest.
134      *
135      * @param emailDigest an email-digest
136      * @return the corresponding email
137      */
138     Email getEmail(EmailDigest emailDigest);
139 }