Package edu.internet2.middleware.grouper
Class MembershipSave
java.lang.Object
edu.internet2.middleware.grouper.MembershipSave
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionassignGroup
(Group theGroup) assign a groupassignGroupId
(String theGroupId) group id to add to, mutually exclusive with group nameassignGroupName
(String theGroupName) group name to add to, mutually exclusive with group idassignImmediateMembershipId
(String theImmediateMembershipId) uuid of this membership for inserts (optional)assignImmediateMshipDisabledTime
(Long theImmediateMshipDisabledTime) millis since 1970 that immediate mship disabledassignImmediateMshipEnabledTime
(Long theImmediateMshipEnabledTime) assignMember
(Member theMember) member to addassignMemberId
(String theMemberId) member id to addassignSaveMode
(SaveMode theSaveMode) asssign save modeassignSubject
(Subject theSubject) subject to addassignSubjectId
(String theSubjectId) subject id to add, mutually exclusive and preferable to subject identifierassignSubjectIdentifier
(String theSubjectIdentifier) subject identifier to add, mutually exclusive and not preferable to subject idassignSubjectSourceId
(String theSubjectSourceId) subject source id to addget the save typesave()
create or update or delete a membership
-
Constructor Details
-
MembershipSave
public MembershipSave()create a new membership save- Parameters:
theGrouperSession
-
-
-
Method Details
-
assignGroupId
group id to add to, mutually exclusive with group name- Parameters:
theGroupId
-- Returns:
- this for chaining
-
assignGroup
assign a group- Parameters:
theGroup
-- Returns:
- this for chaining
-
assignSubject
subject to add- Parameters:
theSubject
-- Returns:
- this for chaining
-
assignMember
member to add- Parameters:
member
-- Returns:
- this for chaining
-
assignGroupName
group name to add to, mutually exclusive with group id- Parameters:
theGroupName
-- Returns:
- this for chaining
-
assignMemberId
member id to add- Parameters:
theMemberId
-- Returns:
- this for chaining
-
assignSubjectId
subject id to add, mutually exclusive and preferable to subject identifier- Parameters:
theSubjectId
-- Returns:
- this for chaining
-
assignSubjectSourceId
subject source id to add- Parameters:
theSubjectSourceId
-- Returns:
- this for chaining
-
assignSubjectIdentifier
subject identifier to add, mutually exclusive and not preferable to subject id- Parameters:
thesubjectIdentifier
-- Returns:
- this for chaining
-
assignImmediateMembershipId
uuid of this membership for inserts (optional)- Parameters:
theImmediateMembershipId
-- Returns:
- this for chaining
-
assignImmediateMshipDisabledTime
millis since 1970 that immediate mship disabled- Parameters:
theImmediateMshipDisabledTime
-- Returns:
- this for chaining
-
assignImmediateMshipEnabledTime
- Parameters:
theImmediateMshipEnabledTime
-- Returns:
- this for chaining
-
assignSaveMode
asssign save mode- Parameters:
theSaveMode
-- Returns:
- this for chaining
-
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
-