|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.core.security.principal.AbstractPrincipalProvider
public abstract class AbstractPrincipalProvider
A base class of a principal provider implementing common tasks and a
caching facility. Extending classes should only deal with the retrieval of
Principals from their source, the caching of the principials is done
by this implementation.
PrincipalProvider mehtods that that involve searching like
PrincipalProvider.getGroupMembership(Principal) are not cached.
| Field Summary | |
|---|---|
static String |
MAXSIZE_KEY
Option name for the max size of the cache to use |
static String |
NEGATIVE_ENTRY_KEY
Option name to enable negative cache entries (see JCR-2672) |
| Constructor Summary | |
|---|---|
protected |
AbstractPrincipalProvider()
Create a new instance of AbstractPrincipalProvider. |
| Method Summary | |
|---|---|
protected void |
addToCache(Principal principal)
Add an entry to the principal cache. |
protected void |
checkInitialized()
Check if the instance has been closed close(). |
protected void |
clearCache()
Clear the principal cache. |
void |
close()
Clears the cache and calls the implementation to close their resources |
Principal |
getPrincipal(String principalName)
Returns the principal with the given name if is known to this provider |
void |
init(Properties options)
Initialize this provider. |
protected abstract Principal |
providePrincipal(String principalName)
Called if the cache does not contain the principal requested. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.jackrabbit.core.security.principal.PrincipalProvider |
|---|
canReadPrincipal, findPrincipals, findPrincipals, getGroupMembership, getPrincipals |
| Field Detail |
|---|
public static final String MAXSIZE_KEY
public static final String NEGATIVE_ENTRY_KEY
| Constructor Detail |
|---|
protected AbstractPrincipalProvider()
AbstractPrincipalProvider.
Initialization and cache are set up upon init(Properties)
| Method Detail |
|---|
protected void checkInitialized()
close().
IllegalStateException - if this instance was closed.protected void clearCache()
protected void addToCache(Principal principal)
principal - to be cached.protected abstract Principal providePrincipal(String principalName)
Principal from their source,
if it contains one for the given name or null.
principalName - Name of the principal to be returned.
getPrincipal(String)public Principal getPrincipal(String principalName)
providePrincipal(String) is called, if no matching entry
is present in the cache.NEGATIVE_ENTRY_KEY configuration option), the cache will also
store negative matches (as null values) in the principal cache.
getPrincipal in interface PrincipalProviderprincipalName - the name of the principal to retrieve
nullpublic void init(Properties options)
PrincipalProvider
init in interface PrincipalProvideroptions - the options that are setPrincipalProvider.init(java.util.Properties)public void close()
close in interface PrincipalProviderPrincipalProvider.close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||