com.ibm.di.server
Class CSDeltaTaskComponent

java.lang.Object
  extended by com.ibm.di.server.AssemblyLineComponent
      extended by com.ibm.di.server.CSDeltaTaskComponent
All Implemented Interfaces:
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.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class com.ibm.di.server.AssemblyLineComponent
addmap, CHECKPOINT_GETS, config, connConfig, connector, connPool, END_OF_DATA, handler, HOOKS_INVOKED, imap, INITIALIZE, initializeCount, LAST_CONN, LAST_ERROR, log, modmap, name, NUM_ADD, NUM_CALLREPLY, NUM_DELETE, NUM_ERRORS, NUM_GET, NUM_GET_TRIES, NUM_GETCLIENT, NUM_GETCLIENT_TRIES, NUM_IGNORED, NUM_LOOKUP, NUM_MODIFY, NUM_NOCHANGE, NUM_SKIPPED, parent, pooledConnector, reusingConnector, SELECT, stats, SUCCESSFUL
 
Constructor Summary
CSDeltaTaskComponent(AssemblyLine parent, String name, ConnectorConfig config, ConnectorInterface conn, boolean isRestarting)
          Constructor.
CSDeltaTaskComponent(AssemblyLine parent, String name, ConnectorConfig config, ConnectorInterface conn, boolean isRestarting, boolean forceRuntime)
          Constructor.
 
Method Summary
 void commitDeltaState()
          Commit the last transactions in Derby database
 void commitOnEndIter()
          Commit if in commit mode "On end of AL cycle"
static boolean deltaEnabled(ConnectorConfig config)
          Determines whether the delta of the given connector configuration is enable.
 void doConnectorTerminate()
          This method calls the appropriate hooks and the connector's terminate method.
 Entry getnext()
          The method returns the next entry from the connector.
 Entry getnext(Entry work)
          The method returns the next entry from the connector.
 boolean markEntryInDeltaStore(Entry work)
          Marks an Entry in the Delta Store.
 Entry nextDeletedEntry(Entry work)
          Return the next deleted entry.
 void rollbackDeltaState()
          Rollback the last transactions in Derby database
 void saveDeltaState()
          Commit the last transactions in Derby database (alias for commitDeltaState)
 
Methods inherited from class com.ibm.di.server.AssemblyLineComponent
add, callreply, checkInitialize, checkTerminate, clear, close, componentInitialized, containsKey, containsValue, debug, delete, deleteEntry, delta, doConnectorInitialize, dumpEntry, dumpObjects, entrySet, executeOperation, expandParameters, get, getBaseConfiguration, getConfig, getConfiguration, getConnector, getConnectorParam, getCriteria, getCurrent, getDebug, getDuplicateEntryCount, getFirstDuplicateEntry, getHandler, getLastEntry, getLastReadEntry, getLog, getName, getnextClient, getNextDuplicateEntry, getRestartInfoEntry, getSimulatingState, getStats, getType, handleException, handleSuccess, initialize, isCheckpointRestartEnabled, isDeltaMode, isEmpty, isEnabled, isExceptionFatal, keySet, logmsg, lookup, lookup, mapEntry, modify, pushback, put, putAll, reconnect, remove, reply, resetStatus, setConnectorParam, setCriteria, setCriteria, setCurrent, setDebug, setDuplicateEntryCount, setErrorObject, setName, setRestartInfoEntry, setSimulatingState, setSuccessful, size, toString, trigger, trigger, trigger, triggerImpl, update, values, verifySchema, wasConfigurationModified, wasSuccessful, willExecute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

CSDeltaTaskComponent

public CSDeltaTaskComponent(AssemblyLine parent,
                            String name,
                            ConnectorConfig config,
                            ConnectorInterface conn,
                            boolean isRestarting)
                     throws Exception
Constructor.

Parameters:
parent - the parent AssemblyLine
name - the component name
config - the connector configuration
conn - the connector
isRestarting - whether is restarting
Throws:
Exception - if a problem occurs

CSDeltaTaskComponent

public CSDeltaTaskComponent(AssemblyLine parent,
                            String name,
                            ConnectorConfig config,
                            ConnectorInterface conn,
                            boolean isRestarting,
                            boolean forceRuntime)
                     throws Exception
Constructor.

Parameters:
parent - the parent AssemblyLine
name - the component name
config - the connector configuration
conn - the connector
isRestarting - whether is restarting; this parameter is always false;
forceRuntime - whether to use runtime provided connector
Throws:
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

doConnectorTerminate

public void doConnectorTerminate()
                          throws Exception
This method calls the appropriate hooks and the connector's terminate method. The DeltaStore is also closed.

Overrides:
doConnectorTerminate in class AssemblyLineComponent
Throws:
Exception - if a problem occurs

getnext

public Entry getnext()
              throws Exception
The method returns the next entry from the connector.

Overrides:
getnext in class AssemblyLineComponent
Returns:
the work entry filled with the next input entry
Throws:
Exception - if a problem occurs

getnext

public Entry getnext(Entry work)
              throws Exception
The method returns the next entry from the connector. It is called by the 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:
Exception - if a problem occurs

nextDeletedEntry

public Entry nextDeletedEntry(Entry work)
                       throws 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:
Exception - if a problem occurs

commitDeltaState

public void commitDeltaState()
                      throws SQLException
Commit the last transactions in Derby database

Throws:
SQLException - Thrown if an error occurs

rollbackDeltaState

public void rollbackDeltaState()
                        throws SQLException
Rollback the last transactions in Derby database

Throws:
SQLException - Thrown if an error occurs
See Also:
markEntryInDeltaStore(com.ibm.di.entry.Entry)

saveDeltaState

public void saveDeltaState()
                    throws SQLException
Commit the last transactions in Derby database (alias for commitDeltaState)

Throws:
SQLException - Thrown if an error occurs

commitOnEndIter

public void commitOnEndIter()
                     throws SQLException
Commit if in commit mode "On end of AL cycle"

Throws:
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