Interface UIDSequencer

All Known Implementing Classes:
AbstractUIDSequencer, ESUIDSequencer, JPAUIDSequencerImpl, KeyValueStoreUIDSequencer, MongoDBUIDSequencer

public interface UIDSequencer
UID Sequencer interface defines a method to retrieve next ids based on a given key.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Cleanup callback
    long
     
     
    Gets the sequencer name.
    default List<Long>
    getNextBlock(String key, int blockSize)
    Returns a block containing blockSize sequences.
    long
    For the given key returns the incremented UID which is also stored in the same sequence entry.
    void
    Init Sequencer
    void
    initSequence(String key, long id)
    Initializes the sequencer with the given key to at least the given long id.
    void
    Sets the sequencer name.
  • Field Details

    • SEQUENCE_DOES_NOT_EXIST

      static final long SEQUENCE_DOES_NOT_EXIST
      Since:
      2025.0
      See Also:
  • Method Details

    • getName

      String getName()
      Gets the sequencer name.
      Since:
      7.4
    • setName

      void setName(String name)
      Sets the sequencer name.
      Since:
      7.4
    • init

      void init()
      Init Sequencer
      Since:
      7.3
    • initSequence

      void initSequence(String key, long id)
      Initializes the sequencer with the given key to at least the given long id.

      A sequence can only be incremented, so if its current id is greater than the given id the sequence won't be decremented to reach the given id.

      Since:
      9.10
    • getKeys

      List<String> getKeys()
      Returns:
      all keys known to this sequencer
      Since:
      2025.0
    • getCurrent

      long getCurrent(String key)
      Returns:
      the current sequence value for the given key, or SEQUENCE_DOES_NOT_EXIST if the sequence doesn't exist
      Since:
      2025.0
    • getNextLong

      long getNextLong(String key)
      For the given key returns the incremented UID which is also stored in the same sequence entry. This is a "one time use" function for a document.
      Since:
      8.3
    • getNextBlock

      default List<Long> getNextBlock(String key, int blockSize)
      Returns a block containing blockSize sequences.
      Since:
      10.3
    • dispose

      void dispose()
      Cleanup callback
      Since:
      7.3