T
- The data type data that this implementation can handle.S
- The type of Edit
s 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
Edit s 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)
DataStore
saveShadowDocument
in interface DataStore<T,S extends Edit<? extends Diff>>
shadowDocument
- the ShadowDocument
to save.public ShadowDocument<T> getShadowDocument(String documentId, String clientId)
DataStore
ShadowDocument
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)
DataStore
saveBackupShadowDocument
in interface DataStore<T,S extends Edit<? extends Diff>>
backupShadow
- the BackupShadowDocument
to save.public BackupShadowDocument<T> getBackupShadowDocument(String documentId, String clientId)
DataStore
BackupShadowDocument
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)
ClientDataStore
saveClientDocument
in interface ClientDataStore<T,S extends Edit<? extends Diff>>
document
- the ClientDocument
to save.public ClientDocument<T> getClientDocument(String documentId, String clientId)
ClientDataStore
Document
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)
DataStore
Edit
to the data store.public void removeEdit(S edit, String documentId, String clientId)
DataStore
public Queue<S> getEdits(String documentId, String clientId)
DataStore
Edit
s for the specified document documentId.Copyright © 2015 JBoss by Red Hat. All Rights Reserved.