Package io.undertow.server.handlers
Class ResponseRateLimitingHandler
- java.lang.Object
-
- io.undertow.server.handlers.ResponseRateLimitingHandler
-
- All Implemented Interfaces:
HttpHandler
public class ResponseRateLimitingHandler extends Object implements HttpHandler
Handler that limits the download rate- Author:
- Stuart Douglas
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ResponseRateLimitingHandler.Builder
-
Constructor Summary
Constructors Constructor Description ResponseRateLimitingHandler(HttpHandler next, int bytes, long time, TimeUnit timeUnit)
A handler that limits the download speed to a set number of bytes/period
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handleRequest(HttpServerExchange exchange)
Handle the request.String
toString()
-
-
-
Constructor Detail
-
ResponseRateLimitingHandler
public ResponseRateLimitingHandler(HttpHandler next, int bytes, long time, TimeUnit timeUnit)
A handler that limits the download speed to a set number of bytes/period- Parameters:
next
- The next handlerbytes
- The number of bytes per time periodtime
- The time periodtimeUnit
- The units of the time period
-
-
Method Detail
-
handleRequest
public void handleRequest(HttpServerExchange exchange) throws Exception
Description copied from interface:HttpHandler
Handle the request.- Specified by:
handleRequest
in interfaceHttpHandler
- Parameters:
exchange
- the HTTP request/response exchange- Throws:
Exception
-
-