View Javadoc
1   package com.nilhcem.fakesmtp.server;
2   
3   import java.util.ArrayList;
4   import java.util.List;
5   import org.subethamail.smtp.AuthenticationHandler;
6   import org.subethamail.smtp.AuthenticationHandlerFactory;
7   
8   /**
9    * The factory interface for creating authentication handlers.
10   *
11   * @author jasonpenny
12   * @since 1.2
13   */
14  /*package*/ final class SMTPAuthHandlerFactory implements AuthenticationHandlerFactory {
15  	private static final String LOGIN_MECHANISM = "LOGIN";
16  
17  	@Override
18  	public AuthenticationHandler create() {
19  		return new SMTPAuthHandler();
20  	}
21  
22  	@Override
23  	public List<String> getAuthenticationMechanisms() {
24  		List<String> result = new ArrayList<String>();
25  		result.add(SMTPAuthHandlerFactory.LOGIN_MECHANISM);
26  		return result;
27  	}
28  }