• 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/ScheduleInfo.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 java.time.Instant;
24
import java.util.List;
25
import java.util.Objects;
26
import javax.annotation.Nullable;
27

28
/** Information about a schedule. */
29
public final class ScheduleInfo {
30
  private final long numActions;
31
  private final long numActionsMissedCatchupWindow;
32
  private final long numActionsSkippedOverlap;
33
  private final List<ScheduleActionExecution> runningActions;
34
  private final List<ScheduleActionResult> recentActions;
35
  private final List<Instant> nextActionTimes;
36
  private final Instant createdAt;
37
  private final Instant lastUpdatedAt;
38

39
  public ScheduleInfo(
40
      long numActions,
41
      long numActionsMissedCatchupWindow,
42
      long numActionsSkippedOverlap,
43
      List<ScheduleActionExecution> runningActions,
44
      List<ScheduleActionResult> recentActions,
45
      List<Instant> nextActionTimes,
46
      Instant createdAt,
47
      Instant lastUpdatedAt) {
×
48
    this.numActions = numActions;
×
49
    this.numActionsMissedCatchupWindow = numActionsMissedCatchupWindow;
×
50
    this.numActionsSkippedOverlap = numActionsSkippedOverlap;
×
51
    this.runningActions = runningActions;
×
52
    this.recentActions = recentActions;
×
53
    this.nextActionTimes = nextActionTimes;
×
54
    this.createdAt = createdAt;
×
55
    this.lastUpdatedAt = lastUpdatedAt;
×
56
  }
×
57

58
  /**
59
   * Get the number of actions taken by the schedule.
60
   *
61
   * @return number of actions taken
62
   */
63
  public long getNumActions() {
64
    return numActions;
×
65
  }
66

67
  /**
68
   * Get the number of actions skipped due to missing the catchup window.
69
   *
70
   * @return number of actions skipped due to catchup window
71
   */
72
  public long getNumActionsMissedCatchupWindow() {
73
    return numActionsMissedCatchupWindow;
×
74
  }
75

76
  /**
77
   * Get the number of actions skipped due to overlap.
78
   *
79
   * @return number of actions skipped due to overlap
80
   */
81
  public long getNumActionsSkippedOverlap() {
82
    return numActionsSkippedOverlap;
×
83
  }
84

85
  /**
86
   * Get a list of currently running actions.
87
   *
88
   * @return list of currently running actions
89
   */
90
  public List<ScheduleActionExecution> getRunningActions() {
91
    return runningActions;
×
92
  }
93

94
  /**
95
   * Get a list of the most recent actions, oldest first.
96
   *
97
   * @return list of the most recent actions
98
   */
99
  public List<ScheduleActionResult> getRecentActions() {
100
    return recentActions;
×
101
  }
102

103
  /**
104
   * Get a list of the next scheduled action times.
105
   *
106
   * @return list of the next recent times
107
   */
108
  public List<Instant> getNextActionTimes() {
109
    return nextActionTimes;
×
110
  }
111

112
  /**
113
   * Get the time the schedule was created at.
114
   *
115
   * @return time the schedule was created
116
   */
117
  public Instant getCreatedAt() {
118
    return createdAt;
×
119
  }
120

121
  /**
122
   * Get the last time the schedule was updated.
123
   *
124
   * @return last time the schedule was updated
125
   */
126
  @Nullable
127
  public Instant getLastUpdatedAt() {
128
    return lastUpdatedAt;
×
129
  }
130

131
  @Override
132
  public boolean equals(Object o) {
133
    if (this == o) return true;
×
134
    if (o == null || getClass() != o.getClass()) return false;
×
135
    ScheduleInfo that = (ScheduleInfo) o;
×
136
    return numActions == that.numActions
×
137
        && numActionsMissedCatchupWindow == that.numActionsMissedCatchupWindow
138
        && numActionsSkippedOverlap == that.numActionsSkippedOverlap
139
        && Objects.equals(runningActions, that.runningActions)
×
140
        && Objects.equals(recentActions, that.recentActions)
×
141
        && Objects.equals(nextActionTimes, that.nextActionTimes)
×
142
        && Objects.equals(createdAt, that.createdAt)
×
143
        && Objects.equals(lastUpdatedAt, that.lastUpdatedAt);
×
144
  }
145

146
  @Override
147
  public int hashCode() {
148
    return Objects.hash(
×
149
        numActions,
×
150
        numActionsMissedCatchupWindow,
×
151
        numActionsSkippedOverlap,
×
152
        runningActions,
153
        recentActions,
154
        nextActionTimes,
155
        createdAt,
156
        lastUpdatedAt);
157
  }
158

159
  @Override
160
  public String toString() {
161
    return "ScheduleInfo{"
×
162
        + "numActions="
163
        + numActions
164
        + ", numActionsMissedCatchupWindow="
165
        + numActionsMissedCatchupWindow
166
        + ", numActionsSkippedOverlap="
167
        + numActionsSkippedOverlap
168
        + ", runningActions="
169
        + runningActions
170
        + ", recentActions="
171
        + recentActions
172
        + ", nextActionTimes="
173
        + nextActionTimes
174
        + ", createdAt="
175
        + createdAt
176
        + ", lastUpdatedAt="
177
        + lastUpdatedAt
178
        + '}';
179
  }
180
}
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