Class RuntimeConfig

java.lang.Object
ai.attackframework.tools.burp.utils.config.RuntimeConfig

public final class RuntimeConfig extends Object
Holds the current runtime configuration for export pipelines.

UI actions update this state, and runtime exporters read from it. The export-running flag gates whether traffic (and future sources) are actually sent to sinks; Start/Stop in the UI toggle this without changing saved config.

  • Method Details

    • getState

      public static ConfigState.State getState()
      Returns the current runtime config state.
    • isExportRunning

      public static boolean isExportRunning()
      Returns whether export is currently running (Start pressed).

      When false, traffic and other exporters do not send data to sinks.

      Returns:
      true if export has been started and not stopped
    • isExportReady

      public static boolean isExportReady()
      Returns whether export is fully active and allowed to emit runtime documents.

      This stays false during Start/bootstrap work so background listeners do not begin pushing traffic or tool-log documents before OpenSearch preflight and index bootstrap have succeeded.

    • setExportRunning

      public static void setExportRunning(boolean running)
      Sets the export-running flag.

      Start button sets true; Stop button sets false.

      Parameters:
      running - new running state
    • setExportStarting

      public static void setExportStarting(boolean starting)
      Sets whether export startup/bootstrap is still in progress.

      When true, the UI may show a running state while runtime exporters remain gated until startup succeeds.

    • updateState

      public static void updateState(ConfigState.State newState)
      Updates the runtime config state with a normalized, non-null value.
    • disableOpenSearchDestination

      public static boolean disableOpenSearchDestination()
      Disables only the OpenSearch destination in the current runtime state.

      This is used for runtime shutdown of a failing destination while allowing any configured file export destination to continue. Later UI changes can intentionally re-enable OpenSearch by pushing a fresh runtime state from the current form values.

      Returns:
      true when OpenSearch was enabled and is now disabled; false otherwise
    • registerStateListener

      public static void registerStateListener(RuntimeConfig.StateListener listener)
      Registers a listener for runtime-state changes and immediately replays the current state.
    • unregisterStateListener

      public static void unregisterStateListener(RuntimeConfig.StateListener listener)
      Removes a previously registered runtime-state listener.
    • isOpenSearchExportEnabled

      public static boolean isOpenSearchExportEnabled()
      True when OpenSearch export is enabled and a non-blank runtime URL is available.
    • isOpenSearchTrafficEnabled

      public static boolean isOpenSearchTrafficEnabled()
      True when OpenSearch export is enabled for the traffic source and at least one tool type is selected.
    • isAnySinkEnabled

      public static boolean isAnySinkEnabled()
      True when any export sink is enabled and sufficiently configured to accept documents.
    • activeSinkSummary

      public static String activeSinkSummary()
      Returns a human-readable summary of the currently enabled export destinations.

      The result is intended for UI and log messages such as start/stop status updates. It reflects the current runtime sink selection and returns "no destinations" when neither Files nor OpenSearch is enabled.

      Returns:
      destination summary suitable for operator-facing status text
    • isAnyTrafficExportEnabled

      public static boolean isAnyTrafficExportEnabled()
      True when traffic export has at least one destination sink enabled.
    • openSearchUrl

      public static String openSearchUrl()
      Current OpenSearch URL for runtime exports; blank when OpenSearch export is disabled.
    • openSearchUser

      public static String openSearchUser()
      Optional OpenSearch username for basic auth (empty = no auth).
    • openSearchPassword

      public static String openSearchPassword()
      Optional OpenSearch password for basic auth (empty = no auth).
    • openSearchTlsMode

      public static String openSearchTlsMode()
      Current OpenSearch TLS mode.
    • uiPreferences

      public static ConfigState.UiPreferences uiPreferences()
      Returns the persisted UI preferences currently attached to runtime config.
    • statsChartStyle

      public static int statsChartStyle()
      Returns the configured StatsPanel chart style in the range 1-3.
    • logPanelPreferences

      public static ConfigState.LogPanelPreferences logPanelPreferences()
      Returns the configured LogPanel preferences.
    • updateStatsChartStyle

      public static void updateStatsChartStyle(int chartStyle)
      Updates only the persisted StatsPanel chart style while preserving all other runtime config.
    • updateLogPanelPreferences

      public static void updateLogPanelPreferences(ConfigState.LogPanelPreferences logPanelPreferences)
      Updates only the persisted LogPanel preferences while preserving all other runtime config.
    • getAllowedExportKeys

      public static Set<String> getAllowedExportKeys(String indexShortName)
      Returns the set of top-level field keys allowed for export for the given index. Used for document filtering (which fields to include in pushed documents). When no field selection is saved, returns required + all toggleable fields.
    • isAnyFileExportEnabled

      public static boolean isAnyFileExportEnabled()
      Returns whether any runtime file export format is enabled and a root path is set.
    • isFileJsonlEnabled

      public static boolean isFileJsonlEnabled()
      Returns whether document-only JSONL export is enabled.
    • isFileBulkNdjsonEnabled

      public static boolean isFileBulkNdjsonEnabled()
      Returns whether bulk-compatible NDJSON export is enabled.
    • fileExportRoot

      public static String fileExportRoot()
      Returns the configured file export root, or blank when unset.
    • isFileTotalCapEnabled

      public static boolean isFileTotalCapEnabled()
      True when the total exporter-file cap is enabled.
    • fileTotalCapBytes

      public static long fileTotalCapBytes()
      Configured total cap across exporter files under the selected root.
    • isFileDiskUsagePercentEnabled

      public static boolean isFileDiskUsagePercentEnabled()
      True when the optional destination-volume used-percent threshold is enabled.
    • fileDiskUsagePercent

      public static int fileDiskUsagePercent()
      Configured destination-volume used-percent threshold for file export.