com.ibm.commerce.foundation.dataload.businessobjectbuilder

Class FeedBusinessObjectBuilder

  • All Implemented Interfaces:
    BusinessObjectBuilder


    public class FeedBusinessObjectBuilder
    extends BaseBusinessObjectBuilder
    This class extends the BaseBusinessObjectBuilder and overrides the preProcess, postProcess and endProcess methods, to handle errors that could occur while processing the web feeds.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void endProcess()
      This method performs post processing of the data after all of the entries in a feed have been processed.
      void init()
      Initialize the feed business object builder to obtain Load item report from dataload.
      void postProcess(java.lang.Object dataObject)
      This method performs post processing of the data.
      void preProcess(java.lang.Object inputData)
      This method performs pre-processing of the input data .
      • Methods inherited from class java.lang.Object

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

      • FeedBusinessObjectBuilder

        public FeedBusinessObjectBuilder()
    • Method Detail

      • preProcess

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

        This method performs pre-processing of the input data .

        This method fetches the feed identifier from the input data and stores it in the instance variable, so it can be retrieved later.

        Specified by:
        preProcess in interface BusinessObjectBuilder
        Overrides:
        preProcess in class AbstractBusinessObjectBuilder
        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.
      • postProcess

        public void postProcess(java.lang.Object dataObject)
                         throws DataLoadException

        This method performs post processing of the data.

        This method updates the CMFEEDLOG table (which keeps track of the feed records processed) with the status of the feed load. The subsequent attempts to process feeds read the status from CMFEEDLOG to find out if the feed needs to be re-processed (in case of failures).

        Specified by:
        postProcess in interface BusinessObjectBuilder
        Overrides:
        postProcess in class AbstractBusinessObjectBuilder
        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

        public void endProcess()
                        throws DataLoadException

        This method performs post processing of the data after all of the entries in a feed have been processed.

        This method updates the feed URL cache, if the entire feed load was successful. Once, a feed URL in the cache is marked as processed, the next time the feed retriever is run, the feed is fetched only if there has been any update to the feed.

        Specified by:
        endProcess in interface BusinessObjectBuilder
        Overrides:
        endProcess in class AbstractBusinessObjectBuilder
        Throws:
        DataLoadException - An application exception will be thrown is there was a problem post processing the loaded data.