SimpleStateDomainEventExchange

class SimpleStateDomainEventExchange<S : Any, T : Any>(val state: ReadOnlyStateAggregate<S>, val message: DomainEvent<T>, val attributes: MutableMap<String, Any> = ConcurrentHashMap()) : StateDomainEventExchange<S, T>

Simple implementation of StateDomainEventExchange.

This class provides a basic implementation of the StateDomainEventExchange interface, combining a read-only state aggregate with a domain event message and managing exchange attributes.

Parameters

S

The type of the aggregate state

T

The type of the domain event body

state

The read-only state aggregate

message

The domain event message

attributes

The mutable map of attributes (default: ConcurrentHashMap)

See also

Constructors

Link copied to clipboard
constructor(state: ReadOnlyStateAggregate<S>, message: DomainEvent<T>, attributes: MutableMap<String, Any> = ConcurrentHashMap())

Creates a new SimpleStateDomainEventExchange with state, message, and attributes

Properties

Link copied to clipboard
open override val attributes: MutableMap<String, Any>

Mutable map for storing exchange attributes (default: empty ConcurrentHashMap)

Link copied to clipboard
open override val message: DomainEvent<T>

The domain event being processed

Link copied to clipboard
open override val state: ReadOnlyStateAggregate<S>

The read-only state aggregate

Functions

Link copied to clipboard
open fun acknowledge(): Mono<Void>
Link copied to clipboard
open override fun clearError()

Clears the current error object.

Link copied to clipboard
open override fun <T : Any> extractDeclared(type: Class<T>): T?

Extracts an object of the specified type from the exchange context.

Link copied to clipboard
open fun <T : Any> extractObject(type: KType): T?
Link copied to clipboard
Link copied to clipboard
open fun <T> getAttribute(key: String): T?
Link copied to clipboard
open override fun getCommandResult(): Map<String, Any>
open override fun <R> getCommandResult(key: String): R?
Link copied to clipboard

Retrieves the command stream from the domain event exchange attributes.

Link copied to clipboard
open override fun getError(): Throwable?

Gets the current error object.

Link copied to clipboard

Retrieves the event processing function for this exchange.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun setAttribute(key: String, value: Any): DomainEventExchange<T>
Link copied to clipboard
open override fun setCommandResult(key: String, value: Any)
Link copied to clipboard

Sets the command stream in the domain event exchange attributes. This allows the command stream to be associated with the domain event for later retrieval.

Link copied to clipboard
open override fun setError(throwable: Throwable)

Sets the error object for this context.

Link copied to clipboard
open fun setFunction(functionInfo: FunctionInfo): DomainEventExchange<T>
Link copied to clipboard