[
http://jira.jboss.com/jira/browse/JBESB-533?page=comments#action_12361665 ]
Daniel Bevenius commented on JBESB-533:
---------------------------------------
I have added a strategy so that it is possible to specify different strategies for a
read-only ftp server (comments removed):
public interface RemoteFileSystemStrategy
{
void init( String configFile ) throws Exception;
File[] filterFileList( File[] files ) throws GatewayException;
boolean deleteFile( File file ) throws GatewayException;
boolean renameFile( File from, File to ) throws GatewayException;
File getWorkFileName( File file, String suffix );
}
The default implementation does the same as what the RemoteGatewayListener did before.
RemoteGatewayListener just delegates now.
This lets us specify different implementations in the esb configuration file.
Every time that RemoteGatewayListeners's getFileList method is called it calls the
strategies filterFileList method.
I have written an implementation (ReadOnlyRemoteFileSystemStrategy.class) that uses JBoss
Cache to cache the filenames, and replicate to other members in the current cache cluster.
This also has a cache loader configured so that the file list is persisted. The cache can
be configured so that the files are only stored in the cache for a certain amount of time
(jgroups configuration). In our case the files on the ftp server will be archived every
day.
Having such a solution will prevent the esb from working with the same file more then
once.
I think that may be others have similar situations and perhaps this is something that
should be checked in?
I have not yet changed the ftp-message-filter to have the property read-only. If read-only
is true the ReadOnlyRemoteFileSystemStrategy could be used, but this could also be
overrridden in the config file if a different impl is to be used. Should I add this
property?
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
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