Package com.sodius.oslc.client.requests
Class GetServiceProvider
java.lang.Object
com.sodius.oslc.client.requests.AbstractResourceRequest<ResourceResponse<ServiceProvider>>
com.sodius.oslc.client.requests.GetResource<ServiceProvider>
com.sodius.oslc.client.requests.GetServiceProvider
- All Implemented Interfaces:
ResourceRequest<ResourceResponse<ServiceProvider>>,Callable<ResourceResponse<ServiceProvider>>
Executes a GET request to read a
ServiceProvider instance.
The service provider URI is usually given by a ServiceProviderCatalog.
- Since:
- 1.1.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ResourceResponse<ServiceProvider> createErrorResponse(OslcResource resource, ClientResponse response) Processes the error response obtained when executing a request on the specified resource.protected ResourceResponse<ServiceProvider> 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, createResourceResponse, getClient, getUri
-
Constructor Details
-
GetServiceProvider
-
-
Method Details
-
createResponse
protected ResourceResponse<ServiceProvider> 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<ServiceProvider>- 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.
-
createErrorResponse
protected ResourceResponse<ServiceProvider> createErrorResponse(OslcResource resource, ClientResponse response) Description copied from class:AbstractResourceRequestProcesses the error response obtained when executing a request on the specified resource. Due to the contract of theResourceRequestinterface, this method is called when the HTTP response status is anything but20x.The default implementation raises a
ClientWebException. Subclasses may override for example to return a default entity instead of throwing an exception.- Overrides:
createErrorResponsein classAbstractResourceRequest<ResourceResponse<ServiceProvider>>- Parameters:
resource- the resource on which a request is executed.response- the error response obtained.- Returns:
- a default entity or an entity extracted from the error response, if any.
-