public interface DBSRepository extends Repository
Repository
for Document-Based Storage.Modifier and Type | Method and Description |
---|---|
void |
createState(State state)
Creates a document.
|
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.
|
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<State> |
queryAndFetch(Expression expression,
DBSExpressionEvaluator evaluator,
OrderByClause orderByClause,
int limit,
int offset,
int countUpTo,
boolean deepCopy,
boolean fulltextScore)
Queries the repository for documents matching a query.
|
List<State> |
queryKeyValue(String key,
String value,
Set<String> ignored)
Queries the repository for documents having key = value.
|
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.
|
void |
updateState(String id,
State.StateDiff diff)
Updates a document.
|
getActiveSessionsCount, getName, getSession, shutdown
BlobManager getBlobManager()
boolean isFulltextDisabled()
true
if fulltext indexing is disabled, false
if it is enabledString getRootId()
String 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) throws DocumentException
state
- the document stateDocumentException
- if the document already existsvoid updateState(String id, State.StateDiff diff) throws DocumentException
id
- the document iddiff
- the diff to applyDocumentException
- if the document does not existvoid deleteStates(Set<String> ids) throws DocumentException
ids
- the document idsDocumentException
State 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, String value, Set<String> ignored)
key
- the keyvalue
- the 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<State> queryAndFetch(Expression expression, DBSExpressionEvaluator evaluator, OrderByClause orderByClause, int limit, int offset, int countUpTo, boolean deepCopy, boolean fulltextScore)
expression
- the query expressionevaluator
- the map-based evaluator for the queryorderByClause
- an ORDER BY clauselimit
- 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
.deepCopy
- whether returned state should be a copyfulltextScore
- whether returned state should include the fulltext scoreCopyright © 2015 Nuxeo SA. All rights reserved.