bucket.user.providers
Class ChainedUserProvider

java.lang.Object
  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:

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.

See Also:
Serialized Form

Constructor Summary
ChainedUserProvider()
           
 
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

ChainedUserProvider

public ChainedUserProvider()
Method Detail

getProviderClass

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.


getNextProvider

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.

Returns:
the next AccessProvider in the chain

init

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
Parameters:
properties - initialisation properties for this provider, and subsequent providers in the chain.
Returns:
true if initialisation was successful, false otherwise

create

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

flushCaches

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

handles

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

list

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

load

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

remove

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

store

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


Copyright © 2003-2012 Atlassian. All Rights Reserved.