|
ModeShape Distribution 3.4.0.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DocumentStore
A store which persists/retrieves documents.
Method Summary | |
---|---|
boolean |
containsKey(String key)
Determine whether the database contains an entry with the supplied key. |
String |
createExternalProjection(String projectedNodeKey,
String sourceName,
String externalPath,
String alias)
Creates an external projection from the federated node with the given key, towards the external node from the given path, from a source. |
SchematicEntry |
get(String key)
Get the entry with the supplied key. |
Document |
getChildReference(String parentKey,
String childKey)
Returns a document representing a single child reference from the supplied parent to the supplied child. |
Document |
getChildrenBlock(String key)
Returns a document representing a block of children, that has the given key. |
ExternalBinaryValue |
getExternalBinary(String sourceName,
String id)
Retrieves a binary value which has the given id and which is not stored by ModeShape. |
String |
getLocalSourceKey()
Returns the value of the local repository source key. |
LocalDocumentStore |
localStore()
Returns a local store instance which will use the local Infinispan cache to store/retrieve information. |
String |
newDocumentKey(String parentKey,
Name documentName,
Name documentPrimaryType)
Generates a new key which will be assigned to a new child document when it is being added to its parent. |
boolean |
prepareDocumentsForUpdate(Collection<String> keys)
Prepare to update all of the documents with the given keys. |
boolean |
remove(String key)
Remove the existing document at the given key. |
void |
setLocalSourceKey(String sourceKey)
Sets the value of the local repository source key. |
SchematicEntry |
storeDocument(String key,
Document document)
Store the supplied document at the given key. |
TransactionManager |
transactionManager()
Returns a transaction manager instance which can be used to manage transactions for this document store. |
void |
updateDocument(String key,
Document document,
SessionNode sessionNode)
Updates the content of the document at the given key with the given document. |
boolean |
updatesRequirePreparing()
Return whether prepareDocumentsForUpdate(Collection) should be called before updating the documents. |
XAResource |
xaResource()
Returns a resource used in distributed transactions |
Method Detail |
---|
SchematicEntry get(String key)
key
- the key or identifier for the document
DocumentStoreException
- if there is a problem retrieving the documentSchematicEntry storeDocument(String key, Document document)
key
- the key or identifier for the documentdocument
- the document that is to be stored
DocumentStoreException
- if there is a problem storing the documentvoid updateDocument(String key, Document document, SessionNode sessionNode)
key
- the key or identifier for the documentdocument
- the content with which the existing document should be updatedsessionNode
- the SessionNode
instance which contains the changes that caused the update
DocumentStoreException
- if there is a problem updating the documentString newDocumentKey(String parentKey, Name documentName, Name documentPrimaryType)
parentKey
- a non-null
String
, the key of the existing parentdocumentName
- non-null
Name
, the name of the new child document.documentPrimaryType
- non-null
Name
, the name of the primary type of the new child document
String
which will be assigned as key to the new child, or null
indicating that no preferred key
is to be used. If this is the case, the repository will assign a random key.boolean updatesRequirePreparing()
prepareDocumentsForUpdate(Collection)
should be called before updating the documents.
prepareDocumentsForUpdate(Collection)
should be called, or false otherwiseboolean prepareDocumentsForUpdate(Collection<String> keys)
keys
- the set of keys identifying the documents that are to be updated via
updateDocument(String, Document, SessionNode)
or via get(String)
followed by
SchematicEntry.editDocumentContent()
.
DocumentStoreException
- if there is an error or problem while obtaining the locksboolean remove(String key)
key
- the key or identifier for the document
DocumentStoreException
- if there is a problem removing the documentboolean containsKey(String key)
key
- the key or identifier for the document
void setLocalSourceKey(String sourceKey)
sourceKey
- a non-null
stringString getLocalSourceKey()
non-null
stringTransactionManager transactionManager()
TransactionManager
instance, never null.XAResource xaResource()
instance
or null
LocalDocumentStore localStore()
LocalDocumentStore
instance.String createExternalProjection(String projectedNodeKey, String sourceName, String externalPath, String alias)
projectedNodeKey
- a non-null
string, the key of the federated node which will contain the projectionsourceName
- a non-null
string, the name of an external source.externalPath
- a non-null
string, representing a path towards a node from the sourcealias
- a non-null
string, representing the alias given to the projection.
non-null
string representing the node key of the external node located at externalPath
.Document getChildrenBlock(String key)
key
- a non-null
String the key of the block
Document
with children and possibly a pointer to the next block, or null
if there isn't a
block with such a key.Document getChildReference(String parentKey, String childKey)
parentKey
- the key for the parentchildKey
- the key for the child
ExternalBinaryValue getExternalBinary(String sourceName, String id)
sourceName
- a non-null
String; the name of an external sourceid
- a non-null
String; the id of an external binary value
ExternalBinaryValue
implementation or null
|
ModeShape Distribution 3.4.0.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |