01: /*--------------------------------------------------------------------------*
02: | Copyright (C) 2006 Gereon Fassbender, Christopher Kohlhaas |
03: | |
04: | This program is free software; you can redistribute it and/or modify |
05: | it under the terms of the GNU General Public License as published by the |
06: | Free Software Foundation. A copy of the license has been included with |
07: | these distribution in the COPYING file, if not go to www.fsf.org |
08: | |
09: | As a special exception, you are granted the permissions to link this |
10: | program with every library, which license fulfills the Open Source |
11: | Definition as published by the Open Source Initiative (OSI). |
12: *--------------------------------------------------------------------------*/
13: package org.rapla.facade;
14:
15: import org.rapla.entities.User;
16: import org.rapla.framework.RaplaException;
17:
18: /** Encapsulates the methods responsible for authentification.
19: * @version CVS $Revision: 1.22 $ $Date: 2006/01/08 14:43:14 $
20: */
21:
22: public interface UserModule {
23: /** The login method establishes the connection and loads data.
24: * It should clear the password char array.
25: * @return false on an invalid login.
26: * @throws RaplaException if the connection can't be established.
27: */
28: boolean login(String username, char[] password)
29: throws RaplaException;
30:
31: /** logout of the current user */
32: void logout() throws RaplaException;
33:
34: /** returns if a session is active. True between a successful login and logout. */
35: boolean isSessionActive();
36:
37: /** throws an Exception if no user has loged in.
38: @return the user that has loged in. */
39: User getUser() throws RaplaException;
40:
41: /** the admin can switch to another user!*/
42: void switchTo(User user);
43:
44: /** returns true if the admin has switched to anoter user!*/
45: boolean canSwitchBack();
46:
47: void changePassword(User user, char[] oldPassword,
48: char[] newPassword) throws RaplaException;
49:
50: boolean canChangePassword();
51: }
|