Package org.eclipse.hono.util
Class ResourceLimitsPeriod
java.lang.Object
org.eclipse.hono.util.ResourceLimitsPeriod
The period definition corresponding to a resource limit for a tenant.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The mode of the data volume calculation. -
Constructor Summary
ConstructorDescriptionCreates a new period object for a mode. -
Method Summary
Modifier and TypeMethodDescriptionfinal Duration
getElapsedAccountingPeriodDuration
(Instant start, Instant end) Gets the duration for which the most recent accounting period as defined by this specification overlaps with a given period of time.getMode()
Gets the mode of period for resource limit calculation.final int
Gets the number of days for which resource usage is calculated.final ResourceLimitsPeriod
setNoOfDays
(int noOfDays) Sets the number of days for which resource usage is calculated.
-
Constructor Details
-
ResourceLimitsPeriod
Creates a new period object for a mode.- Parameters:
mode
- The mode.- Throws:
NullPointerException
- if mode isnull
.
-
-
Method Details
-
getMode
Gets the mode of period for resource limit calculation.- Returns:
- The mode of period for resource limit calculation.
-
getNoOfDays
public final int getNoOfDays()Gets the number of days for which resource usage is calculated.- Returns:
- The number of days for a resource limit calculation.
-
setNoOfDays
Sets the number of days for which resource usage is calculated.- Parameters:
noOfDays
- The number of days for which resource usage is calculated.- Returns:
- a reference to this for fluent use.
- Throws:
IllegalArgumentException
- if the number of days is negative.
-
getElapsedAccountingPeriodDuration
Gets the duration for which the most recent accounting period as defined by this specification overlaps with a given period of time.- Parameters:
start
- The beginning of the time period.end
- The end of the time period.- Returns:
- The duration in days.
- Throws:
NullPointerException
- if start or end arenull
.
-