Author |
Message
|
paranoid221 |
Posted: Fri Sep 12, 2008 10:00 am Post subject: SFTP from JavaCompute Node |
|
|
 Centurion
Joined: 03 Apr 2006 Posts: 101 Location: USA
|
Here's a scenario buddies.
In a broker flow I was reading a file from a directory on the broker box to get some data. This directory is actually an NFS mount of another directory on a remote machine. The corporate data security team has decided to do away with NFS mounts since it does not ensure data security.
So now I have to modify my flow to include SFTP calls to the remote machine to read the file. FTP is already pushed out as an option and hence I cannot use the File nodes in 6.1 which means I have to invariably do this in a JavaCOmpute node. From the googling I've done so far, writing Java code to make SFTP calls is not as straight forward as it is for FTP calls. Java has native support for FTP but it doesnot provide an API sort of thing to make SFTP calls. There are a couple of freeware Java libraries (Jcraft JSCH etc..) out there but Iam pretty sure they won't let me use any of those. SFTP server is built into AIX, and to validate this I logged into the broker AIX box and successfully SFTP'ed a couple of files onto another AIX machine.
Given the above information, how do I start writing the Java Code in JavaCompute node to make an SFTP call to a remote machine.
Any thoughts on this?? _________________ LIFE is a series of complex calculations, somewhere multiplied by ZERO. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Sep 12, 2008 11:53 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
SFTP for java is pretty much the same as FTP but using an SSL socket implementation.... Have you looked at http://j-ftp.sourceforge.net/?
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
paranoid221 |
Posted: Fri Sep 12, 2008 1:27 pm Post subject: |
|
|
 Centurion
Joined: 03 Apr 2006 Posts: 101 Location: USA
|
Heyy saper,
Are you suggesting to use the jftp source code as my starting point for using the API exposed by it and build my classes for implementing in broker?
If yes, then I suppose it cannot happen. The client I'm working with are against the usage of open source software (there are a few exceptions and even in those cases the open source package needs to go through their rigorous 1 year long testing cycle).
I was trying to see if I can write the code in a JavaCompute node to make an SFTP call without using any third party library. _________________ LIFE is a series of complex calculations, somewhere multiplied by ZERO. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Sep 12, 2008 2:01 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
paranoid221 wrote: |
Heyy saper,
Are you suggesting to use the jftp source code as my starting point for using the API exposed by it and build my classes for implementing in broker?
If yes, then I suppose it cannot happen. The client I'm working with are against the usage of open source software (there are a few exceptions and even in those cases the open source package needs to go through their rigorous 1 year long testing cycle).
I was trying to see if I can write the code in a JavaCompute node to make an SFTP call without using any third party library. |
I just thought that it might give you interesting pointers to write your stuff as the source code is usually accessible, and you might not have to go through a year long approval process for something you wrote.... Sorry for them forcing you to reinvent the wheel.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
paranoid221 |
Posted: Fri Sep 12, 2008 2:10 pm Post subject: |
|
|
 Centurion
Joined: 03 Apr 2006 Posts: 101 Location: USA
|
Ah.. I can see where you are coming from.
I've already gone that approach and still investigating. I got the JSCH library from JCraft.com, decompiled the classes to get the source code to see how its being done. That package seems to have been built from the ground up in the sense that you'll see all kinds of low level implementations inside it.
More specifically, you'll see that there is session handling/management classes, buffer management, socket management etc. At the higher levels there are classes to manage and work with user credentials and other auth types.
I've put in a request to see if my organization has any approved SFTP libraries for developers to build SFTP clients on. Lets see how far that gets me. Otherwise, I'll put in a request to the environment team to start evaluating/researching the free libraries and the commercial variants like JScape Secure FTP Factory. _________________ LIFE is a series of complex calculations, somewhere multiplied by ZERO. |
|
Back to top |
|
 |
paranoid221 |
Posted: Thu Oct 16, 2008 9:29 pm Post subject: |
|
|
 Centurion
Joined: 03 Apr 2006 Posts: 101 Location: USA
|
Finally found my way through this. All convincing at the higher levels said and done.
The outcome:
I've used the open source TrileadSSH for Java, imported into my project as an external jar and used the API exposed by it.
I've also considered JFTP and JSCH but they appeared to be very crude and rudimentary.
SSHTools was also an awesome libray if you want to build SFTP clients using Java and was a pretty fierce competitor to the Trilead package. The tie-breaker really was the type of open source license each one came with. SSHTools is a GPL type license which is considered as not-so-opensource-friednly.
Trilead is distributed with a BSD style licence and hence gets a big Thumbs-up
Trilead is very easy to use and works like a charm.  _________________ LIFE is a series of complex calculations, somewhere multiplied by ZERO. |
|
Back to top |
|
 |
IntegratorWMB |
Posted: Wed Oct 22, 2008 6:53 am Post subject: |
|
|
Apprentice
Joined: 06 Dec 2007 Posts: 27
|
|
Back to top |
|
 |
|