public abstract class

ChainedUserProvider

extends Object
implements UserProvider
java.lang.Object
   ↳ bucket.user.providers.ChainedUserProvider
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Allows more explicit chaining of OSUser providers. Normal OSUser chaining is applied externally, so a provider doesn't know it's part of a chain, and can't explicitly talk to providers down the chain (making implementing a generic caching provider difficult, for example)

Init Properties:

chain.classname
The classname of the provider to instantiate that this provider may choose to delegate requests to. The class must be of the appropriate provider type.
chain.*
Any property (other than chain.classname) that starts with chain. will have the "chain." prefix stripped, and be passed as an init property to the next provider in the chain.

If you're a masochist, you can configure multiple chained providers in a row, using properties like "chain.chain.chain.of.fools" to pass configuration properties down the list.

Summary

Public Constructors
ChainedUserProvider()
Public Methods
boolean create(String s)
void flushCaches()
boolean handles(String s)
boolean init(Properties properties)
See the class Javadoc for the chaining provider's properties.
List list()
boolean load(String s, Entity.Accessor accessor)
boolean remove(String s)
boolean store(String s, Entity.Accessor accessor)
Protected Methods
UserProvider getNextProvider()
Get the next UserProvider in the chain.
abstract Class getProviderClass()
Get the exact kind of provider we are chaining.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.opensymphony.user.provider.UserProvider

Public Constructors

public ChainedUserProvider ()

Public Methods

public boolean create (String s)

public void flushCaches ()

public boolean handles (String s)

public boolean init (Properties properties)

See the class Javadoc for the chaining provider's properties.

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

public List list ()

public boolean load (String s, Entity.Accessor accessor)

public boolean remove (String s)

public boolean store (String s, Entity.Accessor accessor)

Protected Methods

protected UserProvider getNextProvider ()

Get the next UserProvider in the chain. So long as the chain has been successfully init()'d, this method should never return null.

Returns
  • the next AccessProvider in the chain

protected abstract Class getProviderClass ()

Get the exact kind of provider we are chaining. Concrete subclasses should return the class we are enforcing providers to be a type of: i.e. AccessProvider, CredentialsProvider or ProfileProvider. If this provider class isn't a sub-type of UserProvider, things will fall over in a painful fashion.