Interface User
- All Superinterfaces:
BusinessObject
- All Known Implementing Classes:
UserBean
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 Summary
Modifier and TypeMethodDescriptionRetrieves theAdministratorobject associated with thisUser.Retrieves theCustomerobject associated with thisUser.Returns aMapof any custom objects saved for thisUser.Retrieves aCollectionofStrings representing coupon codes entered by thisUser.Retrieves theLocalein effect for thisUser.getOrder()Retrieves theOrderthisUseris currently placing.voidsetAdministrator(Administrator administrator) Sets theAdministratorobject associated with thisUser.voidsetCustomer(Customer customer) Sets theCustomerobject associated with thisUser.voidsetCustomMap(Map data) Sets theMapof custom objects for thisUser.voidsetEnteredCouponCodes(Collection enteredCouponCodes) Sets theCollectionof coupon codes entered by thisUser.voidSets theLocalein effect for thisUser.voidSets theOrderthisUseris currently placing.Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject
initialize
-
Method Details
-
getLocale
Locale getLocale()Retrieves theLocalein effect for thisUser. Useful to assist with the formatting of currencies and other localizations.- Returns:
- The
Localein effect for thisUser.
-
setLocale
Sets theLocalein effect for thisUser. ThisLocaleis set in the Struts layer directly after aUserobject is created in each user's session. -
getOrder
Order getOrder()Retrieves theOrderthisUseris currently placing. ThisOrderobject 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
OrderthisUseris currently placing.
-
setOrder
Sets theOrderthisUseris currently placing. ThisOrderobject 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- TheOrderthisUseris currently placing.
-
getCustomer
Customer getCustomer()Retrieves theCustomerobject associated with thisUser. When a user logs in as a customer, thisCustomerobject is created to store his or her account settings and other information.- Returns:
- The
Customerobject associated with thisUser, ornull, if the user has not logged in.
-
setCustomer
Sets theCustomerobject associated with thisUser. When a user logs in as a customer, thisCustomerobject is created to store his or her account settings and other information.- Parameters:
customer- TheCustomerobject associated with thisUser.
-
getEnteredCouponCodes
Collection getEnteredCouponCodes()Retrieves aCollectionofStrings representing coupon codes entered by thisUser. 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
CollectionofStrings representing coupon codes entered by thisUser.
-
setEnteredCouponCodes
Sets theCollectionof coupon codes entered by thisUser. When a user enters a valid coupon code, the code gets stored here for later retrieval during discount processing.- Parameters:
enteredCouponCodes- ACollectionofStrings representing coupon codes entered by thisUser.
-
getAdministrator
Administrator getAdministrator()Retrieves theAdministratorobject associated with thisUser. When a user logs in as an administrator, thisAdministratorobject is created to store his or her account settings and other information.- Returns:
- The
Administratorobject associated with thisUser, ornull, if the user has not logged in.
-
setAdministrator
Sets theAdministratorobject associated with thisUser. When a user logs in as an administrator, thisAdministratorobject is created to store his or her account settings and other information.- Parameters:
administrator- TheAdministratorobject associated with thisUser.
-
getCustomMap
Map getCustomMap()Returns aMapof any custom objects saved for thisUser. Custom developers may place objects in the map which need to be stored with the user throughout his session.- Returns:
- A
Mapof custom objects saved for thisUser.
-
setCustomMap
Sets theMapof custom objects for thisUser. Custom developers may place objects in the map which need to be stored with the user throughout his session.- Parameters:
data- AMapof custom objects saved for thisUser
-