Package com.sodius.oslc.client.requests
Class GetServiceProvider
- java.lang.Object
-
- com.sodius.oslc.client.requests.AbstractResourceRequest<ResourceResponse<T>>
-
- com.sodius.oslc.client.requests.GetResource<ServiceProvider>
-
- com.sodius.oslc.client.requests.GetServiceProvider
-
- All Implemented Interfaces:
ResourceRequest<ResourceResponse<ServiceProvider>>,Callable<ResourceResponse<ServiceProvider>>
public class GetServiceProvider extends GetResource<ServiceProvider>
Executes a GET request to read aServiceProviderinstance.The service provider URI is usually given by a
ServiceProviderCatalog.- Since:
- 1.1.0
- See Also:
GetServiceProviderCatalog
-
-
Constructor Summary
Constructors Constructor Description GetServiceProvider(OslcClient client, URI uri)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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, get
-
Methods inherited from class com.sodius.oslc.client.requests.AbstractResourceRequest
call, createResourceResponse, getClient, getUri
-
-
-
-
Constructor Detail
-
GetServiceProvider
public GetServiceProvider(OslcClient client, URI uri)
-
-
Method Detail
-
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.
-
-