Example #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;
   }
 }
Example #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;
   }
 }
Example #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;
   }
 }
Example #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;
   }
 }
Example #5
0
 public void sendConnectionId(String cid) {
   ObjectNode event = JsonProvider.getConnectionIdJson(cid);
   sendMessage(event);
 }
Example #6
0
 public void sendPlaceBid(Bid bid) {
   ObjectNode event = JsonProvider.getPlaceBidJson(bid);
   sendMessage(event);
 }
Example #7
0
 public void sendDeleteItem(int itemno) {
   ObjectNode event = JsonProvider.getDeleteItemJson(itemno);
   sendMessage(event);
 }
Example #8
0
 public void sendNewItem(Item item) {
   ObjectNode event = JsonProvider.getNewItemJson(item);
   sendMessage(event);
 }