org.jdiameter.api.validation
Interface AvpRepresentation


public interface AvpRepresentation

Represents avp, it stores info about presence, multiplicity, avp code, vendor.

Since:
1.5.4.0-build404
Author:
Bartosz Baranowski , Alexandre Mendonca

Nested Class Summary
static class AvpRepresentation.Rule
           
static class AvpRepresentation.Type
           
 
Field Summary
static java.lang.String _DEFAULT_MANDATORY
           
static java.lang.String _DEFAULT_PROTECTED
           
static java.lang.String _DEFAULT_VENDOR
           
static int _FIX_POSITION_INDEX
           
static java.lang.String _MP_NOT_ALLOWED
           Represents multiplicity of AVP: 0 The AVP MUST NOT be present in the message.
static java.lang.String _MP_ONE
           Represents multiplicity of AVP: 1 One instance of the AVP MUST be present in the message.
static java.lang.String _MP_ONE_AND_MORE
           Represents multiplicity of AVP: 1+ At least one instance of the AVP MUST be present in the message.
static java.lang.String _MP_ZERO_OR_MORE
           Represents multiplicity of AVP: 0+ Zero or more instances of the AVP MAY be present in the message.
static java.lang.String _MP_ZERO_OR_ONE
           Represents multiplicity of AVP: 0-1 Zero or one instance of the AVP MAY be present in the message.
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
           
 java.util.List<AvpRepresentation> getChildren()
           
 int getCode()
           
 java.lang.String getDescription()
           
 java.lang.String getMultiplicityIndicator()
           
 java.lang.String getName()
           
 int getPositionIndex()
           
 java.lang.String getRuleMandatory()
           
 int getRuleMandatoryAsInt()
           
 java.lang.String getRuleProtected()
           
 int getRuleProtectedAsInt()
           
 java.lang.String getRuleVendorBit()
           
 int getRuleVendorBitAsInt()
           
 java.lang.String getType()
           
 long getVendorId()
           
 int hashCode()
           
 boolean isAllowed()
           
 boolean isAllowed(int avpCode)
           
 boolean isAllowed(int avpCode, long vendorId)
           
 boolean isCountValidForMultiplicity(AvpSet destination, int numberToAdd)
           
 boolean isCountValidForMultiplicity(int avpCount)
           
 boolean isGrouped()
           
 boolean isMandatory()
           
 boolean isMayEncrypt()
           
 boolean isPositionFixed()
           
 boolean isProtected()
           
 boolean isWeak()
           
 java.lang.String toString()
           
 void validate(Avp avp)
          Validates passed avp.
 void validate(AvpSet avpSet)
          Validates passed avp.
 

Field Detail

_MP_NOT_ALLOWED

static final java.lang.String _MP_NOT_ALLOWED
 Represents multiplicity of AVP:
 0     The AVP MUST NOT be present in the message.
 

See Also:
Constant Field Values

_MP_ZERO_OR_MORE

static final java.lang.String _MP_ZERO_OR_MORE
 Represents multiplicity of AVP:
 0+    Zero or more instances of the AVP MAY be present in the message.
 

See Also:
Constant Field Values

_MP_ZERO_OR_ONE

static final java.lang.String _MP_ZERO_OR_ONE
 Represents multiplicity of AVP:
 0-1   Zero or one instance of the AVP MAY be present in the message.
       It is considered an error if there are more than one instance of the AVP.
 

See Also:
Constant Field Values

_MP_ONE

static final java.lang.String _MP_ONE
 Represents multiplicity of AVP:
 1     One instance of the AVP MUST be present in the message.
       message.
 

See Also:
Constant Field Values

_MP_ONE_AND_MORE

static final java.lang.String _MP_ONE_AND_MORE
 Represents multiplicity of AVP:
 1+    At least one instance of the AVP MUST be present in the
       message.
 

See Also:
Constant Field Values

_DEFAULT_MANDATORY

static final java.lang.String _DEFAULT_MANDATORY
See Also:
Constant Field Values

_DEFAULT_PROTECTED

static final java.lang.String _DEFAULT_PROTECTED
See Also:
Constant Field Values

_DEFAULT_VENDOR

static final java.lang.String _DEFAULT_VENDOR
See Also:
Constant Field Values

_FIX_POSITION_INDEX

static final int _FIX_POSITION_INDEX
See Also:
Constant Field Values
Method Detail

isPositionFixed

boolean isPositionFixed()

isCountValidForMultiplicity

boolean isCountValidForMultiplicity(int avpCount)

isCountValidForMultiplicity

boolean isCountValidForMultiplicity(AvpSet destination,
                                    int numberToAdd)

isAllowed

boolean isAllowed(int avpCode,
                  long vendorId)

isAllowed

boolean isAllowed(int avpCode)

getPositionIndex

int getPositionIndex()

getCode

int getCode()

getVendorId

long getVendorId()

isAllowed

boolean isAllowed()

getMultiplicityIndicator

java.lang.String getMultiplicityIndicator()

getName

java.lang.String getName()

isGrouped

boolean isGrouped()

getChildren

java.util.List<AvpRepresentation> getChildren()

isWeak

boolean isWeak()

getDescription

java.lang.String getDescription()

isMayEncrypt

boolean isMayEncrypt()

getRuleMandatory

java.lang.String getRuleMandatory()

getRuleMandatoryAsInt

int getRuleMandatoryAsInt()

getRuleProtected

java.lang.String getRuleProtected()

getRuleProtectedAsInt

int getRuleProtectedAsInt()

getRuleVendorBit

java.lang.String getRuleVendorBit()

getRuleVendorBitAsInt

int getRuleVendorBitAsInt()

getType

java.lang.String getType()

isProtected

boolean isProtected()

isMandatory

boolean isMandatory()

validate

void validate(Avp avp)
              throws AvpNotAllowedException
Validates passed avp.

Parameters:
avp - - simply avp which should be confronted vs definition
Throws:
AvpNotAllowedException

validate

void validate(AvpSet avpSet)
              throws AvpNotAllowedException
Validates passed avp.

Parameters:
avpSet - - AvpSet which represents internal content of this avp
Throws:
AvpNotAllowedException

toString

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

hashCode

int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

clone

java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException


Copyright © 2013. All Rights Reserved.