Package org.ametys.core.user.directory
Interface UserDirectory
-
- All Known Subinterfaces:
ModifiableUserDirectory
- All Known Implementing Classes:
AADUserDirectory
,AbstractCachingUserDirectory
,JdbcUserDirectory
,LdapUserDirectory
,StaticUserDirectory
public interface UserDirectory
Abstraction for getting users list and verify the presence of a particular user.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
checkCredentials(String login, String password)
Authenticate a user with its credentialsString
getId()
A unique identifierString
getLabel()
Get the label of the CredentialProviderMap<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.User
getUser(String login)
Get a particular user by his login.User
getUserByEmail(String email)
Get a particular user by his email (search should be case insensitive).String
getUserDirectoryModelId()
Get the id of theUserDirectoryModel
extension pointCollection<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 parametersvoid
init(String id, String udModelId, Map<String,Object> paramValues, String label)
Initialize the user's directory with given parameters' values.default boolean
isCaseSensitive()
Is the user directory case sensitive for login?void
setPopulationId(String populationId)
Set the value of the id of the population this user directory belong to.
-
-
-
Method Detail
-
getUsers
Collection<User> getUsers()
Get the list of all users of one directory.- Returns:
- list of users as Collection of
User
s, empty if a problem occurs.
-
getUsers
List<User> getUsers(int count, int offset, Map<String,Object> parameters)
Get 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
User getUser(String login)
Get a particular user by his login.- Parameters:
login
- Login of the user to get. Cannot be null.- Returns:
- User's information as a
User
instance or null if the user login does not exist.
-
getUserByEmail
User getUserByEmail(String email) throws NotUniqueUserException
Get 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
User
instance or null if the user email does not exist. - Throws:
NotUniqueUserException
- If many users match this email
-
getUserDirectoryModelId
String getUserDirectoryModelId()
Get the id of theUserDirectoryModel
extension point- Returns:
- the id of extension point
-
getParameterValues
Map<String,Object> getParameterValues()
Get the values of parameters (from user directory model)- Returns:
- the parameters' values
-
init
void init(String id, String udModelId, Map<String,Object> paramValues, String label) throws Exception
Initialize the user's directory with given parameters' values.- Parameters:
id
- The non-null and non-empty unique identifierudModelId
- The id of user directory extension pointparamValues
- The parameters' valueslabel
- The optional label- Throws:
Exception
- If an error occurred
-
setPopulationId
void setPopulationId(String populationId)
Set the value of the id of the population this user directory belong to.- Parameters:
populationId
- The id of the population the user directory belongs to.
-
getPopulationId
String getPopulationId()
Get the id of the population this user directory belongs to.- Returns:
- The id of the population
-
checkCredentials
boolean checkCredentials(String login, String password)
Authenticate 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.
-
isCaseSensitive
default boolean isCaseSensitive()
Is the user directory case sensitive for login?- Returns:
- true is the user directory is case sensitive
-
-