Class ProxyRequestHandler

    • Constructor Detail

      • ProxyRequestHandler

        protected ProxyRequestHandler​(RadiusClient radiusClient)
    • Method Detail

      • getProxyServer

        public abstract RadiusEndpoint getProxyServer​(RadiusPacket packet,
                                                      RadiusEndpoint client)
        This method must be implemented to return a RadiusEndpoint if the given packet is to be proxied. The endpoint represents the Radius server the packet should be proxied to.
        Parameters:
        packet - the packet in question
        client - the client endpoint the packet originated from (containing the address, port number and shared secret)
        Returns:
        a RadiusEndpoint or null if the packet should not be proxied
      • handlePacket

        public io.netty.util.concurrent.Promise<RadiusPacket> handlePacket​(io.netty.channel.Channel channel,
                                                                           RadiusPacket request,
                                                                           java.net.InetSocketAddress remoteAddress,
                                                                           SecretProvider secretProvider)
        Proxies the given packet to the server given in the proxy connection. Stores the proxy connection object in the cache with a key that is added to the packet in the "Proxy-State" attribute.
        Specified by:
        handlePacket in interface RequestHandler<RadiusPacket,SecretProvider>
        Parameters:
        channel - socket which received packet
        request - incoming packet, can be RadiusPacket or subclass
        remoteAddress - remote address the packet was sent by
        secretProvider - shared secret associated with remoteAddress
        Returns:
        Promise of RadiusPacket or null for no response. Uses Promise instead Future, so requests to be timed out or cancelled by the caller
      • handleServerResponse

        protected RadiusPacket handleServerResponse​(Dictionary dictionary,
                                                    RadiusPacket packet)
        Sends an answer to a proxied packet back to the original host. Retrieves the RadiusProxyConnection object from the cache employing the Proxy-State attribute.
        Parameters:
        dictionary - dictionary for new packet to use
        packet - response received from server
        Returns:
        packet to send back to client