Esempio n. 1
0
 @Path("application-session-stats")
 @GET
 @NoCache
 @Produces(MediaType.APPLICATION_JSON)
 public Map<String, Integer> getApplicationSessionStats() {
   auth.requireView();
   Map<String, Integer> stats = new HashMap<String, Integer>();
   for (ApplicationModel applicationModel : realm.getApplications()) {
     int size = applicationModel.getActiveUserSessions();
     if (size == 0) continue;
     stats.put(applicationModel.getName(), size);
   }
   return stats;
 }