Class RadiusClient

java.lang.Object
org.tinyradius.io.client.RadiusClient
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable

public class RadiusClient
extends java.lang.Object
implements java.io.Closeable
A simple Radius client which binds to a specific socket, and can then be used to send any number of packets to any endpoints through that socket.
  • Constructor Summary

    Constructors 
    Constructor Description
    RadiusClient​(io.netty.bootstrap.Bootstrap bootstrap, java.net.SocketAddress listenAddress, TimeoutHandler timeoutHandler, io.netty.channel.ChannelHandler handler)  
  • Method Summary

    Modifier and Type Method Description
    void close()  
    io.netty.util.concurrent.Future<RadiusResponse> communicate​(RadiusRequest packet, java.util.List<RadiusEndpoint> endpoints)
    Sends packet to specified endpoints in turn until an endpoint succeeds or all fail.
    io.netty.util.concurrent.Future<RadiusResponse> communicate​(RadiusRequest packet, RadiusEndpoint endpoint)
    Sends packet to specified endpoint.

    Methods inherited from class java.lang.Object

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

    • RadiusClient

      public RadiusClient​(io.netty.bootstrap.Bootstrap bootstrap, java.net.SocketAddress listenAddress, TimeoutHandler timeoutHandler, io.netty.channel.ChannelHandler handler)
      Parameters:
      bootstrap - bootstrap with channel class and eventLoopGroup set up
      listenAddress - local address to bind to
      timeoutHandler - retry strategy for scheduling retries and timeouts
      handler - ChannelHandler to handle outbound requests
  • Method Details

    • communicate

      public io.netty.util.concurrent.Future<RadiusResponse> communicate​(RadiusRequest packet, java.util.List<RadiusEndpoint> endpoints)
      Sends packet to specified endpoints in turn until an endpoint succeeds or all fail.
      Parameters:
      packet - packet to send
      endpoints - endpoints to send packet to
      Returns:
      deferred response containing response packet or exception
    • communicate

      public io.netty.util.concurrent.Future<RadiusResponse> communicate​(RadiusRequest packet, RadiusEndpoint endpoint)
      Sends packet to specified endpoint.
      Parameters:
      packet - packet to send
      endpoint - endpoint to send packet to
      Returns:
      deferred response containing response packet or exception
    • close

      public void close()
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface java.io.Closeable