File tree Expand file tree Collapse file tree 4 files changed +44
-10
lines changed
src/main/java/io/serverlessworkflow/impl Expand file tree Collapse file tree 4 files changed +44
-10
lines changed Original file line number Diff line number Diff line change 2121 <artifactId >slf4j-api</artifactId >
2222 </dependency >
2323 <dependency >
24- <groupId >com.github.f4b6a3 </groupId >
25- <artifactId >ulid-creator </artifactId >
24+ <groupId >de.huxhorn.sulky </groupId >
25+ <artifactId >de.huxhorn.sulky. ulid</artifactId >
2626 </dependency >
2727 </dependencies >
2828</project >
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2020-Present The Serverless Workflow Specification Authors
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+ package io .serverlessworkflow .impl ;
17+
18+ import de .huxhorn .sulky .ulid .ULID ;
19+ import java .security .SecureRandom ;
20+
21+ /**
22+ * A {@link WorkflowInstanceIdFactory} implementation that generates ULIDs as workflow instance IDs.
23+ */
24+ public class UlidWorkflowInstanceIdFactory implements WorkflowInstanceIdFactory {
25+
26+ private final SecureRandom random = new SecureRandom ();
27+ private final ULID ulid = new ULID (random );
28+
29+ @ Override
30+ public String get () {
31+ return ulid .nextULID ();
32+ }
33+ }
Original file line number Diff line number Diff line change 1515 */
1616package io .serverlessworkflow .impl ;
1717
18- import com .github .f4b6a3 .ulid .UlidCreator ;
1918import io .serverlessworkflow .api .types .SchemaInline ;
2019import io .serverlessworkflow .api .types .Workflow ;
2120import io .serverlessworkflow .impl .events .EventConsumer ;
3130import io .serverlessworkflow .impl .resources .StaticResource ;
3231import io .serverlessworkflow .impl .schema .SchemaValidator ;
3332import io .serverlessworkflow .impl .schema .SchemaValidatorFactory ;
33+ import java .security .SecureRandom ;
3434import java .util .ArrayList ;
3535import java .util .Collection ;
3636import java .util .Collections ;
@@ -141,7 +141,8 @@ public SchemaValidator getValidator(SchemaInline inline) {
141141 private ResourceLoaderFactory resourceLoaderFactory = DefaultResourceLoaderFactory .get ();
142142 private SchemaValidatorFactory schemaValidatorFactory ;
143143 private WorkflowPositionFactory positionFactory = () -> new QueueWorkflowPosition ();
144- private WorkflowInstanceIdFactory idFactory = () -> UlidCreator .getMonotonicUlid ().toString ();
144+ private final SecureRandom secureRandom = new SecureRandom ();
145+ private WorkflowInstanceIdFactory idFactory = new UlidWorkflowInstanceIdFactory ();
145146 private ExecutorServiceFactory executorFactory = new DefaultExecutorServiceFactory ();
146147 private EventConsumer <?, ?> eventConsumer ;
147148 private Collection <EventPublisher > eventPublishers = new ArrayList <>();
Original file line number Diff line number Diff line change 99 <name >Serverless Workflow :: Impl</name >
1010 <packaging >pom</packaging >
1111 <properties >
12- <version .org.glassfish.jersey>3.1.11</version .org.glassfish.jersey>
13- <version .net.thisptr>1.6.0</version .net.thisptr>
14- <version .com.github.f4b6a3>5.2.3</version .com.github.f4b6a3>
12+ <version .de.huxhorn.sulky>8.3.0</version .de.huxhorn.sulky>
1513 <version .jakarta.ws.rs>4.0.0</version .jakarta.ws.rs>
14+ <version .net.thisptr>1.6.0</version .net.thisptr>
15+ <version .org.glassfish.jersey>3.1.11</version .org.glassfish.jersey>
1616 </properties >
1717 <dependencyManagement >
1818 <dependencies >
4242 <version >${version.net.thisptr} </version >
4343 </dependency >
4444 <dependency >
45- <groupId >com.github.f4b6a3 </groupId >
46- <artifactId >ulid-creator </artifactId >
47- <version >${version.com.github.f4b6a3 } </version >
45+ <groupId >de.huxhorn.sulky </groupId >
46+ <artifactId >de.huxhorn.sulky. ulid</artifactId >
47+ <version >${version.de.huxhorn.sulky } </version >
4848 </dependency >
4949 <dependency >
5050 <groupId >jakarta.ws.rs</groupId >
You can’t perform that action at this time.
0 commit comments