10Duke Scale C++ Client
|
#include <StatefulAPIRequest.h>
A tenduke::se::APIRequest
, which uses tenduke::oidc::OIDCSession
to maintain request authorization.
This stateful request wraps the actual API-request. On execute, this request first checks if the user session is valid. If not, the session is first refreshed or login-screen is shown. The request then executes the wrapped API-request.
Exceptions are propagated to the caller. If the wrapped request fails with tenduke::se::http::Unauthorized
-exception, the user session is refreshed and the wrapped request is re-executed. If the re-execution fails again with tenduke::se::http::Unauthorized
, the exception is propagated to the caller.
R | type of the response |
Public Member Functions | |
StatefulAPIRequest (const std::shared_ptr<::tenduke::se::APIRequest< R > > &request, const std::shared_ptr<::tenduke::oidc::OIDCSession > &oidc) | |
Constructs new instance. | |
R | execute () override |
Execute the request synchronously. | |
|
inline |
Constructs new instance.
request | the wrapped request. |
oidc | OIDC-session. |
|
inlineoverridevirtual |
Execute the request synchronously.
tenduke::http::HTTPException | e.g. internal server errors, invalid configuration (e.g. HTTP 404 not found) et al. |
tenduke::net::NetworkingException | e.g. timeouts, networking communication problems |
tenduke::TimedOut | generic time outs |
tenduke::TendukeException | depending on business logic problems (invalid json, cryptography issues, unexpected response etc.) These are usually subclasses of tenduke::TendukeException |
Implements tenduke::se::APIRequest< R >.