Class DataVolume


public class DataVolume extends LimitedResource
Data volume definition of the tenant resource limits.
  • Constructor Details

    • DataVolume

      public DataVolume(@HonoTimestamp Instant effectiveSince, ResourceLimitsPeriod period)
      Creates a new data volume specification for an instant in time and an accounting period definition.
      Parameters:
      effectiveSince - The point in time at which the limit became or will become effective.
      period - The definition of the accounting periods to be used for this specification or null to use the default period definition with mode ResourceLimitsPeriod.PeriodMode.monthly.
      Throws:
      NullPointerException - if effectiveSince is null.
      IllegalArgumentException - if max bytes is < -1.
    • DataVolume

      public DataVolume(@HonoTimestamp Instant effectiveSince, ResourceLimitsPeriod period, long maxBytes)
      Creates a new data volume specification for an instant in time.
      Parameters:
      effectiveSince - The point in time at which the limit became or will become effective.
      period - The definition of the accounting periods to be used for this specification or null to use the default period definition with mode ResourceLimitsPeriod.PeriodMode.monthly.
      maxBytes - The amount of data (in bytes) that devices of a tenant may transfer per accounting period. The value -1L can be used to indicate that the data volume should not be limited.
      Throws:
      NullPointerException - if effectiveSince is null.
      IllegalArgumentException - if max bytes is < -1.
  • Method Details

    • getMaxBytes

      public final long getMaxBytes()
      Gets the amount of data that devices of a tenant may transfer per accounting period.

      The default value of this property is -1L which indicates that the data volume is unlimited.

      Returns:
      The amount of data in bytes.
    • isLimited

      public boolean isLimited()
      Checks if the amount of data that devices of a tenant may transfer per accounting period is limited.
      Returns:
      true if the max bytes value is not -1L and the period mode is not ResourceLimitsPeriod.PeriodMode.unknown.