Class DeduplicatorHandler<T extends RadiusPacket>

  • All Implemented Interfaces:
    RequestHandler<T,SecretProvider>


    public class DeduplicatorHandler<T extends RadiusPacket>
    extends java.lang.Object
    implements RequestHandler<T,SecretProvider>
    Handler that wraps around another handler and deduplicates requests, returning null if duplicate. This considers packets duplicate if packetIdentifier and remote address matches.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.netty.util.concurrent.Promise<RadiusPacket> handlePacket​(io.netty.channel.Channel channel, T request, java.net.InetSocketAddress remoteAddress, SecretProvider secretProvider)
      Handles the received Radius packet and constructs a response.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DeduplicatorHandler

        public DeduplicatorHandler​(RequestHandler<T,SecretProvider> requestHandler,
                                   io.netty.util.Timer timer,
                                   long ttlMs)
        Parameters:
        requestHandler - underlying handler to process packet if not duplicate
        timer - used to set timeouts that clean up packets after predefined TTL
        ttlMs - time in ms to keep packets in cache and ignore duplicates
    • Method Detail

      • handlePacket

        public io.netty.util.concurrent.Promise<RadiusPacket> handlePacket​(io.netty.channel.Channel channel,
                                                                           T request,
                                                                           java.net.InetSocketAddress remoteAddress,
                                                                           SecretProvider secretProvider)
        Description copied from interface: RequestHandler
        Handles the received Radius packet and constructs a response. Filters/Deduplicators can also implement this and wrap around underlying handlers.
        Specified by:
        handlePacket in interface RequestHandler<T extends RadiusPacket,SecretProvider>
        Parameters:
        channel - socket which received packet
        request - the packet
        remoteAddress - remote address the packet was sent by
        secretProvider - shared secret associated with remoteAddress
        Returns:
        null if packet is considered duplicate, otherwise delegates to underlying handler.