@Path("follows") @POST @Consumes(MediaType.APPLICATION_FORM_URLENCODED) public void follow(@FormParam("follower") String follower) { UserStateData followerState = us.get(follower); // User does not exist if (followerState == null) throw new WebApplicationException(404); followerState.bc.addAtmosphereResource(us.get(user).bc.getUserAtmosphereEvent().getResource()); followerState.bc.broadcast( user + "is now follow you", followerState.bc.getUserAtmosphereEvent().getResource()); System.out.println(user + " is following " + follower); }
@DELETE public void delete() { us.remove(user); }