Package com.atlassian.crowd.dao.alias
Interface AliasDAO
- All Known Implementing Classes:
AliasDAOHibernate
public interface AliasDAO
Manages persistence of aliases.
-
Method Summary
Modifier and TypeMethodDescriptionfindAliasByUsername
(Application application, String username) Retrieves the application-specific alias for a username.findAliasesForUsers
(Application application, Iterable<String> userNames) Retrieves application-specific aliases for the specified usersfindAllAliases
(Application application) Retrieves application-specific aliases for all usersfindUsernameByAlias
(Application application, String alias) Retrieves the real username for a user in a directory given their application-specific alias.void
removeAlias
(Application application, String username) Remove an application-specific alias for a username.void
removeAliases
(Application application) Removes all the username-aliases for a specific application.void
removeAliasesForUser
(String username) Removes all the aliases registered for a given username in all applications (there may be different users)search
(EntityQuery<String> entityQuery) Will search for a List of Alias' based on a givenEntityQuery
void
storeAlias
(Application application, String username, String alias) Add or update the application-specific alias for a username.
-
Method Details
-
search
Will search for a List of Alias' based on a givenEntityQuery
- Parameters:
entityQuery
- an entity query of typeEntityDescriptor.alias()
- Returns:
- a list of usernames or a Collections.emptyList(). Note: this does not return Alias objects or alias names (only real usernames).
-
findAliasByUsername
Retrieves the application-specific alias for a username.- Parameters:
application
- application context.username
- real username of user in directory.- Returns:
- application-specific alias or
null
if there is no alias for the user/application.
-
findUsernameByAlias
Retrieves the real username for a user in a directory given their application-specific alias.- Parameters:
application
- application context.alias
- application-specific alias.- Returns:
- real username or
null
if there is no user with the supplied alias for the given application.
-
storeAlias
Add or update the application-specific alias for a username.- Parameters:
application
- application context.username
- real username of user in directory.alias
- application-specific alias (cannot benull
or blank).- Throws:
IllegalArgumentException
- if parameters arenull
or blank.
-
removeAlias
Remove an application-specific alias for a username. This method will silently succeed if the username has no application-specific alias.- Parameters:
application
- application context.username
- real username of user in directory.
-
removeAliases
Removes all the username-aliases for a specific application.- Parameters:
application
- application context.
-
removeAliasesForUser
Removes all the aliases registered for a given username in all applications (there may be different users) -
findAliasesForUsers
Retrieves application-specific aliases for the specified users- Parameters:
application
- application contextuserNames
- the users for which the aliases should be retrieved- Returns:
- a list of Alias entities
-
findAllAliases
Retrieves application-specific aliases for all users- Parameters:
application
- application context- Returns:
- map from user to alias
-