private void doMarketCommand(Command command) throws RemoteException,
			MalformedURLException, marketplace.exception.RejectedException,
			RejectedException {
		CommandName inputCommand = command.getCommandName();
		String userOrItemName = command.getUserOrItemName();
		Float amount = command.getAmount();
		String sellerName = command.getSellerName();

		switch (inputCommand) {
		case buy:
			marketobj.buyItem(new ItemImpl(userOrItemName, amount,
					new TraderImpl(sellerName, this)), new TraderImpl(
					clientname, this));
			break;
		case deleteTrader:
			marketobj.unRegisterClient(new TraderImpl(userOrItemName, this));
			clientname = null;
			break;
		case displayItems:
			System.out.println();
			for (Item item : marketobj.getItemsOnSale()) {
				System.out.println(item);
			}
			System.out.println();
			break;
		case sell:
			marketobj.placeItemOnSale(new ItemImpl(userOrItemName, amount,
					new TraderImpl(clientname, this)));
			break;
		case wish:
			marketobj.placeWish(new WishImpl(new ItemImpl(userOrItemName,
					amount, new TraderImpl("*WISH*", this)), new TraderImpl(
					clientname, this)));
			break;
		default:
			System.out.println("Illegal command.");
			break;
		}
	}