KickJava   Java API By Example, From Geeks To Geeks.

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


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
18 /**
19  * Represents a magnolia user.
20  * @author philipp
21  * @version $Revision:2558 $ ($Author:scharles $)
22  */

23 public interface User {
24
25     /**
26      * Is this user in a specified role?
27      * @param roleName the name of the role
28      * @return true if in role
29      */

30     public boolean hasRole(String JavaDoc roleName);
31
32     /**
33      * Remove a role. Implementation is optional
34      */

35     public void removeRole(String JavaDoc roleName) throws UnsupportedOperationException JavaDoc;
36
37     /**
38      * Adds a role to this user. Implementation is optional
39      * @param roleName the name of the role
40      */

41     public void addRole(String JavaDoc roleName) throws UnsupportedOperationException JavaDoc;
42
43     /**
44      * Is this user in a specified group?
45      * @param groupName
46      * @return true if in group
47      */

48     public boolean inGroup(String JavaDoc groupName);
49
50     /**
51      * Remove a group. Implementation is optional
52      * @param groupName
53      */

54     public void removeGroup(String JavaDoc groupName) throws UnsupportedOperationException JavaDoc;
55
56     /**
57      * Adds this user to a group. Implementation is optional
58      * @param groupName
59      */

60     public void addGroup(String JavaDoc groupName) throws UnsupportedOperationException JavaDoc;
61
62     /**
63      * get user language
64      * @return language string
65      */

66
67     public abstract String JavaDoc getLanguage();
68
69     /**
70      * get user name
71      * @return name string
72      */

73     public abstract String JavaDoc getName();
74
75     /**
76      * get user password
77      * @return password string
78      */

79     public abstract String JavaDoc getPassword();
80
81     /**
82      * get groups that user is in
83      * @return
84      */

85     public abstract Collection JavaDoc getGroups();
86
87     /**
88      * get roles tha are assigned to user
89      * @return
90      */

91     public abstract Collection JavaDoc getRoles();
92 }
Popular Tags