Skip to content

Commit ecd26b7

Browse files
authored
Rename UpdateHandle to WorkflowUpdateHandle (#2204)
1 parent 1a054bb commit ecd26b7

File tree

16 files changed

+50
-48
lines changed

16 files changed

+50
-48
lines changed

.github/workflows/features.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ jobs:
77
with:
88
java-repo-path: ${{github.event.pull_request.head.repo.full_name}}
99
version: ${{github.event.pull_request.head.ref}}
10-
version-is-repo-ref: true
10+
version-is-repo-ref: true
11+
features-repo-ref: WorkflowUpdateHandle

temporal-opentracing/src/main/java/io/temporal/opentracing/internal/OpenTracingWorkflowClientCallsInterceptor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import io.opentracing.Scope;
2424
import io.opentracing.Span;
2525
import io.opentracing.Tracer;
26-
import io.temporal.client.UpdateHandle;
26+
import io.temporal.client.WorkflowUpdateHandle;
2727
import io.temporal.common.interceptors.WorkflowClientCallsInterceptor;
2828
import io.temporal.common.interceptors.WorkflowClientCallsInterceptorBase;
2929
import io.temporal.opentracing.OpenTracingOptions;
@@ -120,7 +120,7 @@ public <R> QueryOutput<R> query(QueryInput<R> input) {
120120
}
121121

122122
@Override
123-
public <R> UpdateHandle<R> startUpdate(StartUpdateInput<R> input) {
123+
public <R> WorkflowUpdateHandle<R> startUpdate(StartUpdateInput<R> input) {
124124
Span workflowStartUpdateSpan =
125125
contextAccessor.writeSpanContextToHeader(
126126
() ->

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static <T> WorkflowStub fromTyped(T typed) {
105105
* @return update handle that can be used to get the result of the update.
106106
*/
107107
@Experimental
108-
<R> UpdateHandle<R> startUpdate(
108+
<R> WorkflowUpdateHandle<R> startUpdate(
109109
String updateName, WorkflowUpdateStage waitForStage, Class<R> resultClass, Object... args);
110110

111111
/**
@@ -118,7 +118,7 @@ <R> UpdateHandle<R> startUpdate(
118118
* @return update handle that can be used to get the result of the update.
119119
*/
120120
@Experimental
121-
<R> UpdateHandle<R> startUpdate(UpdateOptions<R> options, Object... args);
121+
<R> WorkflowUpdateHandle<R> startUpdate(UpdateOptions<R> options, Object... args);
122122

123123
/**
124124
* Get an update handle to a previously started update request. Getting an update handle does not
@@ -130,7 +130,7 @@ <R> UpdateHandle<R> startUpdate(
130130
* @return update handle that can be used to get the result of the update.
131131
*/
132132
@Experimental
133-
<R> UpdateHandle<R> getUpdateHandle(String updateId, Class<R> resultClass);
133+
<R> WorkflowUpdateHandle<R> getUpdateHandle(String updateId, Class<R> resultClass);
134134

135135
/**
136136
* Get an update handle to a previously started update request. Getting an update handle does not
@@ -144,7 +144,8 @@ <R> UpdateHandle<R> startUpdate(
144144
* @return update handle that can be used to get the result of the update.
145145
*/
146146
@Experimental
147-
<R> UpdateHandle<R> getUpdateHandle(String updateId, Class<R> resultClass, Type resultType);
147+
<R> WorkflowUpdateHandle<R> getUpdateHandle(
148+
String updateId, Class<R> resultClass, Type resultType);
148149

149150
WorkflowExecution start(Object... args);
150151

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import io.temporal.common.interceptors.Header;
3232
import io.temporal.common.interceptors.WorkflowClientCallsInterceptor;
3333
import io.temporal.failure.CanceledFailure;
34-
import io.temporal.internal.client.LazyUpdateHandleImpl;
34+
import io.temporal.internal.client.LazyWorkflowUpdateHandleImpl;
3535
import io.temporal.serviceclient.CheckedExceptionWrapper;
3636
import io.temporal.serviceclient.StatusUtils;
3737
import java.lang.reflect.Type;
@@ -313,7 +313,7 @@ public <R> R update(String updateName, Class<R> resultClass, Object... args) {
313313
}
314314

315315
@Override
316-
public <R> UpdateHandle<R> startUpdate(
316+
public <R> WorkflowUpdateHandle<R> startUpdate(
317317
String updateName, WorkflowUpdateStage waitForStage, Class<R> resultClass, Object... args) {
318318
UpdateOptions<R> options =
319319
UpdateOptions.<R>newBuilder()
@@ -327,7 +327,7 @@ public <R> UpdateHandle<R> startUpdate(
327327
}
328328

329329
@Override
330-
public <R> UpdateHandle<R> startUpdate(UpdateOptions<R> options, Object... args) {
330+
public <R> WorkflowUpdateHandle<R> startUpdate(UpdateOptions<R> options, Object... args) {
331331
checkStarted();
332332
options.validate();
333333
WorkflowExecution targetExecution = execution.get();
@@ -353,8 +353,8 @@ public <R> UpdateHandle<R> startUpdate(UpdateOptions<R> options, Object... args)
353353
}
354354

355355
@Override
356-
public <R> UpdateHandle<R> getUpdateHandle(String updateId, Class<R> resultClass) {
357-
return new LazyUpdateHandleImpl<>(
356+
public <R> WorkflowUpdateHandle<R> getUpdateHandle(String updateId, Class<R> resultClass) {
357+
return new LazyWorkflowUpdateHandleImpl<>(
358358
workflowClientInvoker,
359359
workflowType.orElse(null),
360360
"",
@@ -365,9 +365,9 @@ public <R> UpdateHandle<R> getUpdateHandle(String updateId, Class<R> resultClass
365365
}
366366

367367
@Override
368-
public <R> UpdateHandle<R> getUpdateHandle(
368+
public <R> WorkflowUpdateHandle<R> getUpdateHandle(
369369
String updateId, Class<R> resultClass, Type resultType) {
370-
return new LazyUpdateHandleImpl<>(
370+
return new LazyWorkflowUpdateHandleImpl<>(
371371
workflowClientInvoker,
372372
workflowType.orElse(null),
373373
"",

temporal-sdk/src/main/java/io/temporal/client/UpdateHandle.java renamed to temporal-sdk/src/main/java/io/temporal/client/WorkflowUpdateHandle.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
import java.util.concurrent.TimeUnit;
2727

2828
/**
29-
* UpdateHandle is a handle to an update workflow execution request that can be used to get the
30-
* status of that update request.
29+
* WorkflowUpdateHandle is a handle to an update workflow execution request that can be used to get
30+
* the status of that update request.
3131
*/
3232
@Experimental
33-
public interface UpdateHandle<T> {
33+
public interface WorkflowUpdateHandle<T> {
3434
/**
3535
* Gets the workflow execution this update request was sent to.
3636
*

temporal-sdk/src/main/java/io/temporal/common/interceptors/WorkflowClientCallsInterceptor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
import io.temporal.api.common.v1.WorkflowExecution;
2424
import io.temporal.api.enums.v1.WorkflowExecutionStatus;
2525
import io.temporal.api.update.v1.WaitPolicy;
26-
import io.temporal.client.UpdateHandle;
2726
import io.temporal.client.WorkflowOptions;
27+
import io.temporal.client.WorkflowUpdateHandle;
2828
import io.temporal.common.Experimental;
2929
import java.lang.reflect.Type;
3030
import java.util.Optional;
@@ -78,7 +78,7 @@ public interface WorkflowClientCallsInterceptor {
7878
<R> QueryOutput<R> query(QueryInput<R> input);
7979

8080
@Experimental
81-
<R> UpdateHandle<R> startUpdate(StartUpdateInput<R> input);
81+
<R> WorkflowUpdateHandle<R> startUpdate(StartUpdateInput<R> input);
8282

8383
@Experimental
8484
<R> PollWorkflowUpdateOutput<R> pollWorkflowUpdate(PollWorkflowUpdateInput<R> input);

temporal-sdk/src/main/java/io/temporal/common/interceptors/WorkflowClientCallsInterceptorBase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
package io.temporal.common.interceptors;
2222

23-
import io.temporal.client.UpdateHandle;
23+
import io.temporal.client.WorkflowUpdateHandle;
2424
import java.util.concurrent.TimeoutException;
2525

2626
/** Convenience base class for {@link WorkflowClientCallsInterceptor} implementations. */
@@ -63,7 +63,7 @@ public <R> QueryOutput<R> query(QueryInput<R> input) {
6363
}
6464

6565
@Override
66-
public <R> UpdateHandle<R> startUpdate(StartUpdateInput<R> input) {
66+
public <R> WorkflowUpdateHandle<R> startUpdate(StartUpdateInput<R> input) {
6767
return next.startUpdate(input);
6868
}
6969

temporal-sdk/src/main/java/io/temporal/internal/client/CompletedUpdateHandleImpl.java renamed to temporal-sdk/src/main/java/io/temporal/internal/client/CompletedWorkflowUpdateHandleImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@
2121
package io.temporal.internal.client;
2222

2323
import io.temporal.api.common.v1.WorkflowExecution;
24-
import io.temporal.client.UpdateHandle;
24+
import io.temporal.client.WorkflowUpdateHandle;
2525
import io.temporal.common.Experimental;
2626
import java.util.concurrent.CompletableFuture;
2727
import java.util.concurrent.TimeUnit;
2828

2929
@Experimental
30-
public final class CompletedUpdateHandleImpl<T> implements UpdateHandle<T> {
30+
public final class CompletedWorkflowUpdateHandleImpl<T> implements WorkflowUpdateHandle<T> {
3131

3232
private final String id;
3333
private final WorkflowExecution execution;
3434
private final T result;
3535

36-
public CompletedUpdateHandleImpl(String id, WorkflowExecution execution, T result) {
36+
public CompletedWorkflowUpdateHandleImpl(String id, WorkflowExecution execution, T result) {
3737
this.id = id;
3838
this.execution = execution;
3939
this.result = result;

temporal-sdk/src/main/java/io/temporal/internal/client/LazyUpdateHandleImpl.java renamed to temporal-sdk/src/main/java/io/temporal/internal/client/LazyWorkflowUpdateHandleImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
import io.grpc.Status;
2424
import io.grpc.StatusRuntimeException;
2525
import io.temporal.api.common.v1.WorkflowExecution;
26-
import io.temporal.client.UpdateHandle;
2726
import io.temporal.client.WorkflowException;
2827
import io.temporal.client.WorkflowServiceException;
28+
import io.temporal.client.WorkflowUpdateHandle;
2929
import io.temporal.common.Experimental;
3030
import io.temporal.common.interceptors.WorkflowClientCallsInterceptor;
3131
import io.temporal.serviceclient.CheckedExceptionWrapper;
@@ -36,7 +36,7 @@
3636
import java.util.concurrent.TimeoutException;
3737

3838
@Experimental
39-
public final class LazyUpdateHandleImpl<T> implements UpdateHandle<T> {
39+
public final class LazyWorkflowUpdateHandleImpl<T> implements WorkflowUpdateHandle<T> {
4040

4141
private final WorkflowClientCallsInterceptor workflowClientInvoker;
4242
private final String workflowType;
@@ -47,7 +47,7 @@ public final class LazyUpdateHandleImpl<T> implements UpdateHandle<T> {
4747
private final Type resultType;
4848
private WorkflowClientCallsInterceptor.PollWorkflowUpdateOutput<T> waitCompletedPollCall;
4949

50-
public LazyUpdateHandleImpl(
50+
public LazyWorkflowUpdateHandleImpl(
5151
WorkflowClientCallsInterceptor workflowClientInvoker,
5252
String workflowType,
5353
String updateName,

temporal-sdk/src/main/java/io/temporal/internal/client/RootWorkflowClientInvoker.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ public <R> QueryOutput<R> query(QueryInput<R> input) {
297297
}
298298

299299
@Override
300-
public <R> UpdateHandle<R> startUpdate(StartUpdateInput<R> input) {
300+
public <R> WorkflowUpdateHandle<R> startUpdate(StartUpdateInput<R> input) {
301301
DataConverter dataConverterWithWorkflowContext =
302302
clientOptions
303303
.getDataConverter()
@@ -366,7 +366,7 @@ public <R> UpdateHandle<R> startUpdate(StartUpdateInput<R> input) {
366366
input.getResultClass(),
367367
input.getResultType(),
368368
dataConverterWithWorkflowContext);
369-
return new CompletedUpdateHandleImpl<>(
369+
return new CompletedWorkflowUpdateHandleImpl<>(
370370
result.getUpdateRef().getUpdateId(),
371371
result.getUpdateRef().getWorkflowExecution(),
372372
resultValue);
@@ -383,8 +383,8 @@ public <R> UpdateHandle<R> startUpdate(StartUpdateInput<R> input) {
383383
+ result.getOutcome().getValueCase());
384384
}
385385
} else {
386-
LazyUpdateHandleImpl<R> handle =
387-
new LazyUpdateHandleImpl<>(
386+
LazyWorkflowUpdateHandleImpl<R> handle =
387+
new LazyWorkflowUpdateHandleImpl<>(
388388
this,
389389
input.getWorkflowType().orElse(null),
390390
input.getUpdateName(),

0 commit comments

Comments
 (0)