From 38daafe98883aa468348b12adaf40d7b2f9fbf2a Mon Sep 17 00:00:00 2001
From: legoc <legoc@ill.eu>
Date: Mon, 5 Sep 2022 12:54:07 +0200
Subject: [PATCH] Changed AddNewAtomicCommandBoxRequest and
 AddNewAtomicCommandBoxRequestAtEnd commandID to controllerName

---
 pom.xml                                       |  2 +-
 .../bridge/command/CommandZoneWrapper.java    | 20 ++++++-------------
 .../bridge/command/ControlCommandWrapper.java |  4 ++--
 .../bridge/command/ForLoopCommandWrapper.java |  4 ++--
 .../ICommandZoneSyncEventListener.java        |  4 ++--
 .../bridge/command/ScanCommandWrapper.java    |  2 +-
 .../ServerCommandZoneSyncListener.java        |  4 ++--
 .../command/CommandZoneAccessor.java          |  8 ++++----
 .../command/ServerBreakCommandBox.java        |  4 ++--
 .../nscclient/command/ServerCommandZone.java  |  8 ++++----
 .../command/ServerControlCommandBox.java      |  4 ++--
 .../command/ServerForLoopCommandBox.java      |  8 ++++----
 .../nscclient/command/ServerIfCommandBox.java |  8 ++++----
 .../command/ServerScanCommandBox.java         |  4 ++--
 .../sync/AddNewAtomicCommandBox.java          | 10 +++++-----
 .../sync/AddNewAtomicCommandBoxAtEnd.java     | 10 +++++-----
 .../sync/CommandZoneSyncEventClient.java      |  4 ++--
 .../sync/CommandZoneSyncEventNotifier.java    |  4 ++--
 18 files changed, 52 insertions(+), 60 deletions(-)

diff --git a/pom.xml b/pom.xml
index ac2dfa23..e64ab2fe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -61,7 +61,7 @@
 		<dependency>	
 			<groupId>fr.ill.ics</groupId>
 			<artifactId>nomadcommandsystem-messages</artifactId>
-			<version>0.0.32</version>
+			<version>0.0.33</version>
 		</dependency>	
 		<dependency>
             <groupId>fr.ill.ics</groupId>
diff --git a/src/main/java/fr/ill/ics/bridge/command/CommandZoneWrapper.java b/src/main/java/fr/ill/ics/bridge/command/CommandZoneWrapper.java
index fcbc8b6e..1505195a 100644
--- a/src/main/java/fr/ill/ics/bridge/command/CommandZoneWrapper.java
+++ b/src/main/java/fr/ill/ics/bridge/command/CommandZoneWrapper.java
@@ -202,19 +202,11 @@ public class CommandZoneWrapper implements ICommandZoneEventListener, ICommandZo
 	}
 
 	public AtomicCommandWrapper addNewCommand(String controllerName, boolean isSettings) {
-		int commandId = getCommandId(controllerName);
-		if (commandId != -1) {
-			return new AtomicCommandWrapper(serverCommandZone.addNewAtomicCommandBoxAtEnd(commandId, isSettings));
-		}
-		return null;
+		return new AtomicCommandWrapper(serverCommandZone.addNewAtomicCommandBoxAtEnd(controllerName, isSettings));
 	}
 
 	public AtomicCommandWrapper addNewCommand(String controllerName, boolean isSettings, IServerCommand serverCommandToShift, boolean above) {
-		int commandId = getCommandId(controllerName);
-		if (commandId != -1) {
-			return new AtomicCommandWrapper(serverCommandZone.addNewAtomicCommandBox(commandId, isSettings, serverCommandToShift.getServerCommandBox(), above));
-		}
-		return null;
+		return new AtomicCommandWrapper(serverCommandZone.addNewAtomicCommandBox(controllerName, isSettings, serverCommandToShift.getServerCommandBox(), above));
 	}
 	
 
@@ -329,13 +321,13 @@ public class CommandZoneWrapper implements ICommandZoneEventListener, ICommandZo
 	}
 
 	@Override
