org.broadleafcommerce.profile.core.service
Interface CustomerService

All Known Implementing Classes:
CustomerServiceImpl

public interface CustomerService


Method Summary
 void addPostRegisterListener(PostRegistrationObserver postRegisterListeners)
           
 Customer changePassword(PasswordChange passwordChange)
           
 GenericResponse checkPasswordResetToken(String token)
          Verifies that the passed in token is valid.
 Customer createCustomer()
           
 Customer createCustomerFromId(Long customerId)
          Returns a Customer by first looking in the database, otherwise creating a new non-persisted Customer
 Customer createNewCustomer()
          Returns a non-persisted Customer.
 Long findNextCustomerId()
           
 List<PasswordUpdatedHandler> getPasswordChangedHandlers()
           
 List<PasswordUpdatedHandler> getPasswordResetHandlers()
           
 String getSalt()
          Deprecated. use getSaltSource() instead
 Object getSalt(Customer customer)
          Gets the salt object for the current customer.
 org.springframework.security.authentication.dao.SaltSource getSaltSource()
          Returns the SaltSource used with the blPasswordEncoder to encrypt the user password.
 Customer readCustomerByEmail(String emailAddress)
           
 Customer readCustomerById(Long userId)
           
 Customer readCustomerByUsername(String customerName)
           
 Customer registerCustomer(Customer customer, String password, String passwordConfirm)
           
 void removePostRegisterListener(PostRegistrationObserver postRegisterListeners)
           
 Customer resetPassword(PasswordReset passwordReset)
           
 GenericResponse resetPasswordUsingToken(String username, String token, String password, String confirmPassword)
          Updates the password for the passed in customer only if the passed in token is valid for that customer.
 Customer saveCustomer(Customer customer)
           
 Customer saveCustomer(Customer customer, boolean register)
           
 GenericResponse sendForgotPasswordNotification(String userName, String forgotPasswordUrl)
          Generates an access token and then emails the user.
 GenericResponse sendForgotUsernameNotification(String emailAddress)
          Looks up the corresponding Customer and emails the address on file with the associated username.
 void setPasswordChangedHandlers(List<PasswordUpdatedHandler> passwordChangedHandlers)
           
 void setPasswordResetHandlers(List<PasswordUpdatedHandler> passwordResetHandlers)
           
 void setSalt(String salt)
          Deprecated. use setSaltSource(SaltSource) instead
 void setSaltSource(org.springframework.security.authentication.dao.SaltSource saltSource)
          Sets the SaltSource used with blPasswordencoder to encrypt the user password.
 

Method Detail

saveCustomer

Customer saveCustomer(Customer customer)

saveCustomer

Customer saveCustomer(Customer customer,
                      boolean register)

registerCustomer

Customer registerCustomer(Customer customer,
                          String password,
                          String passwordConfirm)

readCustomerByUsername

Customer readCustomerByUsername(String customerName)

readCustomerByEmail

Customer readCustomerByEmail(String emailAddress)

changePassword

Customer changePassword(PasswordChange passwordChange)

readCustomerById

Customer readCustomerById(Long userId)

createCustomer

Customer createCustomer()

createCustomerFromId

Customer createCustomerFromId(Long customerId)
Returns a Customer by first looking in the database, otherwise creating a new non-persisted Customer

Parameters:
customerId - the id of the customer to lookup
Returns:
either a Customer from the database if it exists, or a new non-persisted Customer

createNewCustomer

Customer createNewCustomer()
Returns a non-persisted Customer. Typically used with registering a new customer.


addPostRegisterListener

void addPostRegisterListener(PostRegistrationObserver postRegisterListeners)

removePostRegisterListener

void removePostRegisterListener(PostRegistrationObserver postRegisterListeners)

resetPassword

Customer resetPassword(PasswordReset passwordReset)

getPasswordResetHandlers

List<PasswordUpdatedHandler> getPasswordResetHandlers()

setPasswordResetHandlers

void setPasswordResetHandlers(List<PasswordUpdatedHandler> passwordResetHandlers)

getPasswordChangedHandlers

List<PasswordUpdatedHandler> getPasswordChangedHandlers()

setPasswordChangedHandlers

void setPasswordChangedHandlers(List<PasswordUpdatedHandler> passwordChangedHandlers)

sendForgotUsernameNotification

GenericResponse sendForgotUsernameNotification(String emailAddress)
Looks up the corresponding Customer and emails the address on file with the associated username.

Parameters:
emailAddress -
Returns:
Response can contain errors including (notFound)

sendForgotPasswordNotification

GenericResponse sendForgotPasswordNotification(String userName,
                                               String forgotPasswordUrl)
Generates an access token and then emails the user.

Parameters:
userName - - the user to send a reset password email to.
forgotPasswordUrl - - Base url to include in the email.
Returns:
Response can contain errors including (invalidEmail, invalidUsername, inactiveUser)

resetPasswordUsingToken

GenericResponse resetPasswordUsingToken(String username,
                                        String token,
                                        String password,
                                        String confirmPassword)
Updates the password for the passed in customer only if the passed in token is valid for that customer.

Parameters:
username - Username of the customer
token - Valid reset token
password - new password
Returns:
Response can contain errors including (invalidUsername, inactiveUser, invalidToken, invalidPassword, tokenExpired)

checkPasswordResetToken

GenericResponse checkPasswordResetToken(String token)
Verifies that the passed in token is valid. Returns responseCodes of "invalidToken", "tokenUsed", and "tokenExpired".

Parameters:
token -
Returns:

findNextCustomerId

Long findNextCustomerId()

getSalt

@Deprecated
String getSalt()
Deprecated. use getSaltSource() instead


setSalt

@Deprecated
void setSalt(String salt)
Deprecated. use setSaltSource(SaltSource) instead


getSaltSource

org.springframework.security.authentication.dao.SaltSource getSaltSource()
Returns the SaltSource used with the blPasswordEncoder to encrypt the user password. Usually configured in applicationContext-security.xml. This is not a required property and will return null if not configured


setSaltSource

void setSaltSource(org.springframework.security.authentication.dao.SaltSource saltSource)
Sets the SaltSource used with blPasswordencoder to encrypt the user password. Usually configured within applicationContext-security.xml

Parameters:
saltSource -

getSalt

Object getSalt(Customer customer)
Gets the salt object for the current customer. By default this delegates to getSaltSource(). If there is not a SaltSource configured (getSaltSource() returns null) then this also returns null.

Parameters:
customer -
Returns:
the salt for the current customer


Copyright © 2013. All Rights Reserved.