org.enodeframework.domain.IMemoryCache.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of enode Show documentation
Show all versions of enode Show documentation
The enodeframework core implementation.
package org.enodeframework.domain
import java.util.concurrent.CompletableFuture
interface IMemoryCache {
/**
* Get an aggregate from memory cache.
*/
fun getAsync(aggregateRootId: Any): CompletableFuture
/**
* Get a strong type aggregate from memory cache.
*/
fun getAsync(aggregateRootId: Any, aggregateRootType: Class): CompletableFuture
/**
* Accept the given aggregate root's changes.
*/
fun acceptAggregateRootChanges(aggregateRoot: T)
/**
* Refresh the given aggregate.
*/
fun refreshAggregate(aggregateRoot: T)
/**
* Refresh the aggregate memory cache by replaying events of event store, and return the refreshed aggregate root.
*/
fun refreshAggregateFromEventStoreAsync(aggregateRootTypeName: String, aggregateRootId: String): CompletableFuture
/**
* Refresh the aggregate memory cache by replaying events of event store, and return the refreshed aggregate root.
*/
fun refreshAggregateFromEventStoreAsync(aggregateRootType: Class, aggregateRootId: String): CompletableFuture
/**
* Start background tasks.
*/
fun start()
/**
* Stop background tasks.
*/
fun stop()
}