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

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

There is a newer version: 1.1.10
Show newest version
package org.enodeframework.commanding

import java.util.concurrent.CompletableFuture

/**
 * Represents a command service.
 */
interface ICommandService {
    /**
     * Send a command asynchronously.
     *
     * @param command The command to send.
     * @return A task which contains the send result of the command.
     */
    fun sendAsync(command: ICommand): CompletableFuture

    /**
     * Send a command synchronously.
     */
    fun send(command: ICommand): Boolean

    /**
     * Execute a command asynchronously with the default command return type.
     *
     * @param command The command to execute.
     * @return A task which contains the result of the command.
     */
    fun executeAsync(command: ICommand): CompletableFuture

    /**
     * Execute a command asynchronously with the default command return type.
     */
    fun execute(command: ICommand): CommandResult

    /**
     * Execute a command asynchronously with the specified command return type.
     *
     * @param command           The command to execute.
     * @param commandReturnType The return type of the command.
     * @return A task which contains the result of the command.
     */
    fun executeAsync(command: ICommand, commandReturnType: CommandReturnType): CompletableFuture

    /**
     * Execute a command synchronously with the specified command return type.
     */
    fun execute(command: ICommand, commandReturnType: CommandReturnType): CommandResult
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy