javax.ws.rs.DELETE类的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(9.3k)|赞(0)|评价(0)|浏览(266)

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

DELETE介绍

暂无

代码示例

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

@DELETE
@Path("{queryId}/{token}")
@Produces(MediaType.APPLICATION_JSON)
public Response cancelQuery(@PathParam("queryId") QueryId queryId,
    @PathParam("token") long token)
{
  Query query = queries.get(queryId);
  if (query == null) {
    return Response.status(Status.NOT_FOUND).build();
  }
  query.cancel();
  return Response.noContent().build();
}

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

@DELETE
@Path("{queryId}")
public void cancelQuery(@PathParam("queryId") QueryId queryId)
{
  requireNonNull(queryId, "queryId is null");
  queryManager.cancelQuery(queryId);
}

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

@DELETE
@Path("/{id}")
@RequiresPermissions(SidecarRestPermissions.CONFIGURATIONS_DELETE)
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Delete a configuration")
@AuditEvent(type = SidecarAuditEventTypes.CONFIGURATION_DELETE)
public Response deleteConfiguration(@ApiParam(name = "id", required = true)
                  @PathParam("id") String id) {
  if (isConfigurationInUse(id)) {
    throw new BadRequestException("Configuration still in use, cannot delete.");
  }
  int deleted = configurationService.delete(id);
  if (deleted == 0) {
    return Response.notModified().build();
  }
  etagService.invalidateAll();
  return Response.accepted().build();
}

代码示例来源:origin: apache/incubator-druid

