mirror of
https://github.com/klmp200/PQT_Gestionnaire_vente_stock.git
synced 2024-11-22 08:13:20 +00:00
[CLIENT] Suppression des sysout de debug
This commit is contained in:
parent
b6f0db01a9
commit
f835120528
@ -43,8 +43,6 @@ class StartupProcedureHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void testConnection(){
|
private void testConnection(){
|
||||||
//TODO remove sysout
|
|
||||||
System.out.println("Test de connexion");
|
|
||||||
networkService.addListener(getPingListener(networkService));
|
networkService.addListener(getPingListener(networkService));
|
||||||
networkService.setActiveServer(host, port);
|
networkService.setActiveServer(host, port);
|
||||||
networkService.sendPQTPing(host, port);
|
networkService.sendPQTPing(host, port);
|
||||||
@ -52,8 +50,6 @@ class StartupProcedureHandler {
|
|||||||
|
|
||||||
private void useRequestedServer(){
|
private void useRequestedServer(){
|
||||||
//Server found
|
//Server found
|
||||||
//TODO remove sysout
|
|
||||||
System.out.println("Serveur trouvé");
|
|
||||||
firerer.fireServerFoundEvent(host, port);
|
firerer.fireServerFoundEvent(host, port);
|
||||||
accountService.addListener(getUpdateAccountListListener());
|
accountService.addListener(getUpdateAccountListListener());
|
||||||
accountService.refreshAccounts();
|
accountService.refreshAccounts();
|
||||||
@ -61,33 +57,22 @@ class StartupProcedureHandler {
|
|||||||
|
|
||||||
private void connectAccount(){
|
private void connectAccount(){
|
||||||
|
|
||||||
//TODO remove sysout
|
|
||||||
System.out.println("Connexion de compte");
|
|
||||||
|
|
||||||
//TODO remove try-catch(Throwable)
|
|
||||||
try {
|
try {
|
||||||
Account match = accountService.getAllAccounts().stream()
|
Account match = accountService.getAllAccounts().stream()
|
||||||
.filter(account -> account.getUsername().equals(username))
|
.filter(account -> account.getUsername().equals(username))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
|
|
||||||
//TODO remove sysout
|
|
||||||
System.out.println("Account match value : "+match);
|
|
||||||
|
|
||||||
if(match==null){
|
if(match==null){
|
||||||
//TODO remove sysout
|
|
||||||
System.out.println(" --> Compte inconnu");
|
|
||||||
//Compte spécifié inconnu
|
//Compte spécifié inconnu
|
||||||
firerer.fireUserAccountUnknownEvent(username);
|
firerer.fireUserAccountUnknownEvent(username);
|
||||||
firerer.fireStartupProcedureFinishedEvent(false);
|
firerer.fireStartupProcedureFinishedEvent(false);
|
||||||
}else{
|
}else{
|
||||||
//TODO remove sysout
|
|
||||||
System.out.println(" --> Compte connu");
|
|
||||||
accountService.setCurrentAccount(match);
|
accountService.setCurrentAccount(match);
|
||||||
accountService.addListener(getConnectAccountListener());
|
accountService.addListener(getConnectAccountListener());
|
||||||
accountService.logInCurrentAccount(StartupProcedureHandler.this.password);
|
accountService.logInCurrentAccount(StartupProcedureHandler.this.password);
|
||||||
}
|
}
|
||||||
}catch(Throwable e){
|
}catch(Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
firerer.fireStartupProcedureFinishedEvent(false);
|
firerer.fireStartupProcedureFinishedEvent(false);
|
||||||
}
|
}
|
||||||
@ -154,16 +139,12 @@ class StartupProcedureHandler {
|
|||||||
public void onAccountStatusChangedEvent(boolean status) {
|
public void onAccountStatusChangedEvent(boolean status) {
|
||||||
if(status){
|
if(status){
|
||||||
//Compte connecté
|
//Compte connecté
|
||||||
//TODO remove sysout
|
|
||||||
System.out.println("Connecté en tant que '"+username+"'");
|
|
||||||
|
|
||||||
StartupProcedureHandler.this.removeConnectAccountListener();
|
StartupProcedureHandler.this.removeConnectAccountListener();
|
||||||
firerer.fireUserAccountConnectedEvent(username);
|
firerer.fireUserAccountConnectedEvent(username);
|
||||||
firerer.fireStartupProcedureFinishedEvent(true);
|
firerer.fireStartupProcedureFinishedEvent(true);
|
||||||
}else{
|
}else{
|
||||||
//Compte non-connecté
|
//Compte non-connecté
|
||||||
//TODO remove sysout
|
|
||||||
System.out.println("Non-connecté en tant que '"+username+"'");
|
|
||||||
|
|
||||||
firerer.fireUserAccountDisconnectedEvent(username);
|
firerer.fireUserAccountDisconnectedEvent(username);
|
||||||
firerer.fireStartupProcedureFinishedEvent(false);
|
firerer.fireStartupProcedureFinishedEvent(false);
|
||||||
@ -172,6 +153,7 @@ class StartupProcedureHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAccountStatusNotChangedEvent(Throwable cause) {
|
public void onAccountStatusNotChangedEvent(Throwable cause) {
|
||||||
|
|
||||||
StartupProcedureHandler.this.removeConnectAccountListener();
|
StartupProcedureHandler.this.removeConnectAccountListener();
|
||||||
firerer.fireStartupProcedureFinishedEvent(false);
|
firerer.fireStartupProcedureFinishedEvent(false);
|
||||||
}
|
}
|
||||||
|
@ -57,14 +57,6 @@ class StockScreenModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Collection<Product> getProductCollection() {
|
Collection<Product> getProductCollection() {
|
||||||
{//TODO delete print block
|
|
||||||
System.out.println("------------------------------------------");
|
|
||||||
System.out.println("Stock service's list : ");
|
|
||||||
for(Product p : stockService.getProducts()){
|
|
||||||
System.out.println(p);
|
|
||||||
}
|
|
||||||
System.out.println("------------------------------------------");
|
|
||||||
}
|
|
||||||
return stockService.getProducts();
|
return stockService.getProducts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,13 +17,6 @@ public class HttpTextSender implements ITextSender{
|
|||||||
try {
|
try {
|
||||||
String trueURL = String.format("http://%s?%s", host, encode(text));
|
String trueURL = String.format("http://%s?%s", host, encode(text));
|
||||||
|
|
||||||
//TODO remove sysout
|
|
||||||
{
|
|
||||||
System.out.println(" --- --- ---");
|
|
||||||
System.out.println("Sending : ");
|
|
||||||
System.out.println(trueURL);
|
|
||||||
}
|
|
||||||
|
|
||||||
HttpURLConnection con = (HttpURLConnection) new URL(trueURL).openConnection();
|
HttpURLConnection con = (HttpURLConnection) new URL(trueURL).openConnection();
|
||||||
con.setRequestMethod("GET");
|
con.setRequestMethod("GET");
|
||||||
con.setRequestProperty("Content-Type", "application/json");
|
con.setRequestProperty("Content-Type", "application/json");
|
||||||
@ -43,12 +36,6 @@ public class HttpTextSender implements ITextSender{
|
|||||||
content.append(inputLine);
|
content.append(inputLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO remove sysout
|
|
||||||
{
|
|
||||||
System.out.println("Received : ");
|
|
||||||
System.out.println(content);
|
|
||||||
}
|
|
||||||
|
|
||||||
listener.onMessageReceivedEvent(content.toString());
|
listener.onMessageReceivedEvent(content.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,14 +67,6 @@ public class StockDao {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void replaceProductList(Collection<Product> products){
|
private synchronized void replaceProductList(Collection<Product> products){
|
||||||
{//TODO delete print block
|
|
||||||
System.out.println("------------------------------------------");
|
|
||||||
System.out.println("Stock dao's list : ");
|
|
||||||
for(Product p : products){
|
|
||||||
System.out.println(p);
|
|
||||||
}
|
|
||||||
System.out.println("------------------------------------------");
|
|
||||||
}
|
|
||||||
this.products.clear();
|
this.products.clear();
|
||||||
this.products.addAll(products);
|
this.products.addAll(products);
|
||||||
this.lastRefreshTimestamp = new Date();
|
this.lastRefreshTimestamp = new Date();
|
||||||
|
Loading…
Reference in New Issue
Block a user