RADIUS Client API (V3)

com.theorem.radius3.login
Class ClientException

Object
  extended byAttributes
      extended byClientException
All Implemented Interfaces:
Callback, RADIUSCallback, Serializable

public final class ClientException
extends Attributes
implements Callback, Serializable

Class for notification of a a RADIUS packet transmission or reception failure. Generally this will be a timeout waiting for a RADIUS packet to return either because the server has detected a problem or less often one of the packets (request / response) packets has been lost or other exception.

Access to data handling methods in this class may only be performed when isReady() returns true.

Other exceptions include SocketException, UnknownHostException, IOException, ClientSendException or ClientReceiveException. SocketExceptions and UnknownHostExceptions are usually caused by the RADIUSClient constructor and RADIUSClient.reset(). The IOException is thrown by RADIUSClient.debug() if the debug output file cannot be opened. ClientReceiveException is thrown if the server doesn't respond before the time out period or declines to respond at all. ClientSendException is almost never thrown. The underlying network software would have to disappear for a UDP transmission to fail.

This class will not override the LoginException which will be thrown in any case. It may give insight into what went wrong.

In the case of a ClientReceiveException calling the method resend(boolean) will resend the packet. If a retry is not attempted a LoginException will be thrown.

Example of usage in a CallbackHandler

final int RETRIES = 3;
...
int retryCount = 0;
...
} else if (cb instanceof ClientException) {
  ClientException ce = (ClientException)cb;

  // Perform some number of retries.
  // If no more retries are available a LoginException
  // will be thrown by RADIUSLogin.
  if (ce.isReady())
    ce.resend(retryCount++ < RETRIES);
  continue;
}
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from class Attributes
Access_Accept, Access_BadPacket, Access_Challenge, Access_Reject
 
Method Summary
 Exception getException()
          Get the exception.
 void resend(boolean retry)
          Indicate that the packet should be resent.
 
Methods inherited from class Attributes
getRequestAttributes, getResponse, getResponseAttributes, isReady, setReady, setRequestAttributes, setResponse
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getException

public Exception getException()
Get the exception.

Returns:
one of SocketException, UnknownHostException, IOException, ClientSendException or ClientReceiveException.

resend

public void resend(boolean retry)
Indicate that the packet should be resent.

Parameters:
retry - If true resend the packet, otherwise don't resent and accept the error as terminal.

RADIUS Client API (V3)

Submit a bug report or feature request

Copyright 1998-2008 AXL Software. PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.