com.elasticpath.domain.customer.impl
Class CustomerImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.impl.AbstractPersistenceImpl
          extended by com.elasticpath.domain.impl.AbstractEntityImpl
              extended by com.elasticpath.domain.customer.impl.CustomerImpl
All Implemented Interfaces:
Customer, Entity, EpDomain, Persistence, java.io.Serializable, org.acegisecurity.userdetails.UserDetails

public class CustomerImpl
extends AbstractEntityImpl
implements Customer, java.io.Serializable

The default implementation of Customer.

See Also:
Serialized Form

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

ATT_KEY_CP_ANONYMOUS_CUST

public static final java.lang.String ATT_KEY_CP_ANONYMOUS_CUST
System attribute key.

See Also:
Constant Field Values

ATT_KEY_CP_BE_NOTIFIED

public static final java.lang.String ATT_KEY_CP_BE_NOTIFIED
System attribute key.

See Also:
Constant Field Values

ATT_KEY_CP_COMPANY

public static final java.lang.String ATT_KEY_CP_COMPANY
System attribute key.

See Also:
Constant Field Values

ATT_KEY_CP_DOB

public static final java.lang.String ATT_KEY_CP_DOB
System attribute key.

See Also:
Constant Field Values

ATT_KEY_CP_EMAIL

public static final java.lang.String ATT_KEY_CP_EMAIL
System attribute key.

See Also:
Constant Field Values

ATT_KEY_CP_FAX

public static final java.lang.String ATT_KEY_CP_FAX
System attribute key.

See Also:
Constant Field Values

ATT_KEY_CP_FIRST_NAME

public static final java.lang.String ATT_KEY_CP_FIRST_NAME
System attribute key.

See Also:
Constant Field Values

ATT_KEY_CP_GENDER

public static final java.lang.String ATT_KEY_CP_GENDER
System attribute key.

See Also:
Constant Field Values

ATT_KEY_CP_HTML_EMAIL

public static final java.lang.String ATT_KEY_CP_HTML_EMAIL
System attribute key.

See Also:
Constant Field Values

ATT_KEY_CP_LAST_NAME

public static final java.lang.String ATT_KEY_CP_LAST_NAME
System attribute key.

See Also:
Constant Field Values

ATT_KEY_CP_PHONE

public static final java.lang.String ATT_KEY_CP_PHONE
System attribute key.

See Also:
Constant Field Values

ATT_KEY_CP_PREF_CURR

public static final java.lang.String ATT_KEY_CP_PREF_CURR
System attribute key.

See Also:
Constant Field Values

ATT_KEY_CP_PREF_LOCALE

public static final java.lang.String ATT_KEY_CP_PREF_LOCALE
System attribute key.

See Also:
Constant Field Values

serialVersionUID

public static final long serialVersionUID
Serial version id.

See Also:
Constant Field Values
Constructor Detail

CustomerImpl

public CustomerImpl()
The default constructor.

Method Detail

addAddress

public void addAddress(CustomerAddress address)
                throws EpDomainException
Adds an CustomerAddress to the list of addresses.

Specified by:
addAddress in interface Customer
Parameters:
address - the address to add.
Throws:
EpDomainException - if the given CustomerAddress is null.

addCreditCard

public void addCreditCard(CustomerCreditCard creditCard)
                   throws EpDomainException
Add a credit card to this customer.

Specified by:
addCreditCard in interface Customer
Parameters:
creditCard - the credit card to add
Throws:
EpDomainException - if the given CustomerCreditCard is null.

addCustomerGroup

public void addCustomerGroup(CustomerGroup customerGroup)
Adds a CustomerGroup to the list of customerGroups.

Specified by:
addCustomerGroup in interface Customer
Parameters:
customerGroup - the customerGroup to add.

belongsToCustomerGroup

public boolean belongsToCustomerGroup(long customerGroupID)
Returns a boolean indicating whether the customer belongs to a customerGroup with the given customerGroupID.

