AXL Software™

com.theorem.tacacs
Class AttributeList

Object
  extended byAttributeList

public class AttributeList
extends Object

TACACS+ Attribute list. This should not be used directly. Please use on the subclasses.


Constructor Summary
AttributeList()
           
 
Method Summary
 void add(AVPair attribute)
          Add an AV pair.
 void add(String attribute)
          Add an attribute to the list.
 void add(String name, String separator, String value)
          Add an attribute to the list.
 void clear()
          Clear all attributes.
 void extractAVPairs(byte[] packet, int countOffset, int argBlockOffset)
          Read a data block from the packet.
 AVPair get(String name)
          Get the first AVPair matching the given the attribute name.
 AVPair[] getAll(String name)
          Get the all the AVPairs's matching the given the attribute name.
 Iterator iterator()
          Provide an iteration of the attributes.
 String toString()
          Return a string representation of this list.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeList

public AttributeList()
Method Detail

add

public void add(String attribute)
         throws TACACSException
Add an attribute to the list.

Parameters:
attribute - Attribute Value Pair.
Throws:
TACACSException - if the attribute cannot be parsed.

add

public void add(AVPair attribute)
Add an AV pair.

Parameters:
attribute - AVPair.

add

public void add(String name,
                String separator,
                String value)
         throws TACACSException
Add an attribute to the list.

Parameters:
name - Attribute name.
separator - Separator character, '=' for manditory, '*' for optional.
value - Attribute value.
Throws:
TACACSException - if the attribute cannot be constructed.

extractAVPairs

public void extractAVPairs(byte[] packet,
                           int countOffset,
                           int argBlockOffset)
                    throws TACACSException
Read a data block from the packet. The AV Pairs are extracted to this AttributeList.

Parameters:
packet - Packet contents.
countOffset - Offset to the arg count and arg sizes block
argBlockOffset - Offset to the AV pairs.
Throws:
TACACSException - if there's a problem reading the av pair block.

clear

public void clear()
Clear all attributes.


get

public AVPair get(String name)
Get the first AVPair matching the given the attribute name.

Returns:
APPair or null if there is no match.

getAll

public AVPair[] getAll(String name)
Get the all the AVPairs's matching the given the attribute name.

Returns:
APPair or an empty array if there's no match.

iterator

public Iterator iterator()
Provide an iteration of the attributes.

Returns:
an iterator for the attributes. Each iteration element is in the form of an AVPair.

toString

public String toString()
Return a string representation of this list.

Returns:
String.

AXL Software™

Submit a bug report or feature request

Copyright 1998-2002 AXL Software™ PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.