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 classResponseRateLimitingHandler.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 voidhandleRequest(HttpServerExchange exchange)Handle the request.StringtoString()
-
-
-
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:HttpHandlerHandle the request.- Specified by:
handleRequestin interfaceHttpHandler- Parameters:
exchange- the HTTP request/response exchange- Throws:
Exception
-
-