Specified by:
belongsToCustomerGroup in interface Customer
Parameters:
customerGroupID - - customerGroup ID.
Returns:
true if the customer belongs to a customerGroup with the given customerGroupID; otherwise, false.

belongsToCustomerGroup

public boolean belongsToCustomerGroup(java.lang.String groupName)
Return a boolean indicating whether the customer belongs to a customerGroup with the given name.

Specified by:
belongsToCustomerGroup in interface Customer
Parameters:
groupName - - customerGroup name.
Returns:
true if the customer belongs to a customerGroup with the given customerGroup name; otherwise, false.

executeBeforePersistAction

public void executeBeforePersistAction()
Update the last modified date.

Specified by:
executeBeforePersistAction in interface Persistence
Overrides:
executeBeforePersistAction in class AbstractPersistenceImpl

getAddressByGuid

public CustomerAddress getAddressByGuid(java.lang.String addressGuid)
Returns the customer's address with the matching GUID. If no matching address is found then null is returned.

Specified by:
getAddressByGuid in interface Customer
Parameters:
addressGuid - the guid of the address to be retrieved
Returns:
a CustomerAddress or null if no matching address is found

getAddressByUid

public CustomerAddress getAddressByUid(long addressUid)
Returns the customer's address with the matching UID. If no matchin address is found then null is returned.

Specified by:
getAddressByUid in interface Customer
Parameters:
addressUid - the uidPk of the address to be retrieved
Returns:
an CustomerAddress or null if no matching address is found

getAddresses

public java.util.List getAddresses()
Gets the CustomerAddresses associated with this Customer.

Specified by:
getAddresses in interface Customer
Returns:
the list of addresses.

getAuthorities

public org.acegisecurity.GrantedAuthority[] getAuthorities()
Returns the authorities granted to the user. Cannot return null.

Specified by:
getAuthorities in interface org.acegisecurity.userdetails.UserDetails
Returns:
the authorities (never null)

getClearTextPassword

public java.lang.String getClearTextPassword()
Gets the clear-text password (only available at creation time).

Specified by:
getClearTextPassword in interface Customer
Returns:
the clear-text password.

getCompany

public java.lang.String getCompany()
Gets the company associated with this Customer.

Specified by:
getCompany in interface Customer
Returns:
the company.

getConfirmClearTextPassword

public java.lang.String getConfirmClearTextPassword()
Gets the clear-text confirm password (only available at creation time).

Specified by:
getConfirmClearTextPassword in interface Customer
Returns:
the clear-text confirm password.

getCreationDate

public java.util.Date getCreationDate()
Gets the customer creation date.

Specified by:
getCreationDate in interface Customer
Returns:
customer creation date.

getCreditCardByUid

public CustomerCreditCard getCreditCardByUid(long creditCardUid)
Returns the customer's credit card with the matching UID. If no matching credit card is found then null is returned.

Specified by:
getCreditCardByUid in interface Customer
Parameters:
creditCardUid - the uidPk of the credit card to be retrieved
Returns:
an CustomerCreditCard or null if no matching credit card is found

getCreditCards

public java.util.List getCreditCards()
Specified by:
getCreditCards in interface Customer
Returns:
the credit cards

getCustomerAuthentication

public CustomerAuthentication getCustomerAuthentication()
Get the customer authentication.

Specified by:
getCustomerAuthentication in interface Customer
Returns:
the domain model's CustomerAuthentication

getCustomerGroups

public java.util.List getCustomerGroups()
Get the CustomerGroups associatied with this customer.

Specified by:
getCustomerGroups in interface Customer
Returns:
list of customerGroups.

getCustomerProfile

public CustomerProfile getCustomerProfile()
Get the customer profile.

Specified by:
getCustomerProfile in interface Customer
Returns:
the domain model's CustomerProfile

getDateOfBirth

public java.util.Date getDateOfBirth()
Gets the customer's date of birth.

Specified by:
getDateOfBirth in interface Customer
Returns:
customer's date of birth.

getEmail

public java.lang.String getEmail()
Gets the email address of this Customer.

