Package com.sodius.oslc.client.requests
Class DeleteResource
java.lang.Object
com.sodius.oslc.client.requests.AbstractResourceRequest<ResourceResponse<Void>>
com.sodius.oslc.client.requests.DeleteResource
- All Implemented Interfaces:
ResourceRequest<ResourceResponse<Void>>,Callable<ResourceResponse<Void>>
- Direct Known Subclasses:
DeleteUserGroup
Deletes and OSLC resource.
An OSLC-Core-Version header is set to 2.0, as the GET is expected to execute on an OSLC resource. Clients should subclass
AbstractResourceRequest to execute a GET on a non-OSLC resource.
- Since:
- 1.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionDeleteResource(OslcClient client, URI uri) Creates a new instance to execute a DELETE on the specified resource.DeleteResource(OslcClient client, URI uri, MediaType acceptType) Creates a new instance to execute a DELETE on the specified resource with the given media type for Accept header. -
Method Summary
Modifier and TypeMethodDescriptionprotected ClientResponsecall(OslcResource resource) Executes a DELETE request on the resource.protected ResourceResponse<Void> createResponse(OslcResource resource, ClientResponse response) Returns aResourceResponseinstance with just the HTTP response headers.Methods inherited from class com.sodius.oslc.client.requests.AbstractResourceRequest
call, createErrorResponse, createResourceResponse, getClient, getUri
-
Constructor Details
-
DeleteResource
Creates a new instance to execute a DELETE on the specified resource.- Parameters:
client- the REST client used to execute a request.uri- the URI used for the underlying request.
-
DeleteResource
Creates a new instance to execute a DELETE on the specified resource with the given media type for Accept header.- Parameters:
client- the REST client used to execute a request.uri- the URI used for the underlying request.acceptType- the value of theAcceptheaders to use.- Since:
- 1.13.0
-
-
Method Details
-
call
Executes a DELETE request on the resource.An
OSLC-Core-Versionheader is set to2.0, as the DELETE is expected to execute on an OSLC resource. Clients should subclassAbstractResourceRequestto execute a DELETE on a non-OSLC resource.- Specified by:
callin classAbstractResourceRequest<ResourceResponse<Void>>- Parameters:
resource- the resource on which to execute a request.- Returns:
- the response of the request execution.
-
createResponse
Returns aResourceResponseinstance with just the HTTP response headers. This class doesn't expect any entity to be present in the resource response.- Specified by:
createResponsein classAbstractResourceRequest<ResourceResponse<Void>>- Parameters:
resource- the resource on which a request is executed.response- the response obtained.- Returns:
- the extraction of the response content into the expected format.
-