Package org.tinyradius.io.client
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.
-
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 uplistenAddress
- local address to bind totimeoutHandler
- retry strategy for scheduling retries and timeoutshandler
- 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 sendendpoints
- 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 sendendpoint
- endpoint to send packet to- Returns:
- deferred response containing response packet or exception
-
close
public void close()- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-