private void getForSale() { try { contr.updateForSale(marketobj.getForSale(client)); } catch (RemoteException e) { contr.remoteExceptionHandler(e); } }
private void getSold() { try { contr.updateSold(marketobj.getSold(client)); } catch (RemoteException e) { contr.remoteExceptionHandler(e); } }
private void listItems() { try { contr.updateItems(marketobj.listItems()); } catch (RemoteException e) { contr.remoteExceptionHandler(e); } }
private void logOut() { try { marketobj.logOut(command.getClient()); } catch (RemoteException e) { contr.remoteExceptionHandler(e); } }
private void removeWish() { try { marketobj.removeWish(command.getItemName(), command.getPrice(), command.getClient()); contr.updateLog(client.getName() + " removed wish for " + command.getItemName()); getWishes(); } catch (RemoteException e) { contr.remoteExceptionHandler(e); } }
private void sell() { try { marketobj.Sell(command.getItemName(), command.getItemDescr(), command.getPrice(), client); contr.updateLog(client.getName() + " listed " + command.getItemName() + " for sale"); getForSale(); } catch (RemoteException e) { contr.remoteExceptionHandler(e); } }
private void logIn() { try { if (marketobj.login(client, command.getPassword())) { contr.setAccount(); contr.successfulLogin(); } else contr.failedLogin(); } catch (RemoteException e) { contr.remoteExceptionHandler(e); } }
private void removeSell() { try { marketobj.removeSell( command.getItemName(), command.getItemDescr(), command.getPrice(), command.getClient()); contr.updateLog( client.getName() + " removed " + command.getItemName() + " that was listed as for sale"); getForSale(); } catch (RemoteException e) { contr.remoteExceptionHandler(e); } }
private void register() { System.out.println("registering"); try { marketobj.register(client, command.getPassword()); contr.successfulReg(); // contr.updateLog(client.getName() + " registered at the marketplace"); } catch (RejectedException e) { contr.failedReg(); } catch (RemoteException e2) { contr.remoteExceptionHandler(e2); } }
private void buy() { try { marketobj.Buy( command.getItemName(), command.getItemDescr(), command.getPrice(), command.getSeller(), client); contr.updateLog( "you bought " + command.getItemName() + " from " + command.getSeller() + " for: " + command.getPrice()); listItems(); } catch (RejectedException e2) { contr.rejectedExceptionHandler(e2); } catch (RemoteException e) { contr.remoteExceptionHandler(e); } }