All Superinterfaces:
BusinessObject
All Known Implementing Classes:
UserBean

public interface User extends BusinessObject
Interface representing an end user accessing the system. In particular, either a customer using the user interface to shop for and purchase products or an administrator configuring the store's administrative settings.

An instance implementing User is created on the first request of a user's session and is stored along with that session for as long as the user continues to access the application. It is stored as a session attribute named "user".

When the application needs to create an instance that implements User, BusinessObjectFactory finds the name of the Java class to instantiate from the "userImplementer" setting in the appComponents.properties file.

The default "userImplementer" is UserBean.

Author:
David Tobey
  • Method Details

    • getLocale

      Locale getLocale()
      Retrieves the Locale in effect for this User. Useful to assist with the formatting of currencies and other localizations.
      Returns:
      The Locale in effect for this User.
    • setLocale

      void setLocale(Locale locale)
      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.
    • getOrder

      Order getOrder()
      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.
      Returns:
      The Order this User is currently placing.
    • setOrder

      void setOrder(Order order)
      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.
      Parameters:
      order - The Order this User is currently placing.
    • getCustomer

      Customer getCustomer()
      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.
      Returns:
      The Customer object associated with this User, or null, if the user has not logged in.
    • setCustomer

      void setCustomer(Customer customer)
      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.
      Parameters:
      customer - The Customer object associated with this User.
    • getEnteredCouponCodes

      Collection getEnteredCouponCodes()
      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.
      Returns:
      A Collection of Strings representing coupon codes entered by this User.
    • setEnteredCouponCodes

      void setEnteredCouponCodes(Collection enteredCouponCodes)
      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.
      Parameters:
      enteredCouponCodes - A Collection of Strings representing coupon codes entered by this User.
    • getAdministrator

      Administrator getAdministrator()
      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.
      Returns:
      The Administrator object associated with this User, or null, if the user has not logged in.
    • setAdministrator

      void setAdministrator(Administrator administrator)
      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.
      Parameters:
      administrator - The Administrator object associated with this User.
    • getCustomMap

      Map getCustomMap()
      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.
      Returns:
      A Map of custom objects saved for this User.
    • setCustomMap

      void setCustomMap(Map data)
      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.
      Parameters:
      data - A Map of custom objects saved for this User