public interface CustomerService
Modifier and Type | Method and Description |
---|---|
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 . |
String |
encodePassword(String clearText,
Customer customer)
Encodes the clear text parameter, using the customer as a potential Salt.
|
Long |
findNextCustomerId() |
List<PasswordUpdatedHandler> |
getPasswordChangedHandlers() |
List<PasswordUpdatedHandler> |
getPasswordResetHandlers() |
String |
getSalt()
Deprecated.
use
getSaltSource() instead |
Object |
getSalt(Customer customer)
Deprecated.
use
getSalt(Customer, String) instead |
Object |
getSalt(Customer customer,
String unencodedPassword)
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. |
boolean |
isPasswordValid(String rawPassword,
String encodedPassword,
Customer customer)
Use this to determine if passwords match.
|
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. |
Customer registerCustomer(Customer customer, String password, String passwordConfirm)
Customer changePassword(PasswordChange passwordChange)
Customer createCustomer()
Customer createCustomerFromId(Long customerId)
Customer
by first looking in the database, otherwise creating a new non-persisted Customer
customerId
- the id of the customer to lookupCustomer
from the database if it exists, or a new non-persisted Customer
Customer createNewCustomer()
Customer
. Typically used with registering a new customer.void addPostRegisterListener(PostRegistrationObserver postRegisterListeners)
void removePostRegisterListener(PostRegistrationObserver postRegisterListeners)
Customer resetPassword(PasswordReset passwordReset)
List<PasswordUpdatedHandler> getPasswordResetHandlers()
void setPasswordResetHandlers(List<PasswordUpdatedHandler> passwordResetHandlers)
List<PasswordUpdatedHandler> getPasswordChangedHandlers()
void setPasswordChangedHandlers(List<PasswordUpdatedHandler> passwordChangedHandlers)
GenericResponse sendForgotUsernameNotification(String emailAddress)
emailAddress
- GenericResponse sendForgotPasswordNotification(String userName, String forgotPasswordUrl)
userName
- - the user to send a reset password email to.forgotPasswordUrl
- - Base url to include in the email.GenericResponse resetPasswordUsingToken(String username, String token, String password, String confirmPassword)
username
- Username of the customertoken
- Valid reset tokenpassword
- new passwordGenericResponse checkPasswordResetToken(String token)
token
- Long findNextCustomerId()
@Deprecated String getSalt()
getSaltSource()
instead@Deprecated void setSalt(String salt)
setSaltSource(SaltSource)
insteadorg.springframework.security.authentication.dao.SaltSource getSaltSource()
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 configuredvoid setSaltSource(org.springframework.security.authentication.dao.SaltSource saltSource)
SaltSource
used with blPasswordencoder to encrypt the user password. Usually configured within
applicationContext-security.xmlsaltSource
- @Deprecated Object getSalt(Customer customer)
getSalt(Customer, String)
insteadObject getSalt(Customer customer, String unencodedPassword)
getSaltSource()
. If there is
not a SaltSource
configured (getSaltSource()
returns null) then this also returns null.customer
- String encodePassword(String clearText, Customer customer)
clearText
- customer
- boolean isPasswordValid(String rawPassword, String encodedPassword, Customer customer)
rawPassword
- encodedPassword
- customer
- Copyright © 2014. All rights reserved.