Package com.sodius.oslc.client.requests
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>
Executes a GET request to read a
RootServices instance.- Since:
- 1.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionGetRootServices(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.GetRootServices(URI uri, Class<T> type) Creates a new instance to execute a GET on the specified root services location. -
Method Summary
Modifier and TypeMethodDescriptionprotected ClientResponsecall(OslcResource resource) Executes the request on the specified resource.protected TcreateResponse(OslcResource resource, ClientResponse response) Processes the response obtained when executing a request on the specified resource.Methods inherited from class com.sodius.oslc.client.requests.AbstractResourceRequest
call, createErrorResponse, createResourceResponse, getClient, getUri
-
Constructor Details
-
GetRootServices
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 (usuallyRootServices, but can be extended).
-
GetRootServices
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 usingOslcClientFactoryfor specific parameters, like a proxy configuration.- Parameters:
client- the client to useuri- the root services location.type- the type of response to extract from the request execution (usuallyRootServices, but can be extended).- Since:
- 3.5.1
-
-
Method Details
-
call
Description copied from class:AbstractResourceRequestExecutes the request on the specified resource. Subclasses may add extra information (such as headers) on the resource before executing the request.- Specified by:
callin classAbstractResourceRequest<T extends RootServices>- Parameters:
resource- the resource on which to execute a request.- Returns:
- the response of the request execution.
-
createResponse
Description copied from class:AbstractResourceRequestProcesses the response obtained when executing a request on the specified resource. Due to the contract of theResourceRequestinterface, this method is called only when the HTTP response status is20x.- Specified by:
createResponsein classAbstractResourceRequest<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.
-