@ThreadSafe public interface ArangoDatabase extends ArangoSerializationAccessor
| 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
|
AnalyzerEntity |
createAnalyzer(AnalyzerEntity options)
Deprecated.
use
this#createSearchAnalyzer(SearchAnalyzer)} |
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
|
<T> ArangoCursor<T> |
cursor(String cursorId,
Class<T> type,
String nextBatchId)
Return an cursor from the given cursor-ID if still existing
|
DbName |
dbName()
Deprecated.
Use
name() instead |
void |
deleteAnalyzer(String name)
Deprecated.
use
this#deleteSearchAnalyzer(String)}} |
void |
deleteAnalyzer(String name,
AnalyzerDeleteOptions options)
Deprecated.
use
this#deleteSearchAnalyzer(String, AnalyzerDeleteOptions)}} |
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.
|
<V,E> TraversalEntity<V,E> |
executeTraversal(Class<V> vertexClass,
Class<E> edgeClass,
TraversalOptions options)
Deprecated.
use
this#query(String, Map, AqlQueryOptions, Class) |
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
|
AnalyzerEntity |
getAnalyzer(String name)
Deprecated.
use
this#getSearchAnalyzer(String)} |
Collection<AnalyzerEntity> |
getAnalyzers()
Deprecated.
use
this#getSearchAnalyzers() |
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.
|
default String |
name()
Returns the name of the database
|
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. |
ArangoRoute |
route(String... path)
Returns a new
ArangoRoute instance for the given path (relative to the database) that can be used to
perform arbitrary requests. |
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. |
util, utilArangoDB arango()
default String name()
@Deprecated DbName dbName()
name() insteadArangoDBVersion getVersion() throws ArangoDBException
ArangoDBExceptionArangoDBEngine getEngine() throws ArangoDBException
ArangoDBExceptionboolean exists()
throws ArangoDBException
ArangoDBExceptionCollection<String> getAccessibleDatabases() throws ArangoDBException
ArangoDBExceptionArangoCollection collection(String name)
ArangoCollection instance for the given collection name.name - Name of the collectionCollectionEntity createCollection(String name) throws ArangoDBException
name - The name of the collectionArangoDBExceptionCollectionEntity createCollection(String name, CollectionCreateOptions options) throws ArangoDBException
options for this collection's name, then returns collection
information from the server.name - The name of the collectionoptions - Additional options, can be nullArangoDBExceptionCollection<CollectionEntity> getCollections() throws ArangoDBException
ArangoDBExceptionCollection<CollectionEntity> getCollections(CollectionsReadOptions options) throws ArangoDBException
options - Additional options, can be nullArangoDBExceptionIndexEntity getIndex(String id) throws ArangoDBException
id - The index-handleArangoDBExceptionString deleteIndex(String id) throws ArangoDBException
id - The index-handleArangoDBExceptionBoolean create() throws ArangoDBException
ArangoDBExceptionBoolean drop() throws ArangoDBException
ArangoDBExceptionvoid grantAccess(String user, Permissions permissions) throws ArangoDBException
user. You need permission to the _system database in
order to execute this call.user - The name of the userpermissions - The permissions the user grantArangoDBExceptionvoid grantAccess(String user) throws ArangoDBException
user. You need permission to the _system database in order to
execute this call.user - The name of the userArangoDBExceptionvoid revokeAccess(String user) throws ArangoDBException
user. You need permission to the _system database in order
to execute this call.user - The name of the userArangoDBExceptionvoid resetAccess(String user) throws ArangoDBException
user - The name of the userArangoDBExceptionvoid grantDefaultCollectionAccess(String user, Permissions permissions) throws ArangoDBException
user. You need permission
to the _system database in order to execute this call.user - The name of the userpermissions - The permissions the user grantArangoDBExceptionPermissions getPermissions(String user) throws ArangoDBException
user - The name of the userArangoDBException<T> ArangoCursor<T> query(String query, Map<String,Object> bindVars, AqlQueryOptions options, Class<T> type) throws ArangoDBException
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 class, VPackSlice, String for JSON, or Collection/List/Map)ArangoDBException<T> ArangoCursor<T> query(String query, AqlQueryOptions options, Class<T> type) throws ArangoDBException
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 class, VPackSlice, String for JSON, or Collection/List/Map)ArangoDBException<T> ArangoCursor<T> query(String query, Map<String,Object> bindVars, Class<T> type) throws ArangoDBException
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 class, VPackSlice, String for JSON, or Collection/List/Map)ArangoDBException<T> ArangoCursor<T> query(String query, Class<T> type) throws ArangoDBException
query, then returns a new ArangoCursor instance for the
result list.query - An AQL query stringtype - The type of the result (POJO class, VPackSlice, String for JSON, or Collection/List/Map)ArangoDBException<T> ArangoCursor<T> cursor(String cursorId, Class<T> type) throws ArangoDBException
cursorId - The ID of the cursortype - The type of the result (POJO class, VPackSlice, String for JSON, or Collection/List/Map)ArangoDBException<T> ArangoCursor<T> cursor(String cursorId, Class<T> type, String nextBatchId)
cursorId - The ID of the cursortype - The type of the result (POJO class, VPackSlice, String for JSON, or Collection/List/Map)nextBatchId - The ID of the next cursor batch (set only if cursor allows retries, see
AqlQueryOptions.allowRetry(Boolean)AqlExecutionExplainEntity explainQuery(String query, Map<String,Object> bindVars, AqlQueryExplainOptions options) throws ArangoDBException
query - the query which you want explainedbindVars - key/value pairs representing the bind parametersoptions - Additional options, can be nullArangoDBExceptionAqlParseEntity parseQuery(String query) throws ArangoDBException
query(String, Map, AqlQueryOptions, Class)query - the query which you want parseArangoDBExceptionvoid clearQueryCache()
throws ArangoDBException
ArangoDBExceptionQueryCachePropertiesEntity getQueryCacheProperties() throws ArangoDBException
ArangoDBExceptionQueryCachePropertiesEntity setQueryCacheProperties(QueryCachePropertiesEntity properties) throws ArangoDBException
properties - properties to be setArangoDBExceptionQueryTrackingPropertiesEntity getQueryTrackingProperties() throws ArangoDBException
ArangoDBExceptionQueryTrackingPropertiesEntity setQueryTrackingProperties(QueryTrackingPropertiesEntity properties) throws ArangoDBException
properties - properties to be setArangoDBExceptionCollection<QueryEntity> getCurrentlyRunningQueries() throws ArangoDBException
ArangoDBExceptionCollection<QueryEntity> getSlowQueries() throws ArangoDBException
ArangoDBExceptionvoid clearSlowQueries()
throws ArangoDBException
ArangoDBExceptionvoid killQuery(String id) throws ArangoDBException
id - The id of the queryArangoDBExceptionvoid createAqlFunction(String name, String code, AqlFunctionCreateOptions options) throws ArangoDBException
name - A valid AQL function name, e.g.: `"myfuncs::accounting::calculate_vat"`code - A String evaluating to a JavaScript functionoptions - Additional options, can be nullArangoDBExceptionInteger deleteAqlFunction(String name, AqlFunctionDeleteOptions options) throws ArangoDBException
name - The name of the user function to deleteoptions - Additional options, can be nullArangoDBExceptionCollection<AqlFunctionEntity> getAqlFunctions(AqlFunctionGetOptions options) throws ArangoDBException
options - Additional options, can be nullArangoDBExceptionArangoGraph graph(String name)
ArangoGraph instance for the given graph name.name - Name of the graphGraphEntity createGraph(String name, Collection<EdgeDefinition> edgeDefinitions) throws ArangoDBException
name - Name of the graphedgeDefinitions - An array of definitions for the edgeArangoDBExceptionGraphEntity createGraph(String name, Collection<EdgeDefinition> edgeDefinitions, GraphCreateOptions options) throws ArangoDBException
name - Name of the graphedgeDefinitions - An array of definitions for the edgeoptions - Additional options, can be nullArangoDBExceptionCollection<GraphEntity> getGraphs() throws ArangoDBException
ArangoDBException<T> T transaction(String action, Class<T> type, TransactionOptions options) throws ArangoDBException
action - A String evaluating to a JavaScript function to be executed on the server.type - The type of the result (POJO class, VPackSlice or String for JSON)options - Additional options, can be nullArangoDBExceptionStreamTransactionEntity beginStreamTransaction(StreamTransactionOptions options) throws ArangoDBException
options - Additional options, can be nullArangoDBExceptionStreamTransactionEntity abortStreamTransaction(String id) throws ArangoDBException
ArangoDBExceptionStreamTransactionEntity getStreamTransaction(String id) throws ArangoDBException
ArangoDBExceptionCollection<TransactionEntity> getStreamTransactions() throws ArangoDBException
ArangoDBExceptionStreamTransactionEntity commitStreamTransaction(String id) throws ArangoDBException
ArangoDBExceptionDatabaseEntity getInfo() throws ArangoDBException
ArangoDBException@Deprecated <V,E> TraversalEntity<V,E> executeTraversal(Class<V> vertexClass, Class<E> edgeClass, TraversalOptions options) throws ArangoDBException
this#query(String, Map, AqlQueryOptions, Class)vertexClass - The type of the vertex documents (POJO class, VPackSlice or String for JSON)edgeClass - The type of the edge documents (POJO class, VPackSlice or String for JSON)options - Additional optionsArangoDBException<T> T getDocument(String id, Class<T> type) throws ArangoDBException
id - The id of the documenttype - The type of the document (POJO class, VPackSlice or String for JSON)ArangoDBException<T> T getDocument(String id, Class<T> type, DocumentReadOptions options) throws ArangoDBException
id - The id of the documenttype - The type of the document (POJO class, VPackSlice or String for JSON)options - Additional options, can be nullArangoDBExceptionvoid reloadRouting()
throws ArangoDBException
ArangoDBExceptionArangoRoute route(String... path)
ArangoRoute instance for the given path (relative to the database) that can be used to
perform arbitrary requests.path - The database-relative URL of the routeArangoRouteCollection<ViewEntity> getViews() throws ArangoDBException
ArangoDBExceptionArangoView 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) throws ArangoDBException
type, then returns view information from the server.name - The name of the viewtype - The type of the viewArangoDBExceptionViewEntity createArangoSearch(String name, ArangoSearchCreateOptions options) throws ArangoDBException
options, then returns view information from the server.name - The name of the viewoptions - Additional options, can be nullArangoDBExceptionViewEntity createSearchAlias(String name, SearchAliasCreateOptions options) throws ArangoDBException
options, then returns view information from the server.name - The name of the viewoptions - Additional options, can be nullArangoDBException@Deprecated AnalyzerEntity createAnalyzer(AnalyzerEntity options) throws ArangoDBException
this#createSearchAnalyzer(SearchAnalyzer)}options - AnalyzerEntityArangoDBExceptionSearchAnalyzer createSearchAnalyzer(SearchAnalyzer analyzer) throws ArangoDBException
analyzer - SearchAnalyzerArangoDBException@Deprecated AnalyzerEntity getAnalyzer(String name) throws ArangoDBException
this#getSearchAnalyzer(String)}name - of the Analyzer without database prefixArangoDBExceptionSearchAnalyzer getSearchAnalyzer(String name) throws ArangoDBException
name - of the Analyzer without database prefixArangoDBException@Deprecated Collection<AnalyzerEntity> getAnalyzers() throws ArangoDBException
this#getSearchAnalyzers()ArangoDBExceptionCollection<SearchAnalyzer> getSearchAnalyzers() throws ArangoDBException
ArangoDBException@Deprecated void deleteAnalyzer(String name) throws ArangoDBException
this#deleteSearchAnalyzer(String)}}name - of the Analyzer without database prefixArangoDBException@Deprecated void deleteAnalyzer(String name, AnalyzerDeleteOptions options) throws ArangoDBException
this#deleteSearchAnalyzer(String, AnalyzerDeleteOptions)}}name - of the Analyzer without database prefixoptions - AnalyzerDeleteOptionsArangoDBExceptionvoid deleteSearchAnalyzer(String name) throws ArangoDBException
name - of the Analyzer without database prefixArangoDBExceptionvoid deleteSearchAnalyzer(String name, AnalyzerDeleteOptions options) throws ArangoDBException
name - of the Analyzer without database prefixoptions - AnalyzerDeleteOptionsArangoDBExceptionCopyright © 2016–2023 ArangoDB GmbH. All rights reserved.