Class RateLimitConnectHandler

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelOutboundHandler

    @Sharable
    public class RateLimitConnectHandler
    extends io.netty.channel.ChannelOutboundHandlerAdapter
    Created by acurtis on 3/19/18.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

        io.netty.channel.ChannelHandler.Sharable
    • Constructor Summary

      Constructors 
      Constructor Description
      RateLimitConnectHandler​(java.util.concurrent.ScheduledExecutorService scheduledExecutorService, long betweenConnectDelayMillis, long betweenFailureDelayMillis)  
      RateLimitConnectHandler​(java.util.concurrent.ScheduledExecutorService scheduledExecutorService, java.util.function.LongSupplier betweenConnectDelayMillis, java.util.function.LongSupplier betweenFailureDelayMillis)  
      RateLimitConnectHandler​(java.util.concurrent.ScheduledExecutorService scheduledExecutorService, java.util.function.LongSupplier betweenConnectDelayMillis, java.util.function.LongSupplier betweenFailureDelayMillis, java.util.function.LongSupplier maxConnectDelayMillis)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void connect​(io.netty.channel.ChannelHandlerContext ctx, java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, io.netty.channel.ChannelPromise promise)  
      • Methods inherited from class io.netty.channel.ChannelOutboundHandlerAdapter

        bind, close, deregister, disconnect, flush, read, write
      • Methods inherited from class io.netty.channel.ChannelHandlerAdapter

        ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.netty.channel.ChannelHandler

        exceptionCaught, handlerAdded, handlerRemoved
    • Constructor Detail

      • RateLimitConnectHandler

        public RateLimitConnectHandler​(@Nonnull
                                       java.util.concurrent.ScheduledExecutorService scheduledExecutorService,
                                       long betweenConnectDelayMillis,
                                       long betweenFailureDelayMillis)
      • RateLimitConnectHandler

        public RateLimitConnectHandler​(@Nonnull
                                       java.util.concurrent.ScheduledExecutorService scheduledExecutorService,
                                       @Nonnull
                                       java.util.function.LongSupplier betweenConnectDelayMillis,
                                       @Nonnull
                                       java.util.function.LongSupplier betweenFailureDelayMillis)
      • RateLimitConnectHandler

        public RateLimitConnectHandler​(@Nonnull
                                       java.util.concurrent.ScheduledExecutorService scheduledExecutorService,
                                       @Nonnull
                                       java.util.function.LongSupplier betweenConnectDelayMillis,
                                       @Nonnull
                                       java.util.function.LongSupplier betweenFailureDelayMillis,
                                       @Nonnull
                                       java.util.function.LongSupplier maxConnectDelayMillis)
    • Method Detail

      • connect

        public void connect​(io.netty.channel.ChannelHandlerContext ctx,
                            java.net.SocketAddress remoteAddress,
                            java.net.SocketAddress localAddress,
                            io.netty.channel.ChannelPromise promise)
                     throws java.lang.Exception
        Specified by:
        connect in interface io.netty.channel.ChannelOutboundHandler
        Overrides:
        connect in class io.netty.channel.ChannelOutboundHandlerAdapter
        Throws:
        java.lang.Exception