1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.caleigo.security;
20
21 /*** An ILoginHandler handles the process of login in a user. It uses an IUserLoginHandler
22 * for user interaction.
23 *
24 * @author Mattias Hagstrand
25 * @version 1.00
26 *
27 *//*
28 *
29 * WHEN WHO WHY & WHAT
30 * -----------------------------------------------------------------------------
31 * 2002-10-16 Mattias Hagstrand Creation
32 */
33 public interface ILoginHandler
34 {
35
36 /*** Tries to log in a user.
37 *
38 * @param loginInfo An object that contains login information, such as user name, password.
39 * @return A UserInfo object if succesfull, <code>null</code> otherwise.
40 * @throws SecurityException if the login fails.
41 */
42 public UserInfo login(Object loginInfo);
43
44
45
46 /*** Default implementation of ILoginHandler that acceps all logins and logouts.
47 * All logins gets the user is guest.
48 */
49 public static class DefaultLoginHandler implements ILoginHandler
50 {
51
52
53 /*** Tries to log in a user.
54 *
55 * @param loginInfo An object that contains login information, such as user name, password.
56 * @return A UserInfo object if succesfull, <code>null</code> otherwise.
57 * @throws SecurityException if the login fails.
58 */
59 public UserInfo login(Object loginInformation)
60 {
61 UserInfo userInfo = new UserInfo.DefaultUserInfo();
62 userInfo.setCurrentUserID("guest");
63 return userInfo;
64 }
65 }
66 }