public class

CachingCredentialsProvider

extends ChainedCredentialsProvider
implements CacheFactoryAware
java.lang.Object
   ↳ bucket.user.providers.ChainedUserProvider
     ↳ bucket.user.providers.ChainedCredentialsProvider
       ↳ bucket.user.providers.CachingCredentialsProvider

Class Overview

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

Summary

Fields
protected CacheFactory cacheFactory
Public Constructors
CachingCredentialsProvider()
Public Methods
boolean create(String name)
void flushCaches()
boolean handles(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(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(CacheFactory cacheFactory)
[Expand]
Inherited Methods
From class bucket.user.providers.ChainedCredentialsProvider
From class bucket.user.providers.ChainedUserProvider
From class java.lang.Object
From interface com.atlassian.user.cache.CacheFactoryAware
From interface com.opensymphony.user.provider.CredentialsProvider
From interface com.opensymphony.user.provider.UserProvider

Fields

protected CacheFactory cacheFactory

Public Constructors

public CachingCredentialsProvider ()

Public Methods

public boolean create (String name)

public void flushCaches ()

public boolean handles (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.

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

Parameters
properties initialisation properties for this provider, and subsequent providers in the chain.
Returns
  • true if initialisation was successful, false otherwise

public boolean remove (String name)

public void setCacheFactory (CacheFactory cacheFactory)