Class InvocationTraceContext

java.lang.Object
org.j7m.middleware.application.api.InvocationTraceContext

public final class InvocationTraceContext extends Object
Bounded data-only W3C parent context for host-tracked work and generic remote hops. Trace metadata is never authentication, authorization or an idempotency identity. Vendor state, baggage and arbitrary fields are dropped. Only valid version-00 traceparent is propagated. Scopes are thread-confined; current snapshots are immutable and safe to capture for another task.
  • Method Details

    • current

      public static Map<String,String> current()
      Returns the immutable allowed traceparent snapshot, or an empty map.
      Returns:
      at most one fixed-size W3C header
    • sanitized

      public static Map<String,String> sanitized(Map<String,String> metadata)
      Filters untrusted metadata without evaluating payloads or retaining arbitrary headers. Malformed, oversized, zero-identity or unsupported-version input becomes an empty carrier.
      Parameters:
      metadata - source headers, nullable
      Returns:
      immutable empty or single-header carrier
    • open

      public static InvocationTraceContext.Scope open(Map<String,String> metadata)
      Attaches a sanitized snapshot on the current thread and restores its predecessor on close.
      Parameters:
      metadata - allowed carrier or an arbitrary map which is filtered
      Returns:
      thread-confined idempotent owner scope