use of javax.ws.rs.DELETE in project oxTrust by GluuFederation.
the class UserWebService method deleteUser.
@Path("{id}")
@DELETE
@Produces({ MEDIA_TYPE_SCIM_JSON + UTF8_CHARSET_FRAGMENT, MediaType.APPLICATION_JSON + UTF8_CHARSET_FRAGMENT })
@HeaderParam("Accept")
@DefaultValue(MEDIA_TYPE_SCIM_JSON)
@ProtectedApi
@ApiOperation(value = "Delete User", notes = "Delete User (https://tools.ietf.org/html/rfc7644#section-3.6)")
public Response deleteUser(@PathParam("id") String id) {
Response response;
try {
log.debug("Executing web service method. deleteUser");
// person cannot be null (check associated decorator method)
GluuCustomPerson person = personService.getPersonByInum(id);
scim2UserService.deleteUser(person);
response = Response.noContent().build();
} catch (Exception e) {
log.error("Failure at deleteUser method", e);
response = getErrorResponse(Response.Status.INTERNAL_SERVER_ERROR, "Unexpected error: " + e.getMessage());
}
return response;
}
use of javax.ws.rs.DELETE in project cxf by apache.
the class BookCatalog method delete.
@DELETE
public Response delete() throws IOException {
final IndexWriter writer = getIndexWriter();
try {
writer.deleteAll();
writer.commit();
} finally {
writer.close();
}
return Response.ok().build();
}
use of javax.ws.rs.DELETE in project cxf by apache.
the class BookStore method deleteBook.
@DELETE
@Path("/books/{bookId}/")
public Response deleteBook(@PathParam("bookId") String id) {
Book b = books.get(Long.parseLong(id));
Response r;
if (b != null) {
r = Response.ok().build();
} else {
r = Response.notModified().build();
}
return r;
}
use of javax.ws.rs.DELETE in project cxf by apache.
the class BookStore method deleteWithQuery.
@DELETE
@Path("/books/id")
public Response deleteWithQuery(@QueryParam("value") @DefaultValue("-1") int id) {
if (id != 123) {
throw new WebApplicationException();
}
Book b = books.get(new Long(id));
Response r;
if (b != null) {
r = Response.ok().build();
} else {
r = Response.notModified().build();
}
return r;
}
use of javax.ws.rs.DELETE in project cxf by apache.
the class Catalog method delete.
@DELETE
public Response delete() throws IOException {
final IndexWriter writer = getIndexWriter();
try {
storage.deleteAll();
writer.deleteAll();
writer.commit();
} finally {
writer.close();
}
return Response.ok().build();
}
Aggregations