com.softslate.commerce.businessobjects.core
Class BaseBusinessObject

java.lang.Object
  extended bycom.softslate.commerce.businessobjects.core.BaseBusinessObject
All Implemented Interfaces:
BusinessObject
Direct Known Subclasses:
AdministratorBean, AttributeBean, BaseBusinessProcessor, BasicTaxRateBean, CategoryBean, CategorySettingBean, CountryBean, CustomerAddressBean, CustomerBean, OptionBean, OrderBean, OrderDeliveryBean, OrderItemAttributeBean, OrderItemBean, PaymentBean, ProductBean, ProductListBean, ProductSettingBean, RoleBean, SettingsBean, ShippingMethodBean, ShippingRateBean, SKUBean, StateBean, StatesAndCountriesBean, UserBean

public abstract class BaseBusinessObject
extends java.lang.Object
implements BusinessObject

Abstract superclass for all objects in the business layer.

Author:
David Tobey

Field Summary
(package private) static org.apache.commons.logging.Log log
           
 
Constructor Summary
BaseBusinessObject()
           
 
Method Summary
 java.lang.String formatDateTime(java.util.Date dateTime)
          Formats a Date object into a string suitable for storage in the database.
 void initialize(java.util.Map transferMap)
          Initializes this business object by copying incoming parameters into its properties.
 java.util.Date parseDateTime(java.lang.String dateTime)
          Formats a Date object into a string suitable for storage in the database.
 java.lang.String prepareRequestData(java.util.Map params, boolean urlEncode)
          Prepares a url-encoded string for use with an HTTP request, given a map of the request's parameters.
 java.lang.String sendHTTPPost(java.lang.String urlString, java.lang.String postData, boolean followRedirect)
          Sends an HTTP request using the POST method to a given URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

static org.apache.commons.logging.Log log
Constructor Detail

BaseBusinessObject

public BaseBusinessObject()
Method Detail

initialize

public void initialize(java.util.Map transferMap)
                throws java.lang.Exception
Description copied from interface: BusinessObject
Initializes this business object by copying incoming parameters into its properties. This method is used by BusinessObjectFactory after object creation.

Specified by:
initialize in interface BusinessObject
Parameters:
transferMap - A Map containing objects such as the application's DAOFactory, SettingsBean,User, and BusinessObjectFactory.
Throws:
java.lang.Exception

formatDateTime

public java.lang.String formatDateTime(java.util.Date dateTime)
Formats a Date object into a string suitable for storage in the database.

Parameters:
dateTime -
Returns:
a String in the form of "yyyy-MM-dd HH:mm:ss:SSS" suitable for storage in the database.

parseDateTime

public java.util.Date parseDateTime(java.lang.String dateTime)
Formats a Date object into a string suitable for storage in the database.

Parameters:
dateTime -
Returns:
a String in the form of "yyyy-MM-dd HH:mm:ss:SSS" suitable for storage in the database.

prepareRequestData

public java.lang.String prepareRequestData(java.util.Map params,
                                           boolean urlEncode)
                                    throws java.lang.Exception
Prepares a url-encoded string for use with an HTTP request, given a map of the request's parameters.

Parameters:
params - A Map of key-value String pairs representing the parameters of the request.
Returns:
A String representing a valid URL-encoded query string.
Throws:
java.lang.Exception

sendHTTPPost

public java.lang.String sendHTTPPost(java.lang.String urlString,
                                     java.lang.String postData,
                                     boolean followRedirect)
                              throws java.lang.Exception
Sends an HTTP request using the POST method to a given URL.

Parameters:
urlString - The URL to send the request to.
postData - A String representing a valid URL-encoded query string.
followRedirect - A boolean indicating whether redirects should be followed.
Returns:
A String representing the server's response, or the Location header if redirects are not to be followed.
Throws:
java.lang.Exception


Copyright © SoftSlate, Inc. 2003–2005