CommandFunction

class CommandFunction<C : Any>(val delegate: MessageFunction<C, ServerCommandExchange<*>, Mono<*>>, commandAggregate: CommandAggregate<C, *>, afterCommandFunctions: List<AfterCommandFunction<C>>) : AbstractCommandFunction<C> , Decorator<MessageFunction<C, ServerCommandExchange<*>, Mono<*>>>

A concrete implementation of command function that wraps a delegate message function.

This class provides command execution by delegating to an underlying message function, with support for after-command functions and proper checkpointing for debugging.

Parameters

commandAggregate

The command aggregate instance.

afterCommandFunctions

List of after-command functions to execute.

Type Parameters

C

The type of the command aggregate.

Constructors

Link copied to clipboard
constructor(delegate: MessageFunction<C, ServerCommandExchange<*>, Mono<*>>, commandAggregate: CommandAggregate<C, *>, afterCommandFunctions: List<AfterCommandFunction<C>>)

Creates a new CommandFunction with the specified delegate and configuration.

Properties

Link copied to clipboard
open override val contextName: String
Link copied to clipboard
open override val delegate: MessageFunction<C, ServerCommandExchange<*>, Mono<*>>

The underlying message function that handles the command.

Link copied to clipboard
open override val functionKind: FunctionKind
Link copied to clipboard
open override val name: String
Link copied to clipboard
open override val processor: C

The processor instance that contains the actual business logic for handling messages.

Link copied to clipboard
open override val supportedTopics: Set<NamedAggregate>

The set of named aggregates (topics) that this function supports. The function will only process messages that match one of these aggregates.

Link copied to clipboard
open override val supportedType: Class<*>

The class type of message bodies that this function can process. Used to determine if a message is supported by checking if the message body is an instance of this type.

Functions

Link copied to clipboard
open override fun <A : Annotation> getAnnotation(annotationClass: Class<A>): A?

Retrieves an annotation of the specified type from the function's metadata.

Link copied to clipboard
open override fun invokeCommand(exchange: ServerCommandExchange<*>): Mono<*>

Invokes the delegate command function with checkpointing for debugging.

Link copied to clipboard
open override fun toString(): String