HttpHandler
public class ResponseRateLimitingHandler extends Object implements HttpHandler
Modifier and Type | Class | Description |
---|---|---|
static class |
ResponseRateLimitingHandler.Builder |
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
|
Modifier and Type | Method | Description |
---|---|---|
void |
handleRequest(HttpServerExchange exchange) |
Handle the request.
|
public ResponseRateLimitingHandler(HttpHandler next, int bytes, long time, TimeUnit timeUnit)
next
- The next handlerbytes
- The number of bytes per time periodtime
- The time periodtimeUnit
- The units of the time periodpublic void handleRequest(HttpServerExchange exchange) throws Exception
HttpHandler
handleRequest
in interface HttpHandler
exchange
- the HTTP request/response exchangeException
Copyright © 2018. All rights reserved.