Package org.tinyradius.attribute.util
Class Attributes
java.lang.Object
org.tinyradius.attribute.util.Attributes
public class Attributes
extends java.lang.Object
Helper class to create and extract attributes.
-
Method Summary
Modifier and Type Method Description static RadiusAttribute
create(Dictionary dictionary, int vendorId, byte type, byte[] data)
Creates a RadiusAttribute object of the appropriate type by looking up type and vendorId.static RadiusAttribute
create(Dictionary dictionary, int vendorId, byte type, java.lang.String data)
Creates a RadiusAttribute object of the appropriate type by looking up type and vendorId.static java.util.List<RadiusAttribute>
extractAttributes(Dictionary dictionary, int vendorId, byte[] data, int pos)
-
Method Details
-
create
Creates a RadiusAttribute object of the appropriate type by looking up type and vendorId.- Parameters:
dictionary
- Dictionary to usevendorId
- vendor ID or -1type
- attribute typedata
- attribute data as byte array- Returns:
- RadiusAttribute object
-
create
public static RadiusAttribute create(Dictionary dictionary, int vendorId, byte type, java.lang.String data)Creates a RadiusAttribute object of the appropriate type by looking up type and vendorId.- Parameters:
dictionary
- Dictionary to usevendorId
- vendor ID or -1type
- attribute typedata
- attribute data as String- Returns:
- RadiusAttribute object
-
extractAttributes
public static java.util.List<RadiusAttribute> extractAttributes(Dictionary dictionary, int vendorId, byte[] data, int pos)- Parameters:
dictionary
- dictionary to create attributevendorId
- vendor Id to set attributesdata
- byte array to parsepos
- position in byte array at which to parse- Returns:
- list of RadiusAttributes
-