public interface DBSRepository extends Repository, LockManager
Repository
for Document-Based Storage.Modifier and Type | Method and Description |
---|---|
default void |
begin()
Called when created a transaction.
|
default void |
commit()
Saves and flushes to database.
|
void |
createState(State state)
Creates a document.
|
default void |
createStates(List<State> states)
Creates documents.
|
void |
deleteStates(Set<String> ids)
Deletes a set of document.
|
String |
generateNewId()
Generates a new id for a document.
|
BlobManager |
getBlobManager()
Gets the blob manager.
|
FulltextConfiguration |
getFulltextConfiguration()
Gets the fulltext configuration.
|
LockManager |
getLockManager()
Gets the lock manager for this repository.
|
String |
getRootId()
Gets the root id.
|
boolean |
hasChild(String parentId,
String name,
Set<String> ignored)
Checks if a document has a child with the given name
|
boolean |
isFulltextDisabled()
Checks if fulltext indexing is disabled.
|
PartialList<Map<String,Serializable>> |
queryAndFetch(DBSExpressionEvaluator evaluator,
OrderByClause orderByClause,
boolean distinctDocuments,
int limit,
int offset,
int countUpTo)
Queries the repository for documents matching a NXQL query, and returns a projection of the documents.
|
List<State> |
queryKeyValue(String key,
Object value,
Set<String> ignored)
Queries the repository for documents having key = value.
|
List<State> |
queryKeyValue(String key1,
Object value1,
String key2,
Object value2,
Set<String> ignored)
Queries the repository for documents having key1 = value1 and key2 = value2.
|
void |
queryKeyValueArray(String key,
Object value,
Set<String> ids,
Map<String,String> proxyTargets,
Map<String,Object[]> targetProxies)
Queries the repository for document ids having value in key (an array).
|
boolean |
queryKeyValuePresence(String key,
String value,
Set<String> ignored)
Queries the repository to check if there are documents having key = value.
|
State |
readChildState(String parentId,
String name,
Set<String> ignored)
Reads the state of a child document.
|
State |
readState(String id)
Reads the state of a document.
|
List<State> |
readStates(List<String> ids)
Reads the states of several documents.
|
default void |
rollback()
Rolls back the save state by applying the undo log.
|
ScrollResult |
scroll(DBSExpressionEvaluator evaluator,
int batchSize,
int keepAliveSeconds)
Executes the given query and returns the first batch of results, next batch must be requested
within the
keepAliveSeconds delay. |
ScrollResult |
scroll(String scrollId)
Get the next batch of result, the
scrollId is part of the previous ScrollResult response. |
void |
updateState(String id,
State.StateDiff diff)
Updates a document.
|
getActiveSessionsCount, getName, getSession, markReferencedBinaries, shutdown
canLockBeRemoved, clearLockManagerCaches, closeLockManager, getLock, removeLock, setLock
BlobManager getBlobManager()
FulltextConfiguration getFulltextConfiguration()
boolean isFulltextDisabled()
true
if fulltext indexing is disabled, false
if it is enabledString generateNewId()
State readState(String id)
id
- the document idnull
if not foundList<State> readStates(List<String> ids)
The returned states may be in a different order than the ids.
ids
- the document idsnull
if not foundvoid createState(State state)
state
- the document statedefault void createStates(List<State> states)
states
- the document statesvoid updateState(String id, State.StateDiff diff)
id
- the document iddiff
- the diff to applyvoid deleteStates(Set<String> ids)
ids
- the document idsState readChildState(String parentId, String name, Set<String> ignored)
parentId
- the parent document idname
- the name of the childignored
- a set of document ids that should not be considerednull
if not foundboolean hasChild(String parentId, String name, Set<String> ignored)
parentId
- the parent document idname
- the name of the childignored
- a set of document ids that should not be consideredtrue
if the child exists, false
if notList<State> queryKeyValue(String key, Object value, Set<String> ignored)
key
- the keyvalue
- the valueignored
- a set of document ids that should not be consideredList<State> queryKeyValue(String key1, Object value1, String key2, Object value2, Set<String> ignored)
key1
- the first keyvalue1
- the first valuekey2
- the second keyvalue2
- the second valueignored
- a set of document ids that should not be consideredvoid queryKeyValueArray(String key, Object value, Set<String> ids, Map<String,String> proxyTargets, Map<String,Object[]> targetProxies)
key
- the keyvalue
- the valueids
- the set which receives the documents idsproxyTargets
- returns a map of proxy to target among the documents foundtargetProxies
- returns a map of target to proxies among the document foundboolean queryKeyValuePresence(String key, String value, Set<String> ignored)
key
- the keyvalue
- the valueignored
- a set of document ids that should not be consideredtrue
if the query matches at least one document, false
if the query matches nothingPartialList<Map<String,Serializable>> queryAndFetch(DBSExpressionEvaluator evaluator, OrderByClause orderByClause, boolean distinctDocuments, int limit, int offset, int countUpTo)
evaluator
- the map-based evaluator for the queryorderByClause
- an ORDER BY clausedistinctDocuments
- true
if the projection should return a maximum of one row per documentlimit
- the limit on the number of documents to returnoffset
- the offset in the list of documents to returncountUpTo
- if -1
, count the total size without offset/limit.0
, don't count the total size, set it to -1
.n
, count the total number if there are less than n documents otherwise set the total size
to -2
.LockManager getLockManager()
ScrollResult scroll(DBSExpressionEvaluator evaluator, int batchSize, int keepAliveSeconds)
keepAliveSeconds
delay.ScrollResult scroll(String scrollId)
scrollId
is part of the previous ScrollResult
response.default void begin()
default void commit()
default void rollback()
Copyright © 2016 Nuxeo SA. All rights reserved.