Package edu.internet2.middleware.grouper
Class StemCopy
java.lang.Object
edu.internet2.middleware.grouper.StemCopy
Use this class to copy a stem to another stem.
Sample call to copy everything from source to target
StemCopy stemCopy = new StemCopy(stem_copy_source, stem_copy_target); Stem newStem = stemCopy.copyPrivilegesOfStem(true).copyPrivilegesOfGroup(true) .copyGroupAsPrivilege(true).copyListMembersOfGroup(true) .copyListGroupAsMember(true).copyAttributes(true).save();
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionassignStemDisplayExtension
(String stemDisplayExtension) New stem display extension.assignStemExtension
(String stemExtension) New stem extension.copyAttributes
(boolean value) Whether to copy attributes.copyGroupAsPrivilege
(boolean value) Whether to copy privileges where groups are a member.copyListGroupAsMember
(boolean value) Whether to copy list memberships where groups are a member.copyListMembersOfGroup
(boolean value) Whether to copy the list memberships of groups.copyPrivilegesOfGroup
(boolean value) Whether to copy privileges of groups.copyPrivilegesOfStem
(boolean value) Whether to copy privileges of stems.save()
Copy the stem using the options set in this class.
-
Constructor Details
-
StemCopy
Create a new instance of this class if you would like to specify specific options for a stem copy. After setting the options, call save().- Parameters:
stemToCopy
- the stem to copydestinationStem
- the destination stem for the copy
-
-
Method Details
-
copyPrivilegesOfStem
Whether to copy privileges of stems. Default is true.- Parameters:
value
-- Returns:
- StemCopy
-
copyPrivilegesOfGroup
Whether to copy privileges of groups. Default is true.- Parameters:
value
-- Returns:
- StemCopy
-
copyGroupAsPrivilege
Whether to copy privileges where groups are a member. Default is true.- Parameters:
value
-- Returns:
- StemCopy
-
copyListMembersOfGroup
Whether to copy the list memberships of groups. Default is true.- Parameters:
value
-- Returns:
- StemCopy
-
copyListGroupAsMember
Whether to copy list memberships where groups are a member. Default is true.- Parameters:
value
-- Returns:
- StemCopy
-
copyAttributes
Whether to copy attributes. Default is true.- Parameters:
value
-- Returns:
- StemCopy
-
assignStemExtension
New stem extension. Null defaults to the same extension.- Parameters:
stemExtension
-- Returns:
- StemCopy
-
assignStemDisplayExtension
New stem display extension. Null defaults to the same display extension.- Parameters:
stemExtension
-- Returns:
- StemCopy
-
save
Copy the stem using the options set in this class.- Returns:
- Stem the new stem
- Throws:
StemAddException
InsufficientPrivilegeException
-