INT-1661 added HTTP Header mapping documentation, fixed the FTP doc that broke the build

This commit is contained in:
Oleg Zhurakousky
2010-12-10 14:17:05 -05:00
parent 9413fe0dc1
commit 69c0a8bdcf
2 changed files with 52 additions and 8 deletions

View File

@@ -47,7 +47,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/ftp
<property name="password" value="frog"/>
<property name="clientMode" value="0"/>
<property name="fileType" value="2"/>
<property name="bufferSize" value="1000000"/>
<property name="bufferSize" value="100000"/>
</bean>]]></programlisting>
</para>
<para>
@@ -75,11 +75,8 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/ftp
<property name="implicit" value="true"/>
</bean>]]></programlisting>
</para>
<para>
<emphasis>Stale session and session pooling</emphasis>
</para>
<para>
Every time an adapter requests a session object from the <classname>DefaultFtpClientFactory</classname> or <classname>DefaultFtpsClientFactory</classname> the session is
returned from the default session pool maintained by these factories. Session in the session pool might go stale
@@ -90,7 +87,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/ftp
If you experience connectivity problems and would like to trace session creation as well as see which session are
polled you may enable it by setting logger to TRACE level (e.g., log4j.category.org.springframework.integration.file=TRACE)
</note>
</para>
</para>
<para>
Now all you need to do is inject these session factories into your adapters. Obviously the protocol (FTP or FTPS) that an adapter will
@@ -196,13 +193,15 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/ftp
in the MessageHeaders, or if the payload of the Message is already a <classname>java.io.File</classname>, then it will use the original name of that file.
</note>
</para>
<para>
<important>
Defining certain values (e.g., remote-directory) might be platform/ftp server dependent. For example as it
was reported on this forum http://forum.springsource.org/showthread.php?p=333478&posted=1#post333478 on some
was reported on this forum http://forum.springsource.org/showthread.php?p=333478&amp;posted=1#post333478 on some
platforms you must add slash to the end of the directory definition (e.g., remote-directory="/foo/bar/"
instead of remote-directory="/foo/bar")
</important>
</para>
</section>
</chapter>

View File

@@ -172,6 +172,51 @@ By default the HTTP request will be generated using an instance of <classname>Si
</section>
<section id="http-header-mapping">
<title> HTTP Header Mappings</title>
<para>
Spring Integration provides support for Http Header mapping for both HTTP Request and HTTP Responses.
</para>
<para>
By default all standard Http Headers as defined here
http://en.wikipedia.org/wiki/List_of_HTTP_header_fields will be mapped from the message to http request/response headers without
further configuration.
However if you do need further customization you may provide an additional configuration via convenient namesapce support.
Below are couple of examples:
<programlisting language="xml"><![CDATA[<int-http:outbound-gateway id="httpGateway"
url="http://localhost/test2"
mapped-request-headers="foo, bar"
mapped-response-headers="baz, a"
channel="someChannel"/>
<int-http:outbound-channel-adapter id="httpAdapter"
url="http://localhost/test2"
mapped-request-headers="foo, bar"
channel="someChannel"/>]]></programlisting>
The adapters and gateways will use the <classname>DefaultHttpHeaderMapper</classname> which now provides
two static factory methods for "inbound" and "outbound" adapters so that the proper direction can be
applied (mapping HTTP requests/reponses IN/OUT as appropriate).
</para>
<para>
If further customization is required you can also configure <classname>DefaultHttpHeaderMapper</classname> independently
and inject it into the adapter via <code>header-mapper</code> attribute.
<programlisting language="xml"><![CDATA[<int-http:outbound-gateway id="httpGateway"
url="http://localhost/test2"
header-mapper="headerMapper"
channel="someChannel"/>
<bean id="headerMapper" class="org.springframework.integration.http.support.DefaultHttpHeaderMapper">
<property name="inboundHeaderNames" value="foo, bar, baz"/>
<property name="outboundHeaderNames" value="a, b, d"/>
</bean>]]></programlisting>
</para>
</section>
<section id="http-samples">
<title>HTTP Samples</title>
<section id="multipart-rest-inbound">