From 65749186503c8a2c3a84b28dc9a3c52a92554d27 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Sat, 26 Feb 2022 18:44:53 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20la=20possibilit=C3=A9=20d'ajouter?= =?UTF-8?q?=20une=20command=20de=20retour=20pour=20un=20ProtocolReader?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domains/server/MulticastServerListener.java | 1 - .../lightcontainer/protocol/ProtocolReader.java | 16 +++++++++++++++- .../repository/StoreProcessorRepository.java | 1 - 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/lightcontainer/domains/server/MulticastServerListener.java b/app/src/main/java/lightcontainer/domains/server/MulticastServerListener.java index 9f0ffc7..98996f3 100644 --- a/app/src/main/java/lightcontainer/domains/server/MulticastServerListener.java +++ b/app/src/main/java/lightcontainer/domains/server/MulticastServerListener.java @@ -71,7 +71,6 @@ public class MulticastServerListener implements Runnable { // Create the store processor StoreProcessor storeProcessor = new StoreProcessor(socket, readerResult.getDomain(), null); // TODO : Voir comment on procède get via repo ou ici ?! // Add the store processor to its repository - this.repository.addStore(storeProcessor); } catch (IOException ignore) { ignore.printStackTrace(); diff --git a/app/src/main/java/lightcontainer/protocol/ProtocolReader.java b/app/src/main/java/lightcontainer/protocol/ProtocolReader.java index 89046df..295212c 100644 --- a/app/src/main/java/lightcontainer/protocol/ProtocolReader.java +++ b/app/src/main/java/lightcontainer/protocol/ProtocolReader.java @@ -12,7 +12,21 @@ public abstract class ProtocolReader { this.rulePattern = Pattern.compile(pattern); } - public abstract class ProtocolResult {} + public abstract class ProtocolResult { + + /** + * Command qui sera renvoyée par exemple au client + */ + private String resultCommand; + + public String getResultCommand() { + return resultCommand; + } + + public void setResultCommand(String resultCommand) { + this.resultCommand = resultCommand; + } + } /** * Permet de lancer la décomposition d'une commande pour en extraire les données diff --git a/app/src/main/java/lightcontainer/repository/StoreProcessorRepository.java b/app/src/main/java/lightcontainer/repository/StoreProcessorRepository.java index 4171a5b..7132a74 100644 --- a/app/src/main/java/lightcontainer/repository/StoreProcessorRepository.java +++ b/app/src/main/java/lightcontainer/repository/StoreProcessorRepository.java @@ -51,7 +51,6 @@ public class StoreProcessorRepository implements AutoCloseable, MulticastSPR { @Override public void addStore(StoreProcessor store) { this.handlers.add(store); - System.out.println(handlers.size()); } /**