[
http://jira.jboss.com/jira/browse/JBESB-533?page=comments#action_12361792 ]
Daniel Bevenius commented on JBESB-533:
---------------------------------------
I have added this functionality to this workspace:
http://anonsvn.jboss.org/repos/labs/labs/jbossesb/workspace/dbevenius/
The helloworld_ftp_action quickstart has been updated and show what the configuration
looks like:
<ftp-provider name="FTPprovider" hostname="@FTP_HOSTNAME@" >
<ftp-bus busid="helloFTPChannel" >
<ftp-message-filter
username="@FTP_USERNAME@"
password="@FTP_PASSWORD@"
read-only="true"
passive="false"
directory="@FTP_DIRECTORY@"
input-suffix=".dat"
work-suffix=".esbWorking"
post-delete="false"
post-suffix=".COMPLETE"
error-delete="false"
error-suffix=".HAS_ERROR"
/>
</ftp-bus>
</ftp-provider>
So the only property that has been added is the read-only property. This is all that is
needed by default, but this configuration then expects a jboss cache configuration file
named ftpfile-cache-config.xml on the root of your classpath. This can be overridden be
specifying the file to configure like this:
<ftp-listener name="FtpGateway"
busidref="helloFTPChannel"
maxThreads="1"
is-gateway="true"
<property
name="pollLatencySeconds" value="5"/>
<!-- Example of how one can specify a different configuration file
for jboss cache -->
<property name="remoteFileSystemStrategy-configFile"
value="ftpfile_cache_test_config.xml"/>
</ftp-listener>
The value of remoteFileSystemStrategy-configFile can either be a file path on the file
system, or a path on the classpath. I implementation will look for the file on the file
system first and then look for it on the classpath.
It is also possible to specify a different implementation of the RemoteFileSystemStrategy
by using the following property:
<property name="remoteFileSystemStrategy-class"
value="some.class.that.implements.RemoteFileSystemStrategy"/>
Note that the cacheloader specified in the configuration uses hypersonics inmemory
database so if you close down all instances and restart them all files will be processes
again. But by configuring a "real" database this should not be an problem.
'ant run-readonly' will run the readonly version of the quickstart.
FTP bus that is read-only (no rename, post-delete etc)
------------------------------------------------------
Key: JBESB-533
URL:
http://jira.jboss.com/jira/browse/JBESB-533
Project: JBoss ESB
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: Adapters
Affects Versions: 4.0 Beta 1 Maintenance Pack 1
Reporter: Daniel Bevenius
Assigned To: Daniel Bevenius
Priority: Minor
Attachments: ftpfile_cache_test.xml, FtpFileCache.java, FtpFileCacheTest.java,
ReadOnlyRemoteFileSystemStrategy.java, ReadOnlyRemoteFileSystemStrategyTest.java,
RemoteFileSystemStrategy.java
I currently have a requirement to use the ftpbus to connect to an ftp server running on a
mainframe computer. The permissions that exists there are for the current file and it is
read only. This means that we cannot rename the file upon pickup and not move/delete after
processing it.
Proposed solutions:
1. Add a property to the ftp-message-filter, for example read-only="true".
This would probably make it more clear to the end user that the other properties like
post-delete, post-directory, work-suffix, post-delete, post-directory etc, are not valid
for this configuration. If the read-only value is true a subclass of RemoteGatewayListener
would be used. The current implementation sets the gatewayClass in the class
FtpListenerMapper line 80:
if(listener.getIsGateway()) {
listenerNode.setAttribute("gatewayClass",
RemoteGatewayListener.class.getName());
Is there another way to set the gatewayClass that I'm not aware of? I'll
investigate this and perhaps post a question to the design forum.
2. Add a strategy to the RemoteGatewayListener that handles delete and rename. The
default strategy would work like it does now but one would be able to specify a strategy
in the configuration to override it. The strategy to use would then be set in the
checkMyParams if the default strategy in not wanted.
I would appreciate any suggestions or comments.
I assigned this to myself only because I need to start on this as soon as possible.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira