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
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ArangoDB.Builder
Builder class to build an instance ofArangoDB
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ArangoDBAsync
async()
Boolean
createDatabase(DBCreateOptions options)
Creates a new database with the given name.Boolean
createDatabase(String name)
Creates a new database with the given name.UserEntity
createUser(String user, String passwd)
Create a new user.UserEntity
createUser(String user, String passwd, UserCreateOptions options)
Create a new user.ArangoDatabase
db()
Returns aArangoDatabase
instance for the_system
database.ArangoDatabase
db(String name)
Returns aArangoDatabase
instance for the given database name.void
deleteUser(String user)
Removes an existing user, identified by user.<T> Response<T>
execute(Request<?> request, Class<T> type)
Execute custom requests.Collection<String>
getAccessibleDatabases()
Retrieves a list of all databases the current user can accessCollection<String>
getAccessibleDatabasesFor(String user)
List available database to the specified userCollection<String>
getDatabases()
Retrieves a list of all existing databasesArangoDBEngine
getEngine()
Returns the server storage engine.LogEntriesEntity
getLogEntries(LogOptions options)
Returns the server logsLogLevelEntity
getLogLevel()
Returns the server's current loglevel settings.LogLevelEntity
getLogLevel(LogLevelOptions options)
Returns the server's current loglevel settings.Collection<QueryOptimizerRule>
getQueryOptimizerRules()
ServerRole
getRole()
Returns the server role.String
getServerId()
Returns the id of a server in a cluster.UserEntity
getUser(String user)
Fetches data about the specified user.Collection<UserEntity>
getUsers()
Fetches data about all users.ArangoDBVersion
getVersion()
Returns the server name and version number.void
grantDefaultCollectionAccess(String user, Permissions permissions)
Sets the default access level for collections for the useruser
.void
grantDefaultDatabaseAccess(String user, Permissions permissions)
Sets the default access level for databases for the useruser
.ArangoMetrics
metrics()
UserEntity
replaceUser(String user, UserUpdateOptions options)
Replaces the data of an existing user.LogLevelEntity
setLogLevel(LogLevelEntity entity)
Modifies and returns the server's current loglevel settings.LogLevelEntity
setLogLevel(LogLevelEntity entity, LogLevelOptions options)
Modifies and returns the server's current loglevel settings.void
shutdown()
Releases all connections to the server and clear the connection pool.void
updateJwt(String jwt)
Updates the JWT used for requests authorization.UserEntity
updateUser(String user, UserUpdateOptions options)
Partially updates the data of an existing user.-
Methods inherited from interface com.arangodb.ArangoSerdeAccessor
getSerde
-
-
-
-
Method Detail
-
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
ArangoDatabase db()
Returns aArangoDatabase
instance for the_system
database.- Returns:
- database handler
-
db
ArangoDatabase db(String name)
Returns aArangoDatabase
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
-
getDatabases
Collection<String> getDatabases()
Retrieves a list of all existing databases- Returns:
- a list of all existing databases
- 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
-
getVersion
ArangoDBVersion getVersion()
Returns the server name and version number.- Returns:
- the server version, number
- See Also:
- API Documentation
-
getEngine
ArangoDBEngine getEngine()
Returns the server storage engine.- Returns:
- the storage engine name
- See Also:
- API Documentation
-
getRole
ServerRole getRole()
Returns the server role.- Returns:
- the server role
- See Also:
- API Documentation
-
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 userpasswd
- 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 userpasswd
- The user passwordoptions
- 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 useroptions
- 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 useroptions
- 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 useruser
. You need permission to the _system database in order to execute this call.- Parameters:
user
- The name of the userpermissions
- The permissions the user grant- Since:
- ArangoDB 3.2.0
- See Also:
- API Documentation
-
grantDefaultCollectionAccess
void grantDefaultCollectionAccess(String user, Permissions permissions)
Sets the default access level for collections for the useruser
. You need permission to the _system database in order to execute this call.- Parameters:
user
- The name of the userpermissions
- The permissions the user grant- Since:
- ArangoDB 3.2.0
- See Also:
- API Documentation
-
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
- requesttype
- Deserialization target type for the response body (POJO orRawData
)- 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
- See Also:
- API Documentation
-
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:
- API Documentation
-
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:
- API Documentation
-
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:
- API Documentation
-
getQueryOptimizerRules
Collection<QueryOptimizerRule> getQueryOptimizerRules()
- Returns:
- the list of available rules and their respective flags
- Since:
- ArangoDB 3.10
- See Also:
- API Documentation
-
-