Skip to content

Commit ff333ca

Browse files
Add javadocs for ActivityCompletionClient (#2353)
1 parent 82d3c93 commit ff333ca

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

temporal-sdk/src/main/java/io/temporal/activity/ManualActivityCompletionClient.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,17 @@ public interface ManualActivityCompletionClient {
4646
*/
4747
void fail(@Nonnull Throwable failure);
4848

49+
/**
50+
* Records heartbeat for an activity
51+
*
52+
* @param details to record with the heartbeat
53+
*/
4954
void recordHeartbeat(@Nullable Object details) throws CanceledFailure;
5055

5156
/**
5257
* Confirms successful cancellation to the server.
5358
*
54-
* @param details
59+
* @param details to record with the cancellation
5560
*/
5661
void reportCancellation(@Nullable Object details);
5762
}

temporal-sdk/src/main/java/io/temporal/client/ActivityCompletionClient.java

+55
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,81 @@
3838
*/
3939
public interface ActivityCompletionClient {
4040

41+
/**
42+
* Completes the activity execution successfully.
43+
*
44+
* @param taskToken token of the activity attempt to complete
45+
* @param result of the activity execution
46+
*/
4147
<R> void complete(byte[] taskToken, R result) throws ActivityCompletionException;
4248

49+
/**
50+
* Completes the activity execution successfully.
51+
*
52+
* @param workflowId id of the workflow that started the activity
53+
* @param runId optional run id of the workflow that started the activity
54+
* @param activityId id of the activity
55+
* @param result of the activity execution
56+
*/
4357
<R> void complete(String workflowId, Optional<String> runId, String activityId, R result)
4458
throws ActivityCompletionException;
4559

60+
/**
61+
* Completes the activity execution with failure.
62+
*
63+
* @param taskToken token of the activity attempt to complete
64+
* @param result the exception to be used as a failure details object
65+
*/
4666
void completeExceptionally(byte[] taskToken, Exception result) throws ActivityCompletionException;
4767

68+
/**
69+
* Completes the activity execution with failure.
70+
*
71+
* @param workflowId id of the workflow that started the activity
72+
* @param runId optional run id of the workflow that started the activity
73+
* @param activityId id of the activity
74+
* @param result the exception to be used as a failure details object
75+
*/
4876
void completeExceptionally(
4977
String workflowId, Optional<String> runId, String activityId, Exception result)
5078
throws ActivityCompletionException;
5179

80+
/**
81+
* Confirms successful cancellation to the server.
82+
*
83+
* @param taskToken token of the activity attempt
84+
* @param details details to record with the cancellation
85+
*/
5286
<V> void reportCancellation(byte[] taskToken, V details) throws ActivityCompletionException;
5387

88+
/**
89+
* Confirms successful cancellation to the server.
90+
*
91+
* @param workflowId id of the workflow that started the activity
92+
* @param runId optional run id of the workflow that started the activity
93+
* @param activityId id of the activity
94+
* @param details details to record with the cancellation
95+
*/
5496
<V> void reportCancellation(
5597
String workflowId, Optional<String> runId, String activityId, V details)
5698
throws ActivityCompletionException;
5799

100+
/**
101+
* Records a heartbeat for an activity.
102+
*
103+
* @param taskToken token of the activity attempt
104+
* @param details details to record with the heartbeat
105+
* @throws ActivityCompletionException if activity should stop executing
106+
*/
58107
<V> void heartbeat(byte[] taskToken, V details) throws ActivityCompletionException;
59108

60109
/**
110+
* Records a heartbeat for an activity.
111+
*
112+
* @param workflowId id of the workflow that started the activity
113+
* @param runId optional run id of the workflow that started the activity
114+
* @param activityId id of the activity
115+
* @param details details to record with the heartbeat
61116
* @throws ActivityCompletionException if activity should stop executing
62117
*/
63118
<V> void heartbeat(String workflowId, Optional<String> runId, String activityId, V details)

0 commit comments

Comments
 (0)