com.elasticpath.persistence.impl
Class CmUserAuthenticationDaoImpl

java.lang.Object
  extended by com.elasticpath.persistence.impl.CmUserAuthenticationDaoImpl
All Implemented Interfaces:
org.acegisecurity.userdetails.UserDetailsService

public class CmUserAuthenticationDaoImpl
extends java.lang.Object
implements org.acegisecurity.userdetails.UserDetailsService

Default implementation of Acegi's UserDetailsService, to integrate with Acegi Security framework for authentication and authorization.


Constructor Summary
CmUserAuthenticationDaoImpl()
           
 
Method Summary
 PersistenceEngine getPersistenceEngine()
          Returns the persistence engine.
 org.acegisecurity.userdetails.UserDetails loadUserByUsername(java.lang.String userName)
          Locates the user based on the given userName of the cmUser.
 void setPersistenceEngine(PersistenceEngine persistenceEngine)
          F Sets the persistence engine.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmUserAuthenticationDaoImpl

public CmUserAuthenticationDaoImpl()
Method Detail

getPersistenceEngine

public PersistenceEngine getPersistenceEngine()
Returns the persistence engine.

Returns:
the persistence engine.

loadUserByUsername

public org.acegisecurity.userdetails.UserDetails loadUserByUsername(java.lang.String userName)
                                                             throws org.acegisecurity.userdetails.UsernameNotFoundException,
                                                                    org.springframework.dao.DataAccessException
Locates the user based on the given userName of the cmUser.

Specified by:
loadUserByUsername in interface org.acegisecurity.userdetails.UserDetailsService
Parameters:
userName - the userName presented to the DaoAuthenticationProvider. In commerce manager, it will be the userName.
Returns:
a fully populated cmUser (never null)
Throws:
org.acegisecurity.userdetails.UsernameNotFoundException - if the user could not be found or the user has no GrantedAuthority
org.springframework.dao.DataAccessException - if user could not be found for a repository-specific reason

setPersistenceEngine

public void setPersistenceEngine(PersistenceEngine persistenceEngine)
F Sets the persistence engine.

Parameters:
persistenceEngine - the persistence engine to set.