Class GroupCopy

java.lang.Object
edu.internet2.middleware.grouper.GroupCopy

public class GroupCopy extends Object

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 Details

    • GroupCopy

      public GroupCopy(Group group, Stem stem)
      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 copy
      stem - Stem where group should be copied
  • Method Details

    • copyPrivilegesOfGroup

      public GroupCopy copyPrivilegesOfGroup(boolean value)
      Whether to copy privileges of the group. Default is true.
      Parameters:
      value -
      Returns:
      GroupCopy
    • copyGroupAsPrivilege

      public GroupCopy copyGroupAsPrivilege(boolean value)
      Whether to copy privileges where this group is a member. Default is true.
      Parameters:
      value -
      Returns:
      GroupCopy
    • copyListMembersOfGroup

      public GroupCopy copyListMembersOfGroup(boolean value)
      Whether to copy the list memberships of the group. Default is true.
      Parameters:
      value -
      Returns:
      GroupCopy
    • copyListGroupAsMember

      public GroupCopy copyListGroupAsMember(boolean value)
      Whether to copy list memberships where this group is a member. Default is true.
      Parameters:
      value -
      Returns:
      GroupCopy
    • copyAttributes

      public GroupCopy copyAttributes(boolean value)
      Whether to copy attributes. Default is true.
      Parameters:
      value -
      Returns:
      GroupCopy
    • setExtension

      public GroupCopy setExtension(String value)
      Optionally set a new extension for the group.
      Parameters:
      value -
      Returns:
      GroupCopy
    • setDisplayExtension

      public GroupCopy setDisplayExtension(String value)
      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