com.ibm.commerce.foundation.dataload.businessobjectbuilder

Class AbstractBusinessObjectBuilder

  • java.lang.Object
    • com.ibm.commerce.foundation.dataload.businessobjectbuilder.AbstractBusinessObjectBuilder
  • All Implemented Interfaces:
    BusinessObjectBuilder
    Direct Known Subclasses:
    BaseBusinessObjectBuilder, BaseExtractBusinessObjectBuilder, TableObjectBuilder


    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:
    1. init() - initialize the business object reader.
    2. For each record data read from the data source, do the following call
      1. preProcess() - preprocess the data.
      2. execute() - populate the logic SDO and call the business object mediator to load the data.
      3. postProcess() - post process the data.
    3. endProcess() - end of the process of all data.
    4. close() - close the business object reader.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void close()
      This method will perform cleanup on the business object reader.
      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.
      ConfigProperties getConfigProperties()
      Get the instance of the ConfigProperties of the BusinessObjectBuilder.
      void init()
      Initialize 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.
      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.
      void setConfigProperties(ConfigProperties aConfigProperties)
      This method sets the ConfigProperties to the BusinessObjectBuilder.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractBusinessObjectBuilder

        public AbstractBusinessObjectBuilder()
    • Method Detail

      • initConfig

        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.

        Specified by:
        initConfig in interface BusinessObjectBuilder
        Parameters:
        businessObjectBuilderNode - The BusinessObjectBuilder xml node read in from the business object configuration file.
        parentConfigProperties - The configuration properties for the parent data loader of this business object builder.
        Returns:
        ConfigProperties The initialized configuration for this business object builder.
        Throws:
        DataLoadException - An application exception will be thrown if there was a problem initializing the configuration for the business object builder.
      • getConfigProperties

        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.

        Specified by:
        getConfigProperties in interface BusinessObjectBuilder
        Returns:
        ConfigProperties The configuration for this business object reader.
      • setConfigProperties

        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.

        Specified by:
        setConfigProperties in interface BusinessObjectBuilder
        Parameters:
        aConfigProperties - The configuration for this business object reader.
      • preProcess

        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.

        Specified by:
        preProcess in interface BusinessObjectBuilder
        Parameters:
        inputData - The raw data read in by the data reader. (DataReader)
        Throws:
        DataLoadException - An application exception should be thrown is there was a problem preproccessing the input data.
      • execute

        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.

        Specified by:
        execute in interface BusinessObjectBuilder
        Parameters:
        inputData - The input data that the base logical data object will be populated with.
        Returns:
        Object The populated the logical data object.
        Throws:
        DataLoadException - An application exception will be thrown if there was a problem
      • postProcess

        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.

        Specified by:
        postProcess in interface BusinessObjectBuilder
        Parameters:
        dataObject - The data object populated with raw data read in by the data reader. (DataReader)
        Throws:
        DataLoadException - An application exception should be thrown is there was a problem post proccessing the input data.
      • endProcess

        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.

        Specified by:
        endProcess in interface BusinessObjectBuilder
        Throws:
        DataLoadException - An application exception will be thrown is there was a problem post proccessing the loaded data.
      • close

        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.

        Specified by:
        close in interface BusinessObjectBuilder
        Throws:
        DataLoadException - An application exception will be thrown if there was a problem closing the business object reader or its business object mediators.