*/
@Override
public void run() {
try {
while (this.socket.isConnected()) {
CommandData data = (CommandData)inputStream.readObject();
System.out.println("Client send command: " + data.getCommand());
switch (data.getCommand()) {
case CLIENT_SENDS_REQUEST_BUY_MY_CART:
this.handleRequestBuyMyCart();
break;
case CLIENT_SENDS_REQUEST_EDIT_RESERVE_GOOD: // OK
this.handleEditReservationGood(data.getId(), data.getNumber());
break;
case CLIENT_SENDS_REQUEST_DELETE_RESERVE_GOOD: // OK
this.handleRequestDeleteReservatedGood(data.getId());
break;
case CLIENT_SENDS_REQUEST_FOR_GOOD_LIST: // OK
this.handleRequestForGoodList();
break;
case CLIENT_SENDS_REQUEST_RESERVE_GOOD: // OK
this.handleRequestReserveGood(data.getId(), data.getNumber());
break;
default:
break;
}
}