Class EConfigure.PauseConfig

  • Enclosing class:
    EConfigure

    public static final class EConfigure.PauseConfig
    extends Object
    If a remote connection is to be paused, then this is the allowed pause configuration. When defined for a connection acceptor, only the pause duration and maximum backlog size properties are used. A connection initiator has all properties used.

    When a connection is paused, the actual connection is dropped but all the subscriptions and advertisements are kept in place. That means that system and application messages destined for the other side are queued, ready for transmit when the connection is resumed. While all system messages are queued, the number of queued application messages may be limited. When that limit is reached, further application messages are discard as per the configured EConfigure.DiscardPolicy.

    Note that for accepted connections the discard policy used when the maximum message backlog size is reached is set by the connection initiator when requesting a connection pause.

    This feature is targeted for eBus-based applications running on mobile devices. Such devices cannot maintain active connections for long without overheating and draining the battery.

    The pause configuration JSON properties for an eBus service are:

    Service Pause JSON Properties
    Property Required? Type Default Description
    pauseTime Yes Duration NA Maximum allowed pause duration. Actual pause duration in the minimum of client and server values.
    maxBacklogSize Yes int ≥ zero NA Maximum allowed pending message backlog. If zero, then backlog size is unlimited. If maximum size is reached on the server side, then messages are discarded according to the client-specified discard policy.

    The pause configuration JSON properties for an eBus remote connection are:

    Remote Connection Pause JSON Properties
    Property Required? Type Default Description
    pauseTime Yes Duration NA Maximum allowed pause duration. Actual pause duration in the minimum of client and server values. When limit is reached, connection is resumed.
    maxBacklogSize Yes int ≥ zero NA Maximum allowed pending message backlog. If zero, then backlog size is unlimited. If maximum size is reached on client side, then messages are discarded as per the discard policy.
    discardPolicy Yes EConfigure.DiscardPolicy No Message discard policy to be used on both sides, client and server.
    idleTime Yes Duration NA When no messages are sent in the time limit, connection is paused.
    maxConnectTime Yes Duration NA Maximum time a connection may remain up before being paused, regardless of message transmit rate.
    resumeOnBacklogSize No int ≥ zero Zero If message backlog reaches this size, then resume connection. A zero value means that this feature is turned off. If maxBacklogSize is > zero, then this value should be < maxBacklogSize to be effective.

    Example pause config - service.

    pauseTime : 10m
    maxBacklogSize : 50

    Example pause config - remote connection.

    pauseTime : 5m
    maxBacklogSize : 100
    discardPolicy : YOUNGEST_FIRST
    idleTime : 1m
    maxConnectTime : 2m
    resumeOnBacklogSize : 10
    • Method Detail

      • toString

        public String toString()
        Returns the pause configuration as text.
        Overrides:
        toString in class Object
        Returns:
        textual representation of the pause configuration.
      • duration

        public Duration duration()
        Returns the maximum allowed pause duration.
        Returns:
        pause duration.
      • maxBacklogSize

        public int maxBacklogSize()
        Returns the maximum allowed message backlog size.
        Returns:
        message backlog size.
      • discardPolicy

        public EConfigure.DiscardPolicy discardPolicy()
        Returns the message discard policy used when the maximum message backlog size is breached. This policy is set by the connection initiator.
        Returns:
        message discard policy.
      • idleTime

        public Duration idleTime()
        Returns the amount of time wherein no messages are sent or received on the connection before the connection is paused.
        Returns:
        connection idle time.
      • maxConnectTime

        public Duration maxConnectTime()
        Returns the maximum time a connection may remain up before being paused. Note that this pausing is irrespective of the message arrival or departure.
        Returns:
        maximum connection time between pauses.
      • resumeOnQueueLimit

        public int resumeOnQueueLimit()
        Returns the transmit queue limit which triggers an automatic client connection resumption. If zero is returned, then this trigger is disabled.
        Returns:
        resume on reaching transmit queue limit.