Class ExportLineCodec

java.lang.Object
ai.attackframework.tools.burp.utils.export.ExportLineCodec

public final class ExportLineCodec extends Object
Serializes prepared export documents into line-oriented sink formats.

This codec centralizes the shared JSON serialization rules used by file export and the live OpenSearch bulk path so NDJSON line shape, stable _id metadata, and newline handling stay aligned across sinks.

  • Method Details

    • jsonDocumentLine

      public static String jsonDocumentLine(Map<String,Object> document) throws com.fasterxml.jackson.core.JsonProcessingException
      Returns one JSONL line for the provided document body.
      Parameters:
      document - filtered export document body
      Returns:
      one JSON document line terminated by \n
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - if serialization fails
    • bulkNdjsonLines

      public static List<String> bulkNdjsonLines(PreparedExportDocument document) throws com.fasterxml.jackson.core.JsonProcessingException
      Returns the two bulk NDJSON lines for the provided prepared document.
      Parameters:
      document - prepared export document with stable export ID
      Returns:
      action line then document line, both terminated by \n
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - if serialization fails
    • writeBulkNdjson

      public static void writeBulkNdjson(OutputStream output, PreparedExportDocument document) throws IOException
      Writes one bulk NDJSON action/document pair to the target stream.
      Parameters:
      output - target stream; caller retains ownership
      document - prepared export document with stable export ID
      Throws:
      IOException - if serialization or writing fails