Record Class RateLimitKey
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.ratelimiting.RateLimitKey
- Record Components:
tenant- tenant scope;nullbecomesTenantId.DEFAULTscope- non-blank dimension string
Composite key under which
RateLimitStore tracks event
timestamps for sliding-window rate-limiting.
The scope component is a free-form string that the policy
layer (planned for V00.70 Phase 7c) composes from whatever
dimensions the application wants to limit on — typical examples:
"ip:1.2.3.4"— per source IP."subject:alice"— per authenticated user."endpoint:POST /api/login"— per HTTP endpoint."ip:1.2.3.4|endpoint:POST /api/login"— combined.
Keeping the scope as an opaque string keeps the store
itself dimension-agnostic; the policy decides naming conventions
and is free to evolve them without changing the store contract.
-
Constructor Summary
ConstructorsConstructorDescriptionRateLimitKey(TenantId tenant, String scope) Validates the record components and normalises anulltenant toTenantId.DEFAULT. -
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.scope()Returns the value of thescoperecord component.tenant()Returns the value of thetenantrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RateLimitKey
Validates the record components and normalises anulltenant toTenantId.DEFAULT.- Parameters:
tenant- tenant scope;nullbecomes DEFAULTscope- non-blank 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. All components in this record class are compared withObjects::equals(Object,Object). -
tenant
-
scope
-