org.apache.jetspeed.security
Interface GroupManager

All Superinterfaces:
PrincipalTypeManager, java.io.Serializable

public interface GroupManager
extends PrincipalTypeManager

Describes the service interface for managing groups.

Version:
$Id: GroupManager.java 702099 2008-10-06 11:13:38Z ate $

Method Summary
 Group addGroup(java.lang.String groupName)
           Add a new group.
 Group addGroup(java.lang.String groupName, boolean mapped)
           Add a new group and optionally map/replicate it to an external storage manager (if configured).
 void addGroupToGroup(Group from, Group to, java.lang.String associationName)
          Add a hierarchical association between two groups.
 void addUserToGroup(java.lang.String username, java.lang.String groupName)
           Add a user to a group.
 Group getGroup(java.lang.String groupName)
           Get a group Groupfor a given group name.
 java.util.List<java.lang.String> getGroupNames(java.lang.String nameFilter)
           Retrieves a detached and modifiable List of group names, finding groups matching the corresponding group name filter.
 java.util.List<Group> getGroups(java.lang.String nameFilter)
          Retrieves a detached and modifiable Group list matching the corresponding group name filter.
 java.util.List<Group> getGroupsAssociatedFrom(Group from, java.lang.String associationName)
          Retrieve all the groups which are associated from the provided group.
 java.util.List<Group> getGroupsAssociatedTo(Group to, java.lang.String associationName)
          Retrieve all the groups which are associated to the provided group.
 java.util.List<Group> getGroupsForUser(java.lang.String username)
           Retrieves a detached and modifiable Group list of all the groups associated to a specific user.
 java.util.List<Group> getGroupsInRole(java.lang.String roleName)
           Retrieves a detached and modifiable Group list of all the groups in a specific role.
 boolean groupExists(java.lang.String groupName)
           Whether or not a group exists.
 boolean isUserInGroup(java.lang.String username, java.lang.String groupName)
           Whether or not a user is in a group.
 Group newGroup(java.lang.String name, boolean mapped)
           
 Group newTransientGroup(java.lang.String name)
           
 void removeGroup(java.lang.String groupName)
           Remove a group.
 void removeGroupFromGroup(Group from, Group to, java.lang.String associationName)
          Remove a hierarchical association between two groups.
 void removeUserFromGroup(java.lang.String username, java.lang.String groupName)
           Remove a user from a group.
 void updateGroup(Group group)
          Updates a group and all its attributes
 
Methods inherited from interface org.apache.jetspeed.security.PrincipalTypeManager
getPrincipalManager, getPrincipalType
 

Method Detail

newGroup

Group newGroup(java.lang.String name,
               boolean mapped)

newTransientGroup

Group newTransientGroup(java.lang.String name)

addGroup

Group addGroup(java.lang.String groupName)
               throws SecurityException

Add a new group.

If an external security storage manager is used, the group will be mapped/replicated to it as well.

Parameters:
groupName - The group name
Returns:
the new Group
Throws:
Throws - a security exception.
SecurityException

addGroup

Group addGroup(java.lang.String groupName,
               boolean mapped)
               throws SecurityException

Add a new group and optionally map/replicate it to an external storage manager (if configured).

Parameters:
groupName - The group name
mapped - if the new Group should be mapped/replicated to an external security storage manager (if used) or not.
Returns:
the new Group
Throws:
Throws - a security exception.
SecurityException

removeGroup

void removeGroup(java.lang.String groupName)
                 throws SecurityException

Remove a group.

Parameters:
groupName - The group name
Throws:
Throws - a security exception.
SecurityException

groupExists

boolean groupExists(java.lang.String groupName)

Whether or not a group exists.

Parameters:
groupName - The group name
Returns:
Whether or not a group exists.

getGroup

Group getGroup(java.lang.String groupName)
               throws SecurityException

Get a group Groupfor a given group name.

Parameters:
groupName -
Returns:
The Group
Throws:
Throws - security exception if the group does not exist.
SecurityException

getGroupsForUser

java.util.List<Group> getGroupsForUser(java.lang.String username)
                                       throws SecurityException

Retrieves a detached and modifiable Group list of all the groups associated to a specific user.

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

getGroupsInRole

java.util.List<Group> getGroupsInRole(java.lang.String roleName)
                                      throws SecurityException

Retrieves a detached and modifiable Group list of all the groups in a specific role.

Parameters:
roleName - The role name
Returns:
A list of Group.
Throws:
Throws - a security exception if the role does not exist.
SecurityException

addUserToGroup

