Commit 83f9c1dc authored by helene ortiz's avatar helene ortiz
Browse files

Get NomadServerEndpoint from ServerInstance instead of ConfigManager

(the latter does not take account of main/remote client types)
parent b5740287
4.0.31 13/08/2020
------
* Get NomadServerEndpoint from ServerInstance instead of ConfigManager (the latter does not take account of main/remote client types)
4.0.29 27/07/2020
------
* Correct bug command line request after token integration
......
......@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>fr.ill.ics</groupId>
<artifactId>nomadcommandsystem</artifactId>
<version>4.0.30</version>
<version>4.0.31-SNAPSHOT</version>
<name>NomadCommandSystem</name>
<description>Java bridge for the communication with the Nomad server</description>
<scm>
......
......@@ -34,6 +34,7 @@ import fr.ill.ics.cameo.ConnectionTimeout;
import fr.ill.ics.cameo.RequesterCreationException;
import fr.ill.ics.cameo.Server;
import fr.ill.ics.core.property.Property;
import fr.ill.ics.nscclient.serverconnection.ServerInstance;
import fr.ill.ics.nscclient.sessionmanagement.SessionManager;
import fr.ill.ics.ploty.DataPlotMessages;
import fr.ill.ics.ploty.DataPlotMessages.ClientInfo;
......@@ -85,13 +86,6 @@ public class PlotyInstance {
Application.Instance ploty = null;
String nomadServerEndpoint;
if (ConfigManager.getInstance().isMainClient()) {
nomadServerEndpoint = ConfigManager.getInstance().getNomadServerEndpoint();
} else {
// nomad endpoint is build from selected instrument
nomadServerEndpoint = "tcp://" + SessionManager.getInstance(CommandZoneWrapper.SERVER_ID).getInstrumentName() + ":7000";
}
// Client on a different machine as server
List<Info> info = server.getApplicationInfos(PLOTY_NAME);
if (info.isEmpty() == false) {
......@@ -100,7 +94,7 @@ public class PlotyInstance {
// restart ploty2
try {
String arg[] = {nomadServerEndpoint};
String arg[] = {ServerInstance.getInstance().getNomadServerEndpoint()};
ploty = server.start(PLOTY_NAME, arg);
} catch (ConnectionTimeout e) {
System.err.println("Timeout while starting " + PLOTY_NAME);
......
......@@ -606,6 +606,10 @@ public class ConfigManager {
return "tcp://localhost:7000";
}
/**
* Returns the endpoint of the server for main clients.
* @return
*/
public String getNomadServerEndpoint() {
String nomadServerEndpoint = getStringOrNothingAtAll("nomadServerEndpoint");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment