Package com.sodius.oslc.client.requests
Class GetResourceShape
java.lang.Object
com.sodius.oslc.client.requests.AbstractResourceRequest<ResourceResponse<ResourceShape>>
com.sodius.oslc.client.requests.GetResource<ResourceShape>
com.sodius.oslc.client.requests.GetResourceShape
- All Implemented Interfaces:
ResourceRequest<ResourceResponse<ResourceShape>>,Callable<ResourceResponse<ResourceShape>>
Executes a GET request to read a
ResourceShape instance.
The resource shape URI is usually given by a http://open-services.net/ns/core#instanceShape property set on an OSLC resource, e.g.
URI resourceShapeUri = ResourceProperties.getURI(resource, OslcCore.PROPERTY_INSTANCE_SHAPE);
- Since:
- 1.3.0
-
Constructor Summary
ConstructorsConstructorDescriptionGetResourceShape(OslcClient client, URI uri) Creates a request to read the content of a resource shape. -
Method Summary
Modifier and TypeMethodDescriptionprotected ResourceResponse<ResourceShape> createResponse(OslcResource resource, ClientResponse response) Extracts aResourceResponseinstance from the obtained HTTP response.Methods inherited from class com.sodius.oslc.client.requests.GetResource
call, getMethods inherited from class com.sodius.oslc.client.requests.AbstractResourceRequest
call, createErrorResponse, createResourceResponse, getClient, getUri
-
Constructor Details
-
GetResourceShape
Creates a request to read the content of a resource shape.- Parameters:
client- the REST client used to execute a request.uri- the URI of a resource shape.
-
-
Method Details
-
createResponse
protected ResourceResponse<ResourceShape> createResponse(OslcResource resource, ClientResponse response) Description copied from class:GetResourceExtracts aResourceResponseinstance from the obtained HTTP response. The response contains the response headers, from which theETagheader can be extracted in case this request is to follow by aPUT.- Overrides:
createResponsein classGetResource<ResourceShape>- 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.
-