org.mobicents.slee.resource.diameter.base.events.avp
Class DiameterAvpImpl

java.lang.Object
  extended by org.mobicents.slee.resource.diameter.base.events.avp.DiameterAvpImpl
All Implemented Interfaces:
java.lang.Cloneable, DiameterAvp
Direct Known Subclasses:
DiameterIdentityAvpImpl, GroupedAvpImpl, IPFilterRuleAvpImpl

public class DiameterAvpImpl
extends java.lang.Object
implements DiameterAvp

Super project: mobicents 12:51:53 2008-05-08

Author:
baranowb - Bartosz Baranowski , Alexandre Mendonca, Erick Svenson

Field Summary
protected  int code
           
protected static org.apache.log4j.Logger log
           
protected  int mnd
           
protected  java.lang.String name
           
protected  org.jdiameter.client.impl.parser.MessageParser parser
           
protected  int prt
           
protected  DiameterAvpType type
           
protected  long vendorId
           
 
Fields inherited from interface net.java.slee.resource.diameter.base.events.avp.DiameterAvp
FLAG_RULE_MAY, FLAG_RULE_MUST, FLAG_RULE_MUSTNOT
 
Constructor Summary
DiameterAvpImpl(int code, long vendorId, int mnd, int prt, byte[] value, DiameterAvpType type)
           
 
Method Summary
 byte[] byteArrayValue()
          Return the raw contents of this AVP
 java.lang.Object clone()
          Creates and returns a deep copy of this AVP instance.
 double doubleValue()
          The value of this AVP if the Diameter type can be represented in a Java double value (e.g., Float64, Float32)
 float floatValue()
          The value of this AVP if the Diameter type can be represented in a Java float value (e.g., Float32)
 int getCode()
          Return the AVP code, e.g., 263 for Session-Id
 int getMandatoryRule()
          Return the rule for the mandatory (M) flag of this AVP.
 java.lang.String getName()
          Return the AVP name, e.g., "Session-Id"
 int getProtectedRule()
          Return the rule for the protected (P) flag of this AVP.
 DiameterAvpType getType()
          Return the AVP type (one of the String constants from org.mobicents.slee.resource.diameter.base.DiameterAvpType.
 long getVendorId()
          Return the Vendor-ID value for proprietary (non-IETF) AVPs.
 int intValue()
          The value of this AVP if the Diameter type can be represented in a Java int value (e.g., Integer32)
 long longValue()
          The value of this AVP if the Diameter type can be represented in a Java long value (e.g., Integer64, Unsigned32, Integer32)
 java.lang.String stringValue()
          The value of this AVP if the Diameter type is equivalent to a Java String value (e.g., UTF8String)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log

vendorId

protected long vendorId

code

protected int code

mnd

protected int mnd

prt

protected int prt

name

protected java.lang.String name

type

protected DiameterAvpType type

parser

protected org.jdiameter.client.impl.parser.MessageParser parser
Constructor Detail

DiameterAvpImpl

public DiameterAvpImpl(int code,
                       long vendorId,
                       int mnd,
                       int prt,
                       byte[] value,
                       DiameterAvpType type)
Method Detail

getCode

public int getCode()
Description copied from interface: DiameterAvp
Return the AVP code, e.g., 263 for Session-Id

Specified by:
getCode in interface DiameterAvp
Returns:
the AVP code

getVendorId

public long getVendorId()
Description copied from interface: DiameterAvp
Return the Vendor-ID value for proprietary (non-IETF) AVPs.

The value should be the IANA-assigned "SMI Network Management Private Enterprise Codes" value of the organisation that defined the AVP, for example 3GPP is 10415.

A Vendor-ID value of zero means the Vendor-ID is not specified. Standard AVPs defined by IETF will have a Vendor-ID of zero.

Specified by:
getVendorId in interface DiameterAvp
Returns:
the Vendor-ID, or zero if it is not specified.

getName

public java.lang.String getName()
Description copied from interface: DiameterAvp
Return the AVP name, e.g., "Session-Id"

Specified by:
getName in interface DiameterAvp
Returns:
the AVP name

getType

public DiameterAvpType getType()
Description copied from interface: DiameterAvp
Return the AVP type (one of the String constants from org.mobicents.slee.resource.diameter.base.DiameterAvpType.

Specified by:
getType in interface DiameterAvp
Returns:
the AVP type

getMandatoryRule

public int getMandatoryRule()
Description copied from interface: DiameterAvp
Return the rule for the mandatory (M) flag of this AVP.

0 - MUST
1 - MAY
2 - MUSTNOT

Specified by:
getMandatoryRule in interface DiameterAvp

getProtectedRule

public int getProtectedRule()
Description copied from interface: DiameterAvp
Return the rule for the protected (P) flag of this AVP.

0 - MUST
1 - MAY
2 - MUSTNOT

Specified by:
getProtectedRule in interface DiameterAvp

doubleValue

public double doubleValue()
Description copied from interface: DiameterAvp
The value of this AVP if the Diameter type can be represented in a Java double value (e.g., Float64, Float32)

Specified by:
doubleValue in interface DiameterAvp
Returns:
the AVP value as a double

floatValue

public float floatValue()
Description copied from interface: DiameterAvp
The value of this AVP if the Diameter type can be represented in a Java float value (e.g., Float32)

Specified by:
floatValue in interface DiameterAvp
Returns:
the AVP value as a float

intValue

public int intValue()
Description copied from interface: DiameterAvp
The value of this AVP if the Diameter type can be represented in a Java int value (e.g., Integer32)

Specified by:
intValue in interface DiameterAvp
Returns:
the AVP value as an int

longValue

public long longValue()
Description copied from interface: DiameterAvp
The value of this AVP if the Diameter type can be represented in a Java long value (e.g., Integer64, Unsigned32, Integer32)

Specified by:
longValue in interface DiameterAvp
Returns:
the AVP value as a long

stringValue

public java.lang.String stringValue()
Description copied from interface: DiameterAvp
The value of this AVP if the Diameter type is equivalent to a Java String value (e.g., UTF8String)

Specified by:
stringValue in interface DiameterAvp
Returns:
the AVP value as a String

byteArrayValue

public byte[] byteArrayValue()
Description copied from interface: DiameterAvp
Return the raw contents of this AVP

Specified by:
byteArrayValue in interface DiameterAvp
Returns:
the AVP value as a byte array

clone

public java.lang.Object clone()
Description copied from interface: DiameterAvp
Creates and returns a deep copy of this AVP instance.

Specified by:
clone in interface DiameterAvp
Overrides:
clone in class java.lang.Object
Returns:
a deep copy of this AVP.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2008. All Rights Reserved.