C Messaging API Reference for Oracle Internet of Things Cloud Service Client Software Library. Release 21.1.1.0.0-3. E70344-26
iotcs_storage_object.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
00003  *
00004  * This software is dual-licensed to you under the MIT License (MIT) and
00005  * the Universal Permissive License (UPL). See the LICENSE file in the root
00006  * directory for license terms. You may choose either license, or both.
00007  */
00008 
00014 #ifndef IOTCS_STORAGE_OBJECT_H_
00015 #define IOTCS_STORAGE_OBJECT_H_
00016 
00017 #include "iotcs.h"
00018 #include "advanced/iotcs_messaging.h"
00019 
00020 #ifdef __cplusplus
00021 extern "C" {
00022 #endif
00023 
00028     typedef enum iotcs_storage_dispatcher_progress_state_t {
00029         IOTCS_CANCELED = 0, 
00030         IOTCS_COMPLETED = 1, 
00031         IOTCS_FAILED = 2, 
00032         IOTCS_IN_PROGRESS = 3, 
00033         IOTCS_INITIATED = 4, 
00034         IOTCS_QUEUED = 5, 
00035     } iotcs_storage_dispatcher_progress_state;
00036 
00047     typedef void(*iotcs_storage_dispatcher_progress_callback)(iotcs_storage_object *storage_object,
00048             iotcs_storage_dispatcher_progress_state state,
00049             int64_t bytes_transfered, const char *fail_reason);
00050 
00066     iotcs_result iotcs_create_storage_object(const char* name, const char* content_type,
00067             iotcs_storage_object **storage_object);
00068 
00082     iotcs_result iotcs_storage_object_set_custom_metadata(iotcs_storage_object* storage_object,
00083         const char* name, const char* value);
00084 #if !defined IOTCS_DOXYGEN
00085 
00094     iotcs_result iotcs_create_external_object(const char* uri,
00095             iotcs_external_object **external_object);
00096 #endif
00097 
00108     iotcs_result iotcs_create_storage_object_by_uri(const char* uri, iotcs_storage_object **storage_object);
00109 
00114     void iotcs_free_storage_object(iotcs_storage_object *storage_object);
00115 
00116 #if !defined IOTCS_DOXYGEN
00117 
00121     void iotcs_free_external_object(iotcs_external_object *external_object);
00122 #endif
00123 
00128     void iotcs_storage_object_cancel(iotcs_storage_object *storage_object);
00129 
00130 #if !defined IOTCS_VIRTUAL_STORAGE_OBJECT_H_ || defined IOTCS_DOXYGEN
00131 
00132 #if !defined IOTCS_DOXYGEN
00133 
00139     const char* iotcs_external_object_get_uri(const iotcs_external_object *external_object);
00140 #endif
00141 
00150     iotcs_result iotcs_storage_object_set_input_path(iotcs_storage_object *storage_object, const char *input_path);
00151 
00161     iotcs_result iotcs_storage_object_set_output_path(iotcs_storage_object *storage_object, const char *output_path);
00162 
00169     const char* iotcs_storage_object_get_input_path(const iotcs_storage_object *storage_object);
00170 
00177     const char* iotcs_storage_object_get_output_path(const iotcs_storage_object *storage_object);
00178 
00184     const char* iotcs_storage_object_get_name(const iotcs_storage_object *storage_object);
00185 
00192     const char* iotcs_storage_object_get_uri(const iotcs_storage_object *storage_object);
00193 
00212     iotcs_result iotcs_storage_object_sync(iotcs_storage_object* storage_object);
00213 
00220     long iotcs_storage_object_get_length(const iotcs_storage_object* storage_object);
00221 
00228     const char*  iotcs_storage_object_get_type(const iotcs_storage_object* storage_object);
00229 
00236     const char* iotcs_storage_object_get_encoding(const iotcs_storage_object* storage_object);
00237 
00244     iotcs_date_time iotcs_storage_object_get_date(const iotcs_storage_object* storage_object);
00245 #endif
00246 
00258     iotcs_result iotcs_storage_dispatcher_queue(iotcs_storage_object* storage_object);
00259 
00266     void iotcs_storage_dispatcher_set_callback(iotcs_storage_dispatcher_progress_callback callback);
00267 #ifdef __cplusplus
00268 }
00269 #endif
00270 
00271 #endif /* IOTCS_STORAGE_OBJECT_H_ */