Package org.eclipse.hono.util
Class DataVolume
- java.lang.Object
-
- org.eclipse.hono.util.LimitedResource
-
- org.eclipse.hono.util.DataVolume
-
public class DataVolume extends LimitedResource
Data volume definition of the tenant resource limits.
-
-
Constructor Summary
Constructors Constructor Description DataVolume(Instant effectiveSince, ResourceLimitsPeriod period)
Creates a new data volume specification for an instant in time and an accounting period definition.DataVolume(Instant effectiveSince, ResourceLimitsPeriod period, long maxBytes)
Creates a new data volume specification for an instant in time.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getMaxBytes()
Gets the amount of data that devices of a tenant may transfer per accounting period.-
Methods inherited from class org.eclipse.hono.util.LimitedResource
getEffectiveSince, getPeriod
-
-
-
-
Constructor Detail
-
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 ornull
to use the default period definition with mode "monthly".- Throws:
NullPointerException
- if effectiveSince isnull
.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 ornull
to use the default period definition with mode "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 isnull
.IllegalArgumentException
- if max bytes is < -1.
-
-
Method Detail
-
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.
-
-