com.atlassian.crowd.integration.directory.cache
Class MicrosoftActiveDirectoryCache

java.lang.Object
  extended by com.atlassian.crowd.integration.directory.cache.DefaultDirectoryCache
      extended by com.atlassian.crowd.integration.directory.cache.LDAPDirectoryCache
          extended by com.atlassian.crowd.integration.directory.cache.MicrosoftActiveDirectoryCache
All Implemented Interfaces:
DirectoryCache, com.atlassian.event.EventListener

public class MicrosoftActiveDirectoryCache
extends LDAPDirectoryCache


Field Summary
 
Fields inherited from class com.atlassian.crowd.integration.directory.cache.LDAPDirectoryCache
dnToEntityIdentifierCache, entityIdentifierToDnCache
 
Fields inherited from class com.atlassian.crowd.integration.directory.cache.DefaultDirectoryCache
cacheManager, directoryId, groupCache, groupChildGroupsCache, groupGroupMembershipExistsCache, groupNamesCache, groupParentGroupsCache, groupUsersCache, logger, maxElementsInMemoryPerSubCache, userCache, userGroupMembershipExistsCache, userGroupsCache, userNamesCache
 
Constructor Summary
MicrosoftActiveDirectoryCache(long directoryID, net.sf.ehcache.CacheManager ehcacheManager, int maxElementsInMemoryPerSubCache)
           
 
Method Summary
protected  void doClear()
           
protected  void doClose()
           
protected  boolean doHandleEvent(com.atlassian.event.Event evt)
           
protected  String getAttributeFromEntity(LDAPDirectoryEntity entity, String key)
           
protected  EntityIdentifier getEntityIdentifier(String guid)
           
protected  String getGUID(EntityIdentifier identifier)
           
protected  String getGuidFromEntity(LDAPDirectoryEntity entity)
           
protected  Long getUSNChanged(EntityIdentifier identifier)
           
protected  Long getUsnChangedFromEntity(LDAPDirectoryEntity entity)
           
protected  boolean isNewerThanCache(EntityIdentifier identifier, Long usnChanged)
           
protected  void removeEntityByGUID(String guid)
           
 void removeEntityByTombstone(Tombstone tombstone)
           
 void removeGroup(String groupName)
          Removes a group (if it exists in the cache), along with any existing relationships of the group to users or groups.
protected  void removeGUIDMapping(EntityType type, String name)
           
protected  void removeGUIDMapping(String guid)
           
 void removeUser(String userName)
          Removes a user (if it exists in the cache), along with any existing relationships of the user to groups or roles.
 void storeGroup(Group group)
          Stores a clone of the supplied group object in the cache.
protected  void storeGUIDMapping(String guid, EntityIdentifier identifier)
           
 void storeUser(User user)
          Stores a clone of the supplied user object in the cache.
protected  void storeUSNChanged(EntityIdentifier identifier, Long usnChanged)
           
 
Methods inherited from class com.atlassian.crowd.integration.directory.cache.LDAPDirectoryCache
getDn, getDnForEntityIdentifier, getEntityIdentifierForDn, getGroup, getUser, removeDnMapping, removeDnMapping, storeDnMapping, updateGroupMembersFromMemberDNs
 
Methods inherited from class com.atlassian.crowd.integration.directory.cache.DefaultDirectoryCache
addMembership, addRelationship, clear, close, createAndConfigureCache, getAllEntityNames, getAllEntityNamesAsList, getAllGroupNames, getAllUserNames, getCompleteRelationshipsAsList, getEntity, getFromCache, getGroupMembershipsOfGroup, getGroupMembershipsOfUser, getGroupMembersOfGroup, getHandledEventClasses, getKey, getKeys, getRelationships, getRelationshipsAsList, getStatistics, getUserMembersOfGroup, handleEvent, isEventForThisCache, isGroupGroupMember, isMember, isUserGroupMember, lockRead, lockWrite, removeAllRelations, removeCache, removeEntity, removeGroupAsGroupMember, removeMembership, removeRelationship, removeUserAsGroupMember, setGroupAsGroupMember, setMembershipFlag, setUserAsGroupMember, storeAllEntityNames, storeAllGroupNames, storeAllUserNames, storeEntity, storeGroupMembershipsOfGroup, storeGroupMembershipsOfUser, storeGroupMembersOfGroup, storeMembers, storeMemberships, storeUserMembersOfGroup, unlockRead, unlockWrite
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MicrosoftActiveDirectoryCache

