T - The data type data that this implementation can handle.S - The type of Edits that this implementation can handle.public class ClientInMemoryDataStore<T,S extends Edit<? extends Diff>> extends Object implements ClientDataStore<T,S>
ClientDataStore.
This implementation is mainly intended for testing and example applications.
| Constructor and Description |
|---|
ClientInMemoryDataStore() |
| Modifier and Type | Method and Description |
|---|---|
BackupShadowDocument<T> |
getBackupShadowDocument(String documentId,
String clientId)
Retrieves the
BackupShadowDocument matching the passed-in document documentId. |
ClientDocument<T> |
getClientDocument(String documentId,
String clientId)
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
|
void |
saveClientDocument(ClientDocument<T> document)
Saves a client 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.
|
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 void saveClientDocument(ClientDocument<T> document)
ClientDataStoresaveClientDocument in interface ClientDataStore<T,S extends Edit<? extends Diff>>document - the ClientDocument to save.public ClientDocument<T> getClientDocument(String documentId, String clientId)
ClientDataStoreDocument matching the passed-in document documentId.getClientDocument in interface ClientDataStore<T,S extends Edit<? extends Diff>>documentId - the document identifier of the document.clientId - the client identifier for which to fetch the document.ClientDocument 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.