Class TransactionManager
java.lang.Object
java.util.Observable
com.nt.udc.nodemgr.transactionmanager.TransactionManager
- All Implemented Interfaces:
Runnable
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbeginTransaction(String filePath) CC will call this method to begin the transaction for every new file.voidClear all transactionvoidcreateNarForRejectedFile(String transactionID) voidCan be called while shutting down Node Manager to de-register all the nodes.voidderegisterNode(DCNode dcNode) Called by DCNode if it wants to de-register itself with the TransactionManagervoidendTransaction(String transactionID) DC will call this method to end the transactiongetFileName(String transactionId) Get the file namestatic TransactionManagerpublic method to get singleton instance of TransactionManagergetSuspendedRecsFile(String transactionId) Get the Suspended Records FilegetTransaction(String transactionID) A utility method to get the information about the transactionvoidincrementFailureCount(String transactionID) Increment failure countvoidincrementRecordsIn(String transactionID) Increment Records InvoidincrementRecordsOut(String transactionID) Increment Records OutvoidloadTransactions(String tblFilePath) Load all the transactions from filevoidmoveRecycledRecsFile(String transactionID) voidPersist all the transaction to filevoidreadTransaction(String transactionID) Make transaction as completely read by CC.voidregisterNode(DCNode dcNode) Method to be called by DCNode once when it gets started.voidrejectTransaction(String transactionID, String... transactionStatus) Any node within the chain can call this method to reject (Rollback) the transactionvoidrestartTransaction(String filePath, String transactionID) voidrun()voidsetMaxVisibleTransaction(String maxVisibleTxn) voidsetStatsDir(String statsDir) Set the statistics directory.voidsetSuspendedRecsFile(String transactionId, String file) Set the Suspended Records FilevoidsetThresholdLimit(String threshHold) voidwriteSuspendedRecords(DCFieldContainer inputData, String currentTransactionId) Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Field Details
-
osaHome
-
-
Method Details
-
getInstance
public method to get singleton instance of TransactionManager- Returns:
- TransactionManager
-
registerNode
Method to be called by DCNode once when it gets started.- Parameters:
dcNode-
-
deregisterNode
Called by DCNode if it wants to de-register itself with the TransactionManager- Parameters:
dcNode-
-
deregisterAllNodes
public void deregisterAllNodes()Can be called while shutting down Node Manager to de-register all the nodes. -
beginTransaction
CC will call this method to begin the transaction for every new file.- Parameters:
filePath-dcNode-- Returns:
- String
- Throws:
Exception
-
restartTransaction
- Throws:
Exception
-
endTransaction
DC will call this method to end the transaction- Parameters:
transactionID-- Throws:
Exception
-
moveRecycledRecsFile
- Throws:
Exception
-
rejectTransaction
Any node within the chain can call this method to reject (Rollback) the transaction- Parameters:
transactionID-- Throws:
Exception
-
createNarForRejectedFile
-
getTransaction
A utility method to get the information about the transaction- Parameters:
transactionID-- Returns:
- TransactionDefinition
-
getAllTransactions
-
incrementRecordsIn
Increment Records In- Parameters:
transactionID-
-
incrementRecordsOut
Increment Records Out- Parameters:
transactionID-
-
incrementFailureCount
Increment failure count- Parameters:
transactionID-
-
readTransaction
Make transaction as completely read by CC.- Parameters:
transactionID-- Throws:
IOException
-
clearTransactions
public void clearTransactions()Clear all transaction -
loadTransactions
Load all the transactions from file- Parameters:
tblFilePath-- Throws:
IOException
-
persistTransactions
Persist all the transaction to file- Throws:
IOException
-
getFileName
Get the file name- Parameters:
transactionId-- Returns:
-
setSuspendedRecsFile
Set the Suspended Records File- Parameters:
transactionId-file-
-
getSuspendedRecsFile
Get the Suspended Records File- Parameters:
transactionId-- Returns:
-
writeSuspendedRecords
-
setStatsDir
Set the statistics directory.- Parameters:
statsDir-
-
setThresholdLimit
-
setMaxVisibleTransaction
-
run
public void run()
-