com.atlassian.crowd.dao.alias
Interface AliasDAO

All Known Implementing Classes:
AliasDAOHibernate

public interface AliasDAO


Method Summary
 java.lang.String findAliasByUsername(Application application, java.lang.String username)
          Retrieves the application-specific alias for a username.
 java.lang.String findUsernameByAlias(Application application, java.lang.String alias)
          Retrieves the real username for a user in a directory given their application-specific alias.
 void removeAlias(Application application, java.lang.String username)
          Remove an application-specific alias for a username.
 void removeAliases(Application application)
          Removes all the username-aliases for a specific application.
 java.util.List<java.lang.String> search(EntityQuery<java.lang.String> entityQuery)
          Will search for a List of Alias' based on a given EntityQuery
 void storeAlias(Application application, java.lang.String username, java.lang.String alias)
          Add or update the application-specific alias for a username.
 

Method Detail

search

java.util.List<java.lang.String> search(EntityQuery<java.lang.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

java.lang.String findAliasByUsername(Application application,
                                     java.lang.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

java.lang.String findUsernameByAlias(Application application,
                                     java.lang.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,
                java.lang.String username,
                java.lang.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:
java.lang.IllegalArgumentException - if parameters are null or blank.

removeAlias

void removeAlias(Application application,
                 java.lang.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 © 2010 Atlassian. All Rights Reserved.