public interface CostInformation extends GroupedAvp
8.7. Cost-Information AVP The Cost-Information AVP (AVP Code 423) is of type Grouped, and it is used to return the cost information of a service, which the credit- control client can transfer transparently to the end user. The included Unit-Value AVP contains the cost estimate (always type of money) of the service, in the case of price enquiry, or the accumulated cost estimation, in the case of credit-control session. The Currency-Code specifies in which currency the cost was given. The Cost-Unit specifies the unit when the service cost is a cost per unit (e.g., cost for the service is $1 per minute). When the Requested-Action AVP with value PRICE_ENQUIRY is included in the Credit-Control-Request command, the Cost-Information AVP sent in the succeeding Credit-Control-Answer command contains the cost estimation of the requested service, without any reservation being made. The Cost-Information AVP included in the Credit-Control-Answer command with the CC-Request-Type set to UPDATE_REQUEST contains the accumulated cost estimation for the session, without taking any credit reservation into account. The Cost-Information AVP included in the Credit-Control-Answer command with the CC-Request-Type set to EVENT_REQUEST or TERMINATION_REQUEST contains the estimated total cost for the requested service. It is defined as follows (per the grouped-avp-def of RFC 3588 [DIAMBASE]): Cost-Information ::= < AVP Header: 423 > { Unit-Value } { Currency-Code } [ Cost-Unit ]Note:
FLAG_RULE_MAY, FLAG_RULE_MUST, FLAG_RULE_MUSTNOT
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCostUnit()
Returns the value of the Cost-Unit AVP, of type UTF8String.
|
long |
getCurrencyCode()
Returns the value of the Currency-Code AVP, of type Unsigned32.
|
DiameterAvp[] |
getExtensionAvps()
Returns the set of extension AVPs.
|
UnitValue |
getUnitValue()
Returns the value of the Unit-Value AVP, of type Grouped.
|
boolean |
hasCostUnit()
Returns true if the Cost-Unit AVP is present in the Cost-Information AVP.
|
boolean |
hasCurrencyCode()
Returns true if the Currency-Code AVP is present in the Cost-Information AVP.
|
boolean |
hasUnitValue()
Returns true if the Unit-Value AVP is present in the Cost-Information AVP.
|
void |
removeCostUnit()
Removes the Cost-Unit AVP from the Cost-Information AVP.
|
void |
removeCurrencyCode()
Removes the Currency-Code AVP from the Cost-Information AVP.
|
void |
removeExtensionAvps()
Removes all extension AVPs from the Cost-Information AVP.
|
void |
removeUnitValue()
Removes the Unit-Value AVP from the Cost-Information AVP.
|
void |
setCostUnit(java.lang.String costUnit)
Sets the value of the Cost-Unit AVP, of type UTF8String.
|
void |
setCurrencyCode(long currencyCode)
Sets the value of the Currency-Code AVP, of type Unsigned32.
|
void |
setExtensionAvps(DiameterAvp[] avps)
Sets the set of extension AVPs with all the values in the given array.
|
void |
setUnitValue(UnitValue unitValue)
Sets the value of the Unit-Value AVP, of type Grouped.
|
byteArrayValue, clone, doubleValue, floatValue, getCode, getMandatoryRule, getName, getProtectedRule, getType, getVendorID, groupedAvpValue, intValue, longValue, stringValue
boolean hasUnitValue()
UnitValue getUnitValue()
void setUnitValue(UnitValue unitValue)
java.lang.NullPointerException
- if unitValue
is null
.void removeUnitValue()
boolean hasCurrencyCode()
long getCurrencyCode()
hasCurrencyCode()
to check the existence of this AVP.java.lang.IllegalStateException
- if the Currency-Code AVP has not been set.void setCurrencyCode(long currencyCode)
void removeCurrencyCode()
boolean hasCostUnit()
java.lang.String getCostUnit()
void setCostUnit(java.lang.String costUnit)
java.lang.NullPointerException
- if costUnit
is null
.void removeCostUnit()
DiameterAvp[] getExtensionAvps()
void setExtensionAvps(DiameterAvp[] avps) throws AvpNotAllowedException
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)java.lang.NullPointerException
- if avps
is null
.void removeExtensionAvps()