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.ProtocolNotAvailableException;
11: import org.claros.commons.mail.exception.ServerDownException;
12: import org.claros.commons.mail.models.ConnectionMetaHandler;
13: import org.claros.commons.mail.models.ConnectionProfile;
14:
15: /**
16: * @author Umut Gokbayrak
17: */
18: public interface Protocol {
19: public ConnectionMetaHandler connect(int connectType)
20: throws SystemException, ConnectionException,
21: ServerDownException;
22:
23: public void disconnect();
24:
25: public ArrayList fetchAllHeaders() throws SystemException,
26: ConnectionException;
27:
28: public ArrayList fetchAllHeadersAsMessages()
29: throws SystemException, ConnectionException;
30:
31: public ConnectionMetaHandler deleteMessages(int messageIds[])
32: throws MailboxActionException, SystemException,
33: ConnectionException;
34:
35: public Message getMessage(int messageId)
36: throws MailboxActionException, SystemException,
37: ConnectionException, Exception;
38:
39: public void emptyFolder() throws Exception;
40:
41: public int getTotalMessageCount() throws Exception;
42:
43: public int getUnreadMessageCount() throws Exception;
44:
45: public void flagAsDeleted(int[] ids) throws Exception;
46:
47: public ArrayList getHeadersSortedList(String sortCriteriaRaw,
48: String sortDirectionRaw)
49: throws ProtocolNotAvailableException;
50:
51: public ConnectionProfile getProfile();
52:
53: public ArrayList fetchHeaders(int[] msgs) throws SystemException,
54: ConnectionException;
55: }
|