Class IdRateLimitEmailVerificationService
java.lang.Object
com.io7m.idstore.server.service.ratelimit.IdRateLimitEmailVerificationService
- All Implemented Interfaces:
IdRateLimitEmailVerificationServiceType
,IdRateLimiterType
,com.io7m.repetoir.core.RPServiceType
public final class IdRateLimitEmailVerificationService
extends Object
implements IdRateLimitEmailVerificationServiceType
A rate limiting service for email verifications.
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(IdMetricsServiceType metrics, long expiration, TimeUnit timeUnit) A rate limiting service for email verifications.boolean
isAllowedByRateLimit
(UUID user) toString()
waitTime()
-
Method Details
-
create
public static IdRateLimitEmailVerificationServiceType create(IdMetricsServiceType metrics, long expiration, TimeUnit timeUnit) A rate limiting service for email verifications.- Parameters:
metrics
- The metrics serviceexpiration
- The expiration for tokenstimeUnit
- The time unit for expirations- Returns:
- A rate limiter
-
isAllowedByRateLimit
- Specified by:
isAllowedByRateLimit
in interfaceIdRateLimitEmailVerificationServiceType
- Parameters:
user
- The user ID- Returns:
true
if the given operation is allowed by rate limiting
-
description
- Specified by:
description
in interfacecom.io7m.repetoir.core.RPServiceType
-
toString
-
waitTime
- Specified by:
waitTime
in interfaceIdRateLimiterType
- Returns:
- The suggested wait time if a rate limit is exceeded
-