net.jradius.packet.attribute
Class AttributeList

java.lang.Object
  extended by net.jradius.packet.attribute.AttributeList
All Implemented Interfaces:
Serializable

public class AttributeList
extends Object
implements Serializable

Represents the Attribute List of a packet. Supports singleton and lists of attribute values (building packets with several of the same attribute).

Author:
David Bird
See Also:
Serialized Form

Constructor Summary
AttributeList()
          Default constructor
 
Method Summary
 void _add(RadiusAttribute a, boolean overwrite)
           
 void add(AttributeList list)
          Add an attribute list to this attribute list
 void add(RadiusAttribute a)
          Add an attribute, defaulting to overwriting
 void add(RadiusAttribute a, boolean overwrite)
          Add an attribute with option to overwrite.
 void clear()
           
 RadiusAttribute get(long type)
           
 Object get(long type, boolean single)
           
 RadiusAttribute get(String name)
           
 Object get(String name, boolean single)
           
 Object[] getArray(long type)
          Get all attributes of a certain type returned at an array
 List<RadiusAttribute> getAttributeList()
          Returns the attribute hash as a list
 Map<Long,Object> getMap()
           
 int getSize()
           
 Object getValue(long type)
           
 void remove(long attributeType)
          Removes attribute(s) by type
 void remove(RadiusAttribute a)
          Removes attribute(s) by type
 void removeUnknown()
          Removes all unknown (not in the configured JRadius Dictionary) attribtues.
 String toString()
           
 String toString(boolean nonStandardAttrs, boolean unknownAttrs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeList

public AttributeList()
Default constructor

Method Detail

add

public void add(AttributeList list)
Add an attribute list to this attribute list

Parameters:
list - The attribute list to add

add

public void add(RadiusAttribute a)
Add an attribute, defaulting to overwriting

Parameters:
a - The attribute to add

_add

public void _add(RadiusAttribute a,
                 boolean overwrite)

add

public void add(RadiusAttribute a,
                boolean overwrite)
Add an attribute with option to overwrite. If overwrite is false, multiple of the same attribute can be added (building a list)

Parameters:
a -
overwrite -

remove

public void remove(RadiusAttribute a)
Removes attribute(s) by type

Parameters:
a - RadiusAttribute to remove

remove

public void remove(long attributeType)
Removes attribute(s) by type

Parameters:
attributeType - The attribute type to remove

clear

public void clear()

getSize

public int getSize()
Returns:
Returns the number of attributes in the list

removeUnknown

public void removeUnknown()
Removes all unknown (not in the configured JRadius Dictionary) attribtues.


get

public Object get(long type,
                  boolean single)
Parameters:
type - The type of attribute to retrieve
single - True if a only a single attribute can be returned; false if a List of attributes is also ok
Returns:
Returns either s single attribute, a list of attributes, or null

get

public RadiusAttribute get(long type)

get

public Object get(String name,
                  boolean single)
           throws UnknownAttributeException
Throws:
UnknownAttributeException

get

public RadiusAttribute get(String name)
                    throws UnknownAttributeException
Throws:
UnknownAttributeException

getValue

public Object getValue(long type)

getArray

public Object[] getArray(long type)
Get all attributes of a certain type returned at an array

Parameters:
type - The type of attribute to find
Returns:
Returns an array of all attributes found of a certain type

toString

public String toString(boolean nonStandardAttrs,
                       boolean unknownAttrs)

toString

public String toString()
Overrides:
toString in class Object

getAttributeList

public List<RadiusAttribute> getAttributeList()
Returns the attribute hash as a list

Returns:
Returns a List of all attributes

getMap

public Map<Long,Object> getMap()
Returns:
Returns the attribute map


Copyright © 2011 Coova Technologies, LLC, All Rights Reserved.