Specified by:
getEmail in interface Customer
Returns:
the email address.

getFirstName

public java.lang.String getFirstName()
Gets the Customer's first name.

Specified by:
getFirstName in interface Customer
Returns:
the first name.

getGender

public char getGender()
Gets the gender of this Customer.

Specified by:
getGender in interface Customer
Returns:
the customer's gender ('F' for female, or 'M' for male).

getLastEditDate

public java.util.Date getLastEditDate()
Gets the customer last edit date.

Specified by:
getLastEditDate in interface Customer
Returns:
customer last edit date.

getLastName

public java.lang.String getLastName()
Gets the Customer's last name.

Specified by:
getLastName in interface Customer
Returns:
the last name.

getPassword

public java.lang.String getPassword()
Gets the encrypted password.

Specified by:
getPassword in interface Customer
Specified by:
getPassword in interface org.acegisecurity.userdetails.UserDetails
Returns:
the encrypted password.

getPhoneNumber

public java.lang.String getPhoneNumber()
Gets the phone number associated with this Customer.

Specified by:
getPhoneNumber in interface Customer
Returns:
the phone number.

getPreferredBillingAddress

public CustomerAddress getPreferredBillingAddress()
Get the preferred billing address.

Specified by:
getPreferredBillingAddress in interface Customer
Returns:
the preferred billing address

getPreferredCurrency

public java.util.Currency getPreferredCurrency()
Get the preferred currency of the customer corresponding to the shopping cart.

Specified by:
getPreferredCurrency in interface Customer
Returns:
the Currency

getPreferredLocale

public java.util.Locale getPreferredLocale()
Get the preferred locale of the customer corresponding to the shopping cart.

Specified by:
getPreferredLocale in interface Customer
Returns:
the Locale

getPreferredShippingAddress

public CustomerAddress getPreferredShippingAddress()
Get the preferred shipping address.

Specified by:
getPreferredShippingAddress in interface Customer
Returns:
the preferred shipping address

getStatus

public int getStatus()
Gets the status of this Customer.

Specified by:
getStatus in interface Customer
Returns:
the status.

getUserId

public java.lang.String getUserId()
Gets the user identifier for this Customer.

Specified by:
getUserId in interface Customer
Returns:
the user identifier.

getUsername

public java.lang.String getUsername()
Returns the username used to authenticate the user. Cannot return null.

Specified by:
getUsername in interface org.acegisecurity.userdetails.UserDetails
Returns:
the username (never null)

isAccountNonExpired

public boolean isAccountNonExpired()
Indicates whether the user's account has expired. An expired account cannot be authenticated.

Specified by:
isAccountNonExpired in interface org.acegisecurity.userdetails.UserDetails
Returns:
true if the user's account is valid (ie non-expired), false if no longer valid (ie expired)

isAccountNonLocked

public boolean isAccountNonLocked()
Indicates whether the user is locked or unlocked. A locked user cannot be authenticated.

Specified by:
isAccountNonLocked in interface org.acegisecurity.userdetails.UserDetails
Returns:
true if the user is not locked, falseUserRole otherwise

isAnonymous

public boolean isAnonymous()
Gets the flag indicating whether this customer is anonymous or not. Anonymous customers do not have a password and their email address does not need to be unique.

Specified by:
isAnonymous in interface Customer
Returns:
true if the customer is anonymous; otherwise false.

isCredentialsNonExpired

public boolean isCredentialsNonExpired()
Indicates whether the user's credentials (password) has expired. Expired credentials prevent authentication.

Specified by:
isCredentialsNonExpired in interface org.acegisecurity.userdetails.UserDetails
Returns:
true if the user's credentials are valid (ie non-expired), false if no longer valid (ie expired)

isEnabled

public boolean isEnabled()
Indicates whether the user is enabled or disabled. A disabled user cannot be authenticated.

Specified by:
isEnabled in interface org.acegisecurity.userdetails.UserDetails
Returns:
true if the user is enabled, false otherwise

isRegistered

