C Device Virtualization API Reference for Oracle Internet of Things Cloud Service Client Software Library. Release 21.1.1.0.0-3. E70343-26
|
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_VIRTUAL_STORAGE_OBJECT_H_ 00015 #define IOTCS_VIRTUAL_STORAGE_OBJECT_H_ 00016 00017 #include <stdint.h> 00018 00019 #include "iotcs.h" 00020 #include "advanced/iotcs_messaging.h" 00021 #include "iotcs_virtual_device.h" 00022 00023 #ifdef __cplusplus 00024 extern "C" { 00025 #endif 00026 00031 typedef enum iotcs_storage_object_sync_status_t{ 00032 IOTCS_IN_SYNC = 0, 00033 IOTCS_NOT_IN_SYNC = 1, 00034 IOTCS_SYNC_FAILED = 2, 00035 IOTCS_SYNC_PENDING = 3, 00036 } iotcs_storage_object_sync_status; 00037 00042 typedef struct iotcs_storage_object_sync_event_t { 00043 const char *name; 00044 iotcs_storage_object_handle source; 00045 iotcs_virtual_device_handle virtual_device; 00046 } iotcs_storage_object_sync_event; 00054 typedef void(*iotcs_storage_object_sync_callback)(iotcs_storage_object_sync_event *event); 00055 00071 iotcs_result iotcs_create_storage_object_handle(const char* name, const char* content_type, 00072 iotcs_storage_object_handle *storage_object_handle); 00073 00087 iotcs_result iotcs_storage_object_set_custom_metadata(iotcs_storage_object_handle storage_object_handle, 00088 const char* name, const char* value); 00089 #if !defined IOTCS_DOXYGEN 00090 00099 iotcs_result iotcs_create_external_object_handle(const char* uri, 00100 iotcs_external_object_handle *external_object_handle); 00101 #endif 00102 00107 void iotcs_free_storage_object_handle(iotcs_storage_object_handle storage_object_handle); 00108 00109 #if !defined IOTCS_DOXYGEN 00110 00114 void iotcs_free_external_object_handle(iotcs_external_object_handle external_object_handle); 00115 #endif 00116 00117 #if !defined IOTCS_STORAGE_OBJECT_H_ || defined IOTCS_DOXYGEN 00118 #if !defined IOTCS_DOXYGEN 00119 00125 const char* iotcs_external_object_get_uri(const iotcs_external_object_handle external_object_handle); 00126 #endif 00127 00136 iotcs_result iotcs_storage_object_set_input_path(iotcs_storage_object_handle storage_object_handle, const char *input_path); 00137 00146 iotcs_result iotcs_storage_object_set_output_path(iotcs_storage_object_handle storage_object_handle, const char *output_path); 00147 00155 iotcs_result iotcs_storage_object_set_callback(iotcs_storage_object_handle storage_object_handle, iotcs_storage_object_sync_callback callback); 00156 00163 iotcs_storage_object_sync_status iotcs_storage_object_get_sync_status(const iotcs_storage_object_handle storage_object_handle); 00164 00171 const char* iotcs_storage_object_get_input_path(const iotcs_storage_object_handle storage_object_handle); 00172 00179 const char* iotcs_storage_object_get_output_path(const iotcs_storage_object_handle storage_object_handle); 00180 00186 const char* iotcs_storage_object_get_name(const iotcs_storage_object_handle storage_object_handle); 00187 00194 const char* iotcs_storage_object_get_uri(const iotcs_storage_object_handle storage_object_handle); 00195 00202 long iotcs_storage_object_get_length(const iotcs_storage_object_handle storage_object_handle); 00203 00210 const char* iotcs_storage_object_get_type(const iotcs_storage_object_handle storage_object_handle); 00211 00218 const char* iotcs_storage_object_get_encoding(const iotcs_storage_object_handle storage_object_handle); 00219 00226 iotcs_date_time iotcs_storage_object_get_date(const iotcs_storage_object_handle storage_object_handle); 00227 00236 iotcs_result iotcs_storage_object_sync(iotcs_storage_object_handle storage_object_handle); 00237 #endif 00238 00239 #ifdef __cplusplus 00240 } 00241 #endif 00242 00243 #endif /* IOTCS_VIRTUAL_STORAGE_OBJECT_H_ */