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

org.enodeframework.commanding.ICommandContext.kt Maven / Gradle / Ivy

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy