CommandAggregateMetadata

data class CommandAggregateMetadata<C : Any>(val aggregateType: Class<C>, val namedAggregate: NamedAggregate, val constructorAccessor: ConstructorAccessor<C>, val mountedCommands: Set<Class<*>>, val commandFunctionRegistry: Map<Class<*>, FunctionAccessorMetadata<C, Mono<*>>>, val errorFunctionRegistry: Map<Class<*>, FunctionAccessorMetadata<C, Mono<*>>>, val afterCommandFunctionRegistry: List<AfterCommandFunctionMetadata<C>> = emptyList()) : NamedTypedAggregate<C> , NamedAggregateDecorator, Metadata, ProcessorInfo

Represents the metadata for a command aggregate, containing all information needed to process commands.

This data class holds the configuration and function registries for a command aggregate, including constructor accessors, command handlers, error handlers, and after-command functions. It provides utilities to convert these into executable message functions.

Parameters

C

The type of the command aggregate.

Constructors

Link copied to clipboard
constructor(aggregateType: Class<C>, namedAggregate: NamedAggregate, constructorAccessor: ConstructorAccessor<C>, mountedCommands: Set<Class<*>>, commandFunctionRegistry: Map<Class<*>, FunctionAccessorMetadata<C, Mono<*>>>, errorFunctionRegistry: Map<Class<*>, FunctionAccessorMetadata<C, Mono<*>>>, afterCommandFunctionRegistry: List<AfterCommandFunctionMetadata<C>> = emptyList())

Creates a new CommandAggregateMetadata with the specified properties.

Properties

Link copied to clipboard

List of after-command function metadata.

Link copied to clipboard
Link copied to clipboard
open override val aggregateType: Class<C>

The class of the command aggregate.

Link copied to clipboard

Map of command types to their function metadata for command handling.

Link copied to clipboard

The accessor for creating command aggregate instances.

Link copied to clipboard
Link copied to clipboard

Map of error types to their function metadata for error handling.

Link copied to clipboard

Set of command types that are mounted on this aggregate.

Link copied to clipboard
open override val namedAggregate: NamedAggregate

The named aggregate that this command aggregate belongs to.

Link copied to clipboard
open override val processorName: String

The name of this processor, used for identification in processing contexts.

Link copied to clipboard

The list of all registered commands for this aggregate, including both function-registered and mounted commands.

Link copied to clipboard

Indicates whether delete aggregate functionality is registered for this command aggregate.

Link copied to clipboard

Indicates whether recover aggregate functionality is registered for this command aggregate.

Functions

Link copied to clipboard
fun NamedAggregate.aggregateId(id: String = generateId(), tenantId: String = TenantId.DEFAULT_TENANT_ID): DefaultAggregateId

Creates an AggregateId for this NamedAggregate with the specified parameters.

Link copied to clipboard

Finds the aggregate type class associated with this named aggregate.

Link copied to clipboard

Converts this NamedAggregate to its corresponding AggregateMetadata.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Generates a unique ID string for this NamedAggregate.

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 override fun hashCode(): Int
Link copied to clipboard

Checks if the named aggregate is available locally at runtime.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Finds the aggregate type class associated with this named aggregate, throwing an exception if not found.

Link copied to clipboard

Converts the error function registry into executable message functions.

Link copied to clipboard

Extension function to convert a NamedAggregate to an EventNamedAggregate.

Link copied to clipboard

Converts this NamedAggregate to its string representation.

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

Converts this NamedAggregate to a string representation using the context alias.