org.enodeframework.commanding.ICommandContext.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.commanding
import org.enodeframework.domain.IAggregateRoot
import org.enodeframework.messaging.IApplicationMessage
import java.util.concurrent.CompletableFuture
interface ICommandContext {
/**
* Add a new aggregate into the current command context.
*/
fun add(aggregateRoot: IAggregateRoot)
/**
* Add a new aggregate into the current command context synchronously, and then return a completed task object.
*/
fun addAsync(aggregateRoot: IAggregateRoot): CompletableFuture
/**
* Get an aggregate sync from the current command context.
*/
fun get(id: Any, firstFromCache: Boolean, aggregateRootType: Class): T
/**
* Get an aggregate async from the current command context.
*/
fun getAsync(id: Any, firstFromCache: Boolean, aggregateRootType: Class): CompletableFuture
/**
* Get an aggregate sync from the current command context, default from cache.
*/
fun get(id: Any, aggregateRootType: Class): T
/**
* Get an aggregate async from the current command context, default from cache.
*/
fun getAsync(id: Any, aggregateRootType: Class): CompletableFuture
/**
* Get result.
*/
var result: String
/**
* Set an application message.
*/
var applicationMessage: IApplicationMessage?
}