Microsoft Azure Storage Client Library for C++  7.5.0
The Microsoft Azure Storage Client Library for C++ is a library for working with the Azure Storage Services in C++.
Public Member Functions | Static Public Member Functions | List of all members
azure::storage::operation_context Class Reference

Represents the context for a request to the Windows Azure storage services, and provides additional runtime information about its execution. More...

Public Member Functions

WASTORAGE_API operation_context ()
 Initializes a new instance of the azure::storage::operation_context class. More...
 
 operation_context (const operation_context &context)
 Initializes a new instance of the azure::storage::operation_context class. More...
 
operation_contextoperator= (const operation_context &context)
 Returns a reference to an azure::storage::operation_context object. More...
 
const utility::string_t & client_request_id () const
 Gets the client request ID. More...
 
void set_client_request_id (utility::string_t client_request_id)
 Sets the client request ID. More...
 
utility::datetime start_time () const
 Gets the start time of the operation. More...
 
void set_start_time (utility::datetime start_time)
 Sets the start time of the operation. More...
 
utility::datetime end_time () const
 Gets the end time of the operation. More...
 
void set_end_time (utility::datetime end_time)
 Sets the end time of the operation. More...
 
client_log_level log_level () const
 Gets the logging level to be used for an instance of the azure::storage::operation_context class. More...
 
void set_log_level (client_log_level log_level)
 Sets the logging level to be used for an instance of the azure::storage::operation_context class. More...
 
web::http::http_headers & user_headers ()
 Gets or sets additional headers on the request, for example, for proxy or logging information. More...
 
const web::http::http_headers & user_headers () const
 Gets or sets additional headers on the request, for example, for proxy or logging information. More...
 
const std::vector< request_result > & request_results () const
 Gets the set of request results that the current operation has created. More...
 
void set_sending_request (std::function< void(web::http::http_request &, operation_context)> value)
 Sets the function to call when sending a request. More...
 
void set_response_received (std::function< void(web::http::http_request &, const web::http::http_response &, operation_context)> value)
 Sets the function that is called when a response is received from the server. More...
 
const web::web_proxy & proxy () const
 Gets the proxy. More...
 
void set_proxy (web::web_proxy proxy)
 Sets the proxy. More...
 
boost::log::sources::severity_logger< boost::log::trivial::severity_level > & logger ()
 Gets the logger object on this operation context. More...
 
const boost::log::sources::severity_logger< boost::log::trivial::severity_level > & logger () const
 Gets the logger object on this operation context. More...
 
void set_logger (boost::log::sources::severity_logger< boost::log::trivial::severity_level > logger)
 Sets the logger object on this operation context. More...
 
void set_ssl_context_callback (const std::function< void(boost::asio::ssl::context &)> &callback)
 Sets a callback to enable custom setting of the ssl context, at construction time. More...
 
const std::function< void(boost::asio::ssl::context &)> & get_ssl_context_callback () const
 Gets the user's callback to allow for customization of the ssl context. More...
 
void set_native_session_handle_options_callback (const std::function< void(web::http::client::native_handle)> &callback)
 Sets a callback to enable custom setting of platform specific options. More...
 
const std::function< void(web::http::client::native_handle)> & get_native_session_handle_options_callback () const
 Gets the user's callback to custom setting of platform specific options. More...
 

Static Public Member Functions

static WASTORAGE_API client_log_level default_log_level ()
 Gets the default logging level to be used for subsequently created instances of the azure::storage::operation_context class. More...
 
static WASTORAGE_API void set_default_log_level (client_log_level log_level)
 Sets the default logging level to be used for subsequently created instances of the azure::storage::operation_context class. More...
 
static WASTORAGE_API const web::web_proxy & default_proxy ()
 Gets the default proxy to be used for subsequently created instances of the azure::storage::operation_context class. More...
 
static WASTORAGE_API void set_default_proxy (web::web_proxy proxy)
 Sets the default proxy to be used for subsequently created instances of the azure::storage::operation_context class. More...
 

Detailed Description

Represents the context for a request to the Windows Azure storage services, and provides additional runtime information about its execution.

Constructor & Destructor Documentation

◆ operation_context() [1/2]

WASTORAGE_API azure::storage::operation_context::operation_context ( )

Initializes a new instance of the azure::storage::operation_context class.

◆ operation_context() [2/2]

azure::storage::operation_context::operation_context ( const operation_context context)
inline

Initializes a new instance of the azure::storage::operation_context class.

Parameters
contextA reference to an azure::storage::operation_context object.

Member Function Documentation

◆ client_request_id()

const utility::string_t& azure::storage::operation_context::client_request_id ( ) const
inline

Gets the client request ID.

Returns
The client request ID.

◆ default_log_level()

static WASTORAGE_API client_log_level azure::storage::operation_context::default_log_level ( )
static

Gets the default logging level to be used for subsequently created instances of the azure::storage::operation_context class.

Returns
A value of type azure::storage::client_log_level that specifies which events are logged by default by instances of the azure::storage::operation_context.

◆ default_proxy()

static WASTORAGE_API const web::web_proxy& azure::storage::operation_context::default_proxy ( )
static

Gets the default proxy to be used for subsequently created instances of the azure::storage::operation_context class.

Returns
A value of type web::web_proxy that specifies the default proxy by instances of the azure::storage::operation_context.

◆ end_time()

utility::datetime azure::storage::operation_context::end_time ( ) const
inline

Gets the end time of the operation.

Returns
The end time of the operation.

◆ get_native_session_handle_options_callback()

const std::function<void(web::http::client::native_handle)>& azure::storage::operation_context::get_native_session_handle_options_callback ( ) const
inline

Gets the user's callback to custom setting of platform specific options.

◆ get_ssl_context_callback()

