Class ExportLineCodec
java.lang.Object
ai.attackframework.tools.burp.utils.export.ExportLineCodec
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 Summary
Modifier and TypeMethodDescriptionbulkNdjsonLines(PreparedExportDocument document) Returns the two bulk NDJSON lines for the provided prepared document.static StringjsonDocumentLine(Map<String, Object> document) Returns one JSONL line for the provided document body.static voidwriteBulkNdjson(OutputStream output, PreparedExportDocument document) Writes one bulk NDJSON action/document pair to the target stream.
-
Method Details
-
jsonDocumentLine
public static String jsonDocumentLine(Map<String, Object> document) throws com.fasterxml.jackson.core.JsonProcessingExceptionReturns 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 ownershipdocument- prepared export document with stable export ID- Throws:
IOException- if serialization or writing fails
-