Skip to content

Enhancements to RotatingServerAdvice #3027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dturanski opened this issue Aug 13, 2019 · 0 comments · Fixed by #3032
Closed

Enhancements to RotatingServerAdvice #3027

dturanski opened this issue Aug 13, 2019 · 0 comments · Fixed by #3032
Assignees
Milestone

Comments

@dturanski
Copy link
Contributor

Enhancement

Specific issues that depends on this are that the OOTB Sftp Source app uses this class if configured for synchronizing remote files, but uses a parallel implementation for MessageSources that simply list the contents of the remote directory. Additionally, enhancements to the source require exposing the currentDirectory in all multi-source use cases. See spring-attic/sftp#60

  1. RotatingServerAdvice delegates to StandardRotationPolicy which assumes that the MessageSource is one of two types, and downcasts the MessageSource to the appropriate type to perform some specific actions. This should be decoupled from the generic server rotation logic to allow use with other type of message sources.
  2. Expose the currentDirectory()of RotationPolicy so subclasses of RotatingServerAdvice can access it.
@dturanski dturanski self-assigned this Aug 13, 2019
garyrussell pushed a commit that referenced this issue Aug 14, 2019
Fix checkstyle errors

Polishing - wrap code at 120, javadocs at 90; don't use this. on method calls
garyrussell added a commit that referenced this issue Aug 14, 2019
artembilan added a commit to artembilan/spring-integration that referenced this issue Aug 15, 2019
Fixes spring-projects#3027

This is a polishing for PR spring-projects#3029

* Move `KeyDirectory` in to the `RotationPolicy` since it looks like fully
coupled concept with that abstraction and the class name is so bad for
the public API
* Remove `AbstractStandardRotationPolicy` in favor of a `StandardRotationPolicy`
extendability
* Change `ftp.adoc` and `sftp.adoc` to reflect a new API reality
* Mantion these changes in the `whats-new.adoc`
artembilan added a commit that referenced this issue Aug 15, 2019
garyrussell pushed a commit that referenced this issue Aug 15, 2019
Fixes #3027

This is a polishing for PR #3029

* Move `KeyDirectory` in to the `RotationPolicy` since it looks like fully
coupled concept with that abstraction and the class name is so bad for
the public API
* Remove `AbstractStandardRotationPolicy` in favor of a `StandardRotationPolicy`
extendability
* Change `ftp.adoc` and `sftp.adoc` to reflect a new API reality
* Mantion these changes in the `whats-new.adoc`
@artembilan artembilan added this to the 5.2.RC1 milestone Aug 15, 2019
artembilan pushed a commit that referenced this issue Aug 19, 2019
* Implement `RotatingServerAdvice` enhancements

* Update javadocs

* Introduce a new `onRotation()` callback for possible overriding
* Make a default implementation do no throw an exception when 
non-standard `MessageSource` impl is provided.
* Adjust its JavaDocs to describe a behavior
artembilan added a commit that referenced this issue Aug 19, 2019
Related to #3027

* Remove `Assert.isTrue()` from the `onRotation()` to make the behavior
as void in case of non-standard `MessageSource` provided
* Add JavaDocs into `onRotation()` to describe the behavior and
possibility to override
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment