KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > Group


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18
19 package org.apache.catalina;
20
21
22 import java.security.Principal JavaDoc;
23 import java.util.Iterator JavaDoc;
24
25
26 /**
27  * <p>Abstract representation of a group of {@link User}s in a
28  * {@link UserDatabase}. Each user that is a member of this group
29  * inherits the {@link Role}s assigned to the group.</p>
30  *
31  * @author Craig R. McClanahan
32  * @version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
33  * @since 4.1
34  */

35
36 public interface Group extends Principal JavaDoc {
37
38
39     // ------------------------------------------------------------- Properties
40

41
42     /**
43      * Return the description of this group.
44      */

45     public String JavaDoc getDescription();
46
47
48     /**
49      * Set the description of this group.
50      *
51      * @param description The new description
52      */

53     public void setDescription(String JavaDoc description);
54
55
56     /**
57      * Return the group name of this group, which must be unique
58      * within the scope of a {@link UserDatabase}.
59      */

60     public String JavaDoc getGroupname();
61
62
63     /**
64      * Set the group name of this group, which must be unique
65      * within the scope of a {@link UserDatabase}.
66      *
67      * @param groupname The new group name
68      */

69     public void setGroupname(String JavaDoc groupname);
70
71
72     /**
73      * Return the set of {@link Role}s assigned specifically to this group.
74      */

75     public Iterator JavaDoc getRoles();
76
77
78     /**
79      * Return the {@link UserDatabase} within which this Group is defined.
80      */

81     public UserDatabase getUserDatabase();
82
83
84     /**
85      * Return the set of {@link User}s that are members of this group.
86      */

87     public Iterator JavaDoc getUsers();
88
89
90     // --------------------------------------------------------- Public Methods
91

92
93     /**
94      * Add a new {@link Role} to those assigned specifically to this group.
95      *
96      * @param role The new role
97      */

98     public void addRole(Role role);
99
100
101     /**
102      * Is this group specifically assigned the specified {@link Role}?
103      *
104      * @param role The role to check
105      */

106     public boolean isInRole(Role role);
107
108
109     /**
110      * Remove a {@link Role} from those assigned to this group.
111      *
112      * @param role The old role
113      */

114     public void removeRole(Role role);
115
116
117     /**
118      * Remove all {@link Role}s from those assigned to this group.
119      */

120     public void removeRoles();
121
122
123 }
124
Popular Tags