public class RadiusClient extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static LinkedHashMap<String,Class<?>> |
authenticators |
protected JRadiusSession |
session |
protected RadiusClientTransport |
transport |
| Constructor and Description |
|---|
RadiusClient()
Default constructor
|
RadiusClient(DatagramSocket socket) |
RadiusClient(DatagramSocket socket,
InetAddress address,
String secret) |
RadiusClient(DatagramSocket socket,
InetAddress address,
String secret,
int authPort,
int acctPort,
int timeout) |
RadiusClient(InetAddress address,
String secret)
RadiusClient constructor
|
RadiusClient(InetAddress address,
String secret,
int authPort,
int acctPort,
int timeout)
RadiusClient constructor
|
RadiusClient(RadiusClientTransport transport) |
protected RadiusClientTransport transport
protected static final LinkedHashMap<String,Class<?>> authenticators
protected JRadiusSession session
public RadiusClient()
throws IOException
IOExceptionpublic RadiusClient(DatagramSocket socket)
public RadiusClient(RadiusClientTransport transport)
public RadiusClient(InetAddress address, String secret) throws IOException
address - The Internet address to send tosecret - Our shared secretIOExceptionRadiusExceptionpublic RadiusClient(DatagramSocket socket, InetAddress address, String secret)
public RadiusClient(InetAddress address, String secret, int authPort, int acctPort, int timeout) throws IOException
address - The Internet address to send tosecret - Our shared secretauthPort - The authentication portacctPort - The accounting porttimeout - Timeout (time to wait for a reply)IOExceptionRadiusExceptionpublic RadiusClient(DatagramSocket socket, InetAddress address, String secret, int authPort, int acctPort, int timeout) throws SocketException
SocketExceptionpublic void close()
public static void registerAuthenticator(String name, Class<?> c)
name - The authentication protocol namec - The RadiusAuthenticator class that implements the protocolpublic static void registerAuthenticator(String name, String className) throws ClassNotFoundException
ClassNotFoundExceptionpublic static RadiusAuthenticator getAuthProtocol(String protocolName)
Examples:
protocolName - The requested authentication protocolpublic RadiusResponse sendReceive(RadiusRequest p, int retries) throws RadiusException
RadiusExceptionpublic void send(RadiusRequest p) throws Exception
Exceptionpublic RadiusResponse authenticate(AccessRequest p, RadiusAuthenticator auth, int retries) throws RadiusException, UnknownAttributeException, NoSuchAlgorithmException
p - RadiusPacket to be send (should be AccessRequest)auth - The RadiusAuthenticator instance (if null, PAPAuthenticator is used)retries - Number of times to retry (without response)RadiusExceptionUnknownAttributeExceptionNoSuchAlgorithmExceptionpublic AccountingResponse accounting(AccountingRequest p, int retries) throws RadiusException
p - The RadiusPacket to be sent (should be AccountingRequest)retries - Number of times to retry (without a response)RadiusExceptionUnknownAttributeExceptionpublic DisconnectResponse disconnect(DisconnectRequest p, int retries) throws RadiusException
RadiusExceptionpublic CoAResponse changeOfAuth(CoARequest p, int retries) throws RadiusException
RadiusExceptionpublic int getAcctPort()
public void setAcctPort(int acctPort)
acctPort - The RADIUS accounting portpublic int getAuthPort()
public void setAuthPort(int authPort)
authPort - The RADIUS authentication portpublic int getSocketTimeout()
public void setSocketTimeout(int socketTimeout)
socketTimeout - The socket timeout (in seconds)public InetAddress getRemoteInetAddress()
public void setRemoteInetAddress(InetAddress remoteInetAddress)
remoteInetAddress - The remote server IP Addresspublic InetAddress getLocalInetAddress()
public void setLocalInetAddress(InetAddress localInetAddress)
localInetAddress - The local IP Address to bind topublic String getSharedSecret()
public void setSharedSecret(String sharedSecret)
sharedSecret - The shared secret to setCopyright © 2017. All rights reserved.