|
38 | 38 | */
|
39 | 39 | public final class PollerFactory {
|
40 | 40 |
|
| 41 | + /** |
| 42 | + * Create a {@link PollerSpec} based on the provided {@link Trigger}. |
| 43 | + * @param trigger the {@link Trigger} to use. |
| 44 | + * @return the {@link PollerSpec} |
| 45 | + * @see Pollers#trigger(Trigger) |
| 46 | + */ |
41 | 47 | public PollerSpec trigger(Trigger trigger) {
|
42 | 48 | return Pollers.trigger(trigger);
|
43 | 49 | }
|
44 | 50 |
|
| 51 | + /** |
| 52 | + * Create a {@link PollerSpec} based on the provided cron expression. |
| 53 | + * @param cronExpression the cron to use. |
| 54 | + * @return the {@link PollerSpec} |
| 55 | + * @see Pollers#cron(String) |
| 56 | + */ |
45 | 57 | public PollerSpec cron(String cronExpression) {
|
46 | 58 | return Pollers.cron(cronExpression);
|
47 | 59 | }
|
48 | 60 |
|
| 61 | + /** |
| 62 | + * Create a {@link PollerSpec} based on the provided cron expression and {@link TimeZone}. |
| 63 | + * @param cronExpression the cron to use. |
| 64 | + * @param timeZone the {@link TimeZone} to use. |
| 65 | + * @return the {@link PollerSpec} |
| 66 | + * @see Pollers#cron(String, TimeZone) |
| 67 | + */ |
49 | 68 | public PollerSpec cron(String cronExpression, TimeZone timeZone) {
|
50 | 69 | return Pollers.cron(cronExpression, timeZone);
|
51 | 70 | }
|
52 | 71 |
|
| 72 | + /** |
| 73 | + * Create a {@link PollerSpec} based on the provided fixed rate period. |
| 74 | + * @param period the fixed rate period to use. |
| 75 | + * @return the {@link PollerSpec} |
| 76 | + * @see Pollers#fixedRate(long) |
| 77 | + */ |
53 | 78 | public PollerSpec fixedRate(long period) {
|
54 | 79 | return Pollers.fixedRate(period);
|
55 | 80 | }
|
56 | 81 |
|
| 82 | + /** |
| 83 | + * Create a {@link PollerSpec} based on the provided fixed rate period and {@link TimeUnit}. |
| 84 | + * @param period the fixed rate period to use. |
| 85 | + * @param timeUnit the {@link TimeUnit} to use. |
| 86 | + * @return the {@link PollerSpec} |
| 87 | + * @deprecated since 6.1 in favor of {@link #fixedRate(Duration)} |
| 88 | + * @see Pollers#fixedRate(Duration) |
| 89 | + */ |
| 90 | + @Deprecated(forRemoval = true) |
57 | 91 | public PollerSpec fixedRate(long period, TimeUnit timeUnit) {
|
58 | 92 | return Pollers.fixedRate(Duration.of(period, timeUnit.toChronoUnit()));
|
59 | 93 | }
|
60 | 94 |
|
| 95 | + /** |
| 96 | + * Create a {@link PollerSpec} based on the provided fixed rate period. |
| 97 | + * @param period the fixed rate period to use. |
| 98 | + * @return the {@link PollerSpec} |
| 99 | + * @since 6.1 |
| 100 | + * @see Pollers#fixedRate(Duration) |
| 101 | + */ |
| 102 | + public static PollerSpec fixedRate(Duration period) { |
| 103 | + return Pollers.fixedRate(period); |
| 104 | + } |
| 105 | + |
| 106 | + /** |
| 107 | + * Create a {@link PollerSpec} based on the provided fixed rate period and initial delay. |
| 108 | + * @param period the fixed rate period (in milliseconds) to use. |
| 109 | + * @param initialDelay the initial delay (in milliseconds) to use. |
| 110 | + * @return the {@link PollerSpec} |
| 111 | + * @see Pollers#fixedRate(long, long) |
| 112 | + */ |
61 | 113 | public PollerSpec fixedRate(long period, long initialDelay) {
|
62 | 114 | return Pollers.fixedRate(period, initialDelay);
|
63 | 115 | }
|
64 | 116 |
|
65 |
| - public PollerSpec fixedDelay(long period, TimeUnit timeUnit, long initialDelay) { |
66 |
| - ChronoUnit chronoUnit = timeUnit.toChronoUnit(); |
67 |
| - return Pollers.fixedDelay(Duration.of(period, chronoUnit), Duration.of(initialDelay, chronoUnit)); |
| 117 | + /** |
| 118 | + * Create a {@link PollerSpec} based on the provided fixed rate period and initial delay . |
| 119 | + * @param period the fixed rate period to use. |
| 120 | + * @param initialDelay the initial delay to use. |
| 121 | + * @return the {@link PollerSpec} |
| 122 | + * @since 6.1 |
| 123 | + * @see Pollers#fixedRate(Duration) |
| 124 | + */ |
| 125 | + public static PollerSpec fixedRate(Duration period, Duration initialDelay) { |
| 126 | + return Pollers.fixedRate(period, initialDelay); |
68 | 127 | }
|
69 | 128 |
|
| 129 | + /** |
| 130 | + * Create a {@link PollerSpec} based on the provided fixed rate period and {@link TimeUnit} |
| 131 | + * with an initial delay. |
| 132 | + * @param period the fixed rate period to use. |
| 133 | + * @param timeUnit the {@link TimeUnit} to use. |
| 134 | + * @param initialDelay the initial delay to use. |
| 135 | + * @return the {@link PollerSpec} |
| 136 | + * @deprecated since 6.1 in favor of {@link #fixedRate(Duration, Duration)} |
| 137 | + * @see Pollers#fixedRate(Duration, Duration) |
| 138 | + */ |
| 139 | + @Deprecated(forRemoval = true) |
70 | 140 | public PollerSpec fixedRate(long period, TimeUnit timeUnit, long initialDelay) {
|
71 | 141 | ChronoUnit chronoUnit = timeUnit.toChronoUnit();
|
72 | 142 | return Pollers.fixedRate(Duration.of(period, chronoUnit), Duration.of(initialDelay, chronoUnit));
|
73 | 143 | }
|
74 | 144 |
|
| 145 | + /** |
| 146 | + * Create a {@link PollerSpec} based on the provided fixed delay period and {@link TimeUnit} |
| 147 | + * with an initial delay. |
| 148 | + * @param period the fixed delay period to use. |
| 149 | + * @param timeUnit the {@link TimeUnit} to use. |
| 150 | + * @param initialDelay the initial delay to use. |
| 151 | + * @return the {@link PollerSpec} |
| 152 | + * @deprecated since 6.1 in favor of {@link #fixedDelay(Duration, Duration)} |
| 153 | + * @see Pollers#fixedDelay(Duration, Duration) |
| 154 | + */ |
| 155 | + @Deprecated(forRemoval = true) |
| 156 | + public PollerSpec fixedDelay(long period, TimeUnit timeUnit, long initialDelay) { |
| 157 | + ChronoUnit chronoUnit = timeUnit.toChronoUnit(); |
| 158 | + return Pollers.fixedDelay(Duration.of(period, chronoUnit), Duration.of(initialDelay, chronoUnit)); |
| 159 | + } |
| 160 | + |
| 161 | + /** |
| 162 | + * Create a {@link PollerSpec} based on the provided fixed delay period and {@link TimeUnit}. |
| 163 | + * @param period the fixed delay period to use. |
| 164 | + * @param timeUnit the {@link TimeUnit} to use. |
| 165 | + * @return the {@link PollerSpec} |
| 166 | + * @deprecated since 6.1 in favor of {@link #fixedDelay(Duration)} |
| 167 | + * @see Pollers#fixedDelay(Duration) |
| 168 | + */ |
| 169 | + @Deprecated(forRemoval = true) |
75 | 170 | public PollerSpec fixedDelay(long period, TimeUnit timeUnit) {
|
76 | 171 | return Pollers.fixedDelay(Duration.of(period, timeUnit.toChronoUnit()));
|
77 | 172 | }
|
78 | 173 |
|
| 174 | + /** |
| 175 | + * Create a {@link PollerSpec} based on the provided fixed delay period and initial delay. |
| 176 | + * @param period the fixed delay period (in milliseconds) to use. |
| 177 | + * @param initialDelay the initial delay (in milliseconds) to use. |
| 178 | + * @return the {@link PollerSpec} |
| 179 | + * @see Pollers#fixedDelay(long, long) |
| 180 | + */ |
79 | 181 | public PollerSpec fixedDelay(long period, long initialDelay) {
|
80 | 182 | return Pollers.fixedDelay(period, initialDelay);
|
81 | 183 | }
|
82 | 184 |
|
| 185 | + /** |
| 186 | + * Create a {@link PollerSpec} based on the provided fixed delay period. |
| 187 | + * @param period the fixed delay period to use. |
| 188 | + * @return the {@link PollerSpec} |
| 189 | + * @see Pollers#fixedDelay(long) |
| 190 | + */ |
83 | 191 | public PollerSpec fixedDelay(long period) {
|
84 | 192 | return Pollers.fixedDelay(period);
|
85 | 193 | }
|
86 | 194 |
|
| 195 | + /** |
| 196 | + * Create a {@link PollerSpec} based on the provided fixed delay period. |
| 197 | + * @param period the fixed delay period to use. |
| 198 | + * @return the {@link PollerSpec} |
| 199 | + * @since 6.1 |
| 200 | + * @see Pollers#fixedDelay(Duration) |
| 201 | + */ |
| 202 | + public static PollerSpec fixedDelay(Duration period) { |
| 203 | + return Pollers.fixedDelay(period); |
| 204 | + } |
| 205 | + |
| 206 | + /** |
| 207 | + * Create a {@link PollerSpec} based on the provided fixed delay period and initial delay . |
| 208 | + * @param period the fixed delay period to use. |
| 209 | + * @param initialDelay the initial delay to use. |
| 210 | + * @return the {@link PollerSpec} |
| 211 | + * @since 6.1 |
| 212 | + * @see Pollers#fixedDelay(Duration) |
| 213 | + */ |
| 214 | + public static PollerSpec fixedDelay(Duration period, Duration initialDelay) { |
| 215 | + return Pollers.fixedDelay(period, initialDelay); |
| 216 | + } |
| 217 | + |
87 | 218 | PollerFactory() {
|
88 | 219 | }
|
89 | 220 |
|
|
0 commit comments