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.void
Clear all transactionvoid
createNarForRejectedFile
(String transactionID) void
Can be called while shutting down Node Manager to de-register all the nodes.void
deregisterNode
(DCNode dcNode) Called by DCNode if it wants to de-register itself with the TransactionManagervoid
endTransaction
(String transactionID) DC will call this method to end the transactiongetFileName
(String transactionId) Get the file namestatic TransactionManager
public 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 transactionvoid
incrementFailureCount
(String transactionID) Increment failure countvoid
incrementRecordsIn
(String transactionID) Increment Records Invoid
incrementRecordsOut
(String transactionID) Increment Records Outvoid
loadTransactions
(String tblFilePath) Load all the transactions from filevoid
moveRecycledRecsFile
(String transactionID) void
Persist all the transaction to filevoid
readTransaction
(String transactionID) Make transaction as completely read by CC.void
registerNode
(DCNode dcNode) Method to be called by DCNode once when it gets started.void
rejectTransaction
(String transactionID, String... transactionStatus) Any node within the chain can call this method to reject (Rollback) the transactionvoid
restartTransaction
(String filePath, String transactionID) void
run()
void
setMaxVisibleTransaction
(String maxVisibleTxn) void
setStatsDir
(String statsDir) Set the statistics directory.void
setSuspendedRecsFile
(String transactionId, String file) Set the Suspended Records Filevoid
setThresholdLimit
(String threshHold) void
writeSuspendedRecords
(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()
-