com.atlassian.crowd.directory
Class DbCachingRemoteDirectoryCache

java.lang.Object
  extended by com.atlassian.crowd.directory.DbCachingRemoteDirectoryCache
All Implemented Interfaces:
DirectoryCache

public class DbCachingRemoteDirectoryCache
extends java.lang.Object
implements DirectoryCache


Constructor Summary
DbCachingRemoteDirectoryCache(RemoteDirectory remoteDirectory, InternalRemoteDirectory internalDirectory)
           
 
Method Summary
 void addOrUpdateCachedGroups(java.util.List<? extends Group> remoteGroups, java.util.Date syncStartDate)
           
 void addOrUpdateCachedUsers(java.util.List<? extends User> remoteUsers, java.util.Date syncStartDate)
          Synchronises a list of Users from an external directory in the local cache.
 void deleteCachedGroups(java.util.Set<java.lang.String> groupnames)
           
 void deleteCachedGroupsNotIn(GroupType groupType, java.util.List<? extends Group> remoteGroups, java.util.Date syncStartDate)
           
 void deleteCachedUsers(java.util.Set<java.lang.String> usernames)
           
 void deleteCachedUsersNotIn(java.util.List<? extends User> remoteUsers, java.util.Date synchStartDate)
           
 void syncGroupMembershipsForGroup(Group parentGroup, java.util.List<java.lang.String> remoteGroups)
           
 void syncUserMembershipsForGroup(Group group, java.util.List<java.lang.String> remoteUsers)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbCachingRemoteDirectoryCache

public DbCachingRemoteDirectoryCache(RemoteDirectory remoteDirectory,
                                     InternalRemoteDirectory internalDirectory)
Method Detail

addOrUpdateCachedUsers

public void addOrUpdateCachedUsers(java.util.List<? extends User> remoteUsers,
                                   java.util.Date syncStartDate)
                            throws OperationFailedException
Description copied from interface: DirectoryCache
Synchronises a list of Users from an external directory in the local cache.

If the syncStartDate is not null, then it is used to ensure we don't re-introduce stale data if a User is updated locally after we did our search. Some callers may intentionally choose to pass null - eg when UsnChangedCacheRefresher does a partial synchronise.

Specified by:
addOrUpdateCachedUsers in interface DirectoryCache
Parameters:
remoteUsers - A list of Users from the external directory.
syncStartDate - The date that the synchronise started (can be null).
Throws:
OperationFailedException - If the Internal Directory throws a OperationFailedException - which seems unlikely.

deleteCachedUsersNotIn

public void deleteCachedUsersNotIn(java.util.List<? extends User> remoteUsers,
                                   java.util.Date synchStartDate)
                            throws OperationFailedException
Specified by:
deleteCachedUsersNotIn in interface DirectoryCache
Throws:
OperationFailedException

deleteCachedUsers

public void deleteCachedUsers(java.util.Set<java.lang.String> usernames)
                       throws OperationFailedException
Specified by:
deleteCachedUsers in interface DirectoryCache
Throws:
OperationFailedException

addOrUpdateCachedGroups

public void addOrUpdateCachedGroups(java.util.List<? extends Group> remoteGroups,
                                    java.util.Date syncStartDate)
                             throws OperationFailedException
Specified by:
addOrUpdateCachedGroups in interface DirectoryCache
Throws:
OperationFailedException

deleteCachedGroupsNotIn

public void deleteCachedGroupsNotIn(GroupType groupType,
                                    java.util.List<? extends Group> remoteGroups,
                                    java.util.Date syncStartDate)
                             throws OperationFailedException
Specified by:
deleteCachedGroupsNotIn in interface DirectoryCache
Throws:
OperationFailedException

deleteCachedGroups

public void deleteCachedGroups(java.util.Set<java.lang.String> groupnames)
                        throws OperationFailedException
Specified by:
deleteCachedGroups in interface DirectoryCache
Throws:
OperationFailedException

syncUserMembershipsForGroup

public void syncUserMembershipsForGroup(Group group,
                                        java.util.List<java.lang.String> remoteUsers)
                                 throws OperationFailedException
Specified by:
syncUserMembershipsForGroup in interface DirectoryCache
Throws:
OperationFailedException

syncGroupMembershipsForGroup

public void syncGroupMembershipsForGroup(Group parentGroup,
                                         java.util.List<java.lang.String> remoteGroups)
                                  throws OperationFailedException
Specified by:
syncGroupMembershipsForGroup in interface DirectoryCache
Throws:
OperationFailedException


Copyright © 2010 Atlassian. All Rights Reserved.