24
24
import java .io .InputStream ;
25
25
import java .util .Collection ;
26
26
import java .util .Properties ;
27
- import java .util .concurrent .CompletableFuture ;
28
27
29
28
import javax .net .ssl .SSLContext ;
30
29
@@ -227,19 +226,6 @@ public Boolean createDatabase(final String name) throws ArangoDBException {
227
226
return executeSync (createDatabaseRequest (name ), createDatabaseResponseDeserializer ());
228
227
}
229
228
230
- /**
231
- * creates a new database
232
- *
233
- * @see <a href="https://docs.arangodb.com/current/HTTP/Database/DatabaseManagement.html#create-database">API
234
- * Documentation</a>
235
- * @param name
236
- * Has to contain a valid database name
237
- * @return true if the database was created successfully.
238
- */
239
- public CompletableFuture <Boolean > createDatabaseAsync (final String name ) {
240
- return executeAsync (createDatabaseRequest (name ), createDatabaseResponseDeserializer ());
241
- }
242
-
243
229
private Request createDatabaseRequest (final String name ) {
244
230
final Request request = new Request (ArangoDBConstants .SYSTEM , RequestType .POST ,
245
231
ArangoDBConstants .PATH_API_DATABASE );
@@ -266,15 +252,6 @@ public Collection<String> getDatabases() throws ArangoDBException {
266
252
return executeSync (getDatabasesRequest (), getDatabaseResponseDeserializer ());
267
253
}
268
254
269
- /**
270
- * @see <a href="https://docs.arangodb.com/current/HTTP/Database/DatabaseManagement.html#list-of-databases">API
271
- * Documentation</a>
272
- * @return a list of all existing databases
273
- */
274
- public CompletableFuture <Collection <String >> getDatabasesAsync () {
275
- return executeAsync (getDatabasesRequest (), getDatabaseResponseDeserializer ());
276
- }
277
-
278
255
private Request getDatabasesRequest () {
279
256
return new Request (db ().name (), RequestType .GET , ArangoDBConstants .PATH_API_DATABASE );
280
257
}
@@ -301,16 +278,6 @@ public Collection<String> getAccessibleDatabases() throws ArangoDBException {
301
278
return executeSync (getAccessibleDatabasesRequest (), getDatabaseResponseDeserializer ());
302
279
}
303
280
304
- /**
305
- * @see <a href=
306
- * "https://docs.arangodb.com/current/HTTP/Database/DatabaseManagement.html#list-of-accessible-databases">API
307
- * Documentation</a>
308
- * @return a list of all databases the current user can access
309
- */
310
- public CompletableFuture <Collection <String >> getAccessibleDatabasesAsync () {
311
- return executeAsync (getAccessibleDatabasesRequest (), getDatabaseResponseDeserializer ());
312
- }
313
-
314
281
private Request getAccessibleDatabasesRequest () {
315
282
return new Request (db ().name (), RequestType .GET ,
316
283
createPath (ArangoDBConstants .PATH_API_DATABASE , ArangoDBConstants .USER ));
@@ -328,17 +295,6 @@ public ArangoDBVersion getVersion() throws ArangoDBException {
328
295
return executeSync (getVersionRequest (), ArangoDBVersion .class );
329
296
}
330
297
331
- /**
332
- * Returns the server name and version number.
333
- *
334
- * @see <a href="https://docs.arangodb.com/current/HTTP/MiscellaneousFunctions/index.html#return-server-version">API
335
- * Documentation</a>
336
- * @return the server version, number
337
- */
338
- public CompletableFuture <ArangoDBVersion > getVersionAsync () {
339
- return executeAsync (getVersionRequest (), ArangoDBVersion .class );
340
- }
341
-
342
298
private Request getVersionRequest () {
343
299
return new Request (ArangoDBConstants .SYSTEM , RequestType .GET , ArangoDBConstants .PATH_API_VERSION );
344
300
}
@@ -378,41 +334,6 @@ public UserEntity createUser(final String user, final String passwd, final UserC
378
334
return executeSync (createUserRequest (user , passwd , options ), UserEntity .class );
379
335
}
380
336
381
- /**
382
- * Create a new user. This user will not have access to any database. You need permission to the _system database in
383
- * order to execute this call.
384
- *
385
- * @see <a href="https://docs.arangodb.com/current/HTTP/UserManagement/index.html#create-user">API Documentation</a>
386
- * @param user
387
- * The name of the user
388
- * @param passwd
389
- * The user password
390
- * @return information about the user
391
- */
392
- public CompletableFuture <UserEntity > createUserAsync (final String user , final String passwd ) {
393
- return executeAsync (createUserRequest (user , passwd , new UserCreateOptions ()), UserEntity .class );
394
- }
395
-
396
- /**
397
- * Create a new user. This user will not have access to any database. You need permission to the _system database in
398
- * order to execute this call.
399
- *
400
- * @see <a href="https://docs.arangodb.com/current/HTTP/UserManagement/index.html#create-user">API Documentation</a>
401
- * @param user
402
- * The name of the user
403
- * @param passwd
404
- * The user password
405
- * @param options
406
- * Additional properties of the user, can be null
407
- * @return information about the user
408
- */
409
- public CompletableFuture <UserEntity > createUserAsync (
410
- final String user ,
411
- final String passwd ,
412
- final UserCreateOptions options ) {
413
- return executeAsync (createUserRequest (user , passwd , options ), UserEntity .class );
414
- }
415
-
416
337
private Request createUserRequest (final String user , final String passwd , final UserCreateOptions options ) {
417
338
final Request request ;
418
339
request = new Request (db ().name (), RequestType .POST , ArangoDBConstants .PATH_API_USER );
@@ -433,18 +354,6 @@ public void deleteUser(final String user) throws ArangoDBException {
433
354
executeSync (deleteUserRequest (user ), Void .class );
434
355
}
435
356
436
- /**
437
- * Removes an existing user, identified by user. You need access to the _system database.
438
- *
439
- * @see <a href="https://docs.arangodb.com/current/HTTP/UserManagement/index.html#remove-user">API Documentation</a>
440
- * @param user
441
- * The name of the user
442
- * @return void
443
- */
444
- public CompletableFuture <Void > deleteUserAsync (final String user ) {
445
- return executeAsync (deleteUserRequest (user ), Void .class );
446
- }
447
-
448
357
private Request deleteUserRequest (final String user ) {
449
358
return new Request (db ().name (), RequestType .DELETE , createPath (ArangoDBConstants .PATH_API_USER , user ));
450
359
}
@@ -463,19 +372,6 @@ public UserEntity getUser(final String user) throws ArangoDBException {
463
372
return executeSync (getUserRequest (user ), UserEntity .class );
464
373
}
465
374
466
- /**
467
- * Fetches data about the specified user. You can fetch information about yourself or you need permission to the
468
- * _system database in order to execute this call.
469
- *
470
- * @see <a href="https://docs.arangodb.com/current/HTTP/UserManagement/index.html#fetch-user">API Documentation</a>
471
- * @param user
472
- * The name of the user
473
- * @return information about the user
474
- */
475
- public CompletableFuture <UserEntity > getUserAsync (final String user ) {
476
- return executeAsync (getUserRequest (user ), UserEntity .class );
477
- }
478
-
479
375
private Request getUserRequest (final String user ) {
480
376
return new Request (db ().name (), RequestType .GET , createPath (ArangoDBConstants .PATH_API_USER , user ));
481
377
}
@@ -492,17 +388,6 @@ public Collection<UserEntity> getUsers() throws ArangoDBException {
492
388
return executeSync (getUsersRequest (), getUsersResponseDeserializer ());
493
389
}
494
390
495
- /**
496
- * Fetches data about all users. You can only execute this call if you have access to the _system database.
497
- *
498
- * @see <a href="https://docs.arangodb.com/current/HTTP/UserManagement/index.html#list-available-users">API
499
- * Documentation</a>
500
- * @return informations about all users
501
- */
502
- public CompletableFuture <Collection <UserEntity >> getUsersAsync () {
503
- return executeAsync (getUsersRequest (), getUsersResponseDeserializer ());
504
- }
505
-
506
391
private Request getUsersRequest () {
507
392
return new Request (db ().name (), RequestType .GET , ArangoDBConstants .PATH_API_USER );
508
393
}
@@ -534,21 +419,6 @@ public UserEntity updateUser(final String user, final UserUpdateOptions options)
534
419
return executeSync (updateUserRequest (user , options ), UserEntity .class );
535
420
}
536
421
537
- /**
538
- * Partially updates the data of an existing user. The name of an existing user must be specified in user. You can
539
- * only change the password of your self. You need access to the _system database to change the active flag.
540
- *
541
- * @see <a href="https://docs.arangodb.com/current/HTTP/UserManagement/index.html#update-user">API Documentation</a>
542
- * @param user
543
- * The name of the user
544
- * @param options
545
- * Properties of the user to be changed
546
- * @return information about the user
547
- */
548
- public CompletableFuture <UserEntity > updateUserAsync (final String user , final UserUpdateOptions options ) {
549
- return executeAsync (updateUserRequest (user , options ), UserEntity .class );
550
- }
551
-
552
422
private Request updateUserRequest (final String user , final UserUpdateOptions options ) {
553
423
final Request request ;
554
424
request = new Request (db ().name (), RequestType .PATCH , createPath (ArangoDBConstants .PATH_API_USER , user ));
@@ -573,22 +443,6 @@ public UserEntity replaceUser(final String user, final UserUpdateOptions options
573
443
return executeSync (replaceUserRequest (user , options ), UserEntity .class );
574
444
}
575
445
576
- /**
577
- * Replaces the data of an existing user. The name of an existing user must be specified in user. You can only
578
- * change the password of your self. You need access to the _system database to change the active flag.
579
- *
580
- * @see <a href="https://docs.arangodb.com/current/HTTP/UserManagement/index.html#replace-user">API
581
- * Documentation</a>
582
- * @param user
583
- * The name of the user
584
- * @param options
585
- * Additional properties of the user, can be null
586
- * @return information about the user
587
- */
588
- public CompletableFuture <UserEntity > replaceUserAsync (final String user , final UserUpdateOptions options ) {
589
- return executeAsync (replaceUserRequest (user , options ), UserEntity .class );
590
- }
591
-
592
446
private Request replaceUserRequest (final String user , final UserUpdateOptions options ) {
593
447
final Request request ;
594
448
request = new Request (db ().name (), RequestType .PUT , createPath (ArangoDBConstants .PATH_API_USER , user ));
@@ -605,10 +459,6 @@ public Response deserialize(final Response response) throws VPackException {
605
459
});
606
460
}
607
461
608
- public CompletableFuture <Response > executeAsync (final Request request ) {
609
- return executeAsync (request , response -> response );
610
- }
611
-
612
462
/**
613
463
* Returns fatal, error, warning or info log messages from the server's global log.
614
464
*
@@ -624,20 +474,6 @@ public LogEntity getLogs(final LogOptions options) throws ArangoDBException {
624
474
return executeSync (getLogsRequest (options ), LogEntity .class );
625
475
}
626
476
627
- /**
628
- * Returns fatal, error, warning or info log messages from the server's global log.
629
- *
630
- * @see <a href=
631
- * "https://docs.arangodb.com/current/HTTP/AdministrationAndMonitoring/index.html#read-global-logs-from-the-server">API
632
- * Documentation</a>
633
- * @param options
634
- * Additional options, can be null
635
- * @return the log messages
636
- */
637
- public CompletableFuture <LogEntity > getLogsAsync (final LogOptions options ) {
638
- return executeAsync (getLogsRequest (options ), LogEntity .class );
639
- }
640
-
641
477
private Request getLogsRequest (final LogOptions options ) {
642
478
final LogOptions params = options != null ? options : new LogOptions ();
643
479
return new Request (ArangoDBConstants .SYSTEM , RequestType .GET , ArangoDBConstants .PATH_API_ADMIN_LOG )
0 commit comments