Commit 6fab618d authored by yannick legoc's avatar yannick legoc
Browse files

reorganized command box accessor with command zone accessor.

parent d396f402
......@@ -315,9 +315,9 @@
<arg line="${protoFlags} ${protoDir}/ConditionManagerRequests.proto" />
</exec>
<echo message="Generating CommandBoxRequests.java" />
<echo message="Generating CommandZoneRequests.java" />
<exec executable="protoc">
<arg line="${protoFlags} ${protoDir}/commandzone/CommandBoxRequests.proto" />
<arg line="${protoFlags} ${protoDir}/CommandZoneRequests.proto" />
</exec>
</target>
......
......@@ -18,7 +18,7 @@
package fr.ill.ics.core.property;
import fr.ill.ics.nscclient.command.CommandBoxAccessor;
import fr.ill.ics.nscclient.command.CommandZoneAccessor;
import fr.ill.ics.nscclient.dataprovider.DataAccessor;
public class BooleanProperty extends Property {
......@@ -33,7 +33,7 @@ public class BooleanProperty extends Property {
public String getServerValue() {
// Don't use format for the moment. The value can only be "true" or "false"
if (isCommandBox) {
return Boolean.toString(CommandBoxAccessor.getInstance(serverId).getBooleanValue(containerId, id));
return Boolean.toString(CommandZoneAccessor.getInstance(serverId).getBooleanValue(containerId, id));
} else {
return Boolean.toString(DataAccessor.getInstance(serverId).getBooleanValue(containerId, id));
}
......@@ -44,7 +44,7 @@ public class BooleanProperty extends Property {
//try {
boolean ok = true;
if (isCommandBox) {
ok = CommandBoxAccessor.getInstance(serverId).setBooleanValue(containerId, id, Boolean.valueOf(value).booleanValue());
ok = CommandZoneAccessor.getInstance(serverId).setBooleanValue(containerId, id, Boolean.valueOf(value).booleanValue());
} else {
ok = DataAccessor.getInstance(serverId).setBooleanValue(containerId, id, Boolean.valueOf(value).booleanValue());
if (!ok) {
......
......@@ -18,7 +18,7 @@
package fr.ill.ics.core.property;
import fr.ill.ics.nscclient.command.CommandBoxAccessor;
import fr.ill.ics.nscclient.command.CommandZoneAccessor;
import fr.ill.ics.nscclient.dataprovider.DataAccessor;
import fr.ill.ics.util.ConfigManager;
......@@ -31,7 +31,7 @@ public class Float64Property extends FloatProperty {
public String getServerValue() {
try {
if (isCommandBox) {
return this.propertyFormat.formatForDisplay(new Double(CommandBoxAccessor.getInstance(serverId).getFloat64Value(containerId, id)).toString());
return this.propertyFormat.formatForDisplay(new Double(CommandZoneAccessor.getInstance(serverId).getFloat64Value(containerId, id)).toString());
} else {
return this.propertyFormat.formatForDisplay(new Double(DataAccessor.getInstance(serverId).getFloat64Value(containerId, id)).toString());
}
......@@ -48,7 +48,7 @@ public class Float64Property extends FloatProperty {
boolean ok = isOk(serverValue);
if (ok) {
if (isCommandBox) {
ok = CommandBoxAccessor.getInstance(serverId).setFloat64Value(containerId, id, new Double(serverValue).doubleValue());
ok = CommandZoneAccessor.getInstance(serverId).setFloat64Value(containerId, id, new Double(serverValue).doubleValue());
} else {
ok = DataAccessor.getInstance(serverId).setFloat64Value(containerId, id, new Double(serverValue).doubleValue());
if (!ok) {
......
......@@ -18,7 +18,7 @@
package fr.ill.ics.core.property;
import fr.ill.ics.nscclient.command.CommandBoxAccessor;
import fr.ill.ics.nscclient.command.CommandZoneAccessor;
import fr.ill.ics.nscclient.dataprovider.DataAccessor;
import fr.ill.ics.util.ConfigManager;
......@@ -30,7 +30,7 @@ public class Int32Property extends IntegerProperty {
public String getServerValue() {
if (isCommandBox) {
return this.propertyFormat.formatForDisplay(new Integer(CommandBoxAccessor.getInstance(serverId).getInt32Value(containerId, id)).toString());
return this.propertyFormat.formatForDisplay(new Integer(CommandZoneAccessor.getInstance(serverId).getInt32Value(containerId, id)).toString());
} else {
return this.propertyFormat.formatForDisplay(new Integer(DataAccessor.getInstance(serverId).getInt32Value(containerId, id)).toString());
}
......@@ -43,7 +43,7 @@ public class Int32Property extends IntegerProperty {
boolean ok = isOk(serverValue);
if (ok) {
if (isCommandBox) {
ok = CommandBoxAccessor.getInstance(serverId).setInt32Value(containerId, id, new Integer(serverValue).intValue());
ok = CommandZoneAccessor.getInstance(serverId).setInt32Value(containerId, id, new Integer(serverValue).intValue());
} else {
ok = DataAccessor.getInstance(serverId).setInt32Value(containerId, id, new Integer(serverValue).intValue());
if (!ok) {
......
......@@ -18,7 +18,7 @@
package fr.ill.ics.core.property;
import fr.ill.ics.nscclient.command.CommandBoxAccessor;
import fr.ill.ics.nscclient.command.CommandZoneAccessor;
import fr.ill.ics.nscclient.dataprovider.DataAccessor;
public class StringProperty extends Property {
......@@ -29,7 +29,7 @@ public class StringProperty extends Property {
public String getServerValue() {
if (isCommandBox) {
return this.propertyFormat.formatForDisplay(CommandBoxAccessor.getInstance(serverId).getStringValue(containerId, id));
return this.propertyFormat.formatForDisplay(CommandZoneAccessor.getInstance(serverId).getStringValue(containerId, id));
} else {
return this.propertyFormat.formatForDisplay(DataAccessor.getInstance(serverId).getStringValue(containerId, id));
}
......@@ -41,7 +41,7 @@ public class StringProperty extends Property {
if (ok) {
// try {
if (isCommandBox) {
ok = CommandBoxAccessor.getInstance(serverId).setStringValue(containerId, id, serverValue);
ok = CommandZoneAccessor.getInstance(serverId).setStringValue(containerId, id, serverValue);
} else {
ok = DataAccessor.getInstance(serverId).setStringValue(containerId, id, serverValue);
if (!ok) {
......
......@@ -27,19 +27,19 @@ public class ServerAtomicCommandBox extends ServerCommandBox {
}
public int getCommandID() {
return CommandBoxAccessor.getInstance(serverId).getCommandID(commandBoxId);
return CommandZoneAccessor.getInstance(serverId).getCommandID(commandBoxId);
}
public boolean isSettings() {
return CommandBoxAccessor.getInstance(serverId).isSettings(commandBoxId);
return CommandZoneAccessor.getInstance(serverId).isSettings(commandBoxId);
}
public void setSettingsFileName(String filename) {
CommandBoxAccessor.getInstance(serverId).setSettingsFileName(commandBoxId, filename);
CommandZoneAccessor.getInstance(serverId).setSettingsFileName(commandBoxId, filename);
}
public String getSettingsFileName() {
return CommandBoxAccessor.getInstance(serverId).getSettingsFileName(commandBoxId);
return CommandZoneAccessor.getInstance(serverId).getSettingsFileName(commandBoxId);
}
public int getNumberOfCommandBoxes() {
......
......@@ -18,7 +18,7 @@
package fr.ill.ics.nscclient.command;
import fr.ill.ics.nscclient.command.CommandBoxAccessor.ExecutionPhaseState;
import fr.ill.ics.nscclient.command.CommandZoneAccessor.ExecutionPhaseState;
public abstract class ServerCommandBox {
......@@ -53,23 +53,23 @@ public abstract class ServerCommandBox {
}
public void toggleBackground() {
CommandBoxAccessor.getInstance(serverId).toggleBackground(commandBoxId);
CommandZoneAccessor.getInstance(serverId).toggleBackground(commandBoxId);
}
public void toggleParallel() {
CommandBoxAccessor.getInstance(serverId).toggleParallel(commandBoxId);
CommandZoneAccessor.getInstance(serverId).toggleParallel(commandBoxId);
}
public boolean isBackground() {
return CommandBoxAccessor.getInstance(serverId).isBackground(commandBoxId);
return CommandZoneAccessor.getInstance(serverId).isBackground(commandBoxId);
}
public boolean isParallel() {
return CommandBoxAccessor.getInstance(serverId).isParallel(commandBoxId);
return CommandZoneAccessor.getInstance(serverId).isParallel(commandBoxId);
}
public ExecutionPhaseState getExecutionState() {
return CommandBoxAccessor.getInstance(serverId).getExecutionState(commandBoxId);
return CommandZoneAccessor.getInstance(serverId).getExecutionState(commandBoxId);
}
public boolean isRunning() {
......@@ -85,19 +85,19 @@ public abstract class ServerCommandBox {
}
public void setModifiable(boolean isModifiable) {
CommandBoxAccessor.getInstance(serverId).setModifiable(commandBoxId, isModifiable);
CommandZoneAccessor.getInstance(serverId).setModifiable(commandBoxId, isModifiable);
}
public boolean isModifiable() {
return CommandBoxAccessor.getInstance(serverId).isModifiable(commandBoxId);
return CommandZoneAccessor.getInstance(serverId).isModifiable(commandBoxId);
}
public void stop() {
CommandBoxAccessor.getInstance(serverId).stop(commandBoxId);
CommandZoneAccessor.getInstance(serverId).stop(commandBoxId);
}
public int getProgression() {
return CommandBoxAccessor.getInstance(serverId).getProgression(commandBoxId);
return CommandZoneAccessor.getInstance(serverId).getProgression(commandBoxId);
}
public abstract int getNumberOfCommandBoxes();
......
......@@ -27,31 +27,31 @@ public class ServerGenericCommandBox extends ServerCommandBox {
}
public void setControllerName(String controllerName) {
CommandBoxAccessor.getInstance(serverId).setControllerName(commandBoxId, controllerName);
CommandZoneAccessor.getInstance(serverId).setControllerName(commandBoxId, controllerName);
}
public String getControllerName() {
return CommandBoxAccessor.getInstance(serverId).getControllerName(commandBoxId);
return CommandZoneAccessor.getInstance(serverId).getControllerName(commandBoxId);
}
public void setPropertyName(String propertyName) {
CommandBoxAccessor.getInstance(serverId).setPropertyName(commandBoxId, propertyName);
CommandZoneAccessor.getInstance(serverId).setPropertyName(commandBoxId, propertyName);
}
public String getPropertyName() {
return CommandBoxAccessor.getInstance(serverId).getPropertyName(commandBoxId);
return CommandZoneAccessor.getInstance(serverId).getPropertyName(commandBoxId);
}
public int getBoxType() {
return CommandBoxAccessor.getInstance(serverId).getBoxType(commandBoxId);
return CommandZoneAccessor.getInstance(serverId).getBoxType(commandBoxId);
}
public void setValue(String value) {
CommandBoxAccessor.getInstance(serverId).setValue(commandBoxId, value);
CommandZoneAccessor.getInstance(serverId).setValue(commandBoxId, value);
}
public String getValue() {
return CommandBoxAccessor.getInstance(serverId).getValue(commandBoxId);
return CommandZoneAccessor.getInstance(serverId).getValue(commandBoxId);
}
public int getNumberOfCommandBoxes() {
......
......@@ -25,7 +25,7 @@ import java.util.Map;
import fr.ill.ics.bridge.ControllerManager;
import fr.ill.ics.bridge.DriverManager;
import fr.ill.ics.bridge.ResourceManager;
import fr.ill.ics.nscclient.command.CommandBoxAccessor;
import fr.ill.ics.nscclient.command.CommandZoneAccessor;
import fr.ill.ics.nscclient.command.CommandZoneAccessorProxy;
import fr.ill.ics.nscclient.command.ControlCommandBoxAccessorProxy;
import fr.ill.ics.nscclient.command.ForLoopCommandBoxAccessorProxy;
......@@ -72,7 +72,7 @@ public class ServerSessionManager {
ServantManagerAccessor.getInstance(serverId).init();
CommandZoneAccessorProxy.getInstance(serverId).init();
CommandBoxAccessor.getInstance(serverId).init();
CommandZoneAccessor.getInstance(serverId).init();
ScanCommandBoxAccessorProxy.getInstance(serverId).init();
ForLoopCommandBoxAccessorProxy.getInstance(serverId).init();
ControlCommandBoxAccessorProxy.getInstance(serverId).init();
......@@ -158,7 +158,7 @@ public class ServerSessionManager {
ConditionManagerAccessor.getInstance(serverId).reset();
CommandBoxAccessor.getInstance(serverId).reset();
CommandZoneAccessor.getInstance(serverId).reset();
currentSession.logout();
currentSession = 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