DefaultDeleteAggregateFunction

class DefaultDeleteAggregateFunction<C : Any>(commandAggregate: CommandAggregate<C, *>, afterCommandFunctions: List<AfterCommandFunction<C>>) : AbstractCommandFunction<C>

Default implementation of delete aggregate command function.

This function handles the DefaultDeleteAggregate command by generating a DefaultAggregateDeleted event. It provides a standard way to mark aggregates as deleted in the system.

Parameters

C

The type of the command aggregate root.

commandAggregate

The command aggregate instance this function belongs to.

afterCommandFunctions

List of after-command functions to execute after deletion.

Constructors

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

Properties

Link copied to clipboard

The command aggregate instance this function belongs to.

Link copied to clipboard
open override val contextName: String
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 processorName: String

The name of the processor class, derived from the simple name of the processor's class.

Link copied to clipboard
open override val qualifiedName: String

The fully qualified name of the function, formatted as "processorName.functionName(supportedTypeSimpleName)". This provides a unique identifier for the function.

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
fun NamedBoundedContext.getContextAlias(boundedContext: BoundedContext? = MetadataSearcher.metadata.contexts[contextName]): String
Link copied to clipboard

Gets the context alias prefix for this bounded context.

Link copied to clipboard
open fun handle(exchange: ServerCommandExchange<*>): Mono<DomainEventStream>

Handles the message exchange by invoking the function. This method provides an alternative way to process the exchange.

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

Invokes the command function and returns a domain event stream.

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

Invokes the delete command by returning a DefaultAggregateDeleted event.

Link copied to clipboard
open fun isEmpty(): Boolean
Link copied to clipboard
Link copied to clipboard
open fun isSameFunction(functionInfo: FunctionInfo): Boolean
Link copied to clipboard

Checks if a function matches the criteria specified by this NamedFunctionInfo. Used to determine if a wait strategy should be notified about a specific function execution. Returns true if all specified criteria (context, processor, name) match or are not specified.

Link copied to clipboard

Checks if the given message is supported by this function. A message is supported if its body is an instance of the supported type and its aggregate matches one of the supported topics.

Link copied to clipboard
fun FunctionInfo.toWaitSignal(id: String, waitCommandId: String, commandId: String, aggregateId: AggregateId, stage: CommandStage, isLastProjection: Boolean = false, aggregateVersion: Int? = null, errorCode: String = ErrorCodes.SUCCEEDED, errorMsg: String = ErrorCodes.SUCCEEDED_MESSAGE, bindingErrors: List<BindingError> = emptyList(), result: Map<String, Any> = emptyMap(), commands: List<String> = listOf(), signalTime: Long = System.currentTimeMillis()): WaitSignal