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 synchronizeBarbelHisto
backbone updates to external data source.- Author:
- Niklas Schlimm
-
-
Field Summary
Fields Modifier and Type Field Description protected String
documentIdFieldName
protected com.google.gson.Gson
gson
protected Class<?>
managedType
protected BarbelMode
mode
protected Class<? extends Bitemporal>
persistedType
protected R
shadow
protected static String
VERSION_ID
protected String
versionIdFieldName
-
Constructor Summary
Constructors Constructor Description AbstractUpdateListener(Class<?> managedType, com.google.gson.Gson gson)
-
Method Summary
Modifier and Type Method Description abstract T
fromPersistenceObjectJsonToStoredDocument(String json)
Bitemporal
fromStoredDocumentToPersistenceObject(T document)
abstract String
fromStroredDocumentToPersistenceObjectJson(T document)
void
handleInitialization(EventType.BarbelInitializedEvent event)
void
handleLoadOperation(EventType.OnLoadOperationEvent event)
void
handleUnLoadOperation(EventType.UnLoadOperationEvent event)
void
handleUpdate(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:
handleInitialization
in interfaceUpdateListenerProtocol<R,T>
-
handleLoadOperation
public void handleLoadOperation(EventType.OnLoadOperationEvent event)
- Specified by:
handleLoadOperation
in interfaceUpdateListenerProtocol<R,T>
-
handleUnLoadOperation
public void handleUnLoadOperation(EventType.UnLoadOperationEvent event)
- Specified by:
handleUnLoadOperation
in interfaceUpdateListenerProtocol<R,T>
-
handleUpdate
public void handleUpdate(EventType.UpdateFinishedEvent event)
- Specified by:
handleUpdate
in interfaceUpdateListenerProtocol<R,T>
-
fromStoredDocumentToPersistenceObject
public Bitemporal fromStoredDocumentToPersistenceObject(T document)
- Specified by:
fromStoredDocumentToPersistenceObject
in interfaceUpdateListenerProtocol<R,T>
-
fromStroredDocumentToPersistenceObjectJson
public abstract String fromStroredDocumentToPersistenceObjectJson(T document)
-
-