com.ibm.diameter.packet
Class AvpVector

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by com.ibm.diameter.packet.AvpVector
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class AvpVector
extends java.util.Vector

The AvpVector class is a utility class that provides convenience methods for searching for specific Avps in a Vector of Avps.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
AvpVector()
          Constructor to create an empty Avp vector.
AvpVector(java.util.Collection c)
          Constructor to create Avp vector that contains all of the AVPs in an existing collection of AVPs.
AvpVector(int initialCapacity)
          Constructor to create an empty Avp vector.
AvpVector(int initialCapacity, int capacityIncrement)
          Constructor to create an empty Avp vector.
 
Method Summary
 Avp findAvpByAvpCode(int avpCode)
          Finds an AVP in the AvpVector by avp code.
 java.util.ArrayList findAvpListByAvpCode(int avpCode)
          Finds an ArrayList of AVPS in the AvpVector with the specified avp code
 Avp getAcctApplicationIdAvp()
          Returns the Acct-Application-Id AVP (avp code = 259).
 java.util.ArrayList getAcctApplicationIdList()
          Returns an ArrayList of Acct-Application-Id AVPs (avp code = 259).
 java.util.ArrayList getApplicationIdInfoList()
          Returns an ArrayList of ApplicationIdInfo objects that represent the Auth-Application-Id and Acct-Application-Id AVPs held in the AvpVector.
 Avp getAuthApplicationIdAvp()
          Returns the Auth-Application-Id AVP (avp code = 258).
 java.util.ArrayList getAuthApplicationIdList()
          Returns an ArrayList of Auth-Application-Id AVPs (avp code = 258).
 Avp getErrorMessageAvp()
          Returns the Error-Message AVP (avp code = 281)
 Avp getErrorReportingHostAvp()
          Returns the Error-Reporting-Host AVP (avp code = 294)
 Avp getFailedAvpAvp()
          Returns the Failed-AVP AVP (avp code = 279)
 Avp getHostIpAddressAvp()
          Returns the Host-IP-Address AVP (avp code = 257)
 Avp getInbandSecurityIdAvp()
          Returns the Inband-Security-Id AVP (avp code = 299)
 Avp getOriginHostAvp()
          Returns the Origin-Host AVP (avp code = 264)
 Avp getOriginRealmAvp()
          Returns the Origin-Realm AVP (avp code = 296)
 Avp getResultCodeAvp()
          Returns the Result-Code AVP (avp code = 264)
 Avp getSessionIdAvp()
          Returns the Session-Id AVP (avp code = 263)
 Avp getUserNameAvp()
          Returns the User-Name AVP (avp code = 1)
 java.util.ArrayList getVendorSpecificApplicationIdAvps()
          Returns an ArrayList of Vendor-Specific-Application-Id AVPs (avp code = 260)
 java.util.ArrayList getVendorSpecificApplicationIdInfoList()
          Returns an ArrayList of ApplicationIdInfo objects that represent the applications that are supported according to the Vendor-Specific-Application-Id AVP.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

AvpVector

public AvpVector(int initialCapacity,
                 int capacityIncrement)
Constructor to create an empty Avp vector.

Parameters:
initialCapacity - int containing the initial capacity of the AvpVector
capacityIncrement - int containing the amount the Vector will grow whenever it reaches its current capacity.

AvpVector

public AvpVector(int initialCapacity)
Constructor to create an empty Avp vector.

Parameters:
initialCapacity - int containing the initial capacity of the AvpVector

AvpVector

public AvpVector()
Constructor to create an empty Avp vector.


AvpVector

public AvpVector(java.util.Collection c)
Constructor to create Avp vector that contains all of the AVPs in an existing collection of AVPs.

Parameters:
c - A collection of Avp objects
Method Detail

getInbandSecurityIdAvp

public Avp getInbandSecurityIdAvp()
Returns the Inband-Security-Id AVP (avp code = 299)

Returns:
The Inband-Security AVP if it exists, otherwise null

getOriginHostAvp

public Avp getOriginHostAvp()
Returns the Origin-Host AVP (avp code = 264)

Returns:
The Origin-Host AVP if it exists, otherwise null

getOriginRealmAvp

public Avp getOriginRealmAvp()
Returns the Origin-Realm AVP (avp code = 296)

Returns:
The Origin-Realm AVP if it exists, otherwise null

getUserNameAvp

public Avp getUserNameAvp()
Returns the User-Name AVP (avp code = 1)

Returns:
The User-Name AVP if it exists, otherwise null

getSessionIdAvp

public Avp getSessionIdAvp()
Returns the Session-Id AVP (avp code = 263)

Returns:
The Session-Id AVP if it exists, otherwise null

getVendorSpecificApplicationIdAvps

public java.util.ArrayList getVendorSpecificApplicationIdAvps()
Returns an ArrayList of Vendor-Specific-Application-Id AVPs (avp code = 260)

Returns:
An ArrayList of Vendor-Specific-Application-Id AVPs if they exist. If none exist, an empty ArrayList will be returned.

getApplicationIdInfoList

public java.util.ArrayList getApplicationIdInfoList()
Returns an ArrayList of ApplicationIdInfo objects that represent the Auth-Application-Id and Acct-Application-Id AVPs held in the AvpVector.

Returns:
An ArrayList of ApplicationIdInfo objects if ApplicaitonId AVPs if exist. If none exist, an empty ArrayList will be returned.

getVendorSpecificApplicationIdInfoList

public java.util.ArrayList getVendorSpecificApplicationIdInfoList()
Returns an ArrayList of ApplicationIdInfo objects that represent the applications that are supported according to the Vendor-Specific-Application-Id AVP.

Returns:
ArrayList containing the list of ApplicationIdInfo objects that are contained in this AvpVector. If none are present, an empty ArrayList is returned.

getAcctApplicationIdAvp

public Avp getAcctApplicationIdAvp()
Returns the Acct-Application-Id AVP (avp code = 259). Note this will return only one occurence of this AVP.

Returns:
The Acct-Application-Id AVP if it exists, otherwise null

getAcctApplicationIdList

public java.util.ArrayList getAcctApplicationIdList()
Returns an ArrayList of Acct-Application-Id AVPs (avp code = 259).

Returns:
An ArrayList of Acct-Application-Id AVPs if they exist. If none exist, an empty ArrayList will be returned.

getAuthApplicationIdAvp

public Avp getAuthApplicationIdAvp()
Returns the Auth-Application-Id AVP (avp code = 258). Note this will return only one occurence of this AVP.

Returns:
The Auth-Application-Id AVP if it exists, otherwise null

getAuthApplicationIdList

public java.util.ArrayList getAuthApplicationIdList()
Returns an ArrayList of Auth-Application-Id AVPs (avp code = 258).

Returns:
An ArrayList of Auth-Application-Id AVPs if they exist. If none exist, an empty ArrayList will be returned.

getErrorMessageAvp

public Avp getErrorMessageAvp()
Returns the Error-Message AVP (avp code = 281)

Returns:
The Error-Message AVP if it exists, otherwise null

getErrorReportingHostAvp

public Avp getErrorReportingHostAvp()
Returns the Error-Reporting-Host AVP (avp code = 294)

Returns:
The Error-Reporting-Host AVP if it exists, otherwise null

getFailedAvpAvp

public Avp getFailedAvpAvp()
Returns the Failed-AVP AVP (avp code = 279)

Returns:
The Failed-AVP AVP if it exists, otherwise null

getHostIpAddressAvp

public Avp getHostIpAddressAvp()
Returns the Host-IP-Address AVP (avp code = 257)

Returns:
The Host-IP-Address AVP if it exists, otherwise null

getResultCodeAvp

public Avp getResultCodeAvp()
Returns the Result-Code AVP (avp code = 264)

Returns:
The Result-Code AVP if it exists, otherwise null

findAvpByAvpCode

public Avp findAvpByAvpCode(int avpCode)
Finds an AVP in the AvpVector by avp code. If multiple Avps have the same code in the AvpVector, this method will return the first instance.

Parameters:
avpCode - An int holding the avp code to search for.
Returns:
The AVP with the specified code if it exists, otherwise null

findAvpListByAvpCode

public java.util.ArrayList findAvpListByAvpCode(int avpCode)
Finds an ArrayList of AVPS in the AvpVector with the specified avp code

Parameters:
avpCode - The avp code to search for
Returns:
An ArrayList of AVPs with the specified code if any exists, otherwise an empty ArrayList


Copyright © 2006 IBM Corp. All Rights Reserved.