bucket.user.providers
Class CachingProfileProvider

java.lang.Object
  extended by bucket.user.providers.ChainedUserProvider
      extended by bucket.user.providers.ChainedProfileProvider
          extended by bucket.user.providers.CachingProfileProvider
All Implemented Interfaces:
com.atlassian.user.cache.CacheFactoryAware, com.opensymphony.user.provider.ProfileProvider, com.opensymphony.user.provider.UserProvider, Serializable

public class CachingProfileProvider
extends ChainedProfileProvider
implements com.atlassian.user.cache.CacheFactoryAware

An extension of the HibernateProfileProvider that caches handles() and propertyset lookups.

See Also:
CachingPropertySet, Serialized Form

Field Summary
static String CACHE_KEY_PROFILE_PROVIDER_HANDLES
           
static String CACHE_KEY_PROFILE_PROVIDER_PROPERTYSETS
           
 
Constructor Summary
CachingProfileProvider()
           
 
Method Summary
 boolean create(String name)
           
 void flushCaches()
           
 com.opensymphony.module.propertyset.PropertySet getPropertySet(String name)
           
 boolean handles(String name)
           
 boolean init(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(String name)
           
 void setCacheFactory(com.atlassian.cache.CacheFactory cacheFactory)
           
 
Methods inherited from class bucket.user.providers.ChainedProfileProvider
getNextProfileProvider, 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

CACHE_KEY_PROFILE_PROVIDER_HANDLES

public static final String CACHE_KEY_PROFILE_PROVIDER_HANDLES

CACHE_KEY_PROFILE_PROVIDER_PROPERTYSETS

public static final String CACHE_KEY_PROFILE_PROVIDER_PROPERTYSETS
Constructor Detail

CachingProfileProvider

public CachingProfileProvider()
Method Detail

init

public boolean init(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(String name)
Specified by:
handles in interface com.opensymphony.user.provider.UserProvider
Overrides:
handles in class ChainedUserProvider

create

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

remove

public boolean remove(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

getPropertySet

public com.opensymphony.module.propertyset.PropertySet getPropertySet(String name)
Specified by:
getPropertySet in interface com.opensymphony.user.provider.ProfileProvider
Overrides:
getPropertySet in class ChainedProfileProvider

setCacheFactory

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


Copyright © 2003-2011 Atlassian. All Rights Reserved.