Class DocumentMessageReader

java.lang.Object
io.fluxzero.sdk.persisting.search.DocumentMessageReader

public final class DocumentMessageReader extends Object
Internal, registration-scoped document reader. Retains the original composition for typed Graph handlers while preserving the ordinary logical message, handler selection, payload parameters and interceptor input. The root's upcast payload is reused; descendant paths and revisions always refer to the original composition. Explicit internal Model-source handlers also require exactly one upcast state; ordinary document streams retain split/drop semantics. Registrations are reference-counted and removed with their handlers.
  • Constructor Details

    • DocumentMessageReader

      public DocumentMessageReader()
    • DocumentMessageReader

      public DocumentMessageReader(Supplier<SearchClient> searchClient)
      Binds live Graph hydration to the owning client and consumer namespace.
  • Method Details

    • register

      public io.fluxzero.common.Registration register(Object target, io.fluxzero.common.handling.HandlerFilter filter)
      Records accepted typed Graph and Model-source methods until the returned registration is cancelled.
    • register

      public io.fluxzero.common.Registration register(Object target, io.fluxzero.common.handling.HandlerFilter filter, ModelRepository repository)
      Registers durable notifications in the same namespace as the document consumer.
    • readsGraphs

      public boolean readsGraphs(String topic)
      Whether this collection needs the original composition alongside its logical document payload.
    • readsModelDocuments

      public boolean readsModelDocuments(String topic)
      Whether this topic requires a single canonical Model state or the original Graph representation.
    • read

      public Stream<DeserializingMessage> read(List<io.fluxzero.common.api.SerializedMessage> messages, String topic, Serializer serializer)
      Reads a batch; topics without typed Graph handlers retain the original serializer stream.
    • read

      public Stream<DeserializingMessage> read(List<io.fluxzero.common.api.SerializedMessage> messages, String topic, Serializer serializer, SearchClient client)
      Reads using the explicit consumer namespace while retaining this reader's registration-scoped definitions.
    • isLiveGraph

      public static boolean isLiveGraph(DeserializingMessage message)
      Live compositions are observational and must never be persisted as a handler return side effect.