public interface SchematicDb extends Lifecycle
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(String key)
Determine whether the database contains an entry with the supplied key.
|
EditableDocument |
editContent(String key,
boolean createIfMissing)
Get an editor for the entry with the supplied key.
|
EditableDocument |
editContent(String key,
boolean createIfMissing,
boolean acquireLock)
Get an editor for the entry with the supplied key and say whether the entry should be locked.
|
SchematicEntry |
get(String key)
Get the entry with the supplied key.
|
Cache<String,SchematicEntry> |
getCache()
Get the cache that backs this schematic database.
|
String |
getName()
Get the name of this database.
|
boolean |
lock(Collection<String> keys)
Lock all of the documents with the given keys.
|
boolean |
lock(String key)
Lock all of the documents with the given keys.
|
void |
put(Document entryDocument)
Store the supplied document and metadata at the given key.
|
void |
put(String key,
Document document)
Store the supplied document and metadata at the given key.
|
SchematicEntry |
putIfAbsent(String key,
Document document)
Store the supplied document and metadata at the given key.
|
SchematicEntry |
remove(String key)
Remove the existing document at the given key.
|
void |
replace(String key,
Document document)
Replace the existing document and metadata at the given key with the document that is supplied.
|
String getName()
Cache<String,SchematicEntry> getCache()
SchematicEntry get(String key)
key
- the key or identifier for the documentEditableDocument editContent(String key, boolean createIfMissing)
editContent(String, boolean, boolean)
if the lock is known to have already been acquired.key
- the key or identifier for the documentcreateIfMissing
- true if a new entry should be created and added to the database if an existing entry does not existTimeoutException
- if a lock cannot be obtained on the requested documenteditContent(String, boolean, boolean)
EditableDocument editContent(String key, boolean createIfMissing, boolean acquireLock)
acquireLock
is
false, then the entry should have been explicitly locked
as part of a transaction before this
method is called. The resulting editor will operate upon a copy of the entry and the database will be updated as part of
the transaction.key
- the key or identifier for the documentcreateIfMissing
- true if a new entry should be created and added to the database if an existing entry does not existacquireLock
- true if the lock should be acquired for this entry, or false if the lock is known to have already been
acquired for the current transactionTimeoutException
- if aquireLock
is true
and the lock cannot be acquired within the configured lock acquisition time.boolean containsKey(String key)
key
- the key or identifier for the documentvoid put(String key, Document document)
key
- the key or identifier for the documentdocument
- the document that is to be storedputIfAbsent(String, Document)
void put(Document entryDocument)
entryDocument
- the document that contains the metadata document, content document, and keyputIfAbsent(String, Document)
SchematicEntry putIfAbsent(String key, Document document)
key
- the key or identifier for the documentdocument
- the document that is to be storedvoid replace(String key, Document document)
key
- the key or identifier for the documentdocument
- the new document that is to replace the existing document (or binary content)SchematicEntry remove(String key)
key
- the key or identifier for the documentboolean lock(String key)
key
- the key for the document that is to be lockedboolean lock(Collection<String> keys)
keys
- the set of keys identifying the documents that are to be lockedCopyright © 2008-2015 JBoss, a division of Red Hat. All Rights Reserved.