NCBI C++ ToolKit
Classes | Typedefs | Enumerations | Enumerator | Functions | Variables
Context

Classes

class  CRetryContext
 CRetryContext – Retry context. More...
 
class  CHttpRetryContext
 HTTP-specific retry context implementation. More...
 

Typedefs

typedef map< string, stringCRetryContext::TValues
 Map of name-value pairs. More...
 
typedef int CRetryContext::TFlags
 

Enumerations

enum  CRetryContext::EContentOverride { CRetryContext::eNot_set , CRetryContext::eNoContent , CRetryContext::eFromResponse , CRetryContext::eData }
 Content override flags. More...
 
enum  CRetryContext::FFlags {
  CRetryContext::fStop = 1 << 0 , CRetryContext::fDelay = 1 << 1 , CRetryContext::fArgs = 1 << 2 , CRetryContext::fUrl = 1 << 3 ,
  CRetryContext::fContentOverride = 1 << 4 , CRetryContext::fContent = 1 << 5
}
 

Functions

 CRetryContext::CRetryContext (void)
 
virtual CRetryContext::~CRetryContext (void)
 
bool CRetryContext::GetNeedRetry (void) const
 Check if another retry attempt has been requested (any new headers except STOP received in the last reply). More...
 
void CRetryContext::SetNeedRetry (void)
 
void CRetryContext::ResetNeedRetry (void)
 
void CRetryContext::Reset (void)
 Clear all options. More...
 
bool CRetryContext::IsSetStop (void) const
 Check if STOP flag is set. More...
 
const stringCRetryContext::GetStopReason (void) const
 Get STOP reason (or empty string). More...
 
void CRetryContext::SetStop (const string &reason)
 Set STOP flag, clear all other options. More...
 
void CRetryContext::ResetStop (void)
 Reset STOP flag and reason. More...
 
bool CRetryContext::IsSetDelay (void) const
 Check if retry delay is set. More...
 
const CTimeSpanCRetryContext::GetDelay (void) const
 Get retry delay. More...
 
void CRetryContext::SetDelay (CTimeSpan delay)
 Set retry delay. More...
 
void CRetryContext::SetDelay (double sec)
 Set retry delay in seconds. More...
 
void CRetryContext::ResetDelay (void)
 Reset delay. More...
 
bool CRetryContext::IsSetArgs (void) const
 Check if retry args are set. More...
 
const stringCRetryContext::GetArgs (void) const
 Get retry args, URL-decoded. More...
 
void CRetryContext::SetArgs (const string &args)
 Set retry args. More...
 
void CRetryContext::SetArgs (const CUrlArgs &args)
 Set retry args. More...
 
void CRetryContext::ResetArgs (void)
 Reset args. More...
 
bool CRetryContext::IsSetUrl (void) const
 Check if retry URL is set. More...
 
const stringCRetryContext::GetUrl (void) const
 Get retry URL. More...
 
void CRetryContext::SetUrl (const string &url)
 Set retry URL. More...
 
void CRetryContext::SetUrl (const CUrl &url)
 Set retry URL. More...
 
void CRetryContext::ResetUrl (void)
 Reset URL. More...
 
bool CRetryContext::IsSetContentOverride (void) const
 Check if content source is set. More...
 
EContentOverride CRetryContext::GetContentOverride (void) const
 Get content source. More...
 
void CRetryContext::SetContentOverride (EContentOverride content)
 Set content source. More...
 
void CRetryContext::ResetContentOverride (void)
 Reset content source. More...
 
bool CRetryContext::IsSetContent (void) const
 Check if retry content is set and content-override flag assumes any content (eFromResponse or eData). More...
 
const stringCRetryContext::GetContent (void) const
 Get retry content. More...
 
void CRetryContext::SetContent (const string &content)
 Set retry content. More...
 
void CRetryContext::ResetContent (void)
 Reset content. More...
 
bool CRetryContext::NeedReconnect (void) const
 Check if the client should reconnect (e.g. if URL or args have changed). More...
 
void CRetryContext::SetNeedReconnect (void)
 Set need-reconnect flag. More...
 
