Skip to content

Commit 4b07572

Browse files
authored
Bugfix/synchronous exceptions (#23)
* cleanup ArangoDBException from tests * cleanup ArangoDBException from async interfaces * bugfix async drop() invocations in tests * cleanup creation of new CompletableFutures
1 parent f5ddd9f commit 4b07572

21 files changed

+471
-593
lines changed

src/main/java/com/arangodb/ArangoCollectionAsync.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ <T> CompletableFuture<MultiDocumentEntity<DocumentCreateEntity<T>>> insertDocume
131131
* @param values
132132
* a list of Objects that will be stored as documents
133133
* @return information about the import
134-
* @throws ArangoDBException
135134
*/
136135
CompletableFuture<DocumentImportEntity> importDocuments(final Collection<?> values);
137136

@@ -143,7 +142,6 @@ <T> CompletableFuture<MultiDocumentEntity<DocumentCreateEntity<T>>> insertDocume
143142
* @param options
144143
* Additional options, can be null
145144
* @return information about the import
146-
* @throws ArangoDBException
147145
*/
148146
CompletableFuture<DocumentImportEntity> importDocuments(
149147
final Collection<?> values,
@@ -155,7 +153,6 @@ CompletableFuture<DocumentImportEntity> importDocuments(
155153
* @param values
156154
* JSON-encoded array of objects that will be stored as documents
157155
* @return information about the import
158-
* @throws ArangoDBException
159156
*/
160157
CompletableFuture<DocumentImportEntity> importDocuments(final String values);
161158

@@ -167,7 +164,6 @@ CompletableFuture<DocumentImportEntity> importDocuments(
167164
* @param options
168165
* Additional options, can be null
169166
* @return information about the import
170-
* @throws ArangoDBException
171167
*/
172168
CompletableFuture<DocumentImportEntity> importDocuments(final String values, final DocumentImportOptions options);
173169

@@ -740,5 +736,5 @@ CompletableFuture<IndexEntity> ensureFulltextIndex(
740736
* @return permissions of the user
741737
* @since ArangoDB 3.2.0
742738
*/
743-
CompletableFuture<Permissions> getPermissions(final String user) throws ArangoDBException;
739+
CompletableFuture<Permissions> getPermissions(final String user);
744740
}

src/main/java/com/arangodb/ArangoDBAsync.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,6 @@ private VstCommunicationSync.Builder syncBuilder(final HostHandler hostHandler)
655655
* @param user
656656
* The name of the user for which you want to query the databases
657657
* @return
658-
* @throws ArangoDBException
659658
*/
660659
CompletableFuture<Collection<String>> getAccessibleDatabasesFor(final String user);
661660

@@ -672,7 +671,6 @@ private VstCommunicationSync.Builder syncBuilder(final HostHandler hostHandler)
672671
* Returns the server role.
673672
*
674673
* @return the server role
675-
* @throws ArangoDBException
676674
*/
677675
CompletableFuture<ServerRole> getRole();
678676

@@ -772,8 +770,7 @@ private VstCommunicationSync.Builder syncBuilder(final HostHandler hostHandler)
772770
* @since ArangoDB 3.2.0
773771
* @return void
774772
*/
775-
CompletableFuture<Void> grantDefaultDatabaseAccess(final String user, final Permissions permissions)
776-
throws ArangoDBException;
773+
CompletableFuture<Void> grantDefaultDatabaseAccess(final String user, final Permissions permissions);
777774

778775
/**
779776
* Sets the default access level for collections for the user <code>user</code>. You need permission to the _system
@@ -786,16 +783,14 @@ CompletableFuture<Void> grantDefaultDatabaseAccess(final String user, final Perm
786783
* @since ArangoDB 3.2.0
787784
* @return void
788785
*/
789-
CompletableFuture<Void> grantDefaultCollectionAccess(final String user, final Permissions permissions)
790-
throws ArangoDBException;
786+
CompletableFuture<Void> grantDefaultCollectionAccess(final String user, final Permissions permissions);
791787

792788
/**
793789
* Generic Execute. Use this method to execute custom FOXX services.
794790
*
795791
* @param request
796792
* VelocyStream request
797793
* @return VelocyStream response
798-
* @throws ArangoDBException
799794
*/
800795
CompletableFuture<Response> execute(final Request request);
801796

@@ -815,7 +810,6 @@ CompletableFuture<Void> grantDefaultCollectionAccess(final String user, final Pe
815810
* Returns the server's current loglevel settings.
816811
*
817812
* @return the server's current loglevel settings
818-
* @throws ArangoDBException
819813
*/
820814
CompletableFuture<LogLevelEntity> getLogLevel();
821815

@@ -825,7 +819,6 @@ CompletableFuture<Void> grantDefaultCollectionAccess(final String user, final Pe
825819
* @param entity
826820
* loglevel settings
827821
* @return the server's current loglevel settings
828-
* @throws ArangoDBException
829822
*/
830823
CompletableFuture<LogLevelEntity> setLogLevel(final LogLevelEntity entity);
831824
}

src/main/java/com/arangodb/ArangoDatabaseAsync.java

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,8 @@ public interface ArangoDatabaseAsync extends ArangoSerializationAccessor {
254254
* @param permissions
255255
* The permissions the user grant
256256
* @since ArangoDB 3.2.0
257-
* @throws ArangoDBException
258257
*/
259-
CompletableFuture<Void> grantDefaultCollectionAccess(final String user, final Permissions permissions)
260-
throws ArangoDBException;
258+
CompletableFuture<Void> grantDefaultCollectionAccess(final String user, final Permissions permissions);
261259

262260
/**
263261
* Get specific database access level
@@ -269,7 +267,7 @@ CompletableFuture<Void> grantDefaultCollectionAccess(final String user, final Pe
269267
* @return permissions of the user
270268
* @since ArangoDB 3.2.0
271269
*/
272-
CompletableFuture<Permissions> getPermissions(final String user) throws ArangoDBException;
270+
CompletableFuture<Permissions> getPermissions(final String user);
273271

274272
/**
275273
* Performs a database query using the given {@code query} and {@code bindVars}, then returns a new
@@ -286,13 +284,12 @@ CompletableFuture<Void> grantDefaultCollectionAccess(final String user, final Pe
286284
* @param type
287285
* The type of the result (POJO class, VPackSlice, String for Json, or Collection/List/Map)
288286
* @return cursor of the results
289-
* @throws ArangoDBException
290287
*/
291288
<T> CompletableFuture<ArangoCursorAsync<T>> query(
292289
final String query,
293290
final Map<String, Object> bindVars,
294291
final AqlQueryOptions options,
295-
final Class<T> type) throws ArangoDBException;
292+
final Class<T> type);
296293

297294
/**
298295
* Performs a database query using the given {@code query}, then returns a new {@code ArangoCursor} instance for the
@@ -307,12 +304,11 @@ <T> CompletableFuture<ArangoCursorAsync<T>> query(
307304
* @param type
308305
* The type of the result (POJO class, VPackSlice, String for Json, or Collection/List/Map)
309306
* @return cursor of the results
310-
* @throws ArangoDBException
311307
*/
312308
<T> CompletableFuture<ArangoCursorAsync<T>> query(
313309
final String query,
314310
final AqlQueryOptions options,
315-
final Class<T> type) throws ArangoDBException;
311+
final Class<T> type);
316312

317313
/**
318314
* Performs a database query using the given {@code query} and {@code bindVars}, then returns a new
@@ -327,12 +323,11 @@ <T> CompletableFuture<ArangoCursorAsync<T>> query(
327323
* @param type
328324
* The type of the result (POJO class, VPackSlice, String for Json, or Collection/List/Map)
329325
* @return cursor of the results
330-
* @throws ArangoDBException
331326
*/
332327
<T> CompletableFuture<ArangoCursorAsync<T>> query(
333328
final String query,
334329
final Map<String, Object> bindVars,
335-
final Class<T> type) throws ArangoDBException;
330+
final Class<T> type);
336331

337332
/**
338333
* Performs a database query using the given {@code query}, then returns a new {@code ArangoCursor} instance for the
@@ -345,9 +340,8 @@ <T> CompletableFuture<ArangoCursorAsync<T>> query(
345340
* @param type
346341
* The type of the result (POJO class, VPackSlice, String for Json, or Collection/List/Map)
347342
* @return cursor of the results
348-
* @throws ArangoDBException
349343
*/
350-
<T> CompletableFuture<ArangoCursorAsync<T>> query(final String query, final Class<T> type) throws ArangoDBException;
344+
<T> CompletableFuture<ArangoCursorAsync<T>> query(final String query, final Class<T> type);
351345

352346
/**
353347
* Return an cursor from the given cursor-ID if still existing
@@ -360,10 +354,8 @@ <T> CompletableFuture<ArangoCursorAsync<T>> query(
360354
* @param type
361355
* The type of the result (POJO class, VPackSlice, String for Json, or Collection/List/Map)
362356
* @return cursor of the results
363-
* @throws ArangoDBException
364357
*/
365-
<T> CompletableFuture<ArangoCursorAsync<T>> cursor(final String cursorId, final Class<T> type)
366-
throws ArangoDBException;
358+
<T> CompletableFuture<ArangoCursorAsync<T>> cursor(final String cursorId, final Class<T> type);
367359

368360
/**
369361
* Explain an AQL query and return information about it
@@ -684,10 +676,9 @@ <T> CompletableFuture<T> getDocument(final String id, final Class<T> type, final
684676
*
685677
* @see <a href="https://docs.arangodb.com/current/HTTP/Views/Getting.html#reads-all-views">API Documentation</a>
686678
* @return list of information about all views
687-
* @throws ArangoDBException
688679
* @since ArangoDB 3.4.0
689680
*/
690-
CompletableFuture<Collection<ViewEntity>> getViews() throws ArangoDBException;
681+
CompletableFuture<Collection<ViewEntity>> getViews();
691682

692683
/**
693684
* Returns a {@code ArangoViewAsync} instance for the given view name.
@@ -718,9 +709,8 @@ <T> CompletableFuture<T> getDocument(final String id, final Class<T> type, final
718709
* The type of the view
719710
* @return information about the view
720711
* @since ArangoDB 3.4.0
721-
* @throws ArangoDBException
722712
*/
723-
CompletableFuture<ViewEntity> createView(String name, ViewType type) throws ArangoDBException;
713+
CompletableFuture<ViewEntity> createView(String name, ViewType type);
724714

725715
/**
726716
* Creates a ArangoSearch view with the given {@code options}, then returns view information from the server.
@@ -733,9 +723,7 @@ <T> CompletableFuture<T> getDocument(final String id, final Class<T> type, final
733723
* Additional options, can be null
734724
* @return information about the view
735725
* @since ArangoDB 3.4.0
736-
* @throws ArangoDBException
737726
*/
738-
CompletableFuture<ViewEntity> createArangoSearch(String name, ArangoSearchCreateOptions options)
739-
throws ArangoDBException;
727+
CompletableFuture<ViewEntity> createArangoSearch(String name, ArangoSearchCreateOptions options);
740728

741729
}

src/main/java/com/arangodb/ArangoVertexCollectionAsync.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,8 @@ <T> CompletableFuture<VertexUpdateEntity> replaceVertex(
154154
* @param type
155155
* The type of the vertex-document (POJO class, VPackSlice or String for Json)
156156
* @return information about the vertex
157-
* @throws ArangoDBException
158157
*/
159-
<T> CompletableFuture<VertexUpdateEntity> updateVertex(final String key, final T value) throws ArangoDBException;
158+
<T> CompletableFuture<VertexUpdateEntity> updateVertex(final String key, final T value);
160159

161160
/**
162161
* Partially updates the vertex identified by document-key. The value must contain a document with the attributes to
@@ -171,12 +170,11 @@ <T> CompletableFuture<VertexUpdateEntity> replaceVertex(
171170
* @param options
172171
* Additional options, can be null
173172
* @return information about the vertex
174-
* @throws ArangoDBException
175173
*/
176174
<T> CompletableFuture<VertexUpdateEntity> updateVertex(
177175
final String key,
178176
final T value,
179-
final VertexUpdateOptions options) throws ArangoDBException;
177+
final VertexUpdateOptions options);
180178

181179
/**
182180
* Removes a vertex

src/main/java/com/arangodb/ArangoViewAsync.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,13 @@ public interface ArangoViewAsync extends ArangoSerializationAccessor {
5151
* Checks whether the view exists.
5252
*
5353
* @return true if the view exists, otherwise false
54-
* @throws ArangoDBException
5554
*/
5655
CompletableFuture<Boolean> exists();
5756

5857
/**
5958
* Deletes the view from the database.
6059
*
6160
* @see <a href= "https://docs.arangodb.com/current/HTTP/Views/Creating.html#drops-a-view">API Documentation</a>
62-
* @throws ArangoDBException
6361
*/
6462
CompletableFuture<Void> drop();
6563

@@ -70,7 +68,6 @@ public interface ArangoViewAsync extends ArangoSerializationAccessor {
7068
* @param newName
7169
* The new name
7270
* @return information about the view
73-
* @throws ArangoDBException
7471
*/
7572
CompletableFuture<ViewEntity> rename(String newName);
7673

@@ -80,7 +77,6 @@ public interface ArangoViewAsync extends ArangoSerializationAccessor {
8077
* @see <a href= "https://docs.arangodb.com/current/HTTP/Views/Getting.html#return-information-about-a-view">API
8178
* Documentation</a>
8279
* @return information about the view
83-
* @throws ArangoDBException
8480
*/
8581
CompletableFuture<ViewEntity> getInfo();
8682

0 commit comments

Comments
 (0)