Package com.sodius.oslc.client.requests
Class GetResourceShape
- java.lang.Object
-
- com.sodius.oslc.client.requests.AbstractResourceRequest<ResourceResponse<T>>
-
- com.sodius.oslc.client.requests.GetResource<ResourceShape>
-
- com.sodius.oslc.client.requests.GetResourceShape
-
- All Implemented Interfaces:
ResourceRequest<ResourceResponse<ResourceShape>>
,Callable<ResourceResponse<ResourceShape>>
public class GetResourceShape extends GetResource<ResourceShape>
Executes a GET request to read aResourceShape
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
Constructors Constructor Description GetResourceShape(OslcClient client, URI uri)
Creates a request to read the content of a resource shape.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ResourceResponse<ResourceShape>
createResponse(OslcResource resource, ClientResponse response)
Extracts aResourceResponse
instance from the obtained HTTP response.-
Methods inherited from class com.sodius.oslc.client.requests.GetResource
call, get
-
Methods inherited from class com.sodius.oslc.client.requests.AbstractResourceRequest
call, createErrorResponse, createResourceResponse, getClient, getUri
-
-
-
-
Constructor Detail
-
GetResourceShape
public GetResourceShape(OslcClient client, URI uri)
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 Detail
-
createResponse
protected ResourceResponse<ResourceShape> createResponse(OslcResource resource, ClientResponse response)
Description copied from class:GetResource
Extracts aResourceResponse
instance from the obtained HTTP response. The response contains the response headers, from which theETag
header can be extracted in case this request is to follow by aPUT
.- Overrides:
createResponse
in 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.
-
-