Class CapabilityGrantUseResult
- Namespace
- AsiBackbone.Core.CapabilityGrants
- Assembly
- AsiBackbone.Core.dll
Represents the outcome returned by a capability grant use-control store.
public sealed class CapabilityGrantUseResult
- Inheritance
-
CapabilityGrantUseResult
- Inherited Members
Properties
FailureCode
Gets the provider-neutral failure code when the use-control check did not accept the grant.
public string? FailureCode { get; }
Property Value
FailureMessage
Gets the provider-neutral failure message when the use-control check did not accept the grant.
public string? FailureMessage { get; }
Property Value
IsAccepted
Gets a value indicating whether the grant was accepted for use.
public bool IsAccepted { get; }
Property Value
State
Gets the use-control state.
public GrantUseState State { get; }
Property Value
UseCount
Gets the observed use count after the store checked or consumed the grant.
public int UseCount { get; }
Property Value
Methods
Accepted(int)
Creates an accepted use result.
public static CapabilityGrantUseResult Accepted(int useCount)
Parameters
useCountint
Returns
Cancelled(string?)
Creates a result indicating the grant was cancelled.
public static CapabilityGrantUseResult Cancelled(string? failureMessage = null)
Parameters
failureMessagestring
Returns
RetentionElapsed(string?)
Creates a result indicating the store can no longer prove the grant is within its use limit, because the grant is past the store's use-record retention horizon and its record may already have been evicted.
public static CapabilityGrantUseResult RetentionElapsed(string? failureMessage = null)
Parameters
failureMessagestring
Returns
Remarks
The state is UseLimitExceeded, so validation denies. Accepting the use instead would start a fresh count for a grant whose earlier uses the store has discarded, which is a replay.
Stopped(string?)
Creates a result indicating the grant was administratively stopped.
public static CapabilityGrantUseResult Stopped(string? failureMessage = null)
Parameters
failureMessagestring
Returns
Unavailable(string?)
Creates a result indicating the use-control store was unavailable.
public static CapabilityGrantUseResult Unavailable(string? failureMessage = null)
Parameters
failureMessagestring
Returns
UseLimitExceeded(int, string?)
Creates a result indicating the configured use limit was exceeded.
public static CapabilityGrantUseResult UseLimitExceeded(int useCount, string? failureMessage = null)