T
- the type of response to extract from the request execution.public abstract class WebAppResourceRequest<T> extends Object implements ResourceRequest<T>
The contract is to throw a WebApplicationException
for any HTTP responses whose status is not 20x
.
Subclasses may call a client ResourceRequest
in their overridden call(OslcClient)
method. Any client exception that may be
thrown will be caught and changed to a web exception.
Constructor and Description |
---|
WebAppResourceRequest(HttpServletRequest request)
Instantiates a new request.
|
Modifier and Type | Method and Description |
---|---|
T |
call()
Executes the request and parse the response content in the specified format.
|
protected abstract T |
call(OslcClient client)
Executes the request with the specified client.
|
public WebAppResourceRequest(HttpServletRequest request)
request
- the HTTP request used to obtain a REST clientpublic final T call()
protected abstract T call(OslcClient client)
Subclasses may call a ResourceRequest
or use the client to make a custom request.
client
- the client to use to execute the request.