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: IdentifiableUsersManager.java 3722 2007-04-29 09:03:22Z gbevin $
07: */
08: package com.uwyn.rife.authentication.credentialsmanagers;
09:
10: import com.uwyn.rife.authentication.exceptions.CredentialsManagerException;
11:
12: /**
13: * This interface defines the methods that are needed for the {@link com.uwyn.rife.authentication.elements.Identified}
14: * element to be able to setup a {@link RoleUserIdentity} instance for each authenticated user for whom the
15: * {@code Identified} element is executed.
16: *
17: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
18: * @version $Revision: 3722 $
19: * @see com.uwyn.rife.authentication.elements.Identified
20: * @see RoleUserIdentity
21: * @since 1.6
22: */
23: public interface IdentifiableUsersManager {
24: /**
25: * Retrieves the attributes of a particular user according to its unique login.
26: *
27: * @param login the login of the user whose attributes need to be retrieved
28: * @return the requested user attributes; or
29: * <p>{@code null} if the user couldn't be found
30: * @throws CredentialsManagerException when a unexpected error occurred during the retrieval of the user attributes
31: * @since 1.6
32: */
33: public RoleUserAttributes getAttributes(String login)
34: throws CredentialsManagerException;
35:
36: /**
37: * Retrieves the login of a particular user according to its unique ID.
38: *
39: * @param userId the ID of the user whose login will be retrieved
40: * @return the requested user login; or
41: * <p>{@code null} if the user couldn't be found
42: * @throws CredentialsManagerException when a unexpected error occurred during the retrieval of the user login
43: * @since 1.6
44: */
45: public String getLogin(long userId)
46: throws CredentialsManagerException;
47: }
|