Interface SessionCounter
-
- All Superinterfaces:
DirtyMonitor
,com.opencloud.rhino.cmp.Encodable
public interface SessionCounter extends com.opencloud.rhino.cmp.Encodable, DirtyMonitor
SessionCounter
contains the charging counters related to a uniqueSessionCounterAddress
set of key/value pairs and provide methods for incrementing the various charging counters and getting the current values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SessionCounterAddress
getAddress()
Gets the name/value pairs which uniquely label this SessionCounter.long
getCumulativeCommittedUsed()
Gets the cumulative value of this counter's 'committedUsed' field.long
getCumulativeGranted()
Get the cumulative value of this counter's 'granted' field.long
getCumulativeGrantedRefund()
Get the cumulative value of this counter's 'grantedRefund' field.long
getCumulativeRequested()
Get the cumulative value of this counter's 'requested' field.long
getCumulativeRequestedRefund()
Get the cumulative value of this counter's 'requestedRefund' field.long
getCumulativeSentUsed()
Get the cumulative value of this counter's 'sentUsed' field.long
getCumulativeSuspendedDuration()
Get the cumulative value of this counter's 'CumulativeSuspendedDuration' field.long
getEndTime()
The end time is recorded when the session ceases consuming units.long
getGrantedUnitsValidityExpiry()
Unit validity expiry is the time until which the latest granted units are valid.long
getPendingRequested()
Gets the value of the 'pendingRequested' field.long
getReportedUsed()
Gets the value of the 'reportedUsed' field.long
getStartTime()
The start time is recorded when the session starts consuming units For instance, when the session is established.long
getSuspensionStartTime()
The suspension start time value is the time the session counter is suspended by a charging instance, which may be at creation.void
increment(SessionCounter sessionCounter)
Increment all session counter fields based on aSessionCounter
.void
incrementCumulativeCommittedUsed(long committedUsed)
Increment the value of this counter's 'committedUsed' field.void
incrementCumulativeGranted(long granted)
Increment the value of this counter's 'granted' field.void
incrementCumulativeGrantedRefund(long granted)
Increment the value of this counter's 'grantedRefund' field.void
incrementCumulativeRequested(long requested)
Increment the value of this counter's 'requested' field.void
incrementCumulativeRequestedRefund(long requestedRefund)
Increment the value of this counter's 'requestedRefund' field.void
incrementCumulativeSentUsed(long sentUsed)
Increment the value of this counter's 'sentUsed' field.void
incrementCumulativeSuspendedDuration(long suspendedDurationMillis)
Increment the value of this counter's 'CumulativeSuspendedDuration' field.void
setEndTime(long endTimeMillis)
The end time is recorded when the session ceases consuming units.void
setGrantedUnitsValidityExpiry(long unitsValidityExpiryMillis)
Unit validity expiry is the time until which the latest granted units are valid.void
setPendingRequested(long pendingRequested)
Sets the value of the 'pendingRequested' field.void
setReportedUsed(long reportedUsed)
Sets the value of the 'reportedUsed' field.void
setStartTime(long startTimeMillis)
The start time is recorded when the session starts consuming units For instance, when the session is established.-
Methods inherited from interface com.opencloud.sentinel.util.DirtyMonitor
isDirtyAndClear
-
-
-
-
Method Detail
-
getAddress
SessionCounterAddress getAddress()
Gets the name/value pairs which uniquely label this SessionCounter.- Returns:
- the
SessionCounterAddress
that uniquely label thisSessionCounter
.
-
getReportedUsed
long getReportedUsed()
Gets the value of the 'reportedUsed' field.- Returns:
- the value of the 'reportedUsed' field.
-
setReportedUsed
void setReportedUsed(long reportedUsed)
Sets the value of the 'reportedUsed' field.- Parameters:
reportedUsed
- set the value of the 'reportedUsed' field.
-
getPendingRequested
long getPendingRequested()
Gets the value of the 'pendingRequested' field.- Returns:
- the value of the 'pendingRequested' field.
-
setPendingRequested
void setPendingRequested(long pendingRequested)
Sets the value of the 'pendingRequested' field.- Parameters:
pendingRequested
- value to set
-
getCumulativeSentUsed
long getCumulativeSentUsed()
Get the cumulative value of this counter's 'sentUsed' field.- Returns:
- the cumulative value of this counter's 'sentUsed' field.
-
incrementCumulativeSentUsed
void incrementCumulativeSentUsed(long sentUsed)
Increment the value of this counter's 'sentUsed' field.- Parameters:
sentUsed
- the value of this counter's 'sentUsed' field to increment.
-
getCumulativeCommittedUsed
long getCumulativeCommittedUsed()
Gets the cumulative value of this counter's 'committedUsed' field.- Returns:
- the cumulative value of this counter's 'committedUsed' field.
-
incrementCumulativeCommittedUsed
void incrementCumulativeCommittedUsed(long committedUsed)
Increment the value of this counter's 'committedUsed' field.- Parameters:
committedUsed
- the value of this counter's 'committedUsed' field to increment by.
-
getCumulativeRequested
long getCumulativeRequested()
Get the cumulative value of this counter's 'requested' field.- Returns:
- the cumulative value of this counter's 'requested' field.
-
incrementCumulativeRequested
void incrementCumulativeRequested(long requested)
Increment the value of this counter's 'requested' field.- Parameters:
requested
- the value of this counter's 'requested' field to increment by.
-
getCumulativeGranted
long getCumulativeGranted()
Get the cumulative value of this counter's 'granted' field.- Returns:
- the cumulative value of this counter's 'granted' field.
-
incrementCumulativeGranted
void incrementCumulativeGranted(long granted)
Increment the value of this counter's 'granted' field.- Parameters:
granted
- the value of this counter's 'granted' field to increment by.
-
getCumulativeRequestedRefund
long getCumulativeRequestedRefund()
Get the cumulative value of this counter's 'requestedRefund' field.- Returns:
- the cumulative value of this counter's 'requestedRefund' field.
-
incrementCumulativeRequestedRefund
void incrementCumulativeRequestedRefund(long requestedRefund)
Increment the value of this counter's 'requestedRefund' field.- Parameters:
requestedRefund
- the value of this counter's 'requestedRefund' field to increment by.
-
getCumulativeGrantedRefund
long getCumulativeGrantedRefund()
Get the cumulative value of this counter's 'grantedRefund' field.- Returns:
- the cumulative value of this counter's 'grantedRefund' field.
-
incrementCumulativeGrantedRefund
void incrementCumulativeGrantedRefund(long granted)
Increment the value of this counter's 'grantedRefund' field.- Parameters:
granted
- the value of this counter's 'grantedRefund' field to increment by.
-
increment
void increment(SessionCounter sessionCounter)
Increment all session counter fields based on aSessionCounter
.- Parameters:
sessionCounter
- the session counter to increment by.
-
setStartTime
void setStartTime(long startTimeMillis)
The start time is recorded when the session starts consuming units For instance, when the session is established. Until this point the value will be -1 to indicate that it is unset.- Parameters:
startTimeMillis
- start time in milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.
-
getStartTime
long getStartTime()
The start time is recorded when the session starts consuming units For instance, when the session is established. Until this point the value will be -1 to indicate that it is unset.- Returns:
- start time in milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.
-
setEndTime
void setEndTime(long endTimeMillis)
The end time is recorded when the session ceases consuming units. For instance, when the session being charged is terminated. Until this point the value will be -1 to indicate that it is unset- Parameters:
end
- time in milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.
-
getEndTime
long getEndTime()
The end time is recorded when the session ceases consuming units. For instance, when the session being charged is terminated. Until this point the value will be -1 to indicate that it is unset- Returns:
- end time in milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.
-
getSuspensionStartTime
long getSuspensionStartTime()
The suspension start time value is the time the session counter is suspended by a charging instance, which may be at creation.- Returns:
- the value of the 'suspensionStartTime' field in milliseconds from the epoch
-
getCumulativeSuspendedDuration
long getCumulativeSuspendedDuration()
Get the cumulative value of this counter's 'CumulativeSuspendedDuration' field. Indicates the total number of units used whenever charging was suspended.- Returns:
- the cumulative value of this counter's 'CumulativeSuspendedDuration' field in milliseconds.
-
incrementCumulativeSuspendedDuration
void incrementCumulativeSuspendedDuration(long suspendedDurationMillis)
Increment the value of this counter's 'CumulativeSuspendedDuration' field. Indicates the total number of units used while charging was suspended.- Parameters:
suspendedDuration
- the amount to increment this counter's 'CumulativeSuspendedDuration' field by in milliseconds.
-
getGrantedUnitsValidityExpiry
long getGrantedUnitsValidityExpiry()
Unit validity expiry is the time until which the latest granted units are valid.- Returns:
- the value of the 'grantedUnitsValidityExpirty' field in milliseconds from the epoch.
-
setGrantedUnitsValidityExpiry
void setGrantedUnitsValidityExpiry(long unitsValidityExpiryMillis)
Unit validity expiry is the time until which the latest granted units are valid.
-
-