author | chegar |
Sun, 17 Aug 2014 15:54:13 +0100 | |
changeset 25859 | 3317bb8137f4 |
parent 18579 | jdk/src/share/classes/java/security/acl/Group.java@b678846778ad |
permissions | -rw-r--r-- |
2 | 1 |
/* |
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
2 |
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package java.security.acl; |
|
27 |
||
28 |
import java.util.Enumeration; |
|
29 |
import java.security.Principal; |
|
30 |
||
31 |
/** |
|
32 |
* This interface is used to represent a group of principals. (A principal |
|
33 |
* represents an entity such as an individual user or a company). <p> |
|
34 |
* |
|
35 |
* Note that Group extends Principal. Thus, either a Principal or a Group can |
|
36 |
* be passed as an argument to methods containing a Principal parameter. For |
|
37 |
* example, you can add either a Principal or a Group to a Group object by |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
5506
diff
changeset
|
38 |
* calling the object's {@code addMember} method, passing it the |
2 | 39 |
* Principal or Group. |
40 |
* |
|
41 |
* @author Satish Dharmaraj |
|
42 |
*/ |
|
43 |
public interface Group extends Principal { |
|
44 |
||
45 |
/** |
|
46 |
* Adds the specified member to the group. |
|
47 |
* |
|
48 |
* @param user the principal to add to this group. |
|
49 |
* |
|
50 |
* @return true if the member was successfully added, |
|
51 |
* false if the principal was already a member. |
|
52 |
*/ |
|
53 |
public boolean addMember(Principal user); |
|
54 |
||
55 |
/** |
|
56 |
* Removes the specified member from the group. |
|
57 |
* |
|
58 |
* @param user the principal to remove from this group. |
|
59 |
* |
|
60 |
* @return true if the principal was removed, or |
|
61 |
* false if the principal was not a member. |
|
62 |
*/ |
|
63 |
public boolean removeMember(Principal user); |
|
64 |
||
65 |
/** |
|
66 |
* Returns true if the passed principal is a member of the group. |
|
67 |
* This method does a recursive search, so if a principal belongs to a |
|
68 |
* group which is a member of this group, true is returned. |
|
69 |
* |
|
70 |
* @param member the principal whose membership is to be checked. |
|
71 |
* |
|
72 |
* @return true if the principal is a member of this group, |
|
73 |
* false otherwise. |
|
74 |
*/ |
|
75 |
public boolean isMember(Principal member); |
|
76 |
||
77 |
||
78 |
/** |
|
79 |
* Returns an enumeration of the members in the group. |
|
80 |
* The returned objects can be instances of either Principal |
|
81 |
* or Group (which is a subclass of Principal). |
|
82 |
* |
|
83 |
* @return an enumeration of the group members. |
|
84 |
*/ |
|
85 |
public Enumeration<? extends Principal> members(); |
|
86 |
||
87 |
} |