bucket.user.providers
Class CachingCredentialsProvider

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

public class CachingCredentialsProvider
extends ChainedCredentialsProvider
implements com.atlassian.user.cache.CacheFactoryAware

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

See Also:
Serialized Form

Field Summary
protected  com.atlassian.cache.CacheFactory cacheFactory
           
 
Constructor Summary
CachingCredentialsProvider()
           
 
Method Summary
 boolean create(java.lang.String name)
           
 void flushCaches()
           
 boolean handles(java.lang.String name)
          lowercase name before calling handles() we make the assumption here that all providers whose lookups are being cached, only handle user accounts with lower case names.
 boolean init(java.util.Properties properties)
          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)
           
 void setCacheFactory(com.atlassian.cache.CacheFactory cacheFactory)
           
 
Methods inherited from class bucket.user.providers.ChainedCredentialsProvider
authenticate, changePassword, getNextCredentialsProvider, getProviderClass
 
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

CachingCredentialsProvider

public CachingCredentialsProvider()
Method Detail

init

public boolean init(java.util.Properties properties)
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)
lowercase name before calling handles() we make the assumption here that all providers whose lookups are being cached, only handle user accounts with lower case names.

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

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-2010 Atlassian. All Rights Reserved.