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 to
UserDirectory
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.core.util.Cacheable
Cacheable.SingleCacheConfiguration
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Returns the user's cache by loginReturns the user's cache by emailReturns the instance of the implementation ofAbstractCacheManager
to use.protected abstract String
Returns a String identifying the type of this directory, used in the cache screen in _admin, such as 'SQL' or 'LDAP'.getId()
A unique identifiergetLabel()
Get the label of the CredentialProviderGets the managed caches.Get the values of parameters (from user directory model)Get the id of the population this user directory belongs to.Get the id of theUserDirectoryModel
extension pointvoid
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 Details
-
AbstractCachingUserDirectory
public AbstractCachingUserDirectory()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getId
Description copied from interface:UserDirectory
A unique identifier- Specified by:
getId
in interfaceUserDirectory
- Returns:
- The non-null and non-empty identifier
-
getLabel
Description copied from interface:UserDirectory
Get the label of the CredentialProvider- Specified by:
getLabel
in interfaceUserDirectory
- Returns:
- The optionnal label
-
setPopulationId
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
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
Description copied from interface:UserDirectory
Get the values of parameters (from user directory model)- Specified by:
getParameterValues
in interfaceUserDirectory
- Returns:
- the parameters' values
-
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
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
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
Returns the user's cache by login- Returns:
- the user's cache by login
-
getCacheByMail
Returns the user's cache by email- Returns:
- the user's cache by email
-
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
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
- Specified by:
dispose
in interfaceDisposable
-