Examples of cacheControl()


Examples of com.dotcms.repackage.javax.ws.rs.core.Response.ResponseBuilder.cacheControl()

    CacheControl cc = new CacheControl();
    cc.setNoCache(true);
    User user = auth.getUser();
    String username = (user != null) ? user.getFullName() : " unknown ";
    ResponseBuilder builder = Response.ok("{\"result\":\"" + username + " PUT!\"}", "application/json");
    return builder.cacheControl(cc).build();
  }

  @POST
  public Response doPost(@Context HttpServletRequest request, @PathParam("params") String params) throws URISyntaxException {
    InitDataObject auth = init(null, true, request, false);
View Full Code Here

Examples of javax.ws.rs.core.Response.ResponseBuilder.cacheControl()

      }
    } catch (IOException e) {
      throw new WebApplicationException(Response.Status.SERVICE_UNAVAILABLE);
    }
    ResponseBuilder response = Response.ok();
    response.cacheControl(cacheControl);
    return response.build();
  }

}
View Full Code Here

Examples of javax.ws.rs.core.Response.ResponseBuilder.cacheControl()

    try {
      HBaseAdmin admin = new HBaseAdmin(conf);
      StorageClusterVersionModel model = new StorageClusterVersionModel();
      model.setVersion(admin.getClusterStatus().getHBaseVersion());
      ResponseBuilder response = Response.ok(model);
      response.cacheControl(cacheControl);
      return response.build();
    } catch (IOException e) {
      throw new WebApplicationException(e,
                  Response.Status.SERVICE_UNAVAILABLE);
    }
View Full Code Here

Examples of javax.ws.rs.core.Response.ResponseBuilder.cacheControl()

    if (LOG.isDebugEnabled()) {
      LOG.debug("GET " + uriInfo.getAbsolutePath());
    }
    servlet.getMetrics().incrementRequests(1);
    ResponseBuilder response = Response.ok(new VersionModel(context));
    response.cacheControl(cacheControl);
    return response.build();
  }

  /**
   * Dispatch to StorageClusterVersionResource
View Full Code Here

Examples of javax.ws.rs.core.Response.ResponseBuilder.cacheControl()

        }
        value = generator.next();
      } while (value != null);
      model.addRow(rowModel);
      ResponseBuilder response = Response.ok(model);
      response.cacheControl(cacheControl);
      return response.build();
    } catch (IOException e) {
      throw new WebApplicationException(e,
                  Response.Status.SERVICE_UNAVAILABLE);
    }
View Full Code Here

Examples of javax.ws.rs.core.Response.ResponseBuilder.cacheControl()

      if (!generator.hasNext()) {
        throw new WebApplicationException(Response.Status.NOT_FOUND);
      }
      KeyValue value = generator.next();
      ResponseBuilder response = Response.ok(value.getValue());
      response.cacheControl(cacheControl);
      response.header("X-Timestamp", value.getTimestamp());
      return response.build();
    } catch (IOException e) {
      throw new WebApplicationException(e,
                  Response.Status.SERVICE_UNAVAILABLE);
View Full Code Here

Examples of javax.ws.rs.core.Response.ResponseBuilder.cacheControl()

    }
    servlet.getMetrics().incrementRequests(1);
    try {
      ResponseBuilder response =
        Response.ok(new TableSchemaModel(getTableSchema()));
      response.cacheControl(cacheControl);
      return response.build();
    } catch (TableNotFoundException e) {
      throw new WebApplicationException(Response.Status.NOT_FOUND);
    } catch (IOException e) {
      throw new WebApplicationException(e,
View Full Code Here

Examples of javax.ws.rs.core.Response.ResponseBuilder.cacheControl()

            new TableRegionModel(name, hri.getRegionId(), hri.getStartKey(),
              hri.getEndKey()));
        }
      }
      ResponseBuilder response = Response.ok(model);
      response.cacheControl(cacheControl);
      return response.build();
    } catch (TableNotFoundException e) {
      throw new WebApplicationException(Response.Status.NOT_FOUND);
    } catch (IOException e) {
      throw new WebApplicationException(e,
View Full Code Here

Examples of javax.ws.rs.core.Response.ResponseBuilder.cacheControl()

    if (servlet.isMultiUser()) {
      throw new WebApplicationException(Response.Status.BAD_REQUEST);
    }
    try {
      ResponseBuilder response = Response.ok(getTableList());
      response.cacheControl(cacheControl);
      return response.build();
    } catch (IOException e) {
      throw new WebApplicationException(e,
                  Response.Status.SERVICE_UNAVAILABLE);
    }
View Full Code Here

Examples of javax.ws.rs.core.Response.ResponseBuilder.cacheControl()

      if (!servlet.userRequestLimit(user, 1)) {
        return Response.status(509).build();
      }
      try {
        ResponseBuilder response = Response.ok(getTableListForUser(user));
        response.cacheControl(cacheControl);
        return response.build();
      } catch (IOException e) {
        throw new WebApplicationException(e,
                    Response.Status.SERVICE_UNAVAILABLE);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.