Skip to content

Commit 334d7d4

Browse files
authored
Changes to comply with the new Java SDK API. (#2)
* Moved to io.temporal package * Added HelloCron * Updated build.gradle to use temporal sdk release * Updated copyright * Readme updated
1 parent 99aaae0 commit 334d7d4

50 files changed

Lines changed: 1018 additions & 798 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

LICENSE.txt

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1-
Cadence Java Client
2-
Copyright (c) 2017 Uber Technologies, Inc. All Rights Reserved
3-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
4-
file except in compliance with the License. You may obtain a copy of the License at
1+
Temporal Java SDK
52

6-
http://www.apache.org/licenses/LICENSE-2.0
3+
Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved
74

8-
Unless required by applicable law or agreed to in writing, software distributed under
9-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10-
CONDITIONS OF ANY KIND, either express or implied. See the License for the
11-
specific language governing permissions and limitations under the License.
12-
13-
Cadence Java Client uses the following projects:
5+
Copyright (c) 2017 Uber Technologies, Inc. All Rights Reserved
146

15-
AWS Simple Workflow Flow Library
167
Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved
8+
179
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
1810
file except in compliance with the License. You may obtain a copy of the License at
1911

README.md

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Java Cadence Samples
2-
These samples demonstrate various capabilities of Java Cadence client and server. You can learn more about Cadence at:
3-
* [Cadence Service](https://github.com/uber/cadence)
4-
* [Cadence Java Client](https://github.com/uber/cadence-java-client)
5-
* [Go Cadence Client](https://github.com/uber-go/cadence-client)
1+
# Java Temporal Samples
2+
These samples demonstrate various capabilities of Java Temporal client and server. You can learn more about Temporal at:
3+
* [Temporal Service](https://github.com/temporalio/temporal)
4+
* [Temporal Java Client](https://github.com/temporalio/temporal-java-sdk)
5+
* [Go Temporal Client](https://github.com/temporalio/temporal-go-sdk)
66

77
## Overview of the Samples
88

@@ -29,8 +29,8 @@ These samples demonstrate various capabilities of Java Cadence client and server
2929

3030
Run the following commands:
3131

32-
git clone https://github.com/uber/cadence-java-samples
33-
cd cadence-java-samples
32+
git clone https://github.com/temporalio/temporal-java-samples
33+
cd temporal-java-samples
3434

3535
## Import into IntelliJ
3636

@@ -43,24 +43,18 @@ choose **Gradle** and then click **Next**->**Finish**.
4343

4444
./gradlew build
4545

46-
## Run Cadence Server
46+
## Run Temporal Server
4747

48-
Run Cadence Server using Docker Compose:
48+
Run Temporal Server using Docker Compose:
4949

50-
curl -O https://raw.githubusercontent.com/uber/cadence/master/docker/docker-compose.yml
50+
curl -O https://raw.githubusercontent.com/temporalio/temporal/master/docker/docker-compose.yml
5151
docker-compose up
5252

53-
If this does not work, see the instructions for running Cadence Server at https://github.com/uber/cadence/blob/master/README.md.
53+
If this does not work, see the instructions for running Temporal Server at https://github.com/temporalio/temporal/blob/master/README.md.
5454

55-
## Register the Domain
55+
## See Temporal UI (Not Available yet!)
5656

57-
To register the *sample* domain, run the following command once before running any samples:
58-
59-
./gradlew -q execute -PmainClass=com.uber.cadence.samples.common.RegisterDomain
60-
61-
## See Cadence UI
62-
63-
The Cadence Server running in a docker container includes a Web UI.
57+
The Temporal Server running in a docker container includes a Web UI.
6458

6559
Connect to [http://localhost:8088](http://localhost:8088).
6660

@@ -71,9 +65,9 @@ top right corner from "Open" to "Closed" to see the list of the completed workfl
7165
Click on a *RUN ID* of a workflow to see more details about it. Try different view formats to get a different level
7266
of details about the execution history.
7367

74-
## Install Cadence CLI
68+
## Install Temporal CLI
7569

76-
[Command Line Interface Documentation](https://mfateev.github.io/cadence/docs/08_cli)
70+
[Command Line Interface Documentation](https://docs.temporal.io/docs/08_cli)
7771

7872
## Run the samples
7973

@@ -86,37 +80,39 @@ Don't forget to check unit tests found under src/test/java!
8680

8781
To run the hello world samples:
8882

89-
./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloActivity
90-
./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloActivityRetry
91-
./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloAsync
92-
./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloAsyncActivityCompletion
93-
./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloAsyncLambda
94-
./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloChild
95-
./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloException
96-
./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloPeriodic
97-
./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloQuery
98-
./gradlew -q execute -PmainClass=com.uber.cadence.samples.hello.HelloSignal
83+
./gradlew -q execute -PmainClass=io.temporal.samples.hello.HelloActivity
84+
./gradlew -q execute -PmainClass=io.temporal.samples.hello.HelloActivityRetry
85+
./gradlew -q execute -PmainClass=io.temporal.samples.hello.HelloAsync
86+
./gradlew -q execute -PmainClass=io.temporal.samples.hello.HelloAsyncActivityCompletion
87+
./gradlew -q execute -PmainClass=io.temporal.samples.hello.HelloAsyncLambda
88+
./gradlew -q execute -PmainClass=io.temporal.samples.hello.HelloChild
89+
./gradlew -q execute -PmainClass=io.temporal.samples.hello.HelloException
90+
./gradlew -q execute -PmainClass=io.temporal.samples.hello.HelloPeriodic
91+
./gradlew -q execute -PmainClass=io.temporal.samples.hello.HelloCron
92+
./gradlew -q execute -PmainClass=io.temporal.samples.hello.HelloQuery
93+
./gradlew -q execute -PmainClass=io.temporal.samples.hello.HelloSignal
9994

10095
### File Processing
10196

10297
This sample has two executables. Execute each command in a separate terminal window. The first command
10398
runs the worker that hosts the workflow and activities implementation. To demonstrate that activities
10499
execute together, we recommend that you run more than one instance of this worker.
105100

106-
./gradlew -q execute -PmainClass=com.uber.cadence.samples.fileprocessing.FileProcessingWorker
101+
./gradlew -q execute -PmainClass=io.temporal.samples.fileprocessing.FileProcessingWorker
107102

108103
The second command starts workflows. Each invocation starts a new workflow execution.
109104

110-
./gradlew -q execute -PmainClass=com.uber.cadence.samples.fileprocessing.FileProcessingStarter
105+
./gradlew -q execute -PmainClass=io.temporal.samples.fileprocessing.FileProcessingStarter
111106

112107
### Trip Booking
113108

114-
Cadence implementation of the [Camunda BPMN trip booking example](https://github.com/berndruecker/trip-booking-saga-java)
109+
Temporal implementation of the [Camunda BPMN trip booking example](https://github.com/berndruecker/trip-booking-saga-java)
115110

116-
Demonstrates Cadence approach to SAGA.
111+
Demonstrates Temporal approach to SAGA.
117112

118113
To run:
119114

120-
./gradlew -q execute -PmainClass=com.uber.cadence.samples.bookingsaga.TripBookingSaga
121-
115+
./gradlew -q execute -PmainClass=io.temporal.samples.bookingsaga.TripBookingSaga
116+
117+
The produced exception trace is part of the sample, so don't get confused by it.
122118

build.gradle

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ googleJavaFormat {
1515
}
1616

1717
group = 'com.uber'
18-
version = '0.0.1'
18+
version = '0.10.0-SNAPSHOT'
1919

20-
description = """Samples for Cadence. Based on samples for AWS SWF"""
20+
description = "Temporal Java SDK Samples"
2121

2222
sourceCompatibility = 1.8
2323
targetCompatibility = 1.8
@@ -29,18 +29,23 @@ repositories {
2929
maven {
3030
url "https://plugins.gradle.org/m2/"
3131
}
32+
maven {
33+
url "https://oss.sonatype.org/content/repositories/snapshots/"
34+
}
3235
mavenCentral()
3336
}
3437

3538
dependencies {
36-
errorproneJavac("com.google.errorprone:javac:9+181-r4173-1")
37-
errorprone("com.google.errorprone:error_prone_core:2.3.1")
38-
compile group: 'com.uber.cadence', name: 'cadence-client', version: '2.6.0'
39+
compile group: 'io.temporal', name: 'temporal-sdk', version: '0.10.0-SNAPSHOT'
40+
3941
compile group: 'commons-configuration', name: 'commons-configuration', version: '1.9'
4042
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
4143
testCompile group: 'junit', name: 'junit', version: '4.12'
4244
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
4345
testCompile group: 'org.powermock', name: 'powermock-api-mockito', version: '1.7.3'
46+
47+
errorproneJavac("com.google.errorprone:javac:9+181-r4173-1")
48+
errorprone("com.google.errorprone:error_prone_core:2.3.1")
4449
}
4550

4651
compileJava {

license-header.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Copyright (c) 2020 Temporal Technologies, Inc. All Rights Reserved
2+
13
Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
24

35
Modifications copyright (C) 2017 Uber Technologies, Inc.

settings.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
rootProject.name = 'cadence-samples'
1+
rootProject.name = 'temporal-samples'
2+

src/main/java/com/uber/cadence/samples/bookingsaga/README.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/main/java/com/uber/cadence/samples/bookingsaga/TripBookingSaga.java

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/main/java/com/uber/cadence/samples/common/RegisterDomain.java

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/main/java/com/uber/cadence/samples/common/SampleConstants.java

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)