bea Systems, Inc.

theory.smart.ebusiness.customer
Interface Customer


public interface Customer
extends Person

Stores the information required to do business with a customer. It inherits most attributes from the Person object and adds the ability to authenticate and to bill for product via a credit card.

 Primary Key = theory.smart.ebusiness.customer.CustomerPk
 
                  password
 [Customer] <*>------> [String] 

 
                  creditCard (Map)
 [Customer] <*>------> [theory.smart.axiom.contact.CreditCard] 
                     0..*
 

See Also:
CustomerPk, CustomerHome, CustomerImpl, CustomerValue

Method Summary
 boolean authenticate(java.lang.String password)
          Verify that the password specified matches the customers password.
 boolean containsCreditCardKey(java.lang.String key)
          Returns true if the creditCard map contains a creditCard for the specified key.
 boolean containsCreditCardValue(CreditCard creditCard)
          Returns true if the creditCard map maps one or more keys to the specified creditCard.
 CreditCard getCreditCardByKey(java.lang.String key)
          Returns the creditCard to which the creditCard map maps the specified key.
 com.sun.java.util.collections.TreeMap getCreditCards()
          Returns a copy all of the creditCards from the specified map to the creditCard map.
 CustomerValue getCustomerByValue()
          Get all of Customer's attributes.
 int getNumberOfCreditCards()
          Returns the number of key-value mappings in the creditCard map.
 java.lang.String getPassword()
          Get the value of password
 boolean isCreditCardsEmpty()
          Returns true if the creditCard map contains no key-value mappings.
 void putCreditCard(java.lang.String key, CreditCard creditCard)
          Associates the specified creditCard with the specified key in the creditCard map.
 void putCreditCards(com.sun.java.util.collections.TreeMap creditCards)
          Copies all of the creditCards from the specified creditCard map to this creditCard map.
 void removeAllCreditCards()
          Removes all creditCards from this creditCard map.
 CreditCard removeCreditCardByKey(java.lang.String key)
          Removes the creditCard for this key from this creditCard map if present.
 void setCustomerByValue(CustomerValue value)
          Set all of Customer's attributes to the passed in value.
 void setPassword(java.lang.String password)
          Set the value of password
 
Methods inherited from interface theory.smart.axiom.contact.Person
getDob, getFirstName, getLastName, getMaritalStatus, getMiddleName, getMotherMaidenName, getPersonByValue, getSsn, getSuffix, getTitle, setDob, setFirstName, setLastName, setMaritalStatus, setMiddleName, setMotherMaidenName, setPersonByValue, setSsn, setSuffix, setTitle
 
Methods inherited from interface theory.smart.axiom.contact.Stakeholder
addFax, addFax, addFaxes, addFaxes, addFirstFax, addLastFax, containsAddressKey, containsAddressValue, containsEmailKey, containsEmailValue, containsFax, containsPhoneKey, containsPhoneValue, containsUrlKey, containsUrlValue, getAddressByKey, getAddresses, getDescription, getEmailByKey, getEmails, getFax, getFaxes, getFaxes, getFirstFax, getIdentifier, getLastFax, getNamedAddress, getNumberOfAddresses, getNumberOfEmails, getNumberOfFaxes, getNumberOfPhones, getNumberOfUrls, getPhoneByKey, getPhones, getPrimaryAddress, getStakeholderByValue, getUrlByKey, getUrls, indexOfFax, isAddressesEmpty, isEmailsEmpty, isFaxesEmtpy, isPhonesEmpty, isUrlsEmpty, lastIndexOfFax, putAddress, putAddresses, putEmail, putEmails, putPhone, putPhones, putUrl, putUrls, removeAddressByKey, removeAllAddresses, removeAllEmails, removeAllFaxes, removeAllPhones, removeAllUrls, removeEmailByKey, removeFax, removeFax, removeFirstFax, removeLastFax, removePhoneByKey, removeUrlByKey, setDescription, setFax, setPrimaryAddress, setStakeholderByValue
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Method Detail

getCustomerByValue

public CustomerValue getCustomerByValue()
                                 throws java.rmi.RemoteException
Get all of Customer's attributes.
Returns:
CustomerValue the Customer value object

setCustomerByValue

public void setCustomerByValue(CustomerValue value)
                        throws java.rmi.RemoteException
Set all of Customer's attributes to the passed in value. Note: Primary key attributes are not set.
Parameters:
CustomerValue - the Customer value object

getPassword

public java.lang.String getPassword()
                             throws java.rmi.RemoteException
