KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > cms > security > UserManager


1 /**
2  *
3  * Magnolia and its source-code is licensed under the LGPL.
4  * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5  * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6  * you are required to provide proper attribution to obinary.
7  * If you reproduce or distribute the document without making any substantive modifications to its content,
8  * please use the following attribution line:
9  *
10  * Copyright 1993-2006 obinary Ltd. (http://www.obinary.com) All rights reserved.
11  *
12  */

13 package info.magnolia.cms.security;
14
15 import java.util.Collection JavaDoc;
16
17 import javax.security.auth.Subject JavaDoc;
18
19
20 /**
21  * Used to get the current or other User objects.
22  * @author philipp
23  * @version $Revision: 6341 $ ($Author: philipp $)
24  */

25 public interface UserManager {
26
27     /**
28      * Magnolia system user.
29      */

30     public static final String JavaDoc SYSTEM_USER = "superuser";
31
32     /**
33      * Magnolia system default password
34      */

35     public static final String JavaDoc SYSTEM_PSWD = "superuser";
36
37     /**
38      * Anonymous user
39      */

40     public static final String JavaDoc ANONYMOUS_USER = "anonymous";
41
42     /**
43      * Find a specific user. Not all implementations will support this method.
44      * @param name the name of the user
45      * @return the user object
46      */

47     public User getUser(String JavaDoc name) throws UnsupportedOperationException JavaDoc;
48
49     /**
50      * Get system user, this user must always exist in magnolia repository.
51      * @return system user
52      */

53     public User getSystemUser();
54
55     /**
56      * Get Anonymous user, this user must always exist in magnolia repository.
57      * @return anonymous user
58      */

59     public User getAnonymousUser();
60
61     /**
62      * Get all users.
63      * @return collection of User objects
64      * @throws UnsupportedOperationException
65      */

66     public Collection JavaDoc getAllUsers() throws UnsupportedOperationException JavaDoc;
67
68     /**
69      * Creates a user without security restrictions
70      * @param name user name
71      * @param pw password
72      * @return the new user object
73      * @throws UnsupportedOperationException
74      */

75     public User createUser(String JavaDoc name, String JavaDoc pw) throws UnsupportedOperationException JavaDoc;
76
77     /**
78      * Initialize new user using JAAS authenticated/authorized subject
79      * @param subject
80      * @throws UnsupportedOperationException
81      */

82     public User getUser(Subject JavaDoc subject) throws UnsupportedOperationException JavaDoc;
83 }
Popular Tags