|
|||||||||
| 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 CustomerAddresses 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 CustomerGroups 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 CustomerAddresses 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 CustomerGroups 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 Customeraddress - the address to add.
EpDomainException - if the given CustomerAddress is null.
public void addCreditCard(CustomerCreditCard creditCard)
throws EpDomainException
addCreditCard in interface CustomercreditCard - 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 CustomercustomerGroup - the customerGroup to add.public boolean belongsToCustomerGroup(long customerGroupID)
belongsToCustomerGroup in interface CustomercustomerGroupID - - customerGroup ID.
public boolean belongsToCustomerGroup(java.lang.String groupName)
belongsToCustomerGroup in interface CustomergroupName - - customerGroup name.
public void executeBeforePersistAction()
executeBeforePersistAction in interface PersistenceexecuteBeforePersistAction in class AbstractPersistenceImplpublic CustomerAddress getAddressByGuid(java.lang.String addressGuid)
getAddressByGuid in interface CustomeraddressGuid - the guid of the address to be retrieved
CustomerAddress or null if no matching address is foundpublic CustomerAddress getAddressByUid(long addressUid)
getAddressByUid in interface CustomeraddressUid - the uidPk of the address to be retrieved
CustomerAddress or null if no matching address is foundpublic java.util.List getAddresses()
CustomerAddresses associated with this Customer.
getAddresses in interface Customerpublic org.acegisecurity.GrantedAuthority[] getAuthorities()
null.
getAuthorities in interface org.acegisecurity.userdetails.UserDetailsnull)public java.lang.String getClearTextPassword()
getClearTextPassword in interface Customerpublic java.lang.String getCompany()
Customer.
getCompany in interface Customerpublic java.lang.String getConfirmClearTextPassword()
getConfirmClearTextPassword in interface Customerpublic java.util.Date getCreationDate()
getCreationDate in interface Customerpublic CustomerCreditCard getCreditCardByUid(long creditCardUid)
getCreditCardByUid in interface CustomercreditCardUid - 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 Customerpublic CustomerAuthentication getCustomerAuthentication()
getCustomerAuthentication in interface CustomerCustomerAuthenticationpublic java.util.List getCustomerGroups()
CustomerGroups associatied with this customer.
getCustomerGroups in interface Customerpublic CustomerProfile getCustomerProfile()
getCustomerProfile in interface CustomerCustomerProfilepublic java.util.Date getDateOfBirth()
getDateOfBirth in interface Customerpublic java.lang.String getEmail()
Customer.
getEmail in interface Customerpublic java.lang.String getFirstName()
Customer's first name.
getFirstName in interface Customerpublic char getGender()
Customer.
getGender in interface Customerpublic java.util.Date getLastEditDate()
getLastEditDate in interface Customerpublic java.lang.String getLastName()
Customer's last name.
getLastName in interface Customerpublic java.lang.String getPassword()
getPassword in interface CustomergetPassword in interface org.acegisecurity.userdetails.UserDetailspublic java.lang.String getPhoneNumber()
Customer.
getPhoneNumber in interface Customerpublic CustomerAddress getPreferredBillingAddress()
getPreferredBillingAddress in interface Customerpublic java.util.Currency getPreferredCurrency()
getPreferredCurrency in interface CustomerCurrencypublic java.util.Locale getPreferredLocale()
getPreferredLocale in interface CustomerLocalepublic CustomerAddress getPreferredShippingAddress()
getPreferredShippingAddress in interface Customerpublic int getStatus()
Customer.
getStatus in interface Customerpublic java.lang.String getUserId()
Customer.
getUserId in interface Customerpublic java.lang.String getUsername()
null.
getUsername in interface org.acegisecurity.userdetails.UserDetailsnull)public boolean isAccountNonExpired()
isAccountNonExpired in interface org.acegisecurity.userdetails.UserDetailstrue 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.UserDetailstrue if the user is not locked, falseUserRole otherwisepublic boolean isAnonymous()
isAnonymous in interface Customerpublic boolean isCredentialsNonExpired()
isCredentialsNonExpired in interface org.acegisecurity.userdetails.UserDetailstrue 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.UserDetailstrue if the user is enabled, false otherwisepublic boolean isRegistered()
isRegistered in interface Customerpublic boolean isToBeNotified()
isToBeNotified in interface Customer
public void removeAddress(CustomerAddress address)
throws EpDomainException
CustomerAddress from the list of addresses.
removeAddress in interface Customeraddress - 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 CustomercreditCard - 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 CustomercustomerGroup - the customerGroup to remove.public java.lang.String resetPassword()
resetPassword in interface Customer
public void setAddresses(java.util.List addresses)
throws EpDomainException
CustomerAddresses associated with this Customer.
setAddresses in interface Customeraddresses - the new list of addresses.
EpDomainException - if the given List is null.public void setAnonymous(boolean anonymous)
setAnonymous in interface Customeranonymous - - true if the customer is anonymous; otherwise false.public void setClearTextPassword(java.lang.String clearTextPassword)
setClearTextPassword in interface CustomerclearTextPassword - the clear-text password.public void setCompany(java.lang.String company)
Customer.
setCompany in interface Customercompany - the new company.public void setConfirmClearTextPassword(java.lang.String confirmClearTextPassword)
setConfirmClearTextPassword in interface CustomerconfirmClearTextPassword - the user confirmClearTextPassword.public void setCreationDate(java.util.Date creationDate)
setCreationDate in interface CustomercreationDate - customer creation date.public void setCreditCards(java.util.List creditCards)
setCreditCards in interface CustomercreditCards - the credit cards to setpublic void setCustomerAuthentication(CustomerAuthentication customerAuthentication)
setCustomerAuthentication in interface CustomercustomerAuthentication - the CustomerAuthenticationpublic void setCustomerGroups(java.util.List customerGroups)
CustomerGroups associated with this Customer.
setCustomerGroups in interface CustomercustomerGroups - - the list of customerGroups that the current customer is in.public void setCustomerProfile(CustomerProfile customerProfile)
setCustomerProfile in interface CustomercustomerProfile - the CustomerProfilepublic void setDateOfBirth(java.util.Date dateOfBirth)
setDateOfBirth in interface CustomerdateOfBirth - customer's date of birth.public void setDefaultValues()
setDefaultValues in interface PersistencesetDefaultValues in class AbstractEntityImplpublic void setEmail(java.lang.String email)
Customer. Sets the userId as the email if userId is null.
setEmail in interface Customeremail - the new email address.public void setFirstName(java.lang.String firstName)
Customer's first name.
setFirstName in interface CustomerfirstName - the new first name.public void setGender(char gender)
Customer.
setGender in interface Customergender - the customer's gender ('F' for female, or 'M' for male).public void setLastEditDate(java.util.Date lastEditDate)
setLastEditDate in interface CustomerlastEditDate - customer last edit date.public void setLastName(java.lang.String lastName)
Customer's last name.
setLastName in interface CustomerlastName - the new last name.public void setPassword(java.lang.String password)
setPassword in interface Customerpassword - the encrypted password.public void setPhoneNumber(java.lang.String phoneNumber)
Customer.
setPhoneNumber in interface CustomerphoneNumber - the new phone number.public void setPreferredBillingAddress(CustomerAddress address)
setPreferredBillingAddress in interface Customeraddress - the CustomerAddresspublic void setPreferredCreditCard(CustomerCreditCard preferredCreditCard)
setPreferredCreditCard in interface CustomerpreferredCreditCard - the credit card to be used by defaultpublic void setPreferredCurrency(java.util.Currency preferredCurrency)
setPreferredCurrency in interface CustomerpreferredCurrency - the Currencypublic void setPreferredLocale(java.util.Locale preferredLocale)
setPreferredLocale in interface CustomerpreferredLocale - the Localepublic void setPreferredShippingAddress(CustomerAddress address)
setPreferredShippingAddress in interface Customeraddress - the CustomerAddresspublic void setStatus(int status)
Customer.
setStatus in interface Customerstatus - the custome's status.
EpDomainException - if the status is invalid.public void setToBeNotified(boolean toBeNotified)
setToBeNotified in interface CustomertoBeNotified - set to true to indicate that need to be notified of newspublic void setUserId(java.lang.String userId)
Customer.
setUserId in interface CustomeruserId - 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 CustomercreditCard - the credit card that was updated
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||