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, java.io.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:
CacheAwarePropertySet, Serialized Form

Field Summary
static java.lang.String CACHE_KEY_PROFILE_PROVIDER_HANDLES
           
static java.lang.String CACHE_KEY_PROFILE_PROVIDER_PROPERTY_SETS
           
static java.lang.String CACHE_KEY_PROPERTY_SETS_REFERENCES_CACHE
           
 
Constructor Summary
CachingProfileProvider()
           
 
Method Summary
 boolean create(java.lang.String name)
           
 void flushCaches()
           
 com.opensymphony.module.propertyset.PropertySet getPropertySet(java.lang.String name)
           
 boolean handles(java.lang.String name)
           
 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.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 java.lang.String CACHE_KEY_PROFILE_PROVIDER_HANDLES

CACHE_KEY_PROFILE_PROVIDER_PROPERTY_SETS

public static final java.lang.String CACHE_KEY_PROFILE_PROVIDER_PROPERTY_SETS

CACHE_KEY_PROPERTY_SETS_REFERENCES_CACHE

public static final java.lang.String CACHE_KEY_PROPERTY_SETS_REFERENCES_CACHE
Constructor Detail

CachingProfileProvider

public CachingProfileProvider()
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)
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

getPropertySet

public com.opensymphony.module.propertyset.PropertySet getPropertySet(java.lang.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-2014 Atlassian. All Rights Reserved.