public class ResponseRateLimitingHandler extends Object implements HttpHandler
Modifier and Type | Class and Description |
---|---|
static class |
ResponseRateLimitingHandler.Builder |
Constructor and 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 and 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 © 2020 JBoss by Red Hat. All rights reserved.