当前位置: 首页>>代码示例>>Java>>正文


Java DELETE类代码示例

本文整理汇总了Java中javax.ws.rs.DELETE的典型用法代码示例。如果您正苦于以下问题:Java DELETE类的具体用法?Java DELETE怎么用?Java DELETE使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DELETE类属于javax.ws.rs包,在下文中一共展示了DELETE类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deleteComment

import javax.ws.rs.DELETE; //导入依赖的package包/类
@DELETE
@Path("/{uuid}/{version}/comment")
@ApiOperation(value = "Delete a comment")
Response deleteComment(
	@Context 
		UriInfo info,
	@ApiParam(APIDOC_ITEMUUID) 
	@PathParam("uuid") 
		String uuid,
	@ApiParam(APIDOC_ITEMVERSION) 
	@PathParam("version") 
		int version,
	@ApiParam(APIDOC_ITEMVERSION) 
	@QueryParam("commentuuid") 
		String commentUuid
	);
 
开发者ID:equella,项目名称:Equella,代码行数:17,代码来源:EquellaItemResource.java

示例2: cancel

import javax.ws.rs.DELETE; //导入依赖的package包/类
@DELETE
@Path("/tcc/{txid}")
@Consumes("application/tcc")
   @ApiOperation(
   		code = 204,
   		response = String.class,
           value = "Rollback a given composite transaction",
           notes = "See https://www.atomikos.com/Blog/TransactionManagementAPIForRESTTCC",
           consumes = "application/tcc"
       )
public void cancel(
		@ApiParam(value = "Id of the composite transaction to rollback", required = true) @PathParam("txid") String txid
		){
	LOG.info("Trying to rollback transaction [{}]", txid);
	
	getCompositeTransactionParticipantService().cancel(txid);
	
	LOG.info("Transaction [{}] rolled back", txid);
}
 
开发者ID:jotorren,项目名称:microservices-transactions-tcc,代码行数:20,代码来源:CompositeTransactionParticipantController.java

示例3: deleteRoot

import javax.ws.rs.DELETE; //导入依赖的package包/类
/** Handle HTTP DELETE request for the root. */
@DELETE
@Path("/")
@Produces(MediaType.APPLICATION_JSON)
public Response deleteRoot(
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @QueryParam(UserParam.NAME) @DefaultValue(UserParam.DEFAULT)
        final UserParam username,
    @QueryParam(DoAsParam.NAME) @DefaultValue(DoAsParam.DEFAULT)
        final DoAsParam doAsUser,
    @QueryParam(DeleteOpParam.NAME) @DefaultValue(DeleteOpParam.DEFAULT)
        final DeleteOpParam op,
    @QueryParam(RecursiveParam.NAME) @DefaultValue(RecursiveParam.DEFAULT)
        final RecursiveParam recursive,
    @QueryParam(SnapshotNameParam.NAME) @DefaultValue(SnapshotNameParam.DEFAULT)
        final SnapshotNameParam snapshotName
    ) throws IOException, InterruptedException {
  return delete(ugi, delegation, username, doAsUser, ROOT, op, recursive,
      snapshotName);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:NamenodeWebHdfsMethods.java

示例4: delete

import javax.ws.rs.DELETE; //导入依赖的package包/类
@DELETE
@Path("{ref}")
@ApiOperation(value = "Deletes an existing router by ID", tags = "routers")
@ApiResponses({
    @ApiResponse(code = 200, message = "Successful operation"),
    @ApiResponse(code = 400, message = "Invalid ID supplied",
        response = ExceptionPresentation.class),
    @ApiResponse(code = 404, message = "Router not found",
        response = ExceptionPresentation.class)})
public void delete(@ApiParam(value = "The id of the router to be deleted",
    required = true) @PathParam("ref") String ref) throws CommsRouterException {

  LOGGER.debug("Deleting router: {}", ref);

  routerService.delete(ref);
}
 
开发者ID:Nexmo,项目名称:comms-router,代码行数:17,代码来源:RouterResource.java

示例5: deleteApplianceManagerConnector

import javax.ws.rs.DELETE; //导入依赖的package包/类
@ApiOperation(value = "Deletes an Manager Connector",
        notes = "Deletes an Appliance Manager Connector if not referenced by any Distributed Appliances",
        response = BaseJobResponse.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "Successful operation"),
        @ApiResponse(code = 400,
                message = "In case of any error or if the Manager connector is referenced by a Distributed Appliance",
                response = ErrorCodeDto.class) })
