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
public class DeleteResource extends AbstractResourceRequest<ResourceResponse<Void>>
Deletes and OSLC resource.An
OSLC-Core-Version
header is set to2.0
, as the GET is expected to execute on an OSLC resource. Clients should subclassAbstractResourceRequest
to execute a GET on a non-OSLC resource.- Since:
- 1.1.0
-
-
Constructor Summary
Constructors Constructor Description DeleteResource(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ClientResponse
call(OslcResource resource)
Executes a DELETE request on the resource.protected ResourceResponse<Void>
createResponse(OslcResource resource, ClientResponse response)
Returns aResourceResponse
instance with just the HTTP response headers.-
Methods inherited from class com.sodius.oslc.client.requests.AbstractResourceRequest
call, createErrorResponse, createResourceResponse, getClient, getUri
-
-
-
-
Constructor Detail
-
DeleteResource
public DeleteResource(OslcClient client, URI uri)
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
public 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.- Parameters:
client
- the REST client used to execute a request.uri
- the URI used for the underlying request.acceptType
- the value of theAccept
headers to use.- Since:
- 1.13.0
-
-
Method Detail
-
call
protected ClientResponse call(OslcResource resource)
Executes a DELETE request on the resource.An
OSLC-Core-Version
header is set to2.0
, as the DELETE is expected to execute on an OSLC resource. Clients should subclassAbstractResourceRequest
to execute a DELETE on a non-OSLC resource.- Specified by:
call
in classAbstractResourceRequest<ResourceResponse<Void>>
- Parameters:
resource
- the resource on which to execute a request.- Returns:
- the response of the request execution.
-
createResponse
protected ResourceResponse<Void> createResponse(OslcResource resource, ClientResponse response)
Returns aResourceResponse
instance with just the HTTP response headers. This class doesn't expect any entity to be present in the resource response.- Specified by:
createResponse
in 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.
-
-