|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.elasticpath.domain.impl.AbstractEpDomainImpl
com.elasticpath.domain.impl.AbstractPersistenceImpl
com.elasticpath.domain.impl.AbstractEntityImpl
com.elasticpath.domain.customer.impl.CustomerImpl
public class CustomerImpl
The default implementation of Customer
.
Field Summary | |
---|---|
static java.lang.String |
ATT_KEY_CP_ANONYMOUS_CUST
System attribute key. |
static java.lang.String |
ATT_KEY_CP_BE_NOTIFIED
System attribute key. |
static java.lang.String |
ATT_KEY_CP_COMPANY
System attribute key. |
static java.lang.String |
ATT_KEY_CP_DOB
System attribute key. |
static java.lang.String |
ATT_KEY_CP_EMAIL
System attribute key. |
static java.lang.String |
ATT_KEY_CP_FAX
System attribute key. |
static java.lang.String |
ATT_KEY_CP_FIRST_NAME
System attribute key. |
static java.lang.String |
ATT_KEY_CP_GENDER
System attribute key. |
static java.lang.String |
ATT_KEY_CP_HTML_EMAIL
System attribute key. |
static java.lang.String |
ATT_KEY_CP_LAST_NAME
System attribute key. |
static java.lang.String |
ATT_KEY_CP_PHONE
System attribute key. |
static java.lang.String |
ATT_KEY_CP_PREF_CURR
System attribute key. |
static java.lang.String |
ATT_KEY_CP_PREF_LOCALE
System attribute key. |
static long |
serialVersionUID
Serial version id. |
Fields inherited from interface com.elasticpath.domain.customer.Customer |
---|
GENDER_FEMALE, GENDER_MALE, GENDER_NOT_SELECTED, STATUS_ACTIVE, STATUS_DISABLED, STATUS_PENDING_APPROVAL |
Constructor Summary | |
---|---|
CustomerImpl()
The default constructor. |
Method Summary | |
---|---|
void |
addAddress(CustomerAddress address)
Adds an CustomerAddress to the list of addresses. |
void |
addCreditCard(CustomerCreditCard creditCard)
Add a credit card to this customer. |
void |
addCustomerGroup(CustomerGroup customerGroup)
Adds a CustomerGroup to the list of customerGroups. |
boolean |
belongsToCustomerGroup(long customerGroupID)
Returns a boolean indicating whether the customer belongs to a customerGroup with the given customerGroupID. |
boolean |
belongsToCustomerGroup(java.lang.String groupName)
Return a boolean indicating whether the customer belongs to a customerGroup with the given name. |
void |
executeBeforePersistAction()
Update the last modified date. |
CustomerAddress |
getAddressByGuid(java.lang.String addressGuid)
Returns the customer's address with the matching GUID. |
CustomerAddress |
getAddressByUid(long addressUid)
Returns the customer's address with the matching UID. |
java.util.List |
getAddresses()
Gets the CustomerAddress es associated with this Customer . |
org.acegisecurity.GrantedAuthority[] |
getAuthorities()
Returns the authorities granted to the user. |
java.lang.String |
getClearTextPassword()
Gets the clear-text password (only available at creation time). |
java.lang.String |
getCompany()
Gets the company associated with this Customer . |
java.lang.String |
getConfirmClearTextPassword()
Gets the clear-text confirm password (only available at creation time). |
java.util.Date |
getCreationDate()
Gets the customer creation date. |
CustomerCreditCard |
getCreditCardByUid(long creditCardUid)
Returns the customer's credit card with the matching UID. |
java.util.List |
getCreditCards()
|
CustomerAuthentication |
getCustomerAuthentication()
Get the customer authentication. |
java.util.List |
getCustomerGroups()
Get the CustomerGroup s associatied with this customer. |
CustomerProfile |
getCustomerProfile()
Get the customer profile. |
java.util.Date |
getDateOfBirth()
Gets the customer's date of birth. |
java.lang.String |
getEmail()
Gets the email address of this Customer . |
java.lang.String |
getFirstName()
Gets the Customer 's first name. |
char |
getGender()
Gets the gender of this Customer . |
java.util.Date |
getLastEditDate()
Gets the customer last edit date. |
java.lang.String |
getLastName()
Gets the Customer 's last name. |
java.lang.String |
getPassword()
Gets the encrypted password. |
java.lang.String |
getPhoneNumber()
Gets the phone number associated with this Customer . |
CustomerAddress |
getPreferredBillingAddress()
Get the preferred billing address. |
java.util.Currency |
getPreferredCurrency()
Get the preferred currency of the customer corresponding to the shopping cart. |
java.util.Locale |
getPreferredLocale()
Get the preferred locale of the customer corresponding to the shopping cart. |
CustomerAddress |
getPreferredShippingAddress()
Get the preferred shipping address. |
int |
getStatus()
Gets the status of this Customer . |
java.lang.String |
getUserId()
Gets the user identifier for this Customer . |
java.lang.String |
getUsername()
Returns the username used to authenticate the user. |
boolean |
isAccountNonExpired()
Indicates whether the user's account has expired. |
boolean |
isAccountNonLocked()
Indicates whether the user is locked or unlocked. |
boolean |
isAnonymous()
Gets the flag indicating whether this customer is anonymous or not. |
boolean |
isCredentialsNonExpired()
Indicates whether the user's credentials (password) has expired. |
boolean |
isEnabled()
Indicates whether the user is enabled or disabled. |
boolean |
isRegistered()
Gets the flag indicating whether this customer is a 'real' registered customer or not. |
boolean |
isToBeNotified()
Indicates whether the user wishes to be notified of news. |
void |
removeAddress(CustomerAddress address)
Removes an CustomerAddress from the list of addresses. |
void |
removeCreditCard(CustomerCreditCard creditCard)
Removes an CustomerCreditCard from the list of credit cards. |
void |
removeCustomerGroup(CustomerGroup customerGroup)
Removes a CustomerGroup from the list of customerGroups. |
java.lang.String |
resetPassword()
Reset the customer's password. |
void |
setAddresses(java.util.List addresses)
Sets the CustomerAddress es associated with this Customer . |
void |
setAnonymous(boolean anonymous)
Sets the anonymous status of the customer. |
void |
setClearTextPassword(java.lang.String clearTextPassword)
Sets the clear-text password. |
void |
setCompany(java.lang.String company)
Sets the company associated with this Customer . |
void |
setConfirmClearTextPassword(java.lang.String confirmClearTextPassword)
Sets the confirm clear-text password. |
void |
setCreationDate(java.util.Date creationDate)
Sets the customer creation date. |
void |
setCreditCards(java.util.List creditCards)
|
void |
setCustomerAuthentication(CustomerAuthentication customerAuthentication)
Set the customer authentication. |
void |
setCustomerGroups(java.util.List customerGroups)
Sets the CustomerGroup s associated with this Customer . |
void |
setCustomerProfile(CustomerProfile customerProfile)
Set the customer profile. |
void |
setDateOfBirth(java.util.Date dateOfBirth)
Sets the customer's date of birth. |
void |
setDefaultValues()
Set default values for those fields need default values. |
void |
setEmail(java.lang.String email)
Sets the email address of this Customer . |
void |
setFirstName(java.lang.String firstName)
Sets the Customer 's first name. |
void |
setGender(char gender)
Sets the gender of this Customer . |
void |
setLastEditDate(java.util.Date lastEditDate)
Sets the customer last edit date. |
void |
setLastName(java.lang.String lastName)
Sets the Customer 's last name. |
void |
setPassword(java.lang.String password)
Sets the encrypted password. |
void |
setPhoneNumber(java.lang.String phoneNumber)
Sets the phone number associated with this Customer . |
void |
setPreferredBillingAddress(CustomerAddress address)
Set the preferred billing address. |
void |
setPreferredCreditCard(CustomerCreditCard preferredCreditCard)
Sets the customer's default (preferred) credit card. |
void |
setPreferredCurrency(java.util.Currency preferredCurrency)
Set the preferred currency of the customer corresponding to the shopping cart. |
void |
setPreferredLocale(java.util.Locale preferredLocale)
Set the preferred locale of the customer corresponding to the shopping cart. |
void |
setPreferredShippingAddress(CustomerAddress address)
Set the preferred shipping address. |
void |
setStatus(int status)
Sets the status of this Customer . |
void |
setToBeNotified(boolean toBeNotified)
Set whether the user wishes to be notified of news. |
void |
setUserId(java.lang.String userId)
Sets the user identifier for this Customer . |
void |
updateCreditCard(CustomerCreditCard creditCard)
Notifies a Customer that a credit card has been updated
(The credit card default flags will be set accordingly). |
Methods inherited from class com.elasticpath.domain.impl.AbstractEntityImpl |
---|
convertAttributeGroupAttributes, getGuid, setGuid |
Methods inherited from class com.elasticpath.domain.impl.AbstractPersistenceImpl |
---|
getUidPk, isPersistent, setUidPk |
Methods inherited from class com.elasticpath.domain.impl.AbstractEpDomainImpl |
---|
getElasticPath, setElasticPath |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.elasticpath.domain.Entity |
---|
getGuid, setGuid |
Methods inherited from interface com.elasticpath.domain.Persistence |
---|
getUidPk, isPersistent, setUidPk |
Methods inherited from interface com.elasticpath.domain.EpDomain |
---|
getElasticPath, setElasticPath |
Field Detail |
---|
public static final java.lang.String ATT_KEY_CP_ANONYMOUS_CUST
public static final java.lang.String ATT_KEY_CP_BE_NOTIFIED
public static final java.lang.String ATT_KEY_CP_COMPANY
public static final java.lang.String ATT_KEY_CP_DOB
public static final java.lang.String ATT_KEY_CP_EMAIL
public static final java.lang.String ATT_KEY_CP_FAX
public static final java.lang.String ATT_KEY_CP_FIRST_NAME
public static final java.lang.String ATT_KEY_CP_GENDER
public static final java.lang.String ATT_KEY_CP_HTML_EMAIL
public static final java.lang.String ATT_KEY_CP_LAST_NAME
public static final java.lang.String ATT_KEY_CP_PHONE
public static final java.lang.String ATT_KEY_CP_PREF_CURR
public static final java.lang.String ATT_KEY_CP_PREF_LOCALE
public static final long serialVersionUID
Constructor Detail |
---|
public CustomerImpl()
Method Detail |
---|
public void addAddress(CustomerAddress address) throws EpDomainException
CustomerAddress
to the list of addresses.
addAddress
in interface Customer
address
- the address to add.
EpDomainException
- if the given CustomerAddress
is null
.public void addCreditCard(CustomerCreditCard creditCard) throws EpDomainException
addCreditCard
in interface Customer
creditCard
- the credit card to add
EpDomainException
- if the given CustomerCreditCard
is null
.public void addCustomerGroup(CustomerGroup customerGroup)
CustomerGroup
to the list of customerGroups.
addCustomerGroup
in interface Customer
customerGroup
- the customerGroup to add.public boolean belongsToCustomerGroup(long customerGroupID)
belongsToCustomerGroup
in interface Customer
customerGroupID
- - customerGroup ID.
public boolean belongsToCustomerGroup(java.lang.String groupName)
belongsToCustomerGroup
in interface Customer
groupName
- - customerGroup name.
public void executeBeforePersistAction()
executeBeforePersistAction
in interface Persistence
executeBeforePersistAction
in class AbstractPersistenceImpl
public CustomerAddress getAddressByGuid(java.lang.String addressGuid)
getAddressByGuid
in interface Customer
addressGuid
- the guid of the address to be retrieved
CustomerAddress
or null
if no matching address is foundpublic CustomerAddress getAddressByUid(long addressUid)
getAddressByUid
in interface Customer
addressUid
- the uidPk of the address to be retrieved
CustomerAddress
or null
if no matching address is foundpublic java.util.List getAddresses()
CustomerAddress
es associated with this Customer
.
getAddresses
in interface Customer
public org.acegisecurity.GrantedAuthority[] getAuthorities()
null
.
getAuthorities
in interface org.acegisecurity.userdetails.UserDetails
null
)public java.lang.String getClearTextPassword()
getClearTextPassword
in interface Customer
public java.lang.String getCompany()
Customer
.
getCompany
in interface Customer
public java.lang.String getConfirmClearTextPassword()
getConfirmClearTextPassword
in interface Customer
public java.util.Date getCreationDate()
getCreationDate
in interface Customer
public CustomerCreditCard getCreditCardByUid(long creditCardUid)
getCreditCardByUid
in interface Customer
creditCardUid
- the uidPk of the credit card to be retrieved
CustomerCreditCard
or null
if no matching credit card is foundpublic java.util.List getCreditCards()
getCreditCards
in interface Customer
public CustomerAuthentication getCustomerAuthentication()
getCustomerAuthentication
in interface Customer
CustomerAuthentication
public java.util.List getCustomerGroups()
CustomerGroup
s associatied with this customer.
getCustomerGroups
in interface Customer
public CustomerProfile getCustomerProfile()
getCustomerProfile
in interface Customer
CustomerProfile
public java.util.Date getDateOfBirth()
getDateOfBirth
in interface Customer
public java.lang.String getEmail()
Customer
.
getEmail
in interface Customer
public java.lang.String getFirstName()
Customer
's first name.
getFirstName
in interface Customer
public char getGender()
Customer
.
getGender
in interface Customer
public java.util.Date getLastEditDate()
getLastEditDate
in interface Customer
public java.lang.String getLastName()
Customer
's last name.
getLastName
in interface Customer
public java.lang.String getPassword()
getPassword
in interface Customer
getPassword
in interface org.acegisecurity.userdetails.UserDetails
public java.lang.String getPhoneNumber()
Customer
.
getPhoneNumber
in interface Customer
public CustomerAddress getPreferredBillingAddress()
getPreferredBillingAddress
in interface Customer
public java.util.Currency getPreferredCurrency()
getPreferredCurrency
in interface Customer
Currency
public java.util.Locale getPreferredLocale()
getPreferredLocale
in interface Customer
Locale
public CustomerAddress getPreferredShippingAddress()
getPreferredShippingAddress
in interface Customer
public int getStatus()
Customer
.
getStatus
in interface Customer
public java.lang.String getUserId()
Customer
.
getUserId
in interface Customer
public java.lang.String getUsername()
null
.
getUsername
in interface org.acegisecurity.userdetails.UserDetails
null
)public boolean isAccountNonExpired()
isAccountNonExpired
in interface org.acegisecurity.userdetails.UserDetails
true
if the user's account is valid (ie non-expired), false
if no longer valid (ie expired)public boolean isAccountNonLocked()
isAccountNonLocked
in interface org.acegisecurity.userdetails.UserDetails
true
if the user is not locked, false
UserRole otherwisepublic boolean isAnonymous()
isAnonymous
in interface Customer
public boolean isCredentialsNonExpired()
isCredentialsNonExpired
in interface org.acegisecurity.userdetails.UserDetails
true
if the user's credentials are valid (ie non-expired), false
if no longer valid (ie expired)public boolean isEnabled()
isEnabled
in interface org.acegisecurity.userdetails.UserDetails
true
if the user is enabled, false
otherwisepublic boolean isRegistered()
isRegistered
in interface Customer
public boolean isToBeNotified()
isToBeNotified
in interface Customer
public void removeAddress(CustomerAddress address) throws EpDomainException
CustomerAddress
from the list of addresses.
removeAddress
in interface Customer
address
- the address to remove.
EpDomainException
- if the given Customer
is null
.public void removeCreditCard(CustomerCreditCard creditCard) throws EpDomainException
CustomerCreditCard
from the list of credit cards.
removeCreditCard
in interface Customer
creditCard
- the credit card to remove.
EpDomainException
- if the given CustomerCreditCard
is null
.public void removeCustomerGroup(CustomerGroup customerGroup)
CustomerGroup
from the list of customerGroups.
removeCustomerGroup
in interface Customer
customerGroup
- the customerGroup to remove.public java.lang.String resetPassword()
resetPassword
in interface Customer
public void setAddresses(java.util.List addresses) throws EpDomainException
CustomerAddress
es associated with this Customer
.
setAddresses
in interface Customer
addresses
- the new list of addresses.
EpDomainException
- if the given List
is null
.public void setAnonymous(boolean anonymous)
setAnonymous
in interface Customer
anonymous
- - true if the customer is anonymous; otherwise false.public void setClearTextPassword(java.lang.String clearTextPassword)
setClearTextPassword
in interface Customer
clearTextPassword
- the clear-text password.public void setCompany(java.lang.String company)
Customer
.
setCompany
in interface Customer
company
- the new company.public void setConfirmClearTextPassword(java.lang.String confirmClearTextPassword)
setConfirmClearTextPassword
in interface Customer
confirmClearTextPassword
- the user confirmClearTextPassword.public void setCreationDate(java.util.Date creationDate)
setCreationDate
in interface Customer
creationDate
- customer creation date.public void setCreditCards(java.util.List creditCards)
setCreditCards
in interface Customer
creditCards
- the credit cards to setpublic void setCustomerAuthentication(CustomerAuthentication customerAuthentication)
setCustomerAuthentication
in interface Customer
customerAuthentication
- the CustomerAuthentication
public void setCustomerGroups(java.util.List customerGroups)
CustomerGroup
s associated with this Customer
.
setCustomerGroups
in interface Customer
customerGroups
- - the list of customerGroups that the current customer is in.public void setCustomerProfile(CustomerProfile customerProfile)
setCustomerProfile
in interface Customer
customerProfile
- the CustomerProfile
public void setDateOfBirth(java.util.Date dateOfBirth)
setDateOfBirth
in interface Customer
dateOfBirth
- customer's date of birth.public void setDefaultValues()
setDefaultValues
in interface Persistence
setDefaultValues
in class AbstractEntityImpl
public void setEmail(java.lang.String email)
Customer
. Sets the userId as the email if userId is null.
setEmail
in interface Customer
email
- the new email address.public void setFirstName(java.lang.String firstName)
Customer
's first name.
setFirstName
in interface Customer
firstName
- the new first name.public void setGender(char gender)
Customer
.
setGender
in interface Customer
gender
- the customer's gender ('F' for female, or 'M' for male).public void setLastEditDate(java.util.Date lastEditDate)
setLastEditDate
in interface Customer
lastEditDate
- customer last edit date.public void setLastName(java.lang.String lastName)
Customer
's last name.
setLastName
in interface Customer
lastName
- the new last name.public void setPassword(java.lang.String password)
setPassword
in interface Customer
password
- the encrypted password.public void setPhoneNumber(java.lang.String phoneNumber)
Customer
.
setPhoneNumber
in interface Customer
phoneNumber
- the new phone number.public void setPreferredBillingAddress(CustomerAddress address)
setPreferredBillingAddress
in interface Customer
address
- the CustomerAddress
public void setPreferredCreditCard(CustomerCreditCard preferredCreditCard)
setPreferredCreditCard
in interface Customer
preferredCreditCard
- the credit card to be used by defaultpublic void setPreferredCurrency(java.util.Currency preferredCurrency)
setPreferredCurrency
in interface Customer
preferredCurrency
- the Currency
public void setPreferredLocale(java.util.Locale preferredLocale)
setPreferredLocale
in interface Customer
preferredLocale
- the Locale
public void setPreferredShippingAddress(CustomerAddress address)
setPreferredShippingAddress
in interface Customer
address
- the CustomerAddress
public void setStatus(int status)
Customer
.
setStatus
in interface Customer
status
- the custome's status.
EpDomainException
- if the status is invalid.public void setToBeNotified(boolean toBeNotified)
setToBeNotified
in interface Customer
toBeNotified
- set to true to indicate that need to be notified of newspublic void setUserId(java.lang.String userId)
Customer
.
setUserId
in interface Customer
userId
- the new user identifier.
EpDomainException
- if the given identifier is null
.public void updateCreditCard(CustomerCreditCard creditCard)
Customer
that a credit card has been updated
(The credit card default flags will be set accordingly).
updateCreditCard
in interface Customer
creditCard
- the credit card that was updated
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |