• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uber / cadence-java-client / 2263

19 Apr 2024 03:59PM UTC coverage: 60.13% (-0.2%) from 60.328%
2263

push

buildkite

web-flow
Update idls (#882)

Implement required methods for new IDL types

0 of 51 new or added lines in 7 files covered. (0.0%)

16 existing lines in 7 files now uncovered.

11456 of 19052 relevant lines covered (60.13%)

0.6 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

5.76
/src/main/java/com/uber/cadence/serviceclient/WorkflowServiceTChannel.java
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 static com.uber.cadence.internal.metrics.MetricsTagValue.REQUEST_TYPE_LONG_POLL;
21
import static com.uber.cadence.internal.metrics.MetricsTagValue.REQUEST_TYPE_NORMAL;
22

23
import com.google.common.base.Strings;
24
import com.google.common.collect.ImmutableMap;
25
import com.google.gson.Gson;
26
import com.google.gson.GsonBuilder;
27
import com.uber.cadence.*;
28
import com.uber.cadence.WorkflowService.GetWorkflowExecutionHistory_result;
29
import com.uber.cadence.internal.Version;
30
import com.uber.cadence.internal.common.CheckedExceptionWrapper;
31
import com.uber.cadence.internal.common.InternalUtils;
32
import com.uber.cadence.internal.metrics.MetricsTag;
33
import com.uber.cadence.internal.metrics.MetricsType;
34
import com.uber.cadence.internal.metrics.ServiceMethod;
35
import com.uber.cadence.internal.tracing.TracingPropagator;
36
import com.uber.m3.tally.Scope;
37
import com.uber.m3.tally.Stopwatch;
38
import com.uber.tchannel.api.ResponseCode;
39
import com.uber.tchannel.api.SubChannel;
40
import com.uber.tchannel.api.TChannel;
41
import com.uber.tchannel.api.TFuture;
42
import com.uber.tchannel.api.errors.TChannelError;
43
import com.uber.tchannel.errors.ErrorType;
44
import com.uber.tchannel.messages.ThriftRequest;
45
import com.uber.tchannel.messages.ThriftResponse;
46
import com.uber.tchannel.messages.generated.Meta;
47
import io.opentelemetry.api.GlobalOpenTelemetry;
48
import io.opentelemetry.context.Context;
49
import io.opentelemetry.context.propagation.TextMapPropagator;
50
import io.opentelemetry.context.propagation.TextMapSetter;
51
import io.opentracing.Span;
52
import java.net.InetAddress;
53
import java.net.InetSocketAddress;
54
import java.net.UnknownHostException;
55
import java.nio.charset.StandardCharsets;
56
import java.util.ArrayList;
57
import java.util.HashMap;
58
import java.util.Map;
59
import java.util.UUID;
60
import java.util.concurrent.CompletableFuture;
61
import java.util.concurrent.ExecutionException;
62
import org.apache.thrift.TException;
63
import org.apache.thrift.async.AsyncMethodCallback;
64
import org.apache.thrift.transport.TTransportException;
65
import org.slf4j.Logger;
66
import org.slf4j.LoggerFactory;
67

68
public class WorkflowServiceTChannel implements IWorkflowService {
69
  private static final Logger log = LoggerFactory.getLogger(WorkflowServiceTChannel.class);
1✔
70

71
  private static final String INTERFACE_NAME = "WorkflowService";
72

73
  private final ClientOptions options;
74
  private final Map<String, String> thriftHeaders;
75
  private final TChannel tChannel;
76
  private final TracingPropagator tracingPropagator;
77
  private SubChannel subChannel;
78

79
  /**
80
   * Creates Cadence client that connects to the specified host and port using specified options.
81
   *
82
   * @param options configuration options like rpc timeouts.
83
   */
84
  public WorkflowServiceTChannel(ClientOptions options) {
1✔
85
    this.options = options;
1✔
86
    this.thriftHeaders = getThriftHeaders(options);
1✔
87
    this.tChannel = new TChannel.Builder(options.getClientAppName()).build();
1✔
88
    this.tracingPropagator = new TracingPropagator(options.getTracer());
1✔
89

90
    InetAddress address;
91
    try {
92
      address = InetAddress.getByName(options.getHost());
1✔
93
    } catch (UnknownHostException e) {
×
94
      tChannel.shutdown();
×
95
      throw new RuntimeException("Unable to get name of host " + options.getHost(), e);
×
96
    }
1✔
97

98
    ArrayList<InetSocketAddress> peers = new ArrayList<>();
1✔
99
    peers.add(new InetSocketAddress(address, options.getPort()));
1✔
100
    this.subChannel = tChannel.makeSubChannel(options.getServiceName()).setPeers(peers);
1✔
101
    log.info(
1✔
102
        "Initialized TChannel for service "
103
            + this.subChannel.getServiceName()
1✔
104
            + ", LibraryVersion: "
105
            + Version.LIBRARY_VERSION
106
            + ", FeatureVersion: "
107
            + Version.FEATURE_VERSION);
108
  }
1✔
109

110
  public void resetSubchannelPeers() throws UnknownHostException {
111
    InetAddress address = InetAddress.getByName(options.getHost());
×
112
    ArrayList<InetSocketAddress> peers = new ArrayList<>();
×
113
    peers.add(new InetSocketAddress(address, options.getPort()));
×
114
    this.subChannel.setPeers(peers);
×
115
  }
×
116

117
  /**
118
   * Creates Cadence client with specified sub channel and options.
119
   *
120
   * @param subChannel sub channel for communicating with cadence frontend service.
121
   * @param options configuration options like rpc timeouts.
122
   */
123
  public WorkflowServiceTChannel(SubChannel subChannel, ClientOptions options) {
×
124
    this.options = options;
×
125
    this.thriftHeaders = getThriftHeaders(options);
×
126
    this.tChannel = null;
×
127
    this.subChannel = subChannel;
×
128
    this.tracingPropagator = new TracingPropagator(options.getTracer());
×
129
  }
×
130

131
  private static Map<String, String> getThriftHeaders(ClientOptions options) {
132
    String envUserName = System.getProperty("user.name");
1✔
133
    String envHostname;
134
    try {
135
      envHostname = InetAddress.getLocalHost().getHostName();
1✔
136
    } catch (UnknownHostException e) {
×
137
      envHostname = "localhost";
×
138
    }
1✔
139

140
    ImmutableMap.Builder<String, String> builder =
141
        ImmutableMap.<String, String>builder()
1✔
142
            .put("user-name", envUserName)
1✔
143
            .put("host-name", envHostname)
1✔
144
            .put("cadence-client-library-version", Version.LIBRARY_VERSION)
1✔
145
            .put("cadence-client-feature-version", Version.FEATURE_VERSION)
1✔
146
            .put("cadence-client-name", "uber-java");
1✔
147

148
    if (options.getHeaders() != null) {
1✔
149
      for (Map.Entry<String, String> entry : options.getHeaders().entrySet()) {
1✔
150
        builder.put(entry.getKey(), entry.getValue());
×
151
      }
×
152
    }
153

154
    if (options.getFeatureFlags() != null) {
1✔
155
      GsonBuilder gsonBuilder = new GsonBuilder();
1✔
156
      Gson gson = gsonBuilder.create();
1✔
157
      String serialized = gson.toJson(options.getFeatureFlags());
1✔
158
      builder.put("cadence-client-feature-flags", serialized);
1✔
159
    }
160

161
    if (!Strings.isNullOrEmpty(options.getIsolationGroup())) {
1✔
162
      builder.put("cadence-client-isolation-group", options.getIsolationGroup());
×
163
    }
164

165
    return builder.build();
1✔
166
  }
167

168
  /** Returns the endpoint in the format service::method" */
169
  private static String getEndpoint(String service, String method) {
170
    return String.format("%s::%s", service, method);
1✔
171
  }
172

173
  private <T> ThriftRequest<T> buildThriftRequest(String apiName, T body) {
174
    return buildThriftRequest(apiName, body, null);
×
175
  }
176

177
  /**
178
   * Checks if we have a valid connection to the Cadence cluster, and potentially resets the peer
179
   * list
180
   */
181
  @Override
182
  public CompletableFuture<Boolean> isHealthy() {
183
    final ThriftRequest<Meta.health_args> req =
×
184
        new ThriftRequest.Builder<Meta.health_args>(options.getServiceName(), "Meta::health")
×
185
            .setBody(new Meta.health_args())
×
186
            .build();
×
187
    final CompletableFuture<Boolean> result = new CompletableFuture<>();
×
188
    try {
189

190
      final TFuture<ThriftResponse<Meta.health_result>> future = this.subChannel.send(req);
×
191
      future.addCallback(
×
192
          response -> {
193
            req.releaseQuietly();
×
194
            if (response.isError()) {
×
195
              try {
196
                this.resetSubchannelPeers();
×
197
              } catch (final Exception inner_e) {
×
198
              }
×
199
              result.completeExceptionally(new TException("Rpc error:" + response.getError()));
×
200
            } else {
201
              result.complete(response.getBody(Meta.health_result.class).getSuccess().isOk());
×
202
            }
203
            try {
204
              response.release();
×
205
            } catch (final Exception e) {
×
206
              // ignore
207
            }
×
208
          });
×
209
    } catch (final TChannelError e) {
×
210
      req.releaseQuietly();
×
211
      try {
212
        this.resetSubchannelPeers();
×
213
      } catch (final Exception inner_e) {
×
214
      }
×
215
      result.complete(Boolean.FALSE);
×
216
    }
×
217
    return result;
×
218
  }
219

220
  protected <T> ThriftRequest<T> buildThriftRequest(
221
      String apiName, T body, Long rpcTimeoutOverride) {
222
    String endpoint = getEndpoint(INTERFACE_NAME, apiName);
1✔
223
    ThriftRequest.Builder<T> builder =
1✔
224
        new ThriftRequest.Builder<>(options.getServiceName(), endpoint);
1✔
225
    // Create a mutable hashmap for headers, as tchannel.tracing.PrefixedHeadersCarrier assumes
226
    // that it can call put directly to add new stuffs (e.g. traces).
227
    final HashMap<String, String> headers = new HashMap<>(thriftHeaders);
1✔
228
    TextMapPropagator textMapPropagator =
229
        GlobalOpenTelemetry.getPropagators().getTextMapPropagator();
1✔
230

231
    String tracingHeadersPrefix = "$tracing$";
1✔
232
    TextMapSetter<Map<String, String>> setter =
1✔
233
        (carrier, key, value) -> {
234
          if (carrier != null) {
×
235
            carrier.put(tracingHeadersPrefix + key, value);
×
236
          }
237
        };
×
238

239
    textMapPropagator.inject(Context.current(), headers, setter);
1✔
240

241
    if (this.options.getAuthProvider() != null) {
1✔
242
      headers.put(
×
243
          "cadence-authorization",
244
          new String(options.getAuthProvider().getAuthToken(), StandardCharsets.UTF_8));
×
245
    }
246
    builder.setHeaders(headers);
1✔
247

248
    if (rpcTimeoutOverride != null) {
1✔
249
      builder.setTimeout(rpcTimeoutOverride);
1✔
250
    } else {
251
      builder.setTimeout(this.options.getRpcTimeoutMillis());
×
252
    }
253
    for (Map.Entry<String, String> header : this.options.getTransportHeaders().entrySet()) {
1✔
254
      builder.setTransportHeader(header.getKey(), header.getValue());
×
255
    }
×
256
    builder.setBody(body);
1✔
257
    return builder.build();
1✔
258
  }
259

260
  private <T> ThriftResponse<T> doRemoteCall(ThriftRequest<?> request) throws TException {
261
    ThriftResponse<T> response = null;
1✔
262
    try {
263
      TFuture<ThriftResponse<T>> future = subChannel.send(request);
1✔
264
      response = future.get();
×
265
    } catch (InterruptedException e) {
1✔
266
      Thread.currentThread().interrupt();
1✔
267
      throw new TException(e);
1✔
268
    } catch (ExecutionException e) {
×
269
      throw new TException(e);
×
270
    } catch (TChannelError e) {
×
271
      throw new TException("Rpc error", e);
×
272
    }
×
273
    this.throwOnRpcError(response);
×
274
    return response;
×
275
  }
276

277
  private <T> CompletableFuture<ThriftResponse<T>> doRemoteCallAsync(ThriftRequest<?> request) {
278
    final CompletableFuture<ThriftResponse<T>> result = new CompletableFuture<>();
×
279
    TFuture<ThriftResponse<T>> future = null;
×
280
    try {
281
      future = subChannel.send(request);
×
282
    } catch (TChannelError tChannelError) {
×
283
      result.completeExceptionally(new TException(tChannelError));
×
284
    }
×
285
    future.addCallback(
×
286
        response -> {
287
          if (response.isError()) {
×
288
            result.completeExceptionally(new TException("Rpc error:" + response.getError()));
×
289
          } else {
290
            result.complete(response);
×
291
          }
292
        });
×
293
    return result;
×
294
  }
295

296
  private void throwOnRpcError(ThriftResponse<?> response) throws TException {
UNCOV
297
    if (response.isError()) {
×
UNCOV
298
      if (response.getError().getErrorType() == ErrorType.Timeout) {
×
299
        throw new TTransportException(
×
300
            TTransportException.TIMED_OUT, response.getError().getMessage());
×
301
      } else {
UNCOV
302
        throw new TException("Rpc error:" + response.getError());
×
303
      }
304
    }
305
  }
×
306

307
  @Override
308
  public void close() {
309
    if (tChannel != null) {
1✔
310
      tChannel.shutdown();
1✔
311
    }
312
  }
1✔
313

314
  interface RemoteCall<T> {
315
    T apply() throws TException;
316
  }
317

318
  private <T> T measureRemoteCall(String scopeName, RemoteCall<T> call) throws TException {
319
    return measureRemoteCallWithTags(scopeName, call, null);
×
320
  }
321

322
  private <T> T measureRemoteCallWithTags(
323
      String scopeName, RemoteCall<T> call, Map<String, String> tags) throws TException {
324
    Span span = tracingPropagator.activateSpanByServiceMethod(scopeName);
1✔
325
    Scope scope = options.getMetricsScope().subScope(scopeName);
1✔
326
    if (tags != null) {
1✔
327
      scope = scope.tagged(tags);
×
328
    }
329
    scope.counter(MetricsType.CADENCE_REQUEST).inc(1);
1✔
330
    Stopwatch sw = scope.timer(MetricsType.CADENCE_LATENCY).start();
1✔
331
    try {
332
      T resp = call.apply();
×
333
      sw.stop();
×
334
      return resp;
×
335
    } catch (EntityNotExistsError
×
336
        | WorkflowExecutionAlreadyCompletedError
337
        | BadRequestError
338
        | DomainAlreadyExistsError
339
        | WorkflowExecutionAlreadyStartedError
340
        | QueryFailedError e) {
341
      sw.stop();
×
342
      scope.counter(MetricsType.CADENCE_INVALID_REQUEST).inc(1);
×
343
      throw e;
×
344
    } catch (TException e) {
1✔
345
      sw.stop();
1✔
346
      scope.counter(MetricsType.CADENCE_ERROR).inc(1);
1✔
347
      throw e;
1✔
348
    } finally {
349
      span.finish();
1✔
350
    }
351
  }
352

353
  interface RemoteProc {
354
    void apply() throws TException;
355
  }
356

357
  private void measureRemoteProc(String scopeName, RemoteProc proc) throws TException {
358
    measureRemoteCall(
×
359
        scopeName,
360
        () -> {
361
          proc.apply();
×
362
          return null;
×
363
        });
364
  }
×
365

366
  @Override
367
  public void RegisterDomain(RegisterDomainRequest request) throws TException {
368
    measureRemoteProc(ServiceMethod.REGISTER_DOMAIN, () -> registerDomain(request));
×
369
  }
×
370

371
  private void registerDomain(RegisterDomainRequest registerRequest) throws TException {
372
    ThriftResponse<WorkflowService.RegisterDomain_result> response = null;
×
373
    try {
374
      ThriftRequest<WorkflowService.RegisterDomain_args> request =
×
375
          buildThriftRequest(
×
376
              "RegisterDomain", new WorkflowService.RegisterDomain_args(registerRequest));
377
      response = doRemoteCall(request);
×
378
      WorkflowService.RegisterDomain_result result =
×
379
          response.getBody(WorkflowService.RegisterDomain_result.class);
×
380
      if (response.getResponseCode() == ResponseCode.OK) {
×
381
        return;
×
382
      }
383
      if (result.isSetBadRequestError()) {
×
384
        throw result.getBadRequestError();
×
385
      }
386
      if (result.isSetDomainExistsError()) {
×
387
        throw result.getDomainExistsError();
×
388
      }
389
      if (result.isSetServiceBusyError()) {
×
390
        throw result.getServiceBusyError();
×
391
      }
392
      throw new TException("RegisterDomain failed with unknown error:" + result);
×
393
    } finally {
394
      if (response != null) {
×
395
        response.release();
×
396
      }
397
    }
398
  }
399

400
  @Override
401
  public DescribeDomainResponse DescribeDomain(DescribeDomainRequest describeRequest)
402
      throws TException {
403
    return measureRemoteCall(ServiceMethod.DESCRIBE_DOMAIN, () -> describeDomain(describeRequest));
×
404
  }
405

406
  private DescribeDomainResponse describeDomain(DescribeDomainRequest describeRequest)
407
      throws TException {
408
    ThriftResponse<WorkflowService.DescribeDomain_result> response = null;
×
409
    try {
410
      ThriftRequest<WorkflowService.DescribeDomain_args> request =
×
411
          buildThriftRequest(
×
412
              "DescribeDomain", new WorkflowService.DescribeDomain_args(describeRequest));
413
      response = doRemoteCall(request);
×
414
      WorkflowService.DescribeDomain_result result =
×
415
          response.getBody(WorkflowService.DescribeDomain_result.class);
×
416
      if (response.getResponseCode() == ResponseCode.OK) {
×
417
        return result.getSuccess();
×
418
      }
419
      if (result.isSetBadRequestError()) {
×
420
        throw result.getBadRequestError();
×
421
      }
422
      if (result.isSetEntityNotExistError()) {
×
423
        throw result.getEntityNotExistError();
×
424
      }
425
      if (result.isSetServiceBusyError()) {
×
426
        throw result.getServiceBusyError();
×
427
      }
428
      throw new TException("DescribeDomain failed with unknown error:" + result);
×
429
    } finally {
430
      if (response != null) {
×
431
        response.release();
×
432
      }
433
    }
434
  }
435

436
  @Override
437
  public ListDomainsResponse ListDomains(ListDomainsRequest listRequest)
438
      throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError,
439
          TException {
440
    return measureRemoteCall(ServiceMethod.LIST_DOMAINS, () -> listDomains(listRequest));
×
441
  }
442

443
  private ListDomainsResponse listDomains(ListDomainsRequest describeRequest) throws TException {
444
    ThriftResponse<WorkflowService.ListDomains_result> response = null;
×
445
    try {
446
      ThriftRequest<WorkflowService.ListDomains_args> request =
×
447
          buildThriftRequest("ListDomains", new WorkflowService.ListDomains_args(describeRequest));
×
448
      response = doRemoteCall(request);
×
449
      WorkflowService.ListDomains_result result =
×
450
          response.getBody(WorkflowService.ListDomains_result.class);
×
451
      if (response.getResponseCode() == ResponseCode.OK) {
×
452
        return result.getSuccess();
×
453
      }
454
      if (result.isSetBadRequestError()) {
×
455
        throw result.getBadRequestError();
×
456
      }
457
      if (result.isSetEntityNotExistError()) {
×
458
        throw result.getEntityNotExistError();
×
459
      }
460
      if (result.isSetServiceBusyError()) {
×
461
        throw result.getServiceBusyError();
×
462
      }
463
      throw new TException("ListDomains failed with unknown error:" + result);
×
464
    } finally {
465
      if (response != null) {
×
466
        response.release();
×
467
      }
468
    }
469
  }
470

471
  @Override
472
  public UpdateDomainResponse UpdateDomain(UpdateDomainRequest updateRequest) throws TException {
473
    return measureRemoteCall(ServiceMethod.UPDATE_DOMAIN, () -> updateDomain(updateRequest));
×
474
  }
475

476
  private UpdateDomainResponse updateDomain(UpdateDomainRequest updateRequest) throws TException {
477
    ThriftResponse<WorkflowService.UpdateDomain_result> response = null;
×
478
    try {
479
      ThriftRequest<WorkflowService.UpdateDomain_args> request =
×
480
          buildThriftRequest("UpdateDomain", new WorkflowService.UpdateDomain_args(updateRequest));
×
481
      response = doRemoteCall(request);
×
482
      WorkflowService.UpdateDomain_result result =
×
483
          response.getBody(WorkflowService.UpdateDomain_result.class);
×
484
      if (response.getResponseCode() == ResponseCode.OK) {
×
485
        return result.getSuccess();
×
486
      }
487
      if (result.isSetBadRequestError()) {
×
488
        throw result.getBadRequestError();
×
489
      }
490
      if (result.isSetEntityNotExistError()) {
×
491
        throw result.getEntityNotExistError();
×
492
      }
493
      if (result.isSetServiceBusyError()) {
×
494
        throw result.getServiceBusyError();
×
495
      }
496
      if (result.isSetDomainNotActiveError()) {
×
497
        throw result.getDomainNotActiveError();
×
498
      }
499
      throw new TException("UpdateDomain failed with unknown error:" + result);
×
500
    } finally {
501
      if (response != null) {
×
502
        response.release();
×
503
      }
504
    }
505
  }
506

507
  @Override
508
  public void DeprecateDomain(DeprecateDomainRequest deprecateRequest) throws TException {
509
    measureRemoteProc(ServiceMethod.DEPRECATE_DOMAIN, () -> deprecateDomain(deprecateRequest));
×
510
  }
×
511

512
  @Override
513
  public RestartWorkflowExecutionResponse RestartWorkflowExecution(
514
      RestartWorkflowExecutionRequest restartRequest)
515
      throws BadRequestError, ServiceBusyError, DomainNotActiveError, LimitExceededError,
516
          EntityNotExistsError, ClientVersionNotSupportedError, TException {
NEW
517
    throw new IllegalArgumentException("unimplemented");
×
518
  }
519

520
  private void deprecateDomain(DeprecateDomainRequest deprecateRequest) throws TException {
521
    ThriftResponse<WorkflowService.DeprecateDomain_result> response = null;
×
522
    try {
523
      ThriftRequest<WorkflowService.DeprecateDomain_args> request =
×
524
          buildThriftRequest(
×
525
              "DeprecateDomain", new WorkflowService.DeprecateDomain_args(deprecateRequest));
526
      response = doRemoteCall(request);
×
527
      WorkflowService.DeprecateDomain_result result =
×
528
          response.getBody(WorkflowService.DeprecateDomain_result.class);
×
529
      if (response.getResponseCode() == ResponseCode.OK) {
×
530
        return;
×
531
      }
532
      if (result.isSetBadRequestError()) {
×
533
        throw result.getBadRequestError();
×
534
      }
535
      if (result.isSetEntityNotExistError()) {
×
536
        throw result.getEntityNotExistError();
×
537
      }
538
      if (result.isSetServiceBusyError()) {
×
539
        throw result.getServiceBusyError();
×
540
      }
541
      if (result.isSetDomainNotActiveError()) {
×
542
        throw result.getDomainNotActiveError();
×
543
      }
544
      throw new TException("DeprecateDomain failed with unknown error:" + result);
×
545
    } finally {
546
      if (response != null) {
×
547
        response.release();
×
548
      }
549
    }
550
  }
551

552
  @Override
553
  public GetTaskListsByDomainResponse GetTaskListsByDomain(
554
      GetTaskListsByDomainRequest getTaskListsByDomainRequest) throws TException {
555
    return measureRemoteCall(
×
556
        ServiceMethod.GET_TASK_LISTS_BY_DOMAIN,
557
        () -> getTaskListsByDomain(getTaskListsByDomainRequest));
×
558
  }
559

560
  private GetTaskListsByDomainResponse getTaskListsByDomain(
561
      GetTaskListsByDomainRequest getTaskListsByDomainRequest) throws TException {
562
    ThriftResponse<WorkflowService.GetTaskListsByDomain_result> response = null;
×
563
    try {
564
      ThriftRequest<WorkflowService.GetTaskListsByDomain_args> request =
×
565
          buildThriftRequest(
×
566
              "GetTaskListsByDomain",
567
              new WorkflowService.GetTaskListsByDomain_args(getTaskListsByDomainRequest));
568
      response = doRemoteCall(request);
×
569
      WorkflowService.GetTaskListsByDomain_result result =
×
570
          response.getBody(WorkflowService.GetTaskListsByDomain_result.class);
×
571
      if (response.getResponseCode() == ResponseCode.OK) {
×
572
        return result.getSuccess();
×
573
      }
574
      if (result.isSetBadRequestError()) {
×
575
        throw result.getBadRequestError();
×
576
      }
577
      if (result.isSetEntityNotExistError()) {
×
578
        throw result.getEntityNotExistError();
×
579
      }
580
      if (result.isSetLimitExceededError()) {
×
581
        throw result.getLimitExceededError();
×
582
      }
583
      if (result.isSetServiceBusyError()) {
×
584
        throw result.getServiceBusyError();
×
585
      }
586
      if (result.isSetClientVersionNotSupportedError()) {
×
587
        throw result.getClientVersionNotSupportedError();
×
588
      }
589
      throw new TException("GetTaskListsByDomain failed with unknown error:" + result);
×
590
    } finally {
591
      if (response != null) {
×
592
        response.release();
×
593
      }
594
    }
595
  }
596

597
  @Override
598
  public StartWorkflowExecutionResponse StartWorkflowExecution(
599
      StartWorkflowExecutionRequest request) throws TException {
600
    return measureRemoteCall(
×
601
        ServiceMethod.START_WORKFLOW_EXECUTION, () -> startWorkflowExecution(request));
×
602
  }
603

604
  @Override
605
  public StartWorkflowExecutionAsyncResponse StartWorkflowExecutionAsync(
606
      StartWorkflowExecutionAsyncRequest startRequest)
607
      throws BadRequestError, WorkflowExecutionAlreadyStartedError, ServiceBusyError,
608
          DomainNotActiveError, LimitExceededError, EntityNotExistsError,
609
          ClientVersionNotSupportedError, TException {
NEW
610
    throw new IllegalArgumentException("unimplemented");
×
611
  }
612

613
  private StartWorkflowExecutionResponse startWorkflowExecution(
614
      StartWorkflowExecutionRequest startRequest) throws TException {
615
    startRequest.setRequestId(UUID.randomUUID().toString());
×
616
    ThriftResponse<WorkflowService.StartWorkflowExecution_result> response = null;
×
617
    try {
618
      // Write span context to header
619
      if (!startRequest.isSetHeader()) {
×
620
        startRequest.setHeader(new Header());
×
621
      }
622
      tracingPropagator.inject(startRequest.getHeader());
×
623

624
      ThriftRequest<WorkflowService.StartWorkflowExecution_args> request =
×
625
          buildThriftRequest(
×
626
              "StartWorkflowExecution",
627
              new WorkflowService.StartWorkflowExecution_args(startRequest));
628

629
      response = doRemoteCall(request);
×
630
      WorkflowService.StartWorkflowExecution_result result =
×
631
          response.getBody(WorkflowService.StartWorkflowExecution_result.class);
×
632
      if (response.getResponseCode() == ResponseCode.OK) {
×
633
        return result.getSuccess();
×
634
      }
635
      if (result.isSetBadRequestError()) {
×
636
        throw result.getBadRequestError();
×
637
      }
638
      if (result.isSetSessionAlreadyExistError()) {
×
639
        throw result.getSessionAlreadyExistError();
×
640
      }
641
      if (result.isSetServiceBusyError()) {
×
642
        throw result.getServiceBusyError();
×
643
      }
644
      if (result.isSetDomainNotActiveError()) {
×
645
        throw result.getDomainNotActiveError();
×
646
      }
647
      if (result.isSetLimitExceededError()) {
×
648
        throw result.getLimitExceededError();
×
649
      }
650
      if (result.isSetEntityNotExistError()) {
×
651
        throw result.getEntityNotExistError();
×
652
      }
653
      throw new TException("StartWorkflowExecution failed with unknown error:" + result);
×
654
    } finally {
655
      if (response != null) {
×
656
        response.release();
×
657
      }
658
    }
659
  }
660

661
  @Override
662
  public GetWorkflowExecutionHistoryResponse GetWorkflowExecutionHistoryWithTimeout(
663
      GetWorkflowExecutionHistoryRequest request, Long timeoutInMillis) throws TException {
664
    Map<String, String> tags =
×
665
        ImmutableMap.of(
×
666
            MetricsTag.REQUEST_TYPE,
667
            request.isWaitForNewEvent() ? REQUEST_TYPE_LONG_POLL : REQUEST_TYPE_NORMAL);
×
668
    return measureRemoteCallWithTags(
×
669
        ServiceMethod.GET_WORKFLOW_EXECUTION_HISTORY,
670
        () -> getWorkflowExecutionHistory(request, timeoutInMillis),
×
671
        tags);
672
  }
673

674
  @Override
675
  public GetWorkflowExecutionHistoryResponse GetWorkflowExecutionHistory(
676
      GetWorkflowExecutionHistoryRequest request) throws TException {
677
    Map<String, String> tags =
×
678
        ImmutableMap.of(
×
679
            MetricsTag.REQUEST_TYPE,
680
            request.isWaitForNewEvent() ? REQUEST_TYPE_LONG_POLL : REQUEST_TYPE_NORMAL);
×
681
    return measureRemoteCallWithTags(
×
682
        ServiceMethod.GET_WORKFLOW_EXECUTION_HISTORY,
683
        () -> getWorkflowExecutionHistory(request, null),
×
684
        tags);
685
  }
686

687
  private GetWorkflowExecutionHistoryResponse getWorkflowExecutionHistory(
688
      GetWorkflowExecutionHistoryRequest getRequest, Long timeoutInMillis) throws TException {
689
    ThriftResponse<WorkflowService.GetWorkflowExecutionHistory_result> response = null;
×
690
    try {
691
      ThriftRequest<WorkflowService.GetWorkflowExecutionHistory_args> request =
×
692
          buildGetWorkflowExecutionHistoryThriftRequest(getRequest, timeoutInMillis);
×
693
      response = doRemoteCall(request);
×
694
      WorkflowService.GetWorkflowExecutionHistory_result result =
×
695
          response.getBody(WorkflowService.GetWorkflowExecutionHistory_result.class);
×
696
      if (response.getResponseCode() == ResponseCode.OK) {
×
697
        GetWorkflowExecutionHistoryResponse res = result.getSuccess();
×
698
        if (res.getRawHistory() != null) {
×
699
          History history =
×
700
              InternalUtils.DeserializeFromBlobDataToHistory(
×
701
                  res.getRawHistory(), getRequest.getHistoryEventFilterType());
×
702
          res.setHistory(history);
×
703
        }
704
        return res;
×
705
      }
706
      if (result.isSetBadRequestError()) {
×
707
        throw result.getBadRequestError();
×
708
      }
709
      if (result.isSetEntityNotExistError()) {
×
710
        throw result.getEntityNotExistError();
×
711
      }
712
      if (result.isSetServiceBusyError()) {
×
713
        throw result.getServiceBusyError();
×
714
      }
715
      throw new TException("GetWorkflowExecutionHistory failed with unknown error:" + result);
×
716
    } finally {
717
      if (response != null) {
×
718
        response.release();
×
719
      }
720
    }
721
  }
722

723
  private ThriftRequest<WorkflowService.GetWorkflowExecutionHistory_args>
724
      buildGetWorkflowExecutionHistoryThriftRequest(
725
          GetWorkflowExecutionHistoryRequest getRequest, Long timeoutInMillis) {
726

727
    if (getRequest.isWaitForNewEvent()) {
×
728
      timeoutInMillis =
×
729
          validateAndUpdateTimeout(timeoutInMillis, options.getRpcLongPollTimeoutMillis());
×
730
    } else {
731
      timeoutInMillis = validateAndUpdateTimeout(timeoutInMillis, options.getRpcTimeoutMillis());
×
732
    }
733

734
    return buildThriftRequest(
×
735
        "GetWorkflowExecutionHistory",
736
        new WorkflowService.GetWorkflowExecutionHistory_args(getRequest),
737
        timeoutInMillis);
738
  }
739

740
  @Override
741
  public PollForDecisionTaskResponse PollForDecisionTask(PollForDecisionTaskRequest request)
742
      throws TException {
743
    return measureRemoteCall(
×
744
        ServiceMethod.POLL_FOR_DECISION_TASK, () -> pollForDecisionTask(request));
×
745
  }
746

747
  private PollForDecisionTaskResponse pollForDecisionTask(PollForDecisionTaskRequest pollRequest)
748
      throws TException {
749
    ThriftResponse<WorkflowService.PollForDecisionTask_result> response = null;
1✔
750
    try {
751
      ThriftRequest<WorkflowService.PollForDecisionTask_args> request =
1✔
752
          buildThriftRequest(
1✔
753
              "PollForDecisionTask",
754
              new WorkflowService.PollForDecisionTask_args(pollRequest),
755
              options.getRpcLongPollTimeoutMillis());
1✔
756
      response = doRemoteCall(request);
×
757
      WorkflowService.PollForDecisionTask_result result =
×
758
          response.getBody(WorkflowService.PollForDecisionTask_result.class);
×
759
      if (response.getResponseCode() == ResponseCode.OK) {
×
760
        return result.getSuccess();
×
761
      }
762
      if (result.isSetBadRequestError()) {
×
763
        throw result.getBadRequestError();
×
764
      }
765
      if (result.isSetServiceBusyError()) {
×
766
        throw result.getServiceBusyError();
×
767
      }
768
      if (result.isSetDomainNotActiveError()) {
×
769
        throw result.getDomainNotActiveError();
×
770
      }
771
      if (result.isSetLimitExceededError()) {
×
772
        throw result.getLimitExceededError();
×
773
      }
774
      if (result.isSetEntityNotExistError()) {
×
775
        throw result.getEntityNotExistError();
×
776
      }
777
      if (result.isSetClientVersionNotSupportedError()) {
×
778
        throw result.getClientVersionNotSupportedError();
×
779
      }
780
      throw new TException("PollForDecisionTask failed with unknown error:" + result);
×
781
    } finally {
782
      if (response != null) {
1✔
783
        response.release();
×
784
      }
785
    }
786
  }
787

788
  @Override
789
  public RespondDecisionTaskCompletedResponse RespondDecisionTaskCompleted(
790
      RespondDecisionTaskCompletedRequest completedRequest) throws TException {
791
    return measureRemoteCall(
×
792
        ServiceMethod.RESPOND_DECISION_TASK_COMPLETED,
793
        () -> respondDecisionTaskCompleted(completedRequest));
×
794
  }
795

796
  private RespondDecisionTaskCompletedResponse respondDecisionTaskCompleted(
797
      RespondDecisionTaskCompletedRequest completedRequest) throws TException {
798
    ThriftResponse<WorkflowService.RespondDecisionTaskCompleted_result> response = null;
×
799
    try {
800
      ThriftRequest<WorkflowService.RespondDecisionTaskCompleted_args> request =
×
801
          buildThriftRequest(
×
802
              "RespondDecisionTaskCompleted",
803
              new WorkflowService.RespondDecisionTaskCompleted_args(completedRequest));
804
      response = doRemoteCall(request);
×
805
      WorkflowService.RespondDecisionTaskCompleted_result result =
×
806
          response.getBody(WorkflowService.RespondDecisionTaskCompleted_result.class);
×
807
      if (response.getResponseCode() == ResponseCode.OK) {
×
808
        return result.getSuccess();
×
809
      }
810
      if (result.isSetBadRequestError()) {
×
811
        throw result.getBadRequestError();
×
812
      }
813
      if (result.isSetServiceBusyError()) {
×
814
        throw result.getServiceBusyError();
×
815
      }
816
      if (result.isSetDomainNotActiveError()) {
×
817
        throw result.getDomainNotActiveError();
×
818
      }
819
      if (result.isSetLimitExceededError()) {
×
820
        throw result.getLimitExceededError();
×
821
      }
822
      if (result.isSetEntityNotExistError()) {
×
823
        throw result.getEntityNotExistError();
×
824
      }
825
      if (result.isSetWorkflowExecutionAlreadyCompletedError()) {
×
826
        throw result.getWorkflowExecutionAlreadyCompletedError();
×
827
      }
828
      if (result.isSetClientVersionNotSupportedError()) {
×
829
        throw result.getClientVersionNotSupportedError();
×
830
      }
831
      throw new TException("RespondDecisionTaskCompleted failed with unknown error:" + result);
×
832
    } finally {
833
      if (response != null) {
×
834
        response.release();
×
835
      }
836
    }
837
  }
838

839
  @Override
840
  public void RespondDecisionTaskFailed(RespondDecisionTaskFailedRequest request)
841
      throws TException {
842
    measureRemoteProc(
×
843
        ServiceMethod.RESPOND_DECISION_TASK_FAILED, () -> respondDecisionTaskFailed(request));
×
844
  }
×
845

846
  private void respondDecisionTaskFailed(RespondDecisionTaskFailedRequest failedRequest)
847
      throws TException {
848
    ThriftResponse<WorkflowService.RespondDecisionTaskFailed_result> response = null;
×
849
    try {
850
      ThriftRequest<WorkflowService.RespondDecisionTaskFailed_args> request =
×
851
          buildThriftRequest(
×
852
              "RespondDecisionTaskFailed",
853
              new WorkflowService.RespondDecisionTaskFailed_args(failedRequest));
854
      response = doRemoteCall(request);
×
855
      WorkflowService.RespondDecisionTaskFailed_result result =
×
856
          response.getBody(WorkflowService.RespondDecisionTaskFailed_result.class);
×
857
      if (response.getResponseCode() == ResponseCode.OK) {
×
858
        return;
×
859
      }
860
      if (result.isSetBadRequestError()) {
×
861
        throw result.getBadRequestError();
×
862
      }
863
      if (result.isSetEntityNotExistError()) {
×
864
        throw result.getEntityNotExistError();
×
865
      }
866
      if (result.isSetWorkflowExecutionAlreadyCompletedError()) {
×
867
        throw result.getWorkflowExecutionAlreadyCompletedError();
×
868
      }
869
      if (result.isSetServiceBusyError()) {
×
870
        throw result.getServiceBusyError();
×
871
      }
872
      if (result.isSetDomainNotActiveError()) {
×
873
        throw result.getDomainNotActiveError();
×
874
      }
875
      if (result.isSetLimitExceededError()) {
×
876
        throw result.getLimitExceededError();
×
877
      }
878
      if (result.isSetClientVersionNotSupportedError()) {
×
879
        throw result.getClientVersionNotSupportedError();
×
880
      }
881
      throw new TException("RespondDecisionTaskFailed failed with unknown error:" + result);
×
882
    } finally {
883
      if (response != null) {
×
884
        response.release();
×
885
      }
886
    }
887
  }
888

889
  @Override
890
  public PollForActivityTaskResponse PollForActivityTask(PollForActivityTaskRequest request)
891
      throws TException {
892
    return measureRemoteCall(
×
893
        ServiceMethod.POLL_FOR_ACTIVITY_TASK, () -> pollForActivityTask(request));
×
894
  }
895

896
  private PollForActivityTaskResponse pollForActivityTask(PollForActivityTaskRequest pollRequest)
897
      throws TException {
898
    ThriftResponse<WorkflowService.PollForActivityTask_result> response = null;
1✔
899
    try {
900
      ThriftRequest<WorkflowService.PollForActivityTask_args> request =
1✔
901
          buildThriftRequest(
1✔
902
              "PollForActivityTask",
903
              new WorkflowService.PollForActivityTask_args(pollRequest),
904
              options.getRpcLongPollTimeoutMillis());
1✔
905
      response = doRemoteCall(request);
×
906
      WorkflowService.PollForActivityTask_result result =
×
907
          response.getBody(WorkflowService.PollForActivityTask_result.class);
×
908
      if (response.getResponseCode() == ResponseCode.OK) {
×
909
        return result.getSuccess();
×
910
      }
911
      if (result.isSetBadRequestError()) {
×
912
        throw result.getBadRequestError();
×
913
      }
914
      if (result.isSetServiceBusyError()) {
×
915
        throw result.getServiceBusyError();
×
916
      }
917
      if (result.isSetEntityNotExistError()) {
×
918
        throw result.getEntityNotExistError();
×
919
      }
920
      if (result.isSetDomainNotActiveError()) {
×
921
        throw result.getDomainNotActiveError();
×
922
      }
923
      if (result.isSetLimitExceededError()) {
×
924
        throw result.getLimitExceededError();
×
925
      }
926
      if (result.isSetClientVersionNotSupportedError()) {
×
927
        throw result.getClientVersionNotSupportedError();
×
928
      }
929
      throw new TException("PollForActivityTask failed with unknown error:" + result);
×
930
    } finally {
931
      if (response != null) {
1✔
932
        response.release();
×
933
      }
934
    }
935
  }
936

937
  @Override
938
  public RecordActivityTaskHeartbeatResponse RecordActivityTaskHeartbeat(
939
      RecordActivityTaskHeartbeatRequest request) throws TException {
940
    return measureRemoteCall(
×
941
        ServiceMethod.RECORD_ACTIVITY_TASK_HEARTBEAT, () -> recordActivityTaskHeartbeat(request));
×
942
  }
943

944
  private RecordActivityTaskHeartbeatResponse recordActivityTaskHeartbeat(
945
      RecordActivityTaskHeartbeatRequest heartbeatRequest) throws TException {
946
    ThriftResponse<WorkflowService.RecordActivityTaskHeartbeat_result> response = null;
×
947
    try {
948
      ThriftRequest<WorkflowService.RecordActivityTaskHeartbeat_args> request =
×
949
          buildThriftRequest(
×
950
              "RecordActivityTaskHeartbeat",
951
              new WorkflowService.RecordActivityTaskHeartbeat_args(heartbeatRequest));
952
      response = doRemoteCall(request);
×
953
      WorkflowService.RecordActivityTaskHeartbeat_result result =
×
954
          response.getBody(WorkflowService.RecordActivityTaskHeartbeat_result.class);
×
955
      if (response.getResponseCode() == ResponseCode.OK) {
×
956
        return result.getSuccess();
×
957
      }
958
      if (result.isSetBadRequestError()) {
×
959
        throw result.getBadRequestError();
×
960
      }
961
      if (result.isSetEntityNotExistError()) {
×
962
        throw result.getEntityNotExistError();
×
963
      }
964
      if (result.isSetWorkflowExecutionAlreadyCompletedError()) {
×
965
        throw result.getWorkflowExecutionAlreadyCompletedError();
×
966
      }
967
      if (result.isSetServiceBusyError()) {
×
968
        throw result.getServiceBusyError();
×
969
      }
970
      if (result.isSetDomainNotActiveError()) {
×
971
        throw result.getDomainNotActiveError();
×
972
      }
973
      if (result.isSetLimitExceededError()) {
×
974
        throw result.getLimitExceededError();
×
975
      }
976
      if (result.isSetClientVersionNotSupportedError()) {
×
977
        throw result.getClientVersionNotSupportedError();
×
978
      }
979
      throw new TException("RecordActivityTaskHeartbeat failed with unknown error:" + result);
×
980
    } finally {
981
      if (response != null) {
×
982
        response.release();
×
983
      }
984
    }
985
  }
986

987
  @Override
988
  public RecordActivityTaskHeartbeatResponse RecordActivityTaskHeartbeatByID(
989
      RecordActivityTaskHeartbeatByIDRequest heartbeatRequest)
990
      throws BadRequestError, InternalServiceError, EntityNotExistsError, DomainNotActiveError,
991
          WorkflowExecutionAlreadyCompletedError, LimitExceededError, ServiceBusyError, TException {
992
    return measureRemoteCall(
×
993
        ServiceMethod.RECORD_ACTIVITY_TASK_HEARTBEAT_BY_ID,
994
        () -> recordActivityTaskHeartbeatByID(heartbeatRequest));
×
995
  }
996

997
  private RecordActivityTaskHeartbeatResponse recordActivityTaskHeartbeatByID(
998
      RecordActivityTaskHeartbeatByIDRequest heartbeatRequest) throws TException {
999
    ThriftResponse<WorkflowService.RecordActivityTaskHeartbeatByID_result> response = null;
×
1000
    try {
1001
      ThriftRequest<WorkflowService.RecordActivityTaskHeartbeatByID_args> request =
×
1002
          buildThriftRequest(
×
1003
              "RecordActivityTaskHeartbeatByID",
1004
              new WorkflowService.RecordActivityTaskHeartbeatByID_args(heartbeatRequest));
1005
      response = doRemoteCall(request);
×
1006
      WorkflowService.RecordActivityTaskHeartbeatByID_result result =
×
1007
          response.getBody(WorkflowService.RecordActivityTaskHeartbeatByID_result.class);
×
1008
      if (response.getResponseCode() == ResponseCode.OK) {
×
1009
        return result.getSuccess();
×
1010
      }
1011
      if (result.isSetBadRequestError()) {
×
1012
        throw result.getBadRequestError();
×
1013
      }
1014
      if (result.isSetEntityNotExistError()) {
×
1015
        throw result.getEntityNotExistError();
×
1016
      }
1017
      if (result.isSetWorkflowExecutionAlreadyCompletedError()) {
×
1018
        throw result.getWorkflowExecutionAlreadyCompletedError();
×
1019
      }
1020
      if (result.isSetServiceBusyError()) {
×
1021
        throw result.getServiceBusyError();
×
1022
      }
1023
      if (result.isSetDomainNotActiveError()) {
×
1024
        throw result.getDomainNotActiveError();
×
1025
      }
1026
      if (result.isSetLimitExceededError()) {
×
1027
        throw result.getLimitExceededError();
×
1028
      }
1029
      if (result.isSetClientVersionNotSupportedError()) {
×
1030
        throw result.getClientVersionNotSupportedError();
×
1031
      }
1032
      throw new TException("RecordActivityTaskHeartbeatByID failed with unknown error:" + result);
×
1033
    } finally {
1034
      if (response != null) {
×
1035
        response.release();
×
1036
      }
1037
    }
1038
  }
1039

1040
  @Override
1041
  public void RespondActivityTaskCompleted(RespondActivityTaskCompletedRequest request)
1042
      throws TException {
1043
    measureRemoteProc(
×
1044
        ServiceMethod.RESPOND_ACTIVITY_TASK_COMPLETED, () -> respondActivityTaskCompleted(request));
×
1045
  }
×
1046

1047
  private void respondActivityTaskCompleted(RespondActivityTaskCompletedRequest completeRequest)
1048
      throws TException {
1049
    ThriftResponse<WorkflowService.RespondActivityTaskCompleted_result> response = null;
×
1050
    try {
1051
      ThriftRequest<WorkflowService.RespondActivityTaskCompleted_args> request =
×
1052
          buildThriftRequest(
×
1053
              "RespondActivityTaskCompleted",
1054
              new WorkflowService.RespondActivityTaskCompleted_args(completeRequest));
1055
      response = doRemoteCall(request);
×
1056
      WorkflowService.RespondActivityTaskCompleted_result result =
×
1057
          response.getBody(WorkflowService.RespondActivityTaskCompleted_result.class);
×
1058
      if (response.getResponseCode() == ResponseCode.OK) {
×
1059
        return;
×
1060
      }
1061
      if (result.isSetBadRequestError()) {
×
1062
        throw result.getBadRequestError();
×
1063
      }
1064
      if (result.isSetEntityNotExistError()) {
×
1065
        throw result.getEntityNotExistError();
×
1066
      }
1067
      if (result.isSetWorkflowExecutionAlreadyCompletedError()) {
×
1068
        throw result.getWorkflowExecutionAlreadyCompletedError();
×
1069
      }
1070
      if (result.isSetServiceBusyError()) {
×
1071
        throw result.getServiceBusyError();
×
1072
      }
1073
      if (result.isSetDomainNotActiveError()) {
×
1074
        throw result.getDomainNotActiveError();
×
1075
      }
1076
      if (result.isSetLimitExceededError()) {
×
1077
        throw result.getLimitExceededError();
×
1078
      }
1079
      if (result.isSetClientVersionNotSupportedError()) {
×
1080
        throw result.getClientVersionNotSupportedError();
×
1081
      }
1082
      throw new TException("RespondActivityTaskCompleted failed with unknown error:" + result);
×
1083
    } finally {
1084
      if (response != null) {
×
1085
        response.release();
×
1086
      }
1087
    }
1088
  }
1089

1090
  @Override
1091
  public void RespondActivityTaskCompletedByID(RespondActivityTaskCompletedByIDRequest request)
1092
      throws TException {
1093
    measureRemoteProc(
×
1094
        ServiceMethod.RESPOND_ACTIVITY_TASK_COMPLETED_BY_ID,
1095
        () -> respondActivityTaskCompletedByID(request));
×
1096
  }
×
1097

1098
  private void respondActivityTaskCompletedByID(
1099
      RespondActivityTaskCompletedByIDRequest completeRequest) throws TException {
1100
    ThriftResponse<WorkflowService.RespondActivityTaskCompletedByID_result> response = null;
×
1101
    try {
1102
      ThriftRequest<WorkflowService.RespondActivityTaskCompletedByID_args> request =
×
1103
          buildThriftRequest(
×
1104
              "RespondActivityTaskCompletedByID",
1105
              new WorkflowService.RespondActivityTaskCompletedByID_args(completeRequest));
1106
      response = doRemoteCall(request);
×
1107
      WorkflowService.RespondActivityTaskCompletedByID_result result =
×
1108
          response.getBody(WorkflowService.RespondActivityTaskCompletedByID_result.class);
×
1109
      if (response.getResponseCode() == ResponseCode.OK) {
×
1110
        return;
×
1111
      }
1112
      if (result.isSetBadRequestError()) {
×
1113
        throw result.getBadRequestError();
×
1114
      }
1115
      if (result.isSetEntityNotExistError()) {
×
1116
        throw result.getEntityNotExistError();
×
1117
      }
1118
      if (result.isSetWorkflowExecutionAlreadyCompletedError()) {
×
1119
        throw result.getWorkflowExecutionAlreadyCompletedError();
×
1120
      }
1121
      if (result.isSetServiceBusyError()) {
×
1122
        throw result.getServiceBusyError();
×
1123
      }
1124
      if (result.isSetDomainNotActiveError()) {
×
1125
        throw result.getDomainNotActiveError();
×
1126
      }
1127
      if (result.isSetLimitExceededError()) {
×
1128
        throw result.getLimitExceededError();
×
1129
      }
1130
      if (result.isSetClientVersionNotSupportedError()) {
×
1131
        throw result.getClientVersionNotSupportedError();
×
1132
      }
1133
      throw new TException("RespondActivityTaskCompletedByID failed with unknown error:" + result);
×
1134
    } finally {
1135
      if (response != null) {
×
1136
        response.release();
×
1137
      }
1138
    }
1139
  }
1140

1141
  @Override
1142
  public void RespondActivityTaskFailed(RespondActivityTaskFailedRequest request)
1143
      throws TException {
1144
    measureRemoteProc(
×
1145
        ServiceMethod.RESPOND_ACTIVITY_TASK_FAILED, () -> respondActivityTaskFailed(request));
×
1146
  }
×
1147

1148
  private void respondActivityTaskFailed(RespondActivityTaskFailedRequest failRequest)
1149
      throws TException {
1150
    ThriftResponse<WorkflowService.RespondActivityTaskFailed_result> response = null;
×
1151
    try {
1152
      ThriftRequest<WorkflowService.RespondActivityTaskFailed_args> request =
×
1153
          buildThriftRequest(
×
1154
              "RespondActivityTaskFailed",
1155
              new WorkflowService.RespondActivityTaskFailed_args(failRequest));
1156
      response = doRemoteCall(request);
×
1157
      WorkflowService.RespondActivityTaskFailed_result result =
×
1158
          response.getBody(WorkflowService.RespondActivityTaskFailed_result.class);
×
1159
      if (response.getResponseCode() == ResponseCode.OK) {
×
1160
        return;
×
1161
      }
1162
      if (result.isSetBadRequestError()) {
×
1163
        throw result.getBadRequestError();
×
1164
      }
1165
      if (result.isSetEntityNotExistError()) {
×
1166
        throw result.getEntityNotExistError();
×
1167
      }
1168
      if (result.isSetWorkflowExecutionAlreadyCompletedError()) {
×
1169
        throw result.getWorkflowExecutionAlreadyCompletedError();
×
1170
      }
1171
      if (result.isSetServiceBusyError()) {
×
1172
        throw result.getServiceBusyError();
×
1173
      }
1174
      if (result.isSetDomainNotActiveError()) {
×
1175
        throw result.getDomainNotActiveError();
×
1176
      }
1177
      if (result.isSetLimitExceededError()) {
×
1178
        throw result.getLimitExceededError();
×
1179
      }
1180
      if (result.isSetClientVersionNotSupportedError()) {
×
1181
        throw result.getClientVersionNotSupportedError();
×
1182
      }
1183
      throw new TException("RespondActivityTaskFailed failed with unknown error:" + result);
×
1184
    } finally {
1185
      if (response != null) {
×
1186
        response.release();
×
1187
      }
1188
    }
1189
  }
1190

1191
  @Override
1192
  public void RespondActivityTaskFailedByID(RespondActivityTaskFailedByIDRequest request)
1193
      throws TException {
1194
    measureRemoteProc(
×
1195
        ServiceMethod.RESPOND_ACTIVITY_TASK_FAILED_BY_ID,
1196
        () -> respondActivityTaskFailedByID(request));
×
1197
  }
×
1198

1199
  private void respondActivityTaskFailedByID(RespondActivityTaskFailedByIDRequest failRequest)
1200
      throws TException {
1201
    ThriftResponse<WorkflowService.RespondActivityTaskFailedByID_result> response = null;
×
1202
    try {
1203
      ThriftRequest<WorkflowService.RespondActivityTaskFailedByID_args> request =
×
1204
          buildThriftRequest(
×
1205
              "RespondActivityTaskFailedByID",
1206
              new WorkflowService.RespondActivityTaskFailedByID_args(failRequest));
1207
      response = doRemoteCall(request);
×
1208
      WorkflowService.RespondActivityTaskFailedByID_result result =
×
1209
          response.getBody(WorkflowService.RespondActivityTaskFailedByID_result.class);
×
1210
      if (response.getResponseCode() == ResponseCode.OK) {
×
1211
        return;
×
1212
      }
1213
      if (result.isSetBadRequestError()) {
×
1214
        throw result.getBadRequestError();
×
1215
      }
1216
      if (result.isSetEntityNotExistError()) {
×
1217
        throw result.getEntityNotExistError();
×
1218
      }
1219
      if (result.isSetWorkflowExecutionAlreadyCompletedError()) {
×
1220
        throw result.getWorkflowExecutionAlreadyCompletedError();
×
1221
      }
1222
      if (result.isSetServiceBusyError()) {
×
1223
        throw result.getServiceBusyError();
×
1224
      }
1225
      if (result.isSetDomainNotActiveError()) {
×
1226
        throw result.getDomainNotActiveError();
×
1227
      }
1228
      if (result.isSetLimitExceededError()) {
×
1229
        throw result.getLimitExceededError();
×
1230
      }
1231
      if (result.isSetClientVersionNotSupportedError()) {
×
1232
        throw result.getClientVersionNotSupportedError();
×
1233
      }
1234
      throw new TException("RespondActivityTaskFailedByID failedByID with unknown error:" + result);
×
1235
    } finally {
1236
      if (response != null) {
×
1237
        response.release();
×
1238
      }
1239
    }
1240
  }
1241

1242
  @Override
1243
  public void RespondActivityTaskCanceled(RespondActivityTaskCanceledRequest request)
1244
      throws TException {
1245
    measureRemoteProc(
×
1246
        ServiceMethod.RESPOND_ACTIVITY_TASK_CANCELED, () -> respondActivityTaskCanceled(request));
×
1247
  }
×
1248

1249
  private void respondActivityTaskCanceled(RespondActivityTaskCanceledRequest canceledRequest)
1250
      throws TException {
1251
    ThriftResponse<WorkflowService.RespondActivityTaskCanceled_result> response = null;
×
1252
    try {
1253
      ThriftRequest<WorkflowService.RespondActivityTaskCanceled_args> request =
×
1254
          buildThriftRequest(
×
1255
              "RespondActivityTaskCanceled",
1256
              new WorkflowService.RespondActivityTaskCanceled_args(canceledRequest));
1257
      response = doRemoteCall(request);
×
1258
      WorkflowService.RespondActivityTaskCanceled_result result =
×
1259
          response.getBody(WorkflowService.RespondActivityTaskCanceled_result.class);
×
1260
      if (response.getResponseCode() == ResponseCode.OK) {
×
1261
        return;
×
1262
      }
1263
      if (result.isSetBadRequestError()) {
×
1264
        throw result.getBadRequestError();
×
1265
      }
1266
      if (result.isSetEntityNotExistError()) {
×
1267
        throw result.getEntityNotExistError();
×
1268
      }
1269
      if (result.isSetWorkflowExecutionAlreadyCompletedError()) {
×
1270
        throw result.getWorkflowExecutionAlreadyCompletedError();
×
1271
      }
1272
      if (result.isSetServiceBusyError()) {
×
1273
        throw result.getServiceBusyError();
×
1274
      }
1275
      if (result.isSetDomainNotActiveError()) {
×
1276
        throw result.getDomainNotActiveError();
×
1277
      }
1278
      if (result.isSetLimitExceededError()) {
×
1279
        throw result.getLimitExceededError();
×
1280
      }
1281
      if (result.isSetClientVersionNotSupportedError()) {
×
1282
        throw result.getClientVersionNotSupportedError();
×
1283
      }
1284
      throw new TException("RespondActivityTaskCanceled failed with unknown error:" + result);
×
1285
    } finally {
1286
      if (response != null) {
×
1287
        response.release();
×
1288
      }
1289
    }
1290
  }
1291

1292
  @Override
1293
  public void RespondActivityTaskCanceledByID(RespondActivityTaskCanceledByIDRequest request)
1294
      throws TException {
1295
    measureRemoteProc(
×
1296
        ServiceMethod.RESPOND_ACTIVITY_TASK_CANCELED_BY_ID,
1297
        () -> respondActivityTaskCanceledByID(request));
×
1298
  }
×
1299

1300
  private void respondActivityTaskCanceledByID(
1301
      RespondActivityTaskCanceledByIDRequest canceledByIDRequest) throws TException {
1302
    ThriftResponse<WorkflowService.RespondActivityTaskCanceledByID_result> response = null;
×
1303
    try {
1304
      ThriftRequest<WorkflowService.RespondActivityTaskCanceledByID_args> request =
×
1305
          buildThriftRequest(
×
1306
              "RespondActivityTaskCanceledByID",
1307
              new WorkflowService.RespondActivityTaskCanceledByID_args(canceledByIDRequest));
1308
      response = doRemoteCall(request);
×
1309
      WorkflowService.RespondActivityTaskCanceledByID_result result =
×
1310
          response.getBody(WorkflowService.RespondActivityTaskCanceledByID_result.class);
×
1311
      if (response.getResponseCode() == ResponseCode.OK) {
×
1312
        return;
×
1313
      }
1314
      if (result.isSetBadRequestError()) {
×
1315
        throw result.getBadRequestError();
×
1316
      }
1317
      if (result.isSetEntityNotExistError()) {
×
1318
        throw result.getEntityNotExistError();
×
1319
      }
1320
      if (result.isSetWorkflowExecutionAlreadyCompletedError()) {
×
1321
        throw result.getWorkflowExecutionAlreadyCompletedError();
×
1322
      }
1323
      if (result.isSetServiceBusyError()) {
×
1324
        throw result.getServiceBusyError();
×
1325
      }
1326
      if (result.isSetDomainNotActiveError()) {
×
1327
        throw result.getDomainNotActiveError();
×
1328
      }
1329
      if (result.isSetLimitExceededError()) {
×
1330
        throw result.getLimitExceededError();
×
1331
      }
1332
      if (result.isSetClientVersionNotSupportedError()) {
×
1333
        throw result.getClientVersionNotSupportedError();
×
1334
      }
1335
      throw new TException("RespondActivityTaskCanceledByID failed with unknown error:" + result);
×
1336
    } finally {
1337
      if (response != null) {
×
1338
        response.release();
×
1339
      }
1340
    }
1341
  }
1342

1343
  @Override
1344
  public void RequestCancelWorkflowExecution(RequestCancelWorkflowExecutionRequest request)
1345
      throws TException {
1346
    measureRemoteProc(
×
1347
        ServiceMethod.REQUEST_CANCEL_WORKFLOW_EXECUTION,
1348
        () -> requestCancelWorkflowExecution(request));
×
1349
  }
×
1350

1351
  private void requestCancelWorkflowExecution(RequestCancelWorkflowExecutionRequest cancelRequest)
1352
      throws TException {
1353
    cancelRequest.setRequestId(UUID.randomUUID().toString());
×
1354
    ThriftResponse<WorkflowService.RequestCancelWorkflowExecution_result> response = null;
×
1355
    try {
1356
      ThriftRequest<WorkflowService.RequestCancelWorkflowExecution_args> request =
×
1357
          buildThriftRequest(
×
1358
              "RequestCancelWorkflowExecution",
1359
              new WorkflowService.RequestCancelWorkflowExecution_args(cancelRequest));
1360
      response = doRemoteCall(request);
×
1361
      WorkflowService.RequestCancelWorkflowExecution_result result =
×
1362
          response.getBody(WorkflowService.RequestCancelWorkflowExecution_result.class);
×
1363
      if (response.getResponseCode() == ResponseCode.OK) {
×
1364
        return;
×
1365
      }
1366
      if (result.isSetBadRequestError()) {
×
1367
        throw result.getBadRequestError();
×
1368
      }
1369
      if (result.isSetEntityNotExistError()) {
×
1370
        throw result.getEntityNotExistError();
×
1371
      }
1372
      if (result.isSetWorkflowExecutionAlreadyCompletedError()) {
×
1373
        throw result.getWorkflowExecutionAlreadyCompletedError();
×
1374
      }
1375
      if (result.isSetCancellationAlreadyRequestedError()) {
×
1376
        throw result.getCancellationAlreadyRequestedError();
×
1377
      }
1378
      if (result.isSetServiceBusyError()) {
×
1379
        throw result.getServiceBusyError();
×
1380
      }
1381
      if (result.isSetDomainNotActiveError()) {
×
1382
        throw result.getDomainNotActiveError();
×
1383
      }
1384
      if (result.isSetLimitExceededError()) {
×
1385
        throw result.getLimitExceededError();
×
1386
      }
1387
      if (result.isSetClientVersionNotSupportedError()) {
×
1388
        throw result.getClientVersionNotSupportedError();
×
1389
      }
1390
      throw new TException("RequestCancelWorkflowExecution failed with unknown error:" + result);
×
1391
    } finally {
1392
      if (response != null) {
×
1393
        response.release();
×
1394
      }
1395
    }
1396
  }
1397

1398
  @Override
1399
  public void SignalWorkflowExecution(SignalWorkflowExecutionRequest request) throws TException {
1400
    measureRemoteProc(
×
1401
        ServiceMethod.SIGNAL_WORKFLOW_EXECUTION, () -> signalWorkflowExecution(request));
×
1402
  }
×
1403

1404
  private void signalWorkflowExecution(SignalWorkflowExecutionRequest signalRequest)
1405
      throws TException {
1406
    ThriftResponse<WorkflowService.SignalWorkflowExecution_result> response = null;
×
1407
    try {
1408
      ThriftRequest<WorkflowService.SignalWorkflowExecution_args> request =
×
1409
          buildThriftRequest(
×
1410
              "SignalWorkflowExecution",
1411
              new WorkflowService.SignalWorkflowExecution_args(signalRequest));
1412
      response = doRemoteCall(request);
×
1413
      WorkflowService.SignalWorkflowExecution_result result =
×
1414
          response.getBody(WorkflowService.SignalWorkflowExecution_result.class);
×
1415
      if (response.getResponseCode() == ResponseCode.OK) {
×
1416
        return;
×
1417
      }
1418
      if (result.isSetBadRequestError()) {
×
1419
        throw result.getBadRequestError();
×
1420
      }
1421
      if (result.isSetEntityNotExistError()) {
×
1422
        throw result.getEntityNotExistError();
×
1423
      }
1424
      if (result.isSetWorkflowExecutionAlreadyCompletedError()) {
×
1425
        throw result.getWorkflowExecutionAlreadyCompletedError();
×
1426
      }
1427
      if (result.isSetServiceBusyError()) {
×
1428
        throw result.getServiceBusyError();
×
1429
      }
1430
      if (result.isSetDomainNotActiveError()) {
×
1431
        throw result.getDomainNotActiveError();
×
1432
      }
1433
      if (result.isSetLimitExceededError()) {
×
1434
        throw result.getLimitExceededError();
×
1435
      }
1436
      if (result.isSetClientVersionNotSupportedError()) {
×
1437
        throw result.getClientVersionNotSupportedError();
×
1438
      }
1439
      throw new TException("SignalWorkflowExecution failed with unknown error:" + result);
×
1440
    } finally {
1441
      if (response != null) {
×
1442
        response.release();
×
1443
      }
1444
    }
1445
  }
1446

1447
  @Override
1448
  public StartWorkflowExecutionResponse SignalWithStartWorkflowExecution(
1449
      SignalWithStartWorkflowExecutionRequest signalWithStartRequest) throws TException {
1450
    return measureRemoteCall(
×
1451
        ServiceMethod.SIGNAL_WITH_START_WORKFLOW_EXECUTION,
1452
        () -> signalWithStartWorkflowExecution(signalWithStartRequest));
×
1453
  }
1454

1455
  @Override
1456
  public SignalWithStartWorkflowExecutionAsyncResponse SignalWithStartWorkflowExecutionAsync(
1457
      SignalWithStartWorkflowExecutionAsyncRequest signalWithStartRequest)
1458
      throws BadRequestError, WorkflowExecutionAlreadyStartedError, ServiceBusyError,
1459
          DomainNotActiveError, LimitExceededError, EntityNotExistsError,
1460
          ClientVersionNotSupportedError, TException {
NEW
1461
    throw new IllegalArgumentException("unimplemented");
×
1462
  }
1463

1464
  @Override
1465
  public ResetWorkflowExecutionResponse ResetWorkflowExecution(
1466
      ResetWorkflowExecutionRequest resetRequest)
1467
      throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError,
1468
          DomainNotActiveError, LimitExceededError, ClientVersionNotSupportedError, TException {
1469
    return measureRemoteCall(
×
1470
        ServiceMethod.RESET_WORKFLOW_EXECUTION, () -> resetWorkflowExecution(resetRequest));
×
1471
  }
1472

1473
  private ResetWorkflowExecutionResponse resetWorkflowExecution(
1474
      ResetWorkflowExecutionRequest resetRequest) throws TException {
1475
    ThriftResponse<WorkflowService.ResetWorkflowExecution_result> response = null;
×
1476
    try {
1477
      ThriftRequest<WorkflowService.ResetWorkflowExecution_args> request =
×
1478
          buildThriftRequest(
×
1479
              "ResetWorkflowExecution",
1480
              new WorkflowService.ResetWorkflowExecution_args(resetRequest));
1481
      response = doRemoteCall(request);
×
1482
      WorkflowService.ResetWorkflowExecution_result result =
×
1483
          response.getBody(WorkflowService.ResetWorkflowExecution_result.class);
×
1484
      if (response.getResponseCode() == ResponseCode.OK) {
×
1485
        return result.getSuccess();
×
1486
      }
1487
      if (result.isSetBadRequestError()) {
×
1488
        throw result.getBadRequestError();
×
1489
      }
1490
      if (result.isSetEntityNotExistError()) {
×
1491
        throw result.getEntityNotExistError();
×
1492
      }
1493
      if (result.isSetServiceBusyError()) {
×
1494
        throw result.getServiceBusyError();
×
1495
      }
1496
      if (result.isSetDomainNotActiveError()) {
×
1497
        throw result.getDomainNotActiveError();
×
1498
      }
1499
      if (result.isSetLimitExceededError()) {
×
1500
        throw result.getLimitExceededError();
×
1501
      }
1502
      if (result.isSetClientVersionNotSupportedError()) {
×
1503
        throw result.getClientVersionNotSupportedError();
×
1504
      }
1505
      throw new TException("ResetWorkflowExecution failed with unknown error:" + result);
×
1506
    } finally {
1507
      if (response != null) {
×
1508
        response.release();
×
1509
      }
1510
    }
1511
  }
1512

1513
  private StartWorkflowExecutionResponse signalWithStartWorkflowExecution(
1514
      SignalWithStartWorkflowExecutionRequest signalWithStartRequest) throws TException {
1515
    signalWithStartRequest.setRequestId(UUID.randomUUID().toString());
×
1516
    ThriftResponse<WorkflowService.SignalWithStartWorkflowExecution_result> response = null;
×
1517
    try {
1518
      // Write span context to header
1519
      if (!signalWithStartRequest.isSetHeader()) {
×
1520
        signalWithStartRequest.setHeader(new Header());
×
1521
      }
1522
      tracingPropagator.inject(signalWithStartRequest.getHeader());
×
1523

1524
      ThriftRequest<WorkflowService.SignalWithStartWorkflowExecution_args> request =
×
1525
          buildThriftRequest(
×
1526
              "SignalWithStartWorkflowExecution",
1527
              new WorkflowService.SignalWithStartWorkflowExecution_args(signalWithStartRequest));
1528

1529
      response = doRemoteCall(request);
×
1530
      WorkflowService.SignalWithStartWorkflowExecution_result result =
×
1531
          response.getBody(WorkflowService.SignalWithStartWorkflowExecution_result.class);
×
1532
      if (response.getResponseCode() == ResponseCode.OK) {
×
1533
        return result.getSuccess();
×
1534
      }
1535
      if (result.isSetBadRequestError()) {
×
1536
        throw result.getBadRequestError();
×
1537
      }
1538
      if (result.isSetEntityNotExistError()) {
×
1539
        throw result.getEntityNotExistError();
×
1540
      }
1541
      if (result.isSetServiceBusyError()) {
×
1542
        throw result.getServiceBusyError();
×
1543
      }
1544
      if (result.isSetDomainNotActiveError()) {
×
1545
        throw result.getDomainNotActiveError();
×
1546
      }
1547
      if (result.isSetLimitExceededError()) {
×
1548
        throw result.getLimitExceededError();
×
1549
      }
1550
      if (result.isSetDomainNotActiveError()) {
×
1551
        throw result.getDomainNotActiveError();
×
1552
      }
1553
      if (result.isSetClientVersionNotSupportedError()) {
×
1554
        throw result.getClientVersionNotSupportedError();
×
1555
      }
1556
      throw new TException("SignalWithStartWorkflowExecution failed with unknown error:" + result);
×
1557
    } finally {
1558
      if (response != null) {
×
1559
        response.release();
×
1560
      }
1561
    }
1562
  }
1563

1564
  @Override
1565
  public void TerminateWorkflowExecution(TerminateWorkflowExecutionRequest request)
1566
      throws TException {
1567
    measureRemoteProc(
×
1568
        ServiceMethod.TERMINATE_WORKFLOW_EXECUTION, () -> terminateWorkflowExecution(request));
×
1569
  }
×
1570

1571
  private void terminateWorkflowExecution(TerminateWorkflowExecutionRequest terminateRequest)
1572
      throws TException {
1573
    ThriftResponse<WorkflowService.TerminateWorkflowExecution_result> response = null;
×
1574
    try {
1575
      ThriftRequest<WorkflowService.TerminateWorkflowExecution_args> request =
×
1576
          buildThriftRequest(
×
1577
              "TerminateWorkflowExecution",
1578
              new WorkflowService.TerminateWorkflowExecution_args(terminateRequest));
1579
      response = doRemoteCall(request);
×
1580
      WorkflowService.TerminateWorkflowExecution_result result =
×
1581
          response.getBody(WorkflowService.TerminateWorkflowExecution_result.class);
×
1582
      if (response.getResponseCode() == ResponseCode.OK) {
×
1583
        return;
×
1584
      }
1585
      if (result.isSetBadRequestError()) {
×
1586
        throw result.getBadRequestError();
×
1587
      }
1588
      if (result.isSetEntityNotExistError()) {
×
1589
        throw result.getEntityNotExistError();
×
1590
      }
1591
      if (result.isSetWorkflowExecutionAlreadyCompletedError()) {
×
1592
        throw result.getWorkflowExecutionAlreadyCompletedError();
×
1593
      }
1594
      if (result.isSetServiceBusyError()) {
×
1595
        throw result.getServiceBusyError();
×
1596
      }
1597
      if (result.isSetDomainNotActiveError()) {
×
1598
        throw result.getDomainNotActiveError();
×
1599
      }
1600
      if (result.isSetLimitExceededError()) {
×
1601
        throw result.getLimitExceededError();
×
1602
      }
1603
      if (result.isSetClientVersionNotSupportedError()) {
×
1604
        throw result.getClientVersionNotSupportedError();
×
1605
      }
1606
      throw new TException("TerminateWorkflowExecution failed with unknown error:" + result);
×
1607
    } finally {
1608
      if (response != null) {
×
1609
        response.release();
×
1610
      }
1611
    }
1612
  }
1613

1614
  @Override
1615
  public ListOpenWorkflowExecutionsResponse ListOpenWorkflowExecutions(
1616
      ListOpenWorkflowExecutionsRequest request) throws TException {
1617
    return measureRemoteCall(
×
1618
        ServiceMethod.LIST_OPEN_WORKFLOW_EXECUTIONS, () -> listOpenWorkflowExecutions(request));
×
1619
  }
1620

1621
  private ListOpenWorkflowExecutionsResponse listOpenWorkflowExecutions(
1622
      ListOpenWorkflowExecutionsRequest listRequest) throws TException {
1623
    ThriftResponse<WorkflowService.ListOpenWorkflowExecutions_result> response = null;
×
1624
    try {
1625
      ThriftRequest<WorkflowService.ListOpenWorkflowExecutions_args> request =
×
1626
          buildThriftRequest(
×
1627
              "ListOpenWorkflowExecutions",
1628
              new WorkflowService.ListOpenWorkflowExecutions_args(listRequest));
1629
      response = doRemoteCall(request);
×
1630
      WorkflowService.ListOpenWorkflowExecutions_result result =
×
1631
          response.getBody(WorkflowService.ListOpenWorkflowExecutions_result.class);
×
1632
      if (response.getResponseCode() == ResponseCode.OK) {
×
1633
        return result.getSuccess();
×
1634
      }
1635
      if (result.isSetBadRequestError()) {
×
1636
        throw result.getBadRequestError();
×
1637
      }
1638
      if (result.isSetEntityNotExistError()) {
×
1639
        throw result.getEntityNotExistError();
×
1640
      }
1641
      if (result.isSetServiceBusyError()) {
×
1642
        throw result.getServiceBusyError();
×
1643
      }
1644
      if (result.isSetLimitExceededError()) {
×
1645
        throw result.getLimitExceededError();
×
1646
      }
1647
      if (result.isSetClientVersionNotSupportedError()) {
×
1648
        throw result.getClientVersionNotSupportedError();
×
1649
      }
1650
      throw new TException("ListOpenWorkflowExecutions failed with unknown error:" + result);
×
1651
    } finally {
1652
      if (response != null) {
×
1653
        response.release();
×
1654
      }
1655
    }
1656
  }
1657

1658
  @Override
1659
  public ListClosedWorkflowExecutionsResponse ListClosedWorkflowExecutions(
1660
      ListClosedWorkflowExecutionsRequest request) throws TException {
1661
    return measureRemoteCall(
×
1662
        ServiceMethod.LIST_CLOSED_WORKFLOW_EXECUTIONS, () -> listClosedWorkflowExecutions(request));
×
1663
  }
1664

1665
  private ListClosedWorkflowExecutionsResponse listClosedWorkflowExecutions(
1666
      ListClosedWorkflowExecutionsRequest listRequest) throws TException {
1667
    ThriftResponse<WorkflowService.ListClosedWorkflowExecutions_result> response = null;
×
1668
    try {
1669
      ThriftRequest<WorkflowService.ListClosedWorkflowExecutions_args> request =
×
1670
          buildThriftRequest(
×
1671
              "ListClosedWorkflowExecutions",
1672
              new WorkflowService.ListClosedWorkflowExecutions_args(listRequest));
1673
      response = doRemoteCall(request);
×
1674
      WorkflowService.ListClosedWorkflowExecutions_result result =
×
1675
          response.getBody(WorkflowService.ListClosedWorkflowExecutions_result.class);
×
1676
      if (response.getResponseCode() == ResponseCode.OK) {
×
1677
        return result.getSuccess();
×
1678
      }
1679
      if (result.isSetBadRequestError()) {
×
1680
        throw result.getBadRequestError();
×
1681
      }
1682
      if (result.isSetEntityNotExistError()) {
×
1683
        throw result.getEntityNotExistError();
×
1684
      }
1685
      if (result.isSetServiceBusyError()) {
×
1686
        throw result.getServiceBusyError();
×
1687
      }
1688
      if (result.isSetClientVersionNotSupportedError()) {
×
1689
        throw result.getClientVersionNotSupportedError();
×
1690
      }
1691
      throw new TException("ListClosedWorkflowExecutions failed with unknown error:" + result);
×
1692
    } finally {
1693
      if (response != null) {
×
1694
        response.release();
×
1695
      }
1696
    }
1697
  }
1698

1699
  @Override
1700
  public ListWorkflowExecutionsResponse ListWorkflowExecutions(
1701
      ListWorkflowExecutionsRequest request)
1702
      throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError,
1703
          ClientVersionNotSupportedError, TException {
1704
    return measureRemoteCall(
×
1705
        ServiceMethod.LIST_WORKFLOW_EXECUTIONS, () -> listWorkflowExecutions(request));
×
1706
  }
1707

1708
  private ListWorkflowExecutionsResponse listWorkflowExecutions(
1709
      ListWorkflowExecutionsRequest listRequest) throws TException {
1710
    ThriftResponse<WorkflowService.ListWorkflowExecutions_result> response = null;
×
1711
    try {
1712
      ThriftRequest<WorkflowService.ListWorkflowExecutions_args> request =
×
1713
          buildThriftRequest(
×
1714
              "ListWorkflowExecutions",
1715
              new WorkflowService.ListWorkflowExecutions_args(listRequest));
1716
      response = doRemoteCall(request);
×
1717
      WorkflowService.ListWorkflowExecutions_result result =
×
1718
          response.getBody(WorkflowService.ListWorkflowExecutions_result.class);
×
1719
      if (response.getResponseCode() == ResponseCode.OK) {
×
1720
        return result.getSuccess();
×
1721
      }
1722
      if (result.isSetBadRequestError()) {
×
1723
        throw result.getBadRequestError();
×
1724
      }
1725
      if (result.isSetEntityNotExistError()) {
×
1726
        throw result.getEntityNotExistError();
×
1727
      }
1728
      if (result.isSetServiceBusyError()) {
×
1729
        throw result.getServiceBusyError();
×
1730
      }
1731
      if (result.isSetClientVersionNotSupportedError()) {
×
1732
        throw result.getClientVersionNotSupportedError();
×
1733
      }
1734
      throw new TException("ListWorkflowExecutions failed with unknown error:" + result);
×
1735
    } finally {
1736
      if (response != null) {
×
1737
        response.release();
×
1738
      }
1739
    }
1740
  }
1741

1742
  @Override
1743
  public ListArchivedWorkflowExecutionsResponse ListArchivedWorkflowExecutions(
1744
      ListArchivedWorkflowExecutionsRequest listRequest)
1745
      throws BadRequestError, EntityNotExistsError, ServiceBusyError,
1746
          ClientVersionNotSupportedError, TException {
1747
    return measureRemoteCall(
×
1748
        ServiceMethod.LIST_ARCHIVED_WORKFLOW_EXECUTIONS,
1749
        () -> listArchivedWorkflowExecutions(listRequest));
×
1750
  }
1751

1752
  private ListArchivedWorkflowExecutionsResponse listArchivedWorkflowExecutions(
1753
      ListArchivedWorkflowExecutionsRequest listRequest) throws TException {
1754
    ThriftResponse<WorkflowService.ListArchivedWorkflowExecutions_result> response = null;
×
1755
    try {
1756
      ThriftRequest<WorkflowService.ListArchivedWorkflowExecutions_args> request =
×
1757
          buildThriftRequest(
×
1758
              "ListArchivedWorkflowExecutions",
1759
              new WorkflowService.ListArchivedWorkflowExecutions_args(listRequest),
1760
              options.getRpcListArchivedWorkflowTimeoutMillis());
×
1761
      response = doRemoteCall(request);
×
1762
      WorkflowService.ListArchivedWorkflowExecutions_result result =
×
1763
          response.getBody(WorkflowService.ListArchivedWorkflowExecutions_result.class);
×
1764
      if (response.getResponseCode() == ResponseCode.OK) {
×
1765
        return result.getSuccess();
×
1766
      }
1767
      if (result.isSetBadRequestError()) {
×
1768
        throw result.getBadRequestError();
×
1769
      }
1770
      if (result.isSetEntityNotExistError()) {
×
1771
        throw result.getEntityNotExistError();
×
1772
      }
1773
      if (result.isSetServiceBusyError()) {
×
1774
        throw result.getServiceBusyError();
×
1775
      }
1776
      if (result.isSetClientVersionNotSupportedError()) {
×
1777
        throw result.getClientVersionNotSupportedError();
×
1778
      }
1779
      throw new TException("ListArchivedWorkflowExecutions failed with unknown error:" + result);
×
1780
    } finally {
1781
      if (response != null) {
×
1782
        response.release();
×
1783
      }
1784
    }
1785
  }
1786

1787
  @Override
1788
  public ListWorkflowExecutionsResponse ScanWorkflowExecutions(
1789
      ListWorkflowExecutionsRequest request)
1790
      throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError,
1791
          ClientVersionNotSupportedError, TException {
1792
    return measureRemoteCall(
×
1793
        ServiceMethod.SCAN_WORKFLOW_EXECUTIONS, () -> scanWorkflowExecutions(request));
×
1794
  }
1795

1796
  private ListWorkflowExecutionsResponse scanWorkflowExecutions(
1797
      ListWorkflowExecutionsRequest listRequest) throws TException {
1798
    ThriftResponse<WorkflowService.ScanWorkflowExecutions_result> response = null;
×
1799
    try {
1800
      ThriftRequest<WorkflowService.ScanWorkflowExecutions_args> request =
×
1801
          buildThriftRequest(
×
1802
              "ScanWorkflowExecutions",
1803
              new WorkflowService.ScanWorkflowExecutions_args(listRequest));
1804
      response = doRemoteCall(request);
×
1805
      WorkflowService.ScanWorkflowExecutions_result result =
×
1806
          response.getBody(WorkflowService.ScanWorkflowExecutions_result.class);
×
1807
      if (response.getResponseCode() == ResponseCode.OK) {
×
1808
        return result.getSuccess();
×
1809
      }
1810
      if (result.isSetBadRequestError()) {
×
1811
        throw result.getBadRequestError();
×
1812
      }
1813
      if (result.isSetEntityNotExistError()) {
×
1814
        throw result.getEntityNotExistError();
×
1815
      }
1816
      if (result.isSetServiceBusyError()) {
×
1817
        throw result.getServiceBusyError();
×
1818
      }
1819
      if (result.isSetClientVersionNotSupportedError()) {
×
1820
        throw result.getClientVersionNotSupportedError();
×
1821
      }
1822
      throw new TException("ScanWorkflowExecutions failed with unknown error:" + result);
×
1823
    } finally {
1824
      if (response != null) {
×
1825
        response.release();
×
1826
      }
1827
    }
1828
  }
1829

1830
  @Override
1831
  public CountWorkflowExecutionsResponse CountWorkflowExecutions(
1832
      CountWorkflowExecutionsRequest countRequest)
1833
      throws BadRequestError, InternalServiceError, EntityNotExistsError, ServiceBusyError,
1834
          ClientVersionNotSupportedError, TException {
1835
    return measureRemoteCall(
×
1836
        ServiceMethod.COUNT_WORKFLOW_EXECUTIONS, () -> countWorkflowExecutions(countRequest));
×
1837
  }
1838

1839
  private CountWorkflowExecutionsResponse countWorkflowExecutions(
1840
      CountWorkflowExecutionsRequest countRequest) throws TException {
1841
    ThriftResponse<WorkflowService.CountWorkflowExecutions_result> response = null;
×
1842
    try {
1843
      ThriftRequest<WorkflowService.CountWorkflowExecutions_args> request =
×
1844
          buildThriftRequest(
×
1845
              "CountWorkflowExecutions",
1846
              new WorkflowService.CountWorkflowExecutions_args(countRequest));
1847
      response = doRemoteCall(request);
×
1848
      WorkflowService.CountWorkflowExecutions_result result =
×
1849
          response.getBody(WorkflowService.CountWorkflowExecutions_result.class);
×
1850
      if (response.getResponseCode() == ResponseCode.OK) {
×
1851
        return result.getSuccess();
×
1852
      }
1853
      if (result.isSetBadRequestError()) {
×
1854
        throw result.getBadRequestError();
×
1855
      }
1856
      if (result.isSetEntityNotExistError()) {
×
1857
        throw result.getEntityNotExistError();
×
1858
      }
1859
      if (result.isSetServiceBusyError()) {
×
1860
        throw result.getServiceBusyError();
×
1861
      }
1862
      if (result.isSetClientVersionNotSupportedError()) {
×
1863
        throw result.getClientVersionNotSupportedError();
×
1864
      }
1865
      throw new TException("CountWorkflowExecutions failed with unknown error:" + result);
×
1866
    } finally {
1867
      if (response != null) {
×
1868
        response.release();
×
1869
      }
1870
    }
1871
  }
1872

1873
  @Override
1874
  public GetSearchAttributesResponse GetSearchAttributes()
1875
      throws InternalServiceError, ServiceBusyError, ClientVersionNotSupportedError, TException {
1876
    return measureRemoteCall(ServiceMethod.GET_SEARCH_ATTRIBUTES, () -> getSearchAttributes());
×
1877
  }
1878

1879
  private GetSearchAttributesResponse getSearchAttributes() throws TException {
1880
    ThriftResponse<WorkflowService.GetSearchAttributes_result> response = null;
×
1881
    try {
1882
      ThriftRequest<WorkflowService.GetSearchAttributes_args> request =
×
1883
          buildThriftRequest("GetSearchAttributes", new WorkflowService.GetSearchAttributes_args());
×
1884
      response = doRemoteCall(request);
×
1885
      WorkflowService.GetSearchAttributes_result result =
×
1886
          response.getBody(WorkflowService.GetSearchAttributes_result.class);
×
1887
      if (response.getResponseCode() == ResponseCode.OK) {
×
1888
        return result.getSuccess();
×
1889
      }
1890
      if (result.isSetServiceBusyError()) {
×
1891
        throw result.getServiceBusyError();
×
1892
      }
1893
      if (result.isSetClientVersionNotSupportedError()) {
×
1894
        throw result.getClientVersionNotSupportedError();
×
1895
      }
1896
      throw new TException("GetSearchAttributes failed with unknown error:" + result);
×
1897
    } finally {
1898
      if (response != null) {
×
1899
        response.release();
×
1900
      }
1901
    }
1902
  }
1903

1904
  @Override
1905
  public void RespondQueryTaskCompleted(RespondQueryTaskCompletedRequest request)
1906
      throws TException {
1907
    measureRemoteProc(
×
1908
        ServiceMethod.RESPOND_QUERY_TASK_COMPLETED, () -> respondQueryTaskCompleted(request));
×
1909
  }
×
1910

1911
  private void respondQueryTaskCompleted(RespondQueryTaskCompletedRequest completeRequest)
1912
      throws TException {
1913
    ThriftResponse<WorkflowService.RespondQueryTaskCompleted_result> response = null;
×
1914
    try {
1915
      ThriftRequest<WorkflowService.RespondQueryTaskCompleted_args> request =
×
1916
          buildThriftRequest(
×
1917
              "RespondQueryTaskCompleted",
1918
              new WorkflowService.RespondQueryTaskCompleted_args(completeRequest));
1919
      response = doRemoteCall(request);
×
1920
      WorkflowService.RespondQueryTaskCompleted_result result =
×
1921
          response.getBody(WorkflowService.RespondQueryTaskCompleted_result.class);
×
1922
      if (response.getResponseCode() == ResponseCode.OK) {
×
1923
        return;
×
1924
      }
1925
      if (result.isSetBadRequestError()) {
×
1926
        throw result.getBadRequestError();
×
1927
      }
1928
      if (result.isSetEntityNotExistError()) {
×
1929
        throw result.getEntityNotExistError();
×
1930
      }
1931
      if (result.isSetServiceBusyError()) {
×
1932
        throw result.getServiceBusyError();
×
1933
      }
1934
      if (result.isSetDomainNotActiveError()) {
×
1935
        throw result.getDomainNotActiveError();
×
1936
      }
1937
      if (result.isSetLimitExceededError()) {
×
1938
        throw result.getLimitExceededError();
×
1939
      }
1940
      if (result.isSetClientVersionNotSupportedError()) {
×
1941
        throw result.getClientVersionNotSupportedError();
×
1942
      }
1943
      throw new TException("RespondQueryTaskCompleted failed with unknown error:" + result);
×
1944
    } finally {
1945
      if (response != null) {
×
1946
        response.release();
×
1947
      }
1948
    }
1949
  }
1950

1951
  @Override
1952
  public QueryWorkflowResponse QueryWorkflow(QueryWorkflowRequest request) throws TException {
1953
    return measureRemoteCall(ServiceMethod.QUERY_WORKFLOW, () -> queryWorkflow(request));
×
1954
  }
1955

1956
  private QueryWorkflowResponse queryWorkflow(QueryWorkflowRequest queryRequest) throws TException {
1957
    ThriftResponse<WorkflowService.QueryWorkflow_result> response = null;
×
1958
    try {
1959
      ThriftRequest<WorkflowService.QueryWorkflow_args> request =
×
1960
          buildThriftRequest(
×
1961
              "QueryWorkflow",
1962
              new WorkflowService.QueryWorkflow_args(queryRequest),
1963
              options.getRpcQueryTimeoutMillis());
×
1964
      response = doRemoteCall(request);
×
1965
      WorkflowService.QueryWorkflow_result result =
×
1966
          response.getBody(WorkflowService.QueryWorkflow_result.class);
×
1967
      if (response.getResponseCode() == ResponseCode.OK) {
×
1968
        return result.getSuccess();
×
1969
      }
1970
      if (result.isSetBadRequestError()) {
×
1971
        throw result.getBadRequestError();
×
1972
      }
1973
      if (result.isSetEntityNotExistError()) {
×
1974
        throw result.getEntityNotExistError();
×
1975
      }
1976
      if (result.isSetQueryFailedError()) {
×
1977
        throw result.getQueryFailedError();
×
1978
      }
1979
      if (result.isSetClientVersionNotSupportedError()) {
×
1980
        throw result.getClientVersionNotSupportedError();
×
1981
      }
1982
      throw new TException("QueryWorkflow failed with unknown error:" + result);
×
1983
    } finally {
1984
      if (response != null) {
×
1985
        response.release();
×
1986
      }
1987
    }
1988
  }
1989

1990
  @Override
1991
  public ResetStickyTaskListResponse ResetStickyTaskList(ResetStickyTaskListRequest resetRequest)
1992
      throws BadRequestError, InternalServiceError, EntityNotExistsError, LimitExceededError,
1993
          WorkflowExecutionAlreadyCompletedError, ServiceBusyError, DomainNotActiveError,
1994
          TException {
1995
    return measureRemoteCall(
×
1996
        ServiceMethod.RESET_STICKY_TASK_LIST, () -> resetStickyTaskList(resetRequest));
×
1997
  }
1998

1999
  private ResetStickyTaskListResponse resetStickyTaskList(ResetStickyTaskListRequest queryRequest)
2000
      throws TException {
2001
    ThriftResponse<WorkflowService.ResetStickyTaskList_result> response = null;
×
2002
    try {
2003
      ThriftRequest<WorkflowService.ResetStickyTaskList_args> request =
×
2004
          buildThriftRequest(
×
2005
              "ResetStickyTaskList",
2006
              new WorkflowService.ResetStickyTaskList_args(queryRequest),
2007
              options.getRpcQueryTimeoutMillis());
×
2008
      response = doRemoteCall(request);
×
2009
      WorkflowService.ResetStickyTaskList_result result =
×
2010
          response.getBody(WorkflowService.ResetStickyTaskList_result.class);
×
2011
      if (response.getResponseCode() == ResponseCode.OK) {
×
2012
        return result.getSuccess();
×
2013
      }
2014
      if (result.isSetBadRequestError()) {
×
2015
        throw result.getBadRequestError();
×
2016
      }
2017
      if (result.isSetEntityNotExistError()) {
×
2018
        throw result.getEntityNotExistError();
×
2019
      }
2020
      if (result.isSetWorkflowExecutionAlreadyCompletedError()) {
×
2021
        throw result.getWorkflowExecutionAlreadyCompletedError();
×
2022
      }
2023
      if (result.isSetServiceBusyError()) {
×
2024
        throw result.getServiceBusyError();
×
2025
      }
2026
      if (result.isSetDomainNotActiveError()) {
×
2027
        throw result.getDomainNotActiveError();
×
2028
      }
2029
      if (result.isSetLimitExceededError()) {
×
2030
        throw result.getLimitExceededError();
×
2031
      }
2032
      if (result.isSetClientVersionNotSupportedError()) {
×
2033
        throw result.getClientVersionNotSupportedError();
×
2034
      }
2035
      throw new TException("ResetStickyTaskList failed with unknown error:" + result);
×
2036
    } finally {
2037
      if (response != null) {
×
2038
        response.release();
×
2039
      }
2040
    }
2041
  }
2042

2043
  @Override
2044
  public DescribeWorkflowExecutionResponse DescribeWorkflowExecution(
2045
      DescribeWorkflowExecutionRequest request) throws TException {
2046
    return measureRemoteCall(
×
2047
        ServiceMethod.DESCRIBE_WORKFLOW_EXECUTION, () -> describeWorkflowExecution(request));
×
2048
  }
2049

2050
  private DescribeWorkflowExecutionResponse describeWorkflowExecution(
2051
      DescribeWorkflowExecutionRequest describeRequest) throws TException {
2052
    ThriftResponse<WorkflowService.DescribeWorkflowExecution_result> response = null;
×
2053
    try {
2054
      ThriftRequest<WorkflowService.DescribeWorkflowExecution_args> request =
×
2055
          buildThriftRequest(
×
2056
              "DescribeWorkflowExecution",
2057
              new WorkflowService.DescribeWorkflowExecution_args(describeRequest));
2058
      response = doRemoteCall(request);
×
2059
      WorkflowService.DescribeWorkflowExecution_result result =
×
2060
          response.getBody(WorkflowService.DescribeWorkflowExecution_result.class);
×
2061
      if (response.getResponseCode() == ResponseCode.OK) {
×
2062
        return result.getSuccess();
×
2063
      }
2064
      if (result.isSetBadRequestError()) {
×
2065
        throw result.getBadRequestError();
×
2066
      }
2067
      if (result.isSetEntityNotExistError()) {
×
2068
        throw result.getEntityNotExistError();
×
2069
      }
2070
      if (result.isSetServiceBusyError()) {
×
2071
        throw result.getServiceBusyError();
×
2072
      }
2073
      if (result.isSetLimitExceededError()) {
×
2074
        throw result.getLimitExceededError();
×
2075
      }
2076
      if (result.isSetClientVersionNotSupportedError()) {
×
2077
        throw result.getClientVersionNotSupportedError();
×
2078
      }
2079
      throw new TException("DescribeWorkflowExecution failed with unknown error:" + result);
×
2080
    } finally {
2081
      if (response != null) {
×
2082
        response.release();
×
2083
      }
2084
    }
2085
  }
2086

2087
  @Override
2088
  public DescribeTaskListResponse DescribeTaskList(DescribeTaskListRequest request)
2089
      throws TException {
2090
    return measureRemoteCall(ServiceMethod.DESCRIBE_TASK_LIST, () -> describeTaskList(request));
×
2091
  }
2092

2093
  private DescribeTaskListResponse describeTaskList(DescribeTaskListRequest describeRequest)
2094
      throws TException {
2095
    ThriftResponse<WorkflowService.DescribeTaskList_result> response = null;
×
2096
    try {
2097
      ThriftRequest<WorkflowService.DescribeTaskList_args> request =
×
2098
          buildThriftRequest(
×
2099
              "DescribeTaskList", new WorkflowService.DescribeTaskList_args(describeRequest));
2100
      response = doRemoteCall(request);
×
2101
      WorkflowService.DescribeTaskList_result result =
×
2102
          response.getBody(WorkflowService.DescribeTaskList_result.class);
×
2103
      if (response.getResponseCode() == ResponseCode.OK) {
×
2104
        return result.getSuccess();
×
2105
      }
2106
      if (result.isSetBadRequestError()) {
×
2107
        throw result.getBadRequestError();
×
2108
      }
2109
      if (result.isSetEntityNotExistError()) {
×
2110
        throw result.getEntityNotExistError();
×
2111
      }
2112
      if (result.isSetServiceBusyError()) {
×
2113
        throw result.getServiceBusyError();
×
2114
      }
2115
      if (result.isSetLimitExceededError()) {
×
2116
        throw result.getLimitExceededError();
×
2117
      }
2118
      if (result.isSetClientVersionNotSupportedError()) {
×
2119
        throw result.getClientVersionNotSupportedError();
×
2120
      }
2121
      throw new TException("DescribeTaskList failed with unknown error:" + result);
×
2122
    } finally {
2123
      if (response != null) {
×
2124
        response.release();
×
2125
      }
2126
    }
2127
  }
2128

2129
  @Override
2130
  public ClusterInfo GetClusterInfo() throws InternalServiceError, ServiceBusyError, TException {
2131
    return measureRemoteCall(ServiceMethod.GET_CLUSTER_INFO, () -> getClusterInfo());
×
2132
  }
2133

2134
  private ClusterInfo getClusterInfo() throws TException {
2135
    ThriftResponse<WorkflowService.GetClusterInfo_result> response = null;
×
2136
    try {
2137
      ThriftRequest<WorkflowService.GetClusterInfo_args> request =
×
2138
          buildThriftRequest("GetClusterInfo", new WorkflowService.GetClusterInfo_args());
×
2139
      response = doRemoteCall(request);
×
2140
      WorkflowService.GetClusterInfo_result result =
×
2141
          response.getBody(WorkflowService.GetClusterInfo_result.class);
×
2142
      if (response.getResponseCode() == ResponseCode.OK) {
×
2143
        return result.getSuccess();
×
2144
      }
2145
      if (result.isSetServiceBusyError()) {
×
2146
        throw result.getServiceBusyError();
×
2147
      }
2148
      throw new TException("GetClusterInfo failed with unknown error:" + result);
×
2149
    } finally {
2150
      if (response != null) {
×
2151
        response.release();
×
2152
      }
2153
    }
2154
  }
2155

2156
  @Override
2157
  public ListTaskListPartitionsResponse ListTaskListPartitions(
2158
      ListTaskListPartitionsRequest request)
2159
      throws BadRequestError, EntityNotExistsError, LimitExceededError, ServiceBusyError,
2160
          TException {
2161
    return measureRemoteCall(
×
2162
        ServiceMethod.LIST_TASK_LIST_PARTITIONS, () -> listTaskListPartitions(request));
×
2163
  }
2164

2165
  @Override
2166
  public void RefreshWorkflowTasks(RefreshWorkflowTasksRequest refreshWorkflowTasks)
2167
      throws BadRequestError, DomainNotActiveError, ServiceBusyError, EntityNotExistsError,
2168
          TException {
2169
    ThriftResponse<WorkflowService.RefreshWorkflowTasks_result> response = null;
×
2170
    try {
2171
      ThriftRequest<WorkflowService.RefreshWorkflowTasks_args> request =
×
2172
          buildThriftRequest(
×
2173
              "RefreshWorkflowTasks",
2174
              new WorkflowService.RefreshWorkflowTasks_args(refreshWorkflowTasks));
2175
      response = doRemoteCall(request);
×
2176
      WorkflowService.RefreshWorkflowTasks_result result =
×
2177
          response.getBody(WorkflowService.RefreshWorkflowTasks_result.class);
×
2178
      if (result.isSetBadRequestError()) {
×
2179
        throw result.getBadRequestError();
×
2180
      }
2181
      if (result.isSetDomainNotActiveError()) {
×
2182
        throw result.getDomainNotActiveError();
×
2183
      }
2184
      if (result.isSetServiceBusyError()) {
×
2185
        throw result.getServiceBusyError();
×
2186
      }
2187
      if (result.isSetEntityNotExistError()) {
×
2188
        throw result.getEntityNotExistError();
×
2189
      }
2190
    } finally {
2191
      if (response != null) {
×
2192
        response.release();
×
2193
      }
2194
    }
2195
  }
×
2196

2197
  private ListTaskListPartitionsResponse listTaskListPartitions(
2198
      ListTaskListPartitionsRequest listRequest) throws TException {
2199
    ThriftResponse<WorkflowService.ListTaskListPartitions_result> response = null;
×
2200
    try {
2201
      ThriftRequest<WorkflowService.ListTaskListPartitions_args> request =
×
2202
          buildThriftRequest(
×
2203
              "ListTaskListPartitions",
2204
              new WorkflowService.ListTaskListPartitions_args(listRequest));
2205
      response = doRemoteCall(request);
×
2206
      WorkflowService.ListTaskListPartitions_result result =
×
2207
          response.getBody(WorkflowService.ListTaskListPartitions_result.class);
×
2208
      if (response.getResponseCode() == ResponseCode.OK) {
×
2209
        return result.getSuccess();
×
2210
      }
2211
      if (result.isSetBadRequestError()) {
×
2212
        throw result.getBadRequestError();
×
2213
      }
2214
      if (result.isSetEntityNotExistError()) {
×
2215
        throw result.getEntityNotExistError();
×
2216
      }
2217
      if (result.isSetServiceBusyError()) {
×
2218
        throw result.getServiceBusyError();
×
2219
      }
2220
      if (result.isSetLimitExceededError()) {
×
2221
        throw result.getLimitExceededError();
×
2222
      }
2223
      throw new TException("ListTaskListPartitions failed with unknown error:" + result);
×
2224
    } finally {
2225
      if (response != null) {
×
2226
        response.release();
×
2227
      }
2228
    }
2229
  }
2230

2231
  @Override
2232
  public void StartWorkflowExecution(
2233
      StartWorkflowExecutionRequest startRequest, AsyncMethodCallback resultHandler) {
2234
    startWorkflowExecution(startRequest, resultHandler, null);
×
2235
  }
×
2236

2237
  @Override
2238
  public void StartWorkflowExecutionAsync(
2239
      StartWorkflowExecutionAsyncRequest startRequest, AsyncMethodCallback resultHandler)
2240
      throws TException {
NEW
2241
    throw new IllegalArgumentException("unimplemented");
×
2242
  }
2243

2244
  @Override
2245
  public void StartWorkflowExecutionWithTimeout(
2246
      StartWorkflowExecutionRequest startRequest,
2247
      AsyncMethodCallback resultHandler,
2248
      Long timeoutInMillis) {
2249
    startWorkflowExecution(startRequest, resultHandler, timeoutInMillis);
×
2250
  }
×
2251

2252
  private void startWorkflowExecution(
2253
      StartWorkflowExecutionRequest startRequest,
2254
      AsyncMethodCallback resultHandler,
2255
      Long timeoutInMillis) {
2256

2257
    startRequest.setRequestId(UUID.randomUUID().toString());
×
2258
    timeoutInMillis = validateAndUpdateTimeout(timeoutInMillis, options.getRpcTimeoutMillis());
×
2259
    ThriftRequest<WorkflowService.StartWorkflowExecution_args> request =
×
2260
        buildThriftRequest(
×
2261
            "StartWorkflowExecution",
2262
            new WorkflowService.StartWorkflowExecution_args(startRequest),
2263
            timeoutInMillis);
2264

2265
    CompletableFuture<ThriftResponse<WorkflowService.StartWorkflowExecution_result>> response =
×
2266
        doRemoteCallAsync(request);
×
2267
    response
×
2268
        .whenComplete(
×
2269
            (r, e) -> {
2270
              try {
2271
                if (e != null) {
×
2272
                  resultHandler.onError(CheckedExceptionWrapper.wrap(e));
×
2273
                  return;
×
2274
                }
2275
                WorkflowService.StartWorkflowExecution_result result =
×
2276
                    r.getBody(WorkflowService.StartWorkflowExecution_result.class);
×
2277
                if (r.getResponseCode() == ResponseCode.OK) {
×
2278
                  resultHandler.onComplete(result.getSuccess());
×
2279
                  return;
×
2280
                }
2281
                if (result.isSetBadRequestError()) {
×
2282
                  resultHandler.onError(result.getBadRequestError());
×
2283
                  return;
×
2284
                }
2285
                if (result.isSetSessionAlreadyExistError()) {
×
2286
                  resultHandler.onError(result.getSessionAlreadyExistError());
×
2287
                  return;
×
2288
                }
2289
                if (result.isSetServiceBusyError()) {
×
2290
                  resultHandler.onError(result.getServiceBusyError());
×
2291
                  return;
×
2292
                }
2293
                if (result.isSetDomainNotActiveError()) {
×
2294
                  resultHandler.onError(result.getDomainNotActiveError());
×
2295
                  return;
×
2296
                }
2297
                if (result.isSetLimitExceededError()) {
×
2298
                  resultHandler.onError(result.getLimitExceededError());
×
2299
                  return;
×
2300
                }
2301
                if (result.isSetEntityNotExistError()) {
×
2302
                  resultHandler.onError(result.getEntityNotExistError());
×
2303
                  return;
×
2304
                }
2305
                resultHandler.onError(
×
2306
                    new TException("StartWorkflowExecution failed with unknown error:" + result));
2307
              } finally {
2308
                if (r != null) {
×
2309
                  r.release();
×
2310
                }
2311
              }
2312
            })
×
2313
        .exceptionally(
×
2314
            (e) -> {
2315
              log.error("Unexpected error in StartWorkflowExecution", e);
×
2316
              return null;
×
2317
            });
2318
  }
×
2319

2320
  private Long validateAndUpdateTimeout(Long timeoutInMillis, Long defaultTimeoutInMillis) {
2321
    if (timeoutInMillis == null || timeoutInMillis <= 0 || timeoutInMillis == Long.MAX_VALUE) {
×
2322
      timeoutInMillis = defaultTimeoutInMillis;
×
2323
    } else {
2324
      timeoutInMillis = Math.min(timeoutInMillis, defaultTimeoutInMillis);
×
2325
    }
2326
    return timeoutInMillis;
×
2327
  }
2328

2329
  @SuppressWarnings({"unchecked", "FutureReturnValueIgnored"})
2330
  @Override
2331
  public void GetWorkflowExecutionHistoryWithTimeout(
2332
      GetWorkflowExecutionHistoryRequest getRequest,
2333
      AsyncMethodCallback resultHandler,
2334
      Long timeoutInMillis) {
2335

2336
    getWorkflowExecutionHistory(getRequest, resultHandler, timeoutInMillis);
×
2337
  }
×
2338

2339
  @SuppressWarnings({"unchecked", "FutureReturnValueIgnored"})
2340
  @Override
2341
  public void GetWorkflowExecutionHistory(
2342
      GetWorkflowExecutionHistoryRequest getRequest, AsyncMethodCallback resultHandler) {
2343

2344
    getWorkflowExecutionHistory(getRequest, resultHandler, null);
×
2345
  }
×
2346

2347
  private void getWorkflowExecutionHistory(
2348
      GetWorkflowExecutionHistoryRequest getRequest,
2349
      AsyncMethodCallback resultHandler,
2350
      Long timeoutInMillis) {
2351

2352
    ThriftRequest<WorkflowService.GetWorkflowExecutionHistory_args> request =
×
2353
        buildGetWorkflowExecutionHistoryThriftRequest(getRequest, timeoutInMillis);
×
2354

2355
    CompletableFuture<ThriftResponse<GetWorkflowExecutionHistory_result>> response =
×
2356
        doRemoteCallAsync(request);
×
2357
    response
×
2358
        .whenComplete(
×
2359
            (r, e) -> {
2360
              try {
2361
                if (e != null) {
×
2362
                  resultHandler.onError(CheckedExceptionWrapper.wrap(e));
×
2363
                  return;
×
2364
                }
2365
                WorkflowService.GetWorkflowExecutionHistory_result result =
×
2366
                    r.getBody(WorkflowService.GetWorkflowExecutionHistory_result.class);
×
2367

2368
                if (r.getResponseCode() == ResponseCode.OK) {
×
2369
                  GetWorkflowExecutionHistoryResponse res = result.getSuccess();
×
2370
                  if (res.getRawHistory() != null) {
×
2371
                    History history =
×
2372
                        InternalUtils.DeserializeFromBlobDataToHistory(
×
2373
                            res.getRawHistory(), getRequest.getHistoryEventFilterType());
×
2374
                    res.setHistory(history);
×
2375
                  }
2376
                  resultHandler.onComplete(res);
×
2377
                  return;
×
2378
                }
2379
                if (result.isSetBadRequestError()) {
×
2380
                  resultHandler.onError(result.getBadRequestError());
×
2381
                  return;
×
2382
                }
2383
                if (result.isSetEntityNotExistError()) {
×
2384
                  resultHandler.onError(result.getEntityNotExistError());
×
2385
                  return;
×
2386
                }
2387
                if (result.isSetServiceBusyError()) {
×
2388
                  resultHandler.onError(result.getServiceBusyError());
×
2389
                  return;
×
2390
                }
2391
                resultHandler.onError(
×
2392
                    new TException(
2393
                        "GetWorkflowExecutionHistory failed with unknown " + "error:" + result));
2394
              } catch (TException tException) {
×
2395
                resultHandler.onError(tException);
×
2396
              } finally {
2397
                if (r != null) {
×
2398
                  r.release();
×
2399
                }
2400
              }
2401
            })
×
2402
        .exceptionally(
×
2403
            (e) -> {
2404
              log.error("Unexpected error in GetWorkflowExecutionHistory", e);
×
2405
              return null;
×
2406
            });
2407
  }
×
2408

2409
  @Override
2410
  public void PollForDecisionTask(
2411
      PollForDecisionTaskRequest pollRequest, AsyncMethodCallback resultHandler) throws TException {
2412
    throw new UnsupportedOperationException("not implemented");
×
2413
  }
2414

2415
  @Override
2416
  public void RespondDecisionTaskCompleted(
2417
      RespondDecisionTaskCompletedRequest completeRequest, AsyncMethodCallback resultHandler)
2418
      throws TException {
2419
    throw new UnsupportedOperationException("not implemented");
×
2420
  }
2421

2422
  @Override
2423
  public void RespondDecisionTaskFailed(
2424
      RespondDecisionTaskFailedRequest failedRequest, AsyncMethodCallback resultHandler)
2425
      throws TException {
2426
    throw new UnsupportedOperationException("not implemented");
×
2427
  }
2428

2429
  @Override
2430
  public void PollForActivityTask(
2431
      PollForActivityTaskRequest pollRequest, AsyncMethodCallback resultHandler) throws TException {
2432
    throw new UnsupportedOperationException("not implemented");
×
2433
  }
2434

2435
  @Override
2436
  public void RecordActivityTaskHeartbeat(
2437
      RecordActivityTaskHeartbeatRequest heartbeatRequest, AsyncMethodCallback resultHandler)
2438
      throws TException {
2439
    throw new UnsupportedOperationException("not implemented");
×
2440
  }
2441

2442
  @Override
2443
  public void RecordActivityTaskHeartbeatByID(
2444
      RecordActivityTaskHeartbeatByIDRequest heartbeatRequest, AsyncMethodCallback resultHandler)
2445
      throws TException {
2446
    throw new UnsupportedOperationException("not implemented");
×
2447
  }
2448

2449
  @Override
2450
  public void RespondActivityTaskCompleted(
2451
      RespondActivityTaskCompletedRequest completeRequest, AsyncMethodCallback resultHandler)
2452
      throws TException {
2453
    throw new UnsupportedOperationException("not implemented");
×
2454
  }
2455

2456
  @Override
2457
  public void RespondActivityTaskCompletedByID(
2458
      RespondActivityTaskCompletedByIDRequest completeRequest, AsyncMethodCallback resultHandler)
2459
      throws TException {
2460
    throw new UnsupportedOperationException("not implemented");
×
2461
  }
2462

2463
  @Override
2464
  public void RespondActivityTaskFailed(
2465
      RespondActivityTaskFailedRequest failRequest, AsyncMethodCallback resultHandler)
2466
      throws TException {
2467
    throw new UnsupportedOperationException("not implemented");
×
2468
  }
2469

2470
  @Override
2471
  public void RespondActivityTaskFailedByID(
2472
      RespondActivityTaskFailedByIDRequest failRequest, AsyncMethodCallback resultHandler)
2473
      throws TException {
2474
    throw new UnsupportedOperationException("not implemented");
×
2475
  }
2476

2477
  @Override
2478
  public void RespondActivityTaskCanceled(
2479
      RespondActivityTaskCanceledRequest canceledRequest, AsyncMethodCallback resultHandler)
2480
      throws TException {
2481
    throw new UnsupportedOperationException("not implemented");
×
2482
  }
2483

2484
  @Override
2485
  public void RespondActivityTaskCanceledByID(
2486
      RespondActivityTaskCanceledByIDRequest canceledRequest, AsyncMethodCallback resultHandler)
2487
      throws TException {
2488
    throw new UnsupportedOperationException("not implemented");
×
2489
  }
2490

2491
  @Override
2492
  public void RequestCancelWorkflowExecution(
2493
      RequestCancelWorkflowExecutionRequest cancelRequest, AsyncMethodCallback resultHandler)
2494
      throws TException {
2495
    throw new UnsupportedOperationException("not implemented");
×
2496
  }
2497

2498
  @Override
2499
  public void SignalWorkflowExecution(
2500
      SignalWorkflowExecutionRequest signalRequest, AsyncMethodCallback resultHandler) {
2501
    signalWorkflowExecution(signalRequest, resultHandler, null);
×
2502
  }
×
2503

2504
  @Override
2505
  public void SignalWorkflowExecutionWithTimeout(
2506
      SignalWorkflowExecutionRequest signalRequest,
2507
      AsyncMethodCallback resultHandler,
2508
      Long timeoutInMillis) {
2509
    signalWorkflowExecution(signalRequest, resultHandler, timeoutInMillis);
×
2510
  }
×
2511

2512
  private void signalWorkflowExecution(
2513
      SignalWorkflowExecutionRequest signalRequest,
2514
      AsyncMethodCallback resultHandler,
2515
      Long timeoutInMillis) {
2516

2517
    timeoutInMillis = validateAndUpdateTimeout(timeoutInMillis, options.getRpcTimeoutMillis());
×
2518
    ThriftRequest<WorkflowService.SignalWorkflowExecution_args> request =
×
2519
        buildThriftRequest(
×
2520
            "SignalWorkflowExecution",
2521
            new WorkflowService.SignalWorkflowExecution_args(signalRequest),
2522
            timeoutInMillis);
2523
    CompletableFuture<ThriftResponse<WorkflowService.SignalWorkflowExecution_result>> response =
×
2524
        doRemoteCallAsync(request);
×
2525
    response
×
2526
        .whenComplete(
×
2527
            (r, e) -> {
2528
              try {
2529
                if (e != null) {
×
2530
                  resultHandler.onError(CheckedExceptionWrapper.wrap(e));
×
2531
                  return;
×
2532
                }
2533
                WorkflowService.SignalWorkflowExecution_result result =
×
2534
                    r.getBody(WorkflowService.SignalWorkflowExecution_result.class);
×
2535
                if (r.getResponseCode() == ResponseCode.OK) {
×
2536
                  resultHandler.onComplete(null);
×
2537
                  return;
×
2538
                }
2539
                if (result.isSetBadRequestError()) {
×
2540
                  resultHandler.onError(result.getBadRequestError());
×
2541
                  return;
×
2542
                }
2543
                if (result.isSetEntityNotExistError()) {
×
2544
                  resultHandler.onError(result.getEntityNotExistError());
×
2545
                  return;
×
2546
                }
2547
                if (result.isSetWorkflowExecutionAlreadyCompletedError()) {
×
2548
                  resultHandler.onError(result.getWorkflowExecutionAlreadyCompletedError());
×
2549
                  return;
×
2550
                }
2551
                if (result.isSetServiceBusyError()) {
×
2552
                  resultHandler.onError(result.getServiceBusyError());
×
2553
                  return;
×
2554
                }
2555
                if (result.isSetDomainNotActiveError()) {
×
2556
                  resultHandler.onError(result.getDomainNotActiveError());
×
2557
                  return;
×
2558
                }
2559
                if (result.isSetLimitExceededError()) {
×
2560
                  resultHandler.onError(result.getLimitExceededError());
×
2561
                  return;
×
2562
                }
2563
                if (result.isSetClientVersionNotSupportedError()) {
×
2564
                  resultHandler.onError(result.getClientVersionNotSupportedError());
×
2565
                  return;
×
2566
                }
2567
                resultHandler.onError(
×
2568
                    new TException("SignalWorkflowExecution failed with unknown error:" + result));
2569
              } finally {
2570
                if (r != null) {
×
2571
                  r.release();
×
2572
                }
2573
              }
2574
            })
×
2575
        .exceptionally(
×
2576
            (e) -> {
2577
              log.error("Unexpected error in SignalWorkflowExecution", e);
×
2578
              return null;
×
2579
            });
2580
  }
×
2581

2582
  @Override
2583
  public void SignalWithStartWorkflowExecution(
2584
      SignalWithStartWorkflowExecutionRequest signalWithStartRequest,
2585
      AsyncMethodCallback resultHandler)
2586
      throws TException {
2587
    throw new UnsupportedOperationException("not implemented");
×
2588
  }
2589

2590
  @Override
2591
  public void SignalWithStartWorkflowExecutionAsync(
2592
      SignalWithStartWorkflowExecutionAsyncRequest signalWithStartRequest,
2593
      AsyncMethodCallback resultHandler)
2594
      throws TException {
NEW
2595
    throw new IllegalArgumentException("unimplemented");
×
2596
  }
2597

2598
  @Override
2599
  public void ResetWorkflowExecution(
2600
      ResetWorkflowExecutionRequest resetRequest, AsyncMethodCallback resultHandler)
2601
      throws TException {
2602
    throw new UnsupportedOperationException("not implemented");
×
2603
  }
2604

2605
  @Override
2606
  public void TerminateWorkflowExecution(
2607
      TerminateWorkflowExecutionRequest terminateRequest, AsyncMethodCallback resultHandler)
2608
      throws TException {
2609
    throw new UnsupportedOperationException("not implemented");
×
2610
  }
2611

2612
  @Override
2613
  public void ListOpenWorkflowExecutions(
2614
      ListOpenWorkflowExecutionsRequest listRequest, AsyncMethodCallback resultHandler)
2615
      throws TException {
2616
    throw new UnsupportedOperationException("not implemented");
×
2617
  }
2618

2619
  @Override
2620
  public void ListClosedWorkflowExecutions(
2621
      ListClosedWorkflowExecutionsRequest listRequest, AsyncMethodCallback resultHandler)
2622
      throws TException {
2623
    throw new UnsupportedOperationException("not implemented");
×
2624
  }
2625

2626
  @Override
2627
  public void ListWorkflowExecutions(
2628
      ListWorkflowExecutionsRequest listRequest, AsyncMethodCallback resultHandler)
2629
      throws TException {
2630
    throw new UnsupportedOperationException("not implemented");
×
2631
  }
2632

2633
  @Override
2634
  public void ListArchivedWorkflowExecutions(
2635
      ListArchivedWorkflowExecutionsRequest listRequest, AsyncMethodCallback resultHandler)
2636
      throws TException {
2637
    throw new UnsupportedOperationException("not implemented");
×
2638
  }
2639

2640
  @Override
2641
  public void ScanWorkflowExecutions(
2642
      ListWorkflowExecutionsRequest listRequest, AsyncMethodCallback resultHandler)
2643
      throws TException {
2644
    throw new UnsupportedOperationException("not implemented");
×
2645
  }
2646

2647
  @Override
2648
  public void CountWorkflowExecutions(
2649
      CountWorkflowExecutionsRequest countRequest, AsyncMethodCallback resultHandler)
2650
      throws TException {
2651
    throw new UnsupportedOperationException("not implemented");
×
2652
  }
2653

2654
  @Override
2655
  public void GetSearchAttributes(AsyncMethodCallback resultHandler) throws TException {
2656
    throw new UnsupportedOperationException("not implemented");
×
2657
  }
2658

2659
  @Override
2660
  public void RespondQueryTaskCompleted(
2661
      RespondQueryTaskCompletedRequest completeRequest, AsyncMethodCallback resultHandler)
2662
      throws TException {
2663
    throw new UnsupportedOperationException("not implemented");
×
2664
  }
2665

2666
  @Override
2667
  public void ResetStickyTaskList(
2668
      ResetStickyTaskListRequest resetRequest, AsyncMethodCallback resultHandler)
2669
      throws TException {
2670
    throw new UnsupportedOperationException("not implemented");
×
2671
  }
2672

2673
  @Override
2674
  public void QueryWorkflow(QueryWorkflowRequest queryRequest, AsyncMethodCallback resultHandler)
2675
      throws TException {
2676
    throw new UnsupportedOperationException("not implemented");
×
2677
  }
2678

2679
  @Override
2680
  public void DescribeWorkflowExecution(
2681
      DescribeWorkflowExecutionRequest describeRequest, AsyncMethodCallback resultHandler)
2682
      throws TException {
2683
    throw new UnsupportedOperationException("not implemented");
×
2684
  }
2685

2686
  @Override
2687
  public void DescribeTaskList(DescribeTaskListRequest request, AsyncMethodCallback resultHandler)
2688
      throws TException {
2689
    throw new UnsupportedOperationException("not implemented");
×
2690
  }
2691

2692
  @Override
2693
  public void GetClusterInfo(AsyncMethodCallback resultHandler) throws TException {}
×
2694

2695
  @Override
2696
  public void ListTaskListPartitions(
2697
      ListTaskListPartitionsRequest request, AsyncMethodCallback resultHandler) throws TException {}
×
2698

2699
  @Override
2700
  public void RefreshWorkflowTasks(
2701
      RefreshWorkflowTasksRequest request, AsyncMethodCallback resultHandler) throws TException {}
×
2702

2703
  @Override
2704
  public void RegisterDomain(
2705
      RegisterDomainRequest registerRequest, AsyncMethodCallback resultHandler) throws TException {
2706
    throw new UnsupportedOperationException("not implemented");
×
2707
  }
2708

2709
  @Override
2710
  public void DescribeDomain(
2711
      DescribeDomainRequest describeRequest, AsyncMethodCallback resultHandler) throws TException {
2712
    throw new UnsupportedOperationException("not implemented");
×
2713
  }
2714

2715
  @Override
2716
  public void ListDomains(ListDomainsRequest listRequest, AsyncMethodCallback resultHandler)
2717
      throws TException {
2718
    throw new UnsupportedOperationException("not implemented");
×
2719
  }
2720

2721
  @Override
2722
  public void UpdateDomain(UpdateDomainRequest updateRequest, AsyncMethodCallback resultHandler)
2723
      throws TException {
2724
    throw new UnsupportedOperationException("not implemented");
×
2725
  }
2726

2727
  @Override
2728
  public void DeprecateDomain(
2729
      DeprecateDomainRequest deprecateRequest, AsyncMethodCallback resultHandler)
2730
      throws TException {
2731
    throw new UnsupportedOperationException("not implemented");
×
2732
  }
2733

2734
  @Override
2735
  public void RestartWorkflowExecution(
2736
      RestartWorkflowExecutionRequest restartRequest, AsyncMethodCallback resultHandler)
2737
      throws TException {
NEW
2738
    throw new IllegalArgumentException("unimplemented");
×
2739
  }
2740

2741
  @Override
2742
  public void GetTaskListsByDomain(
2743
      GetTaskListsByDomainRequest request, AsyncMethodCallback resultHandler)
2744
      throws org.apache.thrift.TException {
2745
    throw new UnsupportedOperationException("not implemented");
×
2746
  }
2747
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc