Exemple #1
1
 private void getForSale() {
   try {
     contr.updateForSale(marketobj.getForSale(client));
   } catch (RemoteException e) {
     contr.remoteExceptionHandler(e);
   }
 }
Exemple #2
0
 private void getSold() {
   try {
     contr.updateSold(marketobj.getSold(client));
   } catch (RemoteException e) {
     contr.remoteExceptionHandler(e);
   }
 }
Exemple #3
0
 private void listItems() {
   try {
     contr.updateItems(marketobj.listItems());
   } catch (RemoteException e) {
     contr.remoteExceptionHandler(e);
   }
 }
Exemple #4
0
 private void logOut() {
   try {
     marketobj.logOut(command.getClient());
   } catch (RemoteException e) {
     contr.remoteExceptionHandler(e);
   }
 }
Exemple #5
0
 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);
   }
 }
Exemple #6
0
 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);
   }
 }
Exemple #7
0
  private void logIn() {

    try {
      if (marketobj.login(client, command.getPassword())) {
        contr.setAccount();
        contr.successfulLogin();
      } else contr.failedLogin();
    } catch (RemoteException e) {
      contr.remoteExceptionHandler(e);
    }
  }
Exemple #8
0
 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);
   }
 }
Exemple #9
0
 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);
   }
 }
Exemple #10
0
 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);
   }
 }