Class StemCopy

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

public class StemCopy extends Object

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 Details

    • StemCopy

      public StemCopy(Stem stemToCopy, Stem destinationStem)
      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 copy
      destinationStem - the destination stem for the copy
  • Method Details

    • copyPrivilegesOfStem

      public StemCopy copyPrivilegesOfStem(boolean value)
      Whether to copy privileges of stems. Default is true.
      Parameters:
      value -
      Returns:
      StemCopy
    • copyPrivilegesOfGroup

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

      public StemCopy copyGroupAsPrivilege(boolean value)
      Whether to copy privileges where groups are a member. Default is true.
      Parameters:
      value -
      Returns:
      StemCopy
    • copyListMembersOfGroup

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

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

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

      public StemCopy assignStemExtension(String stemExtension)
      New stem extension. Null defaults to the same extension.
      Parameters:
      stemExtension -
      Returns:
      StemCopy
    • assignStemDisplayExtension

      public StemCopy assignStemDisplayExtension(String stemDisplayExtension)
      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