com.atlassian.crowd.dao.alias
Interface AliasDAO

All Known Implementing Classes:
AliasDAOHibernate

public interface AliasDAO

Manages persistence of aliases.


Method Summary
 String findAliasByUsername(Application application, String username)
          Retrieves the application-specific alias for a username.
 String findUsernameByAlias(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.
 List<String> search(EntityQuery<String> entityQuery)
          Will search for a List of Alias' based on a given EntityQuery
 void storeAlias(Application application, String username, String alias)
          Add or update the application-specific alias for a username.
 

Method Detail

search

List<String> search(EntityQuery<String> entityQuery)
Will search for a List of Alias' based on a given EntityQuery

Parameters:
entityQuery - an entity query of type EntityDescriptor.alias()
Returns:
a list of usernames or a Collections.emptyList(). Note: this does not return Alias objects or alias names (only real usernames).

findAliasByUsername

String findAliasByUsername(Application application,
                           String username)
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

String findUsernameByAlias(Application application,
                           String alias)
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

void storeAlias(Application application,
                String username,
                String alias)
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 be null or blank).
Throws:
IllegalArgumentException - if parameters are null or blank.

removeAlias

void removeAlias(Application application,
                 String username)
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

void removeAliases(Application application)
Removes all the username-aliases for a specific application.

Parameters:
application - application context.


Copyright © 2013 Atlassian. All Rights Reserved.