Class MembershipSave

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

public class MembershipSave extends Object

Use this class to insert or update or delete a membership

Sample call

 MembershipSave membershipSave = new MembershipSave().assignGroup(group1).assignSubject(subject);
 membershipSave.save();
 

Sample call to delete a membership

 MembershipSave membershipSave = new MembershipSave().assignGroup(group1).assignSubject(subject).assignSaveMode(SaveMode.DELETE);
 membershipSave.save();
 

Sample call to add a membership using group name and subject identifier and sourceId.  Note, use double quotes to be java compliant

 new MembershipSave().assignGroupName('a:b:c').assignSubjectIdentifier('jsmith').assignSubjectSourceId('myUsers').save();
 

  • Constructor Details

    • MembershipSave

      public MembershipSave()
      create a new membership save
      Parameters:
      theGrouperSession -
  • Method Details

    • assignGroupId

      public MembershipSave assignGroupId(String theGroupId)
      group id to add to, mutually exclusive with group name
      Parameters:
      theGroupId -
      Returns:
      this for chaining
    • assignGroup

      public MembershipSave assignGroup(Group theGroup)
      assign a group
      Parameters:
      theGroup -
      Returns:
      this for chaining
    • assignSubject

      public MembershipSave assignSubject(Subject theSubject)
      subject to add
      Parameters:
      theSubject -
      Returns:
      this for chaining
    • assignMember

      public MembershipSave assignMember(Member theMember)
      member to add
      Parameters:
      member -
      Returns:
      this for chaining
    • assignGroupName

      public MembershipSave assignGroupName(String theGroupName)
      group name to add to, mutually exclusive with group id
      Parameters:
      theGroupName -
      Returns:
      this for chaining
    • assignMemberId

      public MembershipSave assignMemberId(String theMemberId)
      member id to add
      Parameters:
      theMemberId -
      Returns:
      this for chaining
    • assignSubjectId

      public MembershipSave assignSubjectId(String theSubjectId)
      subject id to add, mutually exclusive and preferable to subject identifier
      Parameters:
      theSubjectId -
      Returns:
      this for chaining
    • assignSubjectSourceId

      public MembershipSave assignSubjectSourceId(String theSubjectSourceId)
      subject source id to add
      Parameters:
      theSubjectSourceId -
      Returns:
      this for chaining
    • assignSubjectIdentifier

      public MembershipSave assignSubjectIdentifier(String theSubjectIdentifier)
      subject identifier to add, mutually exclusive and not preferable to subject id
      Parameters:
      thesubjectIdentifier -
      Returns:
      this for chaining
    • assignImmediateMembershipId

      public MembershipSave assignImmediateMembershipId(String theImmediateMembershipId)
      uuid of this membership for inserts (optional)
      Parameters:
      theImmediateMembershipId -
      Returns:
      this for chaining
    • assignImmediateMshipDisabledTime

      public MembershipSave assignImmediateMshipDisabledTime(Long theImmediateMshipDisabledTime)
      millis since 1970 that immediate mship disabled
      Parameters:
      theImmediateMshipDisabledTime -
      Returns:
      this for chaining
    • assignImmediateMshipEnabledTime

      public MembershipSave assignImmediateMshipEnabledTime(Long theImmediateMshipEnabledTime)
      Parameters:
      theImmediateMshipEnabledTime -
      Returns:
      this for chaining
    • assignSaveMode

      public MembershipSave assignSaveMode(SaveMode theSaveMode)
      asssign save mode
      Parameters:
      theSaveMode -
      Returns:
      this for chaining
    • getSaveResultType

      public SaveResultType getSaveResultType()
      get the save type
      Returns:
      save type
    • save

       create or update or delete a membership
       
      Returns:
      the membership that was updated or created or deleted
      Throws:
      InsufficientPrivilegeException
      GroupNotFoundException