|
RADIUS Client API (V3) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectRADIUSDictionary
ParseAttribute
Parse a line and return the attribute(s) found. The class should be loaded with a RADIUS dictionary since it initially is empty of attributes.
The format for attributes is [name] '=' [value]. Values are represented as follows:
Integers start with '#'.
IP addresses start with '@'
Strings are surrounded by double quotation marks
Binary values start with 0X or 0x.
Symbolic values are themselves
For example the Service-Type attribute has a value of 'Login' with an integer value of 1.
Time values start with 'T' and have the form 'YYYY-MM-DD-hr:min:sec;
For example:
User-Name = "Michael"
Service-Type = Login
Service-Type = #1
NAS-IP-Address = @127.0.0.1
State = 0x456789012345
Event_Timestamp = !2003-01-22-03:22:59
This class can be used to create new configuration attributes that are outside
the normal attribute range, for example addAttribute("Digest00-User-Name", 1010, RADIUSDictionary.STRING);.
| Field Summary |
| Fields inherited from class RADIUSDictionary |
DATE, ENCRYPT1, ENCRYPT2, ENCRYPT3, INTEGER, IPADDRESS, LONG_TAGS, OCTETS, SHORT_TAGS, STRING, TUNNEL, UNKNOWN, UNKNOWN_DATA_TYPE, UNKNOWN_VENDOR |
| Constructor Summary | |
ParseAttribute()
Default constructor. |
|
| Method Summary | |
void |
addAttribute(String attributeName,
int tagValue,
int type)
Add an attribute to the permited attributes. |
Attribute |
convertToAttribute(ParseAttribute.VP vp)
Given a value-pair convert it to an attribute. |
Attribute |
convertToAttributeValue(int vendorId,
int tag,
ParseAttribute.VP vp)
Convert the attribute string encoding value to an attribute value for a VSA. |
Attribute |
convertToAttributeValue(int tag,
ParseAttribute.VP vp)
Convert the attribute string encoding value to an attribute value. |
void |
merge(RADIUSDictionary dict)
Add a dictionary file. |
AttributeList |
toAttributes(String line)
Convert a line to an attribute list (likely containing one attribute). |
AttributeList |
toAttributes(String[] lines)
Convert an array of lines to an attribute list. |
| Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ParseAttribute()
| Method Detail |
public void merge(RADIUSDictionary dict)
DefaultDictionary.
merge in class RADIUSDictionarydict - RADIUSDictionary.public AttributeList toAttributes(String line)
line - The line of data to convert to an attribute.
public AttributeList toAttributes(String[] lines)
lines - The lines of data to convert to an attribute.
public void addAttribute(String attributeName,
int tagValue,
int type)
addAttribute in class RADIUSDictionaryattributeName - Attribute name.tagValue - Tag value.type - Data type - one of
RADIUSDictionary.INTEGER,
RADIUSDictionary.OCTETS,
RADIUSDictionary.STRING,
RADIUSDictionary.DATE,
or
RADIUSDictionary.IPADDRESS.
public Attribute convertToAttribute(ParseAttribute.VP vp)
throws IllegalArgumentException
vp - VP object.
Exception - if the attribute name cannot be found or there's an error
converting a value.
IllegalArgumentException
public Attribute convertToAttributeValue(int vendorId,
int tag,
ParseAttribute.VP vp)
throws IllegalArgumentException
vendorId - Vendor Id.tag - Attribute tag value.vp - VP object.
IllegalArgumentException - if the attribute name cannot be found or there's an error
converting a value.
public Attribute convertToAttributeValue(int tag,
ParseAttribute.VP vp)
throws IllegalArgumentException
tag - Attribute tag value.vp - VP object.
Exception - if the attribute name cannot be found or there's an error
converting a value.
IllegalArgumentException
|
RADIUS Client API (V3) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||