Commit 0ec1c595 authored by Locatelli's avatar Locatelli

Add plotyVersion server property

Do switch stuff between this version
parent 3fb0e8c1
...@@ -28,6 +28,7 @@ import fr.ill.ics.nscclient.notification.commandzone.CommandZoneEventClient; ...@@ -28,6 +28,7 @@ import fr.ill.ics.nscclient.notification.commandzone.CommandZoneEventClient;
import fr.ill.ics.nscclient.notification.commandzone.sync.CommandZoneSyncEventClient; import fr.ill.ics.nscclient.notification.commandzone.sync.CommandZoneSyncEventClient;
import fr.ill.ics.nscclient.ploty.PlotyInstance; import fr.ill.ics.nscclient.ploty.PlotyInstance;
import fr.ill.ics.nscclient.survey.SurveySubscriberImpl; import fr.ill.ics.nscclient.survey.SurveySubscriberImpl;
import fr.ill.ics.util.ConfigManager;
public class ChangeManager { public class ChangeManager {
...@@ -51,7 +52,9 @@ public class ChangeManager { ...@@ -51,7 +52,9 @@ public class ChangeManager {
DataNotificationClient.getInstance().readAndDispatch(); DataNotificationClient.getInstance().readAndDispatch();
CommandZoneEventClient.getInstance().readAndDispatch(); CommandZoneEventClient.getInstance().readAndDispatch();
CommandZoneSyncEventClient.getInstance().readAndDispatch(); CommandZoneSyncEventClient.getInstance().readAndDispatch();
PlotyInstance.getInstance().readAndDispatch(); if (ConfigManager.getInstance().getPlotyVersion() == 2) {
PlotyInstance.getInstance().readAndDispatch();
}
// Iterate the map of log subscribers. // Iterate the map of log subscribers.
Map<String, LogSubscriber> logSubscriberMap = LogSubscriber.getInstances(); Map<String, LogSubscriber> logSubscriberMap = LogSubscriber.getInstances();
......
...@@ -39,6 +39,7 @@ import fr.ill.ics.nscclient.servant.ConfigurationManager.LoadFailure; ...@@ -39,6 +39,7 @@ import fr.ill.ics.nscclient.servant.ConfigurationManager.LoadFailure;
import fr.ill.ics.nscclient.sessionmanagement.SessionManager.ClientAlreadyLaunchedException; import fr.ill.ics.nscclient.sessionmanagement.SessionManager.ClientAlreadyLaunchedException;
import fr.ill.ics.nscclient.survey.SurveySubscriberImpl; import fr.ill.ics.nscclient.survey.SurveySubscriberImpl;
import fr.ill.ics.nscclient.variable.VariableManagerAccessor; import fr.ill.ics.nscclient.variable.VariableManagerAccessor;
import fr.ill.ics.util.ConfigManager;
public class ServerSessionManager { public class ServerSessionManager {
...@@ -151,7 +152,9 @@ public class ServerSessionManager { ...@@ -151,7 +152,9 @@ public class ServerSessionManager {
SurveySubscriberImpl.getInstance(serverId).unsubscribe(); SurveySubscriberImpl.getInstance(serverId).unsubscribe();
DataChangeSubscriber.getInstance(serverId).unsubscribe(); DataChangeSubscriber.getInstance(serverId).unsubscribe();
if (serverId.equals("real")) { if (serverId.equals("real")) {
PlotyInstance.getInstance().unsubscribe(); if (ConfigManager.getInstance().getPlotyVersion() == 2) {
PlotyInstance.getInstance().unsubscribe();
}
} }
DataAccessor.getInstance(serverId).reset(); DataAccessor.getInstance(serverId).reset();
...@@ -188,11 +191,13 @@ public class ServerSessionManager { ...@@ -188,11 +191,13 @@ public class ServerSessionManager {
} }
if (serverId.equals("real")) { if (serverId.equals("real")) {
try { if (ConfigManager.getInstance().getPlotyVersion() == 2) {
PlotyInstance.getInstance().unsubscribe(); try {
} catch (Exception e) { PlotyInstance.getInstance().unsubscribe();
System.out.println("Cannot unsubscribe data change"); } catch (Exception e) {
} System.out.println("Cannot unsubscribe data change");
}
}
} }
} }
......
...@@ -615,6 +615,14 @@ public class ConfigManager { ...@@ -615,6 +615,14 @@ public class ConfigManager {
return false; return false;
} }
public int getPlotyVersion() {
String value = getStringOrNothingAtAll("plotyVersion");
if (value != null) {
return Integer.valueOf(value);
}
return 1;
}
public boolean isRemoteClient() { public boolean isRemoteClient() {
return remoteClient; return remoteClient;
} }
......
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