@ChannelHandler.Sharable public class RateLimitingHandler extends io.netty.handler.ipfilter.AbstractRemoteAddressFilter<InetSocketAddress>
Any configuration changes must be made before UaStackServer.startup() is called for the first time,
application-wide. Once the instance has been created further configuration changes will have no effect.
| Modifier and Type | Field and Description |
|---|---|
static AtomicLong |
CUMULATIVE_CONNECTIONS_REJECTED
Cumulative count of all connection rejections for the lifetime of the server.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
accept(io.netty.channel.ChannelHandlerContext ctx,
InetSocketAddress isa) |
protected void |
channelAccepted(io.netty.channel.ChannelHandlerContext ctx,
InetSocketAddress remoteAddress) |
static RateLimitingHandler |
getInstance()
Get the shared
RateLimitingHandler instance. |
channelActive, channelRegistered, channelRejectedchannelInactive, channelRead, channelReadComplete, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharablepublic static final AtomicLong CUMULATIVE_CONNECTIONS_REJECTED
public static RateLimitingHandler getInstance()
RateLimitingHandler instance.
The values of Stack.ConnectionLimits#RATE_LIMIT_ENABLED,
Stack.ConnectionLimits#RATE_LIMIT_MAX_ATTEMPTS,
Stack.ConnectionLimits#RATE_LIMIT_WINDOW_MS,
Stack.ConnectionLimits#RATE_LIMIT_MAX_CONNECTIONS,
and Stack.ConnectionLimits#RATE_LIMIT_MAX_CONNECTIONS_PER_ADDRESS
will be locked in whenever the first invocation of this method occurs.
RateLimitingHandler instance.protected boolean accept(io.netty.channel.ChannelHandlerContext ctx,
InetSocketAddress isa)
accept in class io.netty.handler.ipfilter.AbstractRemoteAddressFilter<InetSocketAddress>protected void channelAccepted(io.netty.channel.ChannelHandlerContext ctx,
InetSocketAddress remoteAddress)
channelAccepted in class io.netty.handler.ipfilter.AbstractRemoteAddressFilter<InetSocketAddress>Copyright © 2021. All rights reserved.