Class BulkCaseProcessor


  • public class BulkCaseProcessor
    extends java.lang.Object
    This class assists with iteratively doing some form of work in multiple cases. This class provides call backs which allow calling code to determine what to do when several errors occur such as:
    • Case is locked by another process
    • There is an error opening the case
    • User provided code to process each case has an error
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCaseDirectory​(java.io.File caseDirectory)
      Adds a case directory to be iterated.
      void addCaseDirectory​(java.lang.String caseDirectoryPath)
      Adds a case directory to be iterated.
      void beforeOpeningCase​(java.util.function.Consumer<CaseInfo> callback)
      Optional callback which is called before opening each case.
      boolean getAllowCaseMigration()
      Gets whether Nuix will be allowed to migrate cases as they are opened.
      void onCaseIsLocked​(java.util.function.Consumer<CaseLockedEventInfo> callback)
      Optional callback which is called when a case is found to be locked in another session of Nuix while being opened.
      void onErrorOpeningCase​(java.util.function.Consumer<CaseOpenErrorEvent> callback)
      Optional callback which is called when opening a case has an error.
      void onUserFunctionError​(java.util.function.Consumer<WorkFunctionErrorEvent> callback)
      Optional callback which is called when callback provided to withEachCase(CaseConsumer) or withEachCase(Case, CaseConsumer) throws an exception.
      void setAllowCaseMigration​(boolean allowCaseMigration)
      Sets whether Nuix will be allowed to migrate cases as they are opened.
      void signalAbort()
      Signals that no further processing should be performed after current case.
      void withEachCase​(CaseConsumer caseWorkFunction)
      Begins iterating provided list of cases, passing the following information for each case to the provided callback:
      - The case object
      - Information about the case
      - Current index of the case provided
      - Total number of cases to be iterated
      void withEachCase​(nuix.Case currentCaseFromGui, CaseConsumer caseWorkFunction)
      Begins iterating provided list of cases, passing the following information for each case to the provided callback:
      - The case object
      - Information about the case
      - Current index of the case provided
      - Total number of cases to be iterated
      This method differs from withEachCase(CaseConsumer) in that you provide the currently open case in the GUI (in Ruby this would usually be $current_case).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BulkCaseProcessor

        public BulkCaseProcessor()
    • Method Detail

      • addCaseDirectory

        public void addCaseDirectory​(java.io.File caseDirectory)
        Adds a case directory to be iterated.
        Parameters:
        caseDirectory - An additional case directory to be iterated.
      • addCaseDirectory

        public void addCaseDirectory​(java.lang.String caseDirectoryPath)
        Adds a case directory to be iterated.
        Parameters:
        caseDirectoryPath - An additional case directory to be iterated.
      • signalAbort

        public void signalAbort()
        Signals that no further processing should be performed after current case.
      • withEachCase

        public void withEachCase​(CaseConsumer caseWorkFunction)
        Begins iterating provided list of cases, passing the following information for each case to the provided callback:
        - The case object
        - Information about the case
        - Current index of the case provided
        - Total number of cases to be iterated
        Parameters:
        caseWorkFunction - Callback which does something with each case.
      • withEachCase

        public void withEachCase​(nuix.Case currentCaseFromGui,
                                 CaseConsumer caseWorkFunction)
        Begins iterating provided list of cases, passing the following information for each case to the provided callback:
        - The case object
        - Information about the case
        - Current index of the case provided
        - Total number of cases to be iterated
        This method differs from withEachCase(CaseConsumer) in that you provide the currently open case in the GUI (in Ruby this would usually be $current_case). If the case open in the GUI matches a case from the list of cases to be processed, this method will hand the callback the already open case object rather than trying to open the case a second time, which would result in an error.
        Parameters:
        currentCaseFromGui - Case currently open in the GUI, in Ruby scripts this is usually $current_case
        caseWorkFunction - Callback which does something with each open case.
      • onCaseIsLocked

        public void onCaseIsLocked​(java.util.function.Consumer<CaseLockedEventInfo> callback)
        Optional callback which is called when a case is found to be locked in another session of Nuix while being opened. Callback is provided instance of CaseLockInfo with information about who is locking that case.
        Parameters:
        callback - Callback to handle when a case is locked.
      • onErrorOpeningCase

        public void onErrorOpeningCase​(java.util.function.Consumer<CaseOpenErrorEvent> callback)
        Optional callback which is called when opening a case has an error.
        Parameters:
        callback - Callback to handle when opening a case throws an error.
      • beforeOpeningCase

        public void beforeOpeningCase​(java.util.function.Consumer<CaseInfo> callback)
        Optional callback which is called before opening each case.
        Parameters:
        callback - The callback to invoke before opening each case
      • getAllowCaseMigration

        public boolean getAllowCaseMigration()
        Gets whether Nuix will be allowed to migrate cases as they are opened.
        Returns:
        True if Nuix will be allowed to migrate cases as they are opened.
      • setAllowCaseMigration

        public void setAllowCaseMigration​(boolean allowCaseMigration)
        Sets whether Nuix will be allowed to migrate cases as they are opened.
        Parameters:
        allowCaseMigration - True if Nuix will be allowed to migrate cases as they are opened.