Skip to content

Commit d9f0672

Browse files
MichaelF25artembilan
authored andcommitted
INT-4531: Use Object type KeyDirectory.key
JIRA: https://jira.spring.io/browse/INT-4531 The `DelegatingSessionFactory` uses plain `Object` as key type whereas the default `RotatingServerAdvice` does not. * Change the type from `String` to `Object` in the `RotatingServerAdvice.KeyDirectory` * Fix typos in the (s)ftp.adoc **Cherry-pick to 5.0.x** (cherry picked from commit 5bfd697)
1 parent 35bb705 commit d9f0672

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

spring-integration-file/src/main/java/org/springframework/integration/file/remote/aop/RotatingServerAdvice.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
* A smart poller advice that rotates across multiple remote servers/directories.
3636
*
3737
* @author Gary Russell
38+
* @author Michael Forstner
3839
*
3940
* @since 5.0.7
4041
*
@@ -196,9 +197,9 @@ public void afterReceive(boolean messageReceived, MessageSource<?> source) {
196197

197198
protected void configureSource(MessageSource<?> source) {
198199
Assert.isTrue(source instanceof AbstractInboundFileSynchronizingMessageSource
199-
|| source instanceof AbstractRemoteFileStreamingMessageSource,
200-
"source must be an AbstractInboundFileSynchronizingMessageSource or a "
201-
+ "AbstractRemoteFileStreamingMessageSource");
200+
|| source instanceof AbstractRemoteFileStreamingMessageSource,
201+
"source must be an AbstractInboundFileSynchronizingMessageSource or a "
202+
+ "AbstractRemoteFileStreamingMessageSource");
202203
if (!this.iterator.hasNext()) {
203204
this.iterator = this.keyDirectories.iterator();
204205
}
@@ -208,7 +209,7 @@ protected void configureSource(MessageSource<?> source) {
208209
}
209210
else {
210211
((AbstractInboundFileSynchronizingMessageSource<?>) source).getSynchronizer()
211-
.setRemoteDirectory(this.current.getDirectory());
212+
.setRemoteDirectory(this.current.getDirectory());
212213
}
213214
}
214215

@@ -219,18 +220,18 @@ protected void configureSource(MessageSource<?> source) {
219220
*/
220221
public static class KeyDirectory {
221222

222-
private final String key;
223+
private final Object key;
223224

224225
private final String directory;
225226

226-
public KeyDirectory(String key, String directory) {
227+
public KeyDirectory(Object key, String directory) {
227228
Assert.notNull(key, "key cannot be null");
228229
Assert.notNull(directory, "directory cannot be null");
229230
this.key = key;
230231
this.directory = directory;
231232
}
232233

233-
public String getKey() {
234+
public Object getKey() {
234235
return this.key;
235236
}
236237

@@ -240,7 +241,7 @@ public String getDirectory() {
240241

241242
@Override
242243
public String toString() {
243-
return "KeyDirectory [key=" + this.key + ", directory=" + this.directory + "]";
244+
return "KeyDirectory [key=" + this.key.toString() + ", directory=" + this.directory + "]";
244245
}
245246

246247
}

src/reference/asciidoc/ftp.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ Convenience methods have been added so this can easily be done from a message fl
224224
IMPORTANT: When using session caching (see <<ftp-session-caching>>), each of the delegates should be cached; you
225225
cannot cache the `DelegatingSessionFactory` itself.
226226

227-
Starting with _version 5.0.7_, the `DelegatingSessionFactory` can be used in conjuction with a `RotatingServerAdvice` to poll multiple servers; see <<ftp-rotating-server-advice>>.
227+
Starting with _version 5.0.7_, the `DelegatingSessionFactory` can be used in conjunction with a `RotatingServerAdvice` to poll multiple servers; see <<ftp-rotating-server-advice>>.
228228

229229
[[ftp-inbound]]
230230
=== FTP Inbound Channel Adapter

src/reference/asciidoc/sftp.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Convenience methods have been added so this can easily be done from a message fl
239239
IMPORTANT: When using session caching (see <<sftp-session-caching>>), each of the delegates should be cached; you
240240
cannot cache the `DelegatingSessionFactory` itself.
241241

242-
Starting with _version 5.0.7_, the `DelegatingSessionFactory` can be used in conjuction with a `RotatingServerAdvice` to poll multiple servers; see <<sftp-rotating-server-advice>>.
242+
Starting with _version 5.0.7_, the `DelegatingSessionFactory` can be used in conjunction with a `RotatingServerAdvice` to poll multiple servers; see <<sftp-rotating-server-advice>>.
243243

244244
[[sftp-session-caching]]
245245
=== SFTP Session Caching

0 commit comments

Comments
 (0)