Class EncodedAttribute
java.lang.Object
org.tinyradius.core.attribute.type.EncodedAttribute
- All Implemented Interfaces:
RadiusAttribute
Wrapper around attributes encoded with one of
AttributeCodecType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDecodes attribute.boolean
io.netty.buffer.ByteBuf
getData()
RadiusAttribute.toByteBuf()
is preferred if caller exposes a reference to the ByteBuf elsewhere to avoid mutating netty ref countsgetTag()
int
getType()
byte[]
getValue()
int
int
hashCode()
boolean
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.tinyradius.core.attribute.type.RadiusAttribute
encode, flatten, getAttributeName, getAttributeTemplate, getHeaderSize, getLength, getLengthSize, getTagSize, getTypeSize, getVendor, isTagged, toByteArray, toByteBuf
-
Constructor Details
-
EncodedAttribute
-
-
Method Details
-
getVendorId
public int getVendorId()- Specified by:
getVendorId
in interfaceRadiusAttribute
- Returns:
- vendor Id if Vendor-Specific attribute or sub-attribute, otherwise -1
-
getType
public int getType()- Specified by:
getType
in interfaceRadiusAttribute
- Returns:
- attribute type code, typically 0-255
-
getTag
- Specified by:
getTag
in interfaceRadiusAttribute
- Returns:
- Tag if available and specified for attribute type (RFC2868)
-
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 interfaceRadiusAttribute
- Returns:
- underlying ByteBuf for attribute, includes attribute header, (optional) tag, and value
-
getValue
public byte[] getValue()- Specified by:
getValue
in interfaceRadiusAttribute
- Returns:
- attribute data as raw bytes
-
getValueString
- Specified by:
getValueString
in interfaceRadiusAttribute
- Returns:
- value of this attribute as a hex string.
-
decode
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
-
isEncoded
public boolean isEncoded()- Specified by:
isEncoded
in interfaceRadiusAttribute
-
getDictionary
- Specified by:
getDictionary
in interfaceRadiusAttribute
- Returns:
- dictionary that attribute uses
-
toString
-
equals
-
hashCode
public int hashCode()
-