Commit Graph

404 Commits

Author SHA1 Message Date
Gary Russell
f3d61ec44a GH-3315: Fix (S)FTP Stream with Fair Rotation
Resolves https://github.com/spring-projects/spring-integration/issues/3315

`maxFetchSize` ignored with filters supporting single file filtering (default).
This breaks "fair" rotation with the `RotatingServerAdvice`.

Honor `maxFetchSize`, even with filters that support single file filtering.

**cherry-pick to 5.3.x, 5.2.x**
2020-07-01 15:47:35 -04:00
Artem Bilan
498f42d480 Fix deprecations from SF
* Remove `whitelist` words
* Resolve Sonar smells
* Add `await()` for FTP file removal test: looks like this operation may fail under the stress build
2020-06-19 12:07:58 -04:00
DEEPAK GUNASEKARAN
7cefd53e10 GH-3092: Refactor (S)FTP outbound specs, handlers
Fixes https://github.com/spring-projects/spring-integration/issues/3092
2020-06-15 16:27:24 -04:00
Gary Russell
42845f03f3 Convert (S)FTP Tests to JUnit5
* Fix SftpTestServer for latest RemoteFileTestSupport changes.
2020-05-18 14:27:45 -04:00
Artem Bilan
6d5690fd58 GH-2996: Add Resource for remote file transfer (#3231)
* GH-2996: Add Resource for remote file transfer

Fixes https://github.com/spring-projects/spring-integration/issues/2996

* Fix `RemoteFileTemplate.send()` to support a `Resource` payload
for remote file transferring content
* Code style clean up for `RemoteFileTemplate`
* Remove `volatile` for configuration properties for better performance
* Change a `charset` to the `Charset` for only once conversion from string
during configuration phase
* Fix (S)FTP tests for new functionality
* Change affected tests to JUnit 5
* Document a new feature; mention all the supported types and `FileExistsMode` constants

* * Fix language in `whats-new.adoc`
2020-03-31 16:09:07 -04:00
Gary Russell
1ff69d4d24 GH-3175: Add .scanner() to inbound file sync spec
Resolves https://github.com/spring-projects/spring-integration/issues/3175

* Fix `@since` for backport

**Cherry-pick to `5.2.x`**
2020-02-11 12:57:26 -05:00
Artem Bilan
ede9528c19 Fix some tests for not closed application context 2020-02-11 12:43:33 -05:00
Artem Bilan
aeab030104 GH-3168: Fix FtpSession warning on logout
Fixes https://github.com/spring-projects/spring-integration/issues/3168

* Call `this.client.noop()` instead of `this.client.isConnected()` to really
check that client has a live connection with the server before calling a `this.client.logout()`
* Wrap `this.client.logout()` into a `try..catch` to be sure that we wil call a
`this.client.disconnect()` even if `logout()` fails for some reason.
* Change `WARN` logs about `Session.close()` into a `DEBUG` level -
when we have a problem with closing session because of server disconnect reason
we have no any control to do with a situation

**Cherry-pick to 5.2.x**
2020-02-11 12:06:05 -05:00
Artem Bilan
867a8cf108 GH-3155: Add support for Java DSL extensions (#3167)
* GH-3155: Add support for Java DSL extensions

Fixes https://github.com/spring-projects/spring-integration/issues/3155

Provide an `IntegrationFlowExtension` for possible custom EI-operators
in the target project use-cases.

* * Move `IntegrationFlowExtension` tests ot its own test class
* Make all the `IntegrationComponentSpec` ctors as `protected` for possible custom extensions
* Make some `BaseIntegrationFlowDefinition` methods and properties as `protected` to get them
access from the `IntegrationFlowExtension` implementations
* Document the feature

* * Fix language and typos in docs

* * Add `protected` to one more `GatewayEndpointSpec` ctor
* Add JavaDocs to `GatewayEndpointSpec` methods

* * Add `protected` to one more `JmsPollableMessageChannelSpec` ctor
2020-02-07 13:40:39 -05:00
Artem Bilan
5ac262f866 GH-3132: Remove usage of super();
Fixes https://github.com/spring-projects/spring-integration/issues/3132

It turns out that Checkstyle EmptyBlock doesn't complain about
empty default ctor.
Plus a new check for `super();` call treats it as a violation

* Remove `super();` from all the no-arg ctors
* Code style clean up in the affected classes according
IDEA suggestions

* Fix new Sonar smells
2019-12-27 15:13:00 -05:00
Artem Bilan
9dc3519f20 Start version 5.3
* Move `What's New` into `changes-5.1-5.2.adoc`
* Remove version from the `XSD` files:
 1. Align with SF
 2. The version for XSD doesn't matter for the current jar version,
 since only the version is available in classpath is from the current
 jar version
 3. Modify `spring.schemas` to map all the possible versions for XSD
 into the current one in a jar.
 This way target applications can upgrade without changing the version
 for XSD location and we don't need to require `versionless` variant
 any more
 4. The jar in classpath can handle only its own XSD, so independently
 of version or no-version variants we still may fail because the current
 jar may not support end-user code any more - need some fix over there
 anyway.
* Remove `checkTestConfigs` Gradle task since we don't worry about XSD
version any more
* Modify `schemaZip` Gradle task to populate XSDs into a distribution
still with a version to avoid overriding on-line XSDs for version `1.0.x`.
We may consider not do that since SF doesn't and just bite a bullet
for always overriding those on-line XSDs to the actual one from the latest
release.
2019-12-26 15:41:19 -05:00
div
c6358a93d4 GH-3123: Don't logout FtpSession if not connected
Fixes https://github.com/spring-projects/spring-integration/issues/3123
2019-12-20 12:14:45 -05:00
Artem Bilan
977997e3bf GH-3090: Add logout() to FtpSession.close()` (#3094)
* GH-3090: Add `logout() to `FtpSession.close()`

Fixes https://github.com/spring-projects/spring-integration/issues/3090

Without `logout()` the FTP session is not closed at all,
but just the connection is closed.
Some FTP servers close those sessions eventually anyway, but some just
leak with resources.

**Cherry-pick to 5.1.x & 4.3.x**

* * Migrate `SessionFactoryTests` to JUnit 5
2019-10-30 15:41:42 -04:00
Joaquin Santana
7aea76c6c4 GH-3026: Fix chmod support for DSL
Fixes https://github.com/spring-projects/spring-integration/issues/3026

**Cherry-pick to `5.1.x`**

* Populate proper `FileTransferringMessageHandler` impl from DSL spec
implementations.
This way we are able to use a provided `chmod` from Java DSL
* Added `FileTransferringMessageHandlerSpec` ctor TODO
* Update SftpTests
* Code cleanup; `@Ignore` `SftpTests.testSftpOutboundFlowWithChmod()`
since it doesn't work properly on Windows
2019-10-29 15:20:08 -04:00
Gary Russell
3e30625ac9 Fix FtpServerOutboundTests.allEvents test
Spurious events captured from other tests.
Only capture events for the test's session.
2019-09-13 16:59:06 -04:00
Artem Bilan
1e93d51697 (S)FTP tests: Add missed @DirtiesContext
Related to: https://build.spring.io/browse/INT-MASTERSPRING40-826/

If we don't close application context on the embedded (S)FTP server,
we my still have some session opened in other tests, which would cause
some unexpected behavior like extra `SessionClosedEvent` in the
test for FTP events
2019-09-11 13:36:56 -04:00
Artem Bilan
075086775d GH-3038: Delegate more RemoteFileTempalte options
Fixes https://github.com/spring-projects/spring-integration/issues/3038

* Add more delegating setters into the `AbstractRemoteFileOutboundGateway`
for its `RemoteFileTemplate` property
* Restrict externally provided `RemoteFileTemplate` from modifications
in the `AbstractRemoteFileOutboundGateway`: those options must be
configured on that external `RemoteFileTemplate`
* Expose new options in the Java DSL specs
2019-08-29 11:20:52 -04:00
Artem Bilan
1b892fc7a4 Fix Sonar smells in the FtpSession 2019-08-29 10:19:45 -04:00
Artem Bilan
a756e6334d GH-3043: Add FileHeaders.REMOTE_HOST header (#3044)
* GH-3043: Add FileHeaders.REMOTE_HOST header

Fixes https://github.com/spring-projects/spring-integration/issues/3043

* Populate a `FileHeaders.REMOTE_HOST` from the
`AbstractRemoteFileStreamingMessageSource` and "get"-based commands
in the `AbstractRemoteFileOutboundGateway`
* Extract the value from the a `Session.getHost()` contract
* The `AbstractInboundFileSynchronizingMessageSource` cannot be
addressed with this because the real message is already based on the
locally stored file
* Adjust some affected tests according our code style requirements

* * Add remote file info support into `AbstractInboundFileSynchronizingMessageSource`
* Introduce a `MetadataStore` functionality into the `AbstractInboundFileSynchronizer`
to gather a remote file info an save it in the URI style against local file
* Retrieve such an info in the `AbstractInboundFileSynchronizingMessageSource`
during local file polling
* Introduce `protocol()` contract for the `AbstractInboundFileSynchronizer`
to build a proper URI in the metadata for external readers to distinguish
remote files properly
* Document the feature

* * Fix some typos in Docs

* * Rename property and header constant to the `HOST_PORT` pair
* Fix typos in Docs
* Add  `remote-file-metadata-store` and `metadata-store-prefix` into XSD
of (S)FTP Inbound Channel Adapters
* Add `remoteFileMetadataStore` and `metadataStorePrefix` options
into `RemoteFileInboundChannelAdapterSpec` for Java DSL
2019-08-28 08:58:13 -04:00
Gary Russell
a4f7412cf5 GH-3026 Support chmod with FTP
Resolves https://github.com/spring-projects/spring-integration/issues/3026

* Fix exception messages; remove test TODOs; test works on Windows
2019-08-15 17:38:24 -04:00
Artem Bilan
13a8623b59 GH-3027: Decouple RotationPolicy
Fixes https://github.com/spring-projects/spring-integration/issues/3027

This is a polishing for PR https://github.com/spring-projects/spring-integration/pull/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`
2019-08-15 11:32:25 -04:00
David Turanski
ba017686fb GH-3027: Enhancements to RotatingServerAdvice
Resolves https://github.com/spring-projects/spring-integration/issues/3027

Fix checkstyle errors

Polishing - wrap code at 120, javadocs at 90; don't use this. on method calls
2019-08-14 13:45:11 -04:00
Gary Russell
cd0f56bc87 Add Apache MINA SftpEventListener
- republish certain events as `ApplicationEvent`s.

* * Add ApacheMinaFtplet to provide the same functionality with FTP
* Fix typo

* * Polishing javadocs and event toString() methods
2019-07-30 10:31:23 -04:00
Artem Bilan
80d679a9b0 GH-2748: More bean definitions into exceptions
Fixes https://github.com/spring-projects/spring-integration/issues/2748

* Refactor more `MessageHandlingException`s to include `this` into an
exception message
* Revert using `MessagingException` in some places which really are not
about messaging.
This helps to wrap them into `MessageHandlingException` later in the
`MessageHandler` for the `BeanDefinition` reference
* Remove `volatile` from configuration properties in the affected
classes
* Remove already deprecated `JmsOutboundGateway.setPriority()`
* Add `resource` and `source` for `BeanDefinition` in the
`AbstractChannelAdapterParser` & `AbstractInboundGatewayParser`
* Document the feature
2019-07-23 15:19:56 -04:00
Artem Bilan
c109e1df34 GH-2987: Add HTTPS entries into spring.schemas
Fixes https://github.com/spring-projects/spring-integration/issues/2987

To resolve XSD files properly from the classpath, their HTTPS reference
must be present in the `spring.schemas` to avoid the Internet interaction
for resolving an XSD file

**Cherry-pick to 5.1.x, 5.0.x & 4.3.x**
2019-07-18 14:05:18 -04:00
Gary Russell
86c7e36667 Sonar issues - complexity
* Fix checkstyle issue.
2019-05-03 20:05:16 -04:00
Gary Russell
6d7bc1fc39 Sonar: repeated literals
* Polishing - PR Comments

* GatewayParser: Restore suppress warnings; remove size from `toArray()`.

* Merge conflict resolution
2019-05-03 12:39:02 -04:00
Gary Russell
0d6faa2e34 Sonar - protected fields 2019-05-01 17:28:42 -04:00
Gary Russell
36c33bb5ab Sonar fixes
- a few complexities
- final method calls from ctor
- raw exception throwing
- useless overrides
- loss of stack trace
2019-04-29 18:20:40 -04:00
Artem Bilan
d21e8f0349 URL Cleanup
This commit updates URLs to prefer the https protocol.
Redirects are not followed to avoid accidentally expanding intentionally
shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status.
While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 2638 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
2019-03-21 19:22:26 -04:00
Artem Bilan
20e8f0af2f Fix HTTP urls to HTTPS
* Do not fix urls for the `http://apache.org/xml/features` when we
configure XML components
* Do not fix urls for localhost and fake links in tests
* Fix all the dead links in docs
2019-03-21 17:16:30 -04:00
Spring Operator
fd30d1b48b URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# HTTP URLs that Could Not Be Fixed
These URLs were unable to be fixed. Please review them to see if they can be manually resolved.

* http://foo.com (301) with 1 occurrences could not be migrated:
   ([https](https://foo.com) result SSLHandshakeException).

# Fixed URLs

## Fixed But Review Recommended
These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* http://diveintomark.org/ (302) with 1 occurrences migrated to:
  /ZKSXZ/ ([https](https://diveintomark.org/) result IllegalArgumentException).
* http://foo.bar.com (UnknownHostException) with 1 occurrences migrated to:
  https://foo.bar.com ([https](https://foo.bar.com) result UnknownHostException).
* http://site1.com,http://site2.com (UnknownHostException) with 1 occurrences migrated to:
  https://site1.com,http://site2.com ([https](https://site1.com,https://site2.com) result UnknownHostException).
* http://example.org/2005/04/02/atom (404) with 1 occurrences migrated to:
  https://example.org/2005/04/02/atom ([https](https://example.org/2005/04/02/atom) result 404).
* http://example.org/audio/ph34r_my_podcast.mp3 (404) with 1 occurrences migrated to:
  https://example.org/audio/ph34r_my_podcast.mp3 ([https](https://example.org/audio/ph34r_my_podcast.mp3) result 404).
* http://example.org/feed.atom (404) with 1 occurrences migrated to:
  https://example.org/feed.atom ([https](https://example.org/feed.atom) result 404).
* http://www.puppycrawl.com/dtds/configuration_1_2.dtd (404) with 1 occurrences migrated to:
  https://www.puppycrawl.com/dtds/configuration_1_2.dtd ([https](https://www.puppycrawl.com/dtds/configuration_1_2.dtd) result 404).
* http://www.puppycrawl.com/dtds/suppressions_1_1.dtd (404) with 1 occurrences migrated to:
  https://www.puppycrawl.com/dtds/suppressions_1_1.dtd ([https](https://www.puppycrawl.com/dtds/suppressions_1_1.dtd) result 404).
* http://www.springframework.org/schema/integration/jsr223/spring-integration-jsr223.xsd (404) with 1 occurrences migrated to:
  https://www.springframework.org/schema/integration/jsr223/spring-integration-jsr223.xsd ([https](https://www.springframework.org/schema/integration/jsr223/spring-integration-jsr223.xsd) result 404).
* http://www.springframework.org/schema/integration/spring-integration-ws.xsd (404) with 1 occurrences migrated to:
  https://www.springframework.org/schema/integration/spring-integration-ws.xsd ([https](https://www.springframework.org/schema/integration/spring-integration-ws.xsd) result 404).
* http://www.springframework.org/schema/integration/webflux/spring-integration-webflux.xsd (404) with 4 occurrences migrated to:
  https://www.springframework.org/schema/integration/webflux/spring-integration-webflux.xsd ([https](https://www.springframework.org/schema/integration/webflux/spring-integration-webflux.xsd) result 404).

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* http://example.org with 22 occurrences migrated to:
  https://example.org ([https](https://example.org) result 200).
* http://example.org/ with 2 occurrences migrated to:
  https://example.org/ ([https](https://example.org/) result 200).
* http://feeds.bbci.co.uk/news/rss.xml with 1 occurrences migrated to:
  https://feeds.bbci.co.uk/news/rss.xml ([https](https://feeds.bbci.co.uk/news/rss.xml) result 200).
* http://www.example.com/ with 1 occurrences migrated to:
  https://www.example.com/ ([https](https://www.example.com/) result 200).
* http://www.springframework.org/schema/aop/spring-aop.xsd with 12 occurrences migrated to:
  https://www.springframework.org/schema/aop/spring-aop.xsd ([https](https://www.springframework.org/schema/aop/spring-aop.xsd) result 200).
* http://www.springframework.org/schema/beans/spring-beans.xsd with 813 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans.xsd ([https](https://www.springframework.org/schema/beans/spring-beans.xsd) result 200).
* http://www.springframework.org/schema/context/spring-context.xsd with 122 occurrences migrated to:
  https://www.springframework.org/schema/context/spring-context.xsd ([https](https://www.springframework.org/schema/context/spring-context.xsd) result 200).
* http://www.springframework.org/schema/data/jpa/spring-jpa.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/data/jpa/spring-jpa.xsd ([https](https://www.springframework.org/schema/data/jpa/spring-jpa.xsd) result 200).
* http://www.springframework.org/schema/data/mongo/spring-mongo.xsd with 18 occurrences migrated to:
  https://www.springframework.org/schema/data/mongo/spring-mongo.xsd ([https](https://www.springframework.org/schema/data/mongo/spring-mongo.xsd) result 200).
* http://www.springframework.org/schema/geode/spring-geode.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/geode/spring-geode.xsd ([https](https://www.springframework.org/schema/geode/spring-geode.xsd) result 200).
* http://www.springframework.org/schema/integration/amqp/spring-integration-amqp.xsd with 14 occurrences migrated to:
  https://www.springframework.org/schema/integration/amqp/spring-integration-amqp.xsd ([https](https://www.springframework.org/schema/integration/amqp/spring-integration-amqp.xsd) result 200).
* http://www.springframework.org/schema/integration/event/spring-integration-event.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/integration/event/spring-integration-event.xsd ([https](https://www.springframework.org/schema/integration/event/spring-integration-event.xsd) result 200).
* http://www.springframework.org/schema/integration/feed/spring-integration-feed.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/integration/feed/spring-integration-feed.xsd ([https](https://www.springframework.org/schema/integration/feed/spring-integration-feed.xsd) result 200).
* http://www.springframework.org/schema/integration/file/spring-integration-file.xsd with 27 occurrences migrated to:
  https://www.springframework.org/schema/integration/file/spring-integration-file.xsd ([https](https://www.springframework.org/schema/integration/file/spring-integration-file.xsd) result 200).
* http://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd with 15 occurrences migrated to:
  https://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd ([https](https://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd) result 200).
* http://www.springframework.org/schema/integration/gemfire/spring-integration-gemfire.xsd with 6 occurrences migrated to:
  https://www.springframework.org/schema/integration/gemfire/spring-integration-gemfire.xsd ([https](https://www.springframework.org/schema/integration/gemfire/spring-integration-gemfire.xsd) result 200).
* http://www.springframework.org/schema/integration/groovy/spring-integration-groovy.xsd with 11 occurrences migrated to:
  https://www.springframework.org/schema/integration/groovy/spring-integration-groovy.xsd ([https](https://www.springframework.org/schema/integration/groovy/spring-integration-groovy.xsd) result 200).
* http://www.springframework.org/schema/integration/http/spring-integration-http.xsd with 18 occurrences migrated to:
  https://www.springframework.org/schema/integration/http/spring-integration-http.xsd ([https](https://www.springframework.org/schema/integration/http/spring-integration-http.xsd) result 200).
* http://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd with 27 occurrences migrated to:
  https://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd ([https](https://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd) result 200).
* http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd with 47 occurrences migrated to:
  https://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd ([https](https://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd) result 200).
* http://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd with 93 occurrences migrated to:
  https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd ([https](https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd) result 200).
* http://www.springframework.org/schema/integration/jmx/spring-integration-jmx.xsd with 32 occurrences migrated to:
  https://www.springframework.org/schema/integration/jmx/spring-integration-jmx.xsd ([https](https://www.springframework.org/schema/integration/jmx/spring-integration-jmx.xsd) result 200).
* http://www.springframework.org/schema/integration/jpa/spring-integration-jpa.xsd with 11 occurrences migrated to:
  https://www.springframework.org/schema/integration/jpa/spring-integration-jpa.xsd ([https](https://www.springframework.org/schema/integration/jpa/spring-integration-jpa.xsd) result 200).
* http://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd with 18 occurrences migrated to:
  https://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd ([https](https://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd) result 200).
* http://www.springframework.org/schema/integration/mongodb/spring-integration-mongodb.xsd with 17 occurrences migrated to:
  https://www.springframework.org/schema/integration/mongodb/spring-integration-mongodb.xsd ([https](https://www.springframework.org/schema/integration/mongodb/spring-integration-mongodb.xsd) result 200).
* http://www.springframework.org/schema/integration/mqtt/spring-integration-mqtt.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/integration/mqtt/spring-integration-mqtt.xsd ([https](https://www.springframework.org/schema/integration/mqtt/spring-integration-mqtt.xsd) result 200).
* http://www.springframework.org/schema/integration/redis/spring-integration-redis.xsd with 17 occurrences migrated to:
  https://www.springframework.org/schema/integration/redis/spring-integration-redis.xsd ([https](https://www.springframework.org/schema/integration/redis/spring-integration-redis.xsd) result 200).
* http://www.springframework.org/schema/integration/rmi/spring-integration-rmi.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/integration/rmi/spring-integration-rmi.xsd ([https](https://www.springframework.org/schema/integration/rmi/spring-integration-rmi.xsd) result 200).
* http://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd with 14 occurrences migrated to:
  https://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd ([https](https://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd) result 200).
* http://www.springframework.org/schema/integration/security/spring-integration-security.xsd with 3 occurrences migrated to:
  https://www.springframework.org/schema/integration/security/spring-integration-security.xsd ([https](https://www.springframework.org/schema/integration/security/spring-integration-security.xsd) result 200).
* http://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd with 18 occurrences migrated to:
  https://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd ([https](https://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd) result 200).
* http://www.springframework.org/schema/integration/spring-integration.xsd with 731 occurrences migrated to:
  https://www.springframework.org/schema/integration/spring-integration.xsd ([https](https://www.springframework.org/schema/integration/spring-integration.xsd) result 200).
* http://www.springframework.org/schema/integration/stomp/spring-integration-stomp.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/integration/stomp/spring-integration-stomp.xsd ([https](https://www.springframework.org/schema/integration/stomp/spring-integration-stomp.xsd) result 200).
* http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd with 17 occurrences migrated to:
  https://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd ([https](https://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd) result 200).
* http://www.springframework.org/schema/integration/syslog/spring-integration-syslog.xsd with 5 occurrences migrated to:
  https://www.springframework.org/schema/integration/syslog/spring-integration-syslog.xsd ([https](https://www.springframework.org/schema/integration/syslog/spring-integration-syslog.xsd) result 200).
* http://www.springframework.org/schema/integration/websocket/spring-integration-websocket.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/integration/websocket/spring-integration-websocket.xsd ([https](https://www.springframework.org/schema/integration/websocket/spring-integration-websocket.xsd) result 200).
* http://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd with 10 occurrences migrated to:
  https://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd ([https](https://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd) result 200).
* http://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd with 12 occurrences migrated to:
  https://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd ([https](https://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd) result 200).
* http://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd with 14 occurrences migrated to:
  https://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd ([https](https://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd) result 200).
* http://www.springframework.org/schema/integration/zookeeper/spring-integration-zookeeper.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/integration/zookeeper/spring-integration-zookeeper.xsd ([https](https://www.springframework.org/schema/integration/zookeeper/spring-integration-zookeeper.xsd) result 200).
* http://www.springframework.org/schema/jdbc/spring-jdbc.xsd with 52 occurrences migrated to:
  https://www.springframework.org/schema/jdbc/spring-jdbc.xsd ([https](https://www.springframework.org/schema/jdbc/spring-jdbc.xsd) result 200).
* http://www.springframework.org/schema/jms/spring-jms.xsd with 7 occurrences migrated to:
  https://www.springframework.org/schema/jms/spring-jms.xsd ([https](https://www.springframework.org/schema/jms/spring-jms.xsd) result 200).
* http://www.springframework.org/schema/lang/spring-lang.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/lang/spring-lang.xsd ([https](https://www.springframework.org/schema/lang/spring-lang.xsd) result 200).
* http://www.springframework.org/schema/mvc/spring-mvc.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/mvc/spring-mvc.xsd ([https](https://www.springframework.org/schema/mvc/spring-mvc.xsd) result 200).
* http://www.springframework.org/schema/rabbit/spring-rabbit.xsd with 9 occurrences migrated to:
  https://www.springframework.org/schema/rabbit/spring-rabbit.xsd ([https](https://www.springframework.org/schema/rabbit/spring-rabbit.xsd) result 200).
* http://www.springframework.org/schema/security/spring-security.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/security/spring-security.xsd ([https](https://www.springframework.org/schema/security/spring-security.xsd) result 200).
* http://www.springframework.org/schema/task/spring-task.xsd with 44 occurrences migrated to:
  https://www.springframework.org/schema/task/spring-task.xsd ([https](https://www.springframework.org/schema/task/spring-task.xsd) result 200).
* http://www.springframework.org/schema/tool/spring-tool.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/tool/spring-tool.xsd ([https](https://www.springframework.org/schema/tool/spring-tool.xsd) result 200).
* http://www.springframework.org/schema/tx/spring-tx.xsd with 14 occurrences migrated to:
  https://www.springframework.org/schema/tx/spring-tx.xsd ([https](https://www.springframework.org/schema/tx/spring-tx.xsd) result 200).
* http://www.springframework.org/schema/util/spring-util.xsd with 92 occurrences migrated to:
  https://www.springframework.org/schema/util/spring-util.xsd ([https](https://www.springframework.org/schema/util/spring-util.xsd) result 200).
* http://www.springframework.org/schema/websocket/spring-websocket.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/websocket/spring-websocket.xsd ([https](https://www.springframework.org/schema/websocket/spring-websocket.xsd) result 200).
* http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd with 1 occurrences migrated to:
  https://java.sun.com/xml/ns/persistence/persistence_2_0.xsd ([https](https://java.sun.com/xml/ns/persistence/persistence_2_0.xsd) result 302).

# Ignored
These URLs were intentionally ignored.

* http://java.sun.com/xml/ns/persistence with 2 occurrences
* http://localhost with 1 occurrences
* http://localhost/ with 1 occurrences
* http://localhost/test1 with 25 occurrences
* http://localhost/test1/%2f with 1 occurrences
* http://localhost/test2 with 2 occurrences
* http://localhost/test2/ with 1 occurrences
* http://localhost:18080/it/ with 3 occurrences
* http://localhost:51235/%2f/testApps?param= with 1 occurrences
* http://test with 1 occurrences
* http://test.example.org with 1 occurrences
* http://test.org with 1 occurrences
* http://testServer/test with 1 occurrences
* http://testServer/testmp with 1 occurrences
* http://www.springframework.org/schema/aop with 25 occurrences
* http://www.springframework.org/schema/beans with 1633 occurrences
* http://www.springframework.org/schema/c with 1 occurrences
* http://www.springframework.org/schema/context with 244 occurrences
* http://www.springframework.org/schema/data/jpa with 3 occurrences
* http://www.springframework.org/schema/data/mongo with 36 occurrences
* http://www.springframework.org/schema/geode with 8 occurrences
* http://www.springframework.org/schema/integration with 1465 occurrences
* http://www.springframework.org/schema/integration/amqp with 28 occurrences
* http://www.springframework.org/schema/integration/event with 8 occurrences
* http://www.springframework.org/schema/integration/feed with 8 occurrences
* http://www.springframework.org/schema/integration/file with 54 occurrences
* http://www.springframework.org/schema/integration/ftp with 30 occurrences
* http://www.springframework.org/schema/integration/gemfire with 12 occurrences
* http://www.springframework.org/schema/integration/groovy with 27 occurrences
* http://www.springframework.org/schema/integration/http with 36 occurrences
* http://www.springframework.org/schema/integration/ip with 54 occurrences
* http://www.springframework.org/schema/integration/jdbc with 94 occurrences
* http://www.springframework.org/schema/integration/jms with 186 occurrences
* http://www.springframework.org/schema/integration/jmx with 64 occurrences
* http://www.springframework.org/schema/integration/jpa with 22 occurrences
* http://www.springframework.org/schema/integration/jsr223 with 2 occurrences
* http://www.springframework.org/schema/integration/mail with 36 occurrences
* http://www.springframework.org/schema/integration/mongodb with 34 occurrences
* http://www.springframework.org/schema/integration/mqtt with 8 occurrences
* http://www.springframework.org/schema/integration/redis with 34 occurrences
* http://www.springframework.org/schema/integration/rmi with 8 occurrences
* http://www.springframework.org/schema/integration/scripting with 28 occurrences
* http://www.springframework.org/schema/integration/security with 6 occurrences
* http://www.springframework.org/schema/integration/sftp with 36 occurrences
* http://www.springframework.org/schema/integration/stomp with 2 occurrences
* http://www.springframework.org/schema/integration/stream with 34 occurrences
* http://www.springframework.org/schema/integration/syslog with 10 occurrences
* http://www.springframework.org/schema/integration/webflux with 8 occurrences
* http://www.springframework.org/schema/integration/websocket with 2 occurrences
* http://www.springframework.org/schema/integration/ws with 22 occurrences
* http://www.springframework.org/schema/integration/xml with 24 occurrences
* http://www.springframework.org/schema/integration/xmpp with 28 occurrences
* http://www.springframework.org/schema/integration/zookeeper with 2 occurrences
* http://www.springframework.org/schema/jdbc with 104 occurrences
* http://www.springframework.org/schema/jms with 13 occurrences
* http://www.springframework.org/schema/lang with 8 occurrences
* http://www.springframework.org/schema/mvc with 2 occurrences
* http://www.springframework.org/schema/p with 19 occurrences
* http://www.springframework.org/schema/rabbit with 18 occurrences
* http://www.springframework.org/schema/security with 4 occurrences
* http://www.springframework.org/schema/task with 88 occurrences
* http://www.springframework.org/schema/tool with 8 occurrences
* http://www.springframework.org/schema/tx with 28 occurrences
* http://www.springframework.org/schema/util with 184 occurrences
* http://www.springframework.org/schema/websocket with 2 occurrences
* http://www.w3.org/1999/xhtml with 1 occurrences
* http://www.w3.org/2001/XMLSchema with 1 occurrences
* http://www.w3.org/2001/XMLSchema-instance with 814 occurrences
* http://www.w3.org/2005/Atom with 1 occurrences

* Use the latest Checkstyle DTDs with their HTTPS variants
2019-03-20 10:39:37 -04:00
Artem Bilan
8380346821 GH-2820: Close session in FtpRemFileTempl.exists
Fixes: https://github.com/spring-projects/spring-integration/issues/2820

The current `FtpRemoteFileTemplate.exists()` implementation obtains a
`Session` for the `NLST_AND_DIRS` mode, but doesn't close it.

* Fix the `FtpRemoteFileTemplate.exists()` method to delegate to `super`
for the proper interaction with a `Session`

**Cherry-pick to 5.1.x, 5.0.x & 4.3.x**
2019-03-19 11:16:04 -04:00
Gary Russell
b187bca36e Avoid throws Exception where possible - Phase I
* Polishing - PR Comments
2019-03-07 12:53:52 -05:00
Gary Russell
931df86274 GH-2777: Remote File Filter Improvements
Resolves https://github.com/spring-projects/spring-integration/issues/2777

If the filter supports it, defer filtering until the last possible moment.
Then, the worst case scenario after a catastrophic failure (e.g. power loss),
would be that at most one file will be incorrectly filtered on restart.

Polishing and add more tests.

Polishing Javadocs

More Polishing

Final polishing

More polishing.

Polishing and docPolishing and docs.

* Fix typos in Docs
2019-03-05 17:49:56 -05:00
Gary Russell
a167290f9b GH-2776: Fix Streaming Remote File MessageSource
Fixes https://github.com/spring-projects/spring-integration/issues/2776
Also see https://github.com/spring-projects/spring-integration/issues/2777

- reset the filter for the current file if the fetch fails
- implement `Lifecycle` and clear the `toBeReceived` queue and corresponding
  filter entries

* Polishing - PR Comments **cherry-pick to all supported**

* Polishing
2019-03-01 14:35:31 -05:00
Gary Russell
23843c789b Avoid Race in FtpStreamingMessageSourceTests
See https://github.com/spring-projects/spring-integration/issues/2776
2019-03-01 11:14:12 -05:00
Artem Bilan
3657d05596 Defer Messaging annotations process (#2769)
* Defer Messaging annotations process

The `AbstractMethodAnnotationPostProcessor` and its implementations
have a `beanFactory.getBean()` call for the `@Bean` methods with
Messaging annotations.
This is done, actually, from the
`MessagingAnnotationPostProcessor.postProcessAfterInitialization()`
which might be still too early in some scenarios, like Spring Cloud Feign
with its child application contexts being initialized from the
`FeignClientFactoryBean`, causing a `BeanCurrentlyInCreationException`

See https://stackoverflow.com/questions/54887963/beancurrentlyincreationexception-when-using-spring-integration-with-spring-cloud

* Implement a `SmartInitializingSingleton` for the `MessagingAnnotationPostProcessor`
and gather `Runnable` wrappers for newly introduced `postProcessMethodAndRegisterEndpointIfAny()`
to be called later in the `afterSingletonsInstantiated()` when context is
still in the initialization phase.
All runtime-registered beans are going to be processed normally from the
regular `postProcessAfterInitialization()`

**Cherry-pick to 5.1.x**

* * Fix unused imports in the `MessagingAnnotationsWithBeanAnnotationTests`

* * Fix `IntegrationEndpointsInitializer` in the testing framework to handle
all the possible `AbstractEndpoint` beans registration.
See its JavaDocs for more info
* Fix `AbstractCorrelatingMessageHandlerParser` and
`AbstractConsumerEndpointParser` to use bean names for `outputChannel`
and `discardChannel` instead of bean references.
Since `MessagingAnnotationPostProcessor` now registers endpoints and
beans for channels much later, than parsers, we can't rely on bean
references any more there.
* Fixes for failing tests which expected `outputChannel/discardChannel`
bean references, when it is already just their names for late binding.
* Apply some code style polishing for the affected classes.
* Add `@Nullable` for `MessageSelector` parameter in the `QueueChannel.purge()`
2019-03-01 10:26:05 -05:00
Artem Bilan
d2e974a6de Fix new Sonar smells (#2768)
* Fix new Sonar smells

* Fix some old Sonar smells as well
* Fix Micrometer leaks in the `PollableChannel` when we register
meters, but don't remove them.

* * Fix NPE around `MetricsCaptor` in channels

* * Fix new smells according test report

* * Further Sonar smell fixes

* * More smell fixes for `MessagingMethodInvokerHelper`
* Remove `throws Exception` from `AbstractMessageHandler.destroy()`

* * Fix complexity in the `MessagingMethodInvokerHelper.processInvokeExceptionAndFallbackToExpressionIfAny()`
2019-02-27 15:17:51 -05:00
Artem Bilan
7e3b56939e Fix XSDs for actual core schema version 2019-02-21 12:43:21 -05:00
Artem Bilan
622d42c71a Migrate tests to AssertJ
Mostly thanks to IDEA's plugin: https://plugins.jetbrains.com/plugin/10345-assertions2assertj
There is still a lot of work to do when complex and composite matchers are used.

* Add `awaitility` dependency and deprecate `EventuallyMatcher` in favor
of `awaitility`
* Remove Hamcrest from dependencies and disable JUnit & Hamcrest
static imports to encourage to use only AssertJ
* Migrate JUnit assumptions in rules to AssertJ's assumptions
* Deprecate some custom matchers in favor of existing in Hamcrest
after upgrading the last to version `2.1`
* Replace `ExpectedException` rules with `assertThatThrownBy()`
* Mention `MessagePredicate` in the `testing.adoc`
2019-02-21 10:20:45 -05:00
Gary Russell
520ebbbd2c Move master to 5.2 2019-02-15 12:01:24 -05:00
Artem Bilan
a609bd9398 Some file module Sonar fixes (#2718)
* Some file module Sonar fixes

* * Fixes after testing

* * Some further Sonar fixes for file module

* * Further Sonar fixes for file module

* * More Sonar fixes for file module

* * Fix `RemoteFileTemplate` issues

* * Fix new sonar smells after previous one

* * Review feedback
2019-01-25 14:37:57 -05:00
Gary Russell
4ea3b1c23c GH-2705: public CTORs on AMFPFileListFilter Impls
Fixes https://github.com/spring-projects/spring-integration/issues/2705
2019-01-18 11:12:38 -05:00
Gary Russell
e40cfe101e Sonar fixes
Hidden fields, `o.s.i.a*` through `o.s.i.j*`.
2019-01-09 10:02:19 -05:00
Gary Russell
e8df546b04 Sonar Fixes - Javadoc-only imports 2019-01-02 12:26:22 -05:00
Gary Russell
62fc7df693 Sonar Fixes
Critical smells, packages `o.s.i.a*` to `f*`.

Plus new smells caused by these changes.
2018-12-03 10:44:26 -05:00
Artem Bilan
76c670075b Fix RotatingServersTests concurrency
https://build.spring.io/browse/INT-FATS5IC-685/

Even if we stop `SourcePollingChannelAdapter`, the task on the fly is
still going to be executed.
This way we may have extra calls to our logic.

* Use `CopyOnWriteArrayList` for the `sessionSources` to avoid
`ConcurrentModificationException` during this collection read in the
tests

**Cherry-pick to 5.0.x**
2018-11-07 10:42:00 -05:00
Gary Russell
12bc24dd02 File, FTP, IP Sonar Fixes 2018-10-26 13:53:54 -04:00
Gary Russell
bd7a3bc4ed GH-2605: (S)FTP test cached sessions
Resolves https://github.com/spring-projects/spring-integration/issues/2605

* Suppress unused field warning.

* Fix typos.

* Use lstat() - don't follow symbolic lincs
2018-10-23 13:59:00 -04:00