|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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
Principal
s 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 |
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. Implementations should return a Principal from their source,
if it contains one for the given name or null . |
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
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 principal with the
given name is present in the cache.
getPrincipal
in interface PrincipalProvider
principalName
- the name of the principal to retrieve
null
public void init(Properties options)
PrincipalProvider
init
in interface PrincipalProvider
options
- the options that are setPrincipalProvider.init(java.util.Properties)
public void close()
close
in interface PrincipalProvider
PrincipalProvider.close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |