|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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-attributes| Method Detail |
|---|
public void setChildVendorId(int childVendorId)
childVendorId - public int getChildVendorId()
public void setDictionary(Dictionary dictionary)
setDictionary in class RadiusAttributedictionary - dictionary to setRadiusAttribute.setDictionary(org.tinyradius.dictionary.Dictionary)public void addSubAttribute(RadiusAttribute attribute)
attribute - sub-attribute to add
public 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 type
public 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
RadiusExceptionpublic byte[] writeAttribute()
writeAttribute in class RadiusAttributeRadiusAttribute.writeAttribute()
public void readAttribute(byte[] data,
int offset,
int length)
throws RadiusException
readAttribute in class RadiusAttributeRadiusExceptionRadiusAttribute.readAttribute(byte[], int,
int)public java.lang.String toString()
toString in class RadiusAttributeRadiusAttribute.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||