01: package org.claros.commons.mail.protocols;
02:
03: import java.util.ArrayList;
04:
05: import javax.mail.Message;
06:
07: import org.claros.commons.exception.SystemException;
08: import org.claros.commons.mail.exception.ConnectionException;
09: import org.claros.commons.mail.exception.MailboxActionException;
10: import org.claros.commons.mail.exception.ServerDownException;
11: import org.claros.commons.mail.models.ConnectionMetaHandler;
12:
13: /**
14: * @author Umut Gokbayrak
15: */
16: public interface Protocol {
17: public ConnectionMetaHandler connect(int connectType)
18: throws SystemException, ConnectionException,
19: ServerDownException;
20:
21: public void disconnect();
22:
23: public ArrayList fetchAllHeaders() throws SystemException,
24: ConnectionException;
25:
26: public ArrayList fetchAllHeadersAsMessages()
27: throws SystemException, ConnectionException;
28:
29: public ConnectionMetaHandler deleteMessages(int messageIds[])
30: throws MailboxActionException, SystemException,
31: ConnectionException;
32:
33: public Message getMessage(int messageId)
34: throws MailboxActionException, SystemException,
35: ConnectionException, Exception;
36:
37: public void emptyFolder() throws Exception;
38:
39: public int getTotalMessageCount() throws Exception;
40:
41: public int getUnreadMessageCount() throws Exception;
42:
43: public void flagAsDeleted(int[] ids) throws Exception;
44: }
|