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

temporalio / sdk-java / #174

pending completion
#174

push

github-actions

web-flow
Add schedules API (#1776)

Add schedules API

1143 of 1143 new or added lines in 35 files covered. (100.0%)

18101 of 23284 relevant lines covered (77.74%)

0.78 hits per line

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

0.0
/temporal-sdk/src/main/java/io/temporal/client/schedules/ScheduleClient.java
1
/*
2
 * Copyright (C) 2022 Temporal Technologies, Inc. All Rights Reserved.
3
 *
4
 * Copyright (C) 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
 *
6
 * Modifications copyright (C) 2017 Uber Technologies, Inc.
7
 *
8
 * Licensed under the Apache License, Version 2.0 (the "License");
9
 * you may not use this material except in compliance with the License.
10
 * You may obtain a copy of the License at
11
 *
12
 *   http://www.apache.org/licenses/LICENSE-2.0
13
 *
14
 * Unless required by applicable law or agreed to in writing, software
15
 * distributed under the License is distributed on an "AS IS" BASIS,
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
 * See the License for the specific language governing permissions and
18
 * limitations under the License.
19
 */
20

21
package io.temporal.client.schedules;
22

23
import io.temporal.serviceclient.WorkflowServiceStubs;
24
import java.util.stream.Stream;
25
import javax.annotation.Nullable;
26

27
/**
28
 * Client to the Temporal service used to create, list and get handles to Schedules.
29
 *
30
 * @see ScheduleHandle
31
 */
32
public interface ScheduleClient {
33
  /**
34
   * Creates a client that connects to an instance of the Temporal Service to interact with
35
   * schedules.
36
   *
37
   * @param service client to the Temporal Service endpoint.
38
   * @return client to interact with schedules
39
   */
40
  static ScheduleClient newInstance(WorkflowServiceStubs service) {
41
    return ScheduleClientImpl.newInstance(service, ScheduleClientOptions.getDefaultInstance());
×
42
  }
43

44
  /**
45
   * Creates a client that connects to an instance of the Temporal Service to interact with
46
   * schedules.
47
   *
48
   * @param service client to the Temporal Service endpoint.
49
   * @param options Options (like {@link io.temporal.common.converter.DataConverter}er override) for
50
   *     configuring client.
51
   * @return client to interact with schedules
52
   */
53
  static ScheduleClient newInstance(WorkflowServiceStubs service, ScheduleClientOptions options) {
54
    return ScheduleClientImpl.newInstance(service, options);
×
55
  }
56

57
  /**
58
   * Create a schedule and return its handle.
59
   *
60
   * @param scheduleID Unique ID for the schedule.
61
   * @param schedule Schedule to create.
62
   * @param options Options for creating the schedule.
63
   * @throws ScheduleAlreadyRunningException if the schedule is already runnning.
64
   * @return A handle that can be used to perform operations on a schedule.
65
   */
66
  ScheduleHandle createSchedule(String scheduleID, Schedule schedule, ScheduleOptions options);
67

68
  /**
69
   * Gets the schedule handle for the given ID.
70
   *
71
   * @param scheduleID Schedule ID to get the handle for.
72
   * @return A handle that can be used to perform operations on a schedule.
73
   */
74
  ScheduleHandle getHandle(String scheduleID);
75

76
  /**
77
   * List schedules.
78
   *
79
   * @return sequential stream that performs remote pagination under the hood
80
   */
81
  Stream<ScheduleListDescription> listSchedules();
82

83
  /**
84
   * List schedules.
85
   *
86
   * @param pageSize how many results to fetch from the Server at a time. Default is 100.
87
   * @return sequential stream that performs remote pagination under the hood
88
   */
89
  Stream<ScheduleListDescription> listSchedules(@Nullable Integer pageSize);
90
}
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

© 2025 Coveralls, Inc