Package com.ibm.di.fc
Class DeltaFC
- java.lang.Object
-
- com.ibm.di.fc.Function
-
- com.ibm.di.fc.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
CSDeltaTaskComponentto maintain the Delta tab functionality for connectors in Iterator mode.- Since:
- TDI 7.1
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPARAM_DETECT_ALLParameter name.static java.lang.StringPARAM_DETECT_ATTRIBUTESParameter name.static java.lang.StringPARAM_IGNORE_ATTRIBUTESParameter name.static java.lang.StringPARAM_READ_COMMITTEDstatic java.lang.StringPARAM_READ_UNCOMMITTEDstatic java.lang.StringPARAM_REPEATABLE_READstatic java.lang.StringPARAM_SERIALIZABLETaskStatisticsstatsThis is the statistics object for the component
-
Constructor Summary
Constructors Constructor Description DeltaFC()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseDelta()Closes connection to the Delta Store.voidcommitDeltaState()Commit the last transactions in Derby databasevoidcommitOnEndIter()Commit if in commit mode "On end of AL cycle"static ResourceHashgetResHash()Used by the script 'deleteDelta' in the tdi.xml for this component.java.lang.StringgetStatisticsString()This method is used to report different types of made changes.java.lang.StringgetVersion()Version information.voidinitialize(java.lang.Object obj)Called once to initialize the Delta Function Component.booleanisReadingDeleted()Returns true if we are reading deleted entries at the momentbooleanmarkEntryInDeltaStore(Entry work)Marks an Entry in the Delta Store.EntrynextDeletedEntry(Entry work)Return the next deleted entry.java.lang.Objectperform(java.lang.Object obj)This method accepts an object of type Entry and computes Delta changes based on the used underlying Delta Store table.voidrollbackDeltaState()Rollback the last transactions in Derby databasevoidsaveDeltaState()Commit the last transactions in Derby database (alias for commitDeltaState)voidterminate()This method closes the internally used Delta Store.-
Methods inherited from class com.ibm.di.fc.Function
debug, getConfiguration, getContext, getDebug, getLog, getParam, getRSInterface, getUI, initialize, logmsg, querySchema, setConfiguration, setContext, setDebug, setLog, setParam, setRSInterface, updateSchema, verifyInitialized
-
-
-
-
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
-
-
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.ExceptionCalled once to initialize the Delta Function Component.- Specified by:
initializein interfaceFunctionInterface- Overrides:
initializein classFunction- Parameters:
obj- ignored- Throws:
java.lang.Exception- if an error occurs
-
perform
public java.lang.Object perform(java.lang.Object obj) throws java.lang.ExceptionThis 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 theEntryclass, 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:
trueif the Entry contained a meaningful key and could be marked in the Delta Store
-
rollbackDeltaState
public void rollbackDeltaState() throws java.sql.SQLExceptionRollback 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.SQLExceptionCommit 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.SQLExceptionCommit 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.SQLExceptionCommit the last transactions in Derby database- Throws:
java.sql.SQLException- Thrown if an error occurs
-
closeDelta
public void closeDelta() throws java.lang.ExceptionCloses 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.ExceptionThis method closes the internally used Delta Store.- Specified by:
terminatein interfaceFunctionInterface- Overrides:
terminatein classFunction- 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
-
-