Commit 0df91acf authored by Jerome Locatelli's avatar Jerome Locatelli
Browse files

Merge of branch Instrument_RC_174

parent aef132ea
......@@ -124,6 +124,9 @@ public class Int64Array extends Array {
}
public boolean onlyContainsNegativeValues() {
if (array == null) {
return false;
}
for (int i = 0; i < array.length; i++) {
if (array[i] > 0) {
return false;
......
......@@ -123,6 +123,9 @@ public class Int8Array extends Array {
}
public boolean onlyContainsNegativeValues() {
if (array == null) {
return false;
}
for (int i = 0; i < array.length; i++) {
if (array[i] > 0) {
return false;
......
......@@ -60,11 +60,11 @@ public class PropertyParser extends GenericParser {
// ********************************************************************************
// ************************* Possible attributes **********************************
// ********************************************************************************
private final static String ATTRIBUTE_CONTROLLER_TYPE = "type";
protected final static String ATTRIBUTE_CONTROLLER_TYPE = "type";
private final static String ATTRIBUTE_PROPERTY_TYPE = "type";
private final static String ATTRIBUTE_PROPERTY_NAME = "name";
private final static String ATTRIBUTE_MAX_LENGTH = "max_length";
private final static String ATTRIBUTE_IS_UNDOABLE = "is_undoable";
protected final static String ATTRIBUTE_PROPERTY_NAME = "name";
protected final static String ATTRIBUTE_MAX_LENGTH = "max_length";
protected final static String ATTRIBUTE_IS_UNDOABLE = "is_undoable";
private final static String ATTRIBUTE_NB_DECIMAL_PLACES = "nb_decimal_places";
private final static String ATTRIBUTE_GREATER_THAN_VALUE = "value";
private final static String ATTRIBUTE_LOWER_THAN_VALUE = "value";
......@@ -76,9 +76,9 @@ public class PropertyParser extends GenericParser {
private final static String ATTRIBUTE_MAX_PROPERTY = "max_property";
private final static String ATTRIBUTE_MAX_EXCLUDED = "max_excluded";
private final static String ATTRIBUTE_DECIMAL_FORMAT_PROPERTY_NAME = "property_name";
private final static String ATTRIBUTE_SIZE_PROPERTY = "size_property";
protected final static String ATTRIBUTE_SIZE_PROPERTY = "size_property";
private String controllerType;
protected String controllerType;
private Map properties; // KEY=property name VALUE=PropertyDescriptor instance
private Map propertyTypes; // KEY=property name VALUE=property type
......
......@@ -23,6 +23,7 @@ import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import fr.ill.ics.bridge.command.CommandZoneWrapper;
import fr.ill.ics.nomadserver.core.DatabaseAccessor;
import fr.ill.ics.nomadserver.core.DatabaseAccessorHelper;
import fr.ill.ics.nomadserver.core.DatabaseAccessorPackage.BadPropertyTypeException;
......@@ -546,4 +547,11 @@ public class DataAccessor {
return databaseAccessor.getWholeScannableProperties(databaseID);
}
public static String getServerId(int databaseId) {
if (databaseId == 0) {
return CommandZoneWrapper.SERVER_ID;
}
return String.valueOf(databaseId);
}
}
\ No newline at end of file
......@@ -133,6 +133,16 @@ public class ServantDatabase {
}
public Set<String> getControllerTypes() {
Set<String> controllerTypes = new TreeSet<String>();
Iterator<ClientServantDescriptor> it = controllers.values().iterator();
while (it.hasNext()) {
controllerTypes.add(it.next().getType());
}
return controllerTypes;
}
public boolean controllerIsEnabled(String controllerName) {
ClientServantDescriptor descriptor = getControllerDescriptor(controllerName);
if (descriptor != null) {
......
......@@ -85,7 +85,7 @@ public class CommandZoneEventClient {
public void addCommandBoxListener(ICommandBoxEventListener listener) {
CommandZoneBoxKey key = new CommandZoneBoxKey(listener.getDatabaseID(), listener.getCommandBoxID());
CommandZoneBoxKey key = new CommandZoneBoxKey(listener.getDatabaseId(), listener.getCommandBoxID());
synchronized (commandBoxListeners) {
if (!commandBoxListeners.containsKey(key)) {
......@@ -97,7 +97,7 @@ public class CommandZoneEventClient {
public void removeCommandBoxListener(ICommandBoxEventListener listener) {
CommandZoneBoxKey key = new CommandZoneBoxKey(listener.getDatabaseID(), listener.getCommandBoxID());
CommandZoneBoxKey key = new CommandZoneBoxKey(listener.getDatabaseId(), listener.getCommandBoxID());
synchronized (commandBoxListeners) {
if (commandBoxListeners.containsKey(key)) {
......@@ -166,7 +166,7 @@ public class CommandZoneEventClient {
public void addForLoopListener(IForLoopEventListener listener) {
CommandZoneBoxKey key = new CommandZoneBoxKey(listener.getDatabaseID(), listener.getForLoopCommandBoxID());
CommandZoneBoxKey key = new CommandZoneBoxKey(listener.getDatabaseId(), listener.getForLoopCommandBoxID());
synchronized (forLoopListeners) {
if (!forLoopListeners.containsKey(key)) {
......@@ -178,7 +178,7 @@ public class CommandZoneEventClient {
public void removeCommandBoxListener(IForLoopEventListener listener) {
CommandZoneBoxKey key = new CommandZoneBoxKey(listener.getDatabaseID(), listener.getForLoopCommandBoxID());
CommandZoneBoxKey key = new CommandZoneBoxKey(listener.getDatabaseId(), listener.getForLoopCommandBoxID());
synchronized (forLoopListeners) {
if (forLoopListeners.containsKey(key)) {
......
......@@ -101,6 +101,11 @@ public class CorbaControllerManager extends ControllerManager implements ServerC
public Set<String> getControllersOfType(String type, boolean onlyVisibleOnes) {
return ServantDatabase.getInstance().getControllersOfType(type, onlyVisibleOnes);
}
public Set<String> getControllerTypes() {
return ServantDatabase.getInstance().getControllerTypes();
}
public boolean controllerIsEnabled(String controllerName) {
......
......@@ -66,7 +66,8 @@ public class CorbaServant implements Controller {
int commandId = CommandDatabase.getInstance().getCommandId(servantId, commandName);
if (commandId != -1) {
return DataAccessor.getInstance("real").getCommandState(databaseId, commandId);
String serverId = DataAccessor.getServerId(databaseId);
return DataAccessor.getInstance(serverId).getCommandState(0, commandId);
}
throw new UnknownCommandException();
......
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