Package io.undertow.server.handlers
Class ResponseRateLimitingHandler
- java.lang.Object
-
- io.undertow.server.handlers.ResponseRateLimitingHandler
-
- All Implemented Interfaces:
HttpHandler
public class ResponseRateLimitingHandler extends java.lang.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, java.util.concurrent.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.java.lang.String
toString()
-
-
-
Constructor Detail
-
ResponseRateLimitingHandler
public ResponseRateLimitingHandler(HttpHandler next, int bytes, long time, java.util.concurrent.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 java.lang.Exception
Description copied from interface:HttpHandler
Handle the request.- Specified by:
handleRequest
in interfaceHttpHandler
- Parameters:
exchange
- the HTTP request/response exchange- Throws:
java.lang.Exception
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-