Package com.bea.wcp.diameter
Class Avp
java.lang.Object
com.bea.wcp.diameter.Avp
- All Implemented Interfaces:
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 ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Author:
- Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares this AVP to another object for equality.Returns the InetAddress value of an Address AVP.Returns the Attribute for this AVP.Returns the AvpList value of a Grouped AVP.getBytes()Returns the ByteBuffer value of an OctetString AVP.intgetCode()Returns the AVP code.getDate()Returns the Date value of a Time AVP.intgetInt()Returns the int value of an Integer32 AVP.longgetLong()Returns the long value of an Integer64 AVP.Returns the String value of a UTF8String AVP.Returns the long value of an Unsigned32 AVP.Returns the BigInteger value of an Unsigned64 AVP.getValue()Returns the AVP value, which is one of the following Java types depending on the attribute Diameter type:inthashCode()Returns the hash code for this AVP.booleanReturns true if this is a grouped AVP, false otherwise.booleanbooleanReturns true if this AVP is vendor specific, false if it is defined by the Diameter base protocol (RFC 3588).voidtoString()voidvalidate()Validates an AVP.
-
Constructor Details
-
Avp
Creates a new AVP for the specified Attribute and value. The value must be valid for the specified attribute type.- Parameters:
attr- the Attribute for the AVPvalue- the value of the AVP- Throws:
IllegalArgumentException- if the value is inappropriate for the given attribute type- See Also:
-
Avp
Creates a new AVP for the specified attribute name and value. The value type must be valid for the specified attribute type.- Parameters:
name- the attribute namevalue- the AVP value
-
Avp
Creates a new Avp copied from the specified Avp.
-
-
Method Details
-
validate
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
-
isValidated
public boolean isValidated()- Returns:
- true if this AVP has already been validated
-
getAttribute
Returns the Attribute for this AVP. -
getCode
public int getCode()Returns the AVP code. -
isVendorSpecific
public boolean isVendorSpecific()Returns true if this AVP is vendor specific, false if it is defined by the Diameter base protocol (RFC 3588). -
isGrouped
public boolean isGrouped()Returns true if this is a grouped AVP, false otherwise. -
getValue
Returns the AVP value, which is one of the following Java types depending on the attribute Diameter type:Diameter Type Java Type ------------- --------- Signed32 Integer Unsigned32 Long Signed64 Long Unsigned64 BigInteger Address InetAddress OctetString ByteBuffer UTF8String String Time Long Grouped AvpList
-
setValue
-
getInt
public int getInt()Returns the int value of an Integer32 AVP. -
getUnsigned32
Returns the long value of an Unsigned32 AVP.- Returns:
- the
Longvalue.
-
getLong
public long getLong()Returns the long value of an Integer64 AVP. -
getUnsigned64
Returns the BigInteger value of an Unsigned64 AVP.- Returns:
- the
BigIntegervalue
-
getString
Returns the String value of a UTF8String AVP. -
getAddress
Returns the InetAddress value of an Address AVP. -
getBytes
Returns the ByteBuffer value of an OctetString AVP. -
getAvpList
Returns the AvpList value of a Grouped AVP. -
getDate
Returns the Date value of a Time AVP. -
hashCode
public int hashCode()Returns the hash code for this AVP. -
equals
Compares this AVP to another object for equality. Two AVPs are equal if they have the same attribute and value. -
toString
-
appendXml
-