net.sf.jradius.packet.attribute
Class AttributeList

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

public class AttributeList
extends java.lang.Object
implements java.io.Serializable

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

Author:
David Bird
See Also:
Serialized Form

Constructor Summary
AttributeList()
          Default constructor
 
Method Summary
 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(int type)
           
 java.lang.Object get(int type, boolean single)
           
 RadiusAttribute get(java.lang.String name)
           
 java.lang.Object get(java.lang.String name, boolean single)
           
 java.lang.Object[] getArray(int type)
          Get all attributes of a certain type returned at an array
 java.util.List getAttributeList()
          Returns the attribute hash as a list
 java.util.Map getMap()
           
 int getSize()
           
 void remove(int 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.
 java.lang.String toString()
           
 java.lang.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 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(int 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 java.lang.Object get(int 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(int type)

get

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

get

public RadiusAttribute get(java.lang.String name)
                    throws UnknownAttributeException
Throws:
UnknownAttributeException

getArray

public java.lang.Object[] getArray(int 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 java.lang.String toString(boolean nonStandardAttrs,
                                 boolean unknownAttrs)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getAttributeList

public java.util.List getAttributeList()
Returns the attribute hash as a list

Returns:
Returns a List of all attributes

getMap

public java.util.Map getMap()
Returns:
Returns the attribute map


Copyright © 2006 The JRadius Project, All Rights Reserved.