Package org.axonframework.common
Class DefaultIdentifierFactory
java.lang.Object
org.axonframework.common.IdentifierFactory
org.axonframework.common.DefaultIdentifierFactory
Default IdentifierFactory implementation that uses generates random
java.util.UUID based identifiers.
Although the performance of this strategy is not the best out there, it has native supported on all JVMs.
This implementations selects a random identifier out of about 3 x 1038 possible values, making the chance
to get a duplicate incredibly small.- Since:
- 1.2
- Author:
- Allard Buijze
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGenerates a unique identifier for use by Entities (generally the Aggregate Root) and Events.Methods inherited from class org.axonframework.common.IdentifierFactory
getInstance
-
Constructor Details
-
DefaultIdentifierFactory
public DefaultIdentifierFactory()
-
-
Method Details
-
generateIdentifier
Generates a unique identifier for use by Entities (generally the Aggregate Root) and Events. The implementation may choose whatever strategy it sees fit, as long as the chance of a duplicate identifier is acceptable to the application. This implementation creates identifiers based on pseudo-random UUIDs.- Specified by:
generateIdentifierin classIdentifierFactory- Returns:
- a String representation of a unique identifier
-