Interface IdentityProvider

All Known Implementing Classes:
UuidFactory
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface IdentityProvider
Strategy interface for generating unique identifiers used throughout the Flux platform.

An IdentityProvider produces identifiers for messages, schedules, user sessions, documents, and other entities that require uniqueness.

The interface defines two types of identifiers:

Implementations can be discovered automatically using ServiceLoader. If none are found, UuidFactory is used by default.

Example Usage


 String id = IdentityProvider.defaultIdentityProvider.nextFunctionalId();
 
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final IdentityProvider
    The default identity provider, resolved using ServiceLoader, or falling back to UuidFactory.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a new functional ID, suitable for user-visible or application-level tracking.
    default String
    Returns a new technical ID, suitable for lower-level operations such as internal tracing.
  • Field Details

  • Method Details

    • nextFunctionalId

      String nextFunctionalId()
      Returns a new functional ID, suitable for user-visible or application-level tracking.
      Returns:
      a unique, non-null identifier string
    • nextTechnicalId

      default String nextTechnicalId()
      Returns a new technical ID, suitable for lower-level operations such as internal tracing.

      Defaults to nextFunctionalId(), but can be overridden.

      Returns:
      a unique identifier string