Interface TimeQuotaMechanism
-
- All Superinterfaces:
Cloneable,DiameterAvp,GroupedAvp
public interface TimeQuotaMechanism extends GroupedAvp
Defines an interface representing the Time-Quota-Mechanism grouped AVP type. From the Diameter Ro Reference Point Protocol Details (3GPP TS 32.299 V11.8.0) specification:7.2.228 Time-Quota-Mechanism The Time-Quota-Mechanism AVP (AVP code 1270) is of type Grouped. It has the following syntax: Time-Quota-Mechanism ::= < AVP Header: 1270> { Time-Quota-Type } { Base-Time-Interval } The OCS may include this AVP in an Multiple-Services-Credit-Control AVP, when granting time quota.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 longgetBaseTimeInterval()Returns the value of the Base-Time-Interval AVP, of type Unsigned32.DiameterAvp[]getExtensionAvps()Returns the set of extension AVPs.TimeQuotaTypegetTimeQuotaType()Returns the value of the Time-Quota-Type AVP, of type Enumerated.booleanhasBaseTimeInterval()Returns true if the Base-Time-Interval AVP is present in the Time-Quota-Mechanism AVP.booleanhasTimeQuotaType()Returns true if the Time-Quota-Type AVP is present in the Time-Quota-Mechanism AVP.voidremoveBaseTimeInterval()Removes the Base-Time-Interval AVP from the Time-Quota-Mechanism AVP.voidremoveExtensionAvps()Removes all extension AVPs from the Time-Quota-Mechanism AVP.voidremoveTimeQuotaType()Removes the Time-Quota-Type AVP from the Time-Quota-Mechanism AVP.voidsetBaseTimeInterval(long baseTimeInterval)Sets the value of the Base-Time-Interval AVP, of type Unsigned32.voidsetExtensionAvps(DiameterAvp[] avps)Sets the set of extension AVPs with all the values in the given array.voidsetTimeQuotaType(TimeQuotaType timeQuotaType)Sets the value of the Time-Quota-Type AVP, of type Enumerated.-
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
-
hasTimeQuotaType
boolean hasTimeQuotaType()
Returns true if the Time-Quota-Type AVP is present in the Time-Quota-Mechanism AVP.
-
getTimeQuotaType
TimeQuotaType getTimeQuotaType()
Returns the value of the Time-Quota-Type AVP, of type Enumerated.- Returns:
- the value of the Time-Quota-Type AVP, or null if it has not been set.
-
setTimeQuotaType
void setTimeQuotaType(TimeQuotaType timeQuotaType)
Sets the value of the Time-Quota-Type AVP, of type Enumerated.- Throws:
NullPointerException- iftimeQuotaTypeisnull.
-
removeTimeQuotaType
void removeTimeQuotaType()
Removes the Time-Quota-Type AVP from the Time-Quota-Mechanism AVP. If the Time-Quota-Type AVP is not present, this method returns silently.
-
hasBaseTimeInterval
boolean hasBaseTimeInterval()
Returns true if the Base-Time-Interval AVP is present in the Time-Quota-Mechanism AVP.
-
getBaseTimeInterval
long getBaseTimeInterval()
Returns the value of the Base-Time-Interval AVP, of type Unsigned32. UsehasBaseTimeInterval()to check the existence of this AVP.- Returns:
- the value of the Base-Time-Interval AVP
- Throws:
IllegalStateException- if the Base-Time-Interval AVP has not been set.
-
setBaseTimeInterval
void setBaseTimeInterval(long baseTimeInterval)
Sets the value of the Base-Time-Interval AVP, of type Unsigned32.
-
removeBaseTimeInterval
void removeBaseTimeInterval()
Removes the Base-Time-Interval AVP from the Time-Quota-Mechanism AVP. If the Base-Time-Interval 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 Time-Quota-Mechanism 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 Time-Quota-Mechanism 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 Time-Quota-Mechanism AVP. If no extension AVPs are present, this method returns silently.
-
-