feat(core): add attributes field to storage records and detail/summary models (Task 2)

Adds Map<String,String> attributes to ExecutionRecord, ProcessorRecord,
ExecutionDetail, ProcessorNode, and ExecutionSummary. ExecutionStore records
carry attributes as a JSON string; detail/summary models carry deserialized maps.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-03-26 18:23:32 +01:00
parent f08461cf35
commit 64f797bd96
4 changed files with 16 additions and 5 deletions

View File

@@ -2,6 +2,7 @@ package com.cameleer3.server.core.detail;
import java.time.Instant; import java.time.Instant;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Full detail of a route execution, including the nested processor tree. * Full detail of a route execution, including the nested processor tree.
@@ -45,6 +46,7 @@ public record ExecutionDetail(
String inputBody, String inputBody,
String outputBody, String outputBody,
String inputHeaders, String inputHeaders,
String outputHeaders String outputHeaders,
Map<String, String> attributes
) { ) {
} }

View File

@@ -3,6 +3,7 @@ package com.cameleer3.server.core.detail;
import java.time.Instant; import java.time.Instant;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Nested tree node representing a single processor execution within a route. * Nested tree node representing a single processor execution within a route.
@@ -21,11 +22,13 @@ public final class ProcessorNode {
private final String diagramNodeId; private final String diagramNodeId;
private final String errorMessage; private final String errorMessage;
private final String errorStackTrace; private final String errorStackTrace;
private final Map<String, String> attributes;
private final List<ProcessorNode> children; private final List<ProcessorNode> children;
public ProcessorNode(String processorId, String processorType, String status, public ProcessorNode(String processorId, String processorType, String status,
Instant startTime, Instant endTime, long durationMs, Instant startTime, Instant endTime, long durationMs,
String diagramNodeId, String errorMessage, String errorStackTrace) { String diagramNodeId, String errorMessage, String errorStackTrace,
Map<String, String> attributes) {
this.processorId = processorId; this.processorId = processorId;
this.processorType = processorType; this.processorType = processorType;
this.status = status; this.status = status;
@@ -35,6 +38,7 @@ public final class ProcessorNode {
this.diagramNodeId = diagramNodeId; this.diagramNodeId = diagramNodeId;
this.errorMessage = errorMessage; this.errorMessage = errorMessage;
this.errorStackTrace = errorStackTrace; this.errorStackTrace = errorStackTrace;
this.attributes = attributes;
this.children = new ArrayList<>(); this.children = new ArrayList<>();
} }
@@ -51,5 +55,6 @@ public final class ProcessorNode {
public String getDiagramNodeId() { return diagramNodeId; } public String getDiagramNodeId() { return diagramNodeId; }
public String getErrorMessage() { return errorMessage; } public String getErrorMessage() { return errorMessage; }
public String getErrorStackTrace() { return errorStackTrace; } public String getErrorStackTrace() { return errorStackTrace; }
public Map<String, String> getAttributes() { return attributes; }
public List<ProcessorNode> getChildren() { return List.copyOf(children); } public List<ProcessorNode> getChildren() { return List.copyOf(children); }
} }

View File

@@ -1,6 +1,7 @@
package com.cameleer3.server.core.search; package com.cameleer3.server.core.search;
import java.time.Instant; import java.time.Instant;
import java.util.Map;
/** /**
* Lightweight summary of a route execution for search result listings. * Lightweight summary of a route execution for search result listings.
@@ -31,6 +32,7 @@ public record ExecutionSummary(
String correlationId, String correlationId,
String errorMessage, String errorMessage,
String diagramContentHash, String diagramContentHash,
String highlight String highlight,
Map<String, String> attributes
) { ) {
} }

View File

@@ -22,7 +22,8 @@ public interface ExecutionStore {
Instant startTime, Instant endTime, Long durationMs, Instant startTime, Instant endTime, Long durationMs,
String errorMessage, String errorStacktrace, String diagramContentHash, String errorMessage, String errorStacktrace, String diagramContentHash,
String engineLevel, String engineLevel,
String inputBody, String outputBody, String inputHeaders, String outputHeaders String inputBody, String outputBody, String inputHeaders, String outputHeaders,
String attributes
) {} ) {}
record ProcessorRecord( record ProcessorRecord(
@@ -31,6 +32,7 @@ public interface ExecutionStore {
int depth, String parentProcessorId, String status, int depth, String parentProcessorId, String status,
Instant startTime, Instant endTime, Long durationMs, Instant startTime, Instant endTime, Long durationMs,
String errorMessage, String errorStacktrace, String errorMessage, String errorStacktrace,
String inputBody, String outputBody, String inputHeaders, String outputHeaders String inputBody, String outputBody, String inputHeaders, String outputHeaders,
String attributes
) {} ) {}
} }