org.apache.jetspeed.security
Interface GroupManager


public interface GroupManager

Describes the service interface for managing groups.

Group hierarchy elements are being returned as a Groupcollection. The backing implementation must appropriately map the group hierarchy to a preferences sub-tree.

The convention {principal}.{subprincipal} has been chosen to name groups hierachies. Implementation follow the conventions enforced by the Preferences API.

Author:
David Le Strat

Method Summary
 void addGroup(String groupFullPathName)
           Add a new group.
 void addUserToGroup(String username, String groupFullPathName)
           Add a user to a group.
 Group getGroup(String groupFullPathName)
           Get a group Groupfor a given group full path name.
 Iterator getGroups(String filter)
          Get all groups available from all group handlers
 Collection getGroupsForUser(String username)
           A collection of Groupfor all the groups associated to a specific user.
 Collection getGroupsInRole(String roleFullPathName)
           A collection of Groupfor all the groups in a specific role.
 boolean groupExists(String groupFullPathName)
           Whether or not a group exists.
 boolean isUserInGroup(String username, String groupFullPathName)
           Whether or not a user is in a group.
 void removeGroup(String groupFullPathName)
           Remove a group.
 void removeUserFromGroup(String username, String groupFullPathName)
           Remove a user from a group.
 void setGroupEnabled(String groupFullPathName, boolean enabled)
          Enable or disable a group.
 

Method Detail

addGroup

void addGroup(String groupFullPathName)
              throws SecurityException

Add a new group.

Group principal names are expressed as {principal}.{subprincipal} where "." is the separator expressing the hierarchical nature of a group.

Group principal path names are stored leveraging the Preferences api. Groups will be stored under /group/theGroupName/theGroupNameChild when given the full path name theGroupName.theGroupNameChild.

Parameters:
groupFullPathName - The group name full path (e.g. theGroupName.theGroupNameChild).
Throws:
Throws - a security exception.
SecurityException

removeGroup

void removeGroup(String groupFullPathName)
                 throws SecurityException

Remove a group.

Group principal names are expressed as {principal}.{subprincipal} where "." is the separator expressing the hierarchical nature of a group.

Group principal path names are stored leveraging the Preferences api. Groups will be stored under /group/theGroupName/theGroupNameChild when given the full path name theGroupName.theGroupNameChild.

Parameters:
groupFullPathName - The group name full path (e.g. theGroupName.theGroupNameChild)
Throws:
Throws - a security exception.
SecurityException

groupExists

boolean groupExists(String groupFullPathName)

Whether or not a group exists.

Parameters:
groupFullPathName - The group name full path (e.g. theGroupName.theGroupNameChild)
Returns:
Whether or not a group exists.

getGroup

Group getGroup(String groupFullPathName)
               throws SecurityException

Get a group Groupfor a given group full path name.

Parameters:
groupFullPathName - The group name full path (e.g. theGroupName.theGroupChildName).
Returns:
The Preferencesnode.
Throws:
Throws - security exception if the group does not exist.
SecurityException

getGroupsForUser

Collection getGroupsForUser(String username)
                            throws SecurityException

A collection of Groupfor all the groups associated to a specific user.

Parameters:
username - The user name.
Returns:
A collection of Group.
Throws:
Throws - security exception if the user does not exist.
SecurityException

getGroupsInRole

Collection getGroupsInRole(String roleFullPathName)
                           throws SecurityException

A collection of Groupfor all the groups in a specific role.

Parameters:
roleFullPathName - The role full path (e.g. theRoleName.theRoleChildName)..
Returns:
A Collection of Group.
Throws:
Throws - a security exception if the role does not exist.
SecurityException

addUserToGroup

void addUserToGroup(String username,
                    String groupFullPathName)
                    throws SecurityException

Add a user to a group.

Parameters:
username - The user name.
groupFullPathName - The group name full path (e.g. theGroupName.theGroupChildName).
Throws:
Throws - a security exception.
SecurityException

removeUserFromGroup

void removeUserFromGroup(String username,
                         String groupFullPathName)
                         throws SecurityException

Remove a user from a group.

Parameters:
username - The user name.
groupFullPathName - The group name full path (e.g. theGroupName.theGroupChildName).
Throws:
Throws - a security exception.
SecurityException

isUserInGroup

boolean isUserInGroup(String username,
                      String groupFullPathName)
                      throws SecurityException

Whether or not a user is in a group.

Parameters:
username - The user name.
groupFullPathName - The group name full path (e.g. theGroupName.theGroupChildName).
Returns:
Whether or not a user is in a group.
Throws:
Throws - security exception if the user or group does not exist.
SecurityException

getGroups

Iterator getGroups(String filter)
                   throws SecurityException
Get all groups available from all group handlers

Parameters:
filter - The filter used to retrieve matching groups.
Returns:
all groups available as Principal
Throws:
SecurityException

setGroupEnabled

void setGroupEnabled(String groupFullPathName,
                     boolean enabled)
                     throws SecurityException
Enable or disable a group.

Parameters:
groupFullPathName - The group name full path theGroupName.theGroupChildName).
enabled - enabled flag for the group
Throws:
SecurityException


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.