void addUserToGroup(java.lang.String username,
                    java.lang.String groupName)
                    throws SecurityException

Add a user to a group.

Parameters:
username - The user name.
groupName - The group name
Throws:
Throws - a security exception.
SecurityException

removeUserFromGroup

void removeUserFromGroup(java.lang.String username,
                         java.lang.String groupName)
                         throws SecurityException

Remove a user from a group.

Parameters:
username - The user name.
groupName - The group name
Throws:
Throws - a security exception.
SecurityException

isUserInGroup

boolean isUserInGroup(java.lang.String username,
                      java.lang.String groupName)
                      throws SecurityException

Whether or not a user is in a group.

Parameters:
username - The user name.
groupName - The group name
Returns:
Whether or not a user is in a group.
Throws:
Throws - security exception if the user or group does not exist.
SecurityException

getGroups

java.util.List<Group> getGroups(java.lang.String nameFilter)
                                throws SecurityException
Retrieves a detached and modifiable Group list matching the corresponding group name filter.

Parameters:
nameFilter - The filter used to retrieve matching groups.
Returns:
a list of Group
Throws:
SecurityException

getGroupNames

java.util.List<java.lang.String> getGroupNames(java.lang.String nameFilter)
                                               throws SecurityException

Retrieves a detached and modifiable List of group names, finding groups matching the corresponding group name filter.

Parameters:
nameFilter - The filter used to retrieve matching groups.
Returns:
A list of group names
Throws:
SecurityException

updateGroup

void updateGroup(Group group)
                 throws SecurityException
Updates a group and all its attributes

Parameters:
group -
Throws:
SecurityException

addGroupToGroup

void addGroupToGroup(Group from,
                     Group to,
                     java.lang.String associationName)
                     throws SecurityException
Add a hierarchical association between two groups.

Default supported hierarchical associations are JetspeedPrincipalAssociationType.IS_A and JetspeedPrincipalAssociationType.IS_PART_OF, but it will depend on the actual runtime configuration if the required JetspeedPrincipalAssociationType is available.

Parameters:
from - The group for the from side of the association
to - The group for the to side of the association
associationName - The name of the JetspeedAssociationType to create
Throws:
SecurityException

removeGroupFromGroup

void removeGroupFromGroup(Group from,
                          Group to,
                          java.lang.String associationName)
                          throws SecurityException
Remove a hierarchical association between two groups.

Default supported hierarchical associations are JetspeedPrincipalAssociationType.IS_A and JetspeedPrincipalAssociationType.IS_PART_OF, but it will depend on the actual runtime configuration if the required JetspeedPrincipalAssociationType is available.

Parameters:
from - The group for the from side of the association
to - The group for the to side of the association
associationName - The name of the JetspeedAssociationType to create
Throws:
SecurityException

getGroupsAssociatedTo

java.util.List<Group> getGroupsAssociatedTo(Group to,
                                            java.lang.String associationName)
Retrieve all the groups which are associated to the provided group.

Default supported hierarchical associations are JetspeedPrincipalAssociationType.IS_A and JetspeedPrincipalAssociationType.IS_PART_OF, but it will depend on the actual runtime configuration if the required JetspeedPrincipalAssociationType is available.

If the corresponding JetspeedPrincipalAssociationType is not available, this method will simply return a empty list.

For a JetspeedPrincipalAssociationType.IS_PART_OF association, this will return all the nested groups which together represent the provided group.

For a JetspeedPrincipalAssociationType.IS_A association, this will return all the groups which extend the provided group.

Note: this method will only return the directly associated groups, not further derived associations.

Parameters:
to - The group for the to side of the association
associationName - The name of the JetspeedAssociationType to create

getGroupsAssociatedFrom

java.util.List<Group> getGroupsAssociatedFrom(Group from,
                                              java.lang.String associationName)
Retrieve all the groups which are associated from the provided group.

Default supported hierarchical associations are JetspeedPrincipalAssociationType.IS_A and JetspeedPrincipalAssociationType.IS_PART_OF, but it will depend on the actual runtime configuration if the required JetspeedPrincipalAssociationType is available.

If the corresponding JetspeedPrincipalAssociationType is not available, this method will simply return a empty list.

For a JetspeedPrincipalAssociationType.IS_PART_OF association, this will return (at most) the single group where the provided group is part of.

For a JetspeedPrincipalAssociationType.IS_A association, this will return all the groups which the provided group extends.

Note: this method will only return the directly associated group(s), not further derived associations.

Parameters:
from - The group for the from side of the association
associationName - The name of the JetspeedAssociationType to create


Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.