com.atlassian.crowd.dao.alias
Class AliasDAOHibernate

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by com.atlassian.crowd.util.persistence.hibernate.HibernateDao
              extended by com.atlassian.crowd.dao.alias.AliasDAOHibernate
All Implemented Interfaces:
AliasDAO, org.springframework.beans.factory.InitializingBean

public class AliasDAOHibernate
extends HibernateDao
implements AliasDAO


Field Summary
 
Fields inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao
batchFinder, batchProcessor, logger
 
Constructor Summary
AliasDAOHibernate()
           
 
Method Summary
 java.lang.String findAliasByUsername(Application application, java.lang.String username)
          Retrieves the application-specific alias for a username.
 java.util.List<Alias> findAll()
           
 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.
 java.lang.Class getPersistentClass()
          All subclasses of HibernateDAO must implement this method for HibernateDao.load(long) to work correctly
 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 setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)
           
 void storeAlias(Application application, java.lang.String username, java.lang.String alias)
          Add or update the application-specific alias for a username.
 
Methods inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao
load, loadReference, remove, save, saveOrUpdate, setBatchFinder, setBatchProcessor, update
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AliasDAOHibernate

public AliasDAOHibernate()
Method Detail

getPersistentClass

public java.lang.Class getPersistentClass()
Description copied from class: HibernateDao
All subclasses of HibernateDAO must implement this method for HibernateDao.load(long) to work correctly

Specified by:
getPersistentClass in class HibernateDao
Returns:
Class

search

public java.util.List<java.lang.String> search(EntityQuery<java.lang.String> entityQuery)
Description copied from interface: AliasDAO
Will search for a List of Alias' based on a given EntityQuery

Specified by:
search in interface AliasDAO
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

public java.lang.String findAliasByUsername(Application application,
                                            java.lang.String username)
Description copied from interface: AliasDAO
Retrieves the application-specific alias for a username.

Specified by:
findAliasByUsername in interface AliasDAO
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

public java.lang.String findUsernameByAlias(Application application,
                                            java.lang.String alias)
Description copied from interface: AliasDAO
Retrieves the real username for a user in a directory given their application-specific alias.

Specified by:
findUsernameByAlias in interface AliasDAO
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

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

Specified by:
storeAlias in interface AliasDAO
Parameters:
application - application context.
username - real username of user in directory.
alias - application-specific alias (cannot be null or blank).

removeAlias

public void removeAlias(Application application,
                        java.lang.String username)
Description copied from interface: AliasDAO
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 AliasDAO
Parameters:
application - application context.
username - real username of user in directory.

removeAliases

public void removeAliases(Application application)
Description copied from interface: AliasDAO
Removes all the username-aliases for a specific application.

Specified by:
removeAliases in interface AliasDAO
Parameters:
application - application context.

findAll

public java.util.List<Alias> findAll()

setHqlQueryTranslater

public void setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)


Copyright © 2010 Atlassian. All Rights Reserved.