Record Class NuggetAdminResultHeader
java.lang.Object
java.lang.Record
org.j7m.middleware.operations.api.NuggetAdminResultHeader
- Record Components:
protocolVersion- public admin protocol versionformatName- normative JSON format nameformatVersion- normative JSON format versionrequestId- request idcorrelationId- correlation idoperationId- stable operation id, when knownoperationKind- typed operation familyoutcome- common outcomeaccepted- whether a provider accepted responsibility for the operationinProgress- whether work remains in progresscompleted- whether the operation completeddenied- whether admission, authorization, target, state, or confirmation policy denied the operation- whether the provider could not evaluate the operationtimedOut- whether the operation exceeded a request or server budgetpartial- whether optional data is partialoutcomeUnknown- whether the final outcome is not knownreturnedCount- returned item count for collection-like responsestotalAvailable- total available item count when authorized and knowntruncated- whether hard response bounds truncated the responsewarnings- safe warningserror- normalized safe error, ornullrequestedAt- request timestampcompletedAt- completion timestampelapsed- elapsed server-side durationmetadata- 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 Summary
ConstructorsConstructorDescriptionNuggetAdminResultHeader(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 Summary
Modifier and TypeMethodDescriptionbooleanaccepted()Returns the value of theacceptedrecord component.booleanReturns the value of thecompletedrecord component.Returns the value of thecompletedAtrecord component.Returns the value of thecorrelationIdrecord component.booleandenied()Returns the value of thedeniedrecord component.elapsed()Returns the value of theelapsedrecord component.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.Returns the value of theformatNamerecord component.intReturns the value of theformatVersionrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theinProgressrecord component.metadata()Returns the value of themetadatarecord component.Returns the value of theoperationIdrecord component.Returns the value of theoperationKindrecord component.outcome()Returns the value of theoutcomerecord component.booleanReturns the value of theoutcomeUnknownrecord component.booleanpartial()Returns the value of thepartialrecord component.intReturns the value of theprotocolVersionrecord component.Returns the value of therequestedAtrecord component.Returns the value of therequestIdrecord component.intReturns the value of thereturnedCountrecord component.booleantimedOut()Returns the value of thetimedOutrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalAvailablerecord component.booleanReturns the value of thetruncatedrecord component.booleanReturns the value of theunavailablerecord component.static NuggetAdminResultHeaderunavailable(NuggetAdminRequestContext context, String operationId, RemoteError error) Creates an unavailable header for an older or unimplemented provider.warnings()Returns the value of thewarningsrecord component.
-
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
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
protocolVersion
public int protocolVersion()Returns the value of theprotocolVersionrecord component.- Returns:
- the value of the
protocolVersionrecord component
-
formatName
Returns the value of theformatNamerecord component.- Returns:
- the value of the
formatNamerecord component
-
formatVersion
public int formatVersion()Returns the value of theformatVersionrecord component.- Returns:
- the value of the
formatVersionrecord component
-
requestId
-
correlationId
Returns the value of thecorrelationIdrecord component.- Returns:
- the value of the
correlationIdrecord component
-
operationId
Returns the value of theoperationIdrecord component.- Returns:
- the value of the
operationIdrecord component
-
operationKind
Returns the value of theoperationKindrecord component.- Returns:
- the value of the
operationKindrecord component
-
outcome
-
accepted
-
inProgress
public boolean inProgress()Returns the value of theinProgressrecord component.- Returns:
- the value of the
inProgressrecord component
-
completed
-
denied
-
timedOut
-
partial
-
outcomeUnknown
public boolean outcomeUnknown()Returns the value of theoutcomeUnknownrecord component.- Returns:
- the value of the
outcomeUnknownrecord component
-
returnedCount
public int returnedCount()Returns the value of thereturnedCountrecord component.- Returns:
- the value of the
returnedCountrecord component
-
totalAvailable
public long totalAvailable()Returns the value of thetotalAvailablerecord component.- Returns:
- the value of the
totalAvailablerecord component
-
truncated
-
warnings
-
error
-
requestedAt
Returns the value of therequestedAtrecord component.- Returns:
- the value of the
requestedAtrecord component
-
completedAt
Returns the value of thecompletedAtrecord component.- Returns:
- the value of the
completedAtrecord component
-
elapsed
-
metadata