com.elasticpath.domain.customer
Interface Customer

All Superinterfaces:
Entity, EpDomain, Persistence, java.io.Serializable, org.acegisecurity.userdetails.UserDetails
All Known Implementing Classes:
CustomerImpl

public interface Customer
extends Entity, org.acegisecurity.userdetails.UserDetails

A Customer is someone with an account in the system for making orders through the Store Front.


Field Summary
static char GENDER_FEMALE
          The gender - female.
static char GENDER_MALE
          The gender - male.
static char GENDER_NOT_SELECTED
          The gender - not-selected.
static int STATUS_ACTIVE
          The status - Active.
static int STATUS_DISABLED
          The status - Disabled.
static int STATUS_PENDING_APPROVAL
          The status - Pending Approval.
 
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 customertGroups.
 boolean belongsToCustomerGroup(long customerGroupID)
          Return a boolean that indicates whether the customer belongs to customerGroup with the given customerGroupID.
 boolean belongsToCustomerGroup(java.lang.String groupName)
          Return a boolean that indicates whether the customer belongs to customerGroup with the given name.
 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.
 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.
 boolean isAnonymous()
          Gets the flag indicating whether this customer is anonymous or not.
 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 an 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 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 interface com.elasticpath.domain.Entity
getGuid, setGuid
 
Methods inherited from interface com.elasticpath.domain.Persistence
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, setUidPk
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 
Methods inherited from interface org.acegisecurity.userdetails.UserDetails
getAuthorities, getUsername, isAccountNonExpired, isAccountNonLocked, isCredentialsNonExpired, isEnabled
 

Field Detail

GENDER_FEMALE

static final char GENDER_FEMALE
The gender - female.

See Also:
Constant Field Values

GENDER_MALE

static final char GENDER_MALE
The gender - male.

See Also:
Constant Field Values

GENDER_NOT_SELECTED

static final char GENDER_NOT_SELECTED
The gender - not-selected.

See Also:
Constant Field Values

STATUS_ACTIVE

static final int STATUS_ACTIVE
The status - Active.

See Also:
Constant Field Values

STATUS_DISABLED

static final int STATUS_DISABLED
The status - Disabled.

See Also:
Constant Field Values

STATUS_PENDING_APPROVAL

static final int STATUS_PENDING_APPROVAL
The status - Pending Approval.

See Also:
Constant Field Values
Method Detail

addAddress

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

Parameters:
address - the address to add.

addCreditCard

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

Parameters:
creditCard - the credit card to add

addCustomerGroup

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

Parameters:
customerGroup - the customerGroup to add.

belongsToCustomerGroup

boolean belongsToCustomerGroup(long customerGroupID)
Return a boolean that indicates whether the customer belongs to customerGroup with the given customerGroupID.

Parameters:
customerGroupID - - customerGroup ID.
Returns:
true if the customer belongs to a customerGroup with the given customerGroupID; otherwise, false.

belongsToCustomerGroup

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

Parameters:
groupName - - customerGroup name.
Returns:
true if the customer belongs to a customerGroup with the given customerGroup name; otherwise, false.

getAddressByGuid

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.

Parameters:
addressGuid - the guid of the address to be retrieved
Returns:
a CustomerAddress or null if no matching address is found

getAddressByUid

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

Parameters:
addressUid - the uidPk of the address to be retrieved
Returns:
a CustomerAddress or null if no matching address is found

getAddresses

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

Returns:
the list of addresses.

getClearTextPassword

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

Returns:
the clear-text password.

getCompany

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

Returns:
the company.

getConfirmClearTextPassword

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

Returns:
the clear-text confirm password.

getCreationDate

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

Returns:
customer creation date.

getCreditCardByUid

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.

Parameters:
creditCardUid - the uidPk of the credit card to be retrieved
Returns:
an CustomerCreditCard or null if no matching credit card is found

getCreditCards

java.util.List getCreditCards()
Returns:
the customer's credit cards

getCustomerAuthentication

CustomerAuthentication getCustomerAuthentication()
Get the customer authentication.

Returns:
the domain model's CustomerAuthentication

