com.ibm.diameter.packet
Class VsAvp

java.lang.Object
  extended by com.ibm.diameter.packet.Avp
      extended by com.ibm.diameter.packet.VsAvp

public class VsAvp
extends Avp

The VsAvp class is used to construct a vendor specific Diameter Attribute Value Pair (AVP). Diameter AVPs are used in Diameter messages to supply configuration details or provide specific application information.


Field Summary
static int VS_AVP_HDR_SIZE
          The header of a vendor specific AVP is always 12 bytes
 
Fields inherited from class com.ibm.diameter.packet.Avp
avpLength, M_BIT, P_BIT, R_BITS, V_BIT, VOFF_MOFF_POFF, VOFF_MOFF_PON, VOFF_MON_POFF, VOFF_MON_PON, VON_MOFF_POFF, VON_MOFF_PON, VON_MON_POFF, VON_MON_PON
 
Constructor Summary
VsAvp()
          Creates an instance of VsAvp.
VsAvp(int avpCode, byte avpFlags, AvpValueUtil avpValue, int avpVendorId)
          Creates an instance of VsAvp.
VsAvp(int avpCode, byte avpFlags, int length, AvpValueUtil avpValue, int avpVendorId)
          Creates an instance of VsAvp.
 
Method Summary
 int getAvpVendorId()
          Returns the IANA assigned Vendor-ID for this AVP.
 boolean isValid()
          isValid() checks to see if AVP is valid Checks include: V_Bit must be on for a vendor specific AVP.
 void setAvpValueUtil(AvpValueUtil avpValue)
          Sets the AvpValueUtil object which is used to read the value of this AVP.
 void setAvpVendorId(int avpVendorId)
          Sets the IANA assigned Vendor-ID for this AVP.
 void toDataOutputStream(java.io.DataOutputStream out)
          Writes the VsAvp to the DataOutputStream, including the header information and the value of the AVP contained within the AvpValueUtil instance.
 void toDiamWsByteBufferOutputStream(com.ibm.diameter.util.DiamWsByteBufferOutputStream out)
          Writes the VsAvp to the DiamWsByteBufferOutputStream, including the header information and the value of the AVP contained within the AvpValueUtil instance.
 java.lang.String toString()
          Returns a String representation of the Avp.
 
Methods inherited from class com.ibm.diameter.packet.Avp
getAvpCode, getAvpFlags, getAvpLength, getAvpValueUtil, isMBit, isPBit, isVBit, setAvpCode, setAvpFlags, setAvpLength, setMBit, setPBit, setVBit, toString2
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VS_AVP_HDR_SIZE

public static final int VS_AVP_HDR_SIZE
The header of a vendor specific AVP is always 12 bytes

See Also:
Constant Field Values
Constructor Detail

VsAvp

public VsAvp()
Creates an instance of VsAvp. This constructor should not typically be used.


VsAvp

public VsAvp(int avpCode,
             byte avpFlags,
             AvpValueUtil avpValue,
             int avpVendorId)
Creates an instance of VsAvp. Note that the length is not included. It is calculated using the AvpValueUtil class.

Parameters:
avpCode - Identifier of the AVP
avpFlags - Tells the receiver how the attribute should be handled. It is of the form VMPrrrrr. The V, or Vendor-Specific, bit indicates whether the Vendor Id field is present in the header. The M, or Mandatory, bit indicates whether support of this AVP is required or not. The P bit indicates the need for encryption. However, this bit is obsolete and should always be zero. The r, or reserved, bits are unused in this release and should be set to 0.
avpValue - An instance of the AvpValueUtil class that contains the value in a form that the class knows how to interpret.
avpVendorId - The IANA assigned Vendor-ID for this vendor

VsAvp

public VsAvp(int avpCode,
             byte avpFlags,
             int length,
             AvpValueUtil avpValue,
             int avpVendorId)
Creates an instance of VsAvp.

Parameters:
avpCode - Identifier of the AVP
avpFlags - Tells the receiver how the attribute should be handled. It is of the form VMPrrrrr. The V, or Vendor-Specific, bit indicates whether the Vendor Id field is present in the header. The M, or Mandatory, bit indicates whether support of this AVP is required or not. The P bit indicates the need for encryption. However, this bit is obsolete and should always be zero. The r, or reserved, bits are unused in this release and should be set to 0.
avpValue - An instance of the AvpValueUtil class that contains the value in a form that the class knows how to interpret.
length - The length of the VsAvp that is being created.
avpVendorId - The IANA assigned Vendor-ID for this vendor
Method Detail

getAvpVendorId

public int getAvpVendorId()
Returns the IANA assigned Vendor-ID for this AVP.

Returns:
Returns the avp vendor id.

setAvpVendorId

public void setAvpVendorId(int avpVendorId)
Sets the IANA assigned Vendor-ID for this AVP.

Parameters:
avpVendorId - The avp vendor id to set.

setAvpValueUtil

public void setAvpValueUtil(AvpValueUtil avpValue)
Sets the AvpValueUtil object which is used to read the value of this AVP.

Overrides:
setAvpValueUtil in class Avp
Parameters:
avpValue - an instance of AvpValueUtil that contains the data as well as a method to retrieve the data.

isValid

public boolean isValid()
isValid() checks to see if AVP is valid Checks include: V_Bit must be on for a vendor specific AVP.

Overrides:
isValid in class Avp
Returns:
Returns true if this VsAvp is valid.

toDiamWsByteBufferOutputStream

public void toDiamWsByteBufferOutputStream(com.ibm.diameter.util.DiamWsByteBufferOutputStream out)
Writes the VsAvp to the DiamWsByteBufferOutputStream, including the header information and the value of the AVP contained within the AvpValueUtil instance.

Overrides:
toDiamWsByteBufferOutputStream in class Avp
Parameters:
out - The output stream to write the VsAvp to.

toDataOutputStream

public void toDataOutputStream(java.io.DataOutputStream out)
Writes the VsAvp to the DataOutputStream, including the header information and the value of the AVP contained within the AvpValueUtil instance.

Overrides:
toDataOutputStream in class Avp
Parameters:
out - The output stream to write the VsAvp to.

toString

public java.lang.String toString()
Returns a String representation of the Avp.

Overrides:
toString in class Avp
Returns:
String representation of the Avp


Copyright © 2006 IBM Corp. All Rights Reserved.