Class AnonSubAttribute

java.lang.Object
org.tinyradius.core.attribute.type.AnonSubAttribute
All Implemented Interfaces:
RadiusAttribute

public class AnonSubAttribute extends Object implements RadiusAttribute
Represents an unparsable VSA sub-attribute.

As per RFC 2865: The String field is one or more octets. The actual format of the information is site or application specific, and a robust implementation SHOULD support the field as undistinguished octets.

Typically used when Vendor can't be looked up, so we can't determine size of sub-attribute 'type' and 'length' fields.

If Vendor is found, but attribute isn't, we typically use OctetsAttribute instead as we can still read the sub-attribute metadata.

  • Constructor Details

    • AnonSubAttribute

      public AnonSubAttribute(Dictionary dictionary, int vendorId, io.netty.buffer.ByteBuf data)
  • Method Details

    • getVendorId

      public int getVendorId()
      Specified by:
      getVendorId in interface RadiusAttribute
      Returns:
      vendor Id if Vendor-Specific attribute or sub-attribute, otherwise -1
    • getType

      public int getType()
      Specified by:
      getType in interface RadiusAttribute
      Returns:
      attribute type code, typically 0-255
    • getTag

      public Optional<Byte> getTag()
      Specified by:
      getTag in interface RadiusAttribute
      Returns:
      Tag if available and specified for attribute type (RFC2868)
    • getValue

      public byte[] getValue()
      Specified by:
      getValue in interface RadiusAttribute
      Returns:
      attribute data as raw bytes
    • getValueString

      public String getValueString()
      Specified by:
      getValueString in interface RadiusAttribute
      Returns:
      value of this attribute as a hex string.
    • getDictionary

      public Dictionary getDictionary()
      Specified by:
      getDictionary in interface RadiusAttribute
      Returns:
      dictionary that attribute uses
    • getData

      public io.netty.buffer.ByteBuf getData()
      Description copied from interface: RadiusAttribute
      RadiusAttribute.toByteBuf() is preferred if caller exposes a reference to the ByteBuf elsewhere to avoid mutating netty ref counts
      Specified by:
      getData in interface RadiusAttribute
      Returns:
      underlying ByteBuf for attribute, includes attribute header, (optional) tag, and value
    • toString

      public String toString()
      Overrides:
      toString in class Object