|
29 | 29 | import com.arangodb.entity.CollectionRevisionEntity; |
30 | 30 | import com.arangodb.entity.DocumentCreateEntity; |
31 | 31 | import com.arangodb.entity.DocumentDeleteEntity; |
| 32 | +import com.arangodb.entity.DocumentImportEntity; |
32 | 33 | import com.arangodb.entity.DocumentUpdateEntity; |
33 | 34 | import com.arangodb.entity.IndexEntity; |
34 | 35 | import com.arangodb.entity.MultiDocumentEntity; |
|
39 | 40 | import com.arangodb.model.DocumentCreateOptions; |
40 | 41 | import com.arangodb.model.DocumentDeleteOptions; |
41 | 42 | import com.arangodb.model.DocumentExistsOptions; |
| 43 | +import com.arangodb.model.DocumentImportOptions; |
42 | 44 | import com.arangodb.model.DocumentReadOptions; |
43 | 45 | import com.arangodb.model.DocumentReplaceOptions; |
44 | 46 | import com.arangodb.model.DocumentUpdateOptions; |
@@ -137,6 +139,63 @@ public <T> CompletableFuture<MultiDocumentEntity<DocumentCreateEntity<T>>> inser |
137 | 139 | insertDocumentsResponseDeserializer(values, params)); |
138 | 140 | } |
139 | 141 |
|
| 142 | + /** |
| 143 | + * Imports documents |
| 144 | + * |
| 145 | + * @param values |
| 146 | + * a list of Objects that will be stored as documents |
| 147 | + * @return information about the import |
| 148 | + * @throws ArangoDBException |
| 149 | + */ |
| 150 | + public CompletableFuture<DocumentImportEntity> importDocuments(final Collection<?> values) { |
| 151 | + return importDocuments(values, new DocumentImportOptions()); |
| 152 | + } |
| 153 | + |
| 154 | + /** |
| 155 | + * Imports documents |
| 156 | + * |
| 157 | + * @param values |
| 158 | + * a list of Objects that will be stored as documents |
| 159 | + * @param options |
| 160 | + * Additional options, can be null |
| 161 | + * @return information about the import |
| 162 | + * @throws ArangoDBException |
| 163 | + */ |
| 164 | + public CompletableFuture<DocumentImportEntity> importDocuments( |
| 165 | + final Collection<?> values, |
| 166 | + final DocumentImportOptions options) { |
| 167 | + return executor.execute(importDocumentsRequest(values, options), DocumentImportEntity.class); |
| 168 | + } |
| 169 | + |
| 170 | + /** |
| 171 | + * Imports documents |
| 172 | + * |
| 173 | + * @param values |
| 174 | + * JSON-encoded array of objects that will be stored as documents |
| 175 | + * @return information about the import |
| 176 | + * @throws ArangoDBException |
| 177 | + */ |
| 178 | + public CompletableFuture<DocumentImportEntity> importDocuments(final String values) { |
| 179 | + return executor.execute(importDocumentsRequest(values, new DocumentImportOptions()), |
| 180 | + DocumentImportEntity.class); |
| 181 | + } |
| 182 | + |
| 183 | + /** |
| 184 | + * Imports documents |
| 185 | + * |
| 186 | + * @param values |
| 187 | + * JSON-encoded array of objects that will be stored as documents |
| 188 | + * @param options |
| 189 | + * Additional options, can be null |
| 190 | + * @return information about the import |
| 191 | + * @throws ArangoDBException |
| 192 | + */ |
| 193 | + public CompletableFuture<DocumentImportEntity> importDocuments( |
| 194 | + final String values, |
| 195 | + final DocumentImportOptions options) { |
| 196 | + return executor.execute(importDocumentsRequest(values, options), DocumentImportEntity.class); |
| 197 | + } |
| 198 | + |
140 | 199 | /** |
141 | 200 | * Reads a single document |
142 | 201 | * |
|
0 commit comments