public boolean isRegistered()
Gets the flag indicating whether this customer is a 'real' registered customer or not. Registered customers are not anonymous and have a persisted record in the database.

Specified by:
isRegistered in interface Customer
Returns:
true if the customer is registered; otherwise false.

isToBeNotified

public boolean isToBeNotified()
Indicates whether the user wishes to be notified of news.

Specified by:
isToBeNotified in interface Customer
Returns:
true if need to be notified, false otherwise

removeAddress

public void removeAddress(CustomerAddress address)
                   throws EpDomainException
Removes an CustomerAddress from the list of addresses.

Specified by:
removeAddress in interface Customer
Parameters:
address - the address to remove.
Throws:
EpDomainException - if the given Customer is null.

removeCreditCard

public void removeCreditCard(CustomerCreditCard creditCard)
                      throws EpDomainException
Removes an CustomerCreditCard from the list of credit cards.

Specified by:
removeCreditCard in interface Customer
Parameters:
creditCard - the credit card to remove.
Throws:
EpDomainException - if the given CustomerCreditCard is null.

removeCustomerGroup

public void removeCustomerGroup(CustomerGroup customerGroup)
Removes a CustomerGroup from the list of customerGroups.

Specified by:
removeCustomerGroup in interface Customer
Parameters:
customerGroup - the customerGroup to remove.

resetPassword

public java.lang.String resetPassword()
Reset the customer's password.

Specified by:
resetPassword in interface Customer
Returns:
the reseted password

setAddresses

public void setAddresses(java.util.List addresses)
                  throws EpDomainException
Sets the CustomerAddresses associated with this Customer.

Specified by:
setAddresses in interface Customer
Parameters:
addresses - the new list of addresses.
Throws:
EpDomainException - if the given List is null.

setAnonymous

public void setAnonymous(boolean anonymous)
Sets the anonymous status of the customer. Anonymous customers do not have a password and their email address does not need to be unique.

Specified by:
setAnonymous in interface Customer
Parameters:
anonymous - - true if the customer is anonymous; otherwise false.

setClearTextPassword

public void setClearTextPassword(java.lang.String clearTextPassword)
Sets the clear-text password. The password will be encrypted using a secure hash like MD5 or SHA1 and saved as a password.

Specified by:
setClearTextPassword in interface Customer
Parameters:
clearTextPassword - the clear-text password.

setCompany

public void setCompany(java.lang.String company)
Sets the company associated with this Customer.

Specified by:
setCompany in interface Customer
Parameters:
company - the new company.

setConfirmClearTextPassword

public void setConfirmClearTextPassword(java.lang.String confirmClearTextPassword)
Sets the confirm clear-text password. This is to compare with the ClearTextPassword and make sure they are the same.

Specified by:
setConfirmClearTextPassword in interface Customer
Parameters:
confirmClearTextPassword - the user confirmClearTextPassword.

setCreationDate

public void setCreationDate(java.util.Date creationDate)
Sets the customer creation date.

Specified by:
setCreationDate in interface Customer
Parameters:
creationDate - customer creation date.

setCreditCards

public void setCreditCards(java.util.List creditCards)
Specified by:
setCreditCards in interface Customer
Parameters:
creditCards - the credit cards to set

setCustomerAuthentication

public void setCustomerAuthentication(CustomerAuthentication customerAuthentication)
Set the customer authentication.

Specified by:
setCustomerAuthentication in interface Customer
Parameters:
customerAuthentication - the CustomerAuthentication

setCustomerGroups

public void setCustomerGroups(java.util.List customerGroups)
Sets the CustomerGroups associated with this Customer.

Specified by:
setCustomerGroups in interface Customer
Parameters:
customerGroups - - the list of customerGroups that the current customer is in.

setCustomerProfile

public void setCustomerProfile(CustomerProfile customerProfile)
Set the customer profile.

Specified by:
setCustomerProfile in interface Customer
Parameters:
customerProfile - the CustomerProfile

setDateOfBirth

