Class GroupMgrImpl
- java.lang.Object
-
- org.apache.directory.fortress.core.impl.Manageable
-
- org.apache.directory.fortress.core.impl.GroupMgrImpl
-
- All Implemented Interfaces:
Serializable
,GroupMgr
,Manageable
public class GroupMgrImpl extends Manageable implements GroupMgr, Serializable
This Manager impl supplies CRUD methods used to manage groups stored within the ldap directory. LDAP group nodes are used for utility and security functions within various systems and apps.This class is thread safe.
- Author:
- Apache Directory Project
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.directory.fortress.core.impl.Manageable
adminSess, contextId
-
-
Constructor Summary
Constructors Constructor Description GroupMgrImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Group
add(Group group)
Create a new group node.,Group
add(Group group, String key, String value)
Add a property to an existing group node.Group
assign(Group group, String member)
Assign a user to an existing group node.Group
deassign(Group group, String member)
Deassign a member from an existing group node.Group
delete(Group group)
Delete existing group node.Group
delete(Group group, String key, String value)
Delete existing group node.List<Group>
find(Group group)
Search using a full or partial group node.List<Group>
find(User user)
Search for groups by userId.List<UserRole>
groupRoles(Group group)
Read an existing group node's roles.Group
read(Group group)
Read an existing group node.List<Group>
roleGroups(Role role)
Search for groups by role name.Group
update(Group group)
Modify existing group node.-
Methods inherited from class org.apache.directory.fortress.core.impl.Manageable
assertContext, assertContext, checkAccess, getFullMethodName, setAdmin, setAdminData, setContextId, setEntitySession
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.directory.fortress.core.Manageable
setAdmin, setContextId
-
-
-
-
Method Detail
-
add
public Group add(Group group) throws SecurityException
Create a new group node.,- Specified by:
add
in interfaceGroupMgr
- Parameters:
group
- containsGroup
.- Returns:
Group
containing entity just added.- Throws:
SecurityException
- in the event system error.
-
update
public Group update(Group group) throws SecurityException
Modify existing group node. The name is required. Does not update members or properties. UseGroupMgr.add( Group group, String key, String value )
,GroupMgr.delete( Group group, String key, String value )
,GroupMgr.assign( Group group, String member)
, orGroupMgr.deassign( Group group, String member)
for multivalued attributes.- Specified by:
update
in interfaceGroupMgr
- Parameters:
group
- containsGroup
.- Returns:
Group
containing entity just modified.- Throws:
SecurityException
- in the event system error.
-
delete
public Group delete(Group group) throws SecurityException
Delete existing group node. The name is required.- Specified by:
delete
in interfaceGroupMgr
- Parameters:
group
- containsGroup
.- Returns:
Group
containing entity just removed.- Throws:
SecurityException
- in the event system error.
-
add
public Group add(Group group, String key, String value) throws SecurityException
Add a property to an existing group node. Must have a name and at least one member.- Specified by:
add
in interfaceGroupMgr
- Parameters:
group
- containsGroup
.key
- contains the property key.value
- contains contains the property value.- Returns:
Group
containing entity just modified.- Throws:
SecurityException
- in the event system error.
-
delete
public Group delete(Group group, String key, String value) throws SecurityException
Delete existing group node. The name is required.- Specified by:
delete
in interfaceGroupMgr
- Parameters:
group
- containsGroup
.key
- contains the property key.value
- contains contains the property value.- Returns:
Group
containing entity just modified.- Throws:
SecurityException
- in the event system error.
-
read
public Group read(Group group) throws SecurityException
Read an existing group node. The name is required.- Specified by:
read
in interfaceGroupMgr
- Parameters:
group
- containsGroup
with name field set with an existing group name.- Returns:
Group
containing entity found.- Throws:
SecurityException
- in the event system error.
-
find
public List<Group> find(Group group) throws SecurityException
Search using a full or partial group node. The name is required.- Specified by:
find
in interfaceGroupMgr
- Parameters:
group
- containsGroup
.- Returns:
- List of type
Group
containing entities found. - Throws:
SecurityException
- in the event system error.
-
find
public List<Group> find(User user) throws SecurityException
Search for groups by userId. Member (maps to userId) and is required.- Specified by:
find
in interfaceGroupMgr
- Parameters:
user
- contains userId that maps to Group member attribute.- Returns:
Group
containing entity just added.- Throws:
SecurityException
- in the event system error.
-
roleGroups
public List<Group> roleGroups(Role role) throws SecurityException
Search for groups by role name. Member (maps to role name) is required.- Specified by:
roleGroups
in interfaceGroupMgr
- Parameters:
role
- contains userId that maps to Group member attribute.- Returns:
Group
containing entity just added.- Throws:
SecurityException
- in the event system error.
-
groupRoles
public List<UserRole> groupRoles(Group group) throws SecurityException
Read an existing group node's roles. The name is required.- Specified by:
groupRoles
in interfaceGroupMgr
- Parameters:
group
- containsGroup
with name field set with an existing group name.- Returns:
- list of
UserRole
for given group. Will return empty list if Group has no roles assigned. - Throws:
SecurityException
- in the event system error.
-
assign
public Group assign(Group group, String member) throws SecurityException
Assign a user to an existing group node. The group name and member are required.- Specified by:
assign
in interfaceGroupMgr
- Parameters:
group
- containsGroup
.member
- is the relative distinguished name (rdn) of an existing user in ldap.- Returns:
Group
containing entity to assign.- Throws:
SecurityException
- in the event entry already present or other system error.
-
deassign
public Group deassign(Group group, String member) throws SecurityException
Deassign a member from an existing group node. The group name and member are required.- Specified by:
deassign
in interfaceGroupMgr
- Parameters:
group
- containsGroup
.member
- is the relative distinguished name (rdn) of an existing user in ldap.- Returns:
Group
containing entity to deassign- Throws:
SecurityException
- in the event entry already present or other system error.
-
-