Record Class RateLimitExceeded
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.audit.RateLimitExceeded
- Record Components:
timestamp- UTC throttle time; non-nullscope- theRateLimitKey.scope()value that was throttled; non-blanksubjectId- subject id when the scope is per-subject; may be empty for IP / endpoint scopeslimit- configured per-window event limit; positivewindow- configured window duration; non-null, positiveeventsInWindow- events counted within the window at decision time; non-negative
- All Implemented Interfaces:
AuditEvent
public record RateLimitExceeded(Instant timestamp, String scope, String subjectId, int limit, Duration window, int eventsInWindow)
extends Record
implements AuditEvent
Emitted by
RateLimitPolicy.tryAcquire when an event was
refused because the per-key event count within the configured
window equals or exceeds the limit.-
Constructor Summary
ConstructorsConstructorDescriptionRateLimitExceeded(Instant timestamp, String scope, String subjectId, int limit, Duration window, int eventsInWindow) Validates the record components. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intReturns the value of theeventsInWindowrecord component.final inthashCode()Returns a hash code value for this object.intlimit()Returns the value of thelimitrecord component.scope()Returns the value of thescoperecord component.Returns the value of thesubjectIdrecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.window()Returns the value of thewindowrecord component.
-
Constructor Details
-
RateLimitExceeded
-
-
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. -
timestamp
Returns the value of thetimestamprecord component.- Specified by:
timestampin interfaceAuditEvent- Returns:
- the value of the
timestamprecord component
-
scope
-
subjectId
-
limit
-
window
-
eventsInWindow
public int eventsInWindow()Returns the value of theeventsInWindowrecord component.- Returns:
- the value of the
eventsInWindowrecord component
-