Package org.eclipse.hono.util
Class ConnectionDuration
- java.lang.Object
-
- org.eclipse.hono.util.LimitedResource
-
- org.eclipse.hono.util.ConnectionDuration
-
public class ConnectionDuration extends LimitedResource
The resource limits definition corresponding to the connection duration.
-
-
Constructor Summary
Constructors Constructor Description ConnectionDuration(Instant effectiveSince, ResourceLimitsPeriod period)
Creates a new connection duration specification for an instant in time.ConnectionDuration(Instant effectiveSince, ResourceLimitsPeriod period, long maxMinutes)
Creates a new connection duration specification for an instant in time.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getMaxMinutes()
Gets the maximum device connection duration in minutes to be allowed for the time period defined by theTenantConstants.FIELD_PERIOD_MODE
andTenantConstants.FIELD_PERIOD_NO_OF_DAYS
.-
Methods inherited from class org.eclipse.hono.util.LimitedResource
getEffectiveSince, getPeriod
-
-
-
-
Constructor Detail
-
ConnectionDuration
public ConnectionDuration(@HonoTimestamp Instant effectiveSince, ResourceLimitsPeriod period)
Creates a new connection duration 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".- Throws:
NullPointerException
- if effectiveSince isnull
.
-
ConnectionDuration
public ConnectionDuration(@HonoTimestamp Instant effectiveSince, ResourceLimitsPeriod period, long maxMinutes)
Creates a new connection duration 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".maxMinutes
- The maximum connection duration in minutes to be allowed.- Throws:
NullPointerException
- if effectiveSince isnull
.IllegalArgumentException
- if the maximum number of minutes is set to less thanTenantConstants.UNLIMITED_MINUTES
.
-
-
Method Detail
-
getMaxMinutes
public final long getMaxMinutes()
Gets the maximum device connection duration in minutes to be allowed for the time period defined by theTenantConstants.FIELD_PERIOD_MODE
andTenantConstants.FIELD_PERIOD_NO_OF_DAYS
.- Returns:
- The maximum connection duration in minutes or
TenantConstants.UNLIMITED_MINUTES
if not set.
-
-