Commit 703d5aa3 authored by ics's avatar ics
Browse files

remote access management: add method serverExists in ServerInstance and

change nomadserverendpoint for remote clients
parent 9bef0593
......@@ -117,6 +117,13 @@ public class ServerConnection {
return true;
}
public boolean serverExists() {
serverInstance = ServerInstance.getInstance().getApplicationInstance(serverId);
return (serverInstance != null && serverInstance.exists());
}
/**
* Returns a string message for the current state
*/
......
......@@ -26,12 +26,20 @@ public class ServerInstance {
}
public void init() {
String nomadServerEndpoint = null;
// Get the server endpoint.
String nomadServerEndpoint = ConfigManager.getInstance().getNomadServerEndpoint();
if (ConfigManager.getInstance().isMainClient()) {
nomadServerEndpoint = ConfigManager.getInstance().getNomadServerEndpoint();
} else {
// nomad endpoint is build from selected instrument
//nomadServerEndpoint = return "tcp://" + SessionManager.getInstance(CommandZoneWrapper.SERVER_ID).getInstrumentName() + ":7000";
nomadServerEndpoint = "tcp://localhost:7000";
}
// Connect to the server.
server = new Server(nomadServerEndpoint);
System.out.println("in serverinstance after new Server(" + nomadServerEndpoint + ")");
}
public Application.Instance getApplicationInstance(String serverId) {
......
......@@ -570,10 +570,6 @@ public class ConfigManager {
public String getNomadServerEndpoint() {
/*if (isRemoteClient()) {
return "tcp://" + SessionManager.getInstance(CommandZoneWrapper.SERVER_ID).getInstrumentName() + ":7000";
}*/
String nomadServerEndpoint = getStringOrNothingAtAll("nomadServerEndpoint");
if (nomadServerEndpoint != null) {
......
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