Class UuidFactory
java.lang.Object
io.fluxzero.sdk.common.UuidFactory
- All Implemented Interfaces:
IdentityProvider
Default implementation of
IdentityProvider that generates random UUIDs.
Optionally removes dashes from the UUID to produce a more compact identifier.
Example Output
61f3c6d26c9c42d3b56b4c0a7e34c939(ifremoveDashes = true)61f3c6d2-6c9c-42d3-b56b-4c0a7e34c939(ifremoveDashes = false)
-
Field Summary
Fields inherited from interface IdentityProvider
defaultIdentityProvider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a new functional ID derived from the given name.Returns a new UUID string, optionally stripped of dashes.Returns a process-unique UUID without consulting the secure random source for every technical message.
-
Constructor Details
-
UuidFactory
public UuidFactory()Creates aUuidFactorythat removes dashes (default behavior).
-
-
Method Details
-
nextFunctionalId
Returns a new UUID string, optionally stripped of dashes.- Specified by:
nextFunctionalIdin interfaceIdentityProvider- Returns:
- a unique identifier string
-
nextTechnicalId
Returns a process-unique UUID without consulting the secure random source for every technical message.A securely generated process prefix is combined with a 62-bit atomic sequence. The resulting value retains the UUID version-4 and IETF variant bits and cannot repeat within one process before the sequence space is exhausted. Functional IDs remain independently random through
nextFunctionalId().- Specified by:
nextTechnicalIdin interfaceIdentityProvider- Returns:
- a unique identifier string
-
idForName
Description copied from interface:IdentityProviderReturns a new functional ID derived from the given name.For a given name, this method should always return the same identifier.
- Specified by:
idForNamein interfaceIdentityProvider- Parameters:
name- the name to derive the identifier from- Returns:
- a unique, non-null identifier string
-