Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Target Management » using RSE in OSGi containers (Equinox)(org.eclipse.rse.core has an unfortunatelly SWT dependency)
using RSE in OSGi containers (Equinox) [message #640228] Fri, 19 November 2010 17:05 Go to next message
Alex Pitigoi is currently offline Alex PitigoiFriend
Messages: 17
Registered: July 2009
Junior Member
Is there any recommendation on how RSE could be used in a server environment based on an OSGi container (Equinox) where SWT dependencies are not welcome?

Is the only choice remaining for such a usage scenario to build the necessary SSH functionality only based on JCraft/JSch direct dependency?

Any hint, suggestion and recommendation is highly appreciated.
Thanks,
Alex
Re: using RSE in OSGi containers (Equinox) [message #640558 is a reply to message #640228] Mon, 22 November 2010 13:49 Go to previous messageGo to next message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
Hi Alex,

RSE carries pretty heavy UI dependencies from its old heritage.

The Services layer is the only layer that's UI-less, so you could
probably leverage that if you need to exchange different communication
mechanisms over a single API. But even there, you'll have to play some
tricks to get rid of the IConnectorService, all of which implementations
require UI yet again.

In general, I think that in a UI-less Server environment you're better
off using the libs directly (i.e. JSch, commons.net), or you use ECF.

HTH,
Martin

Alex Pitigoi wrote:
> Is there any recommendation on how RSE could be used in a server
> environment based on an OSGi container (Equinox) where SWT dependencies
> are not welcome?
>
> Is the only choice remaining for such a usage scenario to build the
> necessary SSH functionality only based on JCraft/JSch direct dependency?
>
> Any hint, suggestion and recommendation is highly appreciated.
> Thanks,
> Alex
Re: using RSE in OSGi containers (Equinox) [message #640696 is a reply to message #640558] Mon, 22 November 2010 20:51 Go to previous messageGo to next message
Alex Pitigoi is currently offline Alex PitigoiFriend
Messages: 17
Registered: July 2009
Junior Member
Hi Martin,

My initial attempt was to rely solely on the Services layer, but that seems to have a org.eclipse.rse.core dependency which has the unfortunate SWT dependency. I am interested in the SSH/SFTP services, and I was wondering what kind of tricks are available to "get rid of the IConnectorService", if you can possibly provide some quick reference. Otherwise, I shall focus on the direct usage of JSch in an OSGi bundle, as I haven't identified any ECF services that would provide SSH/SFTP, unless you can recommend something specifically.

Thanks,
Alex
Re: using RSE in OSGi containers (Equinox) [message #640871 is a reply to message #640696] Tue, 23 November 2010 11:44 Go to previous messageGo to next message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
Hi Alex,

org.eclipse.rse.services.ssh does not depend on anything SWT like. To
instantiate SftpFileService, you need an ISshSessionProvider in the
constructor.

Since you cannot use the RSE SshConnectorService, you will need to make
your own implementation of ISshSessionProvider (could clone some code
from SshConnectorService#createSession(). That's quite simple.

The other IFileService implementation that doesn't need SWT at the
moment is LocalFileService, so you could replace your SSH/SFTP service
by local access easily.

services.files.ftp currently does have an rse.core (and thus SWT)
dependency but that's very thin (only IPropertySet) and could be removed
easily. I'd surely accept a contribution getting rid of this in Indigo
since having it was not wise in the first place. Then you could replace
SSH/Sftp with FTP/FTPS if you want. Please file a bug asking for removal
of IPropertySet from FTP if you want to go that route.

TCFFileService and WinCEFileService would be slightly harder to
refactor, but only because they use a single plugin for both the
services and the subsystem layer at the moment so splitting them up
would be possible. For DStoreFileService I don't see how you could get
rid of the dependency.

Your call what you want to do... use JSch directly if you don't see a
need for replacing a protocol in the future, or RSE IFileService if you
do think you'll want to replace the protocol, or use ECF.

ECF is the other protocol abstraction layer at Eclipse. ECF providers
currently exist for URL, HTTP/HTTPS, BitTorrent and XMPP [1]. I'm being
told that it's easy to add new providers; so you could also write your
ECF provider abstraction on top of JSch, there's enough example code
available. ECF has a history of being used on the server side, so I'm
sure you'd get good support from the ECF people writing such a provider.

[1]
http://wiki.eclipse.org/ECF_Providers#File_Transfer_.28org.e clipse.ecf.filetransfer.29

HTH,
Martin


Alex Pitigoi wrote:
> Hi Martin,
>
> My initial attempt was to rely solely on the Services layer, but that
> seems to have a org.eclipse.rse.core dependency which has the
> unfortunate SWT dependency. I am interested in the SSH/SFTP services,
> and I was wondering what kind of tricks are available to "get rid of the
> IConnectorService", if you can possibly provide some quick reference.
> Otherwise, I shall focus on the direct usage of JSch in an OSGi bundle,
> as I haven't identified any ECF services that would provide SSH/SFTP,
> unless you can recommend something specifically.
>
> Thanks,
> Alex
Re: using RSE in OSGi containers (Equinox) [message #640872 is a reply to message #640558] Tue, 23 November 2010 11:50 Go to previous message
Martin Oberhuber is currently offline Martin OberhuberFriend
Messages: 1007
Registered: July 2009
Senior Member
PS:

ECF does seem to have an exemplary provider for scp over JSch:
org.eclipse.ecf.provider.filetransfer.scp

I'm not sure about its status, nor whether scp is sufficient for you.
There is some risk that it might just transfer files but not support
browsing the directory tree.

On RSE side, an SCP provider that doesn't require the sftp-server on the
remote is in the works. See
https://bugs.eclipse.org/bugs/show_bug.cgi?id=213438

HTH
Martin
Previous Topic:How to create SubSystem Programatically?
Next Topic:IRemoteFile.exists() returns true but can't download file with following message
Goto Forum:
  


Current Time: Tue Apr 23 15:15:44 GMT 2024

Powered by FUDForum. Page generated in 0.03438 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top