I need to build a standalone api using Spring integration's sftp adapter, but the caller will pass in the sftp connection parameters (host, user, pwd, etc..) and so I cannot initialize them in the spring context xml. I'm looking for advice on the best way to do with out needing to teardown and recreate an application context with each invocation. Here's my context xml right now, and i'd like to externalize the DefaultSftpSessionFactory parameters.
<bean id="sftpSessionFactory" class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
<property name="host" value="${host}" />
<property name="port" value="${serverport}" />
<property name="user" value="${username}" />
<property name="password" value="${password}" />
<property name="allowUnknownKeys" value="true" />
</bean>
<int:channel id="inputChannel" />
<int-sftp:outbound-channel-adapter id="sftpOutboundAdapter"
session-factory="sftpSessionFactory"
channel="inputChannel"
charset="UTF-8"
remote-file-separator="/"
remote-directory="/accounts/12026622/Reports/"
use-temporary-file-name="false"
mode="REPLACE"
remote-filename-generator-expression="payload.getName() + '-foo'" />