Interface RadiusAttribute
- All Known Implementing Classes:
EncodedAttribute
,IntegerAttribute
,IpAttribute
,IpAttribute.V4
,IpAttribute.V6
,Ipv6PrefixAttribute
,OctetsAttribute
,StringAttribute
,TaggedAttribute
,VendorSpecificAttribute
public interface RadiusAttribute
-
Method Summary
Modifier and Type Method Description default RadiusAttribute
decode(byte[] requestAuth, java.lang.String secret)
Decodes attribute.default RadiusAttribute
encode(byte[] requestAuth, java.lang.String secret)
Encodes attribute.default java.util.List<RadiusAttribute>
flatten()
Returns set of all nested attributes if contains sub-attributes, otherwise singleton set of current attribute.default java.lang.String
getAttributeName()
default java.util.Optional<AttributeTemplate>
getAttributeTemplate()
Dictionary
getDictionary()
byte
getTag()
byte
getType()
byte[]
getValue()
java.lang.String
getValueString()
int
getVendorId()
default boolean
isEncoded()
byte[]
toByteArray()
-
Method Details
-
getVendorId
int getVendorId()- Returns:
- vendor Id if Vendor-Specific attribute or sub-attribute, otherwise -1
-
getType
byte getType()- Returns:
- attribute type code, 0-255
-
getTag
byte getTag()- Returns:
- Tag if available and specified for attribute type (RFC2868)
-
getValue
byte[] getValue()- Returns:
- attribute data as raw bytes
-
getValueString
java.lang.String getValueString()- Returns:
- value of this attribute as a hex string.
-
getDictionary
Dictionary getDictionary()- Returns:
- dictionary that attribute uses
-
toByteArray
byte[] toByteArray()- Returns:
- entire attribute (including headers) as byte array
-
getAttributeName
default java.lang.String getAttributeName() -
flatten
Returns set of all nested attributes if contains sub-attributes, otherwise singleton set of current attribute.- Returns:
- List of RadiusAttributes
-
getAttributeTemplate
- Returns:
- AttributeTemplate used to define this attribute
-
encode
default RadiusAttribute encode(byte[] requestAuth, java.lang.String secret) throws RadiusPacketExceptionEncodes attribute. Must be idempotent.- Parameters:
requestAuth
- (corresponding) request packet authenticatorsecret
- shared secret to encode with- Returns:
- attribute with encoded data
- Throws:
RadiusPacketException
- errors encoding attribute
-
decode
default RadiusAttribute decode(byte[] requestAuth, java.lang.String secret) throws RadiusPacketExceptionDecodes attribute. Must be idempotent.- Parameters:
requestAuth
- (corresponding) request packet authenticatorsecret
- shared secret to encode with- Returns:
- attribute with encoded data
- Throws:
RadiusPacketException
- errors decoding attribute
-
isEncoded
default boolean isEncoded()
-