com.sas.hls.security.membership
Interface MembershipService


public interface MembershipService

The membershipService provides methods to manage and get information about the members of a memberContext.


Method Summary
 void addMember(MembershipContext context, Principal member)
          Add the specified principal to the membership list of a membership context.
 void addMembers(MembershipContext context, Set<Principal> members)
          Add the specified principal to the membership list of a membership context.
 Set<Principal> getAssignedMembers(MembershipContext context)
           
 Set<Principal> getMembersAvailableForAssignment(MembershipContext context)
          Get the set of all principals which can be added to the current membership of the specified context (this list will not include principals already in the current membership).
 Membership getMembership(MembershipContext context)
          Get the membership list of the specified context.
 Set<MembershipDescriptor> getMemberships(Principal member)
          Get the set of membership lists where the specified principal is a member.
 Set<Principal> getPotentialMembers(MembershipContext context)
          Get the set of all principals which could be included in the membership of the specified context (including current members of that membership).
 boolean isMember(MembershipContext context, Principal member)
          Test to see if a given principal is an explicit member of a specified membership context.
 void removeMember(MembershipContext context, Principal member)
          Remove the specified principal from the membership list of the specified context.
 void removeMembers(MembershipContext context, Set<Principal> members)
           
 Membership updateMembership(Membership membership)
          Update a membership list.
 

Method Detail

addMember

void addMember(MembershipContext context,
               Principal member)
               throws MemberExistsException,
                      InvalidMemberException
Add the specified principal to the membership list of a membership context.

Parameters:
context - The membership context to modify.
member - The principal to add to the membership context.
Throws:
MemberExistsException - Thrown when the principal is already a member of this context.
InvalidMemberException - Thrown when the principal specified can not be a member of the specified context.

addMembers

void addMembers(MembershipContext context,
                Set<Principal> members)
                throws MemberExistsException,
                       InvalidMemberException
Add the specified principal to the membership list of a membership context.

Parameters:
context - The membership context to modify.
members - The principals to add to the membership context.
Throws:
MemberExistsException - Thrown when some number of the principals are already members of this context.
InvalidMemberException - Thrown when some number of the principals specified can not be a members of the specified context.

removeMember

void removeMember(MembershipContext context,
                  Principal member)
                  throws MemberNotFoundException,
                         InvalidMemberException
Remove the specified principal from the membership list of the specified context.

Parameters:
context - The membership context to modify.
member - The principal to remove from the membership context.
Throws:
MemberNotFoundException - Thrown when the principal specified is not found in the specified membership list.
InvalidMemberException - Thrown when the principal specified was not created in the specified membership context.

removeMembers

void removeMembers(MembershipContext context,
                   Set<Principal> members)
                   throws MemberNotFoundException,
                          InvalidMemberException
Parameters:
context - The membership context to modify.
members - The principals to remove from the membership context.
Throws:
MemberNotFoundException - Thrown when some number of the principals specified are not found in the specified membership list.
InvalidMemberException - Thrown when the principal specified was created not in the specified membership context.

isMember

boolean isMember(MembershipContext context,
                 Principal member)
Test to see if a given principal is an explicit member of a specified membership context.

Parameters:
context - The membership context to test.
member - The principal in question.
Returns:
The boolean value indicating if the principal is a member of the context.

getMembership

Membership getMembership(MembershipContext context)
Get the membership list of the specified context.

Parameters:
context - The membership context to query.
Returns:
The membership list of the specified context.

updateMembership

Membership updateMembership(Membership membership)
                            throws InvalidMemberException
Update a membership list.

Parameters:
membership - The membership list to modify.
Returns:
The updated membership list.
Throws:
InvalidMemberException - Thrown when the membership list contains principals which are invalid for this context.

getPotentialMembers

Set<Principal> getPotentialMembers(MembershipContext context)
Get the set of all principals which could be included in the membership of the specified context (including current members of that membership).

Parameters:
context - The membership context in question.
Returns:
the set of all principals which could be included in the membership of this context.

getMembersAvailableForAssignment

Set<Principal> getMembersAvailableForAssignment(MembershipContext context)
Get the set of all principals which can be added to the current membership of the specified context (this list will not include principals already in the current membership).

Parameters:
context - The membership context in question.
Returns:
the set of all principals which can be added to the current membership of the context.

getAssignedMembers

Set<Principal> getAssignedMembers(MembershipContext context)
Parameters:
context - The membership context in question.
Returns:
the set of all principals which currently are in the membership of this context

getMemberships

Set<MembershipDescriptor> getMemberships(Principal member)
Get the set of membership lists where the specified principal is a member.

Parameters:
member - The principal in question.
Returns:
The set of membership lists which contain the specified principal.


Copyright (c) 2014, SAS Institute Inc., Cary, NC, USA