@Transactional public class AliasManagerImpl extends Object implements AliasManager
Constructor and Description |
---|
AliasManagerImpl(AliasDAO aliasDAO,
ApplicationService applicationService,
com.atlassian.event.api.EventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
String |
findAliasByUsername(Application application,
String username)
Will return the 'alias' associated to the user.
|
Map<String,String> |
findAliasesByUsernames(Application application,
Iterable<String> usernames)
Will return application-specific aliases for the provided users.
|
Map<String,String> |
findAllAliasesByUsernames(Application application)
Returns application-specific aliases for all users.
|
String |
findUsernameByAlias(Application application,
String authenticatingUsername)
Will return the 'real' username of the authenticating user.
|
void |
removeAlias(Application application,
String username)
Remove an application-specific alias for a username.
|
void |
removeAliasesForUser(String username)
Removes all the aliases registered for a given username in all applications (there may be different users)
|
List<String> |
search(EntityQuery entityQuery)
Perform an
AliasQuery search on the alias tables of Crowd. |
void |
storeAlias(Application application,
String username,
String alias)
Add or update the application-specific alias for a username.
|
public AliasManagerImpl(AliasDAO aliasDAO, ApplicationService applicationService, com.atlassian.event.api.EventPublisher eventPublisher)
public String findUsernameByAlias(Application application, String authenticatingUsername)
AliasManager
findUsernameByAlias
in interface AliasManager
application
- the application the user is associated withauthenticatingUsername
- the username passed to the application for authenticationpublic String findAliasByUsername(Application application, String username)
AliasManager
findAliasByUsername
in interface AliasManager
application
- the application the user is associated withusername
- the 'real' username of the userpublic void storeAlias(Application application, String username, String alias) throws AliasAlreadyInUseException
AliasManager
storeAlias
in interface AliasManager
application
- application context.username
- real username of user in directory.alias
- application-specific alias (cannot be null
or blank).AliasAlreadyInUseException
- the alias is already in use by another user for the given application.public void removeAlias(Application application, String username) throws AliasAlreadyInUseException
AliasManager
removeAlias
in interface AliasManager
application
- application context.username
- real username of user in directory.AliasAlreadyInUseException
- the username is already in use by another user as their alias for the given application.public List<String> search(EntityQuery entityQuery)
AliasManager
AliasQuery
search on the alias tables of Crowd.search
in interface AliasManager
entityQuery
- Will accept an entity query for aliases as an AliasQuery
List
<String> of usernames for a given AliasQuery
or an empty listpublic void removeAliasesForUser(String username)
AliasManager
removeAliasesForUser
in interface AliasManager
public Map<String,String> findAliasesByUsernames(Application application, Iterable<String> usernames)
AliasManager
findAliasesByUsernames
in interface AliasManager
application
- application contextusernames
- the usernames for which the aliases will be retrievedpublic Map<String,String> findAllAliasesByUsernames(Application application)
AliasManager
findAllAliasesByUsernames
in interface AliasManager
application
- application contextCopyright © 2021 Atlassian. All rights reserved.