Class EncodedAttribute
java.lang.Object
org.tinyradius.core.attribute.type.decorator.EncodedAttribute
- All Implemented Interfaces:
RadiusAttribute
public class EncodedAttribute
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description protected RadiusAttribute
delegate
-
Constructor Summary
Constructors Constructor Description EncodedAttribute(RadiusAttribute attribute)
-
Method Summary
Modifier and Type Method Description RadiusAttribute
decode(byte[] requestAuth, java.lang.String secret)
Decodes attribute.boolean
equals(java.lang.Object o)
Dictionary
getDictionary()
byte
getTag()
int
getType()
byte[]
getValue()
java.lang.String
getValueString()
int
getVendorId()
int
hashCode()
boolean
isEncoded()
java.lang.String
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, getTagBytes, toByteArray
-
Field Details
-
Constructor Details
-
Method Details
-
decode
public RadiusAttribute decode(byte[] requestAuth, java.lang.String secret) throws RadiusPacketExceptionDescription copied from interface:RadiusAttribute
Decodes 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
public boolean isEncoded() -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
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
public byte getTag()- Specified by:
getTag
in interfaceRadiusAttribute
- Returns:
- Tag if available and specified for attribute type (RFC2868)
-
getValue
public byte[] getValue()- Specified by:
getValue
in interfaceRadiusAttribute
- Returns:
- attribute data as raw bytes
-
getValueString
public java.lang.String 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
-