Package org.eclipse.hono.util
Class ResourceLimits
java.lang.Object
org.eclipse.hono.util.ResourceLimits
Resource limits definition.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal ConnectionDuration
Gets the properties that are required for the connection duration verification.final DataVolume
Gets the data volume properties which are required for the message limit verification.Gets the extension properties for this resource limits.final int
Gets the maximum number of connected devices a tenant supports.final long
Gets the maximum time-to-live to use for events published by devices of a tenant.final long
Gets the maximum time-to-live to use for messages published by devices of a tenant to a given endpoint.final long
Gets the maximum time-to-live to use for command responses published by devices of a tenant.final long
Gets the maximum time-to-live to use for telemetry messages published by devices of a tenant with QoS 0.final long
Gets the maximum time-to-live to use for telemetry messages published by devices of a tenant with QoS 1.final ResourceLimits
putExtension
(String key, Object value) Adds an extension property to this resource limit.final ResourceLimits
setConnectionDuration
(ConnectionDuration connectionDuration) Sets the properties that are required for the connection duration verification.final ResourceLimits
setDataVolume
(DataVolume dataVolume) Sets the data volume properties which are required for the message limit verification.final ResourceLimits
setExtensions
(Map<String, Object> extensions) Sets the extension properties for this resource limits.final ResourceLimits
setMaxConnections
(int maxConnections) Sets the maximum number of connected devices a tenant supports.final ResourceLimits
setMaxTtl
(long maxTtl) Sets the maximum time-to-live to use for events published by devices of a tenant.final ResourceLimits
setMaxTtlCommandResponse
(long maxTtl) Sets the maximum time-to-live to use for command responses published by devices of a tenant.final ResourceLimits
setMaxTtlTelemetryQoS0
(long maxTtl) Sets the maximum time-to-live to use for telemetry messages published by devices of a tenant with QoS 0.final ResourceLimits
setMaxTtlTelemetryQoS1
(long maxTtl) Sets the maximum time-to-live to use for telemetry messages published by devices of a tenant with QoS 1.
-
Constructor Details
-
ResourceLimits
public ResourceLimits()
-
-
Method Details
-
setMaxConnections
Sets the maximum number of connected devices a tenant supports.- Parameters:
maxConnections
- The maximum number of connections to set.- Returns:
- A reference to this for fluent use.
- Throws:
IllegalArgumentException
- if the maximum connections is set to less than -1.
-
getMaxConnections
public final int getMaxConnections()Gets the maximum number of connected devices a tenant supports.- Returns:
- The maximum number of connections or
TenantConstants.UNLIMITED_CONNECTIONS
if not set.
-
getMaxTtl
Gets the maximum time-to-live to use for messages published by devices of a tenant to a given endpoint.- Parameters:
endpointName
- The name of the endpoint.qos
- The quality of service being used for the messages.- Returns:
- The time-to-live in seconds.
- Throws:
NullPointerException
- if the endpoint name indicates a telemetry endpoint and qos isnull
.IllegalArgumentException
- if endpoint name is unknown.
-
setMaxTtl
Sets the maximum time-to-live to use for events published by devices of a tenant.- Parameters:
maxTtl
- The time-to-live in seconds.- Returns:
- A reference to this for fluent use.
- Throws:
IllegalArgumentException
- if the time-to-live is set to less than -1.
-
getMaxTtl
public final long getMaxTtl()Gets the maximum time-to-live to use for events published by devices of a tenant.- Returns:
- The time-to-live in seconds.
-
setMaxTtlTelemetryQoS0
Sets the maximum time-to-live to use for telemetry messages published by devices of a tenant with QoS 0.- Parameters:
maxTtl
- The time-to-live in seconds.- Returns:
- A reference to this for fluent use.
- Throws:
IllegalArgumentException
- if the time-to-live is set to less than -1.
-
getMaxTtlTelemetryQoS0
public final long getMaxTtlTelemetryQoS0()Gets the maximum time-to-live to use for telemetry messages published by devices of a tenant with QoS 0.- Returns:
- The time-to-live in seconds.
-
setMaxTtlTelemetryQoS1
Sets the maximum time-to-live to use for telemetry messages published by devices of a tenant with QoS 1.- Parameters:
maxTtl
- The time-to-live in seconds.- Returns:
- A reference to this for fluent use.
- Throws:
IllegalArgumentException
- if the time-to-live is set to less than -1.
-
getMaxTtlTelemetryQoS1
public final long getMaxTtlTelemetryQoS1()Gets the maximum time-to-live to use for telemetry messages published by devices of a tenant with QoS 1.- Returns:
- The time-to-live in seconds.
-
setMaxTtlCommandResponse
Sets the maximum time-to-live to use for command responses published by devices of a tenant.- Parameters:
maxTtl
- The time-to-live in seconds.- Returns:
- A reference to this for fluent use.
- Throws:
IllegalArgumentException
- if the time-to-live is set to less than -1.
-
getMaxTtlCommandResponse
public final long getMaxTtlCommandResponse()Gets the maximum time-to-live to use for command responses published by devices of a tenant.- Returns:
- The time-to-live in seconds.
-
getDataVolume
Gets the data volume properties which are required for the message limit verification.- Returns:
- The data volume properties.
-
setDataVolume
Sets the data volume properties which are required for the message limit verification.- Parameters:
dataVolume
- the data volume properties.- Returns:
- a reference to this for fluent use.
-
getConnectionDuration
Gets the properties that are required for the connection duration verification.- Returns:
- The connection duration properties.
-
setConnectionDuration
Sets the properties that are required for the connection duration verification.- Parameters:
connectionDuration
- the connection duration properties.- Returns:
- a reference to this for fluent use.
-
setExtensions
Sets the extension properties for this resource limits.- Parameters:
extensions
- The extensions to set.- Returns:
- a reference to this for fluent use.
-
getExtensions
Gets the extension properties for this resource limits.- Returns:
- The extensions.
-
putExtension
Adds an extension property to this resource limit.If an extension property already exists for the specified key, the old value is replaced by the specified value.
- Parameters:
key
- The key of the entry.value
- The value of the entry.- Returns:
- This instance, to allow chained invocations.
- Throws:
NullPointerException
- if any of the arguments isnull
.
-