@Path("/{applianceManagerConnectorId}")
@DELETE
public Response deleteApplianceManagerConnector(@Context HttpHeaders headers,
                                                @ApiParam(value = "Id of the Appliance Manager Connector",
                                                        required = true) @PathParam("applianceManagerConnectorId") Long amcId) {

    logger.info("Deleting Appliance Manager Connector " + amcId);
    this.userContext.setUser(OscAuthFilter.getUsername(headers));

    return this.apiUtil.getResponseForBaseRequest(this.deleteApplianceManagerConnectorService,
            new BaseIdRequest(amcId));
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:20,代码来源:ManagerConnectorApis.java

示例6: bucketDelete

import javax.ws.rs.DELETE; //导入依赖的package包/类
@DELETE
   @Produces(MediaType.APPLICATION_JSON)
   @Path("bucket/{bucketKey}")
   public Response bucketDelete(
    	@Context HttpServletRequest request,
    	@PathParam("bucketKey") String bucketKey
) 
	throws IOException, 
	       URISyntaxException 
   {
   	APIImpl impl = getAPIImpl( request );
   	if( impl == null )
   	{
           return Response.status( Response.Status.UNAUTHORIZED ).build();     
   	}
   	Result result = impl.bucketDelete( bucketKey );
   	return formatReturn( result );
   }
 
开发者ID:IBM,项目名称:MaximoForgeViewerPlugin,代码行数:19,代码来源:ForgeRS.java

示例7: modelDelete

import javax.ws.rs.DELETE; //导入依赖的package包/类
@DELETE
   @Produces(MediaType.APPLICATION_JSON)
   @Path("model/{bucketKey}/{objectKey}")
   public Response modelDelete(
    	@Context HttpServletRequest request,
   	@PathParam("bucketKey") String bucketKey,
   	@PathParam("objectKey") String objectKey
) 
	throws IOException, 
	       URISyntaxException,
	       GeneralSecurityException 
   {
   	APIImpl impl = getAPIImpl( request );
   	if( impl == null )
   	{
           return Response.status( Response.Status.UNAUTHORIZED ).build();     
   	}
   	Result result = impl.objectDelete( bucketKey, objectKey );
   	return formatReturn( result );
   }
 
开发者ID:IBM,项目名称:MaximoForgeViewerPlugin,代码行数:21,代码来源:ForgeRS.java

示例8: deleteDomain

import javax.ws.rs.DELETE; //导入依赖的package包/类
/**
 * Deletes the Domain for a given domain Id
 *
 * @return - deleted Domain
 */
@Path("/{domainId}")
@DELETE
public void deleteDomain(@PathParam("domainId") Long domainId) {

    LOG.info("Deleting Domain Entity ID...:" + domainId);

    this.txControl.required(new Callable<Void>() {

        @Override
        public Void call() throws Exception {

            DomainEntity result = DomainApis.this.em.find(DomainEntity.class, domainId);
            if (result == null) {
                return null;
            }
            DomainApis.this.em.remove(result);
            return null;
        }
    });
}
 
开发者ID:opensecuritycontroller,项目名称:security-mgr-sample-plugin,代码行数:26,代码来源:DomainApis.java

示例9: removeDevices

import javax.ws.rs.DELETE; //导入依赖的package包/类
/**
 * Removes the specified collection of devices from the region.
 *
 * @param regionId region identifier
 * @param stream deviceIds JSON stream
 * @return 204 NO CONTENT
 * @onos.rsModel RegionDeviceIds
 */
@DELETE
@Path("{regionId}/devices")
@Consumes(MediaType.APPLICATION_JSON)
public Response removeDevices(@PathParam("regionId") String regionId,
                              InputStream stream) {
    final RegionId rid = RegionId.regionId(regionId);

    try {
        regionAdminService.removeDevices(rid, extractDeviceIds(stream));
    } catch (IOException e) {
        throw new IllegalArgumentException(e);
    }

    return Response.noContent().build();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:24,代码来源:RegionsWebResource.java

示例10: deletePorts

import javax.ws.rs.DELETE; //导入依赖的package包/类
@DELETE
@Path("{portUUID}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response deletePorts(@PathParam("portUUID") String id) {
    Set<VirtualPortId> vPortIds = new HashSet<>();
    try {
        if (id != null) {
            vPortIds.add(VirtualPortId.portId(id));
        }
        Boolean issuccess = nullIsNotFound(get(VirtualPortService.class)
                .removePorts(vPortIds), VPORT_NOT_FOUND);
        if (!issuccess) {
            return Response.status(INTERNAL_SERVER_ERROR)
                    .entity(VPORT_ID_NOT_EXIST).build();
        }
        return ok(issuccess.toString()).build();
    } catch (Exception e) {
        log.error("Deletes VirtualPort failed because of exception {}",
                  e.toString());
        return Response.status(INTERNAL_SERVER_ERROR).entity(e.toString())
                .build();
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:25,代码来源:VirtualPortWebResource.java

示例11: deleteZNode

import javax.ws.rs.DELETE; //导入依赖的package包/类
@DELETE
@Produces( { MediaType.APPLICATION_JSON, "application/javascript",
        MediaType.APPLICATION_XML, MediaType.APPLICATION_OCTET_STREAM })
public void deleteZNode(@PathParam("path") String path,
        @DefaultValue("-1") @QueryParam("version") String versionParam,
        @Context UriInfo ui) throws InterruptedException, KeeperException {
    ensurePathNotNull(path);

    int version;
    try {
        version = Integer.parseInt(versionParam);
    } catch (NumberFormatException e) {
        throw new WebApplicationException(Response.status(
                Response.Status.BAD_REQUEST).entity(
                new ZError(ui.getRequestUri().toString(), path
                        + " bad version " + versionParam)).build());
    }

    zk.delete(path, version);
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:21,代码来源:ZNodeResource.java

示例12: deleteKey

import javax.ws.rs.DELETE; //导入依赖的package包/类
@DELETE
@Path(KMSRESTConstants.KEY_RESOURCE + "/{name:.*}")
public Response deleteKey(@PathParam("name") final String name)
    throws Exception {
  KMSWebApp.getAdminCallsMeter().mark();
  UserGroupInformation user = HttpUserGroupInformation.get();
  assertAccess(KMSACLs.Type.DELETE, user, KMSOp.DELETE_KEY, name);
  KMSClientProvider.checkNotEmpty(name, "name");

  user.doAs(new PrivilegedExceptionAction<Void>() {
    @Override
    public Void run() throws Exception {
      provider.deleteKey(name);
      provider.flush();
      return null;
    }
  });

  kmsAudit.ok(user, KMSOp.DELETE_KEY, name, "");

  return Response.ok().build();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:KMS.java

示例13: removeVirtualLink

import javax.ws.rs.DELETE; //导入依赖的package包/类
/**
 * Removes the virtual network link from the JSON input stream.
 *
 * @param networkId network identifier
 * @param stream    virtual link JSON stream
 * @return 204 NO CONTENT
 * @onos.rsModel VirtualLink
 */
@DELETE
@Path("{networkId}/links")
@Consumes(MediaType.APPLICATION_JSON)
public Response removeVirtualLink(@PathParam("networkId") long networkId,
                                  InputStream stream) {
    try {
        ObjectNode jsonTree = (ObjectNode) mapper().readTree(stream);
        JsonNode specifiedNetworkId = jsonTree.get("networkId");
        if (specifiedNetworkId != null &&
                specifiedNetworkId.asLong() != (networkId)) {
            throw new IllegalArgumentException(INVALID_FIELD + "networkId");
        }
        final VirtualLink vlinkReq = codec(VirtualLink.class).decode(jsonTree, this);
        vnetAdminService.removeVirtualLink(vlinkReq.networkId(),
                                           vlinkReq.src(), vlinkReq.dst());
    } catch (IOException e) {
        throw new IllegalArgumentException(e);
    }

    return Response.noContent().build();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:30,代码来源:VirtualNetworkWebResource.java

示例14: delete

import javax.ws.rs.DELETE; //导入依赖的package包/类
@DELETE
public Response delete(final @Context UriInfo uriInfo) {
  if (LOG.isDebugEnabled()) {
    LOG.debug("DELETE " + uriInfo.getAbsolutePath());
  }
  servlet.getMetrics().incrementRequests(1);
  if (servlet.isReadOnly()) {
    return Response.status(Response.Status.FORBIDDEN)
      .type(MIMETYPE_TEXT).entity("Forbidden" + CRLF)
      .build();
  }
  if (ScannerResource.delete(id)) {
    servlet.getMetrics().incrementSucessfulDeleteRequests(1);
  } else {
    servlet.getMetrics().incrementFailedDeleteRequests(1);
  }
  return Response.ok().build();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:19,代码来源:ScannerInstanceResource.java

示例15: delete

import javax.ws.rs.DELETE; //导入依赖的package包/类
@DELETE
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/delete")
public Response delete(final String hello) {

    return null;
}
 
开发者ID:trajano,项目名称:app-ms,代码行数:9,代码来源:SampleResource.java


注:本文中的javax.ws.rs.DELETE类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。