void CRetryContext::ResetNeedReconnect (void)
 Reset need-reconnect flag (e.g. More...
 
virtual void CRetryContext::GetValues (TValues &) const
 Fill name-value pairs (e.g. More...
 
bool CRetryContext::x_IsSetFlag (FFlags f) const
 
void CRetryContext::x_SetFlag (FFlags f, bool value=true)
 
 CHttpRetryContext::CHttpRetryContext (void)
 
virtual CHttpRetryContext::~CHttpRetryContext (void)
 
 CHttpRetryContext::CHttpRetryContext (const CRetryContext &ctx)
 
CHttpRetryContextCHttpRetryContext::operator= (const CRetryContext &ctx)
 
void CHttpRetryContext::ParseHeader (const char *http_header)
 
virtual void CHttpRetryContext::GetValues (TValues &values) const
 Fills HTTP header names and values. More...
 

Variables

TFlags CRetryContext::m_Flags
 
string CRetryContext::m_StopReason
 
CTimeSpan CRetryContext::m_Delay
 
string CRetryContext::m_Args
 
string CRetryContext::m_Url
 
EContentOverride CRetryContext::m_ContentOverride
 
string CRetryContext::m_Content
 
bool CRetryContext::m_NeedRetry
 
bool CRetryContext::m_NeedReconnect
 
static const char * CHttpRetryContext::kHeader_Stop = "X-NCBI-Retry-Stop"
 
static const char * CHttpRetryContext::kHeader_Delay = "X-NCBI-Retry-Delay"
 
static const char * CHttpRetryContext::kHeader_Args = "X-NCBI-Retry-Args"
 
static const char * CHttpRetryContext::kHeader_Url = "X-NCBI-Retry-URL"
 
static const char * CHttpRetryContext::kHeader_Content = "X-NCBI-Retry-Content"
 
static const char * CHttpRetryContext::kContent_None = "no_content"
 
static const char * CHttpRetryContext::kContent_FromResponse = "from_response"
 
static const char * CHttpRetryContext::kContent_Value = "content:"
 

Detailed Description

Typedef Documentation

◆ TFlags

typedef int CRetryContext::TFlags
private

Definition at line 172 of file retry_ctx.hpp.

◆ TValues

Map of name-value pairs.

Definition at line 158 of file retry_ctx.hpp.

Enumeration Type Documentation

◆ EContentOverride

Content override flags.

Enumerator
eNot_set 

No content provided, send the original request data.

eNoContent 

Do not send any content on retry.

eFromResponse 

On retry send content from the response body.

eData 

On retry send content from the response header.

Definition at line 64 of file retry_ctx.hpp.

◆ FFlags

enum CRetryContext::FFlags
private
Enumerator
fStop 
fDelay 
fArgs 
fUrl 
fContentOverride 
fContent 

Definition at line 164 of file retry_ctx.hpp.

Function Documentation

◆ CHttpRetryContext() [1/2]

CHttpRetryContext::CHttpRetryContext ( const CRetryContext ctx)

Definition at line 51 of file retry_ctx.cpp.

References ctx.

◆ CHttpRetryContext() [2/2]

CHttpRetryContext::CHttpRetryContext ( void  )
inline

Definition at line 193 of file retry_ctx.hpp.

◆ CRetryContext()

CRetryContext::CRetryContext ( void  )
inline

Definition at line 226 of file retry_ctx.hpp.

◆ GetArgs()

const string & CRetryContext::GetArgs ( void  ) const
inline

Get retry args, URL-decoded.

Definition at line 346 of file retry_ctx.hpp.

References CRetryContext::m_Args.

Referenced by CHttpRetryContext::GetValues().

◆ GetContent()

const string & CRetryContext::GetContent ( void  ) const
inline

Get retry content.

Definition at line 456 of file retry_ctx.hpp.

References CRetryContext::m_Content.

Referenced by CHttpRetryContext::GetValues(), and CRPCClient_Base::x_Ask().

◆ GetContentOverride()

CRetryContext::EContentOverride CRetryContext::GetContentOverride ( void  ) const
inline

Get content source.

Definition at line 424 of file retry_ctx.hpp.

References CRetryContext::m_ContentOverride.

Referenced by CHttpRetryContext::GetValues(), and CRPCClient_Base::x_Ask().

◆ GetDelay()

const CTimeSpan & CRetryContext::GetDelay ( void  ) const
inline

Get retry delay.

Definition at line 308 of file retry_ctx.hpp.

References CRetryContext::m_Delay.

Referenced by CHttpRetryContext::GetValues(), and CRPCClient_Base::x_GetRetryDelay().

◆ GetNeedRetry()

bool CRetryContext::GetNeedRetry ( void  ) const
inline

Check if another retry attempt has been requested (any new headers except STOP received in the last reply).

Definition at line 236 of file retry_ctx.hpp.

References CRetryContext::m_NeedRetry.

Referenced by CRPCClient_Base::x_Ask().

◆ GetStopReason()

const string & CRetryContext::GetStopReason ( void  ) const
inline

Get STOP reason (or empty string).

Definition at line 278 of file retry_ctx.hpp.

References CRetryContext::m_StopReason.

Referenced by CHttpRetryContext::GetValues(), and CRPCClient_Base::x_Ask().

◆ GetUrl()

const string & CRetryContext::GetUrl ( void  ) const
inline

Get retry URL.

Definition at line 384 of file retry_ctx.hpp.

References CRetryContext::m_Url.

Referenced by CHttpRetryContext::GetValues().

◆ GetValues() [1/2]

virtual void CRetryContext::GetValues ( TValues ) const
inlinevirtual

Fill name-value pairs (e.g.

to be used by a server application to serve retry information). The default implementaion does nothing.

Reimplemented in CHttpRetryContext.

Definition at line 161 of file retry_ctx.hpp.

◆ GetValues() [2/2]

void CHttpRetryContext::GetValues ( TValues values) const
virtual

◆ IsSetArgs()

bool CRetryContext::IsSetArgs ( void  ) const
inline

Check if retry args are set.

Definition at line 339 of file retry_ctx.hpp.

References CRetryContext::fArgs, and CRetryContext::x_IsSetFlag().

Referenced by CHttpRetryContext::GetValues().

◆ IsSetContent()

bool CRetryContext::IsSetContent ( void  ) const
inline

Check if retry content is set and content-override flag assumes any content (eFromResponse or eData).

Definition at line 447 of file retry_ctx.hpp.

References CRetryContext::eData, CRetryContext::eFromResponse, CRetryContext::fContent, CRetryContext::m_Content, CRetryContext::m_ContentOverride, and CRetryContext::x_IsSetFlag().

Referenced by CHttpRetryContext::GetValues(), and CRPCClient_Base::x_Ask().

◆ IsSetContentOverride()

bool CRetryContext::IsSetContentOverride ( void  ) const
inline

◆ IsSetDelay()

bool CRetryContext::IsSetDelay ( void  ) const
inline

Check if retry delay is set.

Definition at line 301 of file retry_ctx.hpp.

References CRetryContext::fDelay, and CRetryContext::x_IsSetFlag().

Referenced by CHttpRetryContext::GetValues(), and CRPCClient_Base::x_GetRetryDelay().

◆ IsSetStop()

bool CRetryContext::IsSetStop ( void  ) const
inline

Check if STOP flag is set.

Definition at line 271 of file retry_ctx.hpp.

References CRetryContext::fStop, and CRetryContext::x_IsSetFlag().

Referenced by CHttpRetryContext::GetValues(), and CRPCClient_Base::x_Ask().

◆ IsSetUrl()

bool CRetryContext::IsSetUrl ( void  ) const
inline

Check if retry URL is set.

Definition at line 377 of file retry_ctx.hpp.

References CRetryContext::fUrl, and CRetryContext::x_IsSetFlag().

Referenced by CHttpRetryContext::GetValues().

◆ NeedReconnect()

bool CRetryContext::NeedReconnect ( void  ) const
inline

Check if the client should reconnect (e.g. if URL or args have changed).

Definition at line 150 of file retry_ctx.hpp.

References CRetryContext::m_NeedReconnect.

◆ operator=()

CHttpRetryContext & CHttpRetryContext::operator= ( const CRetryContext ctx)

Definition at line 57 of file retry_ctx.cpp.

References ctx, and CObject::operator=().

◆ ParseHeader()

void CHttpRetryContext::ParseHeader ( const char *  http_header)

◆ Reset()

void CRetryContext::Reset ( void  )
inline

◆ ResetArgs()

void CRetryContext::ResetArgs ( void  )
inline

Reset args.

Definition at line 369 of file retry_ctx.hpp.

References CRetryContext::fArgs, CRetryContext::m_Args, and CRetryContext::x_SetFlag().

Referenced by CRetryContext::Reset().

◆ ResetContent()

void CRetryContext::ResetContent ( void  )
inline

◆ ResetContentOverride()

void CRetryContext::ResetContentOverride ( void  )
inline

◆ ResetDelay()

void CRetryContext::ResetDelay ( void  )
inline

◆ ResetNeedReconnect()

void CRetryContext::ResetNeedReconnect ( void  )
inline

Reset need-reconnect flag (e.g.

after reconnecting to the new URL, but before reading new context).

Definition at line 155 of file retry_ctx.hpp.

References CRetryContext::m_NeedReconnect.

Referenced by CRPCClient_Base::Connect(), and CRetryContext::Reset().

◆ ResetNeedRetry()

void CRetryContext::ResetNeedRetry ( void  )
inline

Definition at line 250 of file retry_ctx.hpp.

References CRetryContext::m_NeedRetry.

Referenced by CHttpRetryContext::ParseHeader(), and CRetryContext::Reset().

◆ ResetStop()

void CRetryContext::ResetStop ( void  )
inline

Reset STOP flag and reason.

Definition at line 293 of file retry_ctx.hpp.

References CRetryContext::fStop, CRetryContext::m_StopReason, and CRetryContext::x_SetFlag().

Referenced by CRetryContext::Reset().

◆ ResetUrl()

void CRetryContext::ResetUrl ( void  )
inline

Reset URL.

Definition at line 407 of file retry_ctx.hpp.

References CRetryContext::fUrl, CRetryContext::m_Url, and CRetryContext::x_SetFlag().

Referenced by CRetryContext::Reset().

◆ SetArgs() [1/2]

void CRetryContext::SetArgs ( const CUrlArgs args)
inline

Set retry args.

The arguments set here will override any values set in the URL.

See also
SetUrl()

Definition at line 361 of file retry_ctx.hpp.

References CUrlArgs::eAmp_Char, CRetryContext::fArgs, CUrlArgs::GetQueryString(), CRetryContext::m_Args, and CRetryContext::x_SetFlag().

◆ SetArgs() [2/2]

void CRetryContext::SetArgs ( const string args)
inline

Set retry args.

The arguments must be pre-URL-encoded as required. The arguments set here will override any values set in the URL.

See also
SetUrl()

Definition at line 353 of file retry_ctx.hpp.

References CRetryContext::fArgs, CRetryContext::m_Args, and CRetryContext::x_SetFlag().

Referenced by CHttpRetryContext::ParseHeader().

◆ SetContent()

void CRetryContext::SetContent ( const string content)
inline

Set retry content.

If the content is non-empty and content-override is eFromResponse or eData, the value should be sent by the server automatically.

Definition at line 463 of file retry_ctx.hpp.

References CRetryContext::fContent, CRetryContext::m_Content, and CRetryContext::x_SetFlag().

Referenced by CHttpRetryContext::ParseHeader(), and CRPCClient_Base::x_Ask().

◆ SetContentOverride()

void CRetryContext::SetContentOverride ( EContentOverride  content)
inline

◆ SetDelay() [1/2]

void CRetryContext::SetDelay ( CTimeSpan  delay)
inline

Set retry delay.

Definition at line 315 of file retry_ctx.hpp.

References CRetryContext::fDelay, CRetryContext::m_Delay, and CRetryContext::x_SetFlag().

Referenced by CHttpRetryContext::ParseHeader().

◆ SetDelay() [2/2]

void CRetryContext::SetDelay ( double  sec)
inline

Set retry delay in seconds.

Definition at line 323 of file retry_ctx.hpp.

References CRetryContext::fDelay, CRetryContext::m_Delay, CTimeSpan::Set(), and CRetryContext::x_SetFlag().

◆ SetNeedReconnect()

void CRetryContext::SetNeedReconnect ( void  )
inline

Set need-reconnect flag.

Definition at line 152 of file retry_ctx.hpp.

References CRetryContext::m_NeedReconnect.

Referenced by CHttpRetryContext::ParseHeader().

◆ SetNeedRetry()

void CRetryContext::SetNeedRetry ( void  )
inline

Definition at line 243 of file retry_ctx.hpp.

References CRetryContext::m_NeedRetry.

Referenced by CHttpRetryContext::ParseHeader().

◆ SetStop()

void CRetryContext::SetStop ( const string reason)
inline

Set STOP flag, clear all other options.

Definition at line 285 of file retry_ctx.hpp.

References CRetryContext::fStop, CRetryContext::m_StopReason, and CRetryContext::x_SetFlag().

Referenced by CHttpRetryContext::ParseHeader().

◆ SetUrl() [1/2]

void CRetryContext::SetUrl ( const CUrl url)
inline

Set retry URL.

If the URL contains any arguments, they may be overwritten by the values set through SetArgs().

Definition at line 399 of file retry_ctx.hpp.

References CUrl::ComposeUrl(), CUrlArgs::eAmp_Char, CRetryContext::fUrl, CRetryContext::m_Url, and CRetryContext::x_SetFlag().

◆ SetUrl() [2/2]

void CRetryContext::SetUrl ( const string url)
inline

Set retry URL.

If the URL contains any arguments, they may be overwritten by the values set through SetArgs().

Definition at line 391 of file retry_ctx.hpp.

References CRetryContext::fUrl, CRetryContext::m_Url, and CRetryContext::x_SetFlag().

Referenced by CHttpRetryContext::ParseHeader().

◆ x_IsSetFlag()

bool CRetryContext::x_IsSetFlag ( FFlags  f) const
inlineprivate

◆ x_SetFlag()

void CRetryContext::x_SetFlag ( FFlags  f,
bool  value = true 
)
inlineprivate

◆ ~CHttpRetryContext()

virtual CHttpRetryContext::~CHttpRetryContext ( void  )
inlinevirtual

Definition at line 194 of file retry_ctx.hpp.

◆ ~CRetryContext()

virtual CRetryContext::~CRetryContext ( void  )
inlinevirtual

Definition at line 61 of file retry_ctx.hpp.

Variable Documentation

◆ kContent_FromResponse

const char * CHttpRetryContext::kContent_FromResponse = "from_response"
static

Definition at line 211 of file retry_ctx.hpp.

Referenced by CHttpRetryContext::GetValues(), and CHttpRetryContext::ParseHeader().

◆ kContent_None

const char * CHttpRetryContext::kContent_None = "no_content"
static

Definition at line 210 of file retry_ctx.hpp.

Referenced by CHttpRetryContext::GetValues(), and CHttpRetryContext::ParseHeader().

◆ kContent_Value

const char * CHttpRetryContext::kContent_Value = "content:"
static

Definition at line 212 of file retry_ctx.hpp.

Referenced by CHttpRetryContext::GetValues(), and CHttpRetryContext::ParseHeader().

◆ kHeader_Args

const char * CHttpRetryContext::kHeader_Args = "X-NCBI-Retry-Args"
static

Definition at line 207 of file retry_ctx.hpp.

Referenced by CHttpRetryContext::GetValues(), and CHttpRetryContext::ParseHeader().

◆ kHeader_Content

const char * CHttpRetryContext::kHeader_Content = "X-NCBI-Retry-Content"
static

Definition at line 209 of file retry_ctx.hpp.

Referenced by CHttpRetryContext::GetValues(), and CHttpRetryContext::ParseHeader().

◆ kHeader_Delay

const char * CHttpRetryContext::kHeader_Delay = "X-NCBI-Retry-Delay"
static

◆ kHeader_Stop

const char * CHttpRetryContext::kHeader_Stop = "X-NCBI-Retry-Stop"
static

Definition at line 205 of file retry_ctx.hpp.

Referenced by CHttpRetryContext::GetValues(), and CHttpRetryContext::ParseHeader().

◆ kHeader_Url

const char * CHttpRetryContext::kHeader_Url = "X-NCBI-Retry-URL"
static

◆ m_Args

string CRetryContext::m_Args
private

◆ m_Content

string CRetryContext::m_Content
private

◆ m_ContentOverride

EContentOverride CRetryContext::m_ContentOverride
private

◆ m_Delay

CTimeSpan CRetryContext::m_Delay
private

◆ m_Flags

TFlags CRetryContext::m_Flags
private

Definition at line 177 of file retry_ctx.hpp.

Referenced by CRetryContext::x_IsSetFlag(), and CRetryContext::x_SetFlag().

◆ m_NeedReconnect

bool CRetryContext::m_NeedReconnect
private

◆ m_NeedRetry

bool CRetryContext::m_NeedRetry
private

◆ m_StopReason

string CRetryContext::m_StopReason
private

◆ m_Url

string CRetryContext::m_Url
private
Modified on Fri Sep 20 14:58:14 2024 by modify_doxy.py rev. 669887