public class ArangoDatabaseImpl extends InternalArangoDatabase<ArangoDBImpl,ArangoExecutorSync> implements ArangoDatabase
PATH_API_DATABASE
executor, serde
Modifier | Constructor and Description |
---|---|
protected |
ArangoDatabaseImpl(ArangoDBImpl arangoDB,
DbName name) |
Modifier and Type | Method and Description |
---|---|
StreamTransactionEntity |
abortStreamTransaction(String id)
Aborts a Stream Transaction.
|
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
|
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. |
abortStreamTransactionRequest, arango, beginStreamTransactionRequest, clearQueryCacheRequest, clearSlowQueriesRequest, commitStreamTransactionRequest, createAnalyzerRequest, createAqlFunctionRequest, createArangoSearchRequest, createCollectionRequest, createDropResponseDeserializer, createGraphRequest, createGraphResponseDeserializer, createSearchAliasRequest, createViewRequest, dbName, deleteAnalyzerRequest, deleteAqlFunctionRequest, deleteAqlFunctionResponseDeserializer, dropRequest, explainQueryRequest, getAccessibleDatabasesRequest, getAnalyzerRequest, getAnalyzersRequest, getAqlFunctionsRequest, getAqlFunctionsResponseDeserializer, getCollectionsRequest, getCollectionsResponseDeserializer, getCurrentlyRunningQueriesRequest, getDatabaseResponseDeserializer, getEngineRequest, getGraphsRequest, getGraphsResponseDeserializer, getInfoRequest, getInfoResponseDeserializer, getPermissionsRequest, getPermissionsResponseDeserialzer, getQueryCachePropertiesRequest, getQueryTrackingPropertiesRequest, getSearchAnalyzersResponseDeserializer, getSlowQueriesRequest, getStreamTransactionRequest, getStreamTransactionsRequest, getVersionRequest, getViewsRequest, getViewsResponseDeserializer, grantAccessRequest, killQueryRequest, parseQueryRequest, queryCloseRequest, queryNextRequest, queryRequest, reloadRoutingRequest, resetAccessRequest, setQueryCachePropertiesRequest, setQueryTrackingPropertiesRequest, streamTransactionResponseDeserializer, transactionRequest, transactionResponseDeserializer, transactionsResponseDeserializer, updateUserDefaultCollectionAccessRequest
createPath, executor, getSerde, request
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
arango, dbName
getSerde
protected ArangoDatabaseImpl(ArangoDBImpl arangoDB, DbName name)
public ArangoDBVersion getVersion()
ArangoDatabase
getVersion
in interface ArangoDatabase
public ArangoDBEngine getEngine()
ArangoDatabase
getEngine
in interface ArangoDatabase
public boolean exists()
ArangoDatabase
exists
in interface ArangoDatabase
public Collection<String> getAccessibleDatabases()
ArangoDatabase
getAccessibleDatabases
in interface ArangoDatabase
public ArangoCollection collection(String name)
ArangoDatabase
ArangoCollection
instance for the given collection name.collection
in interface ArangoDatabase
name
- Name of the collectionpublic CollectionEntity createCollection(String name)
ArangoDatabase
createCollection
in interface ArangoDatabase
name
- The name of the collectionpublic CollectionEntity createCollection(String name, CollectionCreateOptions options)
ArangoDatabase
options
for this collection's name, then returns collection
information from the server.createCollection
in interface ArangoDatabase
name
- The name of the collectionoptions
- Additional options, can be nullpublic Collection<CollectionEntity> getCollections()
ArangoDatabase
getCollections
in interface ArangoDatabase
public Collection<CollectionEntity> getCollections(CollectionsReadOptions options)
ArangoDatabase
getCollections
in interface ArangoDatabase
options
- Additional options, can be nullpublic IndexEntity getIndex(String id)
ArangoDatabase
getIndex
in interface ArangoDatabase
id
- The index-handlepublic String deleteIndex(String id)
ArangoDatabase
deleteIndex
in interface ArangoDatabase
id
- The index-handlepublic Boolean create()
ArangoDatabase
create
in interface ArangoDatabase
public Boolean drop()
ArangoDatabase
drop
in interface ArangoDatabase
public void grantAccess(String user, Permissions permissions)
ArangoDatabase
user
. You need permission to the _system database in
order to execute this call.grantAccess
in interface ArangoDatabase
user
- The name of the userpermissions
- The permissions the user grantpublic void grantAccess(String user)
ArangoDatabase
user
. You need permission to the _system database in order to
execute this call.grantAccess
in interface ArangoDatabase
user
- The name of the userpublic void revokeAccess(String user)
ArangoDatabase
user
. You need permission to the _system database in order
to execute this call.revokeAccess
in interface ArangoDatabase
user
- The name of the userpublic void resetAccess(String user)
ArangoDatabase
resetAccess
in interface ArangoDatabase
user
- The name of the userpublic void grantDefaultCollectionAccess(String user, Permissions permissions)
ArangoDatabase
user
. You need permission
to the _system database in order to execute this call.grantDefaultCollectionAccess
in interface ArangoDatabase
user
- The name of the userpermissions
- The permissions the user grantpublic Permissions getPermissions(String user)
ArangoDatabase
getPermissions
in interface ArangoDatabase
user
- The name of the userpublic <T> ArangoCursor<T> query(String query, Map<String,Object> bindVars, AqlQueryOptions options, Class<T> type)
ArangoDatabase
query
and bindVars
, then returns a new
ArangoCursor
instance for the result list.query
in interface ArangoDatabase
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
)public <T> ArangoCursor<T> query(String query, Map<String,Object> bindVars, Class<T> type)
ArangoDatabase
query
and bindVars
, then returns a new
ArangoCursor
instance for the result list.query
in interface ArangoDatabase
query
- An AQL query stringbindVars
- key/value pairs defining the variables to bind the query totype
- The type of the result (POJO or RawData
)public <T> ArangoCursor<T> query(String query, AqlQueryOptions options, Class<T> type)
ArangoDatabase
query
, then returns a new ArangoCursor
instance for the
result list.query
in interface ArangoDatabase
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
)public <T> ArangoCursor<T> query(String query, Class<T> type)
ArangoDatabase
query
, then returns a new ArangoCursor
instance for the
result list.query
in interface ArangoDatabase
query
- An AQL query stringtype
- The type of the result (POJO or RawData
)public <T> ArangoCursor<T> cursor(String cursorId, Class<T> type)
ArangoDatabase
cursor
in interface ArangoDatabase
cursorId
- The ID of the cursortype
- The type of the result (POJO or RawData
)public AqlExecutionExplainEntity explainQuery(String query, Map<String,Object> bindVars, AqlQueryExplainOptions options)
ArangoDatabase
explainQuery
in interface ArangoDatabase
query
- the query which you want explainedbindVars
- key/value pairs representing the bind parametersoptions
- Additional options, can be nullpublic AqlParseEntity parseQuery(String query)
ArangoDatabase
ArangoDatabase.query(String, Map, AqlQueryOptions, Class)
parseQuery
in interface ArangoDatabase
query
- the query which you want parsepublic void clearQueryCache()
ArangoDatabase
clearQueryCache
in interface ArangoDatabase
public QueryCachePropertiesEntity getQueryCacheProperties()
ArangoDatabase
getQueryCacheProperties
in interface ArangoDatabase
public QueryCachePropertiesEntity setQueryCacheProperties(QueryCachePropertiesEntity properties)
ArangoDatabase
setQueryCacheProperties
in interface ArangoDatabase
properties
- properties to be setpublic QueryTrackingPropertiesEntity getQueryTrackingProperties()
ArangoDatabase
getQueryTrackingProperties
in interface ArangoDatabase
public QueryTrackingPropertiesEntity setQueryTrackingProperties(QueryTrackingPropertiesEntity properties)
ArangoDatabase
setQueryTrackingProperties
in interface ArangoDatabase
properties
- properties to be setpublic Collection<QueryEntity> getCurrentlyRunningQueries()
ArangoDatabase
getCurrentlyRunningQueries
in interface ArangoDatabase
public Collection<QueryEntity> getSlowQueries()
ArangoDatabase
getSlowQueries
in interface ArangoDatabase
public void clearSlowQueries()
ArangoDatabase
clearSlowQueries
in interface ArangoDatabase
public void killQuery(String id)
ArangoDatabase
killQuery
in interface ArangoDatabase
id
- The id of the querypublic void createAqlFunction(String name, String code, AqlFunctionCreateOptions options)
ArangoDatabase
createAqlFunction
in interface ArangoDatabase
name
- A valid AQL function name, e.g.: `"myfuncs::accounting::calculate_vat"`code
- A String evaluating to a JavaScript functionoptions
- Additional options, can be nullpublic Integer deleteAqlFunction(String name, AqlFunctionDeleteOptions options)
ArangoDatabase
deleteAqlFunction
in interface ArangoDatabase
name
- The name of the user function to deleteoptions
- Additional options, can be nullpublic Collection<AqlFunctionEntity> getAqlFunctions(AqlFunctionGetOptions options)
ArangoDatabase
getAqlFunctions
in interface ArangoDatabase
options
- Additional options, can be nullpublic ArangoGraph graph(String name)
ArangoDatabase
ArangoGraph
instance for the given graph name.graph
in interface ArangoDatabase
name
- Name of the graphpublic GraphEntity createGraph(String name, Collection<EdgeDefinition> edgeDefinitions)
ArangoDatabase
createGraph
in interface ArangoDatabase
name
- Name of the graphedgeDefinitions
- An array of definitions for the edgepublic GraphEntity createGraph(String name, Collection<EdgeDefinition> edgeDefinitions, GraphCreateOptions options)
ArangoDatabase
createGraph
in interface ArangoDatabase
name
- Name of the graphedgeDefinitions
- An array of definitions for the edgeoptions
- Additional options, can be nullpublic Collection<GraphEntity> getGraphs()
ArangoDatabase
getGraphs
in interface ArangoDatabase
public <T> T transaction(String action, Class<T> type, TransactionOptions options)
ArangoDatabase
transaction
in interface ArangoDatabase
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 nullpublic StreamTransactionEntity beginStreamTransaction(StreamTransactionOptions options)
ArangoDatabase
beginStreamTransaction
in interface ArangoDatabase
options
- Additional options, can be nullpublic StreamTransactionEntity abortStreamTransaction(String id)
ArangoDatabase
abortStreamTransaction
in interface ArangoDatabase
public StreamTransactionEntity getStreamTransaction(String id)
ArangoDatabase
getStreamTransaction
in interface ArangoDatabase
public Collection<TransactionEntity> getStreamTransactions()
ArangoDatabase
getStreamTransactions
in interface ArangoDatabase
public StreamTransactionEntity commitStreamTransaction(String id)
ArangoDatabase
commitStreamTransaction
in interface ArangoDatabase
public DatabaseEntity getInfo()
ArangoDatabase
getInfo
in interface ArangoDatabase
public <T> T getDocument(String id, Class<T> type)
ArangoDatabase
getDocument
in interface ArangoDatabase
id
- The id of the documenttype
- The type of the document (POJO or RawData
)public <T> T getDocument(String id, Class<T> type, DocumentReadOptions options)
ArangoDatabase
getDocument
in interface ArangoDatabase
id
- The id of the documenttype
- The type of the document (POJO or RawData
)options
- Additional options, can be nullpublic void reloadRouting()
ArangoDatabase
reloadRouting
in interface ArangoDatabase
public Collection<ViewEntity> getViews()
ArangoDatabase
getViews
in interface ArangoDatabase
public ArangoView view(String name)
ArangoDatabase
ArangoView
instance for the given view name.view
in interface ArangoDatabase
name
- Name of the viewpublic ArangoSearch arangoSearch(String name)
ArangoDatabase
ArangoSearch
instance for the given view name.arangoSearch
in interface ArangoDatabase
name
- Name of the viewpublic SearchAlias searchAlias(String name)
ArangoDatabase
SearchAlias
instance for the given view name.searchAlias
in interface ArangoDatabase
name
- Name of the viewpublic ViewEntity createView(String name, ViewType type)
ArangoDatabase
type
, then returns view information from the server.createView
in interface ArangoDatabase
name
- The name of the viewtype
- The type of the viewpublic ViewEntity createArangoSearch(String name, ArangoSearchCreateOptions options)
ArangoDatabase
options
, then returns view information from the server.createArangoSearch
in interface ArangoDatabase
name
- The name of the viewoptions
- Additional options, can be nullpublic ViewEntity createSearchAlias(String name, SearchAliasCreateOptions options)
ArangoDatabase
options
, then returns view information from the server.createSearchAlias
in interface ArangoDatabase
name
- The name of the viewoptions
- Additional options, can be nullpublic SearchAnalyzer createSearchAnalyzer(SearchAnalyzer analyzer)
ArangoDatabase
createSearchAnalyzer
in interface ArangoDatabase
analyzer
- SearchAnalyzerpublic SearchAnalyzer getSearchAnalyzer(String name)
ArangoDatabase
getSearchAnalyzer
in interface ArangoDatabase
name
- of the Analyzer without database prefixpublic Collection<SearchAnalyzer> getSearchAnalyzers()
ArangoDatabase
getSearchAnalyzers
in interface ArangoDatabase
public void deleteSearchAnalyzer(String name)
ArangoDatabase
deleteSearchAnalyzer
in interface ArangoDatabase
name
- of the Analyzer without database prefixpublic void deleteSearchAnalyzer(String name, AnalyzerDeleteOptions options)
ArangoDatabase
deleteSearchAnalyzer
in interface ArangoDatabase
name
- of the Analyzer without database prefixoptions
- AnalyzerDeleteOptionsCopyright © 2016–2023 ArangoDB GmbH. All rights reserved.