AXL RADIUS Server API V3

com.theorem.radserver3
Class AccountingInfo

Object
  extended byPacketInfo
      extended byAccountingInfo

public class AccountingInfo
extends PacketInfo

Class to pass information to and from an Accounting request..


Field Summary
static int SHOW_NAMES
          Custom logging flag - Show attribute names.
static int SHOW_NOTHING
          Custom logging flag - Suppress the display of the attribute tag.
static int SHOW_NUMBERS
          Custom logging flag - Show attribute numbers.
static int TIME1
          Custom logging pseudo-attribute to display dateTime1.
static int TIME2
          Custom logging pseudo-attribute to display dateTime1.
 
Fields inherited from class PacketInfo
AUTH_LENGTH, AUTH_STATE_OBJECT
 
Method Summary
 Date getAcctDelayDate(Attribute acctDelayTime)
          Get the Acct-Delay-Time attribute value and return the corrected time.
 AttributeList getClassAttributeList()
          Get the accounting Class information.
 String getLivingstonEntry()
          Get a Livingston standard accounting record.
 Object getModule()
          Retrieves the module (ModuleRegister) object.
 String getMSNTEntry()
          Get a Microsoft accounting record for an IAS-formatted log file.
 String getNASAddress()
          Get NAS IP address.
 String getSessionID()
          Get the Acct-Session-ID attribute value.
 String getSyslogEntry()
          Get a syslog style log entry.
 String getTime()
          Get the formatted current time.
 void setDateFormat(String format)
          Set log time format in java.text.SimpleDateFormat format.
 
Methods inherited from class PacketInfo
addProxyTarget, appendResponseAttributes, cmp, decode, encode, fromAccountingPort, fromAuthenticationPort, getAuthenticator, getDatagram, getDecodedUserPassword, getHostRealm, getMaximumPacketSize, getMessageID, getModule, getName, getNAS, getPacketID, getPacketTypeName, getPrefix, getProxyClient, getProxyStateAttributesLength, getProxyTargetByRealm, getProxyTargets, getRADIUSServer, getRealm, getRealmInfo, getRealmList, getRequestAttributeList, getRequestAttributes, getRequestType, getRequestTypeName, getResponseAttributeList, getResponseType, getResponseTypeName, getSecret, getServerName, getSourceAddress, getSourcePort, getStateObject, getUserName, getUserPassword, removeProxyTarget, sendV2Trap, setResponseAttributes, setResponseAttributes, setResponseType, setStateObject, translateProxyId, trim
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHOW_NAMES

public static final int SHOW_NAMES
Custom logging flag - Show attribute names.

See Also:
Constant Field Values

SHOW_NOTHING

public static final int SHOW_NOTHING
Custom logging flag - Suppress the display of the attribute tag.

See Also:
Constant Field Values

SHOW_NUMBERS

public static final int SHOW_NUMBERS
Custom logging flag - Show attribute numbers.

See Also:
Constant Field Values

TIME1

public static final int TIME1
Custom logging pseudo-attribute to display dateTime1.

See Also:
Constant Field Values

TIME2

public static final int TIME2
Custom logging pseudo-attribute to display dateTime1.

See Also:
Constant Field Values
Method Detail

getAcctDelayDate

public Date getAcctDelayDate(Attribute acctDelayTime)
Get the Acct-Delay-Time attribute value and return the corrected time. The Acct-Delay-Time attribute holds the the time in seconds that the client has been delayed in sending this accounting record. It will be subtracted from the server's time to determine an approximate time for the actual accounting record.

Parameters:
acctDelayTime - Acct-Delay-Time attribute.
Returns:
The corrected date.

getClassAttributeList

public AttributeList getClassAttributeList()
Get the accounting Class information.

Returns:
All the accounting Class attributes. If there are none the list will be empty.

getLivingstonEntry

public String getLivingstonEntry()
Get a Livingston standard accounting record. This is a record in a detail file. All attributes in the Accounting-Request are listed. It looks something like this:
 Tue Feb 5 12:56:28 2002
 Acct-Session-Id = "HTS03"
 User-Name = "michael"
 NAS-IP-Address = 192.168.1.1
 NAS-Port = 1
 NAS-Port-Type = Async
 Acct-Status-Type = Start
 Acct-Authentic = RADIUS
 Service-Type = Login-User
 Login-Service = Telnet
 Login-IP-Host = 192.168.1.101
 Acct-Delay-Time = 0
 Timestamp = 1012931752
 

Returns:
Log entry.

getModule

public Object getModule()
Retrieves the module (ModuleRegister) object.

For example, if you have a module called TEST use TEST t = ((TEST) getModule().test);

Returns:
ModuleRegister object.

getMSNTEntry

public String getMSNTEntry()
Get a Microsoft accounting record for an IAS-formatted log file. It contains the NAS address, User-Name, Record date, Record time, "IAS" service name, RADIUS server name, and all other attributes and their values separated by commas.
 192.168.1.1,NASA,07/03/2002,14:42:19,IAS,radius.auth,6,2,7,1,5,9,61,5,64,1,65,1,31,1
 

Returns:
Log entry.

getNASAddress

public String getNASAddress()
Get NAS IP address. This will either be from the NAS-IP-Address and failing that the source address.

Returns:
NAS address.

getSessionID

public String getSessionID()
Get the Acct-Session-ID attribute value.

Returns:
Acct-Session-ID value or the string "NONE" if it doesn't exist.

getSyslogEntry

public String getSyslogEntry()
Get a syslog style log entry. Like: mm dd HH:MM:SS NAS-IP-Address: port NAS-Port id Acct-Session-Id: User-Name [start | stop] {Type=Async|Sync} {Proto=PPP|SLIP} {Service=Telnet|Rlogin|TCP-Clear} {Host=Login-IP-Host} {Speed=Connect-Speed} {Time=Acct-Session-Time} {Cause=Acct-Terminate-Cause}.

Returns:
Log entry.

getTime

public String getTime()
Get the formatted current time.

Returns:
date and time in the current SimpleDateFormat.

setDateFormat

public void setDateFormat(String format)
Set log time format in java.text.SimpleDateFormat format. The default is MM/dd/yyyy HH:mm:ss.

Parameters:
format - SimpleDateFormat format.

AXL RADIUS Server 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.