Class TransactionManager

java.lang.Object
java.util.Observable
com.nt.udc.nodemgr.transactionmanager.TransactionManager
All Implemented Interfaces:
Runnable

public class TransactionManager extends Observable implements Runnable
  • Field Details

    • osaHome

      public static String osaHome
  • Method Details

    • getInstance

      public static TransactionManager getInstance()
      public method to get singleton instance of TransactionManager
      Returns:
      TransactionManager
    • registerNode

      public void registerNode(DCNode dcNode)
      Method to be called by DCNode once when it gets started.
      Parameters:
      dcNode -
    • deregisterNode

      public void deregisterNode(DCNode dcNode)
      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

      public String beginTransaction(String filePath) throws Exception
      CC will call this method to begin the transaction for every new file.
      Parameters:
      filePath -
      dcNode -
      Returns:
      String
      Throws:
      Exception
    • restartTransaction

      public void restartTransaction(String filePath, String transactionID) throws Exception
      Throws:
      Exception
    • endTransaction

      public void endTransaction(String transactionID) throws Exception
      DC will call this method to end the transaction
      Parameters:
      transactionID -
      Throws:
      Exception
    • moveRecycledRecsFile

      public void moveRecycledRecsFile(String transactionID) throws Exception
      Throws:
      Exception
    • rejectTransaction

      public void rejectTransaction(String transactionID, String... transactionStatus) throws Exception
      Any node within the chain can call this method to reject (Rollback) the transaction
      Parameters:
      transactionID -
      Throws:
      Exception
    • createNarForRejectedFile

      public void createNarForRejectedFile(String transactionID)
    • getTransaction

      public TransactionDefinition getTransaction(String transactionID)
      A utility method to get the information about the transaction
      Parameters:
      transactionID -
      Returns:
      TransactionDefinition
    • getAllTransactions

      public Collection<TransactionDefinition> getAllTransactions()
    • incrementRecordsIn

      public void incrementRecordsIn(String transactionID)
      Increment Records In
      Parameters:
      transactionID -
    • incrementRecordsOut

      public void incrementRecordsOut(String transactionID)
      Increment Records Out
      Parameters:
      transactionID -
    • incrementFailureCount

      public void incrementFailureCount(String transactionID)
      Increment failure count
      Parameters:
      transactionID -
    • readTransaction

      public void readTransaction(String transactionID) throws IOException
      Make transaction as completely read by CC.
      Parameters:
      transactionID -
      Throws:
      IOException
    • clearTransactions

      public void clearTransactions()
      Clear all transaction
    • loadTransactions

      public void loadTransactions(String tblFilePath) throws IOException
      Load all the transactions from file
      Parameters:
      tblFilePath -
      Throws:
      IOException
    • persistTransactions

      public void persistTransactions() throws IOException
      Persist all the transaction to file
      Throws:
      IOException
    • getFileName

      public String getFileName(String transactionId)
      Get the file name
      Parameters:
      transactionId -
      Returns:
    • setSuspendedRecsFile

      public void setSuspendedRecsFile(String transactionId, String file)
      Set the Suspended Records File
      Parameters:
      transactionId -
      file -
    • getSuspendedRecsFile

      public String getSuspendedRecsFile(String transactionId)
      Get the Suspended Records File
      Parameters:
      transactionId -
      Returns:
    • writeSuspendedRecords

      public void writeSuspendedRecords(DCFieldContainer inputData, String currentTransactionId)
    • setStatsDir

      public void setStatsDir(String statsDir)
      Set the statistics directory.
      Parameters:
      statsDir -
    • setThresholdLimit

      public void setThresholdLimit(String threshHold)
    • setMaxVisibleTransaction

      public void setMaxVisibleTransaction(String maxVisibleTxn)
    • run

      public void run()
      Specified by:
      run in interface Runnable