Package com.ibm.di.fc

Class DeltaFC

  • All Implemented Interfaces:
    FunctionInterface, VersionInfoInterface

    public class DeltaFC
    extends Function
    The Delta Function Component encapsulates the Delta functionality for tracking changes in an input source using underlying database for comparison.

    The main logic of this component is reused by the CSDeltaTaskComponent to maintain the Delta tab functionality for connectors in Iterator mode.

    Since:
    TDI 7.1
    • Field Detail

      • stats

        public TaskStatistics stats
        This is the statistics object for the component
      • PARAM_READ_UNCOMMITTED

        public static final java.lang.String PARAM_READ_UNCOMMITTED
        See Also:
        Constant Field Values
      • PARAM_READ_COMMITTED

        public static final java.lang.String PARAM_READ_COMMITTED
        See Also:
        Constant Field Values
      • PARAM_REPEATABLE_READ

        public static final java.lang.String PARAM_REPEATABLE_READ
        See Also:
        Constant Field Values
      • PARAM_SERIALIZABLE

        public static final java.lang.String PARAM_SERIALIZABLE
        See Also:
        Constant Field Values
      • PARAM_IGNORE_ATTRIBUTES

        public static final java.lang.String PARAM_IGNORE_ATTRIBUTES
        Parameter name. When selected changes in attributes listed in "Attribute List" parameter will be ignored.
        See Also:
        Constant Field Values
      • PARAM_DETECT_ATTRIBUTES

        public static final java.lang.String PARAM_DETECT_ATTRIBUTES
        Parameter name. When selected only changes in attributes listed in "Attribute List" parameter will be detected.
        See Also:
        Constant Field Values
      • PARAM_DETECT_ALL

        public static final java.lang.String PARAM_DETECT_ALL
        Parameter name. When selected change sin all attributes will be selected and "Attribute List" parameter will be disabled.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DeltaFC

        public DeltaFC()
    • Method Detail

      • getResHash

        public static ResourceHash getResHash()
        Used by the script 'deleteDelta' in the tdi.xml for this component.
        Returns:
        The resource object.
      • initialize

        public void initialize​(java.lang.Object obj)
                        throws java.lang.Exception
        Called once to initialize the Delta Function Component.
        Specified by:
        initialize in interface FunctionInterface
        Overrides:
        initialize in class Function
        Parameters:
        obj - ignored
        Throws:
        java.lang.Exception - if an error occurs
      • perform

        public java.lang.Object perform​(java.lang.Object obj)
                                 throws java.lang.Exception
        This method accepts an object of type Entry and computes Delta changes based on the used underlying Delta Store table.
        Parameters:
        obj - Entry object
        Returns:
        Returns Delta tagged Entry
        Throws:
        java.lang.Exception - if the parameter is not an instance of the Entry class, if the FC has not been initialized or if the method fails
      • nextDeletedEntry

        public Entry nextDeletedEntry​(Entry work)
                               throws java.lang.Exception
        Return the next deleted entry.
        Parameters:
        work - the work entry to fill in
        Returns:
        the work entry filled with the next deleted entry
        Throws:
        java.lang.Exception - if a problem occurs
      • markEntryInDeltaStore

        public boolean markEntryInDeltaStore​(Entry work)
        Marks an Entry in the Delta Store. This can be useful if the current change can not be propagated properly, and you want to roll back the delta state. You can then use code like this, assuming this Component is called MyIterator:
         MyComponent.rollbackDeltaState();
         MyComponent.markEntryInDeltaStore(work);
         MyComponent.commitDeltaState();
         
        Parameters:
        work - The Entry that contains the key information
        Returns:
        true if the Entry contained a meaningful key and could be marked in the Delta Store
      • rollbackDeltaState

        public void rollbackDeltaState()
                                throws java.sql.SQLException
        Rollback the last transactions in Derby database
        Throws:
        java.sql.SQLException - Thrown if an error occurs
        See Also:
        markEntryInDeltaStore(Entry)
      • saveDeltaState

        public void saveDeltaState()
                            throws java.sql.SQLException
        Commit the last transactions in Derby database (alias for commitDeltaState)
        Throws:
        java.sql.SQLException - Thrown if an error occurs
      • commitOnEndIter

        public void commitOnEndIter()
                             throws java.sql.SQLException
        Commit if in commit mode "On end of AL cycle"
        Throws:
        java.sql.SQLException - Thrown if an error occurs
      • commitDeltaState

        public void commitDeltaState()
                              throws java.sql.SQLException
        Commit the last transactions in Derby database
        Throws:
        java.sql.SQLException - Thrown if an error occurs
      • closeDelta

        public void closeDelta()
                        throws java.lang.Exception
        Closes connection to the Delta Store.
        Throws:
        java.lang.Exception
      • getStatisticsString

        public java.lang.String getStatisticsString()
        This method is used to report different types of made changes.
        Returns:
        The statistics for this run;
      • getVersion

        public java.lang.String getVersion()
        Version information.
        Returns:
        version information.
      • terminate

        public void terminate()
                       throws java.lang.Exception
        This method closes the internally used Delta Store.
        Specified by:
        terminate in interface FunctionInterface
        Overrides:
        terminate in class Function
        Throws:
        java.lang.Exception - An exception is thrown if this method fails.
      • isReadingDeleted

        public boolean isReadingDeleted()
        Returns true if we are reading deleted entries at the moment