Beispiel #1
0
 public boolean sendAllItemsResponse() {
   ObjectNode event = JsonProvider.getAllItemsJson();
   if (event != null) {
     sendMessage(event);
     return true;
   } else {
     System.err.println("Error getting all items");
     return false;
   }
 }
Beispiel #2
0
 public boolean sendViewBids(int userId) {
   ObjectNode event = JsonProvider.getViewBidsJson(userId);
   if (event != null) {
     sendMessage(event);
     return true;
   } else {
     System.err.println("Error getting viewBids");
     return false;
   }
 }
Beispiel #3
0
 public boolean sendLogInResponse(User user) {
   ObjectNode event = JsonProvider.getLoginJson(user);
   if (event != null) {
     sendMessage(event);
     return true;
   } else {
     System.err.println("Error logging in");
     return false;
   }
 }
Beispiel #4
0
 public boolean registerUser(User user) {
   ObjectNode event = JsonProvider.getRegisterJson(user);
   if (event.get("success").asBoolean()) {
     sendMessage(event);
     return true;
   } else {
     sendMessage(event);
     System.err.println("Error registering new user");
     return false;
   }
 }
Beispiel #5
0
 public void sendConnectionId(String cid) {
   ObjectNode event = JsonProvider.getConnectionIdJson(cid);
   sendMessage(event);
 }
Beispiel #6
0
 public void sendPlaceBid(Bid bid) {
   ObjectNode event = JsonProvider.getPlaceBidJson(bid);
   sendMessage(event);
 }
Beispiel #7
0
 public void sendDeleteItem(int itemno) {
   ObjectNode event = JsonProvider.getDeleteItemJson(itemno);
   sendMessage(event);
 }
Beispiel #8
0
 public void sendNewItem(Item item) {
   ObjectNode event = JsonProvider.getNewItemJson(item);
   sendMessage(event);
 }