Reputation: 368
As the title states, are there any preferred ways to create UUIDs for Intershop usage (eg. jobs)? Do UUIDs need to be specific?
Upvotes: 0
Views: 246
Reputation: 1151
For migrations or manual use of uuids there is an ant task:
ES1|...\eserver\...\tools\misc>ant uuid
Buildfile: build.xml
build.environment:
uuid:
createuuid.classpath:
createuuid:
[echo] Generating an amount of 5 UUIDs...
[java] UUID: fMsKAB2ZfRcAAAEwtG8luGUc
[java] UUID: qB8KAB2Z2UQAAAEwtm8luGUc
[java] UUID: nkgKAB2Z2UUAAAEwtm8luGUc
[java] UUID: Yg0KAB2Z2UYAAAEwtm8luGUc
[java] UUID: gGcKAB2Z2UcAAAEwtm8luGUc
Upvotes: 3
Reputation: 676
If you need to create the UUID in a pipeline you can just use the CreateUUID.pipelet
.
If you want to create a UUID in your custom Java code you can create it like this (this code is just a copy from the CreateUUID pipelet):
@Inject
private UUIDGenerator uuidGen;
String uuid = uuidGen.createUUIDString();
Upvotes: 3
Reputation: 971
UUIDMgr is deprecated. Please use
com.intershop.beehive.core.capi.util.UUIDGenerator
instead.
@Inject
private UUIDGenerator uuidGenerator;
...
String uuid = uuidGenerator.createUUIDString();
Upvotes: 3