Class AliasDAOHibernate

All Implemented Interfaces:
AliasDAO

public class AliasDAOHibernate extends HibernateDao<Alias> implements AliasDAO
  • Constructor Details

    • AliasDAOHibernate

      public AliasDAOHibernate()
  • Method Details

    • findAliasByUsername

      public String findAliasByUsername(Application application, 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.
    • findAll

      public List<Alias> findAll()
    • findUsernameByAlias

      public String findUsernameByAlias(Application application, 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.
    • getPersistentClass

      public Class<Alias> getPersistentClass()
      Description copied from class: HibernateDao
      All subclasses of HibernateDao must implement this method for HibernateDao.load(Serializable) to work correctly.
      Specified by:
      getPersistentClass in class HibernateDao<Alias>
      Returns:
      the entity class for this DAO
    • removeAlias

      public void removeAlias(Application application, 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.
    • search

      public List<String> search(EntityQuery<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).
    • storeAlias

      public void storeAlias(Application application, String username, 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).
    • findAliasesForUsers

      public List<Alias> findAliasesForUsers(Application application, Iterable<String> userNames)
      Description copied from interface: AliasDAO
      Retrieves application-specific aliases for the specified users
      Specified by:
      findAliasesForUsers in interface AliasDAO
      Parameters:
      application - application context
      userNames - the users for which the aliases should be retrieved
      Returns:
      a list of Alias entities
    • findAllAliases

      public Map<String,String> findAllAliases(Application application)
      Description copied from interface: AliasDAO
      Retrieves application-specific aliases for all users
      Specified by:
      findAllAliases in interface AliasDAO
      Parameters:
      application - application context
      Returns:
      map from user to alias
    • removeAliasesForUser

      public void removeAliasesForUser(String username)
      Description copied from interface: AliasDAO
      Removes all the aliases registered for a given username in all applications (there may be different users)
      Specified by:
      removeAliasesForUser in interface AliasDAO
    • setHqlQueryTranslater

      @Autowired public void setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)