|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.tinyradius.attribute.RadiusAttribute org.tinyradius.attribute.VendorSpecificAttribute
public class VendorSpecificAttribute
This class represents a "Vendor-Specific" attribute.
Field Summary | |
---|---|
static int |
VENDOR_SPECIFIC
Radius attribute type code for Vendor-Specific |
Constructor Summary | |
---|---|
VendorSpecificAttribute()
Constructs an empty Vendor-Specific attribute that can be read from a Radius packet. |
|
VendorSpecificAttribute(int vendorId)
Constructs a new Vendor-Specific attribute to be sent. |
Method Summary | |
---|---|
void |
addSubAttribute(RadiusAttribute attribute)
Adds a sub-attribute to this attribute. |
void |
addSubAttribute(java.lang.String name,
java.lang.String value)
Adds a sub-attribute with the specified name to this attribute. |
int |
getChildVendorId()
Returns the vendor ID of the sub-attributes. |
RadiusAttribute |
getSubAttribute(int type)
Returns a sub-attribute of the given type which may only occur once in this attribute. |
RadiusAttribute |
getSubAttribute(java.lang.String type)
Returns a single sub-attribute of the given type name. |
java.util.List |
getSubAttributes()
Returns the list of sub-attributes. |
java.util.List |
getSubAttributes(int attributeType)
Returns all sub-attributes of this attribut which have the given type. |
java.lang.String |
getSubAttributeValue(java.lang.String type)
Returns the value of the Radius attribute of the given type or null if there is no such attribute. |
void |
readAttribute(byte[] data,
int offset,
int length)
Reads a Vendor-Specific attribute and decodes the internal sub-attribute structure. |
void |
removeSubAttribute(RadiusAttribute attribute)
Removes the specified sub-attribute from this attribute. |
void |
setChildVendorId(int childVendorId)
Sets the vendor ID of the child attributes. |
void |
setDictionary(Dictionary dictionary)
Also copies the new dictionary to sub-attributes. |
java.lang.String |
toString()
Returns a string representation for debugging. |
byte[] |
writeAttribute()
Renders this attribute as a byte array. |
Methods inherited from class org.tinyradius.attribute.RadiusAttribute |
---|
createRadiusAttribute, createRadiusAttribute, createRadiusAttribute, getAttributeData, getAttributeType, getAttributeTypeObject, getAttributeValue, getDictionary, getVendorId, setAttributeData, setAttributeType, setAttributeValue, setVendorId |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int VENDOR_SPECIFIC
Constructor Detail |
---|
public VendorSpecificAttribute()
public VendorSpecificAttribute(int vendorId)
vendorId
- vendor ID of the sub-attributesMethod Detail |
---|
public void setChildVendorId(int childVendorId)
childVendorId
- public int getChildVendorId()
public void setDictionary(Dictionary dictionary)
setDictionary
in class RadiusAttribute
dictionary
- dictionary to setRadiusAttribute.setDictionary(org.tinyradius.dictionary.Dictionary)
public void addSubAttribute(RadiusAttribute attribute)
attribute
- sub-attribute to addpublic void addSubAttribute(java.lang.String name, java.lang.String value)
name
- name of the sub-attributevalue
- value of the sub-attribute
java.lang.IllegalArgumentException
- invalid sub-attribute name or valuepublic void removeSubAttribute(RadiusAttribute attribute)
attribute
- RadiusAttribute to removepublic java.util.List getSubAttributes()
public java.util.List getSubAttributes(int attributeType)
attributeType
- type of sub-attributes to get
public RadiusAttribute getSubAttribute(int type)
type
- sub-attribute type
java.lang.RuntimeException
- if there are multiple occurences of the
requested sub-attribute typepublic RadiusAttribute getSubAttribute(java.lang.String type) throws RadiusException
type
- attribute type name
java.lang.RuntimeException
- if the attribute occurs multiple times
RadiusException
public java.lang.String getSubAttributeValue(java.lang.String type) throws RadiusException
type
- attribute type name
java.lang.IllegalArgumentException
- if the type name is unknown
java.lang.RuntimeException
- attribute occurs multiple times
RadiusException
public byte[] writeAttribute()
writeAttribute
in class RadiusAttribute
RadiusAttribute.writeAttribute()
public void readAttribute(byte[] data, int offset, int length) throws RadiusException
readAttribute
in class RadiusAttribute
RadiusException
RadiusAttribute.readAttribute(byte[], int,
int)
public java.lang.String toString()
toString
in class RadiusAttribute
RadiusAttribute.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |