com.ibm.commerce.foundation.dataload.businessobjectmediator

Class AbstractBusinessObjectMediator

  • java.lang.Object
    • com.ibm.commerce.foundation.dataload.businessobjectmediator.AbstractBusinessObjectMediator
    • 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 mediator.
      void execute(java.lang.Object obj)
      It calls the transform() method to transform the logic noun to a list of physical objects.
      ConfigProperties getConfigProperties()
      Returns the instance of the ConfigProperties of the BusinessObjectWriter.
      java.lang.Long getEndKey()
      Returns the end key.
      java.lang.Long getStartKey()
      Returns the start key.
      void init()
      This method performs some initialization for the business object mediator.
      ConfigProperties initConfig(org.w3c.dom.Node businessObjectMediatorNode, ConfigProperties parentConfigProperties)
      This method parses the BusinessObjectMediator xml node read in from the business object configuration file and stores the configuration in memory.
      void postProcess()
      This method performs any post processing of the data after the data has been written to the data store.
      void preProcess(java.lang.Object bod)
      This method performs any pre-processing of the data if needed.
      void setConfigProperties(ConfigProperties aConfigProperties)
      Sets the configuration properties for this business object mediator.
      • Methods inherited from class java.lang.Object

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

      • AbstractBusinessObjectMediator

        public AbstractBusinessObjectMediator()
    • Method Detail

      • getConfigProperties

        public ConfigProperties getConfigProperties()

        Returns the instance of the ConfigProperties of the BusinessObjectWriter.

        Call this method when you need to get specific properties from the configuration properties.

        Specified by:
        getConfigProperties in interface BusinessObjectMediator
        Returns:
        The configuration properties for this business object mediator.
      • getStartKey

        public java.lang.Long getStartKey()

        Returns the start key.

        Returns:
        Long The start key.
      • getEndKey

        public java.lang.Long getEndKey()

        Returns the end key.

        Returns:
        Long The end key.
      • setConfigProperties

        public void setConfigProperties(ConfigProperties aConfigProperties)

        Sets the configuration properties for this business object mediator.

        This method is not normally called unless overriding the configuration properties for this business object mediator is required.

        Specified by:
        setConfigProperties in interface BusinessObjectMediator
        Parameters:
        aConfigProperties - The configuration properties for this business object mediator.
      • initConfig

        public ConfigProperties initConfig(org.w3c.dom.Node businessObjectMediatorNode,
                                           ConfigProperties parentConfigProperties)
                                    throws DataLoadException

        This method parses the BusinessObjectMediator xml node read in from the business object configuration file and stores the configuration in memory.

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

        public void init()
                  throws DataLoadException

        This method performs some initialization for the business object mediator.

        The values for the batch size, commit count, start key, end key as well as a list of data writers will be attained from the data load configuration.

        If any subclasses wish to override this method, then this init() method should be called from the subclass.

        Specified by:
        init in interface BusinessObjectMediator
        Throws:
        DataLoadException - An application exception will be thrown if there was a problem initializing the business object mediator.
      • preProcess

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

        This method performs any pre-processing of the data if needed. This default implementation performs no function.

        The subclass should implement this method only if any pre-processing of the populated data object is needed.

        Specified by:
        preProcess in interface BusinessObjectMediator
        Parameters:
        bod - The data object data load with input data read in from the data reader.
        Throws:
        DataLoadException - An application exception will be thrown is there was a problem pre-processing the data from the data object.
      • execute

        public void execute(java.lang.Object obj)
                     throws DataLoadException
        It calls the transform() method to transform the logic noun to a list of physical objects. It then passes the list of physical objects to the data writer to save them.
        Specified by:
        execute in interface BusinessObjectMediator
        Parameters:
        obj - the business object with the action code
        Throws:
        DataLoadException - if there are some errors calling the transform(), dataWrite.save().
      • postProcess

        public void postProcess()
                         throws DataLoadException

        This method performs any post processing of the data after the data has been written to the data store. This default implementation performs no function.

        Sub classes should implement this method only if any post processing of the data loaded is needed.

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

        public void close()
                   throws DataLoadException

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

        This method will flush and commit any data waiting to be persisted in the batch as well as clear the ID resolver cache.

        Specified by:
        close in interface BusinessObjectMediator
        Throws:
        DataLoadException - An application exception will be thrown if there was a problem closing the business object mediator or its data writers.