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 Details

    • getAttributes

      default java.util.List<RadiusAttribute> getAttributes​(int vendorId, byte type)
      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 -1
      type - attribute type code
      Returns:
      list of RadiusAttribute objects, or empty list
    • getAttributes

      default java.util.List<RadiusAttribute> getAttributes​(AttributeType type)
      Description copied from interface: AttributeHolder
      Returns attributes of the given attribute type. Also searches sub-attributes if appropriate.
      Specified by:
      getAttributes in interface AttributeHolder
      Parameters:
      type - attribute type name
      Returns:
      list of RadiusAttribute objects, or empty list
    • getAttribute

      default RadiusAttribute getAttribute​(int vendorId, byte type)
      Convenience method to get single attribute.

      If vendorId doesn't match childVendorId, will search sub-attributes.

      Parameters:
      vendorId - vendor ID, or -1
      type - attribute type
      Returns:
      RadiusAttribute object or null if there is no such attribute
    • addAttribute

      default void addAttribute​(RadiusAttribute attribute)
      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 interface AttributeHolder
      Parameters:
      attribute - RadiusAttribute object
    • removeAttribute

      default void removeAttribute​(RadiusAttribute attribute)
      Removes the specified attribute from this packet.
      Specified by:
      removeAttribute in interface AttributeHolder
      Parameters:
      attribute - RadiusAttribute to remove
    • removeSubAttribute

      default void removeSubAttribute​(RadiusAttribute attribute)
    • 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 -1
      typeCode - attribute type code
    • getVendorSpecificAttributes

      default java.util.List<VendorSpecificAttribute> getVendorSpecificAttributes​(int vendorId)
      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