Package com.arangodb
Interface ArangoDatabase
- All Superinterfaces:
ArangoSerdeAccessor
- All Known Implementing Classes:
ArangoDatabaseImpl
Interface for operations on ArangoDB database level.
- Author:
- Mark Vollmary, Michele Rastelli
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionAborts a Stream Transaction.arango()
Return the main entry point for the ArangoDB driverarangoSearch
(String name) Returns aArangoSearch
instance for the given view name.Begins a Stream Transaction.void
Clears the AQL query cachevoid
Clears the list of slow AQL queriescollection
(String name) Returns aArangoCollection
instance for the given collection name.Commits a Stream Transaction.create()
Creates the databasevoid
createAqlFunction
(String name, String code, AqlFunctionCreateOptions options) Create a new AQL user functioncreateArangoSearch
(String name, ArangoSearchCreateOptions options) Creates a ArangoSearch view with the givenoptions
, then returns view information from the server.createCollection
(String name) Creates a collection for the given collection's name, then returns collection information from the server.createCollection
(String name, CollectionCreateOptions options) Creates a collection with the givenoptions
for this collection's name, then returns collection information from the server.createGraph
(String name, Iterable<EdgeDefinition> edgeDefinitions) Create a new graph in the graph module.createGraph
(String name, Iterable<EdgeDefinition> edgeDefinitions, GraphCreateOptions options) Create a new graph in the graph module.createSearchAlias
(String name, SearchAliasCreateOptions options) Creates a SearchAlias view with the givenoptions
, then returns view information from the server.createSearchAnalyzer
(SearchAnalyzer analyzer) Creates an AnalyzercreateView
(String name, ViewType type) Creates a view of the giventype
, then returns view information from the server.<T> ArangoCursor<T>
Return an cursor from the given cursor-ID if still existing<T> ArangoCursor<T>
cursor
(String cursorId, Class<T> type, AqlQueryOptions options) Return an cursor from the given cursor-ID if still existing<T> ArangoCursor<T>
Return an cursor from the given cursor-ID if still existing<T> ArangoCursor<T>
cursor
(String cursorId, Class<T> type, String nextBatchId, AqlQueryOptions options) Return an cursor from the given cursor-ID if still existingdeleteAqlFunction
(String name, AqlFunctionDeleteOptions options) Deletes the AQL user function with the given name from the database.deleteIndex
(String id) Deletes an indexvoid
deleteSearchAnalyzer
(String name) Deletes an Analyzervoid
deleteSearchAnalyzer
(String name, AnalyzerDeleteOptions options) Deletes an Analyzerdrop()
Deletes the database from the server.boolean
exists()
Checks whether the database existsexplainAqlQuery
(String query, Map<String, Object> bindVars, AqlQueryExplainOptions options) Deprecated.explainAqlQuery
(String query, Map<String, Object> bindVars, ExplainAqlQueryOptions options) Explain an AQL query and return information about itexplainQuery
(String query, Map<String, Object> bindVars, AqlQueryExplainOptions options) Deprecated.for removal, useexplainAqlQuery(String, Map, AqlQueryExplainOptions)
insteadRetrieves a list of all databases the current user can accessgetAqlFunctions
(AqlFunctionGetOptions options) Gets all reqistered AQL user functionsFetches all collections from the database and returns an list of collection descriptions.getCollections
(CollectionsReadOptions options) Fetches all collections from the database and returns an list of collection descriptions.Returns a list of currently running AQL queriesReturns the name of the used storage engine.Lists all graphs known to the graph moduleReturns an indexgetInfo()
Retrieves information about the current databasegetPermissions
(String user) Get specific database access levelReturns the global configuration for the AQL query cacheReturns the configuration for the AQL query trackinggetSearchAnalyzer
(String name) Gets information about an AnalyzerRetrieves all analyzers definitions.Returns a list of slow running AQL queriesGets information about a Stream Transaction.Gets all the currently running Stream Transactions.Returns the server name and version number.getViews()
Fetches all views from the database and returns a list of view descriptions.void
grantAccess
(String user) Grants access to the database for useruser
.void
grantAccess
(String user, Permissions permissions) Grants or revoke access to the database for useruser
.void
grantDefaultCollectionAccess
(String user, Permissions permissions) Sets the default access level for collections within this database for the useruser
.Returns aArangoGraph
instance for the given graph name.void
Kills a running query.name()
Returns the name of the databaseparseQuery
(String query) Parse an AQL query and return information about it This method is for query validation only.<T> ArangoCursor<T>
Performs a database query using the givenquery
, then returns a newArangoCursor
instance for the result list.<T> ArangoCursor<T>
query
(String query, Class<T> type, AqlQueryOptions options) Performs a database query using the givenquery
, then returns a newArangoCursor
instance for the result list.<T> ArangoCursor<T>
Performs a database query using the givenquery
andbindVars
, then returns a newArangoCursor
instance for the result list.<T> ArangoCursor<T>
Performs a database query using the givenquery
andbindVars
, then returns a newArangoCursor
instance for the result list.void
Reload the routing table.void
resetAccess
(String user) Clear the database access level, revert back to the default access level.void
revokeAccess
(String user) Revokes access to the database dbname for useruser
.searchAlias
(String name) Returns aSearchAlias
instance for the given view name.setQueryCacheProperties
(QueryCachePropertiesEntity properties) Changes the configuration for the AQL query cache.Changes the configuration for the AQL query tracking<T> T
transaction
(String action, Class<T> type, TransactionOptions options) Performs a server-side transaction and returns its return value.Returns aArangoView
instance for the given view name.Methods inherited from interface com.arangodb.ArangoSerdeAccessor
getSerde
-
Method Details
-
arango
ArangoDB arango()Return the main entry point for the ArangoDB driver- Returns:
- main entry point
-
name
String name()Returns the name of the database- Returns:
- database name
-
getVersion
ArangoDBVersion getVersion()Returns the server name and version number.- Returns:
- the server version, number
- See Also:
-
getEngine
ArangoDBEngine getEngine()Returns the name of the used storage engine.- Returns:
- the storage engine name
- See Also:
-
exists
boolean exists()Checks whether the database exists- Returns:
- true if the database exists, otherwise false
- 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:
-
collection
Returns aArangoCollection
instance for the given collection name.- Parameters:
name
- Name of the collection- Returns:
- collection handler
-
createCollection
Creates a collection for the given collection's name, then returns collection information from the server.- Parameters:
name
- The name of the collection- Returns:
- information about the collection
- See Also:
-
createCollection
Creates a collection with the givenoptions
for this collection's name, then returns collection information from the server.- Parameters:
name
- The name of the collectionoptions
- Additional options, can be null- Returns:
- information about the collection
- See Also:
-
getCollections
Collection<CollectionEntity> getCollections()Fetches all collections from the database and returns an list of collection descriptions.- Returns:
- list of information about all collections
- See Also:
-
getCollections
Fetches all collections from the database and returns an list of collection descriptions.- Parameters:
options
- Additional options, can be null- Returns:
- list of information about all collections
- See Also:
-
getIndex
Returns an index- Parameters:
id
- The index-handle- Returns:
- information about the index
- See Also:
-
deleteIndex
Deletes an index- Parameters:
id
- The index-handle- Returns:
- the id of the index
- See Also:
-
create
Boolean create()Creates the database- Returns:
- true if the database was created successfully.
- See Also:
-
drop
Boolean drop()Deletes the database from the server.- Returns:
- true if the database was dropped successfully
- See Also:
-
grantAccess
Grants or revoke access to the database for 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- See Also:
-
grantAccess
Grants access to the database for useruser
. You need permission to the _system database in order to execute this call.- Parameters:
user
- The name of the user- See Also:
-
revokeAccess
Revokes access to the database dbname for useruser
. You need permission to the _system database in order to execute this call.- Parameters:
user
- The name of the user- See Also:
-
resetAccess
Clear the database access level, revert back to the default access level.- Parameters:
user
- The name of the user- Since:
- ArangoDB 3.2.0
- See Also:
-
grantDefaultCollectionAccess
Sets the default access level for collections within this database 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:
-
getPermissions
Get specific database access level- Parameters:
user
- The name of the user- Returns:
- permissions of the user
- Since:
- ArangoDB 3.2.0
- See Also:
-
query
<T> ArangoCursor<T> query(String query, Class<T> type, Map<String, Object> bindVars, AqlQueryOptions options) Performs a database query using the givenquery
andbindVars
, then returns a newArangoCursor
instance for the result list.- Parameters:
query
- An AQL query stringtype
- The type of the result (POJO orRawData
)bindVars
- key/value pairs defining the variables to bind the query tooptions
- Additional options that will be passed to the query API, can be null- Returns:
- cursor of the results
- See Also:
-
query
Performs a database query using the givenquery
, then returns a newArangoCursor
instance for the result list.- Parameters:
query
- An AQL query stringtype
- The type of the result (POJO orRawData
)options
- Additional options that will be passed to the query API, can be null- Returns:
- cursor of the results
- See Also:
-
query
Performs a database query using the givenquery
andbindVars
, then returns a newArangoCursor
instance for the result list.- Parameters:
query
- An AQL query stringtype
- The type of the result (POJO orRawData
)bindVars
- key/value pairs defining the variables to bind the query to- Returns:
- cursor of the results
- See Also:
-
query
Performs a database query using the givenquery
, then returns a newArangoCursor
instance for the result list.- Parameters:
query
- An AQL query stringtype
- The type of the result (POJO orRawData
)- Returns:
- cursor of the results
- See Also:
-
cursor
Return an cursor from the given cursor-ID if still existing- Parameters:
cursorId
- The ID of the cursortype
- The type of the result (POJO orRawData
)- Returns:
- cursor of the results
- See Also:
-
cursor
Return an cursor from the given cursor-ID if still existing- Parameters:
cursorId
- The ID of the cursortype
- The type of the result (POJO orRawData
)options
- options- Returns:
- cursor of the results
- See Also:
-
cursor
Return an cursor from the given cursor-ID if still existing- Parameters:
cursorId
- The ID of the cursortype
- The type of the result (POJO orRawData
)nextBatchId
- The ID of the next cursor batch (set only if cursor allows retries, seeAqlQueryOptions.allowRetry(Boolean)
- Returns:
- cursor of the results
- Since:
- ArangoDB 3.11
- See Also:
-
cursor
<T> ArangoCursor<T> cursor(String cursorId, Class<T> type, String nextBatchId, AqlQueryOptions options) Return an cursor from the given cursor-ID if still existing- Parameters:
cursorId
- The ID of the cursortype
- The type of the result (POJO orRawData
)nextBatchId
- The ID of the next cursor batch (set only if cursor allows retries, seeAqlQueryOptions.allowRetry(Boolean)
options
- options- Returns:
- cursor of the results
- Since:
- ArangoDB 3.11
- See Also:
-
explainQuery
@Deprecated AqlExecutionExplainEntity explainQuery(String query, Map<String, Object> bindVars, AqlQueryExplainOptions options) Deprecated.for removal, useexplainAqlQuery(String, Map, AqlQueryExplainOptions)
insteadExplain an AQL query and return information about it- Parameters:
query
- the query which you want explainedbindVars
- key/value pairs representing the bind parametersoptions
- Additional options, can be null- Returns:
- information about the query
- See Also:
-
explainAqlQuery
@Deprecated AqlQueryExplainEntity explainAqlQuery(String query, Map<String, Object> bindVars, AqlQueryExplainOptions options) Deprecated.for removal, useexplainAqlQuery(String, Map, ExplainAqlQueryOptions)
insteadExplain an AQL query and return information about it- Parameters:
query
- the query which you want explainedbindVars
- key/value pairs representing the bind parametersoptions
- Additional options, can be null- Returns:
- information about the query
- See Also:
-
explainAqlQuery
AqlQueryExplainEntity explainAqlQuery(String query, Map<String, Object> bindVars, ExplainAqlQueryOptions options) Explain an AQL query and return information about it- Parameters:
query
- the query which you want explainedbindVars
- key/value pairs representing the bind parametersoptions
- Additional options, can be null- Returns:
- information about the query
- See Also:
-
parseQuery
Parse an AQL query and return information about it This method is for query validation only. To actually query the database, seequery(String, Class, Map, AqlQueryOptions)
- Parameters:
query
- the query which you want parse- Returns:
- imformation about the query
- See Also:
-
clearQueryCache
void clearQueryCache()Clears the AQL query cache- See Also:
-
getQueryCacheProperties
QueryCachePropertiesEntity getQueryCacheProperties()Returns the global configuration for the AQL query cache- Returns:
- configuration for the AQL query cache
- See Also:
-
setQueryCacheProperties
Changes the configuration for the AQL query cache. Note: changing the properties may invalidate all results in the cache.- Parameters:
properties
- properties to be set- Returns:
- current set of properties
- See Also:
-
getQueryTrackingProperties
QueryTrackingPropertiesEntity getQueryTrackingProperties()Returns the configuration for the AQL query tracking- Returns:
- configuration for the AQL query tracking
- See Also:
-
setQueryTrackingProperties
Changes the configuration for the AQL query tracking- Parameters:
properties
- properties to be set- Returns:
- current set of properties
- See Also:
-
getCurrentlyRunningQueries
Collection<QueryEntity> getCurrentlyRunningQueries()Returns a list of currently running AQL queries- Returns:
- a list of currently running AQL queries
- See Also:
-
getSlowQueries
Collection<QueryEntity> getSlowQueries()Returns a list of slow running AQL queries- Returns:
- a list of slow running AQL queries
- See Also:
-
clearSlowQueries
void clearSlowQueries()Clears the list of slow AQL queries- See Also:
-
killQuery
Kills a running query. The query will be terminated at the next cancelation point.- Parameters:
id
- The id of the query- See Also:
-
createAqlFunction
Create a new AQL user function- Parameters:
name
- A valid AQL function name, e.g.: `"myfuncs::accounting::calculate_vat"`code
- A String evaluating to a JavaScript functionoptions
- Additional options, can be null- See Also:
-
deleteAqlFunction
Deletes the AQL user function with the given name from the database.- Parameters:
name
- The name of the user function to deleteoptions
- Additional options, can be null- Returns:
- number of deleted functions (since ArangoDB 3.4.0)
- See Also:
-
getAqlFunctions
Gets all reqistered AQL user functions- Parameters:
options
- Additional options, can be null- Returns:
- all reqistered AQL user functions
- See Also:
-
graph
Returns aArangoGraph
instance for the given graph name.- Parameters:
name
- Name of the graph- Returns:
- graph handler
-
createGraph
Create a new graph in the graph module. The creation of a graph requires the name of the graph and a definition of its edges.- Parameters:
name
- Name of the graphedgeDefinitions
- An array of definitions for the edge- Returns:
- information about the graph
- See Also:
-
createGraph
GraphEntity createGraph(String name, Iterable<EdgeDefinition> edgeDefinitions, GraphCreateOptions options) Create a new graph in the graph module. The creation of a graph requires the name of the graph and a definition of its edges.- Parameters:
name
- Name of the graphedgeDefinitions
- An array of definitions for the edgeoptions
- Additional options, can be null- Returns:
- information about the graph
- See Also:
-
getGraphs
Collection<GraphEntity> getGraphs()Lists all graphs known to the graph module- Returns:
- graphs stored in this database
- See Also:
-
transaction
Performs a server-side transaction and returns its return value.- Parameters:
action
- A String evaluating to a JavaScript function to be executed on the server.type
- The type of the result (POJO orRawData
)options
- Additional options, can be null- Returns:
- the result of the transaction if it succeeded
- See Also:
-
beginStreamTransaction
Begins a Stream Transaction.- Parameters:
options
- Additional options, can be null- Returns:
- information about the transaction
- Since:
- ArangoDB 3.5.0
- See Also:
-
abortStreamTransaction
Aborts a Stream Transaction.- Returns:
- information about the transaction
- See Also:
-
getStreamTransaction
Gets information about a Stream Transaction.- Returns:
- information about the transaction
- Since:
- ArangoDB 3.5.0
- See Also:
-
getStreamTransactions
Collection<TransactionEntity> getStreamTransactions()Gets all the currently running Stream Transactions.- Returns:
- all the currently running Stream Transactions
- Since:
- ArangoDB 3.5.0
- See Also:
-
commitStreamTransaction
Commits a Stream Transaction.- Returns:
- information about the transaction
- Since:
- ArangoDB 3.5.0
- See Also:
-
getInfo
DatabaseEntity getInfo()Retrieves information about the current database- Returns:
- information about the current database
- See Also:
-
reloadRouting
void reloadRouting()Reload the routing table.- See Also:
-
getViews
Collection<ViewEntity> getViews()Fetches all views from the database and returns a list of view descriptions.- Returns:
- list of information about all views
- Since:
- ArangoDB 3.4.0
- See Also:
-
view
Returns aArangoView
instance for the given view name.- Parameters:
name
- Name of the view- Returns:
- view handler
- Since:
- ArangoDB 3.4.0
-
arangoSearch
Returns aArangoSearch
instance for the given view name.- Parameters:
name
- Name of the view- Returns:
- ArangoSearch view handler
- Since:
- ArangoDB 3.4.0
-
searchAlias
Returns aSearchAlias
instance for the given view name.- Parameters:
name
- Name of the view- Returns:
- SearchAlias view handler
- Since:
- ArangoDB 3.10
-
createView
Creates a view of the giventype
, then returns view information from the server.- Parameters:
name
- The name of the viewtype
- The type of the view- Returns:
- information about the view
- Since:
- ArangoDB 3.4.0
-
createArangoSearch
Creates a ArangoSearch view with the givenoptions
, then returns view information from the server.- Parameters:
name
- The name of the viewoptions
- Additional options, can be null- Returns:
- information about the view
- Since:
- ArangoDB 3.4.0
- See Also:
-
createSearchAlias
Creates a SearchAlias view with the givenoptions
, then returns view information from the server.- Parameters:
name
- The name of the viewoptions
- Additional options, can be null- Returns:
- information about the view
- Since:
- ArangoDB 3.10
- See Also:
-
createSearchAnalyzer
Creates an Analyzer- Parameters:
analyzer
- SearchAnalyzer- Returns:
- the created Analyzer
- Since:
- ArangoDB 3.5.0
- See Also:
-
getSearchAnalyzer
Gets information about an Analyzer- Parameters:
name
- of the Analyzer without database prefix- Returns:
- information about an Analyzer
- Since:
- ArangoDB 3.5.0
- See Also:
-
getSearchAnalyzers
Collection<SearchAnalyzer> getSearchAnalyzers()Retrieves all analyzers definitions.- Returns:
- collection of all analyzers definitions
- Since:
- ArangoDB 3.5.0
- See Also:
-
deleteSearchAnalyzer
Deletes an Analyzer- Parameters:
name
- of the Analyzer without database prefix- Since:
- ArangoDB 3.5.0
- See Also:
-
deleteSearchAnalyzer
Deletes an Analyzer- Parameters:
name
- of the Analyzer without database prefixoptions
- AnalyzerDeleteOptions- Since:
- ArangoDB 3.5.0
- See Also:
-
explainAqlQuery(String, Map, ExplainAqlQueryOptions)
instead