public class AccountingRequest extends RadiusPacket
Modifier and Type | Field and Description |
---|---|
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
|
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 and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkRequestAuthenticator(java.lang.String sharedSecret,
int packetLength,
byte[] attributes)
Checks the received clientRequest authenticator as specified by RFC 2866.
|
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 Accounting-Request.
|
protected byte[] |
updateRequestAuthenticator(java.lang.String sharedSecret,
int packetLength,
byte[] attributes)
Calculates the clientRequest authenticator as specified by RFC 2866.
|
addAttribute, addAttribute, checkResponseAuthenticator, createRadiusPacket, 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
public static final int ACCT_STATUS_TYPE_START
public static final int ACCT_STATUS_TYPE_STOP
public static final int ACCT_STATUS_TYPE_INTERIM_UPDATE
public static final int ACCT_STATUS_TYPE_ACCOUNTING_ON
public static final int ACCT_STATUS_TYPE_ACCOUNTING_OFF
public AccountingRequest(java.lang.String userName, int acctStatusType)
userName
- user nameacctStatusType
- ACCT_STATUS_TYPE_*public AccountingRequest()
public void setUserName(java.lang.String userName)
userName
- user name to setpublic java.lang.String getUserName()
public void setAcctStatusType(int acctStatusType)
acctStatusType
- ACCT_STATUS_TYPE_* to setpublic int getAcctStatusType()
protected byte[] updateRequestAuthenticator(java.lang.String sharedSecret, int packetLength, byte[] attributes)
updateRequestAuthenticator
in class RadiusPacket
sharedSecret
- shared secretpacketLength
- length of the final Radius packetattributes
- attribute dataRadiusPacket.updateRequestAuthenticator(java.lang.String, int, byte[])
protected void checkRequestAuthenticator(java.lang.String sharedSecret, int packetLength, byte[] attributes) throws RadiusException
checkRequestAuthenticator
in class RadiusPacket
sharedSecret
- shared secretpacketLength
- total length of the packetattributes
- clientRequest attribute dataRadiusException
- malformed packet