Interface AocCostInformation
-
- All Superinterfaces:
Cloneable
,DiameterAvp
,GroupedAvp
public interface AocCostInformation extends GroupedAvp
Defines an interface representing the AoC-Cost-Information grouped AVP type. From the Diameter Rf Reference Point Protocol Details (3GPP TS 32.299 V10.0.0) specification:7.2.13 AoC-Cost-Information AVP The AoC-Cost-Information AVP (AVP code 2053) is of type Grouped and holds accumulated and incremental cost information for the AoC service It has the following ABNF grammar: AoC-Cost-Information ::= < AVP Header: 2053 > [ Accumulated-Cost] * [ Incremental-Cost ] [ Currency-Code ]
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 AccumulatedCost
getAccumulatedCost()
Returns the value of the Accumulated-Cost AVP, of type Grouped.long
getCurrencyCode()
Returns the value of the Currency-Code AVP, of type Unsigned32.DiameterAvp[]
getExtensionAvps()
Returns the set of extension AVPs.IncrementalCost[]
getIncrementalCosts()
Returns the set of Incremental-Cost AVPs.boolean
hasAccumulatedCost()
Returns true if the Accumulated-Cost AVP is present in the AoC-Cost-Information AVP.boolean
hasCurrencyCode()
Returns true if the Currency-Code AVP is present in the AoC-Cost-Information AVP.void
removeAccumulatedCost()
Removes the Accumulated-Cost AVP from the AoC-Cost-Information AVP.void
removeCurrencyCode()
Removes the Currency-Code AVP from the AoC-Cost-Information AVP.void
removeExtensionAvps()
Removes all extension AVPs from the AoC-Cost-Information AVP.void
removeIncrementalCosts()
Removes all Incremental-Cost AVPs from the AoC-Cost-Information AVP.void
setAccumulatedCost(AccumulatedCost accumulatedCost)
Sets the value of the Accumulated-Cost AVP, of type Grouped.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
setIncrementalCost(IncrementalCost incrementalCost)
Sets a single Incremental-Cost AVP in the AoC-Cost-Information AVP, of type Grouped.void
setIncrementalCosts(IncrementalCost[] incrementalCosts)
Sets the set of Incremental-Cost AVPs, with all the values in the given array.-
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
-
hasAccumulatedCost
boolean hasAccumulatedCost()
Returns true if the Accumulated-Cost AVP is present in the AoC-Cost-Information AVP.
-
getAccumulatedCost
AccumulatedCost getAccumulatedCost()
Returns the value of the Accumulated-Cost AVP, of type Grouped.- Returns:
- the value of the Accumulated-Cost AVP, or null if it has not been set.
-
setAccumulatedCost
void setAccumulatedCost(AccumulatedCost accumulatedCost)
Sets the value of the Accumulated-Cost AVP, of type Grouped.- Throws:
NullPointerException
- ifaccumulatedCost
isnull
.
-
removeAccumulatedCost
void removeAccumulatedCost()
Removes the Accumulated-Cost AVP from the AoC-Cost-Information AVP. If the Accumulated-Cost AVP is not present, this method returns silently.
-
getIncrementalCosts
IncrementalCost[] getIncrementalCosts()
Returns the set of Incremental-Cost AVPs. The returned array contains the AVPs in the order they appear in the AoC-Cost-Information AVP. A return value of null implies that no Incremental-Cost AVPs have been set. The elements in the given array are IncrementalCost objects.
-
setIncrementalCost
void setIncrementalCost(IncrementalCost incrementalCost)
Sets a single Incremental-Cost AVP in the AoC-Cost-Information AVP, of type Grouped.- Throws:
NullPointerException
- ifincrementalCost
isnull
.
-
setIncrementalCosts
void setIncrementalCosts(IncrementalCost[] incrementalCosts)
Sets the set of Incremental-Cost AVPs, with all the values in the given array. The AVPs will be added to the AoC-Cost-Information 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 getIncrementalCosts() is not guaranteed to return the same array instance, e.g. an "==" check would fail.- Throws:
NullPointerException
- ifincrementalCosts
isnull
.
-
removeIncrementalCosts
void removeIncrementalCosts()
Removes all Incremental-Cost AVPs from the AoC-Cost-Information AVP. If no Incremental-Cost AVPs are present, this method returns silently.
-
hasCurrencyCode
boolean hasCurrencyCode()
Returns true if the Currency-Code AVP is present in the AoC-Cost-Information AVP.
-
getCurrencyCode
long getCurrencyCode()
Returns the value of the Currency-Code AVP, of type Unsigned32. UsehasCurrencyCode()
to check the existence of this AVP.- Returns:
- the value of the Currency-Code AVP
- Throws:
IllegalStateException
- if the Currency-Code AVP has not been set.
-
setCurrencyCode
void setCurrencyCode(long currencyCode)
Sets the value of the Currency-Code AVP, of type Unsigned32.
-
removeCurrencyCode
void removeCurrencyCode()
Removes the Currency-Code AVP from the AoC-Cost-Information AVP. If the Currency-Code 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 AoC-Cost-Information 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 AoC-Cost-Information 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 AoC-Cost-Information AVP. If no extension AVPs are present, this method returns silently.
-
-