client-c  0.7.0
ext_log_upload_strategy.h File Reference

External log upload strategy interface used by Kaa data collection subsystem to decide when to upload or cleanup logs. Must be implemented in a concrete application for the data collection feature to function. More...

+ Include dependency graph for ext_log_upload_strategy.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  ext_log_upload_decision_t { NOOP = 0, UPLOAD = 1 }
 
enum  logging_delivery_error_code_t { NO_APPENDERS_CONFIGURED = 0x00, APPENDER_INTERNAL_ERROR = 0x01, REMOTE_CONNECTION_ERROR = 0x02, REMOTE_INTERNAL_ERROR = 0x03 }
 

Functions

ext_log_upload_decision_t ext_log_upload_strategy_decide (void *context, const void *log_storage_context)
 Makes a decision whether to upload logs or cleanup the storage. More...
 
size_t ext_log_upload_strategy_get_bucket_size (void *context)
 Retrieves the maximum size of a report pack that will be delivered in a single request to the Operations server. More...
 
size_t ext_log_upload_strategy_get_timeout (void *context)
 The maximum time to wait a log delivery response. More...
 
kaa_error_t ext_log_upload_strategy_on_timeout (void *context)
 Handles timeout of a log delivery. More...
 
kaa_error_t ext_log_upload_strategy_on_failure (void *context, logging_delivery_error_code_t error_code)
 Handles failure of a log delivery. More...
 
void ext_log_upload_strategy_destroy (void *context)
 Destroys the instance of the log upload strategy. More...
 

Detailed Description

External log upload strategy interface used by Kaa data collection subsystem to decide when to upload or cleanup logs. Must be implemented in a concrete application for the data collection feature to function.

Definition in file ext_log_upload_strategy.h.

Enumeration Type Documentation

Log upload decisions.

Enumerator
NOOP 

Nothing to do yet.

UPLOAD 

Trigger log upload.

Definition at line 38 of file ext_log_upload_strategy.h.

Log delivery error codes.

Enumerator
NO_APPENDERS_CONFIGURED 
APPENDER_INTERNAL_ERROR 
REMOTE_CONNECTION_ERROR 
REMOTE_INTERNAL_ERROR 

Definition at line 46 of file ext_log_upload_strategy.h.

Function Documentation

ext_log_upload_decision_t ext_log_upload_strategy_decide ( void *  context,
const void *  log_storage_context 
)

Makes a decision whether to upload logs or cleanup the storage.

Parameters
[in]contextLog upload strategy context.
[in]log_storage_contextLog storage instance to operate against.
Returns
Log upload decision.
void ext_log_upload_strategy_destroy ( void *  context)

Destroys the instance of the log upload strategy.

Parameters
[in]contextThe log strategy context.
Returns
Error code.
size_t ext_log_upload_strategy_get_bucket_size ( void *  context)

Retrieves the maximum size of a report pack that will be delivered in a single request to the Operations server.

Parameters
[in]contextLog upload strategy context.
Returns
The size of a batch in bytes.
size_t ext_log_upload_strategy_get_timeout ( void *  context)

The maximum time to wait a log delivery response.

Parameters
[in]contextLog upload strategy context.
Returns
Time in seconds.
kaa_error_t ext_log_upload_strategy_on_failure ( void *  context,
logging_delivery_error_code_t  error_code 
)

Handles failure of a log delivery.

Parameters
[in]contextLog upload strategy context.
[in]error_codeDelivery error code.
Returns
Error code.
kaa_error_t ext_log_upload_strategy_on_timeout ( void *  context)

Handles timeout of a log delivery.

Parameters
[in]contextLog upload strategy context.
Returns
Error code.