public interface Group
implements Principal
java.security.acl.Group |
该接口用于表示一组校长。 (委托人代表个人用户或公司等实体)。
请注意,该组扩展了Principal。 因此,可以将Principal或Group作为参数传递给包含Principal参数的方法。 例如,您可以通过调用对象的addMember
方法,并将其传递给Principal或Group,将Principal或Group添加到Group对象。
Public methods |
|
---|---|
abstract boolean |
addMember(Principal user) 将指定的成员添加到组中。 |
abstract boolean |
isMember(Principal member) 如果传递的委托人是组的成员,则返回true。 |
abstract Enumeration<? extends Principal> |
members() 返回组中成员的枚举。 |
abstract boolean |
removeMember(Principal user) 从组中删除指定的成员。 |
Inherited methods |
|
---|---|
From interface java.security.Principal
|
boolean addMember (Principal user)
将指定的成员添加到组中。
Parameters | |
---|---|
user |
Principal : the principal to add to this group. |
Returns | |
---|---|
boolean |
true if the member was successfully added, false if the principal was already a member. |
boolean isMember (Principal member)
如果传递的委托人是组的成员,则返回true。 此方法执行递归搜索,因此,如果主体属于属于该组成员的组,则返回true。
Parameters | |
---|---|
member |
Principal : the principal whose membership is to be checked. |
Returns | |
---|---|
boolean |
true if the principal is a member of this group, false otherwise. |
Enumeration<? extends Principal> members ()
返回组中成员的枚举。 返回的对象可以是Principal或Group(它是Principal的子类)的实例。
Returns | |
---|---|
Enumeration<? extends Principal> |
an enumeration of the group members. |
boolean removeMember (Principal user)
从组中删除指定的成员。
Parameters | |
---|---|
user |
Principal : the principal to remove from this group. |
Returns | |
---|---|
boolean |
true if the principal was removed, or false if the principal was not a member. |