Class VendorSpecificAttribute
java.lang.Object
org.tinyradius.core.attribute.type.OctetsAttribute
org.tinyradius.core.attribute.type.VendorSpecificAttribute
- All Implemented Interfaces:
AttributeHolder<VendorSpecificAttribute>
,RadiusAttribute
public class VendorSpecificAttribute extends OctetsAttribute implements AttributeHolder<VendorSpecificAttribute>
Vendor-Specific attribute. Both an attribute itself and an attribute container for sub-attributes.
-
Field Summary
Fields Modifier and Type Field Description static byte
VENDOR_SPECIFIC
-
Constructor Summary
Constructors Constructor Description VendorSpecificAttribute(Dictionary dictionary, int vendorId, int attributeId, byte[] data)
VendorSpecificAttribute(Dictionary dictionary, int vendorId, int attributeId, java.lang.String data)
VendorSpecificAttribute(Dictionary dictionary, int childVendorId, java.util.List<RadiusAttribute> attributes)
Constructs a new Vendor-Specific attribute -
Method Summary
Modifier and Type Method Description java.util.List<RadiusAttribute>
flatten()
Returns set of all nested attributes if contains sub-attributes, otherwise singleton set of current attribute.java.util.List<RadiusAttribute>
getAttributes()
int
getChildVendorId()
java.lang.String
toString()
VendorSpecificAttribute
withAttributes(java.util.List<RadiusAttribute> attributes)
Methods inherited from class org.tinyradius.core.attribute.type.OctetsAttribute
decode, encode, equals, getAttributeName, getAttributeTemplate, getDictionary, getTag, getType, getValue, getValueString, getVendorId, hashCode, toByteArray
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.tinyradius.core.attribute.AttributeHolder
addAttribute, addAttribute, addAttribute, filterAttributes, filterAttributes, filterAttributes, filterAttributes, getAttribute, getAttribute, getAttributeBytes, getDictionary, removeAttribute, removeAttributes, removeLastAttribute
-
Field Details
-
VENDOR_SPECIFIC
public static final byte VENDOR_SPECIFIC- See Also:
- Constant Field Values
-
-
Constructor Details
-
VendorSpecificAttribute
public VendorSpecificAttribute(Dictionary dictionary, int vendorId, int attributeId, java.lang.String data)- Parameters:
dictionary
- dictionary to use for (sub)attributesvendorId
- ignored, VSAs should always be -1 (top level attribute)attributeId
- ignored, should always be Vendor-Specific (26)data
- data as hex to parse for childVendorId and sub-attributes
-
VendorSpecificAttribute
- Parameters:
dictionary
- dictionary to use for (sub)attributesvendorId
- ignored, VSAs should always be -1 (top level attribute)attributeId
- ignored, should always be Vendor-Specific (26)data
- data to parse for childVendorId and sub-attributes
-
VendorSpecificAttribute
public VendorSpecificAttribute(Dictionary dictionary, int childVendorId, java.util.List<RadiusAttribute> attributes)Constructs a new Vendor-Specific attribute- Parameters:
dictionary
- dictionary to use for (sub)attributeschildVendorId
- vendor ID of the sub-attributesattributes
- sub-attributes held
-
-
Method Details
-
getChildVendorId
public int getChildVendorId()- Specified by:
getChildVendorId
in interfaceAttributeHolder<VendorSpecificAttribute>
- Returns:
- VendorId to restrict (sub)attributes, or -1 for top level
-
getAttributes
- Specified by:
getAttributes
in interfaceAttributeHolder<VendorSpecificAttribute>
- Returns:
- list of RadiusAttributes
-
withAttributes
- Specified by:
withAttributes
in interfaceAttributeHolder<VendorSpecificAttribute>
-
flatten
Description copied from interface:RadiusAttribute
Returns set of all nested attributes if contains sub-attributes, otherwise singleton set of current attribute.- Specified by:
flatten
in interfaceRadiusAttribute
- Overrides:
flatten
in classOctetsAttribute
- Returns:
- List of RadiusAttributes
-
toString
public java.lang.String toString()- Overrides:
toString
in classOctetsAttribute
-