Class CSDeltaTaskComponent

  • All Implemented Interfaces:
    java.util.Map

    public class CSDeltaTaskComponent
    extends AssemblyLineComponent
    This class represents a component extending the functionality of the AssemblyLineComponent. It uses the Delta FC logic to commit and rollback transactions to database.
    • Constructor Detail

      • CSDeltaTaskComponent

        public CSDeltaTaskComponent​(AssemblyLine parent,
                                    java.lang.String name,
                                    ConnectorConfig config,
                                    ConnectorInterface conn,
                                    boolean isRestarting)
                             throws java.lang.Exception
        Constructor.
        Parameters:
        parent - the parent AssemblyLine
        name - the component name
        config - the connector configuration
        conn - the connector
        isRestarting - ignored
        Throws:
        java.lang.Exception - if a problem occurs
      • CSDeltaTaskComponent

        public CSDeltaTaskComponent​(AssemblyLine parent,
                                    java.lang.String name,
                                    ConnectorConfig config,
                                    ConnectorInterface conn,
                                    boolean isRestarting,
                                    boolean forceRuntime)
                             throws java.lang.Exception
        Constructor.
        Parameters:
        parent - the parent AssemblyLine
        name - the component name
        config - the connector configuration
        conn - the connector
        isRestarting - ignored
        forceRuntime - whether to use runtime provided connector
        Throws:
        java.lang.Exception - if a problem occurs
    • Method Detail

      • deltaEnabled

        public static boolean deltaEnabled​(ConnectorConfig config)
        Determines whether the delta of the given connector configuration is enable.
        Parameters:
        config - a connector configuration
        Returns:
        true if it is enabled, otherwise false
      • doConnectorInitialize

        public void doConnectorInitialize()
                                   throws java.lang.Exception
        Description copied from class: AssemblyLineComponent
        This method calls the appropriate hooks and the connector's initialize method.
        Overrides:
        doConnectorInitialize in class AssemblyLineComponent
        Throws:
        java.lang.Exception - if the connector's initialization fails or an error in one of the executed hooks occurred.
      • doConnectorTerminate

        public void doConnectorTerminate()
                                  throws java.lang.Exception
        This method calls the appropriate hooks and the connector's terminate method. The DeltaStore is also closed.
        Overrides:
        doConnectorTerminate in class AssemblyLineComponent
        Throws:
        java.lang.Exception - if a problem occurs
      • getnext

        public Entry getnext​(Entry work)
                      throws java.lang.Exception
        The method returns the next entry from the connector. It is called by the AssemblyLineComponent.getnext() method if we are working in Iterator mode.
        Overrides:
        getnext in class AssemblyLineComponent
        Parameters:
        work - the work entry to fill in
        Returns:
        the work entry filled with the next input entry
        Throws:
        java.lang.Exception - if a problem occurs
      • 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 input entry
        Throws:
        java.lang.Exception - if a problem 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
      • rollbackDeltaState

        public void rollbackDeltaState()
                                throws java.sql.SQLException
        Rollback the last transactions in Derby database. The operation will NOT be executed if at the moment the Delta Store is iterating deleted entries.
        Throws:
        java.sql.SQLException - Thrown if an error occurs
        See Also:
        markEntryInDeltaStore(com.ibm.di.entry.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
      • 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:
         MyIterator.rollbackDeltaState();
         MyIterator.markEntryInDeltaStore(work);
         MyIterator.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