javax.ws.rs.QueryParam.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(9.7k)|赞(0)|评价(0)|浏览(149)

本文整理了Java中javax.ws.rs.QueryParam.<init>方法的一些代码示例,展示了QueryParam.<init>的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryParam.<init>方法的具体详情如下:
包路径:javax.ws.rs.QueryParam
类名称:QueryParam
方法名:<init>

QueryParam.<init>介绍

暂无

代码示例

代码示例来源:origin: knowm/XChange

@GET
@Path("mapi/trades/{pairs}")
@Produces(MediaType.APPLICATION_JSON)
DSXTradesWrapper getTrades(
  @PathParam("pairs") String pairs,
  @DefaultValue("150") @QueryParam("limit") int limit,
  @DefaultValue("1") @QueryParam("ignore_invalid") int ignoreInvalid,
  @DefaultValue("LIVE") @QueryParam("mode") String mode)
  throws IOException;

代码示例来源:origin: Graylog2/graylog2-server

@GET
@Timed
public JsonTesterResponse get(@QueryParam("string") @NotEmpty String string,
               @QueryParam("flatten") @DefaultValue("false") boolean flatten,
               @QueryParam("list_separator") @NotEmpty String listSeparator,
               @QueryParam("key_separator") @NotEmpty String keySeparator,
               @QueryParam("replace_key_whitespace") boolean replaceKeyWhitespace,
               @QueryParam("key_whitespace_replacement") String keyWhitespaceReplacement,
               @QueryParam("key_prefix") String keyPrefix,
               @QueryParam("kv_separator") @NotEmpty String kvSeparator) {
  return testJsonExtractor(string, flatten, listSeparator, keySeparator, kvSeparator, replaceKeyWhitespace, keyWhitespaceReplacement, keyPrefix);
}

代码示例来源:origin: Graylog2/graylog2-server

@GET
@Timed
@Produces(MediaType.APPLICATION_JSON)
public SubstringTesterResponse substringTester(@QueryParam("begin_index") @Min(0) int beginIndex,
                        @QueryParam("end_index") @Min(1) int endIndex,
                        @QueryParam("string") @NotNull String string) {
  return doSubstringTest(string, beginIndex, endIndex);
}

代码示例来源:origin: prestodb/presto

@DELETE
@Path("/v1/proxy")
@Produces(APPLICATION_JSON)
public void cancelQuery(
    @QueryParam("uri") String uri,
    @QueryParam("hmac") String hash,
    @Context HttpServletRequest servletRequest,
    @Suspended AsyncResponse asyncResponse)
{
  if (!hmac.hashString(uri, UTF_8).equals(HashCode.fromString(hash))) {
    throw badRequest(FORBIDDEN, "Failed to validate HMAC of URI");
  }
  Request.Builder request = prepareDelete().setUri(URI.create(uri));
  performRequest(servletRequest, asyncResponse, request, response -> responseWithHeaders(noContent(), response));
}

代码示例来源:origin: jersey/jersey

@Path("start")
@POST
public Response post(@DefaultValue("0") @QueryParam("testSources") int testSources, @Context Sse sse) {
  final Process process = new Process(testSources, sse);
  processes.put(process.getId(), process);
  Executors.newSingleThreadExecutor().execute(process);
  final URI processIdUri = UriBuilder.fromResource(DomainResource.class).path("process/{id}").build(process.getId());
  return Response.created(processIdUri).build();
}

代码示例来源:origin: prestodb/presto

@GET
public List<BasicQueryInfo> getAllQueryInfo(@QueryParam("state") String stateFilter)
{
  QueryState expectedState = stateFilter == null ? null : QueryState.valueOf(stateFilter.toUpperCase(Locale.ENGLISH));
  ImmutableList.Builder<BasicQueryInfo> builder = new ImmutableList.Builder<>();
  for (BasicQueryInfo queryInfo : queryManager.getQueries()) {
    if (stateFilter == null || queryInfo.getState() == expectedState) {
      builder.add(queryInfo);
    }
  }
  return builder.build();
}

