|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.crowd.integration.directory.cache.DefaultDirectoryCache
com.atlassian.crowd.integration.directory.cache.LDAPDirectoryCache
public class LDAPDirectoryCache
In addition to DefaultDirectoryCache caches, the LDAPDirectoryCache adds the following:
1. dn -> entityType, entityName : dn mappings for groups and users only (NOT roles), as they can be members of containers (groups and roles) this stores null if cache doesn't know the mapping and false if the cache knows that the dn maps to nothing useful 2. entityType, entityName -> dn : the reverse mapping
| Field Summary | |
|---|---|
protected net.sf.ehcache.Cache |
dnToEntityIdentifierCache
|
protected net.sf.ehcache.Cache |
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 | |
|---|---|
LDAPDirectoryCache(long directoryID,
net.sf.ehcache.CacheManager ehcacheManager,
int maxElementsInMemoryPerSubCache)
|
|
| Method Summary | |
|---|---|
protected void |
doClear()
|
protected void |
doClose()
|
protected java.lang.String |
getDn(DirectoryEntity directoryEntity)
|
protected java.lang.String |
getDnForEntityIdentifier(EntityIdentifier identifier)
|
EntityIdentifier |
getEntityIdentifierForDn(java.lang.String dn)
Finds the cached entity identifier for the supplied DN. |
Group |
getGroup(java.lang.String groupName)
Returns the cached Group matching the directoryID and groupName. |
User |
getUser(java.lang.String userName)
Returns the cached User matching the directoryID and username. |
protected void |
removeDnMapping(EntityType type,
java.lang.String name)
|
void |
removeDnMapping(java.lang.String dn)
|
void |
removeGroup(java.lang.String groupName)
Removes a group (if it exists in the cache), along with any existing relationships of the group to users or groups. |
void |
removeUser(java.lang.String userName)
Removes a user (if it exists in the cache), along with any existing relationships of the user to groups or roles. |
protected void |
storeDnMapping(DirectoryEntity entity)
|
void |
storeGroup(Group group)
Stores a clone of the supplied group object in the cache. |
void |
storeUser(User user)
Stores a clone of the supplied user object in the cache. |
protected void |
updateGroupMembersFromMemberDNs(Group group)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final net.sf.ehcache.Cache dnToEntityIdentifierCache
protected final net.sf.ehcache.Cache entityIdentifierToDnCache
| Constructor Detail |
|---|
public LDAPDirectoryCache(long directoryID,
net.sf.ehcache.CacheManager ehcacheManager,
int maxElementsInMemoryPerSubCache)
| Method Detail |
|---|
protected void doClear()
doClear in class DefaultDirectoryCacheprotected void doClose()
doClose in class DefaultDirectoryCachepublic void storeUser(User user)
DirectoryCache
storeUser in interface DirectoryCachestoreUser in class DefaultDirectoryCacheuser - user to cache.public void storeGroup(Group group)
DirectoryCache
storeGroup in interface DirectoryCachestoreGroup in class DefaultDirectoryCachegroup - group to cache.public void removeUser(java.lang.String userName)
DirectoryCache
removeUser in interface DirectoryCacheremoveUser in class DefaultDirectoryCacheuserName - name of user to remove from cache.public void removeGroup(java.lang.String groupName)
DirectoryCache
removeGroup in interface DirectoryCacheremoveGroup in class DefaultDirectoryCachegroupName - name of group to remove from cache.
public User getUser(java.lang.String userName)
throws ObjectNotFoundException
DirectoryCachenull is returned.
This signifies we do not know whether the user exists or not.
If it is known that the user does not exist, an
ObjectNotFoundException is thrown. For example,
if a user is removed, a subsequent getUser call attempting
to find the removed user will throw this exception.
The returning user is a clone of user object in the
cache. Callers are free to mutate the clone however they want.
getUser in interface DirectoryCachegetUser in class DefaultDirectoryCacheuserName - name of user to find.
null.
ObjectNotFoundException - if the object does not exist.
public Group getGroup(java.lang.String groupName)
throws ObjectNotFoundException
DirectoryCachenull is returned.
This signifies we do not know whether the group exists or not.
If it is known that the group does not exist, an
ObjectNotFoundException is thrown. For example,
if a group is removed, a subsequent getGroup call attempting
to find the removed group will throw this exception.
The returning group is a clone of group object in the
cache. Callers are free to mutate the clone however they want.
getGroup in interface DirectoryCachegetGroup in class DefaultDirectoryCachegroupName - name of group to find.
null.
ObjectNotFoundException - if the object does not exist.protected void storeDnMapping(DirectoryEntity entity)
protected java.lang.String getDn(DirectoryEntity directoryEntity)
protected void removeDnMapping(EntityType type,
java.lang.String name)
public void removeDnMapping(java.lang.String dn)
public EntityIdentifier getEntityIdentifierForDn(java.lang.String dn)
throws ObjectNotFoundException
dn -
ObjectNotFoundException - if it is known that the DN doesn't map to an Entity (User/Group).protected java.lang.String getDnForEntityIdentifier(EntityIdentifier identifier)
protected void updateGroupMembersFromMemberDNs(Group group)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||