Class SingleDocOutcomeRecorder

java.lang.Object
ai.attackframework.tools.burp.sinks.SingleDocOutcomeRecorder

public final class SingleDocOutcomeRecorder extends Object
Shared single-document outcome accounting for reporters that push one document at a time.

Complements BulkOutcomeRecorder for callers such as ExporterIndexConfigReporter, ExporterIndexLogForwarder, ExporterIndexStatsReporter, and SettingsIndexReporter, which each push individual documents via OpenSearchClientWrapper.pushDocument and would otherwise duplicate the same recordSuccess/recordFailure/recordLastError triplet on every call site.

When openSearchActive is false, counters are not touched (file-sink accounting is handled elsewhere). Callers are responsible for any panel-only log output; this helper intentionally avoids emitting logs because prefix and wording vary per reporter.

  • Method Details

    • record

      public static void record(String indexKey, boolean ok, boolean openSearchActive, String errorSummary)
      Records one single-document push outcome for indexKey.
      Parameters:
      indexKey - logical index key (for example "exporter", "settings"); must not be null or blank
      ok - true when the push succeeded; false when it failed
      openSearchActive - whether the OpenSearch sink was active for this push; when false the helper returns without touching counters
      errorSummary - short error description stored via ExportStats.recordLastError(String, String) when !ok; blank or null falls back to "Single-document push failed"
      Throws:
      IllegalArgumentException - if indexKey is null or blank