01: package org.contineo.core.communication.dao;
02:
03: import java.util.Collection;
04:
05: import org.contineo.core.communication.EMail;
06:
07: /**
08: * This is a DAO service for EMail.
09: *
10: * @author Michael Scholz
11: * @author Alessandro Gasparini
12: * @version 1.0
13: */
14: public interface EMailDAO {
15:
16: /**
17: * This method persists an emailaccount object.
18: *
19: * @param account EMailAccount which should be store.
20: * @return True if successfully stored in a database.
21: */
22: public boolean store(EMail email);
23:
24: /**
25: * This method deletes an emailaccount.
26: *
27: * @param emailId AccountId of the emailaccount which should be delete.
28: */
29: public boolean delete(int emailId);
30:
31: /**
32: * This method finds an email by its id.
33: */
34: public EMail findByPrimaryKey(int emailid);
35:
36: public Collection<EMail> findByUserName(String username);
37:
38: public Collection<EMail> findByUserName(String username,
39: String folder);
40:
41: /**
42: * Loads all e-mails downloaded by the specified account
43: *
44: * @param accountId
45: * @return
46: */
47: public Collection<EMail> findByAccountId(int accountId);
48:
49: /**
50: * Same as findByAccountId except for the fact that the returned collection
51: * contains e-mail identifiers only
52: *
53: * @param accountId
54: * @return
55: */
56: public Collection<String> collectEmailIds(int accountId);
57: }
|