Record Class NuggetAdminResultHeader

java.lang.Object
java.lang.Record
org.j7m.middleware.operations.api.NuggetAdminResultHeader
Record Components:
protocolVersion - public admin protocol version
formatName - normative JSON format name
formatVersion - normative JSON format version
requestId - request id
correlationId - correlation id
operationId - stable operation id, when known
operationKind - typed operation family
outcome - common outcome
accepted - whether a provider accepted responsibility for the operation
inProgress - whether work remains in progress
completed - whether the operation completed
denied - whether admission, authorization, target, state, or confirmation policy denied the operation
unavailable - whether the provider could not evaluate the operation
timedOut - whether the operation exceeded a request or server budget
partial - whether optional data is partial
outcomeUnknown - whether the final outcome is not known
returnedCount - returned item count for collection-like responses
totalAvailable - total available item count when authorized and known
truncated - whether hard response bounds truncated the response
warnings - safe warnings
error - normalized safe error, or null
requestedAt - request timestamp
completedAt - completion timestamp
elapsed - elapsed server-side duration
metadata - safe result metadata in schema-visible order

public record NuggetAdminResultHeader(int protocolVersion, String formatName, int formatVersion, String requestId, String correlationId, String operationId, NuggetAdminOperationKind operationKind, NuggetAdminOutcome outcome, boolean accepted, boolean inProgress, boolean completed, boolean denied, boolean unavailable, boolean timedOut, boolean partial, boolean outcomeUnknown, int returnedCount, long totalAvailable, boolean truncated, List<String> warnings, RemoteError error, Instant requestedAt, Instant completedAt, Duration elapsed, Map<String,String> metadata) extends Record
Common public result header for admin command and query envelopes.

The header carries only safe operational state common to typed public result families. It is suitable for deterministic JSON rendering and future adapters, but it is not a substitute for the typed payload. Timing is expressed as timestamps plus Duration; JSON artifacts render duration in milliseconds. Errors must be normalized RemoteError instances with safe messages and metadata. Exactly one outcome flag must be true, and that flag must correspond to outcome(); for example, an NuggetAdminOutcome.UNAVAILABLE result is unavailable but not completed.

Instances are immutable and thread-safe.

  • Constructor Details

    • NuggetAdminResultHeader

      public NuggetAdminResultHeader(int protocolVersion, String formatName, int formatVersion, String requestId, String correlationId, String operationId, NuggetAdminOperationKind operationKind, NuggetAdminOutcome outcome, boolean accepted, boolean inProgress, boolean completed, boolean denied, boolean unavailable, boolean timedOut, boolean partial, boolean outcomeUnknown, int returnedCount, long totalAvailable, boolean truncated, List<String> warnings, RemoteError error, Instant requestedAt, Instant completedAt, Duration elapsed, Map<String,String> metadata)
      Creates a validated immutable result header.
  • Method Details

    • unavailable

      public static NuggetAdminResultHeader unavailable(NuggetAdminRequestContext context, String operationId, RemoteError error)
      Creates an unavailable header for an older or unimplemented provider.
      Parameters:
      context - request context
      operationId - operation id, or empty
      error - safe unavailable error
      Returns:
      unavailable result header
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • protocolVersion

      public int protocolVersion()
      Returns the value of the protocolVersion record component.
      Returns:
      the value of the protocolVersion record component
    • formatName

      public String formatName()
      Returns the value of the formatName record component.
      Returns:
      the value of the formatName record component
    • formatVersion

      public int formatVersion()
      Returns the value of the formatVersion record component.
      Returns:
      the value of the formatVersion record component
    • requestId

      public String requestId()
      Returns the value of the requestId record component.
      Returns:
      the value of the requestId record component
    • correlationId

      public String correlationId()
      Returns the value of the correlationId record component.
      Returns:
      the value of the correlationId record component
    • operationId

      public String operationId()
      Returns the value of the operationId record component.
      Returns:
      the value of the operationId record component
    • operationKind

      public NuggetAdminOperationKind operationKind()
      Returns the value of the operationKind record component.
      Returns:
      the value of the operationKind record component
    • outcome

      public NuggetAdminOutcome outcome()
      Returns the value of the outcome record component.
      Returns:
      the value of the outcome record component
    • accepted

      public boolean accepted()
      Returns the value of the accepted record component.
      Returns:
      the value of the accepted record component
    • inProgress

      public boolean inProgress()
      Returns the value of the inProgress record component.
      Returns:
      the value of the inProgress record component
    • completed

      public boolean completed()
      Returns the value of the completed record component.
      Returns:
      the value of the completed record component
    • denied

      public boolean denied()
      Returns the value of the denied record component.
      Returns:
      the value of the denied record component
    • unavailable

      public boolean unavailable()
      Returns the value of the unavailable record component.
      Returns:
      the value of the unavailable record component
    • timedOut

      public boolean timedOut()
      Returns the value of the timedOut record component.
      Returns:
      the value of the timedOut record component
    • partial

      public boolean partial()
      Returns the value of the partial record component.
      Returns:
      the value of the partial record component
    • outcomeUnknown

      public boolean outcomeUnknown()
      Returns the value of the outcomeUnknown record component.
      Returns:
      the value of the outcomeUnknown record component
    • returnedCount

      public int returnedCount()
      Returns the value of the returnedCount record component.
      Returns:
      the value of the returnedCount record component
    • totalAvailable

      public long totalAvailable()
      Returns the value of the totalAvailable record component.
      Returns:
      the value of the totalAvailable record component
    • truncated

      public boolean truncated()
      Returns the value of the truncated record component.
      Returns:
      the value of the truncated record component
    • warnings

      public List<String> warnings()
      Returns the value of the warnings record component.
      Returns:
      the value of the warnings record component
    • error

      public RemoteError error()
      Returns the value of the error record component.
      Returns:
      the value of the error record component
    • requestedAt

      public Instant requestedAt()
      Returns the value of the requestedAt record component.
      Returns:
      the value of the requestedAt record component
    • completedAt

      public Instant completedAt()
      Returns the value of the completedAt record component.
      Returns:
      the value of the completedAt record component
    • elapsed

      public Duration elapsed()
      Returns the value of the elapsed record component.
      Returns:
      the value of the elapsed record component
    • metadata

      public Map<String,String> metadata()
      Returns the value of the metadata record component.
      Returns:
      the value of the metadata record component