sbrcsr 3.2.0
ATOMAS sbrcsr
CSR Service

The CSR API which encapsulates a CSR Service endpoint and the type of requests to be submitted. More...

Typedefs

typedef struct _sbr_Csr sbr_Csr
 The CSR object used to interact with an SBR core services service to submit business reports. More...
 

Functions

SBR_CSR_EXPORT int sbr_csr_create (ato_Ctx *ctx, sbr_Csr **csr, const char *servicetype, const char *csrurl, const char *csrtemplate)
 Create a CSR object from the XML stored in csrtemplate. More...
 
SBR_CSR_EXPORT void sbr_csr_free (sbr_Csr *csr)
 Free the CSR object if not NULL. More...
 
SBR_CSR_EXPORT size_t sbr_csr_timeout (ato_Ctx *ctx, sbr_Csr *csr)
 Get the network total timeout value, in seconds, used for requests to SBR CSR services. More...
 
SBR_CSR_EXPORT void sbr_csr_settimeout (ato_Ctx *ctx, sbr_Csr *csr, size_t timeout)
 Set the network total timeout value, in seconds, used for requests to SBR CSR services. More...
 
SBR_CSR_EXPORT size_t sbr_csr_timeoutconnect (ato_Ctx *ctx, sbr_Csr *csr)
 Get the network connect timeout value, in seconds, used for requests to SBR CSR services. More...
 
SBR_CSR_EXPORT void sbr_csr_settimeoutconnect (ato_Ctx *ctx, sbr_Csr *csr, size_t timeout)
 Set the network connect timeout value, in seconds, used for requests to SBR CSR services. More...
 

Detailed Description

The CSR API which encapsulates a CSR Service endpoint and the type of requests to be submitted.

Typedef Documentation

◆ sbr_Csr

typedef struct _sbr_Csr sbr_Csr

The CSR object used to interact with an SBR core services service to submit business reports.

Use this object to construct one or more sbr_Request objects, each of which contains a sbr_Response object.

Function Documentation

◆ sbr_csr_create()

SBR_CSR_EXPORT int sbr_csr_create ( ato_Ctx ctx,
sbr_Csr **  csr,
const char *  servicetype,
const char *  csrurl,
const char *  csrtemplate 
)

Create a CSR object from the XML stored in csrtemplate.

Parameters
ctxthe current thread local Context.
csrthe address of the object to create. *csr must be initialised to NULL.
servicetypethe servicetype id to use within the CSR config context. A NULL value will result in an assertion error.
csrurlthe URL of the CSR service to use. If NULL, the value is read from the current context and servicetype.
csrtemplatethe XML content. A NULL or empty value will result in an assertion error. sbr_csr_loadtemplate() is provided as a helper function to load from the filesystem.
Returns
ATO_ERR_OK

◆ sbr_csr_free()

SBR_CSR_EXPORT void sbr_csr_free ( sbr_Csr csr)

Free the CSR object if not NULL.

Parameters
csrthe CSR object. If NULL do nothing.

◆ sbr_csr_timeout()

SBR_CSR_EXPORT size_t sbr_csr_timeout ( ato_Ctx ctx,
sbr_Csr csr 
)

Get the network total timeout value, in seconds, used for requests to SBR CSR services.

Parameters
ctxthe current thread local Context.
csrthe CSR object.
Returns
the current timeout value.

◆ sbr_csr_settimeout()

SBR_CSR_EXPORT void sbr_csr_settimeout ( ato_Ctx ctx,
sbr_Csr csr,
size_t  timeout 
)

Set the network total timeout value, in seconds, used for requests to SBR CSR services.

This affects all new requests derived from this CSR instance.

Parameters
ctxthe current thread local Context.
csrthe CSR object.
timeoutthe timeout value to set.

◆ sbr_csr_timeoutconnect()

SBR_CSR_EXPORT size_t sbr_csr_timeoutconnect ( ato_Ctx ctx,
sbr_Csr csr 
)

Get the network connect timeout value, in seconds, used for requests to SBR CSR services.

Parameters
ctxthe current thread local Context.
csrthe CSR object.
Returns
the current timeout value.

◆ sbr_csr_settimeoutconnect()

SBR_CSR_EXPORT void sbr_csr_settimeoutconnect ( ato_Ctx ctx,
sbr_Csr csr,
size_t  timeout 
)

Set the network connect timeout value, in seconds, used for requests to SBR CSR services.

This affects all new requests derived from this CSR instance.

Parameters
ctxthe current thread local Context.
csrthe CSR object.
timeoutthe timeout value to set.