bucket.user.providers
Class CachingAccessProvider

java.lang.Object
  extended by bucket.user.providers.ChainedUserProvider
      extended by bucket.user.providers.ChainedAccessProvider
          extended by bucket.user.providers.CachingAccessProvider
All Implemented Interfaces:
com.atlassian.user.cache.CacheFactoryAware, com.opensymphony.user.provider.AccessProvider, com.opensymphony.user.provider.UserProvider, java.io.Serializable

public class CachingAccessProvider
extends ChainedAccessProvider
implements com.atlassian.user.cache.CacheFactoryAware

A custom AccessProvider for Confluence that caches 'handles' lookups.

See Also:
Serialized Form

Field Summary
protected  com.atlassian.cache.CacheFactory cacheFactory
           
 
Constructor Summary
CachingAccessProvider()
           
 
Method Summary
 boolean addToGroup(java.lang.String username, java.lang.String groupname)
           
 boolean create(java.lang.String name)
           
 void flushCaches()
           
 boolean handles(java.lang.String name)
           
 boolean inGroup(java.lang.String username, java.lang.String groupname)
           
 boolean init(java.util.Properties properties)
          NECESSARY HACK: LDAPCredentialsProvider.handles() calls UserManager.getInstance().getCredentialsProviders() which triggers of an initialisation of all providers in osuser.xml (including this one) Initialisation is done via this init() method, so we need to ensure a cacheManager is available so that this caching provider is initialised correctly (normally, we have CachingAccessProvider instantiated and initialised by altassian-user's DefaultOSUConfigurationLoader.addProvider())
 boolean remove(java.lang.String name)
           
 boolean removeFromGroup(java.lang.String username, java.lang.String groupname)
           
 void setCacheFactory(com.atlassian.cache.CacheFactory cacheFactory)
           
 
Methods inherited from class bucket.user.providers.ChainedAccessProvider
flushCache, getNextAccessProvider, getProviderClass, listGroupsContainingUser, listUsersInGroup
 
Methods inherited from class bucket.user.providers.ChainedUserProvider
getNextProvider, list, load, store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.opensymphony.user.provider.UserProvider
list, load, store
 

Field Detail

cacheFactory

protected com.atlassian.cache.CacheFactory cacheFactory
Constructor Detail

CachingAccessProvider

public CachingAccessProvider()
Method Detail

init

public boolean init(java.util.Properties properties)
NECESSARY HACK: LDAPCredentialsProvider.handles() calls UserManager.getInstance().getCredentialsProviders() which triggers of an initialisation of all providers in osuser.xml (including this one) Initialisation is done via this init() method, so we need to ensure a cacheManager is available so that this caching provider is initialised correctly (normally, we have CachingAccessProvider instantiated and initialised by altassian-user's DefaultOSUConfigurationLoader.addProvider())

Specified by:
init in interface com.opensymphony.user.provider.UserProvider
Overrides:
init in class ChainedUserProvider
Parameters:
properties - initialisation properties for this provider, and subsequent providers in the chain.
Returns:
true if initialisation was successful, false otherwise

handles

public boolean handles(java.lang.String name)
Specified by:
handles in interface com.opensymphony.user.provider.UserProvider
Overrides:
handles in class ChainedUserProvider

create

public boolean create(java.lang.String name)
Specified by:
create in interface com.opensymphony.user.provider.UserProvider
Overrides:
create in class ChainedUserProvider

remove

public boolean remove(java.lang.String name)
Specified by:
remove in interface com.opensymphony.user.provider.UserProvider
Overrides:
remove in class ChainedUserProvider

inGroup

public boolean inGroup(java.lang.String username,
                       java.lang.String groupname)
Specified by:
inGroup in interface com.opensymphony.user.provider.AccessProvider
Overrides:
inGroup in class ChainedAccessProvider

addToGroup

public boolean addToGroup(java.lang.String username,
                          java.lang.String groupname)
Specified by:
addToGroup in interface com.opensymphony.user.provider.AccessProvider
Overrides:
addToGroup in class ChainedAccessProvider

removeFromGroup

public boolean removeFromGroup(java.lang.String username,
                               java.lang.String groupname)
Specified by:
removeFromGroup in interface com.opensymphony.user.provider.AccessProvider
Overrides:
removeFromGroup in class ChainedAccessProvider

flushCaches

public void flushCaches()
Specified by:
flushCaches in interface com.opensymphony.user.provider.UserProvider
Overrides:
flushCaches in class ChainedUserProvider

setCacheFactory

public void setCacheFactory(com.atlassian.cache.CacheFactory cacheFactory)
Specified by:
setCacheFactory in interface com.atlassian.user.cache.CacheFactoryAware


Copyright © 2003-2014 Atlassian. All Rights Reserved.