Class AbstractCachingUserDirectory
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.core.impl.user.directory.AbstractCachingUserDirectory
-
- All Implemented Interfaces:
UserDirectory
,Cacheable
,LogEnabled
,Disposable
,Serviceable
- Direct Known Subclasses:
AADUserDirectory
,JdbcUserDirectory
public abstract class AbstractCachingUserDirectory extends AbstractLogEnabled implements UserDirectory, Serviceable, Cacheable, Disposable
Abstract class providing caching features toUserDirectory
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.core.util.Cacheable
Cacheable.SingleCacheConfiguration
-
-
Constructor Summary
Constructors Constructor Description AbstractCachingUserDirectory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
dispose()
protected Cache<String,User>
getCacheByLogin()
Returns the user's cache by loginprotected Cache<String,User>
getCacheByMail()
Returns the user's cache by emailAbstractCacheManager
getCacheManager()
Returns the instance of the implementation ofAbstractCacheManager
to use.protected abstract String
getCacheTypeLabel()
Returns a String identifying the type of this directory, used in the cache screen in _admin, such as 'SQL' or 'LDAP'.String
getId()
A unique identifierString
getLabel()
Get the label of the CredentialProviderCollection<Cacheable.SingleCacheConfiguration>
getManagedCaches()
Gets the managed caches.Map<String,Object>
getParameterValues()
Get the values of parameters (from user directory model)String
getPopulationId()
Get the id of the population this user directory belongs to.String
getUserDirectoryModelId()
Get the id of theUserDirectoryModel
extension pointvoid
init(String id, String udModelId, Map<String,Object> paramValues, String label)
Initialize the user's directory with given parameters' values.void
service(ServiceManager manager)
void
setPopulationId(String populationId)
Set the value of the id of the population this user directory belong to.-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.core.util.Cacheable
createCaches, getCache, hasComputableSize, isCachingEnabled, removeCaches
-
Methods inherited from interface org.ametys.core.user.directory.UserDirectory
checkCredentials, getUser, getUserByEmail, getUsers, getUsers, isCaseSensitive
-
-
-
-
Constructor Detail
-
AbstractCachingUserDirectory
public AbstractCachingUserDirectory()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getId
public String getId()
Description copied from interface:UserDirectory
A unique identifier- Specified by:
getId
in interfaceUserDirectory
- Returns:
- The non-null and non-empty identifier
-
getLabel
public String getLabel()
Description copied from interface:UserDirectory
Get the label of the CredentialProvider- Specified by:
getLabel
in interfaceUserDirectory
- Returns:
- The optionnal label
-
setPopulationId
public void setPopulationId(String populationId)
Description copied from interface:UserDirectory
Set the value of the id of the population this user directory belong to.- Specified by:
setPopulationId
in interfaceUserDirectory
- Parameters:
populationId
- The id of the population the user directory belongs to.
-
getPopulationId
public String getPopulationId()
Description copied from interface:UserDirectory
Get the id of the population this user directory belongs to.- Specified by:
getPopulationId
in interfaceUserDirectory
- Returns:
- The id of the population
-
getParameterValues
public Map<String,Object> getParameterValues()
Description copied from interface:UserDirectory
Get the values of parameters (from user directory model)- Specified by:
getParameterValues
in interfaceUserDirectory
- Returns:
- the parameters' values
-
getUserDirectoryModelId
public String getUserDirectoryModelId()
Description copied from interface:UserDirectory
Get the id of theUserDirectoryModel
extension point- Specified by:
getUserDirectoryModelId
in interfaceUserDirectory
- Returns:
- the id of extension point
-
init
public void init(String id, String udModelId, Map<String,Object> paramValues, String label)
Description copied from interface:UserDirectory
Initialize the user's directory with given parameters' values.- Specified by:
init
in interfaceUserDirectory
- Parameters:
id
- The non-null and non-empty unique identifierudModelId
- The id of user directory extension pointparamValues
- The parameters' valueslabel
- The optional label
-
getManagedCaches
public Collection<Cacheable.SingleCacheConfiguration> getManagedCaches()
Description copied from interface:Cacheable
Gets the managed caches.
This is meant to be implemented in order to describe the managed caches and automatically create and remove the corresponding caches inCacheable.createCaches()
andCacheable.removeCaches()
default methods.
This is not meant to be called manually.- Specified by:
getManagedCaches
in interfaceCacheable
- Returns:
- A collection of
Cacheable.SingleCacheConfiguration
s to manage
-
getCacheByLogin
protected Cache<String,User> getCacheByLogin()
Returns the user's cache by login- Returns:
- the user's cache by login
-
getCacheByMail
protected Cache<String,User> getCacheByMail()
Returns the user's cache by email- Returns:
- the user's cache by email
-
getCacheTypeLabel
protected abstract String getCacheTypeLabel()
Returns a String identifying the type of this directory, used in the cache screen in _admin, such as 'SQL' or 'LDAP'.- Returns:
- this directory's type
-
getCacheManager
public AbstractCacheManager getCacheManager()
Description copied from interface:Cacheable
Returns the instance of the implementation ofAbstractCacheManager
to use.
This is not meant to be called manually.- Specified by:
getCacheManager
in interfaceCacheable
- Returns:
- The
AbstractCacheManager
to bind
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceDisposable
-
-