Class ResourceLimits


  • public class ResourceLimits
    extends Object
    Resource limits definition.
    • Constructor Detail

      • ResourceLimits

        public ResourceLimits()
    • Method Detail

      • setMaxConnections

        public final ResourceLimits setMaxConnections​(int maxConnections)
        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.
      • setMaxTtl

        public ResourceLimits setMaxTtl​(long maxTtl)
        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 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.
      • getDataVolume

        public final DataVolume getDataVolume()
        Gets the data volume properties which are required for the message limit verification.
        Returns:
        The data volume properties.
      • setDataVolume

        public final ResourceLimits setDataVolume​(DataVolume dataVolume)
        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

        public final ConnectionDuration getConnectionDuration()
        Gets the properties that are required for the connection duration verification.
        Returns:
        The connection duration properties.
      • setConnectionDuration

        public final ResourceLimits setConnectionDuration​(ConnectionDuration connectionDuration)
        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

        public final ResourceLimits setExtensions​(Map<String,​Object> extensions)
        Sets the extension properties for this resource limits.
        Parameters:
        extensions - The extensions to set.
        Returns:
        a reference to this for fluent use.
      • getExtensions

        public final Map<String,​Object> getExtensions()
        Gets the extension properties for this resource limits.
        Returns:
        The extensions.
      • putExtension

        public final ResourceLimits putExtension​(String key,
                                                 Object value)
        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 is null.