com.atlassian.crowd.model.group
Interface GroupMembershipDAO

All Superinterfaces:
ObjectDao
All Known Implementing Classes:
GroupMembershipDAOHibernate

public interface GroupMembershipDAO
extends ObjectDao

Persistance methods necessary to modify an InternalDirectory membership.


Method Summary
 RemoteGroupMembership add(RemoteGroupMembership membership)
          Add the membership to the database.
 BatchResult<RemoteGroupMembership> addAll(java.util.Set<RemoteGroupMembership> memberships)
          Add a collection of memberships.
 RemoteGroupMembership findMembership(RemoteGroup group, RemotePrincipal principal)
          Finds the membership (if any) for the specified group and principal.
 java.util.List<RemoteGroupMembership> findMemberships(RemoteGroup group)
          Finds all the memberships for the specified group.
 java.util.List<RemoteGroupMembership> findMemberships(RemotePrincipal principal)
          Finds all the memberships for the specified principal.
 void remove(RemoteGroupMembership membership)
          Remove the group-principal membership.
 void removeAll(RemoteGroup group)
          Remove all the principal members from a group.
 void removeAll(RemotePrincipal principal)
          Remove all the group membersips from a principal.
 
Methods inherited from interface com.atlassian.crowd.util.persistence.hibernate.ObjectDao
getPersistentClass, load, remove, save, update
 

Method Detail

findMemberships

java.util.List<RemoteGroupMembership> findMemberships(RemoteGroup group)
Finds all the memberships for the specified group.

Parameters:
group - group's memberships to find.
Returns:
memberships for the group.

findMemberships

java.util.List<RemoteGroupMembership> findMemberships(RemotePrincipal principal)
Finds all the memberships for the specified principal.

Parameters:
principal - principal's memberships to find.
Returns:
memberships for the group.

findMembership

RemoteGroupMembership findMembership(RemoteGroup group,
                                     RemotePrincipal principal)
                                     throws ObjectNotFoundException
Finds the membership (if any) for the specified group and principal.

Parameters:
group - group forming membership.
principal - principal forming memebership.
Returns:
memberhsip object representing the group-principal membership.
Throws:
ObjectNotFoundException - if the principal is not a member of the group.

add

RemoteGroupMembership add(RemoteGroupMembership membership)
Add the membership to the database. If a membership already exists, no error is reported.

Parameters:
membership - group-principal membership.
Returns:
memberhsip object representing the group-principal membership.

remove

void remove(RemoteGroupMembership membership)
Remove the group-principal membership.

Parameters:
membership - object representing the group-principal membership.

removeAll

void removeAll(RemoteGroup group)
Remove all the principal members from a group.

Parameters:
group - group to clear memberships from.

removeAll

void removeAll(RemotePrincipal principal)
Remove all the group membersips from a principal.

Parameters:
principal - principal to clear memberships from.

addAll

BatchResult<RemoteGroupMembership> addAll(java.util.Set<RemoteGroupMembership> memberships)
Add a collection of memberships. If a membership already exists, no error is reported.

Parameters:
memberships - memberships to add.
Returns:
a batch result indicating the memberships that failed to be added.


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.