CommandTypes

Names the commands a decide function schedules for an aggregate of another type than its own: the full type name (context.aggregate.Command) of the command class sent to an aggregate of target, or null when none is known. The runtime names them from the context's models and the Manifests of the service and its peers.

Types

Link copied to clipboard

Functions

Link copied to clipboard
open fun aggregateIdOf(target: AggregateType, command: Any): String?

The id of the aggregate of target that command acts on, as its body holds it (@AggregateId): read by the context's model, or from the property of its JSON body a contract names. Null when its command type holds none there, or when it leaves it null (a creation). None by default.

Link copied to clipboard
open fun aggregatesOf(command: Class<*>): List<AggregateType>

The aggregate types that decide commands of the class command: those of the context's models and of every contract the service knows (its Manifest and the peer contracts on its class path), a mounted command left out. A saga's handler that leaves a command's ref out sends it to the one type this gives; none is a missing contract, several a class it must address in full. None by default.

Link copied to clipboard
abstract fun nameOf(target: AggregateType, command: Class<*>): String?