All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.enodeframework.domain.IMemoryCache.kt Maven / Gradle / Ivy

There is a newer version: 1.1.10
Show newest version
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()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy