Package edu.internet2.middleware.grouper
Class GroupCopy
java.lang.Object
edu.internet2.middleware.grouper.GroupCopy
Use this class to copy a group to another stem.
Sample call to copy everything
GroupCopy groupCopy = new GroupCopy(child_group, stem); Group newGroup = groupCopy.copyPrivilegesOfGroup(true).copyGroupAsPrivilege(true) .copyListMembersOfGroup(true).copyListGroupAsMember(true).copyAttributes(true) .save();
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopyAttributes
(boolean value) Whether to copy attributes.copyGroupAsPrivilege
(boolean value) Whether to copy privileges where this group is a member.copyListGroupAsMember
(boolean value) Whether to copy list memberships where this group is a member.copyListMembersOfGroup
(boolean value) Whether to copy the list memberships of the group.copyPrivilegesOfGroup
(boolean value) Whether to copy privileges of the group.save()
Copy the group using the options set in this class.setDisplayExtension
(String value) Optionally set a new display extension for the group.setExtension
(String value) Optionally set a new extension for the group.
-
Constructor Details
-
GroupCopy
Create a new instance of this class if you would like to specify specific options for a group copy. After setting the options, call save().- Parameters:
group
- Group to copystem
- Stem where group should be copied
-
-
Method Details
-
copyPrivilegesOfGroup
Whether to copy privileges of the group. Default is true.- Parameters:
value
-- Returns:
- GroupCopy
-
copyGroupAsPrivilege
Whether to copy privileges where this group is a member. Default is true.- Parameters:
value
-- Returns:
- GroupCopy
-
copyListMembersOfGroup
Whether to copy the list memberships of the group. Default is true.- Parameters:
value
-- Returns:
- GroupCopy
-
copyListGroupAsMember
Whether to copy list memberships where this group is a member. Default is true.- Parameters:
value
-- Returns:
- GroupCopy
-
copyAttributes
Whether to copy attributes. Default is true.- Parameters:
value
-- Returns:
- GroupCopy
-
setExtension
Optionally set a new extension for the group.- Parameters:
value
-- Returns:
- GroupCopy
-
setDisplayExtension
Optionally set a new display extension for the group.- Parameters:
value
-- Returns:
- GroupCopy
-
save
Copy the group using the options set in this class.- Returns:
- Group the new group
- Throws:
GroupAddException
InsufficientPrivilegeException
-