Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[dsdp-tm-dev] RE: RSE 2.0 API questions

Hello Anna,

it slightly depends on whether you need your code (plugin)
to be able and run unchanged (binary compatible) on any
future RSE versions or not.

If this is not so important for you, because you'd need
to change your plugin when RSE changes from 2.0 to 3.0
anyways, then I'd recommend just using the internal classes
and keeping the rest of your code unchanged.

If you need / want to be truly API compatible, see the 
EclipseCon Tutorial from last year for how to write code
that runs on the remote and parses output. You can either
install an IHostShellOutputListener, or run a 
SimpleCommandOperation.

http://www.eclipsecon.org/2007/index.php?page=sub/&id=3651
get the slides and sample code from there

Cheers,
--
Martin Oberhuber, Senior Member of Technical Staff, Wind River
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
 
 

> -----Original Message-----
> From: Anna [mailto:adushistova@xxxxxxxxxxxxx] 
> Sent: Sunday, December 23, 2007 1:13 AM
> To: Oberhuber, Martin
> Subject: RSE 2.0 API questions
> 
> Hi Martin,
> I'm working on moving our code to RSE 2.0.2,
> and I have a question.
> We need to run a command on a target and then parse the output.
> With RSE 1.0 we did it this way:
> SshConnectorService connectorService = RSEHelper
>                 .createSshSessionProvider(targetHost);
> 
>         if (!connectorService.isConnected()
>                 || connectorService.getSession() == null) {
>             return Status.CANCEL_STATUS;
>         }
> 
>         ChannelExec channelExec = null;
>         InputStream in = null;
>         try {
>             Channel channel =
> connectorService.getSession().openChannel("exec"); //$NON-NLS-1$
>             channelExec = (ChannelExec) channel;
>             channelExec.setCommand(fetchScript);
>             channelExec.connect();
> 
>             in = channelExec.getInputStream();
> 
> But now, all ssh stuff is made internal.
> I tried to use IRemoteCmdSubSystem.runCommand method,
> but have no idea how to get the actual input/output stream from it.
> What API should I use now for the similar behaviour of the code above?
> Am I missing anything here?
> 
> Thanks a lot!
> Anna.
> 
> 


Back to the top