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

temporalio / sdk-java / #292

31 Jul 2024 04:22PM UTC coverage: 77.571% (-0.005%) from 77.576%
#292

push

github

web-flow
Add support for query in listSchedules (#2163)

0 of 16 new or added lines in 4 files covered. (0.0%)

1 existing line in 1 file now uncovered.

19724 of 25427 relevant lines covered (77.57%)

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/common/interceptors/ScheduleClientCallsInterceptor.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.common.interceptors;
22

23
import io.temporal.api.enums.v1.ScheduleOverlapPolicy;
24
import io.temporal.client.schedules.*;
25
import io.temporal.common.Experimental;
26
import io.temporal.workflow.Functions;
27
import java.util.List;
28
import java.util.stream.Stream;
29

30
/**
31
 * Intercepts calls to the {@link io.temporal.client.schedules.ScheduleClient} and {@link
32
 * io.temporal.client.schedules.ScheduleHandle} related to the lifecycle of a Schedule.
33
 *
34
 * <p>Prefer extending {@link ScheduleClientCallsInterceptorBase} and override only the methods you
35
 * need instead of implementing this interface directly. {@link ScheduleClientCallsInterceptor}
36
 * provides correct default implementations to all the methods of this interface.
37
 */
38
@Experimental
39
public interface ScheduleClientCallsInterceptor {
40

41
  void createSchedule(CreateScheduleInput input);
42

43
  ListScheduleOutput listSchedules(ListSchedulesInput input);
44

45
  void backfillSchedule(BackfillScheduleInput input);
46

47
  void deleteSchedule(DeleteScheduleInput input);
48

49
  DescribeScheduleOutput describeSchedule(DescribeScheduleInput input);
50

51
  void pauseSchedule(PauseScheduleInput input);
52

53
  void triggerSchedule(TriggerScheduleInput input);
54

55
  void unpauseSchedule(UnpauseScheduleInput input);
56

57
  void updateSchedule(UpdateScheduleInput input);
58

59
  class CreateScheduleInput {
60
    private final String Id;
61
    private final Schedule schedule;
62
    private final ScheduleOptions options;
63

64
    public CreateScheduleInput(String id, Schedule schedule, ScheduleOptions options) {
×
65
      Id = id;
×
66
      this.schedule = schedule;
×
67
      this.options = options;
×
68
    }
×
69

70
    public String getId() {
71
      return Id;
×
72
    }
73

74
    public Schedule getSchedule() {
75
      return schedule;
×
76
    }
77

78
    public ScheduleOptions getOptions() {
79
      return options;
×
80
    }
81
  }
82

83
  class ListSchedulesInput {
84
    private final String query;
85
    private final int pageSize;
86

NEW
87
    public ListSchedulesInput(String query, int pageSize) {
×
NEW
88
      this.query = query;
×
89
      this.pageSize = pageSize;
×
90
    }
×
91

92
    public int getPageSize() {
93
      return pageSize;
×
94
    }
95

96
    public String getQuery() {
NEW
97
      return query;
×
98
    }
99
  }
100

101
  class ListScheduleOutput {
102
    public Stream<ScheduleListDescription> getStream() {
103
      return stream;
×
104
    }
105

106
    private final Stream<ScheduleListDescription> stream;
107

108
    public ListScheduleOutput(Stream<ScheduleListDescription> stream) {
×
109
      this.stream = stream;
×
110
    }
×
111
  }
112

113
  class BackfillScheduleInput {
114
    private final String scheduleId;
115

116
    public String getScheduleId() {
117
      return scheduleId;
×
118
    }
119

120
    public List<ScheduleBackfill> getBackfills() {
121
      return backfills;
×
122
    }
123

124
    private final List<ScheduleBackfill> backfills;
125

126
    public BackfillScheduleInput(String scheduleId, List<ScheduleBackfill> backfills) {
×
127
      this.scheduleId = scheduleId;
×
128
      this.backfills = backfills;
×
129
    }
×
130
  }
131

132
  class DeleteScheduleInput {
133
    public String getScheduleId() {
134
      return scheduleId;
×
135
    }
136

137
    private final String scheduleId;
138

139
    public DeleteScheduleInput(String scheduleId) {
×
140
      this.scheduleId = scheduleId;
×
141
    }
×
142
  }
143

144
  class DescribeScheduleInput {
145
    public String getScheduleId() {
146
      return scheduleId;
×
147
    }
148

149
    private final String scheduleId;
150

151
    public DescribeScheduleInput(String scheduleId) {
×
152
      this.scheduleId = scheduleId;
×
153
    }
×
154
  }
155

156
  class DescribeScheduleOutput {
157
    private final ScheduleDescription description;
158

159
    public DescribeScheduleOutput(ScheduleDescription description) {
×
160
      this.description = description;
×
161
    }
×
162

163
    public ScheduleDescription getDescription() {
164
      return description;
×
165
    }
166
  }
167

168
  class PauseScheduleInput {
169
    public String getScheduleId() {
170
      return scheduleId;
×
171
    }
172

173
    public String getNote() {
174
      return note;
×
175
    }
176

177
    private final String scheduleId;
178
    private final String note;
179

180
    public PauseScheduleInput(String scheduleId, String note) {
×
181
      this.scheduleId = scheduleId;
×
182
      this.note = note;
×
183
    }
×
184
  }
185

186
  class TriggerScheduleInput {
187
    private final String scheduleId;
188
    private final ScheduleOverlapPolicy overlapPolicy;
189

190
    public String getScheduleId() {
191
      return scheduleId;
×
192
    }
193

194
    public ScheduleOverlapPolicy getOverlapPolicy() {
195
      return overlapPolicy;
×
196
    }
197

198
    public TriggerScheduleInput(String scheduleId, ScheduleOverlapPolicy overlapPolicy) {
×
199
      this.scheduleId = scheduleId;
×
200
      this.overlapPolicy = overlapPolicy;
×
201
    }
×
202
  }
203

204
  class UnpauseScheduleInput {
205
    public String getScheduleId() {
206
      return scheduleId;
×
207
    }
208

209
    public String getNote() {
210
      return note;
×
211
    }
212

213
    private final String scheduleId;
214
    private final String note;
215

216
    public UnpauseScheduleInput(String scheduleId, String note) {
×
217
      this.scheduleId = scheduleId;
×
218
      this.note = note;
×
219
    }
×
220
  }
221

222
  class UpdateScheduleInput {
223
    public ScheduleDescription getDescription() {
224
      return description;
×
225
    }
226

227
    public Functions.Func1<ScheduleUpdateInput, ScheduleUpdate> getUpdater() {
228
      return updater;
×
229
    }
230

231
    private final ScheduleDescription description;
232
    private final Functions.Func1<ScheduleUpdateInput, ScheduleUpdate> updater;
233

234
    public UpdateScheduleInput(
235
        ScheduleDescription description,
236
        Functions.Func1<ScheduleUpdateInput, ScheduleUpdate> updater) {
×
237
      this.description = description;
×
238
      this.updater = updater;
×
239
    }
×
240
  }
241
}
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