com.atlassian.crowd.integration.service.cache
Class CachingGroupManager

java.lang.Object
  extended by com.atlassian.crowd.integration.service.cache.CachingGroupManager
All Implemented Interfaces:
GroupManager

public class CachingGroupManager
extends java.lang.Object
implements GroupManager

Handles group names & groups themselves.


Constructor Summary
CachingGroupManager(SecurityServerClient securityServerClient, BasicCache basicCache)
           
 
Method Summary
 SOAPGroup addGroup(SOAPGroup group)
          Adds group to the Crowd server.
 java.util.List getAllGroupNames()
          Returns a list of all available groups.
 SOAPGroup getGroup(java.lang.String groupName)
          See also CachingGroupMembershipManager.getMembers(String)} for similar logic.
 boolean isGroup(java.lang.String groupName)
          Returns true if groupName represents a valid group, false otherwise.
 void removeGroup(java.lang.String groupName)
          Removes a group from Crowd.
 java.util.List searchGroups(SearchRestriction[] restrictions)
          Searches the list of all available groups based on the passed-in restrictions and returns a list of groups that match.
 void updateGroup(SOAPGroup group)
          Updates a group's details in Crowd.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingGroupManager

public CachingGroupManager(SecurityServerClient securityServerClient,
                           BasicCache basicCache)
Method Detail

isGroup

public boolean isGroup(java.lang.String groupName)
                throws java.rmi.RemoteException,
                       InvalidAuthorizationTokenException
Description copied from interface: GroupManager
Returns true if groupName represents a valid group, false otherwise.

Specified by:
isGroup in interface GroupManager
Parameters:
groupName - The name to check
Returns:
true if it's a group, false otherwise
Throws:
java.rmi.RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.

getGroup

public SOAPGroup getGroup(java.lang.String groupName)
                   throws java.rmi.RemoteException,
                          InvalidAuthorizationTokenException,
                          ObjectNotFoundException
See also CachingGroupMembershipManager.getMembers(String)} for similar logic.

Specified by:
getGroup in interface GroupManager
Parameters:
groupName -
Returns:
Throws:
java.rmi.RemoteException
InvalidAuthorizationTokenException
ObjectNotFoundException

addGroup

public SOAPGroup addGroup(SOAPGroup group)
                   throws java.rmi.RemoteException,
                          InvalidGroupException,
                          InvalidAuthorizationTokenException,
                          ApplicationPermissionException
Description copied from interface: GroupManager
Adds group to the Crowd server.

Specified by:
addGroup in interface GroupManager
Parameters:
group - The object containing the details of the group.
Returns:
The SOAPGroup, as returned by the Crowd server.
Throws:
java.rmi.RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidGroupException - Could not add the group - it may be malformed, or a group with that name may already exist.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
ApplicationPermissionException - The application, not the user, does not have permission to add groups.

searchGroups

public java.util.List searchGroups(SearchRestriction[] restrictions)
                            throws java.rmi.RemoteException,
                                   InvalidAuthorizationTokenException
Description copied from interface: GroupManager
Searches the list of all available groups based on the passed-in restrictions and returns a list of groups that match.

Specified by:
searchGroups in interface GroupManager
Returns:
A List of SOAPGroups that match the criteria.
Throws:
java.rmi.RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.

updateGroup

public void updateGroup(SOAPGroup group)
                 throws java.rmi.RemoteException,
                        ObjectNotFoundException,
                        ApplicationPermissionException,
                        InvalidAuthorizationTokenException
Description copied from interface: GroupManager
Updates a group's details in Crowd.

Specified by:
updateGroup in interface GroupManager
Parameters:
group - The group to update
Throws:
java.rmi.RemoteException - A communication error occurred - the Crowd server may not be available.
ObjectNotFoundException - The group to update could not be found.
ApplicationPermissionException - This application does not have the rights to update the group. Sorry.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.

removeGroup

public void removeGroup(java.lang.String groupName)
                 throws java.rmi.RemoteException,
                        InvalidAuthorizationTokenException,
                        ObjectNotFoundException,
                        ApplicationPermissionException
Description copied from interface: GroupManager
Removes a group from Crowd.

Specified by:
removeGroup in interface GroupManager
Parameters:
groupName - The name of the group to remove.
Throws:
java.rmi.RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
ObjectNotFoundException - The group to remove could not be found.
ApplicationPermissionException - This application is not allowed to remove this group.

getAllGroupNames

public java.util.List getAllGroupNames()
                                throws java.rmi.RemoteException,
                                       InvalidAuthorizationTokenException
Description copied from interface: GroupManager
Returns a list of all available groups. We recommend against use of this method; depending on the environment, it may prevent your app from scaling. Some large organisations build very complex group permissioning structures, with total group numbers in the tens of thousands.

Specified by:
getAllGroupNames in interface GroupManager
Returns:
A List of Strings that list all the groups visible to this application.
Throws:
java.rmi.RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.