com.elasticpath.persistence.impl
Class CustomerAuthenticationDaoImpl

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

public class CustomerAuthenticationDaoImpl
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
CustomerAuthenticationDaoImpl()
           
 
Method Summary
 ElasticPath getElasticPath()
          Get the ElasticPath singleton.
 PersistenceEngine getPersistenceEngine()
          Returns the persistence engine.
 org.acegisecurity.userdetails.UserDetails loadUserByUsername(java.lang.String userName)
          Locates the customer based on the given userName of the Customer.
 void setElasticPath(ElasticPath elasticpath)
          Inject the ElasticPath singleton.
 void setPersistenceEngine(PersistenceEngine persistenceEngine)
          Sets the persistence engine.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomerAuthenticationDaoImpl

public CustomerAuthenticationDaoImpl()
Method Detail

getElasticPath

public ElasticPath getElasticPath()
Get the ElasticPath singleton.

Returns:
elasticpath the ElasticPath singleton.

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 customer based on the given userName of the Customer.

Specified by:
loadUserByUsername in interface org.acegisecurity.userdetails.UserDetailsService
Parameters:
userName - the userName presented to the DaoAuthenticationProvider.
Returns:
a fully populated Customer
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

setElasticPath

public void setElasticPath(ElasticPath elasticpath)
Inject the ElasticPath singleton.

Parameters:
elasticpath - the ElasticPath singleton.

setPersistenceEngine

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

Parameters:
persistenceEngine - the persistence engine to set.