client-c  0.7.0
ext_log_upload_strategy.h
Go to the documentation of this file.
1 /*
2  * Copyright 2014 CyberVision, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
24 #ifndef EXT_LOG_UPLOAD_STRATEGY_H_
25 #define EXT_LOG_UPLOAD_STRATEGY_H_
26 
27 #include "../platform/ext_log_storage.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 
34 
38 typedef enum {
39  NOOP = 0,
40  UPLOAD = 1
42 
46 typedef enum {
52 
53 
54 
63 ext_log_upload_decision_t ext_log_upload_strategy_decide(void *context, const void *log_storage_context);
64 
65 
66 
73 size_t ext_log_upload_strategy_get_bucket_size(void *context);
74 
75 
76 
83 size_t ext_log_upload_strategy_get_timeout(void *context);
84 
85 
86 
94 
95 
96 
105 
106 
107 
114 void ext_log_upload_strategy_destroy(void *context);
115 
116 
117 
118 #ifdef __cplusplus
119 } /* extern "C" */
120 #endif
121 
122 #endif /* EXT_LOG_UPLOAD_STRATEGY_H_ */
kaa_error_t
Definition: kaa_error.h:31
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 Operati...
kaa_error_t ext_log_upload_strategy_on_timeout(void *context)
Handles timeout of a log delivery.
void ext_log_upload_strategy_destroy(void *context)
Destroys the instance of the log upload strategy.
logging_delivery_error_code_t
ext_log_upload_decision_t
size_t ext_log_upload_strategy_get_timeout(void *context)
The maximum time to wait a log delivery response.
kaa_error_t ext_log_upload_strategy_on_failure(void *context, logging_delivery_error_code_t error_code)
Handles failure of a log delivery.
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.