Class TypeMetadataService
Layer precedence, lowest to highest: BAKED (proto doc-comments from the descriptor snapshot) < GLOBAL (the promoted Apicurio overlay) < GLOBAL_DRAFT (DB) < PIPELINE (DB, graph-scoped, participates only when a graph is named). Merging is whole-entry per field path — a higher layer's entry replaces the lower layer's entry for that path outright.
Saves are full-replace per scope and validated: the type must exist in the descriptor snapshot and every field path must resolve against it (annotations are metadata additions only; they can never reference fields that do not exist). Promotion (phase 1) writes the global draft to the Apicurio system of record — immediately visible to every merged read — and queues a pending-bake record for the phase-2 git automation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordResult of a promotion.static final recordResult of a save. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionai.pipestream.platform.registration.v1.GetTypeMetadataResponseBuilds one type's merged view with per-layer provenance.Promotes a type's global draft to the Apicurio system of record and queues the phase-2 bake record.save(ai.pipestream.platform.registration.v1.MetadataScope scope, String graphId, String messageFullName, Map<String, ai.pipestream.platform.registration.v1.FieldMetadataEntry> fields) Fully replaces one scope's annotations for a type.
-
Constructor Details
-
TypeMetadataService
public TypeMetadataService()Creates the service bean. Collaborators (the descriptor index and Apicurio client) are supplied by CDI field injection.
-
-
Method Details
-
getMerged
public ai.pipestream.platform.registration.v1.GetTypeMetadataResponse getMerged(String messageFullName, String graphId) Builds one type's merged view with per-layer provenance.- Parameters:
messageFullName- the typegraphId- when non-blank, this graph's PIPELINE overlay participates- Returns:
- the merged response
- Throws:
NoSuchElementException- when the type is not in the snapshot
-
save
public TypeMetadataService.SaveResult save(ai.pipestream.platform.registration.v1.MetadataScope scope, String graphId, String messageFullName, Map<String, ai.pipestream.platform.registration.v1.FieldMetadataEntry> fields) Fully replaces one scope's annotations for a type. An empty map deletes.- Parameters:
scope- PIPELINE (requires graphId) or GLOBAL_DRAFT (graphId must be blank)graphId- the graph for PIPELINE scopemessageFullName- the annotated typefields- field path → entry- Returns:
- the persisted state
- Throws:
IllegalArgumentException- on bad scope/graph combination or unknown field pathNoSuchElementException- when the type is not in the snapshot
-
promote
Promotes a type's global draft to the Apicurio system of record and queues the phase-2 bake record. The draft is consumed (deleted) — its content now serves from the GLOBAL layer.- Parameters:
messageFullName- the type whose draft to promote- Returns:
- the Apicurio version + pending-bake id
- Throws:
NoSuchElementException- when the type has no global draft
-