Skip to content

Commit 8d0137a

Browse files
authored
add IWorkflowServiceV4 interface (#987)
1 parent b0f0a7e commit 8d0137a

File tree

3 files changed

+480
-0
lines changed

3 files changed

+480
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Modifications copyright (C) 2017 Uber Technologies, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
7+
* use this file except in compliance with the License. A copy of the License is
8+
* located at
9+
*
10+
* http://aws.amazon.com/apache2.0
11+
*
12+
* or in the "license" file accompanying this file. This file is distributed on
13+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14+
* express or implied. See the License for the specific language governing
15+
* permissions and limitations under the License.
16+
*/
17+
18+
package com.uber.cadence.serviceclient;
19+
20+
import java.time.Duration;
21+
import java.util.Optional;
22+
23+
public class CallMetaData {
24+
private Duration timeout;
25+
26+
public CallMetaData(Duration timeout) {
27+
this.timeout = timeout;
28+
}
29+
30+
public CallMetaData withTimeout(Duration timeout) {
31+
this.timeout = timeout;
32+
return this;
33+
}
34+
35+
public Optional<Duration> getTimeout() {
36+
return timeout == null ? Optional.empty() : Optional.of(timeout);
37+
}
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Modifications copyright (C) 2017 Uber Technologies, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
7+
* use this file except in compliance with the License. A copy of the License is
8+
* located at
9+
*
10+
* http://aws.amazon.com/apache2.0
11+
*
12+
* or in the "license" file accompanying this file. This file is distributed on
13+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14+
* express or implied. See the License for the specific language governing
15+
* permissions and limitations under the License.
16+
*/
17+
18+
package com.uber.cadence.serviceclient;
19+
20+
import com.uber.cadence.api.v1.*;
21+
import java.util.concurrent.CompletableFuture;
22+
import javax.annotation.Nullable;
23+
24+
public interface IWorkflowServiceV4 {
25+
CompletableFuture<StartWorkflowExecutionResponse> startWorkflowExecution(
26+
StartWorkflowExecutionRequest request, @Nullable CallMetaData meta);
27+
28+
CompletableFuture<StartWorkflowExecutionAsyncResponse> startWorkflowExecutionAsync(
29+
StartWorkflowExecutionAsyncRequest request, @Nullable CallMetaData meta);
30+
31+
CompletableFuture<SignalWorkflowExecutionResponse> signalWorkflowExecution(
32+
SignalWorkflowExecutionRequest request, @Nullable CallMetaData meta);
33+
34+
CompletableFuture<SignalWithStartWorkflowExecutionResponse> signalWithStartWorkflowExecution(
35+
SignalWithStartWorkflowExecutionRequest request, @Nullable CallMetaData meta);
36+
37+
CompletableFuture<SignalWithStartWorkflowExecutionAsyncResponse>
38+
signalWithStartWorkflowExecutionAsync(
39+
SignalWithStartWorkflowExecutionAsyncRequest request, @Nullable CallMetaData meta);
40+
41+
CompletableFuture<GetWorkflowExecutionHistoryResponse> getWorkflowExecutionHistory(
42+
GetWorkflowExecutionHistoryRequest request, @Nullable CallMetaData meta);
43+
44+
CompletableFuture<QueryWorkflowResponse> queryWorkflow(
45+
QueryWorkflowRequest request, @Nullable CallMetaData meta);
46+
47+
CompletableFuture<RequestCancelWorkflowExecutionResponse> requestCancelWorkflowExecution(
48+
RequestCancelWorkflowExecutionRequest request, @Nullable CallMetaData meta);
49+
50+
CompletableFuture<TerminateWorkflowExecutionResponse> terminateWorkflowExecution(
51+
TerminateWorkflowExecutionRequest request, @Nullable CallMetaData meta);
52+
53+
CompletableFuture<RestartWorkflowExecutionResponse> restartWorkflowExecution(
54+
RestartWorkflowExecutionRequest request, @Nullable CallMetaData meta);
55+
56+
CompletableFuture<ListWorkflowExecutionsResponse> listWorkflowExecutions(
57+
ListWorkflowExecutionsRequest request, @Nullable CallMetaData meta);
58+
59+
CompletableFuture<ScanWorkflowExecutionsResponse> scanWorkflowExecutions(
60+
ScanWorkflowExecutionsRequest request, @Nullable CallMetaData meta);
61+
62+
CompletableFuture<ListOpenWorkflowExecutionsResponse> listOpenWorkflowExecutions(
63+
ListOpenWorkflowExecutionsRequest request, @Nullable CallMetaData meta);
64+
65+
CompletableFuture<ListClosedWorkflowExecutionsResponse> listClosedWorkflowExecutions(
66+
ListClosedWorkflowExecutionsRequest request, @Nullable CallMetaData meta);
67+
68+
CompletableFuture<CountWorkflowExecutionsResponse> countWorkflowExecutions(
69+
CountWorkflowExecutionsRequest request, @Nullable CallMetaData meta);
70+
71+
CompletableFuture<PollForActivityTaskResponse> pollForActivityTask(
72+
PollForActivityTaskRequest request, @Nullable CallMetaData meta);
73+
74+
CompletableFuture<RecordActivityTaskHeartbeatResponse> recordActivityTaskHeartbeat(
75+
RecordActivityTaskHeartbeatRequest request, @Nullable CallMetaData meta);
76+
77+
CompletableFuture<RespondActivityTaskCanceledResponse> respondActivityTaskCanceled(
78+
RespondActivityTaskCanceledRequest request, @Nullable CallMetaData meta);
79+
80+
CompletableFuture<RespondActivityTaskCanceledByIDResponse> respondActivityTaskCanceledByID(
81+
RespondActivityTaskCanceledByIDRequest request, @Nullable CallMetaData meta);
82+
83+
CompletableFuture<RespondActivityTaskFailedResponse> respondActivityTaskFailed(
84+
RespondActivityTaskFailedRequest request, @Nullable CallMetaData meta);
85+
86+
CompletableFuture<RespondActivityTaskFailedByIDResponse> respondActivityTaskFailedByID(
87+
RespondActivityTaskFailedByIDRequest request, @Nullable CallMetaData meta);
88+
89+
CompletableFuture<RespondActivityTaskCompletedResponse> respondActivityTaskCompleted(
90+
RespondActivityTaskCompletedRequest request, @Nullable CallMetaData meta);
91+
92+
CompletableFuture<RespondActivityTaskCompletedByIDResponse> respondActivityTaskCompletedByID(
93+
RespondActivityTaskCompletedByIDRequest request, @Nullable CallMetaData meta);
94+
95+
CompletableFuture<PollForDecisionTaskResponse> pollForDecisionTask(
96+
PollForDecisionTaskRequest request, @Nullable CallMetaData meta);
97+
98+
CompletableFuture<RespondDecisionTaskFailedResponse> respondDecisionTaskFailed(
99+
RespondDecisionTaskFailedRequest request, @Nullable CallMetaData meta);
100+
101+
CompletableFuture<RespondDecisionTaskCompletedResponse> respondDecisionTaskCompleted(
102+
RespondDecisionTaskCompletedRequest request, @Nullable CallMetaData meta);
103+
}

0 commit comments

Comments
 (0)