From 253b463a97780776a17355b4a53e29adf55a5a43 Mon Sep 17 00:00:00 2001 From: "Notmoo-PC\\Notmoo" Date: Thu, 2 Nov 2017 17:21:42 +0100 Subject: [PATCH] =?UTF-8?q?Module=20Client,=20clss=20ClientBackEndModuleMa?= =?UTF-8?q?nager=20:=20ajout=20d'un=20listener=20sur=20NetworkService=20pe?= =?UTF-8?q?rmettant=20de=20mettre=20=C3=A0=20jours=20les=20modules=20sur?= =?UTF-8?q?=20r=C3=A9ception=20d'une=20config=20serveur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/ClientBackEndModuleManager.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Workspace/client/src/main/java/com/pqt/client/module/ClientBackEndModuleManager.java b/Workspace/client/src/main/java/com/pqt/client/module/ClientBackEndModuleManager.java index d7c12a3b..b97e7973 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/ClientBackEndModuleManager.java +++ b/Workspace/client/src/main/java/com/pqt/client/module/ClientBackEndModuleManager.java @@ -3,6 +3,7 @@ package com.pqt.client.module; import com.pqt.client.module.account.AccountService; import com.pqt.client.module.connection.ConnectionService; import com.pqt.client.module.network.NetworkService; +import com.pqt.client.module.network.listeners.INetworkServiceListener; import com.pqt.client.module.query.QueryExecutor; import com.pqt.client.module.sale.SaleService; import com.pqt.client.module.stat.StatService; @@ -24,6 +25,27 @@ public class ClientBackEndModuleManager { accountService = new AccountService(queryExecutor); statService = new StatService(queryExecutor); networkService = new NetworkService(queryExecutor, connectionService); + + networkService.addListener(new INetworkServiceListener() { + @Override + public void onPQTPingSuccessEvent(String host, Integer port) { + //No-op + } + + @Override + public void onPQTPingFailureEvent(String host, Integer port, Throwable cause) { + //No-op + } + + @Override + public void onNewServerConfigData() { + //On bind un refresh automatique des données + //sur la réception d'une nouvelle config serveur + stockService.refreshProductList(); + accountService.refreshAccounts(); + statService.refreshStats(); + } + }); } public SaleService getSaleService() {