© 2002 BEA Systems, Inc.


com.bea.p13n.usermgmt
Interface GroupManager


public interface GroupManager
extends javax.ejb.EJBObject

Remote interface for the GroupManager session bean. This class provides the core GroupManager functionality without doing any security checks. It is the responsibility of the GroupManager session bean(s) to do any security checks before calling the delegate. This class depends on the following environment variable in the calling GroupManager's environment context:

Any methods that create or remove groups, or modify group membership, delegate to the realm. If the underlying realm does not support these operations, a UserManagementException will be thrown.


Method Summary
 void addGroupToGroup(java.lang.String parentGroup, java.lang.String childGroup)
          Add a child group to a group
 void addUserToGroup(java.lang.String groupname, java.lang.String username)
          Add a user to a group.
 ProfileWrapper createGroup(java.lang.String name)
           
 java.util.List getAllGroupNames()
          Retrieve a list of all groups in the system.
 java.util.List getChildGroupNames(java.lang.String groupname)
          Retrieve a list of all children of a group.
 java.util.List getGroupNamesForUser(java.lang.String username)
          Retrieve a list of all groups that a user belongs to.
 ProfileWrapper getGroupProfile(java.lang.String name)
           
 ProfileManager getGroupProfileManager(java.lang.String name)
          Returns a profile manager that can be used to access a group's profile.
 java.lang.String getParentGroupName(java.lang.String groupname)
          Retrieve the parent of a group.
 java.util.List getTopLevelGroupNames()
          Retrieve a list of groups that do not have parent groups.
 java.util.List getUsernamesForGroup(java.lang.String groupname)
          Retrieve a list of all users in a group.
 java.util.List getUsernamesForGroup(java.lang.String groupname, java.lang.String searchExpression, int limit)
          Retrieve a list of users in a group, matching the provided wildcard expression
 boolean groupExists(java.lang.String name)
          Determines if a group exists in the realm.
 boolean isDeletableGroup(java.lang.String name)
          Determine if a group can be deleted.
 boolean isDescendent(java.lang.String ancestor, java.lang.String descendent)
          Determine if one group is a descendent of another.
 boolean isMember(java.lang.String groupname, java.lang.String username)
          Determine if a user is a member of a group.
 void removeGroup(java.lang.String name)
          Remove a group.
 void removeGroupFromGroup(java.lang.String parentGroup, java.lang.String childGroup)
          Remove a child group from a group
 void removeUserFromGroup(java.lang.String groupname, java.lang.String username)
          Remove a user from a group
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Method Detail

getGroupProfile

public ProfileWrapper getGroupProfile(java.lang.String name)
                               throws java.rmi.RemoteException

Parameters:
name - the name of the group to access
Returns:
the GroupProfileManager

getGroupProfileManager

public ProfileManager getGroupProfileManager(java.lang.String name)
                                      throws java.rmi.RemoteException
Returns a profile manager that can be used to access a group's profile. If the requested group exists in the realm but does not have a profile yet, a new profile will be created at this time. Right now all groups use the same profile manager, but this method is meant to leave the option for this to change in the future (similar to profile types for users).

Parameters:
name - the name of the group to access
Returns:
the GroupProfileManager

groupExists

public boolean groupExists(java.lang.String name)
                    throws java.rmi.RemoteException
Determines if a group exists in the realm.

Parameters:
name - the group name to check
Returns:
true if the group exists, false otherwise

createGroup

public ProfileWrapper createGroup(java.lang.String name)
                           throws java.rmi.RemoteException,
                                  GroupAlreadyExistsException,
                                  InvalidGroupnameException

Throws:
GroupAlreadyExistsException - if the group already exists
InvalidGroupnameException - if the group name is invalid

isDeletableGroup

public boolean isDeletableGroup(java.lang.String name)
                         throws java.rmi.RemoteException
Determine if a group can be deleted.

Returns:
false if the group name given is protected by the system in any way

removeGroup

public void removeGroup(java.lang.String name)
                 throws java.rmi.RemoteException,
                        InvalidGroupnameException
Remove a group. This will remove the group from both the realm and the profile tables.

Parameters:
the - name of the group to remove
Throws:
InvalidGroupnameException - if the group is protected and cannot be deleted

addUserToGroup

public void addUserToGroup(java.lang.String groupname,
                           java.lang.String username)
                    throws java.rmi.RemoteException
Add a user to a group.

Parameters:
groupname - the name of the group to modify
username - the name of the user to add

removeUserFromGroup

public void removeUserFromGroup(java.lang.String groupname,
                                java.lang.String username)
                         throws java.rmi.RemoteException
Remove a user from a group

Parameters:
groupname - the name of the group to modify
username - the name of the user to remove

addGroupToGroup

public void addGroupToGroup(java.lang.String parentGroup,
                            java.lang.String childGroup)
                     throws java.rmi.RemoteException
Add a child group to a group

Parameters:
parentGroup - the name of the group to modify
childGroup - the name of the group to add

removeGroupFromGroup

public void removeGroupFromGroup(java.lang.String parentGroup,
                                 java.lang.String childGroup)
                          throws java.rmi.RemoteException
Remove a child group from a group

Parameters:
parentGroup - the name of the group to modify
childGroup - the name of the group to remove

getTopLevelGroupNames

public java.util.List getTopLevelGroupNames()
                                     throws java.rmi.RemoteException
Retrieve a list of groups that do not have parent groups. This will not return the built-in WLS "everyone" group.


getAllGroupNames

public java.util.List getAllGroupNames()
                                throws java.rmi.RemoteException
Retrieve a list of all groups in the system.


getGroupNamesForUser

public java.util.List getGroupNamesForUser(java.lang.String username)
                                    throws java.rmi.RemoteException
Retrieve a list of all groups that a user belongs to.

Parameters:
username - the user to query

getUsernamesForGroup

public java.util.List getUsernamesForGroup(java.lang.String groupname)
                                    throws java.rmi.RemoteException
Retrieve a list of all users in a group.

Parameters:
groupname - the group to query

getUsernamesForGroup

public java.util.List getUsernamesForGroup(java.lang.String groupname,
                                           java.lang.String searchExpression,
                                           int limit)
                                    throws java.rmi.RemoteException
Retrieve a list of users in a group, matching the provided wildcard expression

Parameters:
groupname - the group to query
searchExpression - a wildcard expression to match
limit - the maximum number of results to return
Returns:
a List of usernames that are in this group

getChildGroupNames

public java.util.List getChildGroupNames(java.lang.String groupname)
                                  throws java.rmi.RemoteException
Retrieve a list of all children of a group.

Parameters:
groupname - the group to query

getParentGroupName

public java.lang.String getParentGroupName(java.lang.String groupname)
                                    throws java.rmi.RemoteException
Retrieve the parent of a group. Assumes that a group will only have one parent, as enforced by the GroupManager. If your realm has groups with more than one parent, the first one encountered will be returned.

Parameters:
groupname - the group to query

isDescendent

public boolean isDescendent(java.lang.String ancestor,
                            java.lang.String descendent)
                     throws java.rmi.RemoteException
Determine if one group is a descendent of another.

Parameters:
ancestor - see if the other group is a descendent of this group
descendent - see if this is a descendent of the other group

isMember

public boolean isMember(java.lang.String groupname,
                        java.lang.String username)
                 throws java.rmi.RemoteException
Determine if a user is a member of a group.

Parameters:
groupname - the group to query
username - the user to look for

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved