Enum Class RateLimiter
- All Implemented Interfaces:
Serializable
,Comparable<RateLimiter>
,Constable
This enum contains all the rate limiters used in the application. Each enum value is associated with a
Bandwidth
object that represents the rate limiter. Every mutation or query that needs to be rate limited
should be associated with a rate limiter.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionRate limiter forUserAuthController.changeEmail(String, String)
Rate limiter forUserAuthController.changePassword(String, String)
Rate limiter forUserMutationController.createReservation(String)
Rate limiter forWorkerMutationController.createRequest(RequestInput)
Rate limiter forUserMutationController.createReservation(String)
Rate limiter forUserMutationController.deleteNotification(UUID)
Rate limiter forWorkerMutationController.deleteRequest(String)
Rate limiter forUserMutationController.deleteReservation(String)
Rate limiter forWorkerQueryController.getAllRequestTypes()
Rate limiter forUserWorkerQueryController.getOffices()
Rate limiter forUserQueryController.getReportDetailsByAvailabilityID(String)
Rate limiter forWorkerQueryController.getRequestByAvailabilityID(String)
Rate limiter forUserQueryController.getRequestTypesByUser()
Rate limiter forUserQueryController.getUserDetails()
Rate limiter forUserQueryController.getUserNotifications()
Rate limiter forUserQueryController.getUserReservations()
Rate limiter forUserAuthController.loginUser(String, String)
Rate limiter forWorkerAuthController.loginWorker(String, String)
Rate limiter forUserAuthController.logout()
Rate limiter forUserMutationController.modifyNotification(NotificationInput, UUID)
Rate limiter forWorkerMutationController.modifyRequest(String, RequestInput)
Rate limiter forUserMutationController.preserveAvailability(String)
}Rate limiter forUserAuthController.refreshAccessToken(String)
Rate limiter forUserAuthController.registerUser(RegisterInput)
Deprecated. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) io.github.bucket4j.Bandwidth
Get the default rate limiter for the enum value.(package private) io.github.bucket4j.Bandwidth
getBandwidth
(int seconds) Get the rate limiter for the enum value with the specified number of seconds.abstract io.github.bucket4j.Bandwidth
getLimit()
Get the rate limiter for the enum value.static RateLimiter
Returns the enum constant of this class with the specified name.static RateLimiter[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
GET_REQUEST_TYPES_BY_USER
Rate limiter forUserQueryController.getRequestTypesByUser()
-
GET_REPORT_DETAILS_BY_AVAILABILITY_ID
Rate limiter forUserQueryController.getReportDetailsByAvailabilityID(String)
-
GET_USER_NOTIFICATIONS
Rate limiter forUserQueryController.getUserNotifications()
-
GET_USER_DETAILS
Rate limiter forUserQueryController.getUserDetails()
-
GET_USER_RESERVATIONS
Rate limiter forUserQueryController.getUserReservations()
-
LOGIN_USER
Rate limiter forUserAuthController.loginUser(String, String)
-
LOGOUT
Rate limiter forUserAuthController.logout()
-
REGISTER_USER
Rate limiter forUserAuthController.registerUser(RegisterInput)
-
REFRESH_ACCESS_TOKEN
Rate limiter forUserAuthController.refreshAccessToken(String)
-
CHANGE_PASSWORD
Rate limiter forUserAuthController.changePassword(String, String)
-
CREATE_RESERVATION
Rate limiter forUserMutationController.createReservation(String)
-
DELETE_RESERVATION
Rate limiter forUserMutationController.deleteReservation(String)
-
CREATE_NOTIFICATION
Rate limiter forUserMutationController.createReservation(String)
-
MODIFY_NOTIFICATION
Rate limiter forUserMutationController.modifyNotification(NotificationInput, UUID)
-
DELETE_NOTIFICATION
Rate limiter forUserMutationController.deleteNotification(UUID)
-
CHANGE_EMAIL
Rate limiter forUserAuthController.changeEmail(String, String)
-
GET_REQUEST_BY_AVAILABILITY_ID
Rate limiter forWorkerQueryController.getRequestByAvailabilityID(String)
-
GET_ALL_REQUEST_TYPES
Rate limiter forWorkerQueryController.getAllRequestTypes()
-
GET_AVAILABILITIES
-
GET_OFFICES
Rate limiter forUserWorkerQueryController.getOffices()
-
LOGIN_WORKER
Rate limiter forWorkerAuthController.loginWorker(String, String)
-
CREATE_REQUEST
Rate limiter forWorkerMutationController.createRequest(RequestInput)
-
MODIFY_REQUEST
Rate limiter forWorkerMutationController.modifyRequest(String, RequestInput)
-
DELETE_REQUEST
Rate limiter forWorkerMutationController.deleteRequest(String)
-
PRESERVE_AVAILABILITY
Rate limiter forUserMutationController.preserveAvailability(String)
} -
REGISTER_WORKER
Deprecated.Rate limiter forWorkerAuthController.registerWorker(WorkerInput)
-
-
Constructor Details
-
RateLimiter
private RateLimiter()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getLimit
public abstract io.github.bucket4j.Bandwidth getLimit()Get the rate limiter for the enum value.- Returns:
- the rate limiter for the enum value
-
getBandwidth
io.github.bucket4j.Bandwidth getBandwidth()Get the default rate limiter for the enum value.- Returns:
- the default rate limiter for the enum value
-
getBandwidth
io.github.bucket4j.Bandwidth getBandwidth(int seconds) Get the rate limiter for the enum value with the specified number of seconds.- Parameters:
seconds
- the number of seconds to wait before refilling the bucket by 1 token- Returns:
- the
Bandwidth
object for the enum value
-
WorkerAuthController.registerWorker(WorkerInput)