Get the value of password
Returns:
password.

setPassword

public void setPassword(java.lang.String password)
                 throws java.rmi.RemoteException
Set the value of password
Parameters:
passwords - password to be added

containsCreditCardKey

public boolean containsCreditCardKey(java.lang.String key)
                              throws java.rmi.RemoteException
Returns true if the creditCard map contains a creditCard for the specified key.
Parameters:
key - key whose presence in the creditCard map is to be tested.
Returns:
true if the creditCard map contains a creditCard for the specified key.
Throws:
ClassCastException - if the key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the creditCard map uses natural ordering, or its comparator does not tolerate null keys.

containsCreditCardValue

public boolean containsCreditCardValue(CreditCard creditCard)
                                throws java.rmi.RemoteException
Returns true if the creditCard map maps one or more keys to the specified creditCard. This operation will probably require linear time.
Parameters:
creditCard - value of creditCard whose presence in the creditCard map is to be tested.

getCreditCardByKey

public CreditCard getCreditCardByKey(java.lang.String key)
                              throws java.rmi.RemoteException
Returns the creditCard to which the creditCard map maps the specified key. Returns null if the map contains no creditCard for this key. A return value of null does not necessarily indicate that the map contains no creditCard for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.
Parameters:
key - key whose associated creditCard is to be returned.
Returns:
the creditCard to which the creditCard map maps the specified key, or null if the map contains no creditCard for the key.
Throws:
ClassCastException - key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the creditCard map uses natural ordering, or its comparator does not tolerate null keys.
See Also:
#containsKey(Object)

getCreditCards

public com.sun.java.util.collections.TreeMap getCreditCards()
                                                     throws java.rmi.RemoteException
Returns a copy all of the creditCards from the specified map to the creditCard map. These creditCards replace any creditCards that the creditCard map had for any of the keys currently in the specified map.
Parameters:
creditCards - a copy of the creditCards.
Throws:
ClassCastException - class of a key or creditCard in the specified map prevents it from being stored in the creditCard map.
NullPointerException - the creditCard map does not permit null keys and a specified key is null.

getNumberOfCreditCards

public int getNumberOfCreditCards()
                           throws java.rmi.RemoteException
Returns the number of key-value mappings in the creditCard map.
Returns:
the number of key-value mappings in the creditCard map.

isCreditCardsEmpty

public boolean isCreditCardsEmpty()
                           throws java.rmi.RemoteException
Returns true if the creditCard map contains no key-value mappings.

Returns:
true if the creditCard map contains no key-value mappings.

putCreditCard

public void putCreditCard(java.lang.String key,
                          CreditCard creditCard)
                   throws java.rmi.RemoteException
Associates the specified creditCard with the specified key in the creditCard map. If the map previously contained a creditCard for this key, the old creditCard is replaced.
Parameters:
key - key with which the specified creditCard is to be associated.
creditCard - creditCard to be associated with the specified key.
Throws:
ClassCastException - key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the creditCard map uses natural order, or its comparator does not tolerate null keys.

putCreditCards

public void putCreditCards(com.sun.java.util.collections.TreeMap creditCards)
                    throws java.rmi.RemoteException
Copies all of the creditCards from the specified creditCard map to this creditCard map. These creditCards replace any creditCards that this creditCard map had for any of the keys currently in the specified map.
Parameters:
creditCard - CreditCards to be stored in the creditCard map.
Throws:
ClassCastException - class of a key or creditCard in the specified map prevents it from being stored in the creditCard map.
NullPointerException - the creditCard map does not permit null keys and a specified key is null.

removeAllCreditCards

public void removeAllCreditCards()
                          throws java.rmi.RemoteException
Removes all creditCards from this creditCard map.

removeCreditCardByKey

public CreditCard removeCreditCardByKey(java.lang.String key)
                                 throws java.rmi.RemoteException
Removes the creditCard for this key from this creditCard map if present.
Parameters:
key - key with which the specified creditCard is associated.
Returns:
previous creditCard associated with specified key, or null if there was no creditCard for key. A null return can also indicate that the map previously associated null with the specified key.
Throws:
ClassCastException - key cannot be compared with the keys currently in the map.
NullPointerException - key is null and the creditCard map uses natural order, or its comparator does not tolerate null keys.

authenticate

public boolean authenticate(java.lang.String password)
                     throws java.rmi.RemoteException
Verify that the password specified matches the customers password. Returns true if password matches and false otherwise.

bea Systems, Inc.

© Copyright 2000 bea Systems, Inc. All rights reserved.