client-c  0.9.0
ext_log_upload_strategy.h
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2016 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 
61 struct kaa_context_s;
62 kaa_error_t ext_log_upload_strategy_create(struct kaa_context_s *context, void **strategy_p, uint8_t type);
63 
72 ext_log_upload_decision_t ext_log_upload_strategy_decide(void *context, const void *log_storage_context);
73 
80 size_t ext_log_upload_strategy_get_timeout(void *context);
81 
82 
83 
91 
92 
93 
101 
102 
103 
112 
113 
114 
121 void ext_log_upload_strategy_destroy(void *context);
122 
123 
124 
125 #ifdef __cplusplus
126 } /* extern "C" */
127 #endif
128 
129 #endif /* EXT_LOG_UPLOAD_STRATEGY_H_ */
kaa_error_t
Definition: kaa_error.h:31
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_create(struct kaa_context_s *context, void **strategy_p, uint8_t type)
size_t ext_log_upload_strategy_get_max_parallel_uploads(void *context)
Max amount of log batches allowed to be uploaded parallel.
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.