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

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

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

DELETE介绍

暂无

代码示例

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

  1. @DELETE
  2. @Path("{queryId}/{token}")
  3. @Produces(MediaType.APPLICATION_JSON)
  4. public Response cancelQuery(@PathParam("queryId") QueryId queryId,
  5. @PathParam("token") long token)
  6. {
  7. Query query = queries.get(queryId);
  8. if (query == null) {
  9. return Response.status(Status.NOT_FOUND).build();
  10. }
  11. query.cancel();
  12. return Response.noContent().build();
  13. }

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

  1. @DELETE
  2. @Path("{queryId}")
  3. public void cancelQuery(@PathParam("queryId") QueryId queryId)
  4. {
  5. requireNonNull(queryId, "queryId is null");
  6. queryManager.cancelQuery(queryId);
  7. }

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

  1. @DELETE
  2. @Path("/{id}")
  3. @RequiresPermissions(SidecarRestPermissions.CONFIGURATIONS_DELETE)
  4. @Produces(MediaType.APPLICATION_JSON)
  5. @ApiOperation(value = "Delete a configuration")
  6. @AuditEvent(type = SidecarAuditEventTypes.CONFIGURATION_DELETE)
  7. public Response deleteConfiguration(@ApiParam(name = "id", required = true)
  8. @PathParam("id") String id) {
  9. if (isConfigurationInUse(id)) {
  10. throw new BadRequestException("Configuration still in use, cannot delete.");
  11. }
  12. int deleted = configurationService.delete(id);
  13. if (deleted == 0) {
  14. return Response.notModified().build();
  15. }
  16. etagService.invalidateAll();
  17. return Response.accepted().build();
  18. }

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

  1. @DELETE
  2. @Deprecated
  3. @Path("/{dataSourceName}")
  4. @ResourceFilters(DatasourceResourceFilter.class)
  5. @Produces(MediaType.APPLICATION_JSON)
  6. public Response deleteDataSource(
  7. @PathParam("dataSourceName") final String dataSourceName,
  8. @QueryParam("kill") final String kill,
  9. @QueryParam("interval") final String interval
  10. return Response.ok(ImmutableMap.of("error", "no indexing service found")).build();
  11. return Response.status(Response.Status.BAD_REQUEST)
  12. .entity(
  13. ImmutableMap.of(
  14. "error",
  15. .build();
  16. return Response.serverError().entity(
  17. ImmutableMap.of(
  18. "error",

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

  1. @DELETE
  2. @Path("orders")
  3. @Produces(MediaType.TEXT_PLAIN)
  4. String deleteAllOrders(
  5. @HeaderParam("AC-ACCESS-KEY") String accessKey,
  6. @HeaderParam("AC-ACCESS-SIGN") ParamsDigest sign,
  7. @HeaderParam("AC-ACCESS-PASSPHRASE") String passphrase,
  8. @HeaderParam("AC-ACCESS-TIMESTAMP") String timestamp)
  9. throws IOException;

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

  1. @DELETE
  2. @Path("/v1/proxy")
  3. @Produces(APPLICATION_JSON)
  4. public void cancelQuery(
  5. @QueryParam("uri") String uri,
  6. @QueryParam("hmac") String hash,
  7. @Context HttpServletRequest servletRequest,
  8. @Suspended AsyncResponse asyncResponse)
  9. {
  10. if (!hmac.hashString(uri, UTF_8).equals(HashCode.fromString(hash))) {
  11. throw badRequest(FORBIDDEN, "Failed to validate HMAC of URI");
  12. }
  13. Request.Builder request = prepareDelete().setUri(URI.create(uri));
  14. performRequest(servletRequest, asyncResponse, request, response -> responseWithHeaders(noContent(), response));
  15. }

代码示例来源:origin: opentripplanner/OpenTripPlanner

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

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

  1. @DELETE
  2. @Timed
  3. @RequiresPermissions(RestPermissions.LDAP_EDIT)
  4. @ApiOperation("Remove the LDAP configuration")
  5. @Path("/settings")
  6. @AuditEvent(type = AuditEventTypes.LDAP_CONFIGURATION_DELETE)
  7. public void deleteLdapSettings() {
  8. ldapSettingsService.delete();
  9. }

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

  1. @DELETE
  2. public Response remove() {
  3. LogAction.logout(getUserId());
  4. request.getSession().removeAttribute(USER_ID_KEY);
  5. return Response.noContent().build();
  6. }

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

  1. @DELETE
  2. @Path("stage/{stageId}")
  3. public void cancelStage(@PathParam("stageId") StageId stageId)
  4. {
  5. requireNonNull(stageId, "stageId is null");
  6. queryManager.cancelStage(stageId);
  7. }
  8. }

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

  1. @DELETE
  2. @Path("/{id}")
  3. @RequiresPermissions(SidecarRestPermissions.COLLECTORS_DELETE)
  4. @Produces(MediaType.APPLICATION_JSON)
  5. @ApiOperation(value = "Delete a collector")
  6. @AuditEvent(type = SidecarAuditEventTypes.COLLECTOR_DELETE)
  7. public Response deleteCollector(@ApiParam(name = "id", required = true)
  8. @PathParam("id") String id) {
  9. final long configurationsForCollector = configurationService.all().stream()
  10. .filter(configuration -> configuration.collectorId().equals(id))
  11. .count();
  12. if (configurationsForCollector > 0) {
  13. throw new BadRequestException("Collector still in use, cannot delete.");
  14. }
  15. int deleted = collectorService.delete(id);
  16. if (deleted == 0) {
  17. return Response.notModified().build();
  18. }
  19. etagService.invalidateAll();
  20. return Response.accepted().build();
  21. }

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

  1. @DELETE
  2. public Response remove(LinkedHashMap<String, Long> entity) throws SQLException, ClassNotFoundException {
  3. Context.getPermissionsManager().checkReadonly(getUserId());
  4. Permission permission = new Permission(entity);
  5. checkPermission(permission, false);
  6. Context.getDataManager().linkObject(permission.getOwnerClass(), permission.getOwnerId(),
  7. permission.getPropertyClass(), permission.getPropertyId(), false);
  8. LogAction.unlink(getUserId(), permission.getOwnerClass(), permission.getOwnerId(),
  9. permission.getPropertyClass(), permission.getPropertyId());
  10. Context.getPermissionsManager().refreshPermissions(permission);
  11. return Response.noContent().build();
  12. }

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

  1. @DELETE
  2. @Path("{taskId}/results/{bufferId}")
  3. @Produces(MediaType.APPLICATION_JSON)
  4. public void abortResults(@PathParam("taskId") TaskId taskId, @PathParam("bufferId") OutputBufferId bufferId, @Context UriInfo uriInfo)
  5. {
  6. requireNonNull(taskId, "taskId is null");
  7. requireNonNull(bufferId, "bufferId is null");
  8. taskManager.abortTaskResults(taskId, bufferId);
  9. }

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

  1. @DELETE
  2. @Path("{stageId}")
  3. public void cancelStage(@PathParam("stageId") StageId stageId)
  4. {
  5. requireNonNull(stageId, "stageId is null");
  6. queryManager.cancelStage(stageId);
  7. }
  8. }

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

  1. @DELETE
  2. @Path("/{id}")
  3. @RequiresPermissions(SidecarRestPermissions.CONFIGURATIONS_UPDATE)
  4. @Produces(MediaType.APPLICATION_JSON)
  5. @ApiOperation(value = "Delete a configuration variable")
  6. @AuditEvent(type = SidecarAuditEventTypes.CONFIGURATION_VARIABLE_DELETE)
  7. public Response deleteConfigurationVariable(@ApiParam(name = "id", required = true)
  8. @PathParam("id") String id) {
  9. final ConfigurationVariable configurationVariable = findVariableOrFail(id);
  10. final List<Configuration> configurations = this.configurationService.findByConfigurationVariable(configurationVariable);
  11. if (!configurations.isEmpty()) {
  12. final ValidationResult validationResult = new ValidationResult();
  13. validationResult.addError("name", "Variable is still used in the following configurations: " +
  14. configurations.stream().map(c -> c.name()).collect(Collectors.joining(", ")));
  15. return Response.status(Response.Status.BAD_REQUEST).entity(validationResult).build();
  16. }
  17. int deleted = configurationVariableService.delete(id);
  18. if (deleted == 0) {
  19. return Response.notModified().build();
  20. }
  21. etagService.invalidateAll();
  22. return Response.accepted().build();
  23. }

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

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

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

  1. /**
  2. * 启用作业.
  3. *
  4. * @param jobName 作业名称
  5. */
  6. @DELETE
  7. @Path("/{jobName}/disable")
  8. @Consumes(MediaType.APPLICATION_JSON)
  9. public void enableJob(@PathParam("jobName") final String jobName) {
  10. jobAPIService.getJobOperatorAPI().enable(Optional.of(jobName), Optional.<String>absent());
  11. }

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

  1. @DELETE
  2. @Path("orders/{order-id}")
  3. @Produces(MediaType.TEXT_PLAIN)
  4. String deleteOrder(
  5. @PathParam("order-id") String orderID,
  6. @HeaderParam("AC-ACCESS-KEY") String accessKey,
  7. @HeaderParam("AC-ACCESS-SIGN") ParamsDigest sign,
  8. @HeaderParam("AC-ACCESS-PASSPHRASE") String passphrase,
  9. @HeaderParam("AC-ACCESS-TIMESTAMP") String timestamp)
  10. throws IOException;

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

  1. /**
  2. * 启用作业.
  3. *
  4. * @param serverIp 服务器IP地址
  5. * @param jobName 作业名称
  6. */
  7. @DELETE
  8. @Path("/{serverIp}/jobs/{jobName}/disable")
  9. public void enableServerJob(@PathParam("serverIp") final String serverIp, @PathParam("jobName") final String jobName) {
  10. jobAPIService.getJobOperatorAPI().enable(Optional.of(jobName), Optional.of(serverIp));
  11. }

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

  1. @DELETE
  2. @Path("orders?product_id={product-id}")
  3. @Produces(MediaType.TEXT_PLAIN)
  4. String deleteAllOrdersForProduct(
  5. @PathParam("product-id") String productID,
  6. @HeaderParam("AC-ACCESS-KEY") String accessKey,
  7. @HeaderParam("AC-ACCESS-SIGN") ParamsDigest sign,
  8. @HeaderParam("AC-ACCESS-PASSPHRASE") String passphrase,
  9. @HeaderParam("AC-ACCESS-TIMESTAMP") String timestamp)
  10. throws IOException;

相关文章

DELETE类方法