Class TaggedAttribute
java.lang.Object
org.tinyradius.core.attribute.type.decorator.TaggedAttribute
- All Implemented Interfaces:
RadiusAttribute
public class TaggedAttribute
extends java.lang.Object
Augments attribute with RFC2868 Tag. If using multiple wrapping decorators,
this should be innermost.
-
Field Summary
Fields Modifier and Type Field Description protected RadiusAttribute
delegate
-
Constructor Summary
Constructors Constructor Description TaggedAttribute(byte tag, OctetsAttribute attribute)
-
Method Summary
Modifier and Type Method Description RadiusAttribute
encode(byte[] requestAuth, java.lang.String secret)
Encodes attribute.boolean
equals(java.lang.Object o)
Dictionary
getDictionary()
byte
getTag()
int
getType()
byte[]
getValue()
java.lang.String
getValueString()
int
getVendorId()
int
hashCode()
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
decode, flatten, getAttributeName, getAttributeTemplate, getTagBytes, isEncoded, toByteArray
-
Field Details
-
Constructor Details
-
Method Details
-
getTag
public byte getTag()- Specified by:
getTag
in interfaceRadiusAttribute
- Returns:
- Tag if available and specified for attribute type (RFC2868)
-
encode
public RadiusAttribute encode(byte[] requestAuth, java.lang.String secret) throws RadiusPacketExceptionDescription copied from interface:RadiusAttribute
Encodes 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
-
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
-
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
-