代码示例来源:origin: knowm/XChange

@GET
@Path("mapi/ticker/{pairs}")
@Produces(MediaType.APPLICATION_JSON)
DSXTickerWrapper getTicker(
  @PathParam("pairs") String pairs,
  @DefaultValue("1") @QueryParam("ignore_invalid") int ignoreInvalid,
  @DefaultValue("LIVE") @QueryParam("mode") String mode)
  throws IOException;

代码示例来源:origin: Graylog2/graylog2-server

@GET
@Timed
@Produces(MediaType.APPLICATION_JSON)
public SplitAndIndexTesterResponse splitAndIndexTester(@QueryParam("split_by") @NotNull String splitBy,
                            @QueryParam("index") @Min(0) int index,
                            @QueryParam("string") @NotNull String string) {
  return doSplitAndIndexTest(string, splitBy, index);
}

代码示例来源:origin: Graylog2/graylog2-server

@GET
  @ApiOperation(value = "Get the cluster traffic stats")
  public TrafficCounterService.TrafficHistogram get(@ApiParam(name = "days", value = "For how many days the traffic stats should be returned")
                           @QueryParam("days") @DefaultValue("30") int days,
                           @ApiParam(name = "daily", value = "Whether the traffic should be aggregate to daily values")
                           @QueryParam("daily") @DefaultValue("false") boolean daily) {
    final TrafficCounterService.TrafficHistogram trafficHistogram =
        trafficCounterService.clusterTrafficOfLastDays(Duration.standardDays(days),
            daily ? TrafficCounterService.Interval.DAILY : TrafficCounterService.Interval.HOURLY);

    return trafficHistogram;
  }
}

代码示例来源:origin: jersey/jersey

@Path("start")
@POST
public Response post(@DefaultValue("0") @QueryParam("testSources") int testSources) {
  final Process process = new Process(testSources);
  processes.put(process.getId(), process);
  Executors.newSingleThreadExecutor().execute(process);
  final URI processIdUri = UriBuilder.fromResource(DomainResource.class).path("process/{id}").build(process.getId());
  return Response.created(processIdUri).build();
}

代码示例来源:origin: dropwizard/dropwizard

@GET
@Timed(name = "get-requests-timed")
@Metered(name = "get-requests-metered")
@CacheControl(maxAge = 1, maxAgeUnit = TimeUnit.DAYS)
public Saying sayHello(@QueryParam("name") Optional<String> name) {
  return new Saying(counter.incrementAndGet(), template.render(name));
}

代码示例来源:origin: knowm/XChange

@GET
@Path("api/3/depth/{pairs}")
@Produces(MediaType.APPLICATION_JSON)
WexDepthWrapper getDepth(
  @PathParam("pairs") String pairs,
  @DefaultValue("150") @QueryParam("limit") int limit,
  @DefaultValue("1") @QueryParam("ignore_invalid") int ignoreInvalid)
  throws IOException;

代码示例来源:origin: Graylog2/graylog2-server

@GET
@Timed
@Produces(MediaType.APPLICATION_JSON)
public RegexTesterResponse regexTester(@QueryParam("regex") @NotEmpty String regex,
                    @QueryParam("string") @NotNull String string) {
  return doTestRegex(string, regex);
}

代码示例来源:origin: Graylog2/graylog2-server

