Package com.c8db.internal
Class C8DatabaseImpl
- java.lang.Object
-
- com.c8db.internal.C8Executeable<E>
-
- com.c8db.internal.InternalC8Database<C8DBImpl,C8ExecutorSync>
-
- com.c8db.internal.C8DatabaseImpl
-
- All Implemented Interfaces:
C8Database,C8SerializationAccessor
public class C8DatabaseImpl extends InternalC8Database<C8DBImpl,C8ExecutorSync> implements C8Database
-
-
Field Summary
-
Fields inherited from class com.c8db.internal.InternalC8Database
PATH_API_CURSOR, PATH_API_DATABASE, PATH_API_DCLIST, PATH_API_EXPLAIN, PATH_API_PERSISTENT, PATH_API_QUERY, PATH_API_QUERY_CURRENT, PATH_API_QUERY_PROPERTIES, PATH_API_QUERY_SLOW, PATH_API_STREAM, PATH_API_STREAMS, PATH_API_TENANT, PATH_API_TRANSACTION, PATH_API_USER, PATH_API_USER_QUERIES, PATH_API_VERSION
-
Fields inherited from class com.c8db.internal.C8Executeable
context, executor, util
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StreamTransactionEntityabortStreamTransaction(String id)Aborts a Stream Transaction.C8Adminadmin()Returns aC8Admininstance.C8ApiKeysapiKeys()Returns aC8ApiKeysinstance.StreamTransactionEntitybeginStreamTransaction(StreamTransactionOptions options)Begins a Stream Transaction.voidclearBacklog()Clear backlog for all streams on a stream db.voidclearBacklog(String subscriptionName)Clear backlog for given subscription.voidclearSlowQueries()Clears the list of slow AQL queriesC8Collectioncollection(String name)Returns aArangoCollectioninstance for the given collection name.StreamTransactionEntitycommitStreamTransaction(String id)Commits a Stream Transaction.Booleancreate()Creates the databaseBooleancreate(String geoFabric)Create a geofabric/db in Demo tenantCollectionEntitycreateCollection(String name)Creates a collection for the given collection's name, then returns collection information from the server.CollectionEntitycreateCollection(String name, CollectionCreateOptions options)Creates a collection with the givenoptionsfor this collection's name, then returns collection information from the server.GraphEntitycreateGraph(String name, Collection<EdgeDefinition> edgeDefinitions)Create a new graph in the graph module.GraphEntitycreateGraph(String name, Collection<EdgeDefinition> edgeDefinitions, GraphCreateOptions options)Create a new graph in the graph module.voidcreatePersistentStream(String name, C8StreamCreateOptions options)Create asynchronously a persistent stream for a given fabric.UserQueryEntitycreateUserQuery(UserQueryOptions userQueryDefinition)Creates user query as the current userUserQueryEntitycreateUserQuery(UserQueryOptions userQueryDefinition, String user)Creates user query as a given user.<T> C8Cursor<T>cursor(String cursorId, Class<T> type)Return an cursor from the given cursor-ID if still existingStringdeleteIndex(String id)Deletes an indexBooleandrop()Deletes the database from the server.C8Eventevent()<V,E>
TraversalEntity<V,E>executeTraversal(Class<V> vertexClass, Class<E> edgeClass, TraversalOptions options)Execute a server-side traversal<T> C8Cursor<T>executeUserQuery(String userName, String name, Map<String,Object> bindVars, Class<T> type)Executes a saved using query using the givennameandbindVars, then returns a newC8Cursorinstance for the result list.booleanexists()Checks whether the database existsC8qlExecutionExplainEntityexplainQuery(String query, Map<String,Object> bindVars, C8qlQueryExplainOptions options)Explain an AQL query and return information about itCollection<String>getAccessibleGeoFabrics()Retrieves a list of all databases the current user can accessCollection<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> TgetDocument(String id, Class<T> type)Reads a single document<T> TgetDocument(String id, Class<T> type, DocumentReadOptions options)Reads a single documentCollection<GraphEntity>getGraphs()Lists all graphs known to the graph moduleIndexEntitygetIndex(String id)Returns an indexDatabaseEntitygetInfo()Retrieves information about the current databasePermissionsgetPermissions(String user)Get specific database access levelCollection<C8StreamEntity>getPersistentStreams(C8StreamCreateOptions options)Get list of persistent streams under the given stream db.QueryTrackingPropertiesEntitygetQueryTrackingProperties()Returns the configuration for the AQL query trackingCollection<QueryEntity>getSlowQueries()Returns a list of slow running AQL queriesCollection<C8StreamEntity>getStreams()Get list of all streams under given database.StreamTransactionEntitygetStreamTransaction(String id)Gets information about a Stream Transaction.Collection<TransactionEntity>getStreamTransactions()Gets all the currently running Stream Transactions.C8DBVersiongetVersion()Returns the server name and version number.voidgrantAccess(String user)Grants access to the database for useruser.voidgrantAccess(String user, Permissions permissions)Grants or revoke access to the database for useruser.C8Graphgraph(String name)Returns aArangoGraphinstance for the given graph name.voidkillQuery(String id)Kills a running query.C8qlParseEntityparseQuery(String query)Parse an AQL query and return information about it This method is for query validation only.<T> C8Cursor<T>query(String query, C8qlQueryOptions options, Class<T> type)Performs a database query using the givenquery, then returns a newArangoCursorinstance for the result list.<T> C8Cursor<T>query(String query, Class<T> type)Performs a database query using the givenquery, then returns a newArangoCursorinstance for the result list.<T> C8Cursor<T>query(String query, Map<String,Object> bindVars, C8qlQueryOptions options, Class<T> type)Performs a database query using the givenqueryandbindVars, then returns a newC8Cursorinstance for the result list.<T> C8Cursor<T>query(String query, Map<String,Object> bindVars, Class<T> type)Performs a database query using the givenqueryandbindVars, then returns a newArangoCursorinstance for the result list.voidresetAccess(String user)Clear the database access level, revert back to the default access level.Restqlrestql()Returns aRestqlinstance.voidrevokeAccess(String user)Revokes access to the database dbname for useruser.protected C8DatabaseImplsetCursorInitializer(C8CursorInitializer cursorInitializer)QueryTrackingPropertiesEntitysetQueryTrackingProperties(QueryTrackingPropertiesEntity properties)Changes the configuration for the AQL query trackingC8Streamstream(String name)Returns aC8Streaminstance for the given stream name.<T> Ttransaction(String action, Class<T> type, C8TransactionOptions options)Performs a server-side transaction and returns its return value.voidunsubscribe(String subscriptionName)Unsubscribes the given subscription on all streams on a stream db.-
Methods inherited from class com.c8db.internal.InternalC8Database
abortStreamTransactionRequest, beginStreamTransactionRequest, c8db, clearC8StreamBacklogRequest, clearC8StreamBacklogRequest, clearSlowQueriesRequest, commitStreamTransactionRequest, createC8PersistentStreamRequest, createCollectionRequest, createDropResponseDeserializer, createGraphRequest, createGraphResponseDeserializer, createUserQueryRequest, createUserQueryResponseDeserializer, dcList, deserializeEdges, deserializeVertices, dropRequest, executeTraversalRequest, executeTraversalResponseDeserializer, explainQueryRequest, getAccessibleDatabasesForResponseDeserializer, getAccessibleDatabasesRequest, getC8PersistentStreamsRequest, getC8StreamsRequest, getC8StreamsResponseDeserializer, getCollectionsRequest, getCollectionsResponseDeserializer, getCurrentlyRunningQueriesRequest, getDatabaseResponseDeserializer, getGraphsRequest, getGraphsResponseDeserializer, getInfoRequest, getInfoResponseDeserializer, getPermissionsRequest, getPermissionsResponseDeserialzer, getQueryTrackingPropertiesRequest, getSlowQueriesRequest, getStreamTransactionRequest, getStreamTransactionsRequest, getVersionRequest, grantAccessRequest, killQueryRequest, name, parseQueryRequest, queryCloseRequest, queryNextRequest, queryRequest, resetAccessRequest, setQueryTrackingPropertiesRequest, spotDc, streamTransactionResponseDeserializer, tenant, transactionRequest, transactionResponseDeserializer, transactionsResponseDeserializer, unsubscribeRequest, userQueryRequest
-
Methods inherited from class com.c8db.internal.C8Executeable
createPath, executor, request, util, util
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.c8db.C8Database
c8db, name, tenant
-
Methods inherited from interface com.c8db.C8SerializationAccessor
util, util
-
-
-
-
Method Detail
-
getVersion
public C8DBVersion getVersion() throws C8DBException
Description copied from interface:C8DatabaseReturns the server name and version number.- Specified by:
getVersionin interfaceC8Database- Returns:
- the server version, number
- Throws:
C8DBException
-
exists
public boolean exists() throws C8DBExceptionDescription copied from interface:C8DatabaseChecks whether the database exists- Specified by:
existsin interfaceC8Database- Returns:
- true if the database exists, otherwise false
- Throws:
C8DBException
-
getAccessibleGeoFabrics
public Collection<String> getAccessibleGeoFabrics() throws C8DBException
Description copied from interface:C8DatabaseRetrieves a list of all databases the current user can access- Specified by:
getAccessibleGeoFabricsin interfaceC8Database- Returns:
- a list of all databases the current user can access
- Throws:
C8DBException
-
collection
public C8Collection collection(String name)
Description copied from interface:C8DatabaseReturns aArangoCollectioninstance for the given collection name.- Specified by:
collectionin interfaceC8Database- Parameters:
name- Name of the collection- Returns:
- collection handler
-
createCollection
public CollectionEntity createCollection(String name) throws C8DBException
Description copied from interface:C8DatabaseCreates a collection for the given collection's name, then returns collection information from the server.- Specified by:
createCollectionin interfaceC8Database- Parameters:
name- The name of the collection- Returns:
- information about the collection
- Throws:
C8DBException
-
createCollection
public CollectionEntity createCollection(String name, CollectionCreateOptions options) throws C8DBException
Description copied from interface:C8DatabaseCreates a collection with the givenoptionsfor this collection's name, then returns collection information from the server.- Specified by:
createCollectionin interfaceC8Database- Parameters:
name- The name of the collectionoptions- Additional options, can be null- Returns:
- information about the collection
- Throws:
C8DBException
-
getCollections
public Collection<CollectionEntity> getCollections() throws C8DBException
Description copied from interface:C8DatabaseFetches all collections from the database and returns an list of collection descriptions.- Specified by:
getCollectionsin interfaceC8Database- Returns:
- list of information about all collections
- Throws:
C8DBException
-
getCollections
public Collection<CollectionEntity> getCollections(CollectionsReadOptions options) throws C8DBException
Description copied from interface:C8DatabaseFetches all collections from the database and returns an list of collection descriptions.- Specified by:
getCollectionsin interfaceC8Database- Parameters:
options- Additional options, can be null- Returns:
- list of information about all collections
- Throws:
C8DBException- See Also:
- API Documentation
-
getIndex
public IndexEntity getIndex(String id) throws C8DBException
Description copied from interface:C8DatabaseReturns an index- Specified by:
getIndexin interfaceC8Database- Parameters:
id- The index-handle- Returns:
- information about the index
- Throws:
C8DBException- See Also:
- API Documentation
-
deleteIndex
public String deleteIndex(String id) throws C8DBException
Description copied from interface:C8DatabaseDeletes an index- Specified by:
deleteIndexin interfaceC8Database- Parameters:
id- The index-handle- Returns:
- the id of the index
- Throws:
C8DBException- See Also:
- API Documentation
-
create
public Boolean create() throws C8DBException
Description copied from interface:C8DatabaseCreates the database- Specified by:
createin interfaceC8Database- Returns:
- true if the database was created successfully.
- Throws:
C8DBException- See Also:
- API Documentation
-
create
public Boolean create(String geoFabric) throws C8DBException
Description copied from interface:C8DatabaseCreate a geofabric/db in Demo tenant- Specified by:
createin interfaceC8Database- Parameters:
geoFabric- The name of the geofabric- Returns:
- Throws:
C8DBException
-
drop
public Boolean drop() throws C8DBException
Description copied from interface:C8DatabaseDeletes the database from the server.- Specified by:
dropin interfaceC8Database- Returns:
- true if the database was dropped successfully
- Throws:
C8DBException- See Also:
- API Documentation
-
grantAccess
public void grantAccess(String user, Permissions permissions) throws C8DBException
Description copied from interface:C8DatabaseGrants or revoke access to the database for useruser. You need permission to the _system database in order to execute this call.- Specified by:
grantAccessin interfaceC8Database- Parameters:
user- The name of the userpermissions- The permissions the user grant- Throws:
C8DBException- See Also:
- API Documentation
-
grantAccess
public void grantAccess(String user) throws C8DBException
Description copied from interface:C8DatabaseGrants access to the database for useruser. You need permission to the _system database in order to execute this call.- Specified by:
grantAccessin interfaceC8Database- Parameters:
user- The name of the user- Throws:
C8DBException- See Also:
- API Documentation
-
revokeAccess
public void revokeAccess(String user) throws C8DBException
Description copied from interface:C8DatabaseRevokes access to the database dbname for useruser. You need permission to the _system database in order to execute this call.- Specified by:
revokeAccessin interfaceC8Database- Parameters:
user- The name of the user- Throws:
C8DBException
-
resetAccess
public void resetAccess(String user) throws C8DBException
Description copied from interface:C8DatabaseClear the database access level, revert back to the default access level.- Specified by:
resetAccessin interfaceC8Database- Parameters:
user- The name of the user- Throws:
C8DBException- See Also:
- API Documentation
-
getPermissions
public Permissions getPermissions(String user) throws C8DBException
Description copied from interface:C8DatabaseGet specific database access level- Specified by:
getPermissionsin interfaceC8Database- Parameters:
user- The name of the user- Returns:
- permissions of the user
- Throws:
C8DBException- See Also:
- API Documentation
-
query
public <T> C8Cursor<T> query(String query, Map<String,Object> bindVars, C8qlQueryOptions options, Class<T> type) throws C8DBException
Description copied from interface:C8DatabasePerforms a database query using the givenqueryandbindVars, then returns a newC8Cursorinstance for the result list.- Specified by:
queryin interfaceC8Database- Parameters:
query- A C8QL 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)- Returns:
- cursor of the results
- Throws:
C8DBException- See Also:
- API Documentation
-
query
public <T> C8Cursor<T> query(String query, Map<String,Object> bindVars, Class<T> type) throws C8DBException
Description copied from interface:C8DatabasePerforms a database query using the givenqueryandbindVars, then returns a newArangoCursorinstance for the result list.- Specified by:
queryin interfaceC8Database- Parameters:
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)- Returns:
- cursor of the results
- Throws:
C8DBException- See Also:
- API Documentation
-
query
public <T> C8Cursor<T> query(String query, C8qlQueryOptions options, Class<T> type) throws C8DBException
Description copied from interface:C8DatabasePerforms a database query using the givenquery, then returns a newArangoCursorinstance for the result list.- Specified by:
queryin interfaceC8Database- Parameters:
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)- Returns:
- cursor of the results
- Throws:
C8DBException- See Also:
- API Documentation
-
query
public <T> C8Cursor<T> query(String query, Class<T> type) throws C8DBException
Description copied from interface:C8DatabasePerforms a database query using the givenquery, then returns a newArangoCursorinstance for the result list.- Specified by:
queryin interfaceC8Database- Parameters:
query- An AQL query stringtype- The type of the result (POJO class, VPackSlice, String for JSON, or Collection/List/Map)- Returns:
- cursor of the results
- Throws:
C8DBException- See Also:
- API Documentation
-
cursor
public <T> C8Cursor<T> cursor(String cursorId, Class<T> type) throws C8DBException
Description copied from interface:C8DatabaseReturn an cursor from the given cursor-ID if still existing- Specified by:
cursorin interfaceC8Database- Parameters:
cursorId- The ID of the cursortype- The type of the result (POJO class, VPackSlice, String for JSON, or Collection/List/Map)- Returns:
- cursor of the results
- Throws:
C8DBException- See Also:
- API Documentation
-
parseQuery
public C8qlParseEntity parseQuery(String query) throws C8DBException
Description copied from interface:C8DatabaseParse an AQL query and return information about it This method is for query validation only. To actually query the database, seeC8Database.query(String, Map, C8qlQueryOptions, Class)- Specified by:
parseQueryin interfaceC8Database- Parameters:
query- the query which you want parse- Returns:
- imformation about the query
- Throws:
C8DBException- See Also:
- API Documentation
-
getCurrentlyRunningQueries
public Collection<QueryEntity> getCurrentlyRunningQueries() throws C8DBException
Description copied from interface:C8DatabaseReturns a list of currently running AQL queries- Specified by:
getCurrentlyRunningQueriesin interfaceC8Database- Returns:
- a list of currently running AQL queries
- Throws:
C8DBException
-
explainQuery
public C8qlExecutionExplainEntity explainQuery(String query, Map<String,Object> bindVars, C8qlQueryExplainOptions options) throws C8DBException
Description copied from interface:C8DatabaseExplain an AQL query and return information about it- Specified by:
explainQueryin interfaceC8Database- 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
- Throws:
C8DBException- See Also:
- API Documentation
-
clearSlowQueries
public void clearSlowQueries() throws C8DBExceptionDescription copied from interface:C8DatabaseClears the list of slow AQL queries- Specified by:
clearSlowQueriesin interfaceC8Database- Throws:
C8DBException
-
getSlowQueries
public Collection<QueryEntity> getSlowQueries() throws C8DBException
Description copied from interface:C8DatabaseReturns a list of slow running AQL queries- Specified by:
getSlowQueriesin interfaceC8Database- Returns:
- a list of slow running AQL queries
- Throws:
C8DBException
-
getQueryTrackingProperties
public QueryTrackingPropertiesEntity getQueryTrackingProperties() throws C8DBException
Description copied from interface:C8DatabaseReturns the configuration for the AQL query tracking- Specified by:
getQueryTrackingPropertiesin interfaceC8Database- Returns:
- configuration for the AQL query tracking
- Throws:
C8DBException
-
setQueryTrackingProperties
public QueryTrackingPropertiesEntity setQueryTrackingProperties(QueryTrackingPropertiesEntity properties) throws C8DBException
Description copied from interface:C8DatabaseChanges the configuration for the AQL query tracking- Specified by:
setQueryTrackingPropertiesin interfaceC8Database- Parameters:
properties- properties to be set- Returns:
- current set of properties
- Throws:
C8DBException
-
killQuery
public void killQuery(String id) throws C8DBException
Description copied from interface:C8DatabaseKills a running query. The query will be terminated at the next cancelation point.- Specified by:
killQueryin interfaceC8Database- Parameters:
id- The id of the query- Throws:
C8DBException- See Also:
- API Documentation
-
graph
public C8Graph graph(String name)
Description copied from interface:C8DatabaseReturns aArangoGraphinstance for the given graph name.- Specified by:
graphin interfaceC8Database- Parameters:
name- Name of the graph- Returns:
- graph handler
-
createGraph
public GraphEntity createGraph(String name, Collection<EdgeDefinition> edgeDefinitions) throws C8DBException
Description copied from interface:C8DatabaseCreate a new graph in the graph module. The creation of a graph requires the name of the graph and a definition of its edges.- Specified by:
createGraphin interfaceC8Database- Parameters:
name- Name of the graphedgeDefinitions- An array of definitions for the edge- Returns:
- information about the graph
- Throws:
C8DBException- See Also:
- API Documentation
-
createGraph
public GraphEntity createGraph(String name, Collection<EdgeDefinition> edgeDefinitions, GraphCreateOptions options) throws C8DBException
Description copied from interface:C8DatabaseCreate a new graph in the graph module. The creation of a graph requires the name of the graph and a definition of its edges.- Specified by:
createGraphin interfaceC8Database- Parameters:
name- Name of the graphedgeDefinitions- An array of definitions for the edgeoptions- Additional options, can be null- Returns:
- information about the graph
- Throws:
C8DBException- See Also:
- API Documentation
-
getGraphs
public Collection<GraphEntity> getGraphs() throws C8DBException
Description copied from interface:C8DatabaseLists all graphs known to the graph module- Specified by:
getGraphsin interfaceC8Database- Returns:
- graphs stored in this database
- Throws:
C8DBException
-
transaction
public <T> T transaction(String action, Class<T> type, C8TransactionOptions options) throws C8DBException
Description copied from interface:C8DatabasePerforms a server-side transaction and returns its return value.- Specified by:
transactionin interfaceC8Database- Parameters:
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 null- Returns:
- the result of the transaction if it succeeded
- Throws:
C8DBException
-
beginStreamTransaction
public StreamTransactionEntity beginStreamTransaction(StreamTransactionOptions options) throws C8DBException
Description copied from interface:C8DatabaseBegins a Stream Transaction.- Specified by:
beginStreamTransactionin interfaceC8Database- Parameters:
options- Additional options, can be null- Returns:
- information about the transaction
- Throws:
C8DBException
-
abortStreamTransaction
public StreamTransactionEntity abortStreamTransaction(String id) throws C8DBException
Description copied from interface:C8DatabaseAborts a Stream Transaction.- Specified by:
abortStreamTransactionin interfaceC8Database- Returns:
- information about the transaction
- Throws:
C8DBException
-
getStreamTransaction
public StreamTransactionEntity getStreamTransaction(String id) throws C8DBException
Description copied from interface:C8DatabaseGets information about a Stream Transaction.- Specified by:
getStreamTransactionin interfaceC8Database- Returns:
- information about the transaction
- Throws:
C8DBException
-
getStreamTransactions
public Collection<TransactionEntity> getStreamTransactions() throws C8DBException
Description copied from interface:C8DatabaseGets all the currently running Stream Transactions.- Specified by:
getStreamTransactionsin interfaceC8Database- Returns:
- all the currently running Stream Transactions
- Throws:
C8DBException
-
commitStreamTransaction
public StreamTransactionEntity commitStreamTransaction(String id) throws C8DBException
Description copied from interface:C8DatabaseCommits a Stream Transaction.- Specified by:
commitStreamTransactionin interfaceC8Database- Returns:
- information about the transaction
- Throws:
C8DBException
-
getInfo
public DatabaseEntity getInfo() throws C8DBException
Description copied from interface:C8DatabaseRetrieves information about the current database- Specified by:
getInfoin interfaceC8Database- Returns:
- information about the current database
- Throws:
C8DBException
-
executeTraversal
public <V,E> TraversalEntity<V,E> executeTraversal(Class<V> vertexClass, Class<E> edgeClass, TraversalOptions options) throws C8DBException
Description copied from interface:C8DatabaseExecute a server-side traversal- Specified by:
executeTraversalin interfaceC8Database- Parameters:
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 options- Returns:
- Result of the executed traversal
- Throws:
C8DBException- See Also:
- API Documentation
-
getDocument
public <T> T getDocument(String id, Class<T> type) throws C8DBException
Description copied from interface:C8DatabaseReads a single document- Specified by:
getDocumentin interfaceC8Database- Parameters:
id- The id of the documenttype- The type of the document (POJO class, VPackSlice or String for JSON)- Returns:
- the document identified by the id
- Throws:
C8DBException- See Also:
- API Documentation
-
getDocument
public <T> T getDocument(String id, Class<T> type, DocumentReadOptions options) throws C8DBException
Description copied from interface:C8DatabaseReads a single document- Specified by:
getDocumentin interfaceC8Database- Parameters:
id- The id of the documenttype- The type of the document (POJO class, VPackSlice or String for JSON)options- Additional options, can be null- Returns:
- the document identified by the id
- Throws:
C8DBException
-
setCursorInitializer
protected C8DatabaseImpl setCursorInitializer(C8CursorInitializer cursorInitializer)
-
stream
public C8Stream stream(String name)
Description copied from interface:C8DatabaseReturns aC8Streaminstance for the given stream name.- Specified by:
streamin interfaceC8Database- Parameters:
name- Name of the stream- Returns:
- stream handler
-
createPersistentStream
public void createPersistentStream(String name, C8StreamCreateOptions options) throws C8DBException
Description copied from interface:C8DatabaseCreate asynchronously a persistent stream for a given fabric.- Specified by:
createPersistentStreamin interfaceC8Database- Parameters:
name- of the streamoptions- C8StreamCreateOptions- Throws:
C8DBException
-
getPersistentStreams
public Collection<C8StreamEntity> getPersistentStreams(C8StreamCreateOptions options) throws C8DBException
Description copied from interface:C8DatabaseGet list of persistent streams under the given stream db. Returns either a list of global or of local streams.- Specified by:
getPersistentStreamsin interfaceC8Database- Returns:
- Throws:
C8DBException
-
getStreams
public Collection<C8StreamEntity> getStreams() throws C8DBException
Description copied from interface:C8DatabaseGet list of all streams under given database.- Specified by:
getStreamsin interfaceC8Database- Returns:
- Throws:
C8DBException
-
clearBacklog
public void clearBacklog()
Description copied from interface:C8DatabaseClear backlog for all streams on a stream db.- Specified by:
clearBacklogin interfaceC8Database
-
clearBacklog
public void clearBacklog(String subscriptionName)
Description copied from interface:C8DatabaseClear backlog for given subscription.- Specified by:
clearBacklogin interfaceC8Database- Parameters:
subscriptionName- Name of the subscription
-
unsubscribe
public void unsubscribe(String subscriptionName)
Description copied from interface:C8DatabaseUnsubscribes the given subscription on all streams on a stream db.- Specified by:
unsubscribein interfaceC8Database- Parameters:
subscriptionName- Identifying name of the subscripton.
-
restql
public Restql restql()
Description copied from interface:C8DatabaseReturns aRestqlinstance.- Specified by:
restqlin interfaceC8Database- Returns:
- Restql handler
-
createUserQuery
public UserQueryEntity createUserQuery(UserQueryOptions userQueryDefinition) throws C8DBException
Description copied from interface:C8DatabaseCreates user query as the current user- Specified by:
createUserQueryin interfaceC8Database- Parameters:
userQueryDefinition- user query definition- Returns:
- user query entity.
- Throws:
C8DBException
-
createUserQuery
public UserQueryEntity createUserQuery(UserQueryOptions userQueryDefinition, String user) throws C8DBException
Description copied from interface:C8DatabaseCreates user query as a given user.Note: this can only be invoked by a admin user.
- Specified by:
createUserQueryin interfaceC8Database- Parameters:
userQueryDefinition- user query definition.user- user name.- Returns:
- user query entity.
- Throws:
C8DBException
-
executeUserQuery
public <T> C8Cursor<T> executeUserQuery(String userName, String name, Map<String,Object> bindVars, Class<T> type) throws C8DBException
Description copied from interface:C8DatabaseExecutes a saved using query using the givennameandbindVars, then returns a newC8Cursorinstance for the result list. IfuserNameis null then tries to execute it for current user.- Specified by:
executeUserQueryin interfaceC8Database- Parameters:
userName- user the query belongs to. If null executes it for current username- A user query namebindVars- 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)- Returns:
- cursor of the results
- Throws:
C8DBException
-
event
public C8Event event()
- Specified by:
eventin interfaceC8Database
-
admin
public C8Admin admin()
Description copied from interface:C8DatabaseReturns aC8Admininstance.- Specified by:
adminin interfaceC8Database- Returns:
- C8Admin handler
-
apiKeys
public C8ApiKeys apiKeys()
Description copied from interface:C8DatabaseReturns aC8ApiKeysinstance.- Specified by:
apiKeysin interfaceC8Database- Returns:
- C8ApiKeys handler
-
-