Class GetResourceShape

All Implemented Interfaces:
ResourceRequest<ResourceResponse<ResourceShape>>, Callable<ResourceResponse<ResourceShape>>

public class GetResourceShape extends GetResource<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 Details

    • 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 Details

    • createResponse

      protected ResourceResponse<ResourceShape> createResponse(OslcResource resource, ClientResponse response)
      Description copied from class: GetResource
      Extracts a ResourceResponse instance from the obtained HTTP response. The response contains the response headers, from which the ETag header can be extracted in case this request is to follow by a PUT.
      Overrides:
      createResponse in class GetResource<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.