Interface IDGenerator

All Known Subinterfaces:
IDGenerator.Ordered
All Known Implementing Classes:
DelegatingHiLoGenerator, FileBasedGenerator, FileBasedHiLoGenerator, HiLoGenerator, IDGenerator.OrderedSupport, InMemoryIDGenerator, LegacyGenerator, NanoTimeGenerator, UUIDGenerator

public interface IDGenerator
MessageID generator interface. This is a replacement for the legacy MessageIDGenerator class, which should not be used anymore.

An instance implementing this interface can be configured by setting the property in the ParserConfiguration class and will then be used to generate IDs for all messages created by HAPI. The default implementation is FileBasedHiLoGenerator.

HAPI does not provide ID generators that depend on external resources (except for files). Implementors are encouraged to add their own classes (implementing IDGenerator.Ordered, e.g. based on database tables or sequences, and use it as delegate in DelegatingHiLoGenerator.

Author:
Christian Ohr
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Extension for continuous ID sequences
    static class 
    Ordered ID sequences with a configurable increment
  • Method Summary

    Modifier and Type
    Method
    Description
    Generates and returns a new ID.
  • Method Details

    • getID

      Generates and returns a new ID. Note: This method must be implemented to be thread-safe.
      Returns:
      a new ID.
      Throws:
      IOException