Class ResourceLimitsPeriod

java.lang.Object
org.eclipse.hono.util.ResourceLimitsPeriod

public class ResourceLimitsPeriod extends Object
The period definition corresponding to a resource limit for a tenant.
  • Constructor Details

  • Method Details

    • getMode

      public final ResourceLimitsPeriod.PeriodMode 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

      public final ResourceLimitsPeriod setNoOfDays(int noOfDays)
      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

      public final 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.
      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 are null.