Class AADUserDirectory
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.core.impl.user.directory.AbstractCachingUserDirectory
-
- org.ametys.plugins.extrausermgt.users.aad.AADUserDirectory
-
- All Implemented Interfaces:
UserDirectory,Cacheable,LogEnabled,Disposable,Serviceable
public class AADUserDirectory extends AbstractCachingUserDirectory
UserDirectorylisting users in Azure Active Directory.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.core.util.Cacheable
Cacheable.SingleCacheConfiguration
-
-
Constructor Summary
Constructors Constructor Description AADUserDirectory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckCredentials(String login, String password)Authenticate a user with its credentialsprotected StringgetCacheTypeLabel()Returns a String identifying the type of this directory, used in the cache screen in _admin, such as 'SQL' or 'LDAP'.UsergetUser(String login)Get a particular user by his login.UsergetUserByEmail(String email)Get a particular user by his email (search should be case insensitive).Collection<User>getUsers()Get the list of all users of one directory.List<User>getUsers(int count, int offset, Map<String,Object> parameters)Get a list of users from a directory given the parametersvoidinit(String id, String udModelId, Map<String,Object> paramValues, String label)Initialize the user's directory with given parameters' values.-
Methods inherited from class org.ametys.plugins.core.impl.user.directory.AbstractCachingUserDirectory
dispose, getCacheByLogin, getCacheByMail, getCacheManager, getId, getLabel, getManagedCaches, getParameterValues, getPopulationId, getUserDirectoryModelId, service, setPopulationId
-
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
isCaseSensitive
-
-
-
-
Constructor Detail
-
AADUserDirectory
public AADUserDirectory()
-
-
Method Detail
-
init
public void init(String id, String udModelId, Map<String,Object> paramValues, String label)
Description copied from interface:UserDirectoryInitialize the user's directory with given parameters' values.- Specified by:
initin interfaceUserDirectory- Overrides:
initin classAbstractCachingUserDirectory- Parameters:
id- The non-null and non-empty unique identifierudModelId- The id of user directory extension pointparamValues- The parameters' valueslabel- The optional label
-
getCacheTypeLabel
protected String getCacheTypeLabel()
Description copied from class:AbstractCachingUserDirectoryReturns a String identifying the type of this directory, used in the cache screen in _admin, such as 'SQL' or 'LDAP'.- Specified by:
getCacheTypeLabelin classAbstractCachingUserDirectory- Returns:
- this directory's type
-
getUsers
public Collection<User> getUsers()
Description copied from interface:UserDirectoryGet the list of all users of one directory.- Returns:
- list of users as Collection of
Users, empty if a problem occurs.
-
getUsers
public List<User> getUsers(int count, int offset, Map<String,Object> parameters)
Description copied from interface:UserDirectoryGet a list of users from a directory given the parameters- Parameters:
count- The limit of users to retrieveoffset- The number of result to ignore before starting to collect users.parameters- A map of additional parameters, see implementation.- Returns:
- The list of retrieved
User
-
getUser
public User getUser(String login)
Description copied from interface:UserDirectoryGet a particular user by his login.- Parameters:
login- Login of the user to get. Cannot be null.- Returns:
- User's information as a
Userinstance or null if the user login does not exist.
-
getUserByEmail
public User getUserByEmail(String email) throws NotUniqueUserException
Description copied from interface:UserDirectoryGet a particular user by his email (search should be case insensitive).- Parameters:
email- Email of the user to get. Cannot be null.- Returns:
- User's information as a
Userinstance or null if the user email does not exist. - Throws:
NotUniqueUserException- If many users match this email
-
checkCredentials
public boolean checkCredentials(String login, String password)
Description copied from interface:UserDirectoryAuthenticate a user with its credentials- Parameters:
login- The login to check. Cannot be null.password- The password to check.- Returns:
- true if the user is authenticated, false otherwise.
-
-