Class GetRootServices<T extends RootServices>

java.lang.Object
com.sodius.oslc.client.requests.AbstractResourceRequest<T>
com.sodius.oslc.client.requests.GetRootServices<T>
Type Parameters:
T - the type of RootServices to extract.
All Implemented Interfaces:
ResourceRequest<T>, Callable<T>

public class GetRootServices<T extends RootServices> extends AbstractResourceRequest<T>
Executes a GET request to read a RootServices instance.
Since:
1.1.0
  • Constructor Details

    • GetRootServices

      public GetRootServices(URI uri, Class<T> type)
      Creates a new instance to execute a GET on the specified root services location.
      Parameters:
      uri - the root services location.
      type - the type of response to extract from the request execution (usually RootServices, but can be extended).
    • GetRootServices

      public GetRootServices(OslcClient client, URI uri, Class<T> type)
      Creates a new instance to execute a GET on the specified root services location, using the given client.

      The client must be unauthenticated, as root services is an authorization-free resource, and some servers may reject requests providing an Authorization header. The client may be customized using OslcClientFactory for specific parameters, like a proxy configuration.

      Parameters:
      client - the client to use
      uri - the root services location.
      type - the type of response to extract from the request execution (usually RootServices, but can be extended).
      Since:
      3.5.1
  • Method Details

    • call

      protected ClientResponse call(OslcResource resource)
      Description copied from class: AbstractResourceRequest
      Executes the request on the specified resource. Subclasses may add extra information (such as headers) on the resource before executing the request.
      Specified by:
      call in class AbstractResourceRequest<T extends RootServices>
      Parameters:
      resource - the resource on which to execute a request.
      Returns:
      the response of the request execution.
    • createResponse

      protected T createResponse(OslcResource resource, ClientResponse response)
      Description copied from class: AbstractResourceRequest
      Processes the response obtained when executing a request on the specified resource. Due to the contract of the ResourceRequest interface, this method is called only when the HTTP response status is 20x .
      Specified by:
      createResponse in class AbstractResourceRequest<T extends RootServices>
      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.