getCustomerGroups

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

Returns:
list of customerGroups.

getCustomerProfile

CustomerProfile getCustomerProfile()
Get the customer profile.

Returns:
the domain model's CustomerProfile

getDateOfBirth

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

Returns:
customer's date of birth.

getEmail

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

Returns:
the email address.

getFirstName

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

Returns:
the first name.

getGender

char getGender()
Gets the gender of this Customer.

Returns:
the customer's gender ('F' for female, or 'M' for male).

getLastEditDate

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

Returns:
customer last edit date.

getLastName

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

Returns:
the last name.

getPassword

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

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

getPhoneNumber

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

Returns:
the phone number.

getPreferredBillingAddress

CustomerAddress getPreferredBillingAddress()
Get the preferred billing address.

Returns:
the preferred shipping address

getPreferredCurrency

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

Returns:
the Currency

getPreferredLocale

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

Returns:
the Locale

getPreferredShippingAddress

CustomerAddress getPreferredShippingAddress()
Get the preferred shipping address.

Returns:
the preferred shipping address

getStatus

int getStatus()
Gets the status of this Customer.

Returns:
the status.

getUserId

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

Returns:
the user identifier.

isAnonymous

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.

Returns:
true if the customer is anonymous; otherwise false.

isRegistered

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.

Returns:
true if the customer is registered; otherwise false.

isToBeNotified

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

Returns:
true if need to be notified, false otherwise

removeAddress

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

Parameters:
address - the address to remove.

removeCreditCard

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

Parameters:
creditCard - the credit card to remove.

removeCustomerGroup

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

Parameters:
customerGroup - the customerGroup to remove.

resetPassword

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

Returns:
the reseted password

setAddresses

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

Parameters:
addresses - the new list of addresses.

setAnonymous

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.

Parameters:
anonymous - - true if the customer is anonymous; otherwise false.

setClearTextPassword

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 password.

Parameters:
clearTextPassword - the clear-text password.

setCompany

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

Parameters:
company - the new company.

setConfirmClearTextPassword

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.

Parameters:
confirmClearTextPassword - the user confirmClearTextPassword.

setCreationDate

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

Parameters:
creationDate - customer creation date.

setCreditCards

void setCreditCards(java.util.List creditCards)
Parameters:
creditCards - the credit cards to set

setCustomerAuthentication

void setCustomerAuthentication(CustomerAuthentication customerAuthentication)
Set the customer authentication.

Parameters:
customerAuthentication - the CustomerAuthentication

setCustomerGroups

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

Parameters:
customerGroups - - the list of customerGroups that the current user is in.

setCustomerProfile

void setCustomerProfile(CustomerProfile customerProfile)
Set the customer profile.

Parameters:
customerProfile - the CustomerProfile

setDateOfBirth

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

Parameters:
dateOfBirth - customer's date of birth.

setEmail

void setEmail(java.lang.String email)
Sets the email address of this Customer.

Parameters:
email - the new email address.

setFirstName

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

Parameters:
firstName - the new first name.

setGender

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

Parameters:
gender - the customer's gender ('F' for female, or 'M' for male).

setLastEditDate

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

Parameters:
lastEditDate - customer last edit date.

setLastName

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

Parameters:
lastName - the new last name.

setPassword

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

Parameters:
password - the encrypted password.

setPhoneNumber

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

Parameters:
phoneNumber - the new phone number.

setPreferredBillingAddress

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

Parameters:
address - the CustomerAddress

setPreferredCreditCard

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

Parameters:
preferredCreditCard - the credit card to be used by default

setPreferredCurrency

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

Parameters:
preferredCurrency - the Currency

setPreferredLocale

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

Parameters:
preferredLocale - the Locale

setPreferredShippingAddress

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

Parameters:
address - the CustomerAddress

setStatus

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

Parameters:
status - the custome's status.

setToBeNotified

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

Parameters:
toBeNotified - set to true to indicate that need to be notified of news

setUserId

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

Parameters:
userId - the new user identifier.

updateCreditCard

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

Parameters:
creditCard - the credit card that was updated