Package com.arangodb

Interface ArangoDB

  • All Superinterfaces:
    ArangoSerdeAccessor

    @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 Detail

      • 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

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

        ArangoDatabase db​(String name)
        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:
        API Documentation
      • 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:
        API Documentation
      • 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:
        API Documentation
      • 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:
        API Documentation
      • getRole

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

        String getServerId()
        Returns the id of a server in a cluster.
        Returns:
        the server id
        See Also:
        API Documentation
      • 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:
        API Documentation
      • 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:
        API Documentation
      • 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:
        API Documentation
      • 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:
        API Documentation
      • 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:
        API Documentation
      • 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:
        API Documentation
      • 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:
        API Documentation
      • 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
      • 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
      • 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:
        API Documentation
      • getLogLevel

        LogLevelEntity getLogLevel()
        Returns the server's current loglevel settings.
        Returns:
        the server's current loglevel settings
        Since:
        ArangoDB 3.1.0
      • 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
      • getQueryOptimizerRules

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