BEA Systems, Inc.

WebLogic Server 6.1 API Reference

weblogic.security.acl
Class GroupImpl

java.lang.Object
  |
  +--java.security.Identity
        |
        +--weblogic.security.acl.User
              |
              +--weblogic.security.acl.GroupImpl

public class GroupImpl
extends User
implements java.security.acl.Group

GroupImpl implements Group, which is used to represent a group of principals. (A principal represents an entity such as an individual user or a company).

Note that Group extends Principal. Thus, either a Principal or a Group can be passed as an argument to methods containing a Principal parameter. For example, you can add either a Principal or a Group to a Group object by calling the object's addMember method, passing it the Principal or Group.

Author:
Copyright (c) 1997-1998 by WebLogic, Inc. All Rights Reserved., Copyright (c) 1999 by BEA WebXpress. All Rights Reserved.
Copyright © 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
Serialized Form

Constructor Summary
GroupImpl(java.lang.String name)
          Constructs a group with the specified name.
 
Method Summary
 boolean addMember(java.security.Principal principal)
          Adds the specified member to the group.
 boolean isMember(java.security.Principal principal)
          Returns true if the specified Principal is a member of the group.
 java.util.Enumeration members()
          Returns an Enumeration of the members in the group.
 boolean removeMember(java.security.Principal principal)
          Removes the specified member from the group.
 
Methods inherited from class weblogic.security.acl.User
getCredential, getRealm, identityEquals, toString
 
Methods inherited from class java.security.Identity
addCertificate, certificates, equals, getInfo, getName, getPublicKey, getScope, hashCode, removeCertificate, setInfo, setPublicKey, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GroupImpl

public GroupImpl(java.lang.String name)
Constructs a group with the specified name.
Method Detail

addMember

public boolean addMember(java.security.Principal principal)
Adds the specified member to the group. If the Principal is already a member, the method returns false.
Specified by:
addMember in interface java.security.acl.Group

Parameters:
principal - Principal to add to this group
Returns:
true if the member was successfully added, false if the principal is already a member of this group
Throws:
Throws - IllegalArgumentException if the principal is this group since a group can't contain itself.

removeMember

public boolean removeMember(java.security.Principal principal)
Removes the specified member from the group. If the Principal was not a member of the group, the method returns false.
Specified by:
removeMember in interface java.security.acl.Group

Parameters:
principal - Principal to remove from this group
Returns:
true if the principal was removed, false if the principal is not a member of this group.

members

public java.util.Enumeration members()
Returns an Enumeration of the members in the group. The returned objects can be instances of either Principal or Group (a subclass of Principal).
Specified by:
members in interface java.security.acl.Group

Returns:
Enumeration of the group members

isMember

public boolean isMember(java.security.Principal principal)
Returns true if the specified Principal is a member of the group. This method does a recursive search; if a Principal belongs to a Group that is a member of this Group, the method returns true.
Specified by:
isMember in interface java.security.acl.Group

Parameters:
member - Principal whose membership is to be checked
Returns:
true if the Principal is a member of this group

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs61

WebLogic classes and methods that do not appear in this reference are not public and are not supported.