org.enodeframework.domain.IMemoryCache 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;
public interface IMemoryCache {
/**
* Get an aggregate from memory cache.
*/
CompletableFuture getAsync(Object aggregateRootId);
/**
* Get a strong type aggregate from memory cache.
*/
CompletableFuture getAsync(Object aggregateRootId, Class aggregateRootType);
/**
* Accept the given aggregate root's changes.
*/
void acceptAggregateRootChanges(IAggregateRoot aggregateRoot);
/**
* Refresh the aggregate memory cache by replaying events of event store, and return the refreshed aggregate root.
*/
CompletableFuture refreshAggregateFromEventStoreAsync(String aggregateRootTypeName, String aggregateRootId);
/**
* Refresh the aggregate memory cache by replaying events of event store, and return the refreshed aggregate root.
*/
CompletableFuture refreshAggregateFromEventStoreAsync(Class aggregateRootType, String aggregateRootId);
/**
* Start background tasks.
*/
void start();
/**
* Stop background tasks.
*/
void stop();
}