|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jradius.client.RadiusClient
public class RadiusClient
A Radius Client Context
Field Summary | |
---|---|
protected int |
acctPort
|
protected static java.util.LinkedHashMap |
authenticators
|
protected int |
authPort
|
protected java.net.InetAddress |
remoteInetAddress
|
protected JRadiusSession |
session
|
protected java.lang.String |
sharedSecret
|
protected java.net.DatagramSocket |
socket
|
protected int |
socketTimeout
|
Constructor Summary | |
---|---|
RadiusClient()
Default constructor |
|
RadiusClient(java.net.InetAddress address,
java.lang.String secret)
RadiusClient constructor |
|
RadiusClient(java.net.InetAddress address,
java.lang.String secret,
int authPort,
int acctPort,
int timeout)
RadiusClient constructor |
Method Summary | |
---|---|
AccountingResponse |
accounting(AccountingRequest p,
int retries)
Send an accounting request |
RadiusResponse |
authenticate(AccessRequest p,
RadiusAuthenticator auth,
int retries)
Authenicates using the specified method. |
int |
getAcctPort()
|
int |
getAuthPort()
|
static RadiusAuthenticator |
getAuthProtocol(java.lang.String protocolName)
Get a supported RadiusAuthenticator based on the protocol name. |
java.net.InetAddress |
getLocalInetAddress()
|
java.security.MessageDigest |
getMD()
|
java.net.InetAddress |
getRemoteInetAddress()
|
java.lang.String |
getSharedSecret()
|
int |
getSocketTimeout()
|
protected RadiusResponse |
receive()
|
static void |
registerAuthenticator(java.lang.String name,
java.lang.Class c)
Registration of supported RadiusAuthenticator protocols |
static void |
registerAuthenticator(java.lang.String name,
java.lang.String className)
|
protected void |
send(RadiusPacket p,
java.net.InetAddress a,
int port,
int attempt)
|
RadiusResponse |
sendReceive(RadiusRequest p,
java.net.InetAddress a,
int port,
int retries)
Send and receive RadiusPackets |
void |
setAcctPort(int acctPort)
|
void |
setAuthPort(int authPort)
|
void |
setLocalInetAddress(java.net.InetAddress localInetAddress)
|
void |
setRemoteInetAddress(java.net.InetAddress remoteInetAddress)
|
void |
setSharedSecret(java.lang.String sharedSecret)
|
void |
setSocketTimeout(int socketTimeout)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.net.InetAddress remoteInetAddress
protected java.lang.String sharedSecret
protected int authPort
protected int acctPort
protected int socketTimeout
protected java.net.DatagramSocket socket
protected JRadiusSession session
protected static final java.util.LinkedHashMap authenticators
Constructor Detail |
---|
public RadiusClient()
public RadiusClient(java.net.InetAddress address, java.lang.String secret)
address
- The Internet address to send tosecret
- Our shared secret
RadiusException
public RadiusClient(java.net.InetAddress address, java.lang.String secret, int authPort, int acctPort, int timeout)
address
- The Internet address to send tosecret
- Our shared secretauthPort
- The authentication portacctPort
- The accounting porttimeout
- Timeout (time to wait for a reply)
RadiusException
Method Detail |
---|
public static void registerAuthenticator(java.lang.String name, java.lang.Class c)
name
- The authentication protocol namec
- The RadiusAuthenticator class that implements the protocolpublic static void registerAuthenticator(java.lang.String name, java.lang.String className) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public static RadiusAuthenticator getAuthProtocol(java.lang.String protocolName)
Examples:
protocolName
- The requested authentication protocol
public RadiusResponse authenticate(AccessRequest p, RadiusAuthenticator auth, int retries) throws RadiusException, UnknownAttributeException
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)
RadiusException
UnknownAttributeException
public 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)
RadiusException
UnknownAttributeException
public RadiusResponse sendReceive(RadiusRequest p, java.net.InetAddress a, int port, int retries) throws RadiusException
p
- The RadiusPacket being senta
- The Internet Address sending toport
- The port sending toretries
- Number of times to retry (without response)
RadiusException
protected void send(RadiusPacket p, java.net.InetAddress a, int port, int attempt) throws java.io.IOException
java.io.IOException
protected RadiusResponse receive() throws java.io.IOException, RadiusException
java.io.IOException
RadiusException
public java.security.MessageDigest getMD()
public 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 java.net.InetAddress getRemoteInetAddress()
public void setRemoteInetAddress(java.net.InetAddress remoteInetAddress)
remoteInetAddress
- The remote server IP Addresspublic java.net.InetAddress getLocalInetAddress()
public void setLocalInetAddress(java.net.InetAddress localInetAddress)
localInetAddress
- The local IP Address to bind topublic java.lang.String getSharedSecret()
public void setSharedSecret(java.lang.String sharedSecret)
sharedSecret
- The shared secret to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |