BEA Systems, Inc.

BEA WebLogic SIP Server 3.1 API Reference


com.bea.wcp.diameter
Class Avp

java.lang.Object
  extended bycom.bea.wcp.diameter.Avp
All Implemented Interfaces:
java.io.Serializable

public final class Avp
extends java.lang.Object
implements java.io.Serializable

Represents a Diameter AVP (Attribute-Value Pair).

     0                   1                   2                   3
   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                           AVP Code                            |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |V M P r r r r r|                  AVP Length                   |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                        Vendor-ID (opt)                        |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                          ... Data ...                         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 

See Also:
Serialized Form
Copyright © 2006 BEA Systems, Inc. All Rights Reserved.

Constructor Summary
Avp(Attribute attr, java.lang.Object value)
          Creates a new AVP for the specified Attribute and value.
Avp(Avp avp)
          Creates a new Avp copied from the specified Avp.
Avp(java.lang.String name, java.lang.Object value)
          Creates a new AVP for the specified attribute name and value.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this AVP to another object for equality.
 java.net.InetAddress getAddress()
          Returns the InetAddress value of an Address AVP.
 Attribute getAttribute()
          Returns the Attribute for this AVP.
 AvpList getAvpList()
          Returns the AvpList value of a Grouped AVP.
 java.nio.ByteBuffer getBytes()
          Returns the ByteBuffer value of an OctetString AVP.
 int getCode()
          Returns the AVP code.
 int getInt()
          Returns the int value of an Integer32 or Unsigned32 AVP.
 long getLong()
          Returns the long value of an Integer64 or Unsigned64 AVP.
 java.lang.String getString()
          Returns the String value of a UTF8String AVP.
 java.lang.Object getValue()
          Returns the AVP value, which is one of the following Java types depending on the attribute Diameter type:
 int hashCode()
          Returns the hash code for this AVP.
 boolean isGrouped()
          Returns true if this is a grouped AVP, false otherwise.
 boolean isValidated()
           
 boolean isVendorSpecific()
          Returns true if this AVP is vendor specific, false if it is defined by the Diameter base protocol (RFC 3588).
 void setValue(java.lang.Object value)
           
 java.lang.String toString()
           
 void validate()
          Validates an AVP.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Avp

public Avp(Attribute attr,
           java.lang.Object value)
Creates a new AVP for the specified Attribute and value. The value must be valid for the specified attribute type.

Throws:
java.lang.IllegalArgumentException - if the value is inappropriate for the given attribute type
See Also:
getValue()

Avp

public Avp(Avp avp)
Creates a new Avp copied from the specified Avp.


Avp

public Avp(java.lang.String name,
           java.lang.Object value)
Creates a new AVP for the specified attribute name and value. The value type must be valid for the specified attribute type.

Method Detail

equals

public boolean equals(java.lang.Object obj)
Compares this AVP to another object for equality. Two AVPs are equal if they have the same attribute and value.

Parameters:
obj - the object to be compared to this AVP
Returns:
true if equal, false otherwise

getAddress

public java.net.InetAddress getAddress()
Returns the InetAddress value of an Address AVP.


getAttribute

public Attribute getAttribute()
Returns the Attribute for this AVP.


getAvpList

public AvpList getAvpList()
Returns the AvpList value of a Grouped AVP.


getBytes

public java.nio.ByteBuffer getBytes()
Returns the ByteBuffer value of an OctetString AVP.


getCode

public int getCode()
Returns the AVP code.


getInt

public int getInt()
Returns the int value of an Integer32 or Unsigned32 AVP.


getLong

public long getLong()
Returns the long value of an Integer64 or Unsigned64 AVP.


getString

public java.lang.String getString()
Returns the String value of a UTF8String AVP.


getValue

public java.lang.Object getValue()
Returns the AVP value, which is one of the following Java types depending on the attribute Diameter type:
   Diameter Type        Java Type
   -------------        ---------
   Signed32/Unsigned32  Integer
   Signed64/Unsigned64  Long
   Address              InetAddress
   OctetString          ByteBuffer
   UTF8String           String
   Time                 Long
   Grouped              AvpList
 


hashCode

public int hashCode()
Returns the hash code for this AVP.

Returns:
the AVP hash code

isGrouped

public boolean isGrouped()
Returns true if this is a grouped AVP, false otherwise.


isValidated

public boolean isValidated()
Returns:
true if this AVP has already been validated

isVendorSpecific

public boolean isVendorSpecific()
Returns true if this AVP is vendor specific, false if it is defined by the Diameter base protocol (RFC 3588).


setValue

public void setValue(java.lang.Object value)

toString

public java.lang.String toString()

validate

public void validate()
              throws AvpException
Validates an AVP. A decoded AVP must be validated before getValue() or any of its variants can be called. A Diameter agent on the other hand may skip validation of one or more message AVPs.

Throws:
AvpException

Documentation is available at
http://e-docs.bea.com/wlcp/wlss31/
Copyright 2007 BEA Systems Inc.