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 inherited from interface org.tinyradius.core.attribute.AttributeHolder
attrHolderLogger
-
Constructor Summary
ConstructorDescriptionVendorSpecificAttribute
(Dictionary dictionary, int vendorId, io.netty.buffer.ByteBuf data) VendorSpecificAttribute
(Dictionary dictionary, int childVendorId, List<RadiusAttribute> attributes) Constructs a new Vendor-Specific attribute -
Method Summary
Modifier and TypeMethodDescriptionDecodes attribute.Encodes attribute.boolean
flatten()
Returns set of all nested attributes if contains sub-attributes, otherwise singleton set of current attribute.int
int
hashCode()
toString()
withAttributes
(List<RadiusAttribute> attributes) Methods inherited from class org.tinyradius.core.attribute.type.OctetsAttribute
getData, getDictionary, getTag, getValue, getValueString, getVendorId, stringHexParser
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, decodeAttributes, encodeAttributes, getAttribute, getAttribute, getAttributeByteBuf, getAttributes, getAttributes, getAttributes, getAttributes, getDictionary, removeAttribute, removeAttributes, removeLastAttribute
Methods inherited from interface org.tinyradius.core.attribute.type.RadiusAttribute
getAttributeName, getAttributeTemplate, getHeaderSize, getLength, getLengthSize, getTagSize, getType, getTypeSize, getVendor, isEncoded, isTagged, toByteArray, toByteBuf
-
Field Details
-
VENDOR_SPECIFIC
public static final byte VENDOR_SPECIFIC- See Also:
-
-
Constructor Details
-
VendorSpecificAttribute
- Parameters:
dictionary
- dictionary to use for (sub)attributesvendorId
- ignored, VSAs should always be -1 (top level attribute)data
- data to parse for childVendorId and sub-attributes
-
VendorSpecificAttribute
public VendorSpecificAttribute(Dictionary dictionary, int childVendorId, 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
- Returns:
- List of RadiusAttributes
-
encode
public VendorSpecificAttribute encode(byte[] requestAuth, String secret) throws RadiusPacketException Description copied from interface:RadiusAttribute
Encodes attribute. Must be idempotent.- Specified by:
encode
in interfaceRadiusAttribute
- Overrides:
encode
in classOctetsAttribute
- Parameters:
requestAuth
- (corresponding) request packet authenticatorsecret
- shared secret to encode with- Returns:
- attribute with encoded data
- Throws:
RadiusPacketException
- errors encoding attribute
-
decode
public VendorSpecificAttribute decode(byte[] requestAuth, String secret) throws RadiusPacketException Description copied from interface:RadiusAttribute
Decodes attribute. Must be idempotent.- Specified by:
decode
in interfaceRadiusAttribute
- Parameters:
requestAuth
- (corresponding) request packet authenticatorsecret
- shared secret to encode with- Returns:
- attribute with encoded data
- Throws:
RadiusPacketException
- errors decoding attribute
-
toString
- Overrides:
toString
in classOctetsAttribute
-
equals
- Overrides:
equals
in classOctetsAttribute
-
hashCode
public int hashCode()- Overrides:
hashCode
in classOctetsAttribute
-