|
RADIUS Client API (V3) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectFailOverRADIUSClient
Class to perform fail-over RADIUS client requests.
A list of remote servers, their secrets, and any special attributes supply the class with fail-over servers.
| Nested Class Summary | |
class |
FailOverRADIUSClient.ServerData
Inner class to hold server list. |
| Field Summary | |
static String |
AUTH_CHAP
CHAP authentication. |
static String |
AUTH_EAPMD5
EAPMD5 authentication. |
static String |
AUTH_MSCHAP
MSCHAP authentication. |
static String |
AUTH_MSCHAP2
MSCHAP V2 authentication. |
static String |
AUTH_PAP
PAP authentication. |
| Constructor Summary | |
FailOverRADIUSClient()
Default constructor. |
|
| Method Summary | |
int |
accounting()
Perform accounting. |
void |
addServer(InetAddress server,
int authPort,
int acctPort,
String secret,
AttributeList serverAttributeList)
Add a server to the list of fail over servers. |
void |
addServer(InetAddress server,
String secret,
AttributeList serverAttributeList)
Add a server to the list of fail over servers. |
void |
allowEmptyAttributes(boolean enable)
Permit or refuse empty attributes. |
int |
authenticate()
Perform the authentication. |
AttributeList |
getAttributes()
Retrieve any attributes returned by the response. |
String |
getErrorMessage()
Get the error message associated with the success() |
InetAddress |
getRespondingServer()
Get the last responding server. |
FailOverRADIUSClient.ServerData |
getRespondingServerData()
Get the responding server information. |
static void |
main(String[] arg)
Main test of the class. |
Iterator |
serverIterator()
Get all server inforamtion. |
void |
setAttributes(AttributeList alist)
Set the attributes necessary for this authentication or accounting. |
void |
setAuthenticationType(String type)
Set the authentication type, one of PAP, CHAP, MSCHAP, MSCHAPV2, and EAPMD5. |
void |
setDebug(boolean enable)
Enable or disable debugging. |
void |
setName(String name)
Set the name of the entity being authenticated or accounted. |
void |
setPassword(byte[] password)
Set the password to be used with authentication. |
void |
setPassword(String password)
Set the password to be used with authentication. |
void |
setTimeout(int timeout)
Set the RADIUS client timeout. |
boolean |
success()
Determine if the authentication or accounting succeeded. |
| Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String AUTH_PAP
public static final String AUTH_CHAP
public static final String AUTH_MSCHAP
public static final String AUTH_MSCHAP2
public static final String AUTH_EAPMD5
| Constructor Detail |
public FailOverRADIUSClient()
| Method Detail |
public void addServer(InetAddress server,
String secret,
AttributeList serverAttributeList)
throws Exception
The default ports are the standard 1812 for authentication and 1813 for accounting. If your server uses obsolete ports they will probably be 1645 and 1646 respectively.
server - Server address.secret - Server secret.serverAttributeList - List of server specific attributes. This may
be empty or null.
Exception - if either the server or secret are null.
public void addServer(InetAddress server,
int authPort,
int acctPort,
String secret,
AttributeList serverAttributeList)
throws Exception
The default ports are the standard 1812 for authentication and 1813 for accounting. If your server uses obsolete ports they will probably be 1645 and 1646 respectively.
server - Server address.authPort - The UDP port number for authentication. A value of 0 uses the standard
port number 1812.acctPort - The UDP port number for accounting. A value of 0 uses the standard
port number 1813.secret - Server secret.serverAttributeList - List of server specific attributes. This may
be empty or null.
Exception - if either the server or secret are null.public void setTimeout(int timeout)
timeout - Timeout in milliseconds.public void setDebug(boolean enable)
enable - True to enable debugging, false to disable debugging.public void allowEmptyAttributes(boolean enable)
An empty attribute is one with a tag and a length of 0. The RADIUS rfc does not permit empty attributes to be sent or received. Some implementations break this rule. If you find that empty attributes are acceptable enable them.
enable - True to support empty attributes. The default to to disable them.public void setAttributes(AttributeList alist)
alist - Attribute list.public AttributeList getAttributes()
public void setName(String name)
name - Entity name.public void setPassword(byte[] password)
password - Password.public void setPassword(String password)
password - Password.
public void setAuthenticationType(String type)
throws Exception
type - Authentication type as a string.
Not setting any authentication type or choosing an authentication method
that implies CHAP or PAP voids the effect of this method.
Exception - if the authentication type is unknown.public int authenticate()
public int accounting()
public boolean success()
getRespondingServer()
to determine which server responded.public String getErrorMessage()
success()
public InetAddress getRespondingServer()
public FailOverRADIUSClient.ServerData getRespondingServerData()
public Iterator serverIterator()
The servers will be returned as the class FailOverRADIUSClient.ServerData.
public static void main(String[] arg)
|
RADIUS Client API (V3) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||