Esempio n. 1
0
  @GET
  @RolesAllowed({"ADMINISTRATOR"})
  public Response findByFilter() {
    final UserFilter userFilter = new UserUrlFilterExtractor(uriInfo).getFilter();
    logger.debug("Finding users using filter: {}", userFilter);

    final PaginatedData<User> users = userService.find(userFilter);

    logger.debug("Found {} users", users.getNumberOfRows());

    final JsonElement jsonWithPagingAndEntries =
        JsonUtils.getJsonElementWithPagingAndEntries(users, userJsonConverter);
    return Response.status(HttpCode.OK.getCode())
        .entity(JsonWriter.writeToString(jsonWithPagingAndEntries))
        .build();
  }
 public static String toJson(final OperationResult operationResult) {
   return JsonWriter.writeToString(getJsonObject(operationResult));
 }