Class AbstractUpdateListener<R,T>
- java.lang.Object
-
- org.projectbarbel.histo.extension.AbstractUpdateListener<R,T>
-
- Type Parameters:
R- data resource to accessT- document type to store
- All Implemented Interfaces:
UpdateListenerProtocol<R,T>
- Direct Known Subclasses:
DefaultUpdateListener
public abstract class AbstractUpdateListener<R,T> extends Object implements UpdateListenerProtocol<R,T>
Mongo shadow update listener implementation to synchronizeBarbelHistobackbone updates to external data source.- Author:
- Niklas Schlimm
-
-
Field Summary
Fields Modifier and Type Field Description protected StringdocumentIdFieldNameprotected com.google.gson.Gsongsonprotected Class<?>managedTypeprotected BarbelModemodeprotected Class<? extends Bitemporal>persistedTypeprotected Rshadowprotected static StringVERSION_IDprotected StringversionIdFieldName
-
Constructor Summary
Constructors Constructor Description AbstractUpdateListener(Class<?> managedType, com.google.gson.Gson gson)
-
Method Summary
Modifier and Type Method Description abstract TfromPersistenceObjectJsonToStoredDocument(String json)BitemporalfromStoredDocumentToPersistenceObject(T document)abstract StringfromStroredDocumentToPersistenceObjectJson(T document)voidhandleInitialization(EventType.BarbelInitializedEvent event)voidhandleLoadOperation(EventType.OnLoadOperationEvent event)voidhandleUnLoadOperation(EventType.UnLoadOperationEvent event)voidhandleUpdate(EventType.UpdateFinishedEvent event)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.projectbarbel.histo.extension.UpdateListenerProtocol
delete, deleteJournal, getExternalDataResource, insertDocuments, queryJournal
-
-
-
-
Field Detail
-
VERSION_ID
protected static final String VERSION_ID
- See Also:
- Constant Field Values
-
shadow
protected R shadow
-
mode
protected final BarbelMode mode
-
gson
protected final com.google.gson.Gson gson
-
versionIdFieldName
protected String versionIdFieldName
-
managedType
protected final Class<?> managedType
-
documentIdFieldName
protected final String documentIdFieldName
-
persistedType
protected final Class<? extends Bitemporal> persistedType
-
-
Constructor Detail
-
AbstractUpdateListener
public AbstractUpdateListener(Class<?> managedType, com.google.gson.Gson gson)
-
-
Method Detail
-
handleInitialization
public void handleInitialization(EventType.BarbelInitializedEvent event)
- Specified by:
handleInitializationin interfaceUpdateListenerProtocol<R,T>
-
handleLoadOperation
public void handleLoadOperation(EventType.OnLoadOperationEvent event)
- Specified by:
handleLoadOperationin interfaceUpdateListenerProtocol<R,T>
-
handleUnLoadOperation
public void handleUnLoadOperation(EventType.UnLoadOperationEvent event)
- Specified by:
handleUnLoadOperationin interfaceUpdateListenerProtocol<R,T>
-
handleUpdate
public void handleUpdate(EventType.UpdateFinishedEvent event)
- Specified by:
handleUpdatein interfaceUpdateListenerProtocol<R,T>
-
fromStoredDocumentToPersistenceObject
public Bitemporal fromStoredDocumentToPersistenceObject(T document)
- Specified by:
fromStoredDocumentToPersistenceObjectin interfaceUpdateListenerProtocol<R,T>
-
fromStroredDocumentToPersistenceObjectJson
public abstract String fromStroredDocumentToPersistenceObjectJson(T document)
-
-