1 /* 2 * Copyright (c) 2005-2007 Creative Sphere Limited. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * 10 * Creative Sphere - initial API and implementation 11 * 12 */ 13 package org.abstracthorizon.mercury.maildir.security; 14 15 /** 16 * Interface describing authentication provider. 17 * 18 * @author Daniel Sendula 19 */ 20 public interface AuthenticationProvider { 21 22 /** 23 * Initialises provider with given login context name 24 * @param loginContext login context name 25 */ 26 void init(String loginContext); 27 28 /** 29 * Tries to authenticate given user. 30 * @param host host to be logged to 31 * @param port port to be logged to 32 * @param user username 33 * @param pass password 34 * @return <code>true</code> if authentication succeded. 35 */ 36 boolean authenticate(String host, int port, String user, char[] pass); 37 38 }