Commit 82374a32 authored by yannick legoc's avatar yannick legoc
Browse files

Renamed IServant into IController.

parent 157a12aa
......@@ -296,7 +296,7 @@ public class ControllerManager implements ServerConfigurationChangeListener {
}
public void updateDynamicProperties(IServant servant) {
public void updateDynamicProperties(IController servant) {
Controller controller = (Controller)servant;
ServantManagerAccessor.getInstance(serverId).updateDynamicProperties(controller.getId());
}
......@@ -314,7 +314,7 @@ public class ControllerManager implements ServerConfigurationChangeListener {
reset();
}
public String getControllerNameWithRole(IServant servant, String role) {
public String getControllerNameWithRole(IController servant, String role) {
Controller controller = (Controller)servant;
return ServantManagerAccessor.getInstance(serverId).getControllerNameWithRole(controller.getId(), role);
}
......
......@@ -26,7 +26,7 @@ import fr.ill.ics.bridge.listeners.ServerProgressChangeListener;
import fr.ill.ics.bridge.listeners.ServerPropertyChangeListener;
import fr.ill.ics.bridge.listeners.ServerResetCommandListener;
public interface IServant {
public interface IController {
public String getName();
public String getType();
......@@ -47,7 +47,7 @@ public interface IServant {
public void addServerResetCommandListener(ServerResetCommandListener listener);
public void removeServerResetCommandListener(ServerResetCommandListener listener);
public IServant getLinkedController();
public IController getLinkedController();
public void updateDynamicProperties();
public int getDatabaseId();
......
......@@ -21,13 +21,13 @@ package fr.ill.ics.bridge.command;
import java.util.Map;
import java.util.Set;
import fr.ill.ics.bridge.IServant;
import fr.ill.ics.bridge.IController;
import fr.ill.ics.bridge.listeners.ServerPropertyChangeListener;
import fr.ill.ics.nscclient.command.ServerAtomicCommandBox;
import fr.ill.ics.nscclient.dataprovider.CommandDatabase;
import fr.ill.ics.nscclient.dataprovider.ServantDatabase;
public class AtomicCommandWrapper extends CommandWrapper implements IServant {
public class AtomicCommandWrapper extends CommandWrapper implements IController {
private ServerAtomicCommandBox serverAtomicCommandBox;
private int servantId;
......@@ -96,7 +96,7 @@ public class AtomicCommandWrapper extends CommandWrapper implements IServant {
// do nothing
}
public IServant getLinkedController() {
public IController getLinkedController() {
return null;
}
......
......@@ -21,7 +21,7 @@ package fr.ill.ics.core.command;
import java.util.HashMap;
import java.util.Map;
import fr.ill.ics.bridge.IServant;
import fr.ill.ics.bridge.IController;
import fr.ill.ics.bridge.command.AtomicCommandWrapper;
import fr.ill.ics.nscclient.dataprovider.CommandDatabase;
import fr.ill.ics.nscclient.servant.Servant;
......@@ -44,7 +44,7 @@ public class CommandManager {
return instance;
}
public Command getCommand(IServant controller, String commandName, boolean createExceptionIfNotFound, PluginType pluginType) throws CommandNotFoundException {
public Command getCommand(IController controller, String commandName, boolean createExceptionIfNotFound, PluginType pluginType) throws CommandNotFoundException {
// Create a new Map of commandName:Command instance if it doesn't exist for the abstract controller
if (controllerCommands == null) {
......
......@@ -33,7 +33,7 @@ import java.util.TreeSet;
import java.util.logging.Level;
import java.util.logging.Logger;
import fr.ill.ics.bridge.IServant;
import fr.ill.ics.bridge.IController;
import fr.ill.ics.bridge.ControllerManager;
import fr.ill.ics.bridge.DriverManager;
import fr.ill.ics.bridge.ResourceManager;
......@@ -126,7 +126,7 @@ public class PropertyManager {
boolean clientFilesExist = readPropertiesClientFilesFor(descriptor.getType());
if (clientFilesExist) {
IServant controller = DriverManager.getInstance().getDriver(descriptor.getName());
IController controller = DriverManager.getInstance().getDriver(descriptor.getName());
createPropertiesForController((Servant)controller);
if (dynamicPropertiesByControllerType != null && dynamicPropertiesByControllerType.containsKey(((Servant)controller).getType())) {
createDynamicPropertiesForController((Servant)controller);
......@@ -140,7 +140,7 @@ public class PropertyManager {
ClientServantDescriptor descriptor = it.next();
boolean clientFilesExist = readPropertiesClientFilesFor(descriptor.getType());
if (clientFilesExist) {
IServant controller = ControllerManager.getInstance().getController(descriptor.getName());
IController controller = ControllerManager.getInstance().getController(descriptor.getName());
createPropertiesForController((Servant)controller);
if (dynamicPropertiesByControllerType != null && dynamicPropertiesByControllerType.containsKey(((Servant)controller).getType())) {
createDynamicPropertiesForController((Servant)controller);
......@@ -166,7 +166,7 @@ public class PropertyManager {
Set<String> drivers = ServantDatabase.getInstance().getDriversOfType(type, false);
if (drivers != null && !drivers.isEmpty()) {
for (String driverName : drivers) {
IServant controller = DriverManager.getInstance().getDriver(driverName);
IController controller = DriverManager.getInstance().getDriver(driverName);
createPropertiesForController((Servant)controller);
if (dynamicPropertiesByControllerType != null && dynamicPropertiesByControllerType.containsKey(((Servant)controller).getType())) {
createDynamicPropertiesForController((Servant)controller);
......@@ -176,7 +176,7 @@ public class PropertyManager {
Set<String> controllers = ControllerManager.getInstance().getControllersOfType(type, false);
if (controllers != null && !controllers.isEmpty()) {
for (String controllerName : controllers) {
IServant controller = ControllerManager.getInstance().getController(controllerName);
IController controller = ControllerManager.getInstance().getController(controllerName);
createPropertiesForController((Servant)controller);
if (dynamicPropertiesByControllerType != null && dynamicPropertiesByControllerType.containsKey(((Servant)controller).getType())) {
createDynamicPropertiesForController((Servant)controller);
......@@ -304,7 +304,7 @@ public class PropertyManager {
* @return
* @throws PropertyNotFoundException
*/
public Property getProperty(IServant controller, String propertyName, PluginType pluginType) throws PropertyNotFoundException {
public Property getProperty(IController controller, String propertyName, PluginType pluginType) throws PropertyNotFoundException {
Property property;
if (controller instanceof Servant) {
property = getPropertyForServant((Servant)controller, propertyName);
......@@ -641,7 +641,7 @@ public class PropertyManager {
* @param propertyName
* @return
*/
public Property getDynamicPropertyChild(IServant controller, String realPropertyName, PluginType pluginType) throws PropertyNotFoundException {
public Property getDynamicPropertyChild(IController controller, String realPropertyName, PluginType pluginType) throws PropertyNotFoundException {
String parentPropertyName = realPropertyName.substring(0, realPropertyName.lastIndexOf("."));
int index = Integer.parseInt(realPropertyName.substring(realPropertyName.lastIndexOf(".")+1));
Property property = null;
......@@ -674,7 +674,7 @@ public class PropertyManager {
/**
* Search dynamic property
*/
public Property getDynamicProperty(IServant controller, String propertyName) throws PropertyNotFoundException {
public Property getDynamicProperty(IController controller, String propertyName) throws PropertyNotFoundException {
String parentPropertyName = propertyName.substring(0, propertyName.lastIndexOf("."));
int index = Integer.parseInt(propertyName.substring(propertyName.lastIndexOf(".")+1));
......@@ -882,7 +882,7 @@ public class PropertyManager {
* @param property
* @param isTrueString
*/
public void changeToString(IServant controller, Property property, boolean isTrueString) {
public void changeToString(IController controller, Property property, boolean isTrueString) {
if (controller instanceof AtomicCommandWrapper) {
AtomicCommandWrapper command = (AtomicCommandWrapper)controller;
CommandBoxKey key = new CommandBoxKey(command.getServerId(), command.getId());
......@@ -900,7 +900,7 @@ public class PropertyManager {
* @param property
* @param isTrueString
*/
public void changeDynamicToString(IServant controller, Property property, boolean isTrueString) {
public void changeDynamicToString(IController controller, Property property, boolean isTrueString) {
if (controller instanceof AtomicCommandWrapper) {
AtomicCommandWrapper command = (AtomicCommandWrapper)controller;
CommandBoxKey key = new CommandBoxKey(command.getServerId(), command.getId());
......@@ -970,7 +970,7 @@ public class PropertyManager {
*
* @param controller
*/
public void removeController(IServant controller) {
public void removeController(IController controller) {
if (controller instanceof AtomicCommandWrapper) {
AtomicCommandWrapper command = (AtomicCommandWrapper)controller;
CommandBoxKey key = new CommandBoxKey(command.getServerId(), command.getId());
......@@ -993,13 +993,13 @@ public class PropertyManager {
* @param dynamicPropertyName
* @return
*/
public int getNumberOfChildrenForDynamicProperty(IServant controller, String dynamicPropertyName) {
public int getNumberOfChildrenForDynamicProperty(IController controller, String dynamicPropertyName) {
int propertyId = PropertyDatabase.getInstance().getDynamicPropertyIdForServant(((Servant)controller).getId(), dynamicPropertyName);
return PropertyDatabase.getInstance().getNumberOfChildProperties(propertyId);
}
public int getNumberOfDecimalPlaces(IServant controller, String propertyName) {
public int getNumberOfDecimalPlaces(IController controller, String propertyName) {
try {
Property property = getProperty(controller, propertyName, PluginType.GENERAL);
if (property != null) {
......@@ -1023,7 +1023,7 @@ public class PropertyManager {
* @param propertyName
* @return
*/
public boolean isDynamic(IServant controller, String propertyName) {
public boolean isDynamic(IController controller, String propertyName) {
if (propertyMap.containsKey(((Servant)controller).getId())) {
Map map = propertyMap.get(((Servant)controller).getId());
if (map.containsKey(propertyName)) {
......
......@@ -21,7 +21,7 @@ package fr.ill.ics.nscclient.servant;
import java.util.Map;
import java.util.Set;
import fr.ill.ics.bridge.IServant;
import fr.ill.ics.bridge.IController;
import fr.ill.ics.bridge.ControllerManager;
import fr.ill.ics.bridge.listeners.ServerCommandStateChangeListener;
import fr.ill.ics.bridge.listeners.ServerProgressChangeListener;
......@@ -35,7 +35,7 @@ import fr.ill.ics.nscclient.dataprovider.PropertyDatabase;
import fr.ill.ics.nscclient.notification.DataNotificationClient;
public class Servant implements IServant {
public class Servant implements IController {
public class UnknownPropertyException extends Exception {};
public class UnknownCommandException extends Exception {};
......@@ -145,7 +145,7 @@ public class Servant implements IServant {
return servantDescriptor.getName();
}
public IServant getLinkedController() {
public IController getLinkedController() {
return this;
}
......
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