Class ChainedUserProvider

  extended by bucket.user.providers.ChainedUserProvider
All Implemented Interfaces:
com.opensymphony.user.provider.UserProvider, Serializable
Direct Known Subclasses:
ChainedAccessProvider, ChainedCredentialsProvider, ChainedProfileProvider

public abstract class ChainedUserProvider
extends Object
implements com.opensymphony.user.provider.UserProvider

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:

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.
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.

See Also:
Serialized Form

Constructor Summary
Method Summary
 boolean create(String s)
 void flushCaches()
protected  com.opensymphony.user.provider.UserProvider getNextProvider()
          Get the next UserProvider in the chain.
protected abstract  Class getProviderClass()
          Get the exact kind of provider we are chaining.
 boolean handles(String s)
 boolean init(Properties properties)
          See the class Javadoc for the chaining provider's properties.
 List list()
 boolean load(String s, com.opensymphony.user.Entity.Accessor accessor)
 boolean remove(String s)
 boolean store(String s, com.opensymphony.user.Entity.Accessor accessor)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ChainedUserProvider()
Method Detail


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.


protected com.opensymphony.user.provider.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.

the next AccessProvider in the chain


public boolean init(Properties properties)
See the class Javadoc for the chaining provider's properties.

Specified by:
init in interface com.opensymphony.user.provider.UserProvider
properties - initialisation properties for this provider, and subsequent providers in the chain.
true if initialisation was successful, false otherwise


public boolean create(String s)
Specified by:
create in interface com.opensymphony.user.provider.UserProvider


public void flushCaches()
Specified by:
flushCaches in interface com.opensymphony.user.provider.UserProvider


public boolean handles(String s)
Specified by:
handles in interface com.opensymphony.user.provider.UserProvider


public List list()
Specified by:
list in interface com.opensymphony.user.provider.UserProvider


public boolean load(String s,
                    com.opensymphony.user.Entity.Accessor accessor)
Specified by:
load in interface com.opensymphony.user.provider.UserProvider


public boolean remove(String s)
Specified by:
remove in interface com.opensymphony.user.provider.UserProvider


public boolean store(String s,
                     com.opensymphony.user.Entity.Accessor accessor)
Specified by:
store in interface com.opensymphony.user.provider.UserProvider

Copyright © 2003-2013 Atlassian. All Rights Reserved.