01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: CredentialsManager.java 3643 2007-01-12 15:29:45Z gbevin $
07: */
08: package com.uwyn.rife.authentication;
09:
10: import com.uwyn.rife.authentication.exceptions.CredentialsManagerException;
11:
12: /**
13: * This interface defines the methods that classes with
14: * {@code CredentialsManager} functionalities have to implement.
15: * <p>A {@code CredentialsManager} is in charge of verifying
16: * {@code Credentials} instances. Using the information that a
17: * {@code CredentialsManager} provides, the authentication system is able
18: * to take appropriate actions (ie. start a new session, provide informational
19: * messages about a user's status, and so on).
20: *
21: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
22: * @version $Revision: 3643 $
23: * @see Credentials
24: * @see SessionValidator
25: * @since 1.0
26: */
27: public interface CredentialsManager {
28: /**
29: * Verifies the validity of the provided {@code Credentials}
30: * instance.
31: *
32: * @param credentials The {@code Credentials} instance that needs to
33: * be verified.
34: * @return A {@code long} that uniquely identifies the user that
35: * corresponds to the validated credentials; or
36: * <p>{@code -1} if the credentials are invalid.
37: * @exception CredentialsManagerException An undefined number of
38: * exceptional cases or error situations can occur when credentials are
39: * verified. They are all indicated by throwing an instance of
40: * {@code CredentialsManagerException}. It's up to the
41: * implementations of this interface to give more specific meanings to
42: * these exceptions.
43: * @since 1.0
44: */
45: public long verifyCredentials(Credentials credentials)
46: throws CredentialsManagerException;
47: }
|