public void setDateOfBirth(java.util.Date dateOfBirth)
Sets the customer's date of birth.

Specified by:
setDateOfBirth in interface Customer
Parameters:
dateOfBirth - customer's date of birth.

setDefaultValues

public void setDefaultValues()
Set default values for those fields need default values.

Specified by:
setDefaultValues in interface Persistence
Overrides:
setDefaultValues in class AbstractEntityImpl

setEmail

public void setEmail(java.lang.String email)
Sets the email address of this Customer. Sets the userId as the email if userId is null.

Specified by:
setEmail in interface Customer
Parameters:
email - the new email address.

setFirstName

public void setFirstName(java.lang.String firstName)
Sets the Customer's first name.

Specified by:
setFirstName in interface Customer
Parameters:
firstName - the new first name.

setGender

public void setGender(char gender)
Sets the gender of this Customer.

Specified by:
setGender in interface Customer
Parameters:
gender - the customer's gender ('F' for female, or 'M' for male).

setLastEditDate

public void setLastEditDate(java.util.Date lastEditDate)
Sets the customer last edit date.

Specified by:
setLastEditDate in interface Customer
Parameters:
lastEditDate - customer last edit date.

setLastName

public void setLastName(java.lang.String lastName)
Sets the Customer's last name.

Specified by:
setLastName in interface Customer
Parameters:
lastName - the new last name.

setPassword

public void setPassword(java.lang.String password)
Sets the encrypted password. By default, the clear-text customer input password will be encrypted using the SHA1 secure hash algorithm

Specified by:
setPassword in interface Customer
Parameters:
password - the encrypted password.

setPhoneNumber

public void setPhoneNumber(java.lang.String phoneNumber)
Sets the phone number associated with this Customer.

Specified by:
setPhoneNumber in interface Customer
Parameters:
phoneNumber - the new phone number.

setPreferredBillingAddress

public void setPreferredBillingAddress(CustomerAddress address)
Set the preferred billing address.

Specified by:
setPreferredBillingAddress in interface Customer
Parameters:
address - the CustomerAddress

setPreferredCreditCard

public void setPreferredCreditCard(CustomerCreditCard preferredCreditCard)
Sets the customer's default (preferred) credit card.

Specified by:
setPreferredCreditCard in interface Customer
Parameters:
preferredCreditCard - the credit card to be used by default

setPreferredCurrency

public void setPreferredCurrency(java.util.Currency preferredCurrency)
Set the preferred currency of the customer corresponding to the shopping cart.

Specified by:
setPreferredCurrency in interface Customer
Parameters:
preferredCurrency - the Currency

setPreferredLocale

public void setPreferredLocale(java.util.Locale preferredLocale)
Set the preferred locale of the customer corresponding to the shopping cart.

Specified by:
setPreferredLocale in interface Customer
Parameters:
preferredLocale - the Locale

setPreferredShippingAddress

public void setPreferredShippingAddress(CustomerAddress address)
Set the preferred shipping address.

Specified by:
setPreferredShippingAddress in interface Customer
Parameters:
address - the CustomerAddress

setStatus

public void setStatus(int status)
Sets the status of this Customer.

Specified by:
setStatus in interface Customer
Parameters:
status - the custome's status.
Throws:
EpDomainException - if the status is invalid.

setToBeNotified

public void setToBeNotified(boolean toBeNotified)
Set whether the user wishes to be notified of news.

Specified by:
setToBeNotified in interface Customer
Parameters:
toBeNotified - set to true to indicate that need to be notified of news

setUserId

public void setUserId(java.lang.String userId)
Sets the user identifier for this Customer.

Specified by:
setUserId in interface Customer
Parameters:
userId - the new user identifier.
Throws:
EpDomainException - if the given identifier is null.

updateCreditCard

public void updateCreditCard(CustomerCreditCard creditCard)
Notifies a Customer that a credit card has been updated (The credit card default flags will be set accordingly).

Specified by:
updateCreditCard in interface Customer
Parameters:
creditCard - the credit card that was updated