Interface RateElement
-
- All Superinterfaces:
Cloneable
,DiameterAvp
,GroupedAvp
public interface RateElement extends GroupedAvp
Defines an interface representing the Rate-Element grouped AVP type. From the Diameter Rf Reference Point Protocol Details (3GPP TS 32.299 V8.13.0) specification:7.2.126 A Rate-Element AVP The Rate-Element AVP (AVP code 2058) is of type Grouped and holds simple rate element of one dimension. Possible dimensions are the CC-Unit-Type. It has the following ABNF grammar: Rate-Element ::= < AVP Header: 2058 > { CC-Unit-Type } [ Unit-Value ] [ Unit-Cost ] [ Unit-Quota-Threshold ]
Note:
The support for extension AVPs is present even thou the ABNF grammar for this AVP does not contain the "* [ AVP ]" line. Be aware that adding any extension AVPs may result in interoperability problems with products that strongly validate the incoming diameter message for it's adherence to the specification.
-
-
Field Summary
-
Fields inherited from interface org.jainslee.resources.diameter.base.DiameterAvp
FLAG_RULE_MAY, FLAG_RULE_MUST, FLAG_RULE_MUSTNOT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CcUnitType
getCcUnitType()
Returns the value of the CC-Unit-Type AVP, of type Enumerated.DiameterAvp[]
getExtensionAvps()
Returns the set of extension AVPs.UnitCost
getUnitCost()
Returns the value of the Unit-Cost AVP, of type Grouped.long
getUnitQuotaThreshold()
Returns the value of the Unit-Quota-Threshold AVP, of type Unsigned32.UnitValue
getUnitValue()
Returns the value of the Unit-Value AVP, of type Grouped.boolean
hasCcUnitType()
Returns true if the CC-Unit-Type AVP is present in the Rate-Element AVP.boolean
hasUnitCost()
Returns true if the Unit-Cost AVP is present in the Rate-Element AVP.boolean
hasUnitQuotaThreshold()
Returns true if the Unit-Quota-Threshold AVP is present in the Rate-Element AVP.boolean
hasUnitValue()
Returns true if the Unit-Value AVP is present in the Rate-Element AVP.void
removeCcUnitType()
Removes the CC-Unit-Type AVP from the Rate-Element AVP.void
removeExtensionAvps()
Removes all extension AVPs from the Rate-Element AVP.void
removeUnitCost()
Removes the Unit-Cost AVP from the Rate-Element AVP.void
removeUnitQuotaThreshold()
Removes the Unit-Quota-Threshold AVP from the Rate-Element AVP.void
removeUnitValue()
Removes the Unit-Value AVP from the Rate-Element AVP.void
setCcUnitType(CcUnitType ccUnitType)
Sets the value of the CC-Unit-Type AVP, of type Enumerated.void
setExtensionAvps(DiameterAvp[] avps)
Sets the set of extension AVPs with all the values in the given array.void
setUnitCost(UnitCost unitCost)
Sets the value of the Unit-Cost AVP, of type Grouped.void
setUnitQuotaThreshold(long unitQuotaThreshold)
Sets the value of the Unit-Quota-Threshold AVP, of type Unsigned32.void
setUnitValue(UnitValue unitValue)
Sets the value of the Unit-Value AVP, of type Grouped.-
Methods inherited from interface org.jainslee.resources.diameter.base.DiameterAvp
byteArrayValue, clone, doubleValue, floatValue, getCode, getMandatoryRule, getName, getProtectedRule, getType, getVendorID, groupedAvpValue, intValue, longValue, stringValue
-
-
-
-
Method Detail
-
hasCcUnitType
boolean hasCcUnitType()
Returns true if the CC-Unit-Type AVP is present in the Rate-Element AVP.
-
getCcUnitType
CcUnitType getCcUnitType()
Returns the value of the CC-Unit-Type AVP, of type Enumerated.- Returns:
- the value of the CC-Unit-Type AVP, or null if it has not been set.
-
setCcUnitType
void setCcUnitType(CcUnitType ccUnitType)
Sets the value of the CC-Unit-Type AVP, of type Enumerated.- Throws:
NullPointerException
- ifccUnitType
isnull
.
-
removeCcUnitType
void removeCcUnitType()
Removes the CC-Unit-Type AVP from the Rate-Element AVP. If the CC-Unit-Type AVP is not present, this method returns silently.
-
hasUnitValue
boolean hasUnitValue()
Returns true if the Unit-Value AVP is present in the Rate-Element AVP.
-
getUnitValue
UnitValue getUnitValue()
Returns the value of the Unit-Value AVP, of type Grouped.- Returns:
- the value of the Unit-Value AVP, or null if it has not been set.
-
setUnitValue
void setUnitValue(UnitValue unitValue)
Sets the value of the Unit-Value AVP, of type Grouped.- Throws:
NullPointerException
- ifunitValue
isnull
.
-
removeUnitValue
void removeUnitValue()
Removes the Unit-Value AVP from the Rate-Element AVP. If the Unit-Value AVP is not present, this method returns silently.
-
hasUnitCost
boolean hasUnitCost()
Returns true if the Unit-Cost AVP is present in the Rate-Element AVP.
-
getUnitCost
UnitCost getUnitCost()
Returns the value of the Unit-Cost AVP, of type Grouped.- Returns:
- the value of the Unit-Cost AVP, or null if it has not been set.
-
setUnitCost
void setUnitCost(UnitCost unitCost)
Sets the value of the Unit-Cost AVP, of type Grouped.- Throws:
NullPointerException
- ifunitCost
isnull
.
-
removeUnitCost
void removeUnitCost()
Removes the Unit-Cost AVP from the Rate-Element AVP. If the Unit-Cost AVP is not present, this method returns silently.
-
hasUnitQuotaThreshold
boolean hasUnitQuotaThreshold()
Returns true if the Unit-Quota-Threshold AVP is present in the Rate-Element AVP.
-
getUnitQuotaThreshold
long getUnitQuotaThreshold()
Returns the value of the Unit-Quota-Threshold AVP, of type Unsigned32. UsehasUnitQuotaThreshold()
to check the existence of this AVP.- Returns:
- the value of the Unit-Quota-Threshold AVP
- Throws:
IllegalStateException
- if the Unit-Quota-Threshold AVP has not been set.
-
setUnitQuotaThreshold
void setUnitQuotaThreshold(long unitQuotaThreshold)
Sets the value of the Unit-Quota-Threshold AVP, of type Unsigned32.
-
removeUnitQuotaThreshold
void removeUnitQuotaThreshold()
Removes the Unit-Quota-Threshold AVP from the Rate-Element AVP. If the Unit-Quota-Threshold AVP is not present, this method returns silently.
-
getExtensionAvps
DiameterAvp[] getExtensionAvps()
Returns the set of extension AVPs. The returned array contains the extension AVPs in the order they appear in the Rate-Element AVP. A return value of null implies that no extensions AVPs have been set.
-
setExtensionAvps
void setExtensionAvps(DiameterAvp[] avps) throws AvpNotAllowedException
Sets the set of extension AVPs with all the values in the given array. The AVPs will be added to Rate-Element AVP in the order in which they appear in the array. Note: the array must not be altered by the caller following this call, and getExtensionAvps() is not guaranteed to return the same array instance, e.g. an "==" check would fail.- Throws:
AvpNotAllowedException
- if an AVP is encountered of a type already known to this class (i.e. an AVP for which get/set methods already appear in this class)NullPointerException
- ifavps
isnull
.
-
removeExtensionAvps
void removeExtensionAvps()
Removes all extension AVPs from the Rate-Element AVP. If no extension AVPs are present, this method returns silently.
-
-