com.ibm.commerce.foundation.dataload.businessobjectbuilder

Interface BusinessObjectBuilder

  • All Known Implementing Classes:
    AbstractBusinessObjectBuilder, BaseBusinessObjectBuilder, BaseExtractBusinessObjectBuilder, CustomTableObjectBuilder, FeedBusinessObjectBuilder, TableObjectBuilder


    public interface BusinessObjectBuilder
    The business object reader is responsible to populate the logic SDO based on the data read from a data reader. It also calls business object writer to load the logic SDO to the database. The business object loader will call the business object reader 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() - pre-process the data.
      2. execute() - populate the logic SDO and call the business object writer 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.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      The internal copyright field.
    • Method Summary

      All Methods Instance Methods Abstract 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 BusinessObjectReader.
      void init()
      Initialize the business object reader.
      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 pre-processing of the data if needed.
      void setConfigProperties(ConfigProperties aConfigProperties)
      This method sets the ConfigProperties to the BusinessObjectReader.
    • Field Detail

      • COPYRIGHT

        static final java.lang.String COPYRIGHT
        The internal copyright field.
        See Also:
        Constant Field Values
    • Method Detail

      • getConfigProperties

        ConfigProperties getConfigProperties()

        Get the instance of the ConfigProperties of the BusinessObjectReader.

        This method shouldn't be called unless specific properties are needed from the ConfigProperties.

        Returns:
        ConfigProperties The configuration for this business object reader.
      • setConfigProperties

        void setConfigProperties(ConfigProperties aConfigProperties)

        This method sets the ConfigProperties to the BusinessObjectReader.

        This is not needed to be called unless overriding the configuration of the business object reader is desired.

        Parameters:
        aConfigProperties - The configuration for this business object reader.
      • init

        void init()
           throws DataLoadException

        Initialize the business object reader.

        Throws:
        DataLoadException - An application exception will be thrown if there was a problem initializing the business object reader.
      • initConfig

        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.

        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.
      • preProcess

        void preProcess(java.lang.Object inputData)
                 throws DataLoadException

        This method performs any pre-processing of the data if needed.

        This method normally does not have any function. Implement this method only if any pre-processing of the raw data is needed.

        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 pre-processing the input data.
      • execute

        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 writer to process and load the data.

        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

        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.

        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 processing the input data.
      • endProcess

        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.

        Throws:
        DataLoadException - An application exception will be thrown is there was a problem post processing the loaded data.
      • close

        void close()
            throws DataLoadException

        This method will perform cleanup on the business object reader. It will attempt to close all of the business object writers configured for this business object reader.

        Throws:
        DataLoadException - An application exception will be thrown if there was a problem closing the business object reader or its business object writers.