Class OctetsAttribute
java.lang.Object
org.tinyradius.core.attribute.type.OctetsAttribute
- All Implemented Interfaces:
RadiusAttribute
- Direct Known Subclasses:
IntegerAttribute
,IpAttribute
,Ipv6PrefixAttribute
,StringAttribute
,VendorSpecificAttribute
The basic generic Radius attribute. All type-specific implementations extend this class
by adding additional type conversion methods and validations.
-
Constructor Summary
ConstructorDescriptionOctetsAttribute
(Dictionary dictionary, int vendorId, io.netty.buffer.ByteBuf data) -
Method Summary
Modifier and TypeMethodDescriptionEncodes 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()
byte[]
getValue()
int
int
hashCode()
static byte[]
stringHexParser
(String value) 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
decode, flatten, getAttributeName, getAttributeTemplate, getHeaderSize, getLength, getLengthSize, getTagSize, getType, getTypeSize, getVendor, isEncoded, isTagged, toByteArray, toByteBuf
-
Constructor Details
-
OctetsAttribute
-
-
Method Details
-
getVendorId
public int getVendorId()- Specified by:
getVendorId
in interfaceRadiusAttribute
- Returns:
- vendor Id if Vendor-Specific attribute or sub-attribute, otherwise -1
-
getTag
- Specified by:
getTag
in interfaceRadiusAttribute
- Returns:
- RFC2868 Tag
-
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.
-
getDictionary
- Specified by:
getDictionary
in interfaceRadiusAttribute
- 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 interfaceRadiusAttribute
- Returns:
- underlying ByteBuf for attribute, includes attribute header, (optional) tag, and value
-
toString
-
encode
Description copied from interface:RadiusAttribute
Encodes attribute. Must be idempotent.- Specified by:
encode
in interfaceRadiusAttribute
- Parameters:
requestAuth
- (corresponding) request packet authenticatorsecret
- shared secret to encode with- Returns:
- attribute with encoded data
- Throws:
RadiusPacketException
- errors encoding attribute
-
equals
-
hashCode
public int hashCode() -
stringHexParser
-