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()
           
 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)
           
 

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()


Copyright © 2013. All Rights Reserved.