bucket.user.providers
Class ChainedUserProvider

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

public abstract class ChainedUserProvider
extends java.lang.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(java.lang.String s)
           
 void flushCaches()
           
protected  com.opensymphony.user.provider.UserProvider getNextProvider()
          Get the next UserProvider in the chain.
protected abstract  java.lang.Class getProviderClass()
          Get the exact kind of provider we are chaining.
 boolean handles(java.lang.String s)
           
 boolean init(java.util.Properties properties)
          See the class Javadoc for the chaining provider's properties.
 java.util.List list()
           
 boolean load(java.lang.String s, com.opensymphony.user.Entity.Accessor accessor)
           
 boolean remove(java.lang.String s)
           
 boolean store(java.lang.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 java.lang.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(java.util.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(java.lang.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(java.lang.String s)
Specified by:
handles in interface com.opensymphony.user.provider.UserProvider

list

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

load

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

remove

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

store

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


Copyright © 2003-2014 Atlassian. All Rights Reserved.