le_cfgAdmin_common.h

Go to the documentation of this file.
1 
2 /*
3  * ====================== WARNING ======================
4  *
5  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
6  * DO NOT MODIFY IN ANY WAY.
7  *
8  * ====================== WARNING ======================
9  */
10 /**
11  * @file le_cfgAdmin_common.h
12  *
13  * Type definitions for le_cfgAdmin.
14  *
15  */
16 #ifndef LE_CFGADMIN_COMMON_H_INCLUDE_GUARD
17 #define LE_CFGADMIN_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 // Interface specific includes
23 #include "le_cfg_common.h"
24 
25 #define IFGEN_LE_CFGADMIN_PROTOCOL_ID "a027aae806d6622f4ea64008f3a707ba"
26 #define IFGEN_LE_CFGADMIN_MSG_SIZE 1044
27 /** @addtogroup le_cfgAdmin
28  * @{ **/
29 
30 
31 //--------------------------------------------------------------------------------------------------
32 /**
33  * Reference to an iterator object that can be used to iterate over the list of trees.
34  */
35 //--------------------------------------------------------------------------------------------------
36 typedef struct le_cfgAdmin_Iterator* le_cfgAdmin_IteratorRef_t;
37 
38 
39 
40 //--------------------------------------------------------------------------------------------------
41 /**
42  * Get if this client bound locally.
43  */
44 //--------------------------------------------------------------------------------------------------
45 LE_SHARED bool ifgen_le_cfgAdmin_HasLocalBinding
46 (
47  void
48 );
49 
50 
51 //--------------------------------------------------------------------------------------------------
52 /**
53  * Init data that is common across all threads
54  */
55 //--------------------------------------------------------------------------------------------------
56 LE_SHARED void ifgen_le_cfgAdmin_InitCommonData
57 (
58  void
59 );
60 
61 
62 //--------------------------------------------------------------------------------------------------
63 /**
64  * Perform common initialization and open a session
65  */
66 //--------------------------------------------------------------------------------------------------
67 LE_SHARED le_result_t ifgen_le_cfgAdmin_OpenSession
68 (
69  le_msg_SessionRef_t _ifgen_sessionRef,
70  bool isBlocking
71 );
72 
73 //--------------------------------------------------------------------------------------------------
74 /**
75  * Read a subset of the configuration tree from the given filePath. The tree then overwrites the
76  * node at the given nodePath.
77  *
78  * This function will import a sub-tree as part of the iterator's current transaction. This allows
79  * you to create an iterator on a given node. Import a sub-tree, and then examine the contents of
80  * the import before deciding to commit the new data.
81  *
82  * @return This function will return one of the following values:
83  *
84  * - LE_OK - The commit was completed successfuly.
85  * - LE_FAULT - An I/O error occured while reading the data.
86  * - LE_FORMAT_ERROR - The configuration data being imported appears corrupted.
87  */
88 //--------------------------------------------------------------------------------------------------
89 LE_SHARED le_result_t ifgen_le_cfgAdmin_ImportTree
90 (
91  le_msg_SessionRef_t _ifgen_sessionRef,
92  le_cfg_IteratorRef_t iteratorRef,
93  ///< [IN] Write iterator that is being used for the import.
94  const char* LE_NONNULL filePath,
95  ///< [IN] Import the tree data from the this file.
96  const char* LE_NONNULL nodePath
97  ///< [IN] Where in the tree should this import happen? Leave
98  ///< as an empty string to use the iterator's current
99  ///< node.
100 );
101 
102 //--------------------------------------------------------------------------------------------------
103 /**
104  * Take a node given from nodePath and stream it and it's children to the file given by filePath.
105  *
106  * This funciton uses the iterator's read transaction, and takes a snapshot of the current state of
107  * the tree. The data write happens immediately.
108  *
109  * @return This function will return one of the following values:
110  *
111  * - LE_OK - The commit was completed successfuly.
112  * - LE_FAULT - An I/O error occured while writing the data.
113  */
114 //--------------------------------------------------------------------------------------------------
115 LE_SHARED le_result_t ifgen_le_cfgAdmin_ExportTree
116 (
117  le_msg_SessionRef_t _ifgen_sessionRef,
118  le_cfg_IteratorRef_t iteratorRef,
119  ///< [IN] Write iterator that is being used for the export.
120  const char* LE_NONNULL filePath,
121  ///< [IN] Import the tree data from the this file.
122  const char* LE_NONNULL nodePath
123  ///< [IN] Where in the tree should this export happen? Leave
124  ///< as an empty string to use the iterator's current
125  ///< node.
126 );
127 
128 //--------------------------------------------------------------------------------------------------
129 /**
130  * Delete a tree from the system, both from the filesystem and from memory.
131  */
132 //--------------------------------------------------------------------------------------------------
133 LE_SHARED void ifgen_le_cfgAdmin_DeleteTree
134 (
135  le_msg_SessionRef_t _ifgen_sessionRef,
136  const char* LE_NONNULL treeName
137  ///< [IN] Name of the tree to delete.
138 );
139 
140 //--------------------------------------------------------------------------------------------------
141 /**
142  * Create a new iterator object for iterating over the list of trees currently managed by the
143  * config tree daemon.
144  */
145 //--------------------------------------------------------------------------------------------------
146 LE_SHARED le_cfgAdmin_IteratorRef_t ifgen_le_cfgAdmin_CreateTreeIterator
147 (
148  le_msg_SessionRef_t _ifgen_sessionRef
149 );
150 
151 //--------------------------------------------------------------------------------------------------
152 /**
153  * Release the iterator and free it's memory back to the system.
154  */
155 //--------------------------------------------------------------------------------------------------
156 LE_SHARED void ifgen_le_cfgAdmin_ReleaseTreeIterator
157 (
158  le_msg_SessionRef_t _ifgen_sessionRef,
159  le_cfgAdmin_IteratorRef_t iteratorRef
160  ///< [IN] Iterator object to release.
161 );
162 
163 //--------------------------------------------------------------------------------------------------
164 /**
165  * Read the name of the tree currently pointed at by the iterator.
166  *
167  * @return LE_OK if there is enough room to copy the name into the supplied buffer. LE_OVERFLOW if
168  * not. LE_NOT_FOUND is returned if the list is empty or if the iterator hasn't been moved
169  * onto the first item yet.
170  */
171 //--------------------------------------------------------------------------------------------------
172 LE_SHARED le_result_t ifgen_le_cfgAdmin_GetTreeName
173 (
174  le_msg_SessionRef_t _ifgen_sessionRef,
175  le_cfgAdmin_IteratorRef_t iteratorRef,
176  ///< [IN] Iterator object to read.
177  char* name,
178  ///< [OUT] Name of the currently referenced tree is
179  ///< passed in this out parameter.
180  size_t nameSize
181  ///< [IN]
182 );
183 
184 //--------------------------------------------------------------------------------------------------
185 /**
186  * Move onto the next tree in the list. If there are no more trees this function returns false,
187  * otherwise true is returned.
188  *
189  * @return LE_OK if there are more trees to iterate through. LE_NOT_FOUND if not.
190  */
191 //--------------------------------------------------------------------------------------------------
192 LE_SHARED le_result_t ifgen_le_cfgAdmin_NextTree
193 (
194  le_msg_SessionRef_t _ifgen_sessionRef,
195  le_cfgAdmin_IteratorRef_t iteratorRef
196  ///< [IN] Iterator to iterate.
197 );
198 /** @} **/
199 #endif // LE_CFGADMIN_COMMON_H_INCLUDE_GUARD
#define LE_SHARED
Definition: le_basics.h:300
le_result_t
Definition: le_basics.h:46
struct le_cfgAdmin_Iterator * le_cfgAdmin_IteratorRef_t
Definition: le_cfgAdmin_common.h:36
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860
struct le_cfg_Iterator * le_cfg_IteratorRef_t
Definition: le_cfg_common.h:68