Exemplo n.º 1
0
 @GET
 @Path("ackRecibido")
 @Produces(MediaType.APPLICATION_JSON)
 public boolean ackMensaje(
     @QueryParam("nombreUsuario") String nombreUsuario,
     @QueryParam("imei") String imei,
     @QueryParam("idMensaje") Integer idMensaje) {
   if (autenticar(nombreUsuario, imei)) {
     ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(server);
     MessageService mensajeService =
         (MessageService) ctx.getBean(MessageService.class.getSimpleName());
     try {
       mensajeService.mensajeRecibido(idMensaje, ctx);
     } catch (PendienteEnvioException e) {
       throw e;
     }
   } else {
     throw new NotAuthorizedException();
   }
   return true;
 }