public class ArangoDatabase extends InternalArangoDatabase<ArangoDB,ArangoExecutorSync,Response,ConnectionSync>
executor| Modifier | Constructor and Description |
|---|---|
protected |
ArangoDatabase(ArangoDB arangoDB,
String name) |
protected |
ArangoDatabase(CommunicationProtocol protocol,
ArangoSerialization util,
DocumentCache documentCache,
String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearQueryCache()
Clears the AQL query cache
|
void |
clearSlowQueries()
Clears the list of slow AQL queries
|
ArangoCollection |
collection(String name)
Returns a handler of the collection by the given name
|
void |
createAqlFunction(String name,
String code,
AqlFunctionCreateOptions options)
Create a new AQL user function
|
CollectionEntity |
createCollection(String name)
Creates a collection
|
CollectionEntity |
createCollection(String name,
CollectionCreateOptions options)
Creates a collection
|
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.
|
<T> ArangoCursor<T> |
cursor(String cursorId,
Class<T> type)
Return an cursor from the given cursor-ID if still existing
|
void |
deleteAqlFunction(String name,
AqlFunctionDeleteOptions options)
Remove an existing AQL user function
|
String |
deleteIndex(String id)
Deletes an index
|
Boolean |
drop()
Drop an existing database
|
<V,E> TraversalEntity<V,E> |
executeTraversal(Class<V> vertexClass,
Class<E> edgeClass,
TraversalOptions options)
Execute a server-side traversal
|
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()
Returns all collections
|
Collection<CollectionEntity> |
getCollections(CollectionsReadOptions options)
Returns all collections
|
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
|
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
|
Collection<QueryEntity> |
getSlowQueries()
Returns a list of slow running AQL queries
|
ArangoDBVersion |
getVersion()
Returns the server name and version number.
|
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 handler of the graph by the given 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,
Map<String,Object> bindVars,
AqlQueryOptions options,
Class<T> type)
Create a cursor and return the first results
|
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. |
protected ArangoDatabase |
setCursorInitializer(ArangoCursorInitializer cursorInitializer) |
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)
Execute a server-side transaction
|
void |
updateUserDefaultCollectionAccess(String user,
Permissions permissions)
Deprecated.
|
arango, clearQueryCacheRequest, clearSlowQueriesRequest, createAqlFunctionRequest, createCollectionRequest, createDropResponseDeserializer, createGraphRequest, createGraphResponseDeserializer, deleteAqlFunctionRequest, deserializeEdges, deserializeVertices, dropRequest, executeTraversalRequest, executeTraversalResponseDeserializer, explainQueryRequest, getAccessibleDatabasesRequest, getAqlFunctionsRequest, getCollectionsRequest, getCollectionsResponseDeserializer, getCurrentlyRunningQueriesRequest, getDatabaseResponseDeserializer, getGraphsRequest, getGraphsResponseDeserializer, getInfoRequest, getInfoResponseDeserializer, getPermissionsRequest, getPermissionsResponseDeserialzer, getQueryCachePropertiesRequest, getQueryTrackingPropertiesRequest, getSlowQueriesRequest, getVersionRequest, grantAccessRequest, killQueryRequest, name, parseQueryRequest, queryCloseRequest, queryNextRequest, queryRequest, reloadRoutingRequest, resetAccessRequest, setQueryCachePropertiesRequest, setQueryTrackingPropertiesRequest, transactionRequest, transactionResponseDeserializer, updateUserDefaultCollectionAccessRequestexecutor, utilprotected ArangoDatabase(CommunicationProtocol protocol, ArangoSerialization util, DocumentCache documentCache, String name)
public ArangoDBVersion getVersion() throws ArangoDBException
ArangoDBExceptionpublic boolean exists()
throws ArangoDBException
ArangoDBExceptionpublic Collection<String> getAccessibleDatabases() throws ArangoDBException
ArangoDBExceptionpublic ArangoCollection collection(String name)
name - Name of the collectionpublic CollectionEntity createCollection(String name) throws ArangoDBException
name - The name of the collectionArangoDBExceptionpublic CollectionEntity createCollection(String name, CollectionCreateOptions options) throws ArangoDBException
name - The name of the collectionoptions - Additional options, can be nullArangoDBExceptionpublic Collection<CollectionEntity> getCollections() throws ArangoDBException
ArangoDBExceptionpublic Collection<CollectionEntity> getCollections(CollectionsReadOptions options) throws ArangoDBException
options - Additional options, can be nullArangoDBExceptionpublic IndexEntity getIndex(String id) throws ArangoDBException
id - The index-handleArangoDBExceptionpublic String deleteIndex(String id) throws ArangoDBException
id - The index-handleArangoDBExceptionpublic Boolean drop() throws ArangoDBException
ArangoDBExceptionpublic void 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 grantArangoDBExceptionpublic void grantAccess(String user) throws ArangoDBException
user. You need permission to the _system database in order to
execute this call.user - The name of the userArangoDBExceptionpublic void revokeAccess(String user) throws ArangoDBException
user. You need permission to the _system database in
order to execute this call.user - The name of the userArangoDBExceptionpublic void resetAccess(String user) throws ArangoDBException
user - The name of the userArangoDBExceptionpublic void 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 grantArangoDBException@Deprecated public void updateUserDefaultCollectionAccess(String user, Permissions permissions) throws ArangoDBException
grantDefaultCollectionAccess(String, Permissions) insteaduser - The name of the userpermissions - The permissions the user grantArangoDBExceptionpublic Permissions getPermissions(String user) throws ArangoDBException
user - The name of the userArangoDBExceptionpublic <T> ArangoCursor<T> query(String query, Map<String,Object> bindVars, AqlQueryOptions options, Class<T> type) throws ArangoDBException
query - contains the query string to be executedbindVars - key/value pairs representing the bind parametersoptions - Additional options, can be nulltype - The type of the result (POJO class, VPackSlice, String for Json, or Collection/List/Map)ArangoDBExceptionpublic <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)ArangoDBExceptionpublic 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 nullArangoDBExceptionpublic AqlParseEntity parseQuery(String query) throws ArangoDBException
query(String, Map, AqlQueryOptions, Class)query - the query which you want parseArangoDBExceptionpublic void clearQueryCache()
throws ArangoDBException
ArangoDBExceptionpublic QueryCachePropertiesEntity getQueryCacheProperties() throws ArangoDBException
ArangoDBExceptionpublic QueryCachePropertiesEntity setQueryCacheProperties(QueryCachePropertiesEntity properties) throws ArangoDBException
properties - properties to be setArangoDBExceptionpublic QueryTrackingPropertiesEntity getQueryTrackingProperties() throws ArangoDBException
ArangoDBExceptionpublic QueryTrackingPropertiesEntity setQueryTrackingProperties(QueryTrackingPropertiesEntity properties) throws ArangoDBException
properties - properties to be setArangoDBExceptionpublic Collection<QueryEntity> getCurrentlyRunningQueries() throws ArangoDBException
ArangoDBExceptionpublic Collection<QueryEntity> getSlowQueries() throws ArangoDBException
ArangoDBExceptionpublic void clearSlowQueries()
throws ArangoDBException
ArangoDBExceptionpublic void killQuery(String id) throws ArangoDBException
id - The id of the queryArangoDBExceptionpublic void createAqlFunction(String name, String code, AqlFunctionCreateOptions options) throws ArangoDBException
name - the fully qualified name of the user functionscode - a string representation of the function bodyoptions - Additional options, can be nullArangoDBExceptionpublic void deleteAqlFunction(String name, AqlFunctionDeleteOptions options) throws ArangoDBException
name - the name of the AQL user functionoptions - Additional options, can be nullArangoDBExceptionpublic Collection<AqlFunctionEntity> getAqlFunctions(AqlFunctionGetOptions options) throws ArangoDBException
options - Additional options, can be nullArangoDBExceptionpublic ArangoGraph graph(String name)
name - Name of the graphpublic GraphEntity createGraph(String name, Collection<EdgeDefinition> edgeDefinitions) throws ArangoDBException
name - Name of the graphedgeDefinitions - An array of definitions for the edgeArangoDBExceptionpublic GraphEntity 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 nullArangoDBExceptionpublic Collection<GraphEntity> getGraphs() throws ArangoDBException
ArangoDBExceptionpublic <T> T transaction(String action, Class<T> type, TransactionOptions options) throws ArangoDBException
action - the actual transaction operations to be executed, in the form of stringified JavaScript codetype - The type of the result (POJO class, VPackSlice or String for Json)options - Additional options, can be nullArangoDBExceptionpublic DatabaseEntity getInfo() throws ArangoDBException
ArangoDBExceptionpublic <V,E> TraversalEntity<V,E> executeTraversal(Class<V> vertexClass, Class<E> edgeClass, TraversalOptions options) throws ArangoDBException
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 optionsArangoDBExceptionpublic <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)ArangoDBExceptionpublic <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 nullArangoDBExceptionpublic void reloadRouting()
throws ArangoDBException
ArangoDBExceptionprotected ArangoDatabase setCursorInitializer(ArangoCursorInitializer cursorInitializer)
Copyright © 2016–2017 ArangoDB GmbH. All rights reserved.