Skip to content

Commit 3c0927e

Browse files
authored
GH-8585: Add Javadocs to Pollers & PollerFactory (#8621)
* GH-8585: Add Javadocs to Pollers & PollerFactory Fixes #8585 * * Fix Javadoc tags order * * One more Javadoc tags order
1 parent 396f5fb commit 3c0927e

File tree

2 files changed

+262
-10
lines changed

2 files changed

+262
-10
lines changed

spring-integration-core/src/main/java/org/springframework/integration/dsl/PollerFactory.java

Lines changed: 134 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,52 +38,183 @@
3838
*/
3939
public final class PollerFactory {
4040

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+
*/
4147
public PollerSpec trigger(Trigger trigger) {
4248
return Pollers.trigger(trigger);
4349
}
4450

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+
*/
4557
public PollerSpec cron(String cronExpression) {
4658
return Pollers.cron(cronExpression);
4759
}
4860

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+
*/
4968
public PollerSpec cron(String cronExpression, TimeZone timeZone) {
5069
return Pollers.cron(cronExpression, timeZone);
5170
}
5271

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+
*/
5378
public PollerSpec fixedRate(long period) {
5479
return Pollers.fixedRate(period);
5580
}
5681

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)
5791
public PollerSpec fixedRate(long period, TimeUnit timeUnit) {
5892
return Pollers.fixedRate(Duration.of(period, timeUnit.toChronoUnit()));
5993
}
6094

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+
*/
61113
public PollerSpec fixedRate(long period, long initialDelay) {
62114
return Pollers.fixedRate(period, initialDelay);
63115
}
64116

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);
68127
}
69128

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)
70140
public PollerSpec fixedRate(long period, TimeUnit timeUnit, long initialDelay) {
71141
ChronoUnit chronoUnit = timeUnit.toChronoUnit();
72142
return Pollers.fixedRate(Duration.of(period, chronoUnit), Duration.of(initialDelay, chronoUnit));
73143
}
74144

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)
75170
public PollerSpec fixedDelay(long period, TimeUnit timeUnit) {
76171
return Pollers.fixedDelay(Duration.of(period, timeUnit.toChronoUnit()));
77172
}
78173

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+
*/
79181
public PollerSpec fixedDelay(long period, long initialDelay) {
80182
return Pollers.fixedDelay(period, initialDelay);
81183
}
82184

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+
*/
83191
public PollerSpec fixedDelay(long period) {
84192
return Pollers.fixedDelay(period);
85193
}
86194

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+
87218
PollerFactory() {
88219
}
89220

0 commit comments

Comments
 (0)