T
- The type of documents that this engine can handle.S
- The type of Edit
s that this synchronizer can handlepublic interface ServerSynchronizer<T,S extends Edit<? extends Diff>>
Modifier and Type | Method and Description |
---|---|
S |
clientDiff(Document<T> document,
ShadowDocument<T> shadowDocument)
Is called to produce an
Edit of changes coming from a client. |
PatchMessage<S> |
createPatchMessage(String documentId,
String clientId,
Queue<S> edits)
Creates a new
PatchMessage with the with the type of Edit that this
synchronizer can handle. |
Document<T> |
documentFromJson(com.fasterxml.jackson.databind.JsonNode json)
Converts the
JsonNode into a Document instance. |
Document<T> |
patchDocument(S edit,
Document<T> document)
Called when the document should be patched.
|
PatchMessage<S> |
patchMessageFromJson(String json)
Creates a {link PatchMessage} by parsing the passed-in json.
|
ShadowDocument<T> |
patchShadow(S edit,
ShadowDocument<T> shadowDocument)
Called when the shadow should be patched.
|
S |
serverDiff(Document<T> document,
ShadowDocument<T> shadowDocument)
The first step in a sync is to produce a an edit for the changes.
|
ShadowDocument<T> patchShadow(S edit, ShadowDocument<T> shadowDocument)
edit
- The edits.shadowDocument
- the ShadowDocument
to patchShadowDocument
a new patched shadow document.Document<T> patchDocument(S edit, Document<T> document)
edit
- the edit to use to path the documentdocument
- the document to be patched.Document
a new patched document.S serverDiff(Document<T> document, ShadowDocument<T> shadowDocument)
document
- the document containingshadowDocument
- the document shadow.Edit
the edit representing the diff between the document and it's shadow document.S clientDiff(Document<T> document, ShadowDocument<T> shadowDocument)
Edit
of changes coming from a client.document
- the server side document .shadowDocument
- the document shadow containing the client changes.Edit
the edit representing the diff between the document and it's shadow document.PatchMessage<S> createPatchMessage(String documentId, String clientId, Queue<S> edits)
PatchMessage
with the with the type of Edit
that this
synchronizer can handle.documentId
- the document identifier for the PatchMessage
clientId
- the client identifier for the PatchMessage
edits
- the Edit
s for the PatchMessage
PatchMessage
the created {code PatchMessage}PatchMessage<S> patchMessageFromJson(String json)
json
- the json representation of a PatchMessage
PatchMessage
the created {code PatchMessage}Copyright © 2015 JBoss by Red Hat. All Rights Reserved.