@ThreadSafe public interface ArangoDatabase extends ArangoSerdeAccessor
Modifier and Type | Method and Description |
---|---|
StreamTransactionEntity |
abortStreamTransaction(String id)
Aborts a Stream Transaction.
|
ArangoDB |
arango()
Return the main entry point for the ArangoDB driver
|
ArangoSearch |
arangoSearch(String name)
Returns a
ArangoSearch instance for the given view name. |
StreamTransactionEntity |
beginStreamTransaction(StreamTransactionOptions options)
Begins a Stream Transaction.
|
void |
clearQueryCache()
Clears the AQL query cache
|
void |
clearSlowQueries()
Clears the list of slow AQL queries
|
ArangoCollection |
collection(String name)
Returns a
ArangoCollection instance for the given collection name. |
StreamTransactionEntity |
commitStreamTransaction(String id)
Commits a Stream Transaction.
|
Boolean |
create()
Creates the database
|
void |
createAqlFunction(String name,
String code,
AqlFunctionCreateOptions options)
Create a new AQL user function
|
ViewEntity |
createArangoSearch(String name,
ArangoSearchCreateOptions options)
Creates a ArangoSearch view with the given
options , then returns view information from the server. |
CollectionEntity |
createCollection(String name)
Creates a collection for the given collection's name, then returns collection information from the server.
|
CollectionEntity |
createCollection(String name,
CollectionCreateOptions options)
Creates a collection with the given
options for this collection's name, then returns collection
information from the server. |
GraphEntity |
createGraph(String name,
Collection<EdgeDefinition> edgeDefinitions)
Create a new graph in the graph module.
|
GraphEntity |
createGraph(String name,
Collection<EdgeDefinition> edgeDefinitions,
GraphCreateOptions options)
Create a new graph in the graph module.
|
ViewEntity |
createSearchAlias(String name,
SearchAliasCreateOptions options)
Creates a SearchAlias view with the given
options , then returns view information from the server. |
SearchAnalyzer |
createSearchAnalyzer(SearchAnalyzer analyzer)
Creates an Analyzer
|
ViewEntity |
createView(String name,
ViewType type)
Creates a view of the given
type , then returns view information from the server. |
<T> ArangoCursor<T> |
cursor(String cursorId,
Class<T> type)
Return an cursor from the given cursor-ID if still existing
|
DbName |
dbName()
Returns the name of the database
|
Integer |
deleteAqlFunction(String name,
AqlFunctionDeleteOptions options)
Deletes the AQL user function with the given name from the database.
|
String |
deleteIndex(String id)
Deletes an index
|
void |
deleteSearchAnalyzer(String name)
Deletes an Analyzer
|
void |
deleteSearchAnalyzer(String name,
AnalyzerDeleteOptions options)
Deletes an Analyzer
|
Boolean |
drop()
Deletes the database from the server.
|
boolean |
exists()
Checks whether the database exists
|
AqlExecutionExplainEntity |
explainQuery(String query,
Map<String,Object> bindVars,
AqlQueryExplainOptions options)
Explain an AQL query and return information about it
|
Collection<String> |
getAccessibleDatabases()
Retrieves a list of all databases the current user can access
|
Collection<AqlFunctionEntity> |
getAqlFunctions(AqlFunctionGetOptions options)
Gets all reqistered AQL user functions
|
Collection<CollectionEntity> |
getCollections()
Fetches all collections from the database and returns an list of collection descriptions.
|
Collection<CollectionEntity> |
getCollections(CollectionsReadOptions options)
Fetches all collections from the database and returns an list of collection descriptions.
|
Collection<QueryEntity> |
getCurrentlyRunningQueries()
Returns a list of currently running AQL queries
|
<T> T |
getDocument(String id,
Class<T> type)
Reads a single document
|
<T> T |
getDocument(String id,
Class<T> type,
DocumentReadOptions options)
Reads a single document
|
ArangoDBEngine |
getEngine()
Returns the name of the used storage engine.
|
Collection<GraphEntity> |
getGraphs()
Lists all graphs known to the graph module
|
IndexEntity |
getIndex(String id)
Returns an index
|
DatabaseEntity |
getInfo()
Retrieves information about the current database
|
Permissions |
getPermissions(String user)
Get specific database access level
|
QueryCachePropertiesEntity |
getQueryCacheProperties()
Returns the global configuration for the AQL query cache
|
QueryTrackingPropertiesEntity |
getQueryTrackingProperties()
Returns the configuration for the AQL query tracking
|
SearchAnalyzer |
getSearchAnalyzer(String name)
Gets information about an Analyzer
|
Collection<SearchAnalyzer> |
getSearchAnalyzers()
Retrieves all analyzers definitions.
|
Collection<QueryEntity> |
getSlowQueries()
Returns a list of slow running AQL queries
|
StreamTransactionEntity |
getStreamTransaction(String id)
Gets information about a Stream Transaction.
|
Collection<TransactionEntity> |
getStreamTransactions()
Gets all the currently running Stream Transactions.
|
ArangoDBVersion |
getVersion()
Returns the server name and version number.
|
Collection<ViewEntity> |
getViews()
Fetches all views from the database and returns an list of view descriptions.
|
void |
grantAccess(String user)
Grants access to the database for user
user . |
void |
grantAccess(String user,
Permissions permissions)
Grants or revoke access to the database for user
user . |
void |
grantDefaultCollectionAccess(String user,
Permissions permissions)
Sets the default access level for collections within this database for the user
user . |
ArangoGraph |
graph(String name)
Returns a
ArangoGraph instance for the given graph name. |
void |
killQuery(String id)
Kills a running query.
|
AqlParseEntity |
parseQuery(String query)
Parse an AQL query and return information about it This method is for query validation only.
|
<T> ArangoCursor<T> |
query(String query,
AqlQueryOptions options,
Class<T> type)
Performs a database query using the given
query , then returns a new ArangoCursor instance for the
result list. |
<T> ArangoCursor<T> |
query(String query,
Class<T> type)
Performs a database query using the given
query , then returns a new ArangoCursor instance for the
result list. |
<T> ArangoCursor<T> |
query(String query,
Map<String,Object> bindVars,
AqlQueryOptions options,
Class<T> type)
Performs a database query using the given
query and bindVars , then returns a new
ArangoCursor instance for the result list. |
<T> ArangoCursor<T> |
query(String query,
Map<String,Object> bindVars,
Class<T> type)
Performs a database query using the given
query and bindVars , then returns a new
ArangoCursor instance for the result list. |
void |
reloadRouting()
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 user
user . |
SearchAlias |
searchAlias(String name)
Returns a
SearchAlias instance for the given view name. |
QueryCachePropertiesEntity |
setQueryCacheProperties(QueryCachePropertiesEntity properties)
Changes the configuration for the AQL query cache.
|
QueryTrackingPropertiesEntity |
setQueryTrackingProperties(QueryTrackingPropertiesEntity properties)
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.
|
ArangoView |
view(String name)
Returns a
ArangoView instance for the given view name. |
getSerde
ArangoDB arango()
DbName dbName()
ArangoDBVersion getVersion()
ArangoDBEngine getEngine()
boolean exists()
Collection<String> getAccessibleDatabases()
ArangoCollection collection(String name)
ArangoCollection
instance for the given collection name.name
- Name of the collectionCollectionEntity createCollection(String name)
name
- The name of the collectionCollectionEntity createCollection(String name, CollectionCreateOptions options)
options
for this collection's name, then returns collection
information from the server.name
- The name of the collectionoptions
- Additional options, can be nullCollection<CollectionEntity> getCollections()
Collection<CollectionEntity> getCollections(CollectionsReadOptions options)
options
- Additional options, can be nullIndexEntity getIndex(String id)
id
- The index-handleString deleteIndex(String id)
id
- The index-handleBoolean create()
Boolean drop()
void grantAccess(String user, Permissions permissions)
user
. You need permission to the _system database in
order to execute this call.user
- The name of the userpermissions
- The permissions the user grantvoid grantAccess(String user)
user
. You need permission to the _system database in order to
execute this call.user
- The name of the uservoid revokeAccess(String user)
user
. You need permission to the _system database in order
to execute this call.user
- The name of the uservoid resetAccess(String user)
user
- The name of the uservoid grantDefaultCollectionAccess(String user, Permissions permissions)
user
. You need permission
to the _system database in order to execute this call.user
- The name of the userpermissions
- The permissions the user grantPermissions getPermissions(String user)
user
- The name of the user<T> ArangoCursor<T> query(String query, Map<String,Object> bindVars, AqlQueryOptions options, Class<T> type)
query
and bindVars
, then returns a new
ArangoCursor
instance for the result list.query
- An AQL query stringbindVars
- key/value pairs defining the variables to bind the query tooptions
- Additional options that will be passed to the query API, can be nulltype
- The type of the result (POJO or RawData
)<T> ArangoCursor<T> query(String query, AqlQueryOptions options, Class<T> type)
query
, then returns a new ArangoCursor
instance for the
result list.query
- An AQL query stringoptions
- Additional options that will be passed to the query API, can be nulltype
- The type of the result (POJO or RawData
)<T> ArangoCursor<T> query(String query, Map<String,Object> bindVars, Class<T> type)
query
and bindVars
, then returns a new
ArangoCursor
instance for the result list.query
- An AQL query stringbindVars
- key/value pairs defining the variables to bind the query totype
- The type of the result (POJO or RawData
)<T> ArangoCursor<T> query(String query, Class<T> type)
query
, then returns a new ArangoCursor
instance for the
result list.query
- An AQL query stringtype
- The type of the result (POJO or RawData
)<T> ArangoCursor<T> cursor(String cursorId, Class<T> type)
cursorId
- The ID of the cursortype
- The type of the result (POJO or RawData
)AqlExecutionExplainEntity explainQuery(String query, Map<String,Object> bindVars, AqlQueryExplainOptions options)
query
- the query which you want explainedbindVars
- key/value pairs representing the bind parametersoptions
- Additional options, can be nullAqlParseEntity parseQuery(String query)
query(String, Map, AqlQueryOptions, Class)
query
- the query which you want parsevoid clearQueryCache()
QueryCachePropertiesEntity getQueryCacheProperties()
QueryCachePropertiesEntity setQueryCacheProperties(QueryCachePropertiesEntity properties)
properties
- properties to be setQueryTrackingPropertiesEntity getQueryTrackingProperties()
QueryTrackingPropertiesEntity setQueryTrackingProperties(QueryTrackingPropertiesEntity properties)
properties
- properties to be setCollection<QueryEntity> getCurrentlyRunningQueries()
Collection<QueryEntity> getSlowQueries()
void clearSlowQueries()
void killQuery(String id)
id
- The id of the queryvoid createAqlFunction(String name, String code, AqlFunctionCreateOptions options)
name
- A valid AQL function name, e.g.: `"myfuncs::accounting::calculate_vat"`code
- A String evaluating to a JavaScript functionoptions
- Additional options, can be nullInteger deleteAqlFunction(String name, AqlFunctionDeleteOptions options)
name
- The name of the user function to deleteoptions
- Additional options, can be nullCollection<AqlFunctionEntity> getAqlFunctions(AqlFunctionGetOptions options)
options
- Additional options, can be nullArangoGraph graph(String name)
ArangoGraph
instance for the given graph name.name
- Name of the graphGraphEntity createGraph(String name, Collection<EdgeDefinition> edgeDefinitions)
name
- Name of the graphedgeDefinitions
- An array of definitions for the edgeGraphEntity createGraph(String name, Collection<EdgeDefinition> edgeDefinitions, GraphCreateOptions options)
name
- Name of the graphedgeDefinitions
- An array of definitions for the edgeoptions
- Additional options, can be nullCollection<GraphEntity> getGraphs()
<T> T transaction(String action, Class<T> type, TransactionOptions options)
action
- A String evaluating to a JavaScript function to be executed on the server.type
- The type of the result (POJO or RawData
)options
- Additional options, can be nullStreamTransactionEntity beginStreamTransaction(StreamTransactionOptions options)
options
- Additional options, can be nullStreamTransactionEntity abortStreamTransaction(String id)
StreamTransactionEntity getStreamTransaction(String id)
Collection<TransactionEntity> getStreamTransactions()
StreamTransactionEntity commitStreamTransaction(String id)
DatabaseEntity getInfo()
<T> T getDocument(String id, Class<T> type)
id
- The id of the documenttype
- The type of the document (POJO or RawData
)<T> T getDocument(String id, Class<T> type, DocumentReadOptions options)
id
- The id of the documenttype
- The type of the document (POJO or RawData
)options
- Additional options, can be nullvoid reloadRouting()
Collection<ViewEntity> getViews()
ArangoView view(String name)
ArangoView
instance for the given view name.name
- Name of the viewArangoSearch arangoSearch(String name)
ArangoSearch
instance for the given view name.name
- Name of the viewSearchAlias searchAlias(String name)
SearchAlias
instance for the given view name.name
- Name of the viewViewEntity createView(String name, ViewType type)
type
, then returns view information from the server.name
- The name of the viewtype
- The type of the viewViewEntity createArangoSearch(String name, ArangoSearchCreateOptions options)
options
, then returns view information from the server.name
- The name of the viewoptions
- Additional options, can be nullViewEntity createSearchAlias(String name, SearchAliasCreateOptions options)
options
, then returns view information from the server.name
- The name of the viewoptions
- Additional options, can be nullSearchAnalyzer createSearchAnalyzer(SearchAnalyzer analyzer)
analyzer
- SearchAnalyzerSearchAnalyzer getSearchAnalyzer(String name)
name
- of the Analyzer without database prefixCollection<SearchAnalyzer> getSearchAnalyzers()
void deleteSearchAnalyzer(String name)
name
- of the Analyzer without database prefixvoid deleteSearchAnalyzer(String name, AnalyzerDeleteOptions options)
name
- of the Analyzer without database prefixoptions
- AnalyzerDeleteOptionsCopyright © 2016–2023 ArangoDB GmbH. All rights reserved.