Package org.tinyradius.attribute.util
Interface NestedAttributeHolder
- All Superinterfaces:
AttributeHolder
- All Known Subinterfaces:
MessageAuthSupport<T>
,RadiusPacket
- All Known Implementing Classes:
AccessRequest
,AccessRequestChap
,AccessRequestEap
,AccessRequestPap
,AccessResponse
,AccountingRequest
,BaseRadiusPacket
,RadiusRequest
,RadiusResponse
public interface NestedAttributeHolder extends AttributeHolder
AttributeHolder that supports sub-attributes (Vendor-Specific Attributes) and filtering by vendorId
-
Method Summary
Modifier and Type Method Description default void
addAttribute(RadiusAttribute attribute)
Adds a Radius attribute to this packet.default RadiusAttribute
getAttribute(int vendorId, byte type)
Convenience method to get single attribute.default java.util.List<RadiusAttribute>
getAttributes(int vendorId, byte type)
Returns all attributes of this packet that match the given type and vendorId.default java.util.List<RadiusAttribute>
getAttributes(AttributeType type)
Returns attributes of the given attribute type.default java.util.List<VendorSpecificAttribute>
getVendorSpecificAttributes(int vendorId)
Returns the Vendor-Specific attribute(s) for the given vendor ID.default void
removeAttribute(RadiusAttribute attribute)
Removes the specified attribute from this packet.default void
removeAttributes(int vendorId, byte typeCode)
Removes all (sub)attributes of the given vendor and type.default void
removeSubAttribute(RadiusAttribute attribute)
Methods inherited from interface org.tinyradius.attribute.util.AttributeHolder
addAttribute, addAttribute, getAttribute, getAttribute, getAttributeBytes, getAttributeMap, getAttributes, getAttributes, getAttributes, getAttributeString, getChildVendorId, getDictionary, lookupAttributeType, removeAttributes, removeLastAttribute
-
Method Details
-
getAttributes
Returns all attributes of this packet that match the given type and vendorId.If vendorId doesn't match childVendorId, will search sub-attributes.
- Parameters:
vendorId
- vendor ID, or -1type
- attribute type code- Returns:
- list of RadiusAttribute objects, or empty list
-
getAttributes
Description copied from interface:AttributeHolder
Returns attributes of the given attribute type. Also searches sub-attributes if appropriate.- Specified by:
getAttributes
in interfaceAttributeHolder
- Parameters:
type
- attribute type name- Returns:
- list of RadiusAttribute objects, or empty list
-
getAttribute
Convenience method to get single attribute.If vendorId doesn't match childVendorId, will search sub-attributes.
- Parameters:
vendorId
- vendor ID, or -1type
- attribute type- Returns:
- RadiusAttribute object or null if there is no such attribute
-
addAttribute
Adds a Radius attribute to this packet. Can also be used to add Vendor-Specific sub-attributes. If a attribute with a vendor code != -1 is passed in, a VendorSpecificAttribute is created for the sub-attribute.- Specified by:
addAttribute
in interfaceAttributeHolder
- Parameters:
attribute
- RadiusAttribute object
-
removeAttribute
Removes the specified attribute from this packet.- Specified by:
removeAttribute
in interfaceAttributeHolder
- Parameters:
attribute
- RadiusAttribute to remove
-
removeSubAttribute
-
removeAttributes
default void removeAttributes(int vendorId, byte typeCode)Removes all (sub)attributes of the given vendor and type.If vendorId doesn't match childVendorId, will search sub-attributes.
- Parameters:
vendorId
- vendor ID, or -1typeCode
- attribute type code
-
getVendorSpecificAttributes
Returns the Vendor-Specific attribute(s) for the given vendor ID.- Parameters:
vendorId
- vendor ID to filter by- Returns:
- List with VendorSpecificAttribute objects, or empty list
-