Class ArangoDBImpl

All Implemented Interfaces:
ArangoDB, ArangoSerdeAccessor

public class ArangoDBImpl extends InternalArangoDB implements ArangoDB
Author:
Mark Vollmary, Heiko Kernbach, Michele Rastelli
  • Constructor Details

  • Method Details

    • async

      public ArangoDBAsync async()
      Specified by:
      async in interface ArangoDB
      Returns:
      the asynchronous version of this class
    • shutdown

      public void shutdown()
      Description copied from interface: ArangoDB
      Releases all connections to the server and clear the connection pool.
      Specified by:
      shutdown in interface ArangoDB
    • updateJwt

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

      public ArangoDatabase db()
      Description copied from interface: ArangoDB
      Returns a ArangoDatabase instance for the _system database.
      Specified by:
      db in interface ArangoDB
      Returns:
      database handler
    • db

      public ArangoDatabase db(String dbName)
      Description copied from interface: ArangoDB
      Returns a ArangoDatabase instance for the given database name.
      Specified by:
      db in interface ArangoDB
      Parameters:
      dbName - Name of the database
      Returns:
      database handler
    • metrics

      public ArangoMetrics metrics()
      Specified by:
      metrics in interface ArangoDB
      Returns:
      entry point for accessing client metrics
    • createDatabase

      public Boolean createDatabase(String dbName)
      Description copied from interface: ArangoDB
      Creates a new database with the given name.
      Specified by:
      createDatabase in interface ArangoDB
      Parameters:
      dbName - Name of the database to create
      Returns:
      true if the database was created successfully.
      See Also:
    • createDatabase

      public Boolean createDatabase(DBCreateOptions options)
      Description copied from interface: ArangoDB
      Creates a new database with the given name.
      Specified by:
      createDatabase in interface ArangoDB
      Parameters:
      options - Creation options
      Returns:
      true if the database was created successfully.
      See Also:
    • getDatabases

      public Collection<String> getDatabases()
      Description copied from interface: ArangoDB
      Retrieves a list of all existing databases
      Specified by:
      getDatabases in interface ArangoDB
      Returns:
      a list of all existing databases
      See Also:
    • getAccessibleDatabases

      public Collection<String> getAccessibleDatabases()
      Description copied from interface: ArangoDB
      Retrieves a list of all databases the current user can access
      Specified by:
      getAccessibleDatabases in interface ArangoDB
      Returns:
      a list of all databases the current user can access
      See Also:
    • getAccessibleDatabasesFor

      public Collection<String> getAccessibleDatabasesFor(String user)
      Description copied from interface: ArangoDB
      List available database to the specified user
      Specified by:
      getAccessibleDatabasesFor in interface ArangoDB
      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

      public ArangoDBVersion getVersion()
      Description copied from interface: ArangoDB
      Returns the server name and version number.
      Specified by:
      getVersion in interface ArangoDB
      Returns:
      the server version, number
      See Also:
    • getEngine

      public ArangoDBEngine getEngine()
      Description copied from interface: ArangoDB
      Returns the server storage engine.
      Specified by:
      getEngine in interface ArangoDB
      Returns:
      the storage engine name
      See Also:
    • getRole

      public ServerRole getRole()
      Description copied from interface: ArangoDB
      Returns the server role.
      Specified by:
      getRole in interface ArangoDB
      Returns:
      the server role
      See Also:
    • getServerId

      public String getServerId()
      Description copied from interface: ArangoDB
      Returns the id of a server in a cluster.
      Specified by:
      getServerId in interface ArangoDB
      Returns:
      the server id
      See Also:
    • createUser

      public UserEntity createUser(String user, String passwd)
      Description copied from interface: ArangoDB
      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.
      Specified by:
      createUser in interface ArangoDB
      Parameters:
      user - The name of the user
      passwd - The user password
      Returns:
      information about the user
      See Also:
    • createUser

      public UserEntity createUser(String user, String passwd, UserCreateOptions options)
      Description copied from interface: ArangoDB
      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.
      Specified by:
      createUser in interface ArangoDB
      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

      public void deleteUser(String user)
      Description copied from interface: ArangoDB
      Removes an existing user, identified by user. You need access to the _system database.
      Specified by:
      deleteUser in interface ArangoDB
      Parameters:
      user - The name of the user
      See Also:
    • getUser

      public UserEntity getUser(String user)
      Description copied from interface: ArangoDB
      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.
      Specified by:
      getUser in interface ArangoDB
      Parameters:
      user - The name of the user
      Returns:
      information about the user
      See Also:
    • getUsers

      public Collection<UserEntity> getUsers()
      Description copied from interface: ArangoDB
      Fetches data about all users. You can only execute this call if you have access to the _system database.
      Specified by:
      getUsers in interface ArangoDB
      Returns:
      informations about all users
      See Also:
    • updateUser

      public UserEntity updateUser(String user, UserUpdateOptions options)
      Description copied from interface: ArangoDB
      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.
      Specified by:
      updateUser in interface ArangoDB
      Parameters:
      user - The name of the user
      options - Properties of the user to be changed
      Returns:
      information about the user
      See Also:
    • replaceUser

      public UserEntity replaceUser(String user, UserUpdateOptions options)
      Description copied from interface: ArangoDB
      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.
      Specified by:
      replaceUser in interface ArangoDB
      Parameters:
      user - The name of the user
      options - Additional properties of the user, can be null
      Returns:
      information about the user
      See Also:
    • grantDefaultDatabaseAccess

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

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

      public <T> Response<T> execute(Request<?> request, Class<T> type)
      Description copied from interface: ArangoDB
      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
      Specified by:
      execute in interface ArangoDB
      Parameters:
      request - request
      type - Deserialization target type for the response body (POJO or RawData)
      Returns:
      response
    • getLogEntries

      public LogEntriesEntity getLogEntries(LogOptions options)
      Description copied from interface: ArangoDB
      Returns the server logs
      Specified by:
      getLogEntries in interface ArangoDB
      Parameters:
      options - Additional options, can be null
      Returns:
      the log messages
      See Also:
    • getLogLevel

      public LogLevelEntity getLogLevel()
      Description copied from interface: ArangoDB
      Returns the server's current loglevel settings.
      Specified by:
      getLogLevel in interface ArangoDB
      Returns:
      the server's current loglevel settings
      See Also:
    • getLogLevel

      public LogLevelEntity getLogLevel(LogLevelOptions options)
      Description copied from interface: ArangoDB
      Returns the server's current loglevel settings.
      Specified by:
      getLogLevel in interface ArangoDB
      Returns:
      the server's current loglevel settings
      See Also:
    • setLogLevel

      public LogLevelEntity setLogLevel(LogLevelEntity entity)
      Description copied from interface: ArangoDB
      Modifies and returns the server's current loglevel settings.
      Specified by:
      setLogLevel in interface ArangoDB
      Parameters:
      entity - loglevel settings
      Returns:
      the server's current loglevel settings
      See Also:
    • setLogLevel

      public LogLevelEntity setLogLevel(LogLevelEntity entity, LogLevelOptions options)
      Description copied from interface: ArangoDB
      Modifies and returns the server's current loglevel settings.
      Specified by:
      setLogLevel in interface ArangoDB
      Parameters:
      entity - loglevel settings
      Returns:
      the server's current loglevel settings
      See Also:
    • resetLogLevels

      public LogLevelEntity resetLogLevels(LogLevelOptions options)
      Description copied from interface: ArangoDB
      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.
      Specified by:
      resetLogLevels in interface ArangoDB
    • getQueryOptimizerRules

      public Collection<QueryOptimizerRule> getQueryOptimizerRules()
      Specified by:
      getQueryOptimizerRules in interface ArangoDB
      Returns:
      the list of available rules and their respective flags
      See Also: