|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tinyradius.attribute.RadiusAttribute
public class RadiusAttribute
This class represents a generic Radius attribute. Subclasses implement methods to access the fields of special attributes.
| Constructor Summary | |
|---|---|
RadiusAttribute()
Constructs an empty Radius attribute. |
|
RadiusAttribute(int type,
byte[] data)
Constructs a Radius attribute with the specified type and data. |
|
| Method Summary | |
|---|---|
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()
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(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()
String representation for debugging purposes. |
byte[] |
writeAttribute()
Returns this attribute encoded as a byte array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RadiusAttribute()
public RadiusAttribute(int type,
byte[] data)
type - attribute type, see AttributeTypes.*data - attribute data| Method Detail |
|---|
public 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()
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 java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public AttributeType getAttributeTypeObject()
public static RadiusAttribute createRadiusAttribute(Dictionary dictionary,
int vendorId,
int attributeType)
dictionary - Dictionary to usevendorId - vendor ID or -1attributeType - attribute type
public static RadiusAttribute createRadiusAttribute(int vendorId,
int attributeType)
vendorId - vendor ID or -1attributeType - attribute type
public static RadiusAttribute createRadiusAttribute(int attributeType)
attributeType - attribute type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||