public class CacheSchematicDb extends Object implements SchematicDb
| Constructor and Description |
|---|
CacheSchematicDb(AdvancedCache<String,SchematicEntry> store) |
| 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.
|
SchematicEntry |
put(Document entryDocument)
Store the supplied document and metadata at the given key.
|
SchematicEntry |
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.
|
protected SchematicEntry |
removedResult(String key,
SchematicEntry entry) |
SchematicEntry |
replace(String key,
Document document)
Replace the existing document and metadata at the given key with the document that is supplied.
|
void |
start() |
void |
stop() |
public CacheSchematicDb(AdvancedCache<String,SchematicEntry> store)
public String getName()
SchematicDbgetName in interface SchematicDbpublic Cache<String,SchematicEntry> getCache()
SchematicDbgetCache in interface SchematicDbpublic SchematicEntry get(String key)
SchematicDbget in interface SchematicDbkey - the key or identifier for the documentpublic boolean containsKey(String key)
SchematicDbcontainsKey in interface SchematicDbkey - the key or identifier for the documentpublic SchematicEntry put(String key, Document document)
SchematicDbput in interface SchematicDbkey - the key or identifier for the documentdocument - the document that is to be storedSchematicDb.putIfAbsent(String, Document)protected SchematicEntry removedResult(String key, SchematicEntry entry)
public SchematicEntry put(Document entryDocument)
SchematicDbput in interface SchematicDbentryDocument - the document that contains the metadata document, content document, and keySchematicDb.putIfAbsent(String, Document)public SchematicEntry putIfAbsent(String key, Document document)
SchematicDbputIfAbsent in interface SchematicDbkey - the key or identifier for the documentdocument - the document that is to be storedpublic SchematicEntry replace(String key, Document document)
SchematicDbreplace in interface SchematicDbkey - the key or identifier for the documentdocument - the new document that is to replace the existing document (or binary content)public SchematicEntry remove(String key)
SchematicDbremove in interface SchematicDbkey - the key or identifier for the documentpublic EditableDocument editContent(String key, boolean createIfMissing)
SchematicDbSchematicDb.editContent(String, boolean, boolean) if the lock is known to have already been acquired.editContent in interface SchematicDbkey - 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 existSchematicDb.editContent(String, boolean, boolean)public EditableDocument editContent(String key, boolean createIfMissing, boolean acquireLock)
SchematicDbacquireLock 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.editContent in interface SchematicDbkey - 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 transactionpublic boolean lock(Collection<String> keys)
SchematicDblock in interface SchematicDbkeys - the set of keys identifying the documents that are to be lockedpublic boolean lock(String key)
SchematicDblock in interface SchematicDbkey - the key for the document that is to be lockedCopyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.