7 Replies Latest reply on Dec 18, 2006 8:37 PM by estebanschifman

    FtpClientUtil refactoring

    bgeorges

      In order to add support for protocol such as Secure FTP over SSL and SSH, which could be implemented using either open or closed source implementation. We need flexibility to extend and configure the bus to support any of these implementations.
      We discussed with Esteban to start with the following approach:

      Create an Interface based on the existing FtpClientUtil

      core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystem.java

      Create a Factory
      core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java

      Implementation in the internal package
      Regular FTP:
      core/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java

      Secure FTP [over ssh]:
      core/rosetta/src/org/jboss/internal/soa/esb/util/JSchFtpImpl.java

      Others...

      update action classes to use the RemoteFileSystem factory
      core/listeners/src/org/jboss/soa/esb/actions/FtpUploader.java
      core/listeners/src/org/jboss/soa/esb/actions/FtpDownloader.java



      I will check these in the workspace.



        • 1. Re: FtpClientUtil refactoring
          kurtstam

          Looks good Bruno. Where will one configure which implementation one wants? In the PropertyManager?

          • 2. Re: FtpClientUtil refactoring
            bgeorges

            Kurt,
            This is where we left it . I believe this is one way of doing it.
            The factory will return the corresponding implementation. So far I haven't implemented this logic, instead I am focusing to get the EdtFtpImpl and JschFtpImpl class working. [Your input is welcome though :-) ]

            The method responsible for this in the factory looks like this so far:

            public static RemoteFileSystem getRemoteFileSystem(ConfigTree p_oP, boolean p_bConnect)
            throws RemoteFileSystemException
             {
             try
             {
             // TODO get the implementation class from properties.
            
             //ConfigTree cfgTree = ConfigTree.fromInputStream((InputStream)new FileInputStream("ftp-esb-properties.xml"));
             return new EdtFtpImpl(p_oP,p_bConnect);
             }



            • 3. Re: FtpClientUtil refactoring
              kurtstam

              Bruno, I think it makes sense to add a property to the PropertyManager configuration, which defines which implementation should be returned in the factory. All the other configuration should be added to the deployment-properties.xml, which I think is pretty much what you are going for. I can help you out with when it's integration time.

              Also by that time we need to refactor it to use the new Courier on the trunk. It supports setting up transports both ways (down and up). Take a look at the JmsCourier for instance. I think the FtpUploader and FtpDownloader fit right in there as an FtpCourier. But this is at a higher level then what you are working on right now, so let's not worry about that just yet.

              So basically I'm saying nothing but keep up the good work :).

              --Kurt

              • 4. Re: FtpClientUtil refactoring
                mark.proctor

                jboss esb can "push" to ftp, are there plans to receive? I'm looking at the apache ftp server, which works with ssl, and you can hook in events for file uploads.

                • 5. Re: FtpClientUtil refactoring
                  marklittle

                   

                  "mark.proctor@jboss.com" wrote:
                  jboss esb can "push" to ftp, are there plans to receive? I'm looking at the apache ftp server, which works with ssl, and you can hook in events for file uploads.


                  If something is sending a message via FTP then there's an assumption that there is something receiving. We don't have a requirement for a specific FTP server, if that's what you mean, in the same way we won't for HTTP. As long as whatever implementation you use conforms to the EPR requirements, you should be able to use anything.

                  • 6. Re: FtpClientUtil refactoring

                    We had it working 2-Way before with Rosetta. We should check with Esteban on this one as he is the one working on the couriers for this. I believe it is supported though.

                    • 7. Re: FtpClientUtil refactoring
                      estebanschifman

                      You are right Daniel. We can both 'deliver' and 'pick up' messages through FTP. The CourierFactory takes care of returning an appropriate courier for the protocol in the URL contained in the EPR argument.