T - The data type data that this implementation can handle.S - The type of Edits that this implementation can handle.public class ServerInMemoryDataStore<T,S extends Edit<? extends Diff>> extends Object implements ServerDataStore<T,S>
ServerDataStore.
This implementation is mainly intended for testing and example applications.
| Constructor and Description |
|---|
ServerInMemoryDataStore() |
| Modifier and Type | Method and Description |
|---|---|
BackupShadowDocument<T> |
getBackupShadowDocument(String documentId,
String clientId)
Retrieves the
BackupShadowDocument matching the passed-in document documentId. |
Document<T> |
getDocument(String documentId)
Retrieves the
Document matching the passed-in document documentId. |
Queue<S> |
getEdits(String documentId,
String clientId)
Retreives the queue of
Edits for the specified document documentId. |
ShadowDocument<T> |
getShadowDocument(String documentId,
String clientId)
Retrieves the
ShadowDocument matching the passed-in document documentId. |
void |
removeEdit(S edit,
String documentId,
String clientId)
Removes the edit from the store.
|
void |
removeEdits(String documentId,
String clientId)
Removes all edits for the specific client and document pair.
|
void |
saveBackupShadowDocument(BackupShadowDocument<T> backupShadow)
Saves a backup shadow document
|
boolean |
saveDocument(Document<T> document)
Saves a server document.
|
void |
saveEdits(S edit,
String documentId,
String clientId)
Saves an
Edit to the data store. |
void |
saveShadowDocument(ShadowDocument<T> shadowDocument)
Saves a shadow document.
|
void |
updateDocument(Document<T> document)
Updates a server document.
|
public void saveShadowDocument(ShadowDocument<T> shadowDocument)
DataStoresaveShadowDocument in interface DataStore<T,S extends Edit<? extends Diff>>shadowDocument - the ShadowDocument to save.public ShadowDocument<T> getShadowDocument(String documentId, String clientId)
DataStoreShadowDocument matching the passed-in document documentId.getShadowDocument in interface DataStore<T,S extends Edit<? extends Diff>>documentId - the document id of the shadow document.clientId - the client for which to retrieve the shadow document.ShadowDocument the shadow document matching the documentId.public void saveBackupShadowDocument(BackupShadowDocument<T> backupShadow)
DataStoresaveBackupShadowDocument in interface DataStore<T,S extends Edit<? extends Diff>>backupShadow - the BackupShadowDocument to save.public BackupShadowDocument<T> getBackupShadowDocument(String documentId, String clientId)
DataStoreBackupShadowDocument matching the passed-in document documentId.getBackupShadowDocument in interface DataStore<T,S extends Edit<? extends Diff>>documentId - the document identifier of the backup shadow document.clientId - the client identifier for which to fetch the document.BackupShadowDocument the backup shadow document matching the documentId.public boolean saveDocument(Document<T> document)
ServerDataStoresaveDocument in interface ServerDataStore<T,S extends Edit<? extends Diff>>document - the Document to save.public void updateDocument(Document<T> document)
ServerDataStoreupdateDocument in interface ServerDataStore<T,S extends Edit<? extends Diff>>document - the Document to update.public Document<T> getDocument(String documentId)
ServerDataStoreDocument matching the passed-in document documentId.getDocument in interface ServerDataStore<T,S extends Edit<? extends Diff>>documentId - the document identifier of the shadow document.Document the document matching the documentId.public void saveEdits(S edit, String documentId, String clientId)
DataStoreEdit to the data store.public void removeEdit(S edit, String documentId, String clientId)
DataStorepublic Queue<S> getEdits(String documentId, String clientId)
DataStoreEdits for the specified document documentId.Copyright © 2015 JBoss by Red Hat. All Rights Reserved.