Home » Eclipse Projects » DSDP - Target Management » Set daemon port programmatically
|
Re: Set daemon port programmatically [message #20636 is a reply to message #20625] |
Mon, 21 April 2008 15:12 |
David McKnight Messages: 244 Registered: July 2009 |
Senior Member |
|
|
Hi Denise,
In order to set the daemon port for a dstore connection, you'll need to
first get at the appropriate connector service. In some cases there may be
more than one connector service (for example, if you use a combination of
services like ftp files, with dstore shells). To get at the connector
services, you can call IHost.getConnectorServices(). For DStore, you'll
need to get the DStoreConnectorService. Once you have that, you can call
DStoreConnectorService.getRemoteServerLauncherProperties(). That should
return a RemoteServerLauncher (you'll have to cast to that). From there,
there is a setDaemonPort(int) method.
hope that helps,
Dave
"Denise Schmidt" <denise.schmidt@lmco.com> wrote in message
news:14493445faab485fba72818ff9067fee$1@www.eclipse.org...
>I am using RSE 2.0.3. I have written some plug in code to add a button to
>create a connection to a specific Unix machine. The code I have appears to
>take all the default values when creating the connection. What I'd like to
>know is how do I change the default port used to connect to the server
>daemon in my code? Here's what I have to create the connection:
>
> ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
>
> ISystemProfile profile =
> registry.getSystemProfileManager().getDefaultPrivateSystemPr ofile();
>
> String hostName = "eddea03.rck.atm.lmco.com";
>
> IHost host = registry.getHost(profile, hostName);
> if (host == null) {
> IRSESystemType sysType = RSECorePlugin.getTheCoreRegistry()
> .getSystemTypeById("org.eclipse.rse.systemtype.unix");
> host = registry.createHost(sysType,
> hostName,
> hostName,
> "Connection to Unix machine");
> }
>
> I've been searching the web and looking through RSE code but haven't found
> how to set the daemon port to something other than 4075.
> While I'm at it, my code doesn't actually connect all the way to the
> server as I don't get prompted for a user ID and password until I try to
> expand my home directory. I must be missing an additional call to
> complete the connection but I'm not sure what it is.
>
> Thanks for any help.
>
>
|
|
| | |
Re: Set daemon port programmatically [message #21966 is a reply to message #20625] |
Tue, 22 April 2008 15:36 |
Martin Oberhuber Messages: 1007 Registered: July 2009 |
Senior Member |
|
|
Hi Denise,
You can look at our Unit Tests how to programmatically create a connection:
org.eclipse.rse.tests / RSEBaseConnectionTestCase.getLinuxHost()
does the DStore thing. That also shows you how to avoid the UI
prompt. For the Daemon Port specifically, see RSEConnectionManager
line 256ff:
IConnectorService cs = connection.getConnectorServices()[0];
IServerLauncherProperties p = cs.getRemoteServerLauncherProperties();
if (p instanceof IRemoteServerLauncher) {
IRemoteServerLauncher launcher = (IRemoteServerLauncher) p;
launcher.setDaemonPort(daemonPortNum);
}
Xuan or DaveM might know more, if you ask on the Mailing List.
Cheers,
--
Martin Oberhuber, Senior Member of Technical Staff, Wind River
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
Denise Schmidt wrote:
> I am using RSE 2.0.3. I have written some plug in code to add a button
> to create a connection to a specific Unix machine. The code I have
> appears to take all the default values when creating the connection.
> What I'd like to know is how do I change the default port used to
> connect to the server daemon in my code? Here's what I have to create
> the connection:
>
> ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
>
> ISystemProfile profile =
> registry.getSystemProfileManager().getDefaultPrivateSystemPr ofile();
>
> String hostName = "eddea03.rck.atm.lmco.com";
>
> IHost host = registry.getHost(profile, hostName);
> if (host == null) {
> IRSESystemType sysType = RSECorePlugin.getTheCoreRegistry()
> .getSystemTypeById("org.eclipse.rse.systemtype.unix");
> host = registry.createHost(sysType,
> hostName,
> hostName,
> "Connection to Unix machine");
> }
>
> I've been searching the web and looking through RSE code but haven't
> found how to set the daemon port to something other than 4075.
> While I'm at it, my code doesn't actually connect all the way to the
> server as I don't get prompted for a user ID and password until I try to
> expand my home directory. I must be missing an additional call to
> complete the connection but I'm not sure what it is.
>
> Thanks for any help.
>
>
|
|
|
Re: Set daemon port programmatically [message #573823 is a reply to message #20625] |
Mon, 21 April 2008 15:12 |
David McKnight Messages: 244 Registered: July 2009 |
Senior Member |
|
|
Hi Denise,
In order to set the daemon port for a dstore connection, you'll need to
first get at the appropriate connector service. In some cases there may be
more than one connector service (for example, if you use a combination of
services like ftp files, with dstore shells). To get at the connector
services, you can call IHost.getConnectorServices(). For DStore, you'll
need to get the DStoreConnectorService. Once you have that, you can call
DStoreConnectorService.getRemoteServerLauncherProperties(). That should
return a RemoteServerLauncher (you'll have to cast to that). From there,
there is a setDaemonPort(int) method.
hope that helps,
Dave
"Denise Schmidt" <denise.schmidt@lmco.com> wrote in message
news:14493445faab485fba72818ff9067fee$1@www.eclipse.org...
>I am using RSE 2.0.3. I have written some plug in code to add a button to
>create a connection to a specific Unix machine. The code I have appears to
>take all the default values when creating the connection. What I'd like to
>know is how do I change the default port used to connect to the server
>daemon in my code? Here's what I have to create the connection:
>
> ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
>
> ISystemProfile profile =
> registry.getSystemProfileManager().getDefaultPrivateSystemPr ofile();
>
> String hostName = "eddea03.rck.atm.lmco.com";
>
> IHost host = registry.getHost(profile, hostName);
> if (host == null) {
> IRSESystemType sysType = RSECorePlugin.getTheCoreRegistry()
> .getSystemTypeById("org.eclipse.rse.systemtype.unix");
> host = registry.createHost(sysType,
> hostName,
> hostName,
> "Connection to Unix machine");
> }
>
> I've been searching the web and looking through RSE code but haven't found
> how to set the daemon port to something other than 4075.
> While I'm at it, my code doesn't actually connect all the way to the
> server as I don't get prompted for a user ID and password until I try to
> expand my home directory. I must be missing an additional call to
> complete the connection but I'm not sure what it is.
>
> Thanks for any help.
>
>
|
|
| | |
Re: Set daemon port programmatically [message #574107 is a reply to message #20625] |
Tue, 22 April 2008 15:36 |
Martin Oberhuber Messages: 1007 Registered: July 2009 |
Senior Member |
|
|
Hi Denise,
You can look at our Unit Tests how to programmatically create a connection:
org.eclipse.rse.tests / RSEBaseConnectionTestCase.getLinuxHost()
does the DStore thing. That also shows you how to avoid the UI
prompt. For the Daemon Port specifically, see RSEConnectionManager
line 256ff:
IConnectorService cs = connection.getConnectorServices()[0];
IServerLauncherProperties p = cs.getRemoteServerLauncherProperties();
if (p instanceof IRemoteServerLauncher) {
IRemoteServerLauncher launcher = (IRemoteServerLauncher) p;
launcher.setDaemonPort(daemonPortNum);
}
Xuan or DaveM might know more, if you ask on the Mailing List.
Cheers,
--
Martin Oberhuber, Senior Member of Technical Staff, Wind River
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
Denise Schmidt wrote:
> I am using RSE 2.0.3. I have written some plug in code to add a button
> to create a connection to a specific Unix machine. The code I have
> appears to take all the default values when creating the connection.
> What I'd like to know is how do I change the default port used to
> connect to the server daemon in my code? Here's what I have to create
> the connection:
>
> ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
>
> ISystemProfile profile =
> registry.getSystemProfileManager().getDefaultPrivateSystemPr ofile();
>
> String hostName = "eddea03.rck.atm.lmco.com";
>
> IHost host = registry.getHost(profile, hostName);
> if (host == null) {
> IRSESystemType sysType = RSECorePlugin.getTheCoreRegistry()
> .getSystemTypeById("org.eclipse.rse.systemtype.unix");
> host = registry.createHost(sysType,
> hostName,
> hostName,
> "Connection to Unix machine");
> }
>
> I've been searching the web and looking through RSE code but haven't
> found how to set the daemon port to something other than 4075.
> While I'm at it, my code doesn't actually connect all the way to the
> server as I don't get prompted for a user ID and password until I try to
> expand my home directory. I must be missing an additional call to
> complete the connection but I'm not sure what it is.
>
> Thanks for any help.
>
>
|
|
|
Goto Forum:
Current Time: Sat Apr 20 12:18:16 GMT 2024
Powered by FUDForum. Page generated in 0.03164 seconds
|