public interface GroupManager extends PrincipalTypeManager
Describes the service interface for managing groups.
Modifier and Type | Method and Description |
---|---|
Group |
addGroup(String groupName)
Add a new group.
|
Group |
addGroup(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,
String associationName)
Add a hierarchical association between two groups.
|
void |
addUserToGroup(String username,
String groupName)
Add a user to a group.
|
Group |
getGroup(String groupName)
Get a group
Group for a given group name. |
List<String> |
getGroupNames(String nameFilter)
Retrieves a detached and modifiable List of group names, finding groups matching the corresponding
group name filter.
|
List<Group> |
getGroups(String nameFilter)
Retrieves a detached and modifiable
Group list matching the corresponding
group name filter. |
List<Group> |
getGroupsAssociatedFrom(Group from,
String associationName)
Retrieve all the groups which are associated from the provided group.
|
List<Group> |
getGroupsAssociatedTo(Group to,
String associationName)
Retrieve all the groups which are associated to the provided group.
|
List<Group> |
getGroupsForUser(String username)
Retrieves a detached and modifiable
Group list of all the groups associated to a specific
user. |
List<Group> |
getGroupsInRole(String roleName)
Retrieves a detached and modifiable
Group list of all the groups in a specific role. |
boolean |
groupExists(String groupName)
Whether or not a group exists.
|
boolean |
isUserInGroup(String username,
String groupName)
Whether or not a user is in a group.
|
Group |
newGroup(String name,
boolean mapped) |
Group |
newTransientGroup(String name) |
void |
removeGroup(String groupName)
Remove a group.
|
void |
removeGroupFromGroup(Group from,
Group to,
String associationName)
Remove a hierarchical association between two groups.
|
void |
removeUserFromGroup(String username,
String groupName)
Remove a user from a group.
|
void |
updateGroup(Group group)
Updates a group and all its attributes
|
getPrincipalManager, getPrincipalType
Group addGroup(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.
groupName
- The group nameGroup
throws
- a security exception.SecurityException
Group addGroup(String groupName, boolean mapped) throws SecurityException
Add a new group and optionally map/replicate it to an external storage manager (if configured).
groupName
- The group namemapped
- if the new Group should be mapped/replicated to an external security storage manager (if used) or not.Group
throws
- a security exception.SecurityException
void removeGroup(String groupName) throws SecurityException
Remove a group.
groupName
- The group namethrows
- a security exception.SecurityException
boolean groupExists(String groupName)
Whether or not a group exists.
groupName
- The group nameGroup getGroup(String groupName) throws SecurityException
Get a group Group
for a given group name.
groupName
- Group
throws
- security exception if the group does not exist.SecurityException
List<Group> getGroupsForUser(String username) throws SecurityException
Retrieves a detached and modifiable Group
list of all the groups associated to a specific
user.
username
- The user name.Group
.throws
- security exception if the user does not exist.SecurityException
List<Group> getGroupsInRole(String roleName) throws SecurityException
Retrieves a detached and modifiable Group
list of all the groups in a specific role.
roleName
- The role nameGroup
.throws
- a security exception if the role does not exist.SecurityException
void addUserToGroup(String username, String groupName) throws SecurityException
Add a user to a group.
username
- The user name.groupName
- The group namethrows
- a security exception.SecurityException
void removeUserFromGroup(String username, String groupName) throws SecurityException
Remove a user from a group.
username
- The user name.groupName
- The group namethrows
- a security exception.SecurityException
boolean isUserInGroup(String username, String groupName) throws SecurityException
Whether or not a user is in a group.
username
- The user name.groupName
- The group namethrows
- security exception if the user or group does not exist.SecurityException
List<Group> getGroups(String nameFilter) throws SecurityException
Group
list matching the corresponding
group name filter.
nameFilter
- The filter used to retrieve matching groups.Group
SecurityException
List<String> getGroupNames(String nameFilter) throws SecurityException
Retrieves a detached and modifiable List of group names, finding groups matching the corresponding group name filter.
nameFilter
- The filter used to retrieve matching groups.SecurityException
void updateGroup(Group group) throws SecurityException
group
- SecurityException
void addGroupToGroup(Group from, Group to, String associationName) throws SecurityException
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.
from
- The group for the from side of the associationto
- The group for the to side of the associationassociationName
- The name of the JetspeedPrincipalAssociationType
to createSecurityException
void removeGroupFromGroup(Group from, Group to, String associationName) throws SecurityException
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.
from
- The group for the from side of the associationto
- The group for the to side of the associationassociationName
- The name of the JetspeedPrincipalAssociationType
to createSecurityException
List<Group> getGroupsAssociatedTo(Group to, String associationName)
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.
to
- The group for the to side of the associationassociationName
- The name of the JetspeedPrincipalAssociationType
to createList<Group> getGroupsAssociatedFrom(Group from, String associationName)
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.
from
- The group for the from side of the associationassociationName
- The name of the JetspeedPrincipalAssociationType
to createCopyright © 1999–2016 The Apache Software Foundation. All rights reserved.