public MicrosoftActiveDirectoryCache(long directoryID,
                                     net.sf.ehcache.CacheManager ehcacheManager,
                                     int maxElementsInMemoryPerSubCache)
Method Detail

doClear

protected void doClear()
Overrides:
doClear in class LDAPDirectoryCache

doClose

protected void doClose()
Overrides:
doClose in class LDAPDirectoryCache

getGuidFromEntity

protected String getGuidFromEntity(LDAPDirectoryEntity entity)

getUsnChangedFromEntity

protected Long getUsnChangedFromEntity(LDAPDirectoryEntity entity)

getAttributeFromEntity

protected String getAttributeFromEntity(LDAPDirectoryEntity entity,
                                        String key)

isNewerThanCache

protected boolean isNewerThanCache(EntityIdentifier identifier,
                                   Long usnChanged)

storeUser

public void storeUser(User user)
Description copied from interface: DirectoryCache
Stores a clone of the supplied user object in the cache. If a user with the same name already exists in the cache, then it is silently replaced.

Specified by:
storeUser in interface DirectoryCache
Overrides:
storeUser in class LDAPDirectoryCache
Parameters:
user - user to cache.

storeGroup

public void storeGroup(Group group)
Description copied from interface: DirectoryCache
Stores a clone of the supplied group object in the cache. If a group with the same name already exists in the cache, then it is silently replaced.

Specified by:
storeGroup in interface DirectoryCache
Overrides:
storeGroup in class LDAPDirectoryCache
Parameters:
group - group to cache.

removeUser

public void removeUser(String userName)
Description copied from interface: DirectoryCache
Removes a user (if it exists in the cache), along with any existing relationships of the user to groups or roles. The cache entry will be marked so that subsequent calls to getUser(username) will throw an ObjectNotFoundException.

Specified by:
removeUser in interface DirectoryCache
Overrides:
removeUser in class LDAPDirectoryCache
Parameters:
userName - name of user to remove from cache.

removeGroup

public void removeGroup(String groupName)
Description copied from interface: DirectoryCache
Removes a group (if it exists in the cache), along with any existing relationships of the group to users or groups. The cache entry will be marked so that subsequent calls to getGroup(groupName) will throw an ObjectNotFoundException.

Specified by:
removeGroup in interface DirectoryCache
Overrides:
removeGroup in class LDAPDirectoryCache
Parameters:
groupName - name of group to remove from cache.

removeEntityByTombstone

public void removeEntityByTombstone(Tombstone tombstone)

removeEntityByGUID

protected void removeEntityByGUID(String guid)

storeGUIDMapping

protected void storeGUIDMapping(String guid,
                                EntityIdentifier identifier)

removeGUIDMapping

protected void removeGUIDMapping(EntityType type,
                                 String name)

removeGUIDMapping

protected void removeGUIDMapping(String guid)

getGUID

protected String getGUID(EntityIdentifier identifier)

getEntityIdentifier

protected EntityIdentifier getEntityIdentifier(String guid)

storeUSNChanged

protected void storeUSNChanged(EntityIdentifier identifier,
                               Long usnChanged)

getUSNChanged

protected Long getUSNChanged(EntityIdentifier identifier)

doHandleEvent

protected boolean doHandleEvent(com.atlassian.event.Event evt)
Overrides:
doHandleEvent in class DefaultDirectoryCache


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.