Package com.arangodb

Interface ArangoDB

All Superinterfaces:
ArangoSerdeAccessor
All Known Implementing Classes:
ArangoDBImpl

@ThreadSafe public interface ArangoDB extends ArangoSerdeAccessor
Central access point for applications to communicate with an ArangoDB server.

Will be instantiated through ArangoDB.Builder

 ArangoDB arango = new ArangoDB.Builder().build();
 ArangoDB arango = new ArangoDB.Builder().host("127.0.0.1", 8529).build();
 
Author:
Mark Vollmary, Michele Rastelli
  • Method Details

    • async

      ArangoDBAsync async()
      Returns:
      the asynchronous version of this class
    • shutdown

      void shutdown()
      Releases all connections to the server and clear the connection pool.
    • updateJwt

      void updateJwt(String jwt)
      Updates the JWT used for requests authorization. It does not change already existing VST connections, since VST connections are authenticated during the initialization phase.
      Parameters:
      jwt - token to use
    • db

      Returns a ArangoDatabase instance for the _system database.
      Returns:
      database handler
    • db

      Returns a ArangoDatabase instance for the given database name.
      Parameters:
      name - Name of the database
      Returns:
      database handler
    • metrics

      ArangoMetrics metrics()
      Returns:
      entry point for accessing client metrics
    • createDatabase

      Boolean createDatabase(String name)
      Creates a new database with the given name.
      Parameters:
      name - Name of the database to create
      Returns:
      true if the database was created successfully.
      See Also:
    • createDatabase

      Boolean createDatabase(DBCreateOptions options)
      Creates a new database with the given name.
      Parameters:
      options - Creation options
      Returns:
      true if the database was created successfully.
      Since:
      ArangoDB 3.6.0
      See Also:
    • getDatabases

      Collection<String> getDatabases()
      Retrieves a list of all existing databases
      Returns:
      a list of all existing databases
      See Also:
    • getAccessibleDatabases

      Collection<String> getAccessibleDatabases()
      Retrieves a list of all databases the current user can access
      Returns:
      a list of all databases the current user can access
      See Also:
    • getAccessibleDatabasesFor

      Collection<String> getAccessibleDatabasesFor(String user)
      List available database to the specified user
      Parameters:
      user - The name of the user for which you want to query the databases
      Returns:
      list of database names which are available for the specified user
      See Also:
    • getVersion

      ArangoDBVersion getVersion()
      Returns the server name and version number.
      Returns:
      the server version, number
      See Also:
    • getEngine

      ArangoDBEngine getEngine()
      Returns the server storage engine.
      Returns:
      the storage engine name
      See Also:
    • getRole

      ServerRole getRole()
      Returns the server role.
      Returns:
      the server role
      See Also:
    • getServerId

      String getServerId()
      Returns the id of a server in a cluster.
      Returns:
      the server id
      See Also:
    • createUser

      UserEntity createUser(String user, String passwd)
      Create a new user. This user will not have access to any database. You need permission to the _system database in order to execute this call.
      Parameters:
      user - The name of the user
      passwd - The user password
      Returns:
      information about the user
      See Also:
    • createUser

      UserEntity createUser(String user, String passwd, UserCreateOptions options)
      Create a new user. This user will not have access to any database. You need permission to the _system database in order to execute this call.
      Parameters:
      user - The name of the user
      passwd - The user password
      options - Additional options, can be null
      Returns:
      information about the user
      See Also:
    • deleteUser

      void deleteUser(String user)
      Removes an existing user, identified by user. You need access to the _system database.
      Parameters:
      user - The name of the user
      See Also:
    • getUser

      UserEntity getUser(String user)
      Fetches data about the specified user. You can fetch information about yourself or you need permission to the _system database in order to execute this call.
      Parameters:
      user - The name of the user
      Returns:
      information about the user
      See Also:
    • getUsers

      Collection<UserEntity> getUsers()
      Fetches data about all users. You can only execute this call if you have access to the _system database.
      Returns:
      informations about all users
      See Also:
    • updateUser

      UserEntity updateUser(String user, UserUpdateOptions options)
      Partially updates the data of an existing user. The name of an existing user must be specified in user. You can only change the password of your self. You need access to the _system database to change the active flag.
      Parameters:
      user - The name of the user
      options - Properties of the user to be changed
      Returns:
      information about the user
      See Also:
    • replaceUser

      UserEntity replaceUser(String user, UserUpdateOptions options)
      Replaces the data of an existing user. The name of an existing user must be specified in user. You can only change the password of your self. You need access to the _system database to change the active flag.
      Parameters:
      user - The name of the user
      options - Additional properties of the user, can be null
      Returns:
      information about the user
      See Also:
    • grantDefaultDatabaseAccess

      void grantDefaultDatabaseAccess(String user, Permissions permissions)
      Sets the default access level for databases for the user user. You need permission to the _system database in order to execute this call.
      Parameters:
      user - The name of the user
      permissions - The permissions the user grant
      Since:
      ArangoDB 3.2.0
      See Also:
    • grantDefaultCollectionAccess

      void grantDefaultCollectionAccess(String user, Permissions permissions)
      Sets the default access level for collections for the user user. You need permission to the _system database in order to execute this call.
      Parameters:
      user - The name of the user
      permissions - The permissions the user grant
      Since:
      ArangoDB 3.2.0
      See Also:
    • execute

      <T> Response<T> execute(Request<?> request, Class<T> type)
      Execute custom requests. Requests can be programmatically built by setting low level detail such as method, path, query parameters, headers and body payload. This method can be used to call FOXX services, API endpoints not (yet) implemented in this driver or trigger async jobs, see Fire and Forget and Async Execution and later Result Retrieval
      Parameters:
      request - request
      type - Deserialization target type for the response body (POJO or RawData)
      Returns:
      response
    • getLogEntries

      LogEntriesEntity getLogEntries(LogOptions options)
      Returns the server logs
      Parameters:
      options - Additional options, can be null
      Returns:
      the log messages
      Since:
      ArangoDB 3.8
      See Also:
    • getLogLevel

      LogLevelEntity getLogLevel()
      Returns the server's current loglevel settings.
      Returns:
      the server's current loglevel settings
      Since:
      ArangoDB 3.1.0
      See Also:
    • getLogLevel

      LogLevelEntity getLogLevel(LogLevelOptions options)
      Returns the server's current loglevel settings.
      Returns:
      the server's current loglevel settings
      Since:
      ArangoDB 3.10
      See Also:
    • setLogLevel

      LogLevelEntity setLogLevel(LogLevelEntity entity)
      Modifies and returns the server's current loglevel settings.
      Parameters:
      entity - loglevel settings
      Returns:
      the server's current loglevel settings
      Since:
      ArangoDB 3.1.0
      See Also:
    • setLogLevel

      LogLevelEntity setLogLevel(LogLevelEntity entity, LogLevelOptions options)
      Modifies and returns the server's current loglevel settings.
      Parameters:
      entity - loglevel settings
      Returns:
      the server's current loglevel settings
      Since:
      ArangoDB 3.10
      See Also:
    • resetLogLevels

      LogLevelEntity resetLogLevels(LogLevelOptions options)
      Reset the server log levels Revert the server's log level settings to the values they had at startup, as determined by the startup options specified on the command-line, a configuration file, and the factory defaults.
      Since:
      ArangoDB 3.12
    • getQueryOptimizerRules

      Collection<QueryOptimizerRule> getQueryOptimizerRules()
      Returns:
      the list of available rules and their respective flags
      Since:
      ArangoDB 3.10
      See Also: