Qore RestClient Module Reference 2.0
No Matches
RestClient::RestPingPollOperation Class Reference

REST ping polling I/O class with OAuth2 authentication. More...

#include <RestClient.qm.dox.h>

Inheritance diagram for RestClient::RestPingPollOperation:

Public Member Methods

 constructor (RestClient rc, hash< auto > real_opts)
 Creates the poller with the REST client and option hash.
*hash< SocketPollInfo > continuePoll ()
 Returns a hash to be used for I/O polling or NOTHING in case the poll operation is complete.
string getGoal ()
 Returns the goal. More...
string getState ()
 Returns the current state. More...
bool goalReached ()
 Returns True when the goal as been reached. More...

Public Attributes

const SPS_COMPLETE = "complete"
 Complete state.
const SPS_GET_SWAGGER = 'get-swagger'
 Retrieve Swagger schema.
const SPS_OAUTH2_GET_TOKEN = "oauth2-get-token"
 OAuth2 get token state.
const SPS_OAUTH2_REFRESH_TOKEN = "oauth2-refresh-token"
 OAuth2 refresh token state.
const SPS_REST_PING = "rest-ping"
 Execute ping request.

Private Member Methods

Mutex m ()
 Lock for atomicity.

Private Attributes

*auto body
 The message body to send.
bool goal_reached = False
 Goal reached flag.
*hash< auto > headers
 Headers to send.
bool in_refresh
 token refresh flag
string method
 The HTTP method to use.
string path
 The URI path to use.
AbstractPollOperation poller
 The polling object.
RestClient rc
 The RestClient object to use for polling I/O.
hash< auto > real_opts
 RestClient options.
string state
 Current state.
bool use_path_as_is
 Use path directly / ping path already prepared.

Detailed Description

REST ping polling I/O class with OAuth2 authentication.

Ensures a 200 response to the polling send/receive operation

Member Function Documentation

◆ getGoal()

string RestClient::RestPingPollOperation::getGoal ( )

Returns the goal.

the goal set in the constructor

Implements Qore::AbstractPollOperation.

◆ getState()

string RestClient::RestPingPollOperation::getState ( )

Returns the current state.

the current state

Implements Qore::AbstractPollOperation.

◆ goalReached()

bool RestClient::RestPingPollOperation::goalReached ( )

Returns True when the goal as been reached.

True when the goal as been reached

Implements Qore::AbstractPollOperation.