public class RadiusAttribute extends Object
| 构造器和说明 |
|---|
RadiusAttribute()
Constructs an empty Radius attribute.
|
RadiusAttribute(int type,
byte[] data)
Constructs a Radius attribute with the specified
type and data.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static RadiusAttribute |
createRadiusAttribute(Dictionary dictionary,
int vendorId,
int attributeType)
Creates a RadiusAttribute object of the appropriate type.
|
static RadiusAttribute |
createRadiusAttribute(int attributeType)
Creates a Radius attribute.
|
static RadiusAttribute |
createRadiusAttribute(int vendorId,
int attributeType)
Creates a Radius attribute, including vendor-specific
attributes.
|
byte[] |
getAttributeData()
Returns the data for this attribute.
|
int |
getAttributeType()
Returns the type of this Radius attribute.
|
AttributeType |
getAttributeTypeObject()
Retrieves an AttributeType object for this attribute.
|
String |
getAttributeValue()
Gets the value of this attribute as a string.
|
Dictionary |
getDictionary()
Returns the dictionary this Radius attribute uses.
|
int |
getVendorId()
Gets the Vendor-Id of the Vendor-Specific attribute this
attribute belongs to.
|
void |
readAttribute(byte[] data,
int offset,
int length)
Reads in this attribute from the passed byte array.
|
void |
setAttributeData(byte[] attributeData)
Sets the data for this attribute.
|
void |
setAttributeType(int attributeType)
Sets the type of this Radius attribute.
|
void |
setAttributeValue(String value)
Sets the value of the attribute using a string.
|
void |
setDictionary(Dictionary dictionary)
Sets a custom dictionary to use.
|
void |
setVendorId(int vendorId)
Sets the Vendor-Id of the Vendor-Specific attribute this
attribute belongs to.
|
String |
toString()
String representation for debugging purposes.
|
byte[] |
writeAttribute()
Returns this attribute encoded as a byte array.
|
public RadiusAttribute()
public RadiusAttribute(int type,
byte[] data)
type - attribute type, see AttributeTypes.*data - attribute datapublic byte[] getAttributeData()
public void setAttributeData(byte[] attributeData)
attributeData - attribute datapublic int getAttributeType()
public void setAttributeType(int attributeType)
attributeType - type code, 0-255public void setAttributeValue(String value)
value - value as a stringpublic String getAttributeValue()
RadiusException - if the value is invalidpublic int getVendorId()
public void setVendorId(int vendorId)
vendorId - vendor IDpublic Dictionary getDictionary()
public void setDictionary(Dictionary dictionary)
dictionary - Dictionary class to useDefaultDictionarypublic byte[] writeAttribute()
public void readAttribute(byte[] data,
int offset,
int length)
throws RadiusException
data - RadiusExceptionpublic String toString()
toString 在类中 ObjectObject.toString()public AttributeType getAttributeTypeObject()
public static RadiusAttribute createRadiusAttribute(Dictionary dictionary, int vendorId, int attributeType)
dictionary - Dictionary to usevendorId - vendor ID or -1attributeType - attribute typepublic static RadiusAttribute createRadiusAttribute(int vendorId, int attributeType)
vendorId - vendor ID or -1attributeType - attribute typepublic static RadiusAttribute createRadiusAttribute(int attributeType)
attributeType - attribute typeCopyright © 2016. All rights reserved.