public class RadiusAttribute
extends java.lang.Object
Constructor and Description |
---|
RadiusAttribute()
Constructs an empty Radius attribute.
|
RadiusAttribute(int type,
byte[] data)
Constructs a Radius attribute with the specified
type and data.
|
Modifier and Type | Method and Description |
---|---|
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.
|
java.lang.String |
getAttributeValue() |
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)
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(java.lang.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.
|
java.lang.String |
toString() |
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(java.lang.String value)
value
- value as a stringpublic java.lang.String getAttributeValue()
public int getVendorId()
public void setVendorId(int vendorId)
vendorId
- vendor IDpublic Dictionary getDictionary()
public void setDictionary(Dictionary dictionary)
dictionary
- Dictionary class to useDefaultDictionary
public byte[] writeAttribute()
public void readAttribute(byte[] data, int offset) throws RadiusException
data
- input dataoffset
- byte to start reading fromRadiusException
- malformed packetpublic java.lang.String toString()
toString
in class java.lang.Object
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 type