コード例 #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();
  }
コード例 #2
0
 public static String toJson(final OperationResult operationResult) {
   return JsonWriter.writeToString(getJsonObject(operationResult));
 }