-	public void onAddNewAtomicCommandBoxAtEnd(ContainerType type, int commandBoxId, int commandId, boolean isSettings, int newCommandBoxId) {
-		commandZoneSyncListener.onAddNewAtomicCommandBoxAtEnd(type, commandBoxId, commandId, isSettings, newCommandBoxId);
+	public void onAddNewAtomicCommandBoxAtEnd(ContainerType type, int commandBoxId, String controllerName, boolean isSettings, int newCommandBoxId) {
+		commandZoneSyncListener.onAddNewAtomicCommandBoxAtEnd(type, commandBoxId, controllerName, isSettings, newCommandBoxId);
 	}
 
 	@Override
-	public void onAddNewAtomicCommandBox(ContainerType type, int commandBoxId, int commandId, boolean isSettings, int commandBoxIdToMove, boolean above, int newCommandBoxId) {
-		commandZoneSyncListener.onAddNewAtomicCommandBox(type, commandBoxId, commandId, isSettings, commandBoxIdToMove, above, newCommandBoxId);
+	public void onAddNewAtomicCommandBox(ContainerType type, int commandBoxId, String controllerName, boolean isSettings, int commandBoxIdToMove, boolean above, int newCommandBoxId) {
+		commandZoneSyncListener.onAddNewAtomicCommandBox(type, commandBoxId, controllerName, isSettings, commandBoxIdToMove, above, newCommandBoxId);
 	}
 
 	@Override
diff --git a/src/main/java/fr/ill/ics/bridge/command/ControlCommandWrapper.java b/src/main/java/fr/ill/ics/bridge/command/ControlCommandWrapper.java
index e2add0bd..cb14cdd2 100644
--- a/src/main/java/fr/ill/ics/bridge/command/ControlCommandWrapper.java
+++ b/src/main/java/fr/ill/ics/bridge/command/ControlCommandWrapper.java
@@ -61,11 +61,11 @@ public class ControlCommandWrapper extends CommandWrapper {
 	}
 	
 	public AtomicCommandWrapper addNewCommand(String controllerName, boolean isSettings) {
-		return new AtomicCommandWrapper(serverControlCommandBox.addNewAtomicCommandBoxAtEnd(getCommandId(controllerName), isSettings));
+		return new AtomicCommandWrapper(serverControlCommandBox.addNewAtomicCommandBoxAtEnd(controllerName, isSettings));
 	}
 
 	public AtomicCommandWrapper addNewCommand(String controllerName, boolean isSettings, IServerCommand serverCommandToShift, boolean above) {
-		return new AtomicCommandWrapper(serverControlCommandBox.addNewAtomicCommandBox(getCommandId(controllerName), isSettings, serverCommandToShift.getServerCommandBox(), above));
+		return new AtomicCommandWrapper(serverControlCommandBox.addNewAtomicCommandBox(controllerName, isSettings, serverCommandToShift.getServerCommandBox(), above));
 	}
 
 	public ScanCommandWrapper addNewScan(String scanName) {
diff --git a/src/main/java/fr/ill/ics/bridge/command/ForLoopCommandWrapper.java b/src/main/java/fr/ill/ics/bridge/command/ForLoopCommandWrapper.java
index b03e75f5..33569bdd 100644
--- a/src/main/java/fr/ill/ics/bridge/command/ForLoopCommandWrapper.java
+++ b/src/main/java/fr/ill/ics/bridge/command/ForLoopCommandWrapper.java
@@ -137,11 +137,11 @@ public class ForLoopCommandWrapper extends CommandWrapper implements IForLoopEve
 
 
 	public AtomicCommandWrapper addNewCommand(String controllerName, boolean isSettings) {
-		return new AtomicCommandWrapper(serverForLoopCommandBox.addNewAtomicCommandBoxAtEnd(getCommandId(controllerName), isSettings));
+		return new AtomicCommandWrapper(serverForLoopCommandBox.addNewAtomicCommandBoxAtEnd(controllerName, isSettings));
 	}
 
 	public AtomicCommandWrapper addNewCommand(String controllerName, boolean isSettings, IServerCommand serverCommandToShift, boolean above) {
-		return new AtomicCommandWrapper(serverForLoopCommandBox.addNewAtomicCommandBox(getCommandId(controllerName), isSettings, serverCommandToShift.getServerCommandBox(), above));
+		return new AtomicCommandWrapper(serverForLoopCommandBox.addNewAtomicCommandBox(controllerName, isSettings, serverCommandToShift.getServerCommandBox(), above));
 	}
 
 	public ScanCommandWrapper addNewScan(String scanName) {
diff --git a/src/main/java/fr/ill/ics/bridge/command/ICommandZoneSyncEventListener.java b/src/main/java/fr/ill/ics/bridge/command/ICommandZoneSyncEventListener.java
index 09f8dba9..48d750a2 100644
--- a/src/main/java/fr/ill/ics/bridge/command/ICommandZoneSyncEventListener.java
+++ b/src/main/java/fr/ill/ics/bridge/command/ICommandZoneSyncEventListener.java
@@ -22,8 +22,8 @@ import fr.ill.ics.nscclient.command.CommandZoneAccessor.ContainerType;
 
 public interface ICommandZoneSyncEventListener {
 
-	public void onAddNewAtomicCommandBoxAtEnd(ContainerType type, int commandBoxId, int commandId, boolean isSettings, int newCommandBoxId);
-	public void onAddNewAtomicCommandBox(ContainerType type, int commandBoxId, int commandId, boolean isSettings, int commandBoxIdToMove, boolean above, int newCommandBoxId);
+	public void onAddNewAtomicCommandBoxAtEnd(ContainerType type, int commandBoxId, String controllerName, boolean isSettings, int newCommandBoxId);
+	public void onAddNewAtomicCommandBox(ContainerType type, int commandBoxId, String controllerName, boolean isSettings, int commandBoxIdToMove, boolean above, int newCommandBoxId);
 	
 	public void onAddNewControlCommandBoxAtEnd(ContainerType type, int commandBoxId, int boxType, int newCommandBoxId);
 	public void onAddNewControlCommandBox(ContainerType type, int commandBoxId, int boxType, int commandBoxIdToMove, boolean above, int newCommandBoxId);
diff --git a/src/main/java/fr/ill/ics/bridge/command/ScanCommandWrapper.java b/src/main/java/fr/ill/ics/bridge/command/ScanCommandWrapper.java
index c8fe3807..4652fd43 100644
--- a/src/main/java/fr/ill/ics/bridge/command/ScanCommandWrapper.java
+++ b/src/main/java/fr/ill/ics/bridge/command/ScanCommandWrapper.java
@@ -42,7 +42,7 @@ public class ScanCommandWrapper extends CommandWrapper {
 	}
 
 	public AtomicCommandWrapper addNewCommand(String controllerName, boolean isSettings) {
-		return new AtomicCommandWrapper(serverScanCommandBox.addNewAtomicCommandBoxAtEnd(getCommandId(controllerName), isSettings));
+		return new AtomicCommandWrapper(serverScanCommandBox.addNewAtomicCommandBoxAtEnd(controllerName, isSettings));
 	}
 
 	public ScanCommandWrapper addNewScan(String scanName) {
diff --git a/src/main/java/fr/ill/ics/bridge/listeners/ServerCommandZoneSyncListener.java b/src/main/java/fr/ill/ics/bridge/listeners/ServerCommandZoneSyncListener.java
index 60b4f2d8..1f37ae06 100644
--- a/src/main/java/fr/ill/ics/bridge/listeners/ServerCommandZoneSyncListener.java
+++ b/src/main/java/fr/ill/ics/bridge/listeners/ServerCommandZoneSyncListener.java
@@ -22,8 +22,8 @@ import fr.ill.ics.nscclient.command.CommandZoneAccessor.ContainerType;
 
 public interface ServerCommandZoneSyncListener {
 
-	public void onAddNewAtomicCommandBoxAtEnd(ContainerType type, int commandBoxId, int commandId, boolean isSettings, int newCommandBoxId);
-	public void onAddNewAtomicCommandBox(ContainerType type, int commandBoxId, int commandId, boolean isSettings, int commandBoxIdToMove, boolean above, int newCommandBoxId);
+	public void onAddNewAtomicCommandBoxAtEnd(ContainerType type, int commandBoxId, String controllerName, boolean isSettings, int newCommandBoxId);
+	public void onAddNewAtomicCommandBox(ContainerType type, int commandBoxId,String controllerName, boolean isSettings, int commandBoxIdToMove, boolean above, int newCommandBoxId);
 	
 	public void onAddNewControlCommandBoxAtEnd(ContainerType type, int commandBoxId, int boxType, int newCommandBoxId);
 	public void onAddNewControlCommandBox(ContainerType type, int commandBoxId, int boxType, int commandBoxIdToMove, boolean above, int newCommandBoxId);
diff --git a/src/main/java/fr/ill/ics/nscclient/command/CommandZoneAccessor.java b/src/main/java/fr/ill/ics/nscclient/command/CommandZoneAccessor.java
index 6a508425..0b06c73e 100644
--- a/src/main/java/fr/ill/ics/nscclient/command/CommandZoneAccessor.java
+++ b/src/main/java/fr/ill/ics/nscclient/command/CommandZoneAccessor.java
@@ -1605,7 +1605,7 @@ public class CommandZoneAccessor {
 		return content;
 	}
 
-	public synchronized ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(ContainerType containerType, int commandBoxID, int commandID, boolean isSettings) {
+	public synchronized ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(ContainerType containerType, int commandBoxID, String controllerName, boolean isSettings) {
 
 		// Create the message type.
 		CommandZoneRequests.Message type = CommandZoneRequests.Message.newBuilder()
@@ -1617,7 +1617,7 @@ public class CommandZoneAccessor {
 				.setClientID(getClientID())
 				.setType(convertContainerType(containerType))
 				.setContainerID(commandBoxID)
-				.setCommandID(commandID)
+				.setControllerName(controllerName)
 				.setIsSettings(isSettings)
 				.build();
 
@@ -1641,7 +1641,7 @@ public class CommandZoneAccessor {
 		return null;
 	}
 
-	public synchronized ServerAtomicCommandBox addNewAtomicCommandBox(ContainerType containerType, int commandBoxID, int commandID, boolean isSettings, int commandBoxIDToMove, boolean above) {
+	public synchronized ServerAtomicCommandBox addNewAtomicCommandBox(ContainerType containerType, int commandBoxID, String controllerName, boolean isSettings, int commandBoxIDToMove, boolean above) {
 
 		// Create the message type.
 		CommandZoneRequests.Message type = CommandZoneRequests.Message.newBuilder()
@@ -1653,7 +1653,7 @@ public class CommandZoneAccessor {
 				.setClientID(getClientID())
 				.setType(convertContainerType(containerType))
 				.setContainerID(commandBoxID)
-				.setCommandID(commandID)
+				.setControllerName(controllerName)
 				.setIsSettings(isSettings)
 				.setCommandBoxIDToMove(commandBoxIDToMove)
 				.setAbove(above)
diff --git a/src/main/java/fr/ill/ics/nscclient/command/ServerBreakCommandBox.java b/src/main/java/fr/ill/ics/nscclient/command/ServerBreakCommandBox.java
index 5f4cb25c..8abdcfef 100644
--- a/src/main/java/fr/ill/ics/nscclient/command/ServerBreakCommandBox.java
+++ b/src/main/java/fr/ill/ics/nscclient/command/ServerBreakCommandBox.java
@@ -31,12 +31,12 @@ public class ServerBreakCommandBox extends ServerControlCommandBox {
 		return new LinkedHashSet<ServerCommandBox>();
 	}
 	
-	public ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(int commandID, boolean isSettings) {
+	public ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(String controllerName, boolean isSettings) {
 		// Must never be called.
 		return null;
 	}
 
-	public ServerAtomicCommandBox addNewAtomicCommandBox(int commandID, boolean isSettings, ServerCommandBox commandBoxToMove, boolean above) {
+	public ServerAtomicCommandBox addNewAtomicCommandBox(String controllerName, boolean isSettings, ServerCommandBox commandBoxToMove, boolean above) {
 		// Must never be called.
 		return null;
 	}
diff --git a/src/main/java/fr/ill/ics/nscclient/command/ServerCommandZone.java b/src/main/java/fr/ill/ics/nscclient/command/ServerCommandZone.java
index 978c7172..28a0aaf0 100644
--- a/src/main/java/fr/ill/ics/nscclient/command/ServerCommandZone.java
+++ b/src/main/java/fr/ill/ics/nscclient/command/ServerCommandZone.java
@@ -51,12 +51,12 @@ public class ServerCommandZone {
 		return CommandZoneAccessor.getInstance(serverId).getContent(CommandZoneAccessor.ContainerType.COMMANDZONE, commandZoneId);
 	}
 	
-	public ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(int commandID, boolean isSettings) {
-		return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBoxAtEnd(CommandZoneAccessor.ContainerType.COMMANDZONE, commandZoneId, commandID, isSettings);
+	public ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(String controllerName, boolean isSettings) {
+		return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBoxAtEnd(CommandZoneAccessor.ContainerType.COMMANDZONE, commandZoneId, controllerName, isSettings);
 	}
 	
-	public ServerAtomicCommandBox addNewAtomicCommandBox(int commandID, boolean isSettings, ServerCommandBox commandBoxToMove, boolean above) {
-		return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBox(CommandZoneAccessor.ContainerType.COMMANDZONE, commandZoneId, commandID, isSettings, commandBoxToMove.getId(), above);
+	public ServerAtomicCommandBox addNewAtomicCommandBox(String controllerName, boolean isSettings, ServerCommandBox commandBoxToMove, boolean above) {
+		return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBox(CommandZoneAccessor.ContainerType.COMMANDZONE, commandZoneId, controllerName, isSettings, commandBoxToMove.getId(), above);
 	}
 	
 	public ServerGenericCommandBox addNewGenericCommandBox(int boxType, ServerCommandBox commandBoxToMove, boolean above) {
diff --git a/src/main/java/fr/ill/ics/nscclient/command/ServerControlCommandBox.java b/src/main/java/fr/ill/ics/nscclient/command/ServerControlCommandBox.java
index f7ee0278..82e1efee 100644
--- a/src/main/java/fr/ill/ics/nscclient/command/ServerControlCommandBox.java
+++ b/src/main/java/fr/ill/ics/nscclient/command/ServerControlCommandBox.java
@@ -69,9 +69,9 @@ public abstract class ServerControlCommandBox extends ServerCommandBox {
 	
 	public abstract Set<ServerCommandBox> getContent();
 	
-	public abstract ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(int commandID, boolean isSettings);
+	public abstract ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(String controllerName, boolean isSettings);
 
-	public abstract ServerAtomicCommandBox addNewAtomicCommandBox(int commandID, boolean isSettings, ServerCommandBox commandBoxToMove, boolean above);
+	public abstract ServerAtomicCommandBox addNewAtomicCommandBox(String controllerName, boolean isSettings, ServerCommandBox commandBoxToMove, boolean above);
 
 	public abstract ServerScanCommandBox addNewScanCommandBoxAtEnd(String scanName);
 
diff --git a/src/main/java/fr/ill/ics/nscclient/command/ServerForLoopCommandBox.java b/src/main/java/fr/ill/ics/nscclient/command/ServerForLoopCommandBox.java
index 5cc5a7a5..63c0a3d5 100644
--- a/src/main/java/fr/ill/ics/nscclient/command/ServerForLoopCommandBox.java
+++ b/src/main/java/fr/ill/ics/nscclient/command/ServerForLoopCommandBox.java
@@ -108,12 +108,12 @@ public class ServerForLoopCommandBox extends ServerCommandBox {
 		return CommandZoneAccessor.getInstance(serverId).getContent(CommandZoneAccessor.ContainerType.FORLOOP, commandBoxId);
 	}
 
-	public ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(int commandID, boolean isSettings) {
-		return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBoxAtEnd(CommandZoneAccessor.ContainerType.FORLOOP, commandBoxId, commandID, isSettings);
+	public ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(String controllerName, boolean isSettings) {
+		return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBoxAtEnd(CommandZoneAccessor.ContainerType.FORLOOP, commandBoxId, controllerName, isSettings);
 	}
 
-	public ServerAtomicCommandBox addNewAtomicCommandBox(int commandID, boolean isSettings, ServerCommandBox commandBoxToMove, boolean above) {
-		return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBox(CommandZoneAccessor.ContainerType.FORLOOP, commandBoxId, commandID, isSettings, commandBoxToMove.getId(), above);
+	public ServerAtomicCommandBox addNewAtomicCommandBox(String controllerName, boolean isSettings, ServerCommandBox commandBoxToMove, boolean above) {
+		return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBox(CommandZoneAccessor.ContainerType.FORLOOP, commandBoxId, controllerName, isSettings, commandBoxToMove.getId(), above);
 	}
 
 	public ServerScanCommandBox addNewScanCommandBoxAtEnd(String scanName) {
diff --git a/src/main/java/fr/ill/ics/nscclient/command/ServerIfCommandBox.java b/src/main/java/fr/ill/ics/nscclient/command/ServerIfCommandBox.java
index d13844ad..0cedf16e 100644
--- a/src/main/java/fr/ill/ics/nscclient/command/ServerIfCommandBox.java
+++ b/src/main/java/fr/ill/ics/nscclient/command/ServerIfCommandBox.java
@@ -30,12 +30,12 @@ public class ServerIfCommandBox extends ServerControlCommandBox {
 		return CommandZoneAccessor.getInstance(serverId).getContent(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId);
 	}
 	
-	public ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(int commandID, boolean isSettings) {
-		return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBoxAtEnd(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId, commandID, isSettings);
+	public ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(String controllerName, boolean isSettings) {
+		return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBoxAtEnd(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId, controllerName, isSettings);
 	}
 
-	public ServerAtomicCommandBox addNewAtomicCommandBox(int commandID, boolean isSettings, ServerCommandBox commandBoxToMove, boolean above) {
-		return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBox(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId, commandID, isSettings, commandBoxToMove.getId(), above);
+	public ServerAtomicCommandBox addNewAtomicCommandBox(String controllerName, boolean isSettings, ServerCommandBox commandBoxToMove, boolean above) {
+		return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBox(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId, controllerName, isSettings, commandBoxToMove.getId(), above);
 	}
 
 	public ServerScanCommandBox addNewScanCommandBoxAtEnd(String scanName) {
diff --git a/src/main/java/fr/ill/ics/nscclient/command/ServerScanCommandBox.java b/src/main/java/fr/ill/ics/nscclient/command/ServerScanCommandBox.java
index 223e3173..3fe619e5 100644
--- a/src/main/java/fr/ill/ics/nscclient/command/ServerScanCommandBox.java
+++ b/src/main/java/fr/ill/ics/nscclient/command/ServerScanCommandBox.java
@@ -36,8 +36,8 @@ public class ServerScanCommandBox extends ServerCommandBox {
 		return CommandZoneAccessor.getInstance(serverId).getContent(CommandZoneAccessor.ContainerType.SCAN, commandBoxId);
 	}
 
-	public ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(int commandID, boolean isSettings) { 
-		return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBoxAtEnd(CommandZoneAccessor.ContainerType.SCAN, commandBoxId, commandID, isSettings);
+	public ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(String controllerName, boolean isSettings) { 
+		return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBoxAtEnd(CommandZoneAccessor.ContainerType.SCAN, commandBoxId, controllerName, isSettings);
 	}
 
 	public ServerScanCommandBox addNewScanCommandBoxAtEnd(String scanName) {
diff --git a/src/main/java/fr/ill/ics/nscclient/notification/commandzone/sync/AddNewAtomicCommandBox.java b/src/main/java/fr/ill/ics/nscclient/notification/commandzone/sync/AddNewAtomicCommandBox.java
index 8b2b184f..bacf72c0 100644
--- a/src/main/java/fr/ill/ics/nscclient/notification/commandzone/sync/AddNewAtomicCommandBox.java
+++ b/src/main/java/fr/ill/ics/nscclient/notification/commandzone/sync/AddNewAtomicCommandBox.java
@@ -22,24 +22,24 @@ import fr.ill.ics.nscclient.command.CommandZoneAccessor.ContainerType;
 
 public class AddNewAtomicCommandBox extends CommandZoneSyncEvent {
 
-	private int commandId;
+	private String controllerName;
 	private boolean isSettings;
 	private int commandBoxIdToMove;
 	private boolean above;
 	private int newCommandBoxId;
 	
-	public AddNewAtomicCommandBox(ContainerType type, int commandBoxId, int commandId, boolean isSettings, int commandBoxIdToMove, boolean above, int newCommandBoxId) {
+	public AddNewAtomicCommandBox(ContainerType type, int commandBoxId, String controllerName, boolean isSettings, int commandBoxIdToMove, boolean above, int newCommandBoxId) {
 		super(type, commandBoxId);
 
-		this.commandId = commandId;
+		this.controllerName = controllerName;
 		this.isSettings = isSettings;
 		this.commandBoxIdToMove = commandBoxIdToMove;
 		this.above = above;
 		this.newCommandBoxId = newCommandBoxId;
 	}
 
-	public int getCommandId() {
-		return commandId;
+	public String getControllerName() {
+		return controllerName;
 	}
 
 	public boolean isSettings() {
diff --git a/src/main/java/fr/ill/ics/nscclient/notification/commandzone/sync/AddNewAtomicCommandBoxAtEnd.java b/src/main/java/fr/ill/ics/nscclient/notification/commandzone/sync/AddNewAtomicCommandBoxAtEnd.java
index 59a6756c..7dbbec5d 100644
--- a/src/main/java/fr/ill/ics/nscclient/notification/commandzone/sync/AddNewAtomicCommandBoxAtEnd.java
+++ b/src/main/java/fr/ill/ics/nscclient/notification/commandzone/sync/AddNewAtomicCommandBoxAtEnd.java
@@ -22,20 +22,20 @@ import fr.ill.ics.nscclient.command.CommandZoneAccessor.ContainerType;
 
 public class AddNewAtomicCommandBoxAtEnd extends CommandZoneSyncEvent {
 
-	private int commandId;
+	private String controllerName;
 	private boolean isSettings;
 	private int newCommandBoxId;
 	
-	public AddNewAtomicCommandBoxAtEnd(ContainerType type, int commandBoxId, int commandId, boolean isSettings, int newCommandBoxId) {
+	public AddNewAtomicCommandBoxAtEnd(ContainerType type, int commandBoxId, String controllerName, boolean isSettings, int newCommandBoxId) {
 		super(type, commandBoxId);
 
-		this.commandId = commandId;
+		this.controllerName = controllerName;
 		this.isSettings = isSettings;
 		this.newCommandBoxId = newCommandBoxId;
 	}
 
-	public int getCommandId() {
-		return commandId;
+	public String getControllerName() {
+		return controllerName;
 	}
 
 	public boolean isSettings() {
diff --git a/src/main/java/fr/ill/ics/nscclient/notification/commandzone/sync/CommandZoneSyncEventClient.java b/src/main/java/fr/ill/ics/nscclient/notification/commandzone/sync/CommandZoneSyncEventClient.java
index 30970a1e..bd054dcb 100644
--- a/src/main/java/fr/ill/ics/nscclient/notification/commandzone/sync/CommandZoneSyncEventClient.java
+++ b/src/main/java/fr/ill/ics/nscclient/notification/commandzone/sync/CommandZoneSyncEventClient.java
@@ -317,7 +317,7 @@ public class CommandZoneSyncEventClient {
 		synchronized (commandZoneListeners) {
 			Iterator<ICommandZoneSyncEventListener> it = commandZoneListeners.iterator();
 			while (it.hasNext()) {
-				it.next().onAddNewAtomicCommandBox(event.getType(), event.getCommandBoxId(), event.getCommandId(), event.isSettings(), event.getCommandBoxIdToMove(), event.isAbove(), event.getNewCommandBoxId());
+				it.next().onAddNewAtomicCommandBox(event.getType(), event.getCommandBoxId(), event.getControllerName(), event.isSettings(), event.getCommandBoxIdToMove(), event.isAbove(), event.getNewCommandBoxId());
 			}
 		}
 	}
@@ -327,7 +327,7 @@ public class CommandZoneSyncEventClient {
 		synchronized (commandZoneListeners) {
 			Iterator<ICommandZoneSyncEventListener> it = commandZoneListeners.iterator();
 			while (it.hasNext()) {
-				it.next().onAddNewAtomicCommandBoxAtEnd(event.getType(), event.getCommandBoxId(), event.getCommandId(), event.isSettings(), event.getNewCommandBoxId());
+				it.next().onAddNewAtomicCommandBoxAtEnd(event.getType(), event.getCommandBoxId(), event.getControllerName(), event.isSettings(), event.getNewCommandBoxId());
 			}
 		}
 	}
diff --git a/src/main/java/fr/ill/ics/nscclient/notification/commandzone/sync/CommandZoneSyncEventNotifier.java b/src/main/java/fr/ill/ics/nscclient/notification/commandzone/sync/CommandZoneSyncEventNotifier.java
index 7be59365..6f7056a7 100644
--- a/src/main/java/fr/ill/ics/nscclient/notification/commandzone/sync/CommandZoneSyncEventNotifier.java
+++ b/src/main/java/fr/ill/ics/nscclient/notification/commandzone/sync/CommandZoneSyncEventNotifier.java
@@ -112,7 +112,7 @@ public class CommandZoneSyncEventNotifier {
 					return new AddNewAtomicCommandBoxAtEnd(
 							convertContainerType(request.getType()),
 							request.getContainerID(), 
-							request.getCommandID(),
+							request.getControllerName(),
 							request.getIsSettings(),
 							response.getValue());
 				}
@@ -126,7 +126,7 @@ public class CommandZoneSyncEventNotifier {
 					return new AddNewAtomicCommandBox(
 							convertContainerType(request.getType()),
 							request.getContainerID(), 
-							request.getCommandID(),
+							request.getControllerName(),
 							request.getIsSettings(),
 							request.getCommandBoxIDToMove(),
 							request.getAbove(),
-- 
GitLab