Class CCheckManager

All Implemented Interfaces:
AutoCloseable, Executor, ExecutorService

public class CCheckManager extends ThreadPoolExecutor
This class manages the threads that run consistency checks for the different KBs in the system.
Author:
Karen Joy Nomorosa, Rearden Commerce Inc.
  • Constructor Details

    • CCheckManager

      public CCheckManager()
  • Method Details

    • lastCCheck

      public Timestamp lastCCheck(String kbName)
      Returns the timestamp of when the last consistency check was run on this KB.
      Parameters:
      kbName - - name of the KB
      Returns:
      Timestamp if a consistency check has been run previously, null if it hasn't.
    • ccheckResults

      public String ccheckResults(String kbName)
      This method returns full or partial results of the consistency checks.
      Parameters:
      kbName - - name of the KB that we want the results of
      Returns:
      SimpleElement of the parsed XML file or null if there are errors or it does not exist.
    • ccheckStatus

      public CCheckManager.CCheckStatus ccheckStatus(String kbName)
      Returns the current status of a KB
      Parameters:
      kbName - - the name of the KB to be checked
      Returns:
      true if there is a worker thread currently performing consistency checks on it, and false if not
    • performConsistencyCheck

      public CCheckManager.CCheckStatus performConsistencyCheck(KB kb, String chosenEngine, String systemChosen, String location, String language, int timeout)
      Main code that performs the consistency check on the KB.
      Parameters:
      kb - - KB to be checked
      Returns:
      the status of the check (whether it has been accepted or rejected)
    • afterExecute

      protected void afterExecute(CCheck r, Throwable t)
      Removes the KB from the list of kbs currently being checked, and add it to the checkedKBs list. This method is overridden from the parent class.
      Parameters:
      r -
      t -