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 V9.6.0) specification:7.2.161 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 } [ Reason-Code ] [ 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 CcUnitTypegetCcUnitType()Returns the value of the CC-Unit-Type AVP, of type Enumerated.DiameterAvp[]getExtensionAvps()Returns the set of extension AVPs.ReasonCodegetReasonCode()Returns the value of the Reason-Code AVP, of type Enumerated.UnitCostgetUnitCost()Returns the value of the Unit-Cost AVP, of type Grouped.longgetUnitQuotaThreshold()Returns the value of the Unit-Quota-Threshold AVP, of type Unsigned32.UnitValuegetUnitValue()Returns the value of the Unit-Value AVP, of type Grouped.booleanhasCcUnitType()Returns true if the CC-Unit-Type AVP is present in the Rate-Element AVP.booleanhasReasonCode()Returns true if the Reason-Code AVP is present in the Rate-Element AVP.booleanhasUnitCost()Returns true if the Unit-Cost AVP is present in the Rate-Element AVP.booleanhasUnitQuotaThreshold()Returns true if the Unit-Quota-Threshold AVP is present in the Rate-Element AVP.booleanhasUnitValue()Returns true if the Unit-Value AVP is present in the Rate-Element AVP.voidremoveCcUnitType()Removes the CC-Unit-Type AVP from the Rate-Element AVP.voidremoveExtensionAvps()Removes all extension AVPs from the Rate-Element AVP.voidremoveReasonCode()Removes the Reason-Code AVP from the Rate-Element AVP.voidremoveUnitCost()Removes the Unit-Cost AVP from the Rate-Element AVP.voidremoveUnitQuotaThreshold()Removes the Unit-Quota-Threshold AVP from the Rate-Element AVP.voidremoveUnitValue()Removes the Unit-Value AVP from the Rate-Element AVP.voidsetCcUnitType(CcUnitType ccUnitType)Sets the value of the CC-Unit-Type AVP, of type Enumerated.voidsetExtensionAvps(DiameterAvp[] avps)Sets the set of extension AVPs with all the values in the given array.voidsetReasonCode(ReasonCode reasonCode)Sets the value of the Reason-Code AVP, of type Enumerated.voidsetUnitCost(UnitCost unitCost)Sets the value of the Unit-Cost AVP, of type Grouped.voidsetUnitQuotaThreshold(long unitQuotaThreshold)Sets the value of the Unit-Quota-Threshold AVP, of type Unsigned32.voidsetUnitValue(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- ifccUnitTypeisnull.
-
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.
-
hasReasonCode
boolean hasReasonCode()
Returns true if the Reason-Code AVP is present in the Rate-Element AVP.
-
getReasonCode
ReasonCode getReasonCode()
Returns the value of the Reason-Code AVP, of type Enumerated.- Returns:
- the value of the Reason-Code AVP, or null if it has not been set.
-
setReasonCode
void setReasonCode(ReasonCode reasonCode)
Sets the value of the Reason-Code AVP, of type Enumerated.- Throws:
NullPointerException- ifreasonCodeisnull.
-
removeReasonCode
void removeReasonCode()
Removes the Reason-Code AVP from the Rate-Element AVP. If the Reason-Code 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- ifunitValueisnull.
-
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- ifunitCostisnull.
-
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- ifavpsisnull.
-
removeExtensionAvps
void removeExtensionAvps()
Removes all extension AVPs from the Rate-Element AVP. If no extension AVPs are present, this method returns silently.
-
-