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;
import fr.ill.ics.nscclient.notification.commandzone.sync.CommandZoneSyncEventClient;
import fr.ill.ics.nscclient.ploty.PlotyInstance;
import fr.ill.ics.nscclient.survey.SurveySubscriberImpl;
import fr.ill.ics.util.ConfigManager;
public class ChangeManager {
......@@ -51,7 +52,9 @@ public class ChangeManager {
DataNotificationClient.getInstance().readAndDispatch();
CommandZoneEventClient.getInstance().readAndDispatch();
CommandZoneSyncEventClient.getInstance().readAndDispatch();
if (ConfigManager.getInstance().getPlotyVersion() == 2) {
PlotyInstance.getInstance().readAndDispatch();
}
// Iterate the map of log subscribers.
Map<String, LogSubscriber> logSubscriberMap = LogSubscriber.getInstances();
......
......@@ -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.survey.SurveySubscriberImpl;
import fr.ill.ics.nscclient.variable.VariableManagerAccessor;
import fr.ill.ics.util.ConfigManager;
public class ServerSessionManager {
......@@ -151,8 +152,10 @@ public class ServerSessionManager {
SurveySubscriberImpl.getInstance(serverId).unsubscribe();
DataChangeSubscriber.getInstance(serverId).unsubscribe();
if (serverId.equals("real")) {
if (ConfigManager.getInstance().getPlotyVersion() == 2) {
PlotyInstance.getInstance().unsubscribe();
}
}
DataAccessor.getInstance(serverId).reset();
ServantManagerAccessor.getInstance(serverId).reset();
......@@ -188,6 +191,7 @@ public class ServerSessionManager {
}
if (serverId.equals("real")) {
if (ConfigManager.getInstance().getPlotyVersion() == 2) {
try {
PlotyInstance.getInstance().unsubscribe();
} catch (Exception e) {
......@@ -195,6 +199,7 @@ public class ServerSessionManager {
}
}
}
}
public ServantManagerAccessor getServantManagerAccessor() {
return ServantManagerAccessor.getInstance(serverId);
......
......@@ -615,6 +615,14 @@ public class ConfigManager {
return false;
}
public int getPlotyVersion() {
String value = getStringOrNothingAtAll("plotyVersion");
if (value != null) {
return Integer.valueOf(value);
}
return 1;
}
public boolean isRemoteClient() {
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