public abstract class AbstractBusinessObjectBuilder extends java.lang.Object implements BusinessObjectBuilder
This is an abstract class to implement many default behavior of the BusinessObjectBuilder interface.
The business object loader will call the business object builder in the following sequence:Constructor and Description |
---|
AbstractBusinessObjectBuilder() |
Modifier and Type | Method and Description |
---|---|
void | close()
This method will perform cleanup on the business object reader.
|
protected java.lang.Object | determineDataObjectPropertyValue(com.ibm.commerce.foundation.dataload.config.DataMappingProperties dataMappingProperties, java.util.Map data)
This method determines the value for a data object property.
|
void | endProcess()
This method performs any post processing of the data after all of the data has been loaded.
|
java.lang.Object | execute(java.lang.Object inputData)
This method populate the logical data object with the data read in from the data reader.
|
protected int | getActionCode(java.lang.Object inputData)
Get the action code from the input data object.
|
protected BusinessObjectMediator | getBusinessObjectMediator()
Get the business object mediator associated with this business object builder.
|
ConfigProperties | getConfigProperties()
Get the instance of the ConfigProperties of the BusinessObjectBuilder.
|
protected java.lang.String | getDataLoadMode()
Get the data load mode to be used by the subclasses.
|
protected java.util.List | getDataMappingList()
Get the data mapping list which is available after the init() is called.
|
protected java.lang.Object | getValueFromMap(java.util.Map map, java.lang.String name)
Gets the value from the map
|
protected ValueHandler | getValueHandlerImpl(java.lang.String className)
Gets the value handler class implementation.
|
void | init()
Initialize the business object builder.
|
protected void | initBusinessObjectMediators()
This method initializes the business object mediators configured for the business object builder.
|
ConfigProperties | initConfig(org.w3c.dom.Node businessObjectBuilderNode, ConfigProperties parentConfigProperties)
This method parses the BusinessObjectBuilder xml node read in from the business object configuration file and stores the configuration in memory.
|
protected abstract DataLoadBusinessObject | populateDataLoadBusinessObject(java.lang.Object inputData)
This method populated the base logical data object with the raw data read in from the data reader, based on the data mapping configuration read in from the businesss object configuration file.
|
protected java.util.Map<java.lang.String,java.lang.String> | populateParameterMap(java.util.List<com.ibm.commerce.foundation.dataload.config.ParameterProperties> parameterList, java.util.Map inputData)
Populate parameter map.
|
void | postProcess(java.lang.Object dataObject)
This method performs any post processing of the data.
|
void | preProcess(java.lang.Object inputData)
This method performs any preprocessing of the data if needed.
|
protected void | processData(BusinessObjectMediator businessObjectMediator, DataLoadBusinessObject bod)
This method accepts the populated logical data object and calls the configured business object writer to process the data.
|
protected void | processData(DataLoadBusinessObject bod)
This method accepts the populated logical data object and calls the configured business object writers serially in the list to process the data.
|
protected java.lang.String | processValueHandler(java.lang.String dataValue, com.ibm.commerce.foundation.dataload.config.DataMappingProperties dataMappingProperties, java.lang.Object dataObject, java.util.Map inputData)
It calls the value handler to handle the value if it is defined in the configuration.
|
void | setConfigProperties(ConfigProperties aConfigProperties)
This method sets the ConfigProperties to the BusinessObjectBuilder.
|
public ConfigProperties initConfig(org.w3c.dom.Node businessObjectBuilderNode, ConfigProperties parentConfigProperties) throws DataLoadException
This method parses the BusinessObjectBuilder xml node read in from the business object configuration file and stores the configuration in memory.
public ConfigProperties getConfigProperties()
Get the instance of the ConfigProperties of the BusinessObjectBuilder.
This method shouldn't be called unless specific properties are needed from the ConfigProperties.
public void setConfigProperties(ConfigProperties aConfigProperties)
This method sets the ConfigProperties to the BusinessObjectBuilder.
This is not needed to be called unless overriding the configuration of the business object reader is desired.
public void init() throws DataLoadException
Initialize the business object builder.
public void preProcess(java.lang.Object inputData) throws DataLoadException
This method performs any preprocessing of the data if needed.
This method normally does not have any function. Implement this method only if any preprocessing of the raw data is needed.
public java.lang.Object execute(java.lang.Object inputData) throws DataLoadException
This method populate the logical data object with the data read in from the data reader. Using the data mapping configuration from the business object configuration file, the data will be mapped to a specific property in the logical data object using XPath.
After the logical data object has been populated with data, this method calls the business object mediator to process and load the data.
public void postProcess(java.lang.Object dataObject) throws DataLoadException
This method performs any post processing of the data.
This method normally does not have any function. Implement this method only if any post processing of the populated data object is needed.
public void endProcess() throws DataLoadException
This method performs any post processing of the data after all of the data has been loaded.
This method does not have any function. Child classes must override this method if any post processing of the data is needed.
public void close() throws DataLoadException
This method will perform cleanup on the business object reader. It will attempt to close all of the business object mediators configured for this business object reader.
protected java.lang.String getDataLoadMode()
protected void processData(DataLoadBusinessObject bod) throws DataLoadException
This method accepts the populated logical data object and calls the configured business object writers serially in the list to process the data.
protected void processData(BusinessObjectMediator businessObjectMediator, DataLoadBusinessObject bod) throws DataLoadException
This method accepts the populated logical data object and calls the configured business object writer to process the data.
protected abstract DataLoadBusinessObject populateDataLoadBusinessObject(java.lang.Object inputData) throws DataLoadException
This method populated the base logical data object with the raw data read in from the data reader, based on the data mapping configuration read in from the businesss object configuration file. It can also set the action code in the DataLoadBusinessObject.
protected BusinessObjectMediator getBusinessObjectMediator()
protected void initBusinessObjectMediators() throws DataLoadException
This method initializes the business object mediators configured for the business object builder.
protected java.util.List getDataMappingList()
protected int getActionCode(java.lang.Object inputData)
protected ValueHandler getValueHandlerImpl(java.lang.String className) throws DataLoadException
protected java.util.Map<java.lang.String,java.lang.String> populateParameterMap(java.util.List<com.ibm.commerce.foundation.dataload.config.ParameterProperties> parameterList, java.util.Map inputData)
protected java.lang.Object determineDataObjectPropertyValue(com.ibm.commerce.foundation.dataload.config.DataMappingProperties dataMappingProperties, java.util.Map data) throws DataLoadException
This method determines the value for a data object property.
protected java.lang.Object getValueFromMap(java.util.Map map, java.lang.String name)
protected java.lang.String processValueHandler(java.lang.String dataValue, com.ibm.commerce.foundation.dataload.config.DataMappingProperties dataMappingProperties, java.lang.Object dataObject, java.util.Map inputData) throws DataLoadException