|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.crowd.service.cache.CachingGroupMembershipManager
public class CachingGroupMembershipManager
This class handles group memberships, but also handles some funky translation
Constructor Summary | |
---|---|
CachingGroupMembershipManager(SecurityServerClient securityServerClient,
UserManager userManager,
GroupManager groupManager,
BasicCache basicCache)
|
Method Summary | |
---|---|
void |
addMembership(java.lang.String userName,
java.lang.String groupName)
Adds a user identified by userName to the group identified by groupName . |
java.util.List |
getMembers(java.lang.String groupName)
Also see CachingGroupManager.getGroup(String) for very similar logic. |
java.util.List |
getMemberships(java.lang.String userName)
Obtains a list of all groups that the user identified by userName belongs to, sorted naturally. |
boolean |
isMember(java.lang.String userName,
java.lang.String groupName)
Returns true if the user represented by userName is a member of groupName |
java.lang.Boolean |
isUserOrGroup(java.lang.String name)
|
void |
removeMembership(java.lang.String userName,
java.lang.String groupName)
Removes a user identified by userName from the group identified by groupName . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CachingGroupMembershipManager(SecurityServerClient securityServerClient, UserManager userManager, GroupManager groupManager, BasicCache basicCache)
Method Detail |
---|
public boolean isMember(java.lang.String userName, java.lang.String groupName) throws java.rmi.RemoteException, InvalidAuthorizationTokenException
GroupMembershipManager
userName
is a member of groupName
isMember
in interface GroupMembershipManager
userName
- The user to checkgroupName
- The group to check.
java.rmi.RemoteException
- A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException
- The application (not the user) was not authenticated correctly.public void addMembership(java.lang.String userName, java.lang.String groupName) throws java.rmi.RemoteException, InvalidAuthorizationTokenException, ApplicationPermissionException
GroupMembershipManager
userName
to the group identified by groupName
. If the user
is already a member of the group, this method will return successfully.
addMembership
in interface GroupMembershipManager
userName
- The user to addgroupName
- The group the user will be added to
java.rmi.RemoteException
- A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException
- The application (not the user) was not authenticated correctly.
ApplicationPermissionException
- This application does not have permission to update group memberships.public void removeMembership(java.lang.String userName, java.lang.String groupName) throws java.rmi.RemoteException, InvalidAuthorizationTokenException, ApplicationPermissionException, MembershipNotFoundException
GroupMembershipManager
userName
from the group identified by groupName
. If the
user was not a member of the group, this method will return successfully.
removeMembership
in interface GroupMembershipManager
userName
- The user to removegroupName
- The group the user will be added from
java.rmi.RemoteException
- A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException
- The application (not the user) was not authenticated correctly.
ApplicationPermissionException
- This application does not have permission to update group memberships.
MembershipNotFoundException
public java.util.List getMemberships(java.lang.String userName) throws java.rmi.RemoteException, InvalidAuthorizationTokenException
GroupMembershipManager
userName
belongs to, sorted naturally.
This can be a slow call, particularly on some LDAP directories, and so should be avoided. Use
isMember()
instead.
getMemberships
in interface GroupMembershipManager
userName
- The user whose group memberships are desired.
List
of String
s containing all the groups the user belongs to, or an empty List
java.rmi.RemoteException
- A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException
- The application (not the user) was not authenticated correctly.public java.util.List getMembers(java.lang.String groupName) throws java.rmi.RemoteException, InvalidAuthorizationTokenException
CachingGroupManager.getGroup(String)
for very similar logic.
getMembers
in interface GroupMembershipManager
groupName
-
java.rmi.RemoteException
InvalidAuthorizationTokenException
public java.lang.Boolean isUserOrGroup(java.lang.String name) throws InvalidAuthorizationTokenException, java.rmi.RemoteException
InvalidAuthorizationTokenException
java.rmi.RemoteException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |