org.tinyradius.packet
Class AccountingRequest

java.lang.Object
  extended by org.tinyradius.packet.RadiusPacket
      extended by org.tinyradius.packet.AccountingRequest

public class AccountingRequest
extends RadiusPacket

This class represents a Radius packet of the type "Accounting-Request".


Field Summary
static int ACCT_STATUS_TYPE_ACCOUNTING_OFF
          Acct-Status-Type: Accounting-Off
static int ACCT_STATUS_TYPE_ACCOUNTING_ON
          Acct-Status-Type: Accounting-On
static int ACCT_STATUS_TYPE_INTERIM_UPDATE
          Acct-Status-Type: Interim Update/Alive
static int ACCT_STATUS_TYPE_START
          Acct-Status-Type: Start
static int ACCT_STATUS_TYPE_STOP
          Acct-Status-Type: Stop
 
Fields inherited from class org.tinyradius.packet.RadiusPacket
ACCESS_ACCEPT, ACCESS_CHALLENGE, ACCESS_REJECT, ACCESS_REQUEST, ACCOUNTING_MESSAGE, ACCOUNTING_REQUEST, ACCOUNTING_RESPONSE, ACCOUNTING_STATUS, COA_ACK, COA_NAK, COA_REQUEST, DISCONNECT_ACK, DISCONNECT_NAK, DISCONNECT_REQUEST, MAX_PACKET_LENGTH, PASSWORD_ACCEPT, PASSWORD_REJECT, PASSWORD_REQUEST, RADIUS_HEADER_LENGTH, RESERVED, STATUS_ACCEPT, STATUS_CLIENT, STATUS_REJECT, STATUS_REQUEST, STATUS_SERVER
 
Constructor Summary
AccountingRequest()
          Constructs an empty Accounting-Request to be received by a Radius client.
AccountingRequest(java.lang.String userName, int acctStatusType)
          Constructs an Accounting-Request packet to be sent to a Radius server.
 
Method Summary
 int getAcctStatusType()
          Retrieves the user name from the User-Name attribute.
 java.lang.String getUserName()
          Retrieves the user name from the User-Name attribute.
 void setAcctStatusType(int acctStatusType)
          Sets the Acct-Status-Type attribute of this Accountnig-Request.
 void setUserName(java.lang.String userName)
          Sets the User-Name attribute of this Accountnig-Request.
protected  byte[] updateRequestAuthenticator(java.lang.String sharedSecret, int packetLength, byte[] attributes)
          Calculates the request authenticator as specified by RFC 2866.
 
Methods inherited from class org.tinyradius.packet.RadiusPacket
addAttribute, addAttribute, checkResponseAuthenticator, createRadiusPacket, createRequestAuthenticator, createResponseAuthenticator, decodePacket, decodeRequestAttributes, decodeRequestPacket, decodeRequestPacket, decodeResponsePacket, decodeResponsePacket, encodePacket, encodeRequestAttributes, encodeRequestPacket, encodeResponsePacket, getAttribute, getAttribute, getAttribute, getAttributeBytes, getAttributes, getAttributes, getAttributes, getAttributeValue, getAuthenticator, getDictionary, getMd5Digest, getNextPacketIdentifier, getPacketIdentifier, getPacketType, getPacketTypeName, getVendorAttribute, getVendorAttributes, removeAttribute, removeAttributes, removeAttributes, removeLastAttribute, setAttributes, setAuthenticator, setDictionary, setPacketIdentifier, setPacketType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ACCT_STATUS_TYPE_START

public static final int ACCT_STATUS_TYPE_START
Acct-Status-Type: Start

See Also:
Constant Field Values

ACCT_STATUS_TYPE_STOP

public static final int ACCT_STATUS_TYPE_STOP
Acct-Status-Type: Stop

See Also:
Constant Field Values

ACCT_STATUS_TYPE_INTERIM_UPDATE

public static final int ACCT_STATUS_TYPE_INTERIM_UPDATE
Acct-Status-Type: Interim Update/Alive

See Also:
Constant Field Values

ACCT_STATUS_TYPE_ACCOUNTING_ON

public static final int ACCT_STATUS_TYPE_ACCOUNTING_ON
Acct-Status-Type: Accounting-On

See Also:
Constant Field Values

ACCT_STATUS_TYPE_ACCOUNTING_OFF

public static final int ACCT_STATUS_TYPE_ACCOUNTING_OFF
Acct-Status-Type: Accounting-Off

See Also:
Constant Field Values
Constructor Detail

AccountingRequest

public AccountingRequest(java.lang.String userName,
                         int acctStatusType)
Constructs an Accounting-Request packet to be sent to a Radius server.

Parameters:
userName - user name
acctStatusType - ACCT_STATUS_TYPE_*

AccountingRequest

public AccountingRequest()
Constructs an empty Accounting-Request to be received by a Radius client.

Method Detail

setUserName

public void setUserName(java.lang.String userName)
Sets the User-Name attribute of this Accountnig-Request.

Parameters:
userName - user name to set

getUserName

public java.lang.String getUserName()
                             throws RadiusException
Retrieves the user name from the User-Name attribute.

Returns:
user name
Throws:
RadiusException

setAcctStatusType

public void setAcctStatusType(int acctStatusType)
Sets the Acct-Status-Type attribute of this Accountnig-Request.

Parameters:
acctStatusType - ACCT_STATUS_TYPE_* to set

getAcctStatusType

public int getAcctStatusType()
                      throws RadiusException
Retrieves the user name from the User-Name attribute.

Returns:
user name
Throws:
RadiusException

updateRequestAuthenticator

protected byte[] updateRequestAuthenticator(java.lang.String sharedSecret,
                                            int packetLength,
                                            byte[] attributes)
Calculates the request authenticator as specified by RFC 2866.

Overrides:
updateRequestAuthenticator in class RadiusPacket
Parameters:
sharedSecret - shared secret
packetLength - length of the final Radius packet
attributes - attribute data
Returns:
new request authenticator
See Also:
RadiusPacket.updateRequestAuthenticator(java.lang.String, int, byte[])