com.softslate.commerce.businessobjects.core
Class UserBean

java.lang.Object
  extended by com.softslate.commerce.businessobjects.core.BaseBusinessObject
      extended by com.softslate.commerce.businessobjects.core.UserBean
All Implemented Interfaces:
BusinessObject, User, java.io.Serializable

public class UserBean
extends BaseBusinessObject
implements User, java.io.Serializable

Represents an end user accessing the system. UserBean is the default implementation of the User interface for the application.

Author:
David Tobey
See Also:
User, Serialized Form

Field Summary
private  Administrator administrator
           
private  Customer customer
           
private  java.util.Map customMap
           
private  java.util.Map dynamicShippingOptions
           
private  java.util.Collection enteredCouponCodes
           
private  java.util.Locale locale
           
(package private) static org.apache.commons.logging.Log log
           
private  Order order
           
private static long serialVersionUID
           
 
Constructor Summary
UserBean()
           
 
Method Summary
 Administrator getAdministrator()
          Retrieves the Administrator object associated with this User.
 Customer getCustomer()
          Retrieves the Customer object associated with this User.
 java.util.Map getCustomMap()
          Returns a Map of any custom objects saved for this User.
 java.util.Map getDynamicShippingOptions()
          Returns the Map of dynamically generated shipping options saved for this User.
 java.util.Collection getEnteredCouponCodes()
          Retrieves a Collection of Strings representing coupon codes entered by this User.
 java.util.Locale getLocale()
          Retrieves the Locale in effect for this User.
 Order getOrder()
          Retrieves the Order this User is currently placing.
 void setAdministrator(Administrator administrator)
          Sets the Administrator object associated with this User.
 void setCustomer(Customer customer)
          Sets the Customer object associated with this User.
 void setCustomMap(java.util.Map customMap)
          Sets the Map of custom objects for this User.
 void setDynamicShippingOptions(java.util.Map dynamicShippingOptions)
          Sets the Map of dynamically generated shipping options presented to this User.
 void setEnteredCouponCodes(java.util.Collection enteredCouponCodes)
          Sets the Collection of coupon codes entered by this User.
 void setLocale(java.util.Locale locale)
          Sets the Locale in effect for this User.
 void setOrder(Order order)
          Sets the Order this User is currently placing.
 
Methods inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessObject
initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject
initialize
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

log

static org.apache.commons.logging.Log log

locale

private java.util.Locale locale
See Also:
getLocale()

order

private Order order
See Also:
getOrder()

customer

private Customer customer
See Also:
getCustomer()

enteredCouponCodes

private java.util.Collection enteredCouponCodes
See Also:
getEnteredCouponCodes()

administrator

private Administrator administrator
See Also:
getAdministrator()

customMap

private java.util.Map customMap
See Also:
getCustomMap()

dynamicShippingOptions

private java.util.Map dynamicShippingOptions
See Also:
getDynamicShippingOptions()
Constructor Detail

UserBean

public UserBean()
Method Detail

getLocale

public java.util.Locale getLocale()
Description copied from interface: User
Retrieves the Locale in effect for this User. Useful to assist with the formatting of currencies and other localizations.

Specified by:
getLocale in interface User
Returns:
The Locale in effect for this User.

setLocale

public void setLocale(java.util.Locale locale)
Description copied from interface: User
Sets the Locale in effect for this User. This Locale is set in the Struts layer directly after a User object is created in each user's session.

Specified by:
setLocale in interface User

getOrder

public Order getOrder()
Description copied from interface: User
Retrieves the Order this User is currently placing. This Order object is created when the user adds the first item to his or her cart. It is destroyed either when the user completes the order, or when his or her session ends.

Specified by:
getOrder in interface User
Returns:
The Order this User is currently placing.

setOrder

public void setOrder(Order order)
Description copied from interface: User
Sets the Order this User is currently placing. This Order object is created when the user adds the first item to his or her cart. It is destroyed either when the user completes the order, or when his or her session ends.

Specified by:
setOrder in interface User
Parameters:
order - The Order this User is currently placing.

getCustomer

public Customer getCustomer()
Description copied from interface: User
Retrieves the Customer object associated with this User. When a user logs in as a customer, this Customer object is created to store his or her account settings and other information.

Specified by:
getCustomer in interface User
Returns:
The Customer object associated with this User, or null, if the user has not logged in.

setCustomer

public void setCustomer(Customer customer)
Description copied from interface: User
Sets the Customer object associated with this User. When a user logs in as a customer, this Customer object is created to store his or her account settings and other information.

Specified by:
setCustomer in interface User
Parameters:
customer - The Customer object associated with this User.

getEnteredCouponCodes

public java.util.Collection getEnteredCouponCodes()
Description copied from interface: User
Retrieves a Collection of Strings representing coupon codes entered by this User. When a user enters a coupon code at any point in the session, the code gets stored here for retrieval during discount processing.

Specified by:
getEnteredCouponCodes in interface User
Returns:
A Collection of Strings representing coupon codes entered by this User.

setEnteredCouponCodes

public void setEnteredCouponCodes(java.util.Collection enteredCouponCodes)
Description copied from interface: User
Sets the Collection of coupon codes entered by this User. When a user enters a valid coupon code, the code gets stored here for later retrieval during discount processing.

Specified by:
setEnteredCouponCodes in interface User
Parameters:
enteredCouponCodes - A Collection of Strings representing coupon codes entered by this User.

getAdministrator

public Administrator getAdministrator()
Description copied from interface: User
Retrieves the Administrator object associated with this User. When a user logs in as an administrator, this Administrator object is created to store his or her account settings and other information.

Specified by:
getAdministrator in interface User
Returns:
The Administrator object associated with this User, or null, if the user has not logged in.

setAdministrator

public void setAdministrator(Administrator administrator)
Description copied from interface: User
Sets the Administrator object associated with this User. When a user logs in as an administrator, this Administrator object is created to store his or her account settings and other information.

Specified by:
setAdministrator in interface User
Parameters:
administrator - The Administrator object associated with this User.

getCustomMap

public java.util.Map getCustomMap()
Description copied from interface: User
Returns a Map of any custom objects saved for this User. Custom developers may place objects in the map which need to be stored with the user throughout his session.

Specified by:
getCustomMap in interface User
Returns:
A Map of custom objects saved for this User.

setCustomMap

public void setCustomMap(java.util.Map customMap)
Description copied from interface: User
Sets the Map of custom objects for this User. Custom developers may place objects in the map which need to be stored with the user throughout his session.

Specified by:
setCustomMap in interface User
Parameters:
customMap - A Map of custom objects saved for this User

getDynamicShippingOptions

public java.util.Map getDynamicShippingOptions()
Description copied from interface: User
Returns the Map of dynamically generated shipping options saved for this User. They are stored here in order to preserve them between http requests.

Specified by:
getDynamicShippingOptions in interface User
Returns:
A Map of DynamicShippingOptions. The keys are the optionId Strings. One of these should match the value returned by BaseShippingProcessor.getSelectedOption().
See Also:
DynamicShippingOption

setDynamicShippingOptions

public void setDynamicShippingOptions(java.util.Map dynamicShippingOptions)
Description copied from interface: User
Sets the Map of dynamically generated shipping options presented to this User.

Specified by:
setDynamicShippingOptions in interface User
Parameters:
dynamicShippingOptions - A Map of DynamicShippingOptions representing shipping choices available to this User. The keys are the optionId Strings. One of these should match the value returned by BaseShippingProcessor.getSelectedOption().
See Also:
DynamicShippingOption


Copyright ? SoftSlate, LLC 2003?2005