Merge remote-tracking branch 'upstream/master' into 4.0.0-WIP
Conflicts: spring-integration-core/src/test/java/org/springframework/integration/aggregator/AggregatorTests.java spring-integration-core/src/test/java/org/springframework/integration/aggregator/ConcurrentAggregatorTests.java spring-integration-core/src/test/java/org/springframework/integration/aggregator/CorrelatingMessageHandlerTests.java spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInterfaceTests.java spring-integration-redis/src/test/java/org/springframework/integration/redis/channel/SubscribableRedisChannelTests.java spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisInboundChannelAdapterParserTests.java spring-integration-redis/src/test/java/org/springframework/integration/redis/store/DelayerHandlerRescheduleIntegrationTests.java spring-integration-redis/src/test/java/org/springframework/integration/redis/store/RedisMessageGroupStoreTests.java spring-integration-redis/src/test/java/org/springframework/integration/redis/store/RedisMessageStoreTests.java Resolved
This commit is contained in:
@@ -351,6 +351,7 @@ protected void postProcessClientBeforeConnect(T client) throws IOException {
|
||||
<listitem>-f - do not sort the list</listitem>
|
||||
<listitem>-dirs - include directories (excluded by default)</listitem>
|
||||
<listitem>-links - include symbolic links (excluded by default)</listitem>
|
||||
<listitem>-R - list the remote directory recursively</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
@@ -366,6 +367,13 @@ protected void postProcessClientBeforeConnect(T client) throws IOException {
|
||||
The remote directory that the <emphasis>ls</emphasis> command acted on is provided
|
||||
in the <classname>file_remoteDirectory</classname> header.
|
||||
</para>
|
||||
<para>
|
||||
When using the recursive option (<code>-R</code>), the <code>fileName</code> includes any subdirectory
|
||||
elements, representing a relative path to the file (relative to the remote directory). If the <code>-dirs</code>
|
||||
option is included, each recursive directory is also returned as an element in the list. In this case,
|
||||
it is recommended that the <code>-1</code> is not used because you would not be able to determine files Vs.
|
||||
directories, which is achievable using the <code>FileInfo</code> objects.
|
||||
</para>
|
||||
<para><emphasis role="bold">get</emphasis></para>
|
||||
<para>
|
||||
<emphasis>get</emphasis> retrieves a remote file and supports the following option:
|
||||
@@ -399,6 +407,27 @@ protected void postProcessClientBeforeConnect(T client) throws IOException {
|
||||
for the filenames is
|
||||
provided in the <classname>file_remoteFile</classname> header.
|
||||
</para>
|
||||
<note>
|
||||
<title>Notes for when using recursion (<code>-R</code>)</title>
|
||||
<para>
|
||||
The pattern is ignored, and <code>*</code> is assumed. By
|
||||
default, the entire remote tree is retrieved. However, files in the tree can be filtered, by providing a
|
||||
<classname>FileListFilter</classname>; directories in the tree can also be filtered this way.
|
||||
A <classname>FileListFilter</classname> can be provided by reference or by <code>filename-pattern</code>
|
||||
or <code>filename-regex</code> attributes. For example,
|
||||
<code>filename-regex="(subDir|.*1.txt)"</code> will retrieve all files ending with <code>1.txt</code> in the
|
||||
remote directory and the subdirectory <code>subDir</code>. If a subdirectory is filtered, no additional
|
||||
traversal of that subdirectory is performed.
|
||||
</para>
|
||||
<para>
|
||||
The <code>-dirs</code> option is not allowed (the recursive mget uses the recursive <code>ls</code> to
|
||||
obtain the directory tree and the directories themselves cannot be included in the list).
|
||||
</para>
|
||||
<para>
|
||||
Typically, you would use the <code>#remoteDirectory</code> variable in the <code>local-directory-expression</code>
|
||||
so that the remote directory structure is retained locally.
|
||||
</para>
|
||||
</note>
|
||||
<para><emphasis role="bold">rm</emphasis></para>
|
||||
<para>
|
||||
The <emphasis>rm</emphasis> command has no options.
|
||||
@@ -433,7 +462,16 @@ protected void postProcessClientBeforeConnect(T client) throws IOException {
|
||||
defines a SpEL expression to generate the name of local file(s) during the transfer.
|
||||
The root object of the evaluation context is the request Message but, in addition, the <code>remoteFileName</code>
|
||||
variable is also available, which is particularly useful for <emphasis>mget</emphasis>, for
|
||||
example: <code>local-filename-generator-expression="#remoteFileName.toUpperCase() + headers.foo"</code>
|
||||
example: <code>local-filename-generator-expression="#remoteFileName.toUpperCase() + headers.foo"</code>.
|
||||
</para>
|
||||
<para>
|
||||
The <emphasis>get</emphasis> and <emphasis>mget</emphasis> commands support
|
||||
the <emphasis>local-directory-expression</emphasis> attribute. It
|
||||
defines a SpEL expression to generate the name of local directory(ies) during the transfer.
|
||||
The root object of the evaluation context is the request Message but, in addition, the <code>remoteDirectory</code>
|
||||
variable is also available, which is particularly useful for <emphasis>mget</emphasis>, for
|
||||
example: <code>local-directory-expression="'/tmp/local/' + #remoteDirectory.toUpperCase() + headers.foo"</code>.
|
||||
This attribute is mutually exclusive with <emphasis>local-directory</emphasis> attribute.
|
||||
</para>
|
||||
<para>
|
||||
For all commands, the PATH that the command acts on is provided by the 'expression'
|
||||
|
||||
@@ -116,9 +116,10 @@ public interface Cafe {
|
||||
|
||||
<programlisting language="xml"><![CDATA[<int:gateway id="myGateway" service-interface="org.foo.bar.TestGateway"
|
||||
default-request-channel="inputC">
|
||||
<int:default-header name="calledMethod" expression="#gatewayMethod.name"/>
|
||||
<int:method name="echo" request-channel="inputA" reply-timeout="2" request-timeout="200"/>
|
||||
<int:method name="echoUpperCase" request-channel="inputB"/>
|
||||
<int:method name="echoViaDefault"/>
|
||||
<int:method name="echoUpperCase" request-channel="inputB"/>
|
||||
<int:method name="echoViaDefault"/>
|
||||
</int:gateway>]]></programlisting>
|
||||
|
||||
<para>
|
||||
@@ -145,6 +146,45 @@ public interface Cafe {
|
||||
In the above case you can clearly see how a different value will be set for the 'RESPONSE_TYPE'
|
||||
header based on the gateway's method.
|
||||
</para>
|
||||
<para><emphasis role="bold">Expressions and "Global" Headers</emphasis></para>
|
||||
<para>
|
||||
The <code><header/></code> element supports <code>expression</code> as an alternative to
|
||||
<code>value</code>. The SpEL expression is evaluated to determine the value of the header. There is no
|
||||
<code>#root</code> object but the following variables are available:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
#args - an <code>Object[]</code> containing the method arguments
|
||||
</listitem>
|
||||
<listitem>
|
||||
#gatewayMethod - the <classname>java.reflect.Method</classname> object representing the method in the
|
||||
<code>service-interface</code> that was invoked. A header containing this variable can be used
|
||||
later in the flow, for example, for routing. For example, if you wish to route on the simple method
|
||||
name, you might add a header, with expression <code>#gatewayMethod.name</code>.
|
||||
<note>
|
||||
The <classname>java.reflect.Method</classname> is not serializable; a header with expression
|
||||
<code>#gatewayMethod</code> will be lost if you later serialize the message. So, you may wish
|
||||
to use <code>#gatewayMethod.name</code> or <code>#gatewayMethod.toString()</code> in those cases;
|
||||
the <code>toString()</code> method provides a String representation of the method, including
|
||||
parameter and return types.
|
||||
</note>
|
||||
<note>
|
||||
Prior to 3.0, the <code>#method</code> variable was available, representing the method name only.
|
||||
This is still available, but deprecated; use <code>#gatewayMethod.name</code> instead.
|
||||
</note>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
Since 3.0, <code><default-header/></code>s can be defined to add headers to all messages produced
|
||||
by the gateway, regardless of the method invoked. Specific headers defined for a method take precedence
|
||||
over default headers. Specific headers defined for a method here will override any <code>@Header</code> annotations
|
||||
in the service interface. However, default headers will NOT override any <code>@Header</code> annotations
|
||||
in the service interface.
|
||||
</para>
|
||||
<para>
|
||||
The gateway now also supports a <code>default-payload-expression</code> which will be applied for all methods
|
||||
(unless overridden).
|
||||
</para>
|
||||
|
||||
</section>
|
||||
<section id="gateway-calling-no-argument-methods">
|
||||
|
||||
@@ -387,6 +387,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/sftp
|
||||
<listitem>-f - do not sort the list</listitem>
|
||||
<listitem>-dirs - include directories (excluded by default)</listitem>
|
||||
<listitem>-links - include symbolic links (excluded by default)</listitem>
|
||||
<listitem>-R - list the remote directory recursively</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
@@ -402,6 +403,13 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/sftp
|
||||
The remote directory that the <emphasis>ls</emphasis> command acted on is provided
|
||||
in the <classname>file_remoteDirectory</classname> header.
|
||||
</para>
|
||||
<para>
|
||||
When using the recursive option (<code>-R</code>), the <code>fileName</code> includes any subdirectory
|
||||
elements, representing a relative path to the file (relative to the remote directory). If the <code>-dirs</code>
|
||||
option is included, each recursive directory is also returned as an element in the list. In this case,
|
||||
it is recommended that the <code>-1</code> is not used because you would not be able to determine files Vs.
|
||||
directories, which is achievable using the <code>FileInfo</code> objects.
|
||||
</para>
|
||||
<para><emphasis role="bold">get</emphasis></para>
|
||||
<para>
|
||||
<emphasis>get</emphasis> retrieves a remote file and supports the following option:
|
||||
@@ -435,6 +443,27 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/sftp
|
||||
for the filenames is
|
||||
provided in the <classname>file_remoteFile</classname> header.
|
||||
</para>
|
||||
<note>
|
||||
<title>Notes for when using recursion (<code>-R</code>)</title>
|
||||
<para>
|
||||
The pattern is ignored, and <code>*</code> is assumed. By
|
||||
default, the entire remote tree is retrieved. However, files in the tree can be filtered, by providing a
|
||||
<classname>FileListFilter</classname>; directories in the tree can also be filtered this way.
|
||||
A <classname>FileListFilter</classname> can be provided by reference or by <code>filename-pattern</code>
|
||||
or <code>filename-regex</code> attributes. For example,
|
||||
<code>filename-regex="(subDir|.*1.txt)"</code> will retrieve all files ending with <code>1.txt</code> in the
|
||||
remote directory and the subdirectory <code>subDir</code>. If a subdirectory is filtered, no additional
|
||||
traversal of that subdirectory is performed.
|
||||
</para>
|
||||
<para>
|
||||
The <code>-dirs</code> option is not allowed (the recursive mget uses the recursive <code>ls</code> to
|
||||
obtain the directory tree and the directories themselves cannot be included in the list).
|
||||
</para>
|
||||
<para>
|
||||
Typically, you would use the <code>#remoteDirectory</code> variable in the <code>local-directory-expression</code>
|
||||
so that the remote directory structure is retained locally.
|
||||
</para>
|
||||
</note>
|
||||
<para><emphasis role="bold">rm</emphasis></para>
|
||||
<para>
|
||||
The <emphasis>rm</emphasis> command has no options.
|
||||
@@ -471,6 +500,15 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/sftp
|
||||
variable is also available, which is particularly useful for <emphasis>mget</emphasis>, for
|
||||
example: <code>local-filename-generator-expression="#remoteFileName.toUpperCase() + headers.foo"</code>
|
||||
</para>
|
||||
<para>
|
||||
The <emphasis>get</emphasis> and <emphasis>mget</emphasis> commands support
|
||||
the <emphasis>local-directory-expression</emphasis> attribute. It
|
||||
defines a SpEL expression to generate the name of local directory(ies) during the transfer.
|
||||
The root object of the evaluation context is the request Message but, in addition, the <code>remoteDirectory</code>
|
||||
variable is also available, which is particularly useful for <emphasis>mget</emphasis>, for
|
||||
example: <code>local-directory-expression="'/tmp/local/' + #remoteDirectory.toUpperCase() + headers.foo"</code>.
|
||||
This attribute is mutually exclusive with <emphasis>local-directory</emphasis> attribute.
|
||||
</para>
|
||||
<para>
|
||||
For all commands, the PATH that the command acts on is provided by the 'expression'
|
||||
property of the gateway. For the mget command, the expression might evaluate to '*', meaning
|
||||
|
||||
@@ -155,6 +155,20 @@
|
||||
<section id="3.0-general">
|
||||
<title>General Changes</title>
|
||||
|
||||
<section id="3.0-gateway">
|
||||
<title><gateway> Changes</title>
|
||||
<para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
It is now possible to set common headers across all gateway methods, and more options
|
||||
are provided for adding, to the message, information about which method was invoked.
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
For more information see <xref linkend="gateway"/>.
|
||||
</para>
|
||||
</section>
|
||||
<section id="3.0-corr-endpoint-empty-groups">
|
||||
<title>Aggregator 'empty-group-min-timeout' property</title>
|
||||
<para><classname>AbstractCorrelatingMessageHandler</classname> provides a new property
|
||||
@@ -238,14 +252,28 @@
|
||||
<section id="3.0-xFTP-gw">
|
||||
<title>FTP, SFTP and FTPS Gateways</title>
|
||||
<para>
|
||||
The gateways now support the <code>mv</code> command, enabling the renaming of remote
|
||||
files.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
The gateways now support the <code>mv</code> command, enabling the renaming of remote
|
||||
files.
|
||||
</listitem>
|
||||
<listitem>
|
||||
The gateways now support recursive <code>ls</code> and <code>mget</code> commands, enabling
|
||||
the retrieval of a remote file tree.
|
||||
</listitem>
|
||||
<listitem>
|
||||
The <code>local-filename-generator-expression</code> attribute is now supported,
|
||||
enabling the naming of local files during transfer. By default, the same
|
||||
name as the remote file is used.
|
||||
</listitem>
|
||||
<listitem>
|
||||
The <code>local-directory-expression</code> attribute is now supported,
|
||||
enabling the naming of local directories during transfer based on the remote directory.
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
The <code>local-filename-generator-expression</code> attribute is now supported,
|
||||
enabling the naming of local files during transfer. By default, the same
|
||||
name as the remote file is used. For more information, see
|
||||
<xref linkend="ftp-outbound-gateway"/> and <xref linkend="sftp-outbound-gateway"/>.
|
||||
For more information, see <xref linkend="ftp-outbound-gateway"/> and <xref linkend="sftp-outbound-gateway"/>.
|
||||
</para>
|
||||
</section>
|
||||
<section id="3.0-jdbc-mysql-v5_6_4">
|
||||
|
||||
Reference in New Issue
Block a user