1   /**
2    * Created by IntelliJ IDEA.
3    * User: Edwin
4    * Date: Dec 5, 2002
5    * Time: 2:51:14 PM
6    * To change this template use Options | File Templates.
7    */
8   package com.atlassian.mail.server;
9   
10  import alt.javax.mail.Session;
11  import alt.javax.mail.Transport;
12  import com.atlassian.mail.MailException;
13  
14  import javax.mail.Authenticator;
15  import java.util.List;
16  import java.util.Map;
17  import java.util.Properties;
18  
19  public interface MailServerManager
20  {
21      /**
22       * This class allows MailServers to be created, updated and deleted.
23       * It also allows MailServers to be retrieved by id and name
24       */
25      String[] SERVER_TYPES = new String[]{"pop", "smtp"};
26  
27      MailServer getMailServer(Long id) throws MailException;
28  
29      MailServer getMailServer(String name) throws MailException;
30  
31      Long create(MailServer mailServer) throws MailException;
32  
33      void update(MailServer mailServer) throws MailException;
34  
35      void delete(Long mailServerId) throws MailException;
36  
37      List getServerNames() throws MailException;
38  
39      List getSmtpMailServers() throws MailException;
40  
41      List getPopMailServers() throws MailException;
42  
43      SMTPMailServer getDefaultSMTPMailServer() throws MailException;
44  
45      PopMailServer getDefaultPopMailServer() throws MailException;
46  
47      Session getSession(Properties props, Authenticator auth) throws MailException;
48  
49      void init(Map params);
50  }