@DELETE
@Deprecated
@Path("/{dataSourceName}")
@ResourceFilters(DatasourceResourceFilter.class)
@Produces(MediaType.APPLICATION_JSON)
public Response deleteDataSource(
  @PathParam("dataSourceName") final String dataSourceName,
  @QueryParam("kill") final String kill,
  @QueryParam("interval") final String interval
  return Response.ok(ImmutableMap.of("error", "no indexing service found")).build();
   return Response.status(Response.Status.BAD_REQUEST)
           .entity(
             ImmutableMap.of(
               "error",
           .build();
   return Response.serverError().entity(
     ImmutableMap.of(
       "error",

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

@DELETE
@Path("orders")
@Produces(MediaType.TEXT_PLAIN)
String deleteAllOrders(
  @HeaderParam("AC-ACCESS-KEY") String accessKey,
  @HeaderParam("AC-ACCESS-SIGN") ParamsDigest sign,
  @HeaderParam("AC-ACCESS-PASSPHRASE") String passphrase,
  @HeaderParam("AC-ACCESS-TIMESTAMP") String timestamp)
  throws IOException;

代码示例来源: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: opentripplanner/OpenTripPlanner

/** De-register all registered routerIds, evicting them from memory. */
@RolesAllowed({ "ROUTERS" })
@DELETE @Produces({ MediaType.TEXT_PLAIN })
public Response deleteAll() {
  int nEvicted = otpServer.getGraphService().evictAll();
  String message = String.format("%d graphs evicted.\n", nEvicted);
  return Response.status(200).entity(message).build();
}

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

@DELETE
@Timed
@RequiresPermissions(RestPermissions.LDAP_EDIT)
@ApiOperation("Remove the LDAP configuration")
@Path("/settings")
@AuditEvent(type = AuditEventTypes.LDAP_CONFIGURATION_DELETE)
public void deleteLdapSettings() {
  ldapSettingsService.delete();
}

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

@DELETE
public Response remove() {
  LogAction.logout(getUserId());
  request.getSession().removeAttribute(USER_ID_KEY);
  return Response.noContent().build();
}

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

@DELETE
  @Path("stage/{stageId}")
  public void cancelStage(@PathParam("stageId") StageId stageId)
  {
    requireNonNull(stageId, "stageId is null");
    queryManager.cancelStage(stageId);
  }
}

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

@DELETE
@Path("/{id}")
@RequiresPermissions(SidecarRestPermissions.COLLECTORS_DELETE)
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Delete a collector")
@AuditEvent(type = SidecarAuditEventTypes.COLLECTOR_DELETE)
public Response deleteCollector(@ApiParam(name = "id", required = true)
                @PathParam("id") String id) {
  final long configurationsForCollector = configurationService.all().stream()
      .filter(configuration -> configuration.collectorId().equals(id))
      .count();
  if (configurationsForCollector > 0) {
    throw new BadRequestException("Collector still in use, cannot delete.");
  }
  int deleted = collectorService.delete(id);
  if (deleted == 0) {
    return Response.notModified().build();
  }
  etagService.invalidateAll();
  return Response.accepted().build();
}

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

@DELETE
public Response remove(LinkedHashMap<String, Long> entity) throws SQLException, ClassNotFoundException {
  Context.getPermissionsManager().checkReadonly(getUserId());
  Permission permission = new Permission(entity);
  checkPermission(permission, false);
  Context.getDataManager().linkObject(permission.getOwnerClass(), permission.getOwnerId(),
      permission.getPropertyClass(), permission.getPropertyId(), false);
  LogAction.unlink(getUserId(), permission.getOwnerClass(), permission.getOwnerId(),
      permission.getPropertyClass(), permission.getPropertyId());
  Context.getPermissionsManager().refreshPermissions(permission);
  return Response.noContent().build();
}

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

@DELETE
@Path("{taskId}/results/{bufferId}")
@Produces(MediaType.APPLICATION_JSON)
public void abortResults(@PathParam("taskId") TaskId taskId, @PathParam("bufferId") OutputBufferId bufferId, @Context UriInfo uriInfo)
{
  requireNonNull(taskId, "taskId is null");
  requireNonNull(bufferId, "bufferId is null");
  taskManager.abortTaskResults(taskId, bufferId);
}

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

@DELETE
  @Path("{stageId}")
  public void cancelStage(@PathParam("stageId") StageId stageId)
  {
    requireNonNull(stageId, "stageId is null");
    queryManager.cancelStage(stageId);
  }
}

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

@DELETE
@Path("/{id}")
@RequiresPermissions(SidecarRestPermissions.CONFIGURATIONS_UPDATE)
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Delete a configuration variable")
@AuditEvent(type = SidecarAuditEventTypes.CONFIGURATION_VARIABLE_DELETE)
public Response deleteConfigurationVariable(@ApiParam(name = "id", required = true)
                        @PathParam("id") String id) {
  final ConfigurationVariable configurationVariable = findVariableOrFail(id);
  final List<Configuration> configurations = this.configurationService.findByConfigurationVariable(configurationVariable);
  if (!configurations.isEmpty()) {
    final ValidationResult validationResult = new ValidationResult();
    validationResult.addError("name", "Variable is still used in the following configurations: " +
        configurations.stream().map(c -> c.name()).collect(Collectors.joining(", ")));
    return Response.status(Response.Status.BAD_REQUEST).entity(validationResult).build();
  }
  int deleted = configurationVariableService.delete(id);
  if (deleted == 0) {
    return Response.notModified().build();
  }
  etagService.invalidateAll();
  return Response.accepted().build();
}

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

@DELETE
@Path("orders/{id}")
@Produces(MediaType.TEXT_PLAIN)
void cancelOrder(
  @PathParam("id") String id,
  @HeaderParam("CB-ACCESS-KEY") String apiKey,
  @HeaderParam("CB-ACCESS-SIGN") ParamsDigest signer,
  @HeaderParam("CB-ACCESS-TIMESTAMP") SynchronizedValueFactory<Long> nonce,
  @HeaderParam("CB-ACCESS-PASSPHRASE") String passphrase)
  throws CoinbaseProException, IOException;

代码示例来源:origin: elasticjob/elastic-job-lite

/**
 * 启用作业.
 *
 * @param jobName 作业名称
 */
@DELETE
@Path("/{jobName}/disable")
@Consumes(MediaType.APPLICATION_JSON)
public void enableJob(@PathParam("jobName") final String jobName) {
  jobAPIService.getJobOperatorAPI().enable(Optional.of(jobName), Optional.<String>absent());
}

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

@DELETE
@Path("orders/{order-id}")
@Produces(MediaType.TEXT_PLAIN)
String deleteOrder(
  @PathParam("order-id") String orderID,
  @HeaderParam("AC-ACCESS-KEY") String accessKey,
  @HeaderParam("AC-ACCESS-SIGN") ParamsDigest sign,
  @HeaderParam("AC-ACCESS-PASSPHRASE") String passphrase,
  @HeaderParam("AC-ACCESS-TIMESTAMP") String timestamp)
  throws IOException;

代码示例来源:origin: elasticjob/elastic-job-lite

/**
 * 启用作业.
 *
 * @param serverIp 服务器IP地址
 * @param jobName 作业名称
 */
@DELETE
@Path("/{serverIp}/jobs/{jobName}/disable")
public void enableServerJob(@PathParam("serverIp") final String serverIp, @PathParam("jobName") final String jobName) {
  jobAPIService.getJobOperatorAPI().enable(Optional.of(jobName), Optional.of(serverIp));
}

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

@DELETE
@Path("orders?product_id={product-id}")
@Produces(MediaType.TEXT_PLAIN)
String deleteAllOrdersForProduct(
  @PathParam("product-id") String productID,
  @HeaderParam("AC-ACCESS-KEY") String accessKey,
  @HeaderParam("AC-ACCESS-SIGN") ParamsDigest sign,
  @HeaderParam("AC-ACCESS-PASSPHRASE") String passphrase,
  @HeaderParam("AC-ACCESS-TIMESTAMP") String timestamp)
  throws IOException;

相关文章

微信公众号

最新文章

更多

DELETE类方法