const std::function<void(boost::asio::ssl::context&)>& azure::storage::operation_context::get_ssl_context_callback ( ) const
inline

Gets the user's callback to allow for customization of the ssl context.

◆ log_level()

client_log_level azure::storage::operation_context::log_level ( ) const
inline

Gets the logging level to be used for an instance of the azure::storage::operation_context class.

Returns
A value of type azure::storage::client_log_level that specifies which events are logged by the azure::storage::operation_context.

◆ logger() [1/2]

boost::log::sources::severity_logger<boost::log::trivial::severity_level>& azure::storage::operation_context::logger ( )
inline

Gets the logger object on this operation context.

Returns
The boost::log::sources::severity_logger<boost::log::trivial::severity_level> object used by this operation context.

◆ logger() [2/2]

const boost::log::sources::severity_logger<boost::log::trivial::severity_level>& azure::storage::operation_context::logger ( ) const
inline

Gets the logger object on this operation context.

Returns
The boost::log::sources::severity_logger<boost::log::trivial::severity_level> object used by this operation context.

◆ operator=()

operation_context& azure::storage::operation_context::operator= ( const operation_context context)
inline

Returns a reference to an azure::storage::operation_context object.

Parameters
contextA reference to an azure::storage::operation_context object.
Returns
An azure::storage::operation_context object.

◆ proxy()

const web::web_proxy& azure::storage::operation_context::proxy ( ) const
inline

Gets the proxy.

Returns
The proxy.

◆ request_results()

const std::vector<request_result>& azure::storage::operation_context::request_results ( ) const
inline

Gets the set of request results that the current operation has created.

Returns
A std::vector object that contains azure::storage::request_result objects that represent the request results created by the current operation.

◆ set_client_request_id()

void azure::storage::operation_context::set_client_request_id ( utility::string_t  client_request_id)
inline

Sets the client request ID.

Parameters
client_request_idThe client request ID.

◆ set_default_log_level()

static WASTORAGE_API void azure::storage::operation_context::set_default_log_level ( client_log_level  log_level)
static

Sets the default logging level to be used for subsequently created instances of the azure::storage::operation_context class.

Parameters
log_levelA value of type azure::storage::client_log_level that specifies which events are logged by default by instances of the azure::storage::operation_context.

◆ set_default_proxy()

static WASTORAGE_API void azure::storage::operation_context::set_default_proxy ( web::web_proxy  proxy)
static

Sets the default proxy to be used for subsequently created instances of the azure::storage::operation_context class.

Parameters
proxyA value of type web::proxy that specifies default proxy by instances of the azure::storage::operation_context.

The proxy uri should be in the format "//host[:port]"

◆ set_end_time()

void azure::storage::operation_context::set_end_time ( utility::datetime  end_time)
inline

Sets the end time of the operation.

Parameters
end_timeThe end time of the operation.

◆ set_log_level()

void azure::storage::operation_context::set_log_level ( client_log_level  log_level)
inline

Sets the logging level to be used for an instance of the azure::storage::operation_context class.

Parameters
log_levelA value of type azure::storage::client_log_level that specifies which events are logged by the azure::storage::operation_context.

◆ set_logger()

void azure::storage::operation_context::set_logger ( boost::log::sources::severity_logger< boost::log::trivial::severity_level >  logger)
inline

Sets the logger object on this operation context.

Parameters
loggerThe boost::log::sources::severity_logger<boost::log::trivial::severity_level> object to use for requests made by this operation context.

◆ set_native_session_handle_options_callback()

void azure::storage::operation_context::set_native_session_handle_options_callback ( const std::function< void(web::http::client::native_handle)> &  callback)
inline

Sets a callback to enable custom setting of platform specific options.

Parameters
callbackA user callback allowing for customization of the session.

◆ set_proxy()

void azure::storage::operation_context::set_proxy ( web::web_proxy  proxy)
inline

Sets the proxy.

Parameters
proxyThe proxy.

The proxy uri should be in the format "//host[:port]"

◆ set_response_received()

void azure::storage::operation_context::set_response_received ( std::function< void(web::http::http_request &, const web::http::http_response &, operation_context)>  value)
inline

Sets the function that is called when a response is received from the server.

Parameters
valueA pointer to a function that takes an web::http::http_request object, an web::http::http_response object, and an azure::storage::operation_context object.

◆ set_sending_request()

void azure::storage::operation_context::set_sending_request ( std::function< void(web::http::http_request &, operation_context)>  value)
inline

Sets the function to call when sending a request.

Parameters
valueA pointer to a function that takes an web::http::http_request object and an azure::storage::operation_context object.

◆ set_ssl_context_callback()

void azure::storage::operation_context::set_ssl_context_callback ( const std::function< void(boost::asio::ssl::context &)> &  callback)
inline

Sets a callback to enable custom setting of the ssl context, at construction time.

Parameters
callbackA user callback allowing for customization of the ssl context at construction time.

◆ set_start_time()

void azure::storage::operation_context::set_start_time ( utility::datetime  start_time)
inline

Sets the start time of the operation.

Parameters
start_timeThe start time of the operation.

◆ start_time()

utility::datetime azure::storage::operation_context::start_time ( ) const
inline

Gets the start time of the operation.

Returns
The start time of the operation.

◆ user_headers() [1/2]

web::http::http_headers& azure::storage::operation_context::user_headers ( )
inline

Gets or sets additional headers on the request, for example, for proxy or logging information.

Returns
A web::http::http_headers reference containing additional header information.

◆ user_headers() [2/2]

const web::http::http_headers& azure::storage::operation_context::user_headers ( ) const
inline

Gets or sets additional headers on the request, for example, for proxy or logging information.

Returns
A web::http::http_headers reference containing additional header information.