@GET
@Timed
@ApiOperation(value = "Get the most recent alarms of all streams.")
@ApiResponses(value = {
    @ApiResponse(code = 400, message = "Invalid ObjectId.")
})
public AlertListSummary listRecent(@ApiParam(name = "since", value = "Optional parameter to define a lower date boundary. (UNIX timestamp)", required = false)
                  @QueryParam("since") @DefaultValue("0") @Min(0) int sinceTs,
                  @ApiParam(name = "limit", value = "Maximum number of alerts to return.", required = false)
                  @QueryParam("limit") @DefaultValue("300") @Min(1) int limit) throws NotFoundException {
  final DateTime since = new DateTime(sinceTs * 1000L, DateTimeZone.UTC);
  final List<AlertSummary> alerts = getAlertSummaries(alertService.loadRecentOfStreams(getAllowedStreamIds(), since, limit).stream());
  return AlertListSummary.create(alerts.size(), alerts);
}

代码示例来源:origin: knowm/XChange

@GET
 @Path("api/3/trades/{pairs}")
 @Produces(MediaType.APPLICATION_JSON)
 WexTradesWrapper getTrades(
   @PathParam("pairs") String pairs,
   @DefaultValue("1") @QueryParam("limit") int limit,
   @DefaultValue("1") @QueryParam("ignore_invalid") int ignoreInvalid)
   throws IOException;
}

代码示例来源:origin: prestodb/presto

@GET
@Produces(MediaType.APPLICATION_JSON)
public List<QueryStateInfo> getQueryStateInfos(@QueryParam("user") String user)
{
  List<BasicQueryInfo> queryInfos = queryManager.getQueries();
  if (!isNullOrEmpty(user)) {
    queryInfos = queryInfos.stream()
        .filter(queryInfo -> Pattern.matches(user, queryInfo.getSession().getUser()))
        .collect(toImmutableList());
  }
  return queryInfos.stream()
      .filter(queryInfo -> !queryInfo.getState().isDone())
      .map(this::getQueryStateInfo)
      .collect(toImmutableList());
}

代码示例来源:origin: graphhopper/graphhopper

@GET
public Response doGet(@QueryParam("point") GHPoint point, @QueryParam("elevation") @DefaultValue("false") boolean elevation) {
  QueryResult qr = index.findClosest(point.lat, point.lon, EdgeFilter.ALL_EDGES);
  if (qr.isValid()) {
    GHPoint3D snappedPoint = qr.getSnappedPoint();
    double[] coordinates = hasElevation && elevation ? new double[]{snappedPoint.lon, snappedPoint.lat, snappedPoint.ele} : new double[]{snappedPoint.lon, snappedPoint.lat};
    return new Response(coordinates, calc.calcDist(point.lat, point.lon, snappedPoint.lat, snappedPoint.lon));
  } else {
    throw new WebApplicationException("Nearest point cannot be found!");
  }
}

代码示例来源:origin: knowm/XChange

@GET
@Path("mapi/depth/{pairs}")
@Produces(MediaType.APPLICATION_JSON)
DSXOrderbookWrapper getOrderbook(
  @PathParam("pairs") String pairs,
  @DefaultValue("1") @QueryParam("ignore_invalid") int ignoreInvalid,
  @DefaultValue("LIVE") @QueryParam("mode") String mode)
  throws IOException;

代码示例来源:origin: Graylog2/graylog2-server

@GET
  @Timed
  @Produces(MediaType.APPLICATION_JSON)
  public Map<String, String> naturalDateTester(@QueryParam("string") @NotEmpty String string) {
    try {
      return new NaturalDateParser().parse(string).asMap();
    } catch (NaturalDateParser.DateNotParsableException e) {
      LOG.debug("Could not parse from natural date: " + string, e);
      throw new WebApplicationException(e, 422);
    }
  }
}

代码示例来源:origin: knowm/XChange

@GET
 @Path("mapi/lastBars/{pairs}/{period}/{amount}")
 @Produces(MediaType.APPLICATION_JSON)
 DSXBarsWrapper getBars(
   @PathParam("pairs") String pairs,
   @PathParam("period") String period,
   @PathParam("amount") String amount,
   @DefaultValue("1") @QueryParam("ignore_invalid") int ignoreInvalid,
   @DefaultValue("LIVE") @QueryParam("mode") String mode)
   throws IOException;
}

相关文章