Search in sources :

Example 86 with DELETE

use of javax.ws.rs.DELETE in project quickstart by wildfly.

the class ProductResourceRESTService method deleteAllProducts.

@DELETE
public Response deleteAllProducts() {
    DeleteTask dt = deleteTaskInstance.get();
    // Delete all Products on a separated Thread
    log.info("Will delete all Products on other Thread");
    managedExecutorService.execute(dt);
    log.info("Returning response");
    return Response.ok().build();
}
Also used : DeleteTask(org.jboss.as.quickstarts.managedexecutorservice.concurrency.DeleteTask) DELETE(javax.ws.rs.DELETE)

Example 87 with DELETE

use of javax.ws.rs.DELETE in project kylo by Teradata.

the class DebugController method deleteJcrTree.

/**
 * Delete the JCR tree specified by the absolute path following ".../jcr/".
 *
 * @param abspath the path with JCR to delete
 * @return a confirmation message that the path was deleted
 */
@DELETE
@Path("jcr/{abspath: .*}")
@Produces(MediaType.TEXT_PLAIN)
public String deleteJcrTree(@PathParam("abspath") final String abspath) {
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    try {
        metadata.commit(() -> {
            this.accessController.checkPermission(AccessController.SERVICES, MetadataAccessControl.ADMIN_METADATA);
            Session session = JcrMetadataAccess.getActiveSession();
            session.removeItem("/" + abspath);
            pw.print("DELETED " + abspath);
        });
    } catch (Exception e) {
        e.printStackTrace(pw);
        throw new RuntimeException(e);
    }
    pw.flush();
    return sw.toString();
}
Also used : StringWriter(java.io.StringWriter) ParseException(java.text.ParseException) PathNotFoundException(javax.jcr.PathNotFoundException) RepositoryException(javax.jcr.RepositoryException) PrintWriter(java.io.PrintWriter) Session(javax.jcr.Session) Path(javax.ws.rs.Path) JcrPath(com.thinkbiganalytics.metadata.modeshape.support.JcrPath) DELETE(javax.ws.rs.DELETE) Produces(javax.ws.rs.Produces)

Example 88 with DELETE

use of javax.ws.rs.DELETE in project fabric8 by jboss-fuse.

the class ContainerResource method stop.

/**
 * Stops the container
 */
@DELETE
@Path("start")
public void stop() {
    FabricService fabricService = getFabricService();
    Objects.notNull(fabricService, "fabricService");
    fabricService.stopContainer(container);
}
Also used : FabricService(io.fabric8.api.FabricService) Path(javax.ws.rs.Path) DELETE(javax.ws.rs.DELETE)

Example 89 with DELETE

use of javax.ws.rs.DELETE in project fabric8 by jboss-fuse.

the class ContainerResource method delete.

/**
 * Deletes this container
 */
@DELETE
public void delete() {
    FabricService fabricService = getFabricService();
    Objects.notNull(fabricService, "fabricService");
    fabricService.destroyContainer(container);
}
Also used : FabricService(io.fabric8.api.FabricService) DELETE(javax.ws.rs.DELETE)

Example 90 with DELETE

use of javax.ws.rs.DELETE in project fabric8 by jboss-fuse.

the class ProfileResource method deleteProfile.

@DELETE
public void deleteProfile() {
    FabricService fabricService = getFabricService();
    Objects.notNull(fabricService, "fabricService");
    ProfileService profileService = getProfileService();
    Objects.notNull(profileService, "profileService");
    profileService.deleteProfile(fabricService, profile.getVersion(), profile.getId(), true);
}
Also used : ProfileService(io.fabric8.api.ProfileService) FabricService(io.fabric8.api.FabricService) DELETE(javax.ws.rs.DELETE)

Aggregations

DELETE (javax.ws.rs.DELETE)587 Path (javax.ws.rs.Path)539 Produces (javax.ws.rs.Produces)194 ApiOperation (io.swagger.annotations.ApiOperation)153 ApiResponses (io.swagger.annotations.ApiResponses)127 Consumes (javax.ws.rs.Consumes)78 Timed (com.codahale.metrics.annotation.Timed)59 Response (javax.ws.rs.core.Response)54 IOException (java.io.IOException)47 WebApplicationException (javax.ws.rs.WebApplicationException)46 RESTPermit (fi.otavanopisto.security.rest.RESTPermit)42 Identity (org.olat.core.id.Identity)36 AuditEvent (org.graylog2.audit.jersey.AuditEvent)32 NotFoundException (javax.ws.rs.NotFoundException)23 POST (javax.ws.rs.POST)21 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)20 ApiResponse (io.swagger.annotations.ApiResponse)20 RestSecurityHelper.getIdentity (org.olat.restapi.security.RestSecurityHelper.getIdentity)20 HashMap (java.util.HashMap)19 GET (javax.ws.rs.GET)19