Package com.cloudimpl.outstack.runtime
Class EntityContextProvider.UnboundedTransaction<R extends RootEntity>
java.lang.Object
com.cloudimpl.outstack.runtime.EntityContextProvider.UnboundedTransaction<R>
- All Implemented Interfaces:
CRUDOperations,ITransaction<R>,QueryOperations<R>
- Enclosing class:
- EntityContextProvider<T extends RootEntity>
public static final class EntityContextProvider.UnboundedTransaction<R extends RootEntity> extends java.lang.Object implements ITransaction<R>, CRUDOperations
-
Constructor Summary
Constructors Constructor Description UnboundedTransaction(EntityContextProvider entityContextProvider, java.lang.String tenantId, java.util.function.Supplier<java.lang.String> idGenerator, QueryOperations<R> queryOperation, java.util.function.Consumer<java.lang.Object> validator, java.util.function.Function<java.lang.Class<? extends RootEntity>,QueryOperations<?>> queryOperationSelector, java.lang.Class<? extends Entity> entityType, java.util.function.Supplier<java.util.function.BiFunction<java.lang.String,java.lang.Object,reactor.core.publisher.Mono>> requestHandler) -
Method Summary
Modifier and Type Method Description voidcreate(Entity entity)voiddelete(Entity entity)ResultSet<R>getAllByRootType(java.lang.Class<R> rootType, java.lang.String tenantId, Query.PagingRequest paging)ResultSet<R>getAllByRootType(java.lang.Class<R> rootType, java.util.Collection<java.lang.String> tenantId, Query.PagingRequest paging)<T extends ChildEntity<R>>
ResultSet<T>getAllChildByType(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<T> childType, java.lang.String tenantId, Query.PagingRequest paging)<T extends ChildEntity<R>>
ResultSet<T>getAllChildByType(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<T> childType, java.util.Collection<java.lang.String> tenantId, Query.PagingRequest paging)<K> KgetAttachment()<T extends ChildEntity<R>>
java.util.Optional<T>getChildById(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<T> childType, java.lang.String childId, java.lang.String tenantId)<C extends ChildEntity<R>, K extends Entity, Z extends EntityQueryContext>
ZgetContext(java.lang.Class<K> entityType)java.util.Map<java.lang.String,Entity>getDeletedEntities()java.util.Collection<Entity>getEntityList()java.util.List<Event>getEventList()<T extends ChildEntity<R>>
ResultSet<Event<T>>getEventsByChildId(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<T> childType, java.lang.String childId, java.lang.String tenantId, Query.PagingRequest paging)ResultSet<Event<R>>getEventsByRootId(java.lang.Class<R> rootType, java.lang.String rootId, java.lang.String tenantId, Query.PagingRequest paging)InputMetaProvidergetInputMetaProvider()protected ITransaction<R>getNonTenantTransaction(java.lang.String rootId)java.util.Map<java.lang.String,Entity>getRenameEntities()<K> KgetReply()java.util.Optional<R>getRootById(java.lang.Class<R> rootType, java.lang.String id, java.lang.String tenantId)java.lang.Class<R>getRootType()protected ITransaction<R>getTransaction(java.lang.String rootId)java.util.Collection<ITransaction<R>>getTxList()booleanisEntityRenamed(java.lang.String trn)booleanisIdExist(java.lang.String id, java.lang.String tenantId)<K extends Entity, C extends ChildEntity<R>>
java.util.Optional<K>loadEntity(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<C> childType, java.lang.String childId, java.lang.String tenantId)protected voidpublishEvent(Event event)voidrename(Entity oldEntity, Entity newEntity)voidsetAttachment(java.lang.Object attachment)protected voidsetInputMetaProvider(InputMetaProvider inputMetaProvider)voidsetReply(java.lang.Object reply)voidupdate(Entity entity)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
UnboundedTransaction
public UnboundedTransaction(EntityContextProvider entityContextProvider, java.lang.String tenantId, java.util.function.Supplier<java.lang.String> idGenerator, QueryOperations<R> queryOperation, java.util.function.Consumer<java.lang.Object> validator, java.util.function.Function<java.lang.Class<? extends RootEntity>,QueryOperations<?>> queryOperationSelector, java.lang.Class<? extends Entity> entityType, java.util.function.Supplier<java.util.function.BiFunction<java.lang.String,java.lang.Object,reactor.core.publisher.Mono>> requestHandler)
-
-
Method Details
-
setInputMetaProvider
-
setReply
public void setReply(java.lang.Object reply) -
getEventList
- Specified by:
getEventListin interfaceITransaction<R extends RootEntity>
-
getEntityList
- Specified by:
getEntityListin interfaceITransaction<R extends RootEntity>
-
getDeletedEntities
- Specified by:
getDeletedEntitiesin interfaceITransaction<R extends RootEntity>
-
getRenameEntities
- Specified by:
getRenameEntitiesin interfaceITransaction<R extends RootEntity>
-
setAttachment
public void setAttachment(java.lang.Object attachment)- Specified by:
setAttachmentin interfaceITransaction<R extends RootEntity>
-
getAttachment
public <K> K getAttachment()- Specified by:
getAttachmentin interfaceITransaction<R extends RootEntity>
-
isEntityRenamed
public boolean isEntityRenamed(java.lang.String trn)- Specified by:
isEntityRenamedin interfaceITransaction<R extends RootEntity>
-
getTxList
- Specified by:
getTxListin interfaceITransaction<R extends RootEntity>
-
getReply
public <K> K getReply()- Specified by:
getReplyin interfaceITransaction<R extends RootEntity>
-
getContext
public <C extends ChildEntity<R>, K extends Entity, Z extends EntityQueryContext> Z getContext(java.lang.Class<K> entityType)- Specified by:
getContextin interfaceITransaction<R extends RootEntity>
-
getInputMetaProvider
- Specified by:
getInputMetaProviderin interfaceITransaction<R extends RootEntity>
-
loadEntity
public <K extends Entity, C extends ChildEntity<R>> java.util.Optional<K> loadEntity(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<C> childType, java.lang.String childId, java.lang.String tenantId) -
publishEvent
-
getAllByRootType
public ResultSet<R> getAllByRootType(java.lang.Class<R> rootType, java.lang.String tenantId, Query.PagingRequest paging)- Specified by:
getAllByRootTypein interfaceQueryOperations<R extends RootEntity>
-
getAllByRootType
public ResultSet<R> getAllByRootType(java.lang.Class<R> rootType, java.util.Collection<java.lang.String> tenantId, Query.PagingRequest paging)- Specified by:
getAllByRootTypein interfaceQueryOperations<R extends RootEntity>
-
getRootById
public java.util.Optional<R> getRootById(java.lang.Class<R> rootType, java.lang.String id, java.lang.String tenantId)- Specified by:
getRootByIdin interfaceQueryOperations<R extends RootEntity>
-
getChildById
public <T extends ChildEntity<R>> java.util.Optional<T> getChildById(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<T> childType, java.lang.String childId, java.lang.String tenantId)- Specified by:
getChildByIdin interfaceQueryOperations<R extends RootEntity>
-
getAllChildByType
public <T extends ChildEntity<R>> ResultSet<T> getAllChildByType(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<T> childType, java.lang.String tenantId, Query.PagingRequest paging)- Specified by:
getAllChildByTypein interfaceQueryOperations<R extends RootEntity>
-
getAllChildByType
public <T extends ChildEntity<R>> ResultSet<T> getAllChildByType(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<T> childType, java.util.Collection<java.lang.String> tenantId, Query.PagingRequest paging)- Specified by:
getAllChildByTypein interfaceQueryOperations<R extends RootEntity>
-
getEventsByRootId
public ResultSet<Event<R>> getEventsByRootId(java.lang.Class<R> rootType, java.lang.String rootId, java.lang.String tenantId, Query.PagingRequest paging)- Specified by:
getEventsByRootIdin interfaceQueryOperations<R extends RootEntity>
-
getEventsByChildId
public <T extends ChildEntity<R>> ResultSet<Event<T>> getEventsByChildId(java.lang.Class<R> rootType, java.lang.String id, java.lang.Class<T> childType, java.lang.String childId, java.lang.String tenantId, Query.PagingRequest paging)- Specified by:
getEventsByChildIdin interfaceQueryOperations<R extends RootEntity>
-
getTransaction
-
getNonTenantTransaction
-
create
- Specified by:
createin interfaceCRUDOperations
-
update
- Specified by:
updatein interfaceCRUDOperations
-
delete
- Specified by:
deletein interfaceCRUDOperations
-
rename
- Specified by:
renamein interfaceCRUDOperations
-
isIdExist
public boolean isIdExist(java.lang.String id, java.lang.String tenantId)- Specified by:
isIdExistin interfaceQueryOperations<R extends RootEntity>
-
getRootType
- Specified by:
getRootTypein interfaceITransaction<R extends RootEntity>
-