Record Class RateLimitProfile
java.lang.Object
java.lang.Record
org.j7m.middleware.application.api.RateLimitProfile
- Record Components:
permits- admitted requests per window, 1..1000000; later bulkhead rejection does not refund themwindow- positive monotonic interval, 1ms..1dayscope- required coordination scope; never silently downgraded
public record RateLimitProfile(long permits, Duration window, RateLimitProfile.Scope scope)
extends Record
Finite fixed-window admission policy. A LOCAL implementation must reject a DISTRIBUTED profile.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumCoordination requirement selected by the trusted host. -
Constructor Summary
ConstructorsConstructorDescriptionRateLimitProfile(long permits, Duration window, RateLimitProfile.Scope scope) Validates finite limits without allocating state or choosing a fallback scope. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longpermits()Returns the value of thepermitsrecord component.scope()Returns the value of thescoperecord component.final StringtoString()Returns a string representation of this record class.window()Returns the value of thewindowrecord component.
-
Constructor Details
-
RateLimitProfile
Validates finite limits without allocating state or choosing a fallback scope.
-
-
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. -
permits
-
window
-
scope
-