HttpHandler
public class ResponseRateLimitingHandler extends java.lang.Object implements HttpHandler
Modifier and Type | Class | Description |
---|---|---|
static class |
ResponseRateLimitingHandler.Builder |
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
|
Modifier and Type | Method | Description |
---|---|---|
void |
handleRequest(HttpServerExchange exchange) |
Handle the request.
|
public ResponseRateLimitingHandler(HttpHandler next, int bytes, long time, java.util.concurrent.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 java.lang.Exception
HttpHandler
handleRequest
in interface HttpHandler
exchange
- the HTTP request/response exchangejava.lang.Exception
Copyright © 2018. All rights reserved.