Package org.tinyradius.client
Class RadiusClient
- java.lang.Object
-
- org.tinyradius.server.AbstractListener
-
- org.tinyradius.client.RadiusClient
-
public class RadiusClient extends AbstractListener
This object represents a simple Radius client which communicates with a specified Radius server. You can use a single instance of this object to authenticate or account different users with the same Radius server as long as you authenticate/account one user after the other.This object is thread safe, but requires a packet manager to avoid confusion with the mapping of request and result packets.
-
-
Field Summary
-
Fields inherited from class org.tinyradius.server.AbstractListener
eventLoopGroup
-
-
Constructor Summary
Constructors Constructor Description RadiusClient(io.netty.channel.EventLoopGroup eventLoopGroup, io.netty.channel.ChannelFactory<? extends io.netty.channel.socket.DatagramChannel> factory, ClientHandler clientHandler, RetryStrategy retryStrategy, java.net.InetSocketAddress listenAddress)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.util.concurrent.Future<RadiusPacket>
communicate(RadiusPacket originalPacket, RadiusEndpoint endpoint)
io.netty.util.concurrent.Future<java.lang.Void>
start()
Registers the channel and binds to address.io.netty.util.concurrent.Future<java.lang.Void>
stop()
Shutdown and close resources.-
Methods inherited from class org.tinyradius.server.AbstractListener
listen
-
-
-
-
Constructor Detail
-
RadiusClient
public RadiusClient(io.netty.channel.EventLoopGroup eventLoopGroup, io.netty.channel.ChannelFactory<? extends io.netty.channel.socket.DatagramChannel> factory, ClientHandler clientHandler, RetryStrategy retryStrategy, java.net.InetSocketAddress listenAddress)
- Parameters:
eventLoopGroup
- for both channel IO and processingfactory
- to create new ChannelclientHandler
- to log outgoing packets and handle incoming packets/responsesretryStrategy
- retry strategy for scheduling retries and timeoutslistenAddress
- local address to bind to
-
-
Method Detail
-
start
public io.netty.util.concurrent.Future<java.lang.Void> start()
Registers the channel and binds to address.Also run implicitly if
communicate(RadiusPacket, RadiusEndpoint)
is called.- Specified by:
start
in classAbstractListener
- Returns:
- channelFuture of started channel socket
-
stop
public io.netty.util.concurrent.Future<java.lang.Void> stop()
Description copied from class:AbstractListener
Shutdown and close resources.- Specified by:
stop
in classAbstractListener
- Returns:
- future completes when resources shutdown
-
communicate
public io.netty.util.concurrent.Future<RadiusPacket> communicate(RadiusPacket originalPacket, RadiusEndpoint endpoint)
-
-