Interface GrantedServiceUnit
-
- All Superinterfaces:
Cloneable
,DiameterAvp
,GroupedAvp
public interface GrantedServiceUnit extends GroupedAvp
Defines an interface representing the Granted-Service-Unit grouped AVP type. From the Diameter Credit-Control Application (rfc4006.txt) specification:8.17. Granted-Service-Unit AVP Granted-Service-Unit AVP (AVP Code 431) is of type Grouped and contains the amount of units that the Diameter credit-control client can provide to the end user until the service must be released or the new Credit-Control-Request must be sent. A client is not required to implement all the unit types, and it must treat unknown or unsupported unit types in the answer message as an incorrect CCA answer. In this case, the client MUST terminate the credit-control session and indicate in the Termination-Cause AVP reason DIAMETER_BAD_ANSWER. The Granted-Service-Unit AVP is defined as follows (per the grouped- avp-def of RFC 3588 [DIAMBASE]): Granted-Service-Unit ::= < AVP Header: 431 > [ Tariff-Time-Change ] [ CC-Time ] [ CC-Money ] [ CC-Total-Octets ] [ CC-Input-Octets ] [ CC-Output-Octets ] [ CC-Service-Specific-Units ] *[ AVP ]
-
-
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 long
getCcInputOctets()
Returns the value of the CC-Input-Octets AVP, of type Unsigned64.CcMoney
getCcMoney()
Returns the value of the CC-Money AVP, of type Grouped.long
getCcOutputOctets()
Returns the value of the CC-Output-Octets AVP, of type Unsigned64.long
getCcServiceSpecificUnits()
Returns the value of the CC-Service-Specific-Units AVP, of type Unsigned64.long
getCcTime()
Returns the value of the CC-Time AVP, of type Unsigned32.long
getCcTotalOctets()
Returns the value of the CC-Total-Octets AVP, of type Unsigned64.DiameterAvp[]
getExtensionAvps()
Returns the set of extension AVPs.Date
getTariffTimeChange()
Returns the value of the Tariff-Time-Change AVP, of type Time.boolean
hasCcInputOctets()
Returns true if the CC-Input-Octets AVP is present in the Granted-Service-Unit AVP.boolean
hasCcMoney()
Returns true if the CC-Money AVP is present in the Granted-Service-Unit AVP.boolean
hasCcOutputOctets()
Returns true if the CC-Output-Octets AVP is present in the Granted-Service-Unit AVP.boolean
hasCcServiceSpecificUnits()
Returns true if the CC-Service-Specific-Units AVP is present in the Granted-Service-Unit AVP.boolean
hasCcTime()
Returns true if the CC-Time AVP is present in the Granted-Service-Unit AVP.boolean
hasCcTotalOctets()
Returns true if the CC-Total-Octets AVP is present in the Granted-Service-Unit AVP.boolean
hasTariffTimeChange()
Returns true if the Tariff-Time-Change AVP is present in the Granted-Service-Unit AVP.void
removeCcInputOctets()
Removes the CC-Input-Octets AVP from the Granted-Service-Unit AVP.void
removeCcMoney()
Removes the CC-Money AVP from the Granted-Service-Unit AVP.void
removeCcOutputOctets()
Removes the CC-Output-Octets AVP from the Granted-Service-Unit AVP.void
removeCcServiceSpecificUnits()
Removes the CC-Service-Specific-Units AVP from the Granted-Service-Unit AVP.void
removeCcTime()
Removes the CC-Time AVP from the Granted-Service-Unit AVP.void
removeCcTotalOctets()
Removes the CC-Total-Octets AVP from the Granted-Service-Unit AVP.void
removeExtensionAvps()
Removes all extension AVPs from the Granted-Service-Unit AVP.void
removeTariffTimeChange()
Removes the Tariff-Time-Change AVP from the Granted-Service-Unit AVP.void
setCcInputOctets(long ccInputOctets)
Sets the value of the CC-Input-Octets AVP, of type Unsigned64.void
setCcMoney(CcMoney ccMoney)
Sets the value of the CC-Money AVP, of type Grouped.void
setCcOutputOctets(long ccOutputOctets)
Sets the value of the CC-Output-Octets AVP, of type Unsigned64.void
setCcServiceSpecificUnits(long ccServiceSpecificUnits)
Sets the value of the CC-Service-Specific-Units AVP, of type Unsigned64.void
setCcTime(long ccTime)
Sets the value of the CC-Time AVP, of type Unsigned32.void
setCcTotalOctets(long ccTotalOctets)
Sets the value of the CC-Total-Octets AVP, of type Unsigned64.void
setExtensionAvps(DiameterAvp[] avps)
Sets the set of extension AVPs with all the values in the given array.void
setTariffTimeChange(Date tariffTimeChange)
Sets the value of the Tariff-Time-Change AVP, of type Time.-
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
-
hasTariffTimeChange
boolean hasTariffTimeChange()
Returns true if the Tariff-Time-Change AVP is present in the Granted-Service-Unit AVP.
-
getTariffTimeChange
Date getTariffTimeChange()
Returns the value of the Tariff-Time-Change AVP, of type Time.- Returns:
- the value of the Tariff-Time-Change AVP, or null if it has not been set.
-
setTariffTimeChange
void setTariffTimeChange(Date tariffTimeChange)
Sets the value of the Tariff-Time-Change AVP, of type Time.- Throws:
NullPointerException
- iftariffTimeChange
isnull
.
-
removeTariffTimeChange
void removeTariffTimeChange()
Removes the Tariff-Time-Change AVP from the Granted-Service-Unit AVP. If the Tariff-Time-Change AVP is not present, this method returns silently.
-
hasCcTime
boolean hasCcTime()
Returns true if the CC-Time AVP is present in the Granted-Service-Unit AVP.
-
getCcTime
long getCcTime()
Returns the value of the CC-Time AVP, of type Unsigned32. UsehasCcTime()
to check the existence of this AVP.- Returns:
- the value of the CC-Time AVP
- Throws:
IllegalStateException
- if the CC-Time AVP has not been set.
-
setCcTime
void setCcTime(long ccTime)
Sets the value of the CC-Time AVP, of type Unsigned32.
-
removeCcTime
void removeCcTime()
Removes the CC-Time AVP from the Granted-Service-Unit AVP. If the CC-Time AVP is not present, this method returns silently.
-
hasCcMoney
boolean hasCcMoney()
Returns true if the CC-Money AVP is present in the Granted-Service-Unit AVP.
-
getCcMoney
CcMoney getCcMoney()
Returns the value of the CC-Money AVP, of type Grouped.- Returns:
- the value of the CC-Money AVP, or null if it has not been set.
-
setCcMoney
void setCcMoney(CcMoney ccMoney)
Sets the value of the CC-Money AVP, of type Grouped.- Throws:
NullPointerException
- ifccMoney
isnull
.
-
removeCcMoney
void removeCcMoney()
Removes the CC-Money AVP from the Granted-Service-Unit AVP. If the CC-Money AVP is not present, this method returns silently.
-
hasCcTotalOctets
boolean hasCcTotalOctets()
Returns true if the CC-Total-Octets AVP is present in the Granted-Service-Unit AVP.
-
getCcTotalOctets
long getCcTotalOctets()
Returns the value of the CC-Total-Octets AVP, of type Unsigned64. UsehasCcTotalOctets()
to check the existence of this AVP.- Returns:
- the value of the CC-Total-Octets AVP
- Throws:
IllegalStateException
- if the CC-Total-Octets AVP has not been set.
-
setCcTotalOctets
void setCcTotalOctets(long ccTotalOctets)
Sets the value of the CC-Total-Octets AVP, of type Unsigned64.
-
removeCcTotalOctets
void removeCcTotalOctets()
Removes the CC-Total-Octets AVP from the Granted-Service-Unit AVP. If the CC-Total-Octets AVP is not present, this method returns silently.
-
hasCcInputOctets
boolean hasCcInputOctets()
Returns true if the CC-Input-Octets AVP is present in the Granted-Service-Unit AVP.
-
getCcInputOctets
long getCcInputOctets()
Returns the value of the CC-Input-Octets AVP, of type Unsigned64. UsehasCcInputOctets()
to check the existence of this AVP.- Returns:
- the value of the CC-Input-Octets AVP
- Throws:
IllegalStateException
- if the CC-Input-Octets AVP has not been set.
-
setCcInputOctets
void setCcInputOctets(long ccInputOctets)
Sets the value of the CC-Input-Octets AVP, of type Unsigned64.
-
removeCcInputOctets
void removeCcInputOctets()
Removes the CC-Input-Octets AVP from the Granted-Service-Unit AVP. If the CC-Input-Octets AVP is not present, this method returns silently.
-
hasCcOutputOctets
boolean hasCcOutputOctets()
Returns true if the CC-Output-Octets AVP is present in the Granted-Service-Unit AVP.
-
getCcOutputOctets
long getCcOutputOctets()
Returns the value of the CC-Output-Octets AVP, of type Unsigned64. UsehasCcOutputOctets()
to check the existence of this AVP.- Returns:
- the value of the CC-Output-Octets AVP
- Throws:
IllegalStateException
- if the CC-Output-Octets AVP has not been set.
-
setCcOutputOctets
void setCcOutputOctets(long ccOutputOctets)
Sets the value of the CC-Output-Octets AVP, of type Unsigned64.
-
removeCcOutputOctets
void removeCcOutputOctets()
Removes the CC-Output-Octets AVP from the Granted-Service-Unit AVP. If the CC-Output-Octets AVP is not present, this method returns silently.
-
hasCcServiceSpecificUnits
boolean hasCcServiceSpecificUnits()
Returns true if the CC-Service-Specific-Units AVP is present in the Granted-Service-Unit AVP.
-
getCcServiceSpecificUnits
long getCcServiceSpecificUnits()
Returns the value of the CC-Service-Specific-Units AVP, of type Unsigned64. UsehasCcServiceSpecificUnits()
to check the existence of this AVP.- Returns:
- the value of the CC-Service-Specific-Units AVP
- Throws:
IllegalStateException
- if the CC-Service-Specific-Units AVP has not been set.
-
setCcServiceSpecificUnits
void setCcServiceSpecificUnits(long ccServiceSpecificUnits)
Sets the value of the CC-Service-Specific-Units AVP, of type Unsigned64.
-
removeCcServiceSpecificUnits
void removeCcServiceSpecificUnits()
Removes the CC-Service-Specific-Units AVP from the Granted-Service-Unit AVP. If the CC-Service-Specific-Units 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 Granted-Service-Unit 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 Granted-Service-Unit 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 Granted-Service-Unit AVP. If no extension AVPs are present, this method returns silently.
-
-