Class CountLimit

java.lang.Object
com.swiftmq.impl.streams.comp.memory.limit.CountLimit
All Implemented Interfaces:
Limit

public class CountLimit extends Object implements Limit
A CountLimit keeps a Memory at a specific number of Messages and removes older Messages if necessary.
Author:
IIT Software GmbH, Muenster/Germany, (c) 2016, All Rights Reserved
  • Method Details

    • sliding

      public CountLimit sliding()
      Marks it as sliding count limit (default). If a new Message is being added and the limit is reached, the oldest Message will retire.
      Returns:
      this
    • tumbling

      public CountLimit tumbling()
      Marks it as tumbling count limit. If a new Message is being added and the limit is reached, all Messages will retire and the Memory is empty.
      Returns:
      this
    • checkLimit

      public void checkLimit()
      Description copied from interface: Limit
      Checks the Memory limits and deletes Messages that doesn't fit in the limit
      Specified by:
      checkLimit in interface Limit
    • onRetire

      public Limit onRetire(RetirementCallback callback)
      Description copied from interface: Limit
      Sets a callback which is called for each Message that is retired (removed by a Limit).
      Specified by:
      onRetire in interface Limit
      Parameters:
      callback - Callback
      Returns:
      Limit
    • limit

      public LimitBuilder limit()
      Description copied from interface: Limit
      Creates a new LimitBuilder and that chains new Limits to the corresponding Memory
      Specified by:
      limit in interface Limit
      Returns:
      LimitBuilder
    • toString

      public String toString()
      Overrides:
      toString in class Object