Package com.cloudimpl.outstack.runtime
Class EventRepositoy<T extends RootEntity>
java.lang.Object
com.cloudimpl.outstack.runtime.EventRepositoy<T>
- Type Parameters:
T-
- All Implemented Interfaces:
QueryOperations<T>
- Direct Known Subclasses:
MemEventRepository
public abstract class EventRepositoy<T extends RootEntity> extends java.lang.Object implements QueryOperations<T>
- Author:
- nuwan
-
Field Summary
Fields Modifier and Type Field Description protected ResourceHelperresourceHelperprotected java.lang.Class<T>rootTypestatic java.lang.StringTID_PREFIXprotected java.lang.Stringversion -
Constructor Summary
Constructors Constructor Description EventRepositoy(java.lang.Class<T> rootType, ResourceHelper resourceHelper) -
Method Summary
Modifier and Type Method Description protected abstract java.util.Optional<EntityCheckpoint>_getCheckpoint(java.lang.String rootTrn)protected abstract voidaddEvent(Event event)<T extends Entity>
TapplyEvent(Event event)protected abstract <C extends ChildEntity<T>>
voiddeleteChildEntityBrnById(ChildEntity e, boolean deleteOnlyEntity)protected abstract <C extends ChildEntity<T>>
voiddeleteChildEntityTrnById(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<C> childType, java.lang.String childId, java.lang.String tenantId)protected abstract voiddeleteRootEntityBrnById(RootEntity e, boolean deleteOnlyEntity)protected abstract voiddeleteRootEntityTrnById(java.lang.Class<T> rootType, java.lang.String id, java.lang.String tenantId)protected abstract voidendTransaction()java.lang.StringgenerateTid()protected EntityCheckpointgetCheckpoint(java.lang.String rootTrn)<K extends Entity, C extends ChildEntity<T>>
java.util.Optional<K>loadEntityWithClone(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<C> childType, java.lang.String childId, java.lang.String tenantId)protected java.lang.StringresourcePrefix(java.lang.String prefix)protected abstract voidsaveChildEntityBrnIfExist(long lastSeq, ChildEntity e)protected abstract voidsaveChildEntityBrnIfNotExist(ChildEntity e)protected abstract voidsaveChildEntityTrnIfExist(long lastSeq, ChildEntity e)protected abstract voidsaveChildEntityTrnIfNotExist(ChildEntity e)protected abstract voidsaveRootEntityBrnIfExist(long lastSeq, RootEntity e)protected abstract voidsaveRootEntityBrnIfNotExist(RootEntity e)protected abstract voidsaveRootEntityTrnIfExist(long lastSeq, RootEntity e)protected abstract voidsaveRootEntityTrnIfNotExist(RootEntity e)voidsaveTx(ITransaction<T> tx)protected abstract voidstartTransaction()protected abstract voidupdateCheckpoint(EntityCheckpoint checkpoint)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.cloudimpl.outstack.runtime.QueryOperations
getAllByRootType, getAllByRootType, getAllChildByType, getAllChildByType, getChildById, getEventsByChildId, getEventsByRootId, getRootById, isIdExist
-
Field Details
-
TID_PREFIX
public static final java.lang.String TID_PREFIX- See Also:
- Constant Field Values
-
rootType
-
resourceHelper
-
version
protected final java.lang.String version
-
-
Constructor Details
-
EventRepositoy
-
-
Method Details
-
saveTx
-
applyEvent
-
getCheckpoint
-
startTransaction
protected abstract void startTransaction() -
endTransaction
protected abstract void endTransaction() -
saveRootEntityBrnIfNotExist
-
saveRootEntityTrnIfNotExist
-
saveRootEntityBrnIfExist
-
saveRootEntityTrnIfExist
-
saveChildEntityBrnIfNotExist
-
saveChildEntityTrnIfNotExist
-
saveChildEntityBrnIfExist
-
saveChildEntityTrnIfExist
-
deleteRootEntityBrnById
-
deleteRootEntityTrnById
protected abstract void deleteRootEntityTrnById(java.lang.Class<T> rootType, java.lang.String id, java.lang.String tenantId) -
deleteChildEntityBrnById
protected abstract <C extends ChildEntity<T>> void deleteChildEntityBrnById(ChildEntity e, boolean deleteOnlyEntity) -
deleteChildEntityTrnById
protected abstract <C extends ChildEntity<T>> void deleteChildEntityTrnById(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<C> childType, java.lang.String childId, java.lang.String tenantId) -
_getCheckpoint
-
updateCheckpoint
-
addEvent
-
generateTid
public java.lang.String generateTid() -
loadEntityWithClone
public <K extends Entity, C extends ChildEntity<T>> java.util.Optional<K> loadEntityWithClone(java.lang.Class<T> rootType, java.lang.String id, java.lang.Class<C> childType, java.lang.String childId, java.lang.String tenantId) -
resourcePrefix
protected java.lang.String resourcePrefix(java.lang.String prefix)
-