com.atlassian.crowd.manager.application
Class AliasManagerImpl

java.lang.Object
  extended by com.atlassian.crowd.manager.application.AliasManagerImpl
All Implemented Interfaces:
AliasManager

public class AliasManagerImpl
extends Object
implements AliasManager


Constructor Summary
AliasManagerImpl(AliasDAO aliasDAO, ApplicationService applicationService)
           
 
Method Summary
 String findAliasByUsername(Application application, String username)
          Will return the 'alias' associated to the user.
 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.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AliasManagerImpl

public AliasManagerImpl(AliasDAO aliasDAO,
                        ApplicationService applicationService)
Method Detail

findUsernameByAlias

public String findUsernameByAlias(Application application,
                                  String authenticatingUsername)
Description copied from interface: AliasManager
Will return the 'real' username of the authenticating user. This returned username maybe the username passed in, if the user does not have a configured 'alias' for the given application

Specified by:
findUsernameByAlias in interface AliasManager
Parameters:
application - the application the user is associated with
authenticatingUsername - the username passed to the application for authentication
Returns:
The 'real' username of the authenticating user, or the passed in username

findAliasByUsername

public String findAliasByUsername(Application application,
                                  String username)
Description copied from interface: AliasManager
Will return the 'alias' associated to the user. If an alias does not exist the 'real' username will be returned

Specified by:
findAliasByUsername in interface AliasManager
Parameters:
application - the application the user is associated with
username - the 'real' username of the user
Returns:
if an alias exists it will be returned, otherwise the username will be returned.

storeAlias

public void storeAlias(Application application,
                       String username,
                       String alias)
                throws AliasAlreadyInUseException
Description copied from interface: AliasManager
Add or update the application-specific alias for a username.

Specified by:
storeAlias in interface AliasManager
Parameters:
application - application context.
username - real username of user in directory.
alias - application-specific alias (cannot be null or blank).
Throws:
AliasAlreadyInUseException - the alias is already in use by another user for the given application.

removeAlias

public void removeAlias(Application application,
                        String username)
                 throws AliasAlreadyInUseException
Description copied from interface: AliasManager
Remove an application-specific alias for a username. This method will silently succeed if the username has no application-specific alias.

Specified by:
removeAlias in interface AliasManager
Parameters:
application - application context.
username - real username of user in directory.
Throws:
AliasAlreadyInUseException - the username is already in use by another user as their alias for the given application.

search

public List<String> search(EntityQuery entityQuery)
Description copied from interface: AliasManager
Perform an AliasQuery search on the alias tables of Crowd.

Specified by:
search in interface AliasManager
Parameters:
entityQuery - Will accept an entity query for aliases as an AliasQuery
Returns:
a List of usernames for a given AliasQuery or an empty list


Copyright © 2013 Atlassian. All Rights Reserved.