Hi Kim
We need to download files created only today on a SFTP server. Initially I
thought the regular expression parameter could be used to do this, but now I
don't think its possible.

A further major design fault of the VFS mediator is that I don't think these
parameters can be programatically set.
This is not a design fault, but the way it was designed.. To Synapse, VFS is just a transport - underneath Axis2.. which makes things a bit distant. Ofcourse it may not be exactly what you want, but has use for some other common scenarios.. Synapse is expected to poll locations for new files.. you can poll directories and also provide a file name pattern.
Requirement: The SFTP server we need to connect to keeps every file the
partner creates, on it for months. We only need files with todays date in
the name. Unfortunately we cannot change the partners policy here or hwo
they name files.

The file naming scheme is:
CODEMMDDYYNN.TYPE
Where CODE is a set parameter
Where TYPE is a set parameter
Where NN is the increment number for files created within the day. So a *
here.
The rest is the date.

So the server may have 2000 files and 3 created today.
How can I download just those 3 ?

Originally I thought I could create the regular expresssion parameter in
Java code and pass to VFS.
But I don't think this is possible ?
Not to poll, but you can do this to write - i.e. dynamically decide the path to write. To poll, you should still be able to specify the regex such that MMDDYY matches any dates after today, quite easily..
VFS parameter are isolated from Synapse. Never thought Synapse would be so
inflexible.
Only solution left is to do it completely in a regular expression, not sure
this is feasible ?
Can a Java regular expression know the date today ?
Is this compatible with how VFS uses the expression ?

Is there any other way to set the VFS parameters ?

Alternative is to fix the way VFS parameters are set, e.g via a property
rather than inflexible text only. (However, if VFS is a proxy this cannot be
done either, because parameter cannot get set prior to proxy call)
OR
call VFS from Java - but then why use Synapse ?

A final solution is to use a Java program to write the synapse.xml file,
with the required text. Then hot-load the synapse.xml every midnight.
However, again, may as well just stick with Java solution.

This is about the last nail in the coffin for our problems with getting
Synapse to solve a simple mediation problem.
Seems like using pure Java might be a good workaround for your case for now, since you seem to be in a hurry, and all developers of Synapse are volunteers and thus we cannot guarantee any time frames for enhancements. We would be happy if you could open JIRA's though so that someone could attend to them when they have time.

cheers
asankha

--
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com




Reply via email to