Companion

object Companion

Functions

Link copied to clipboard
fun failed(code: String, message: String = code): PeerAnswer

The peer's node failed the call for a reason of its own, the error catalog's code (wow.storage.unavailable, wow.command.busy, ...), said as message: answered with the code's status and what a retry may do, as the peer's node answers it, which the caller gets as a WowProblemException. A domain's code is a rejection (rejected), not a failure: it is refused.

Link copied to clipboard
fun rejected(code: String, message: String = code, status: Int? = null, violations: List<Violation> = emptyList(), extensions: Map<String, Any?> = emptyMap()): PeerAnswer

The peer's aggregate rejected the command with the error code and message, answered with the status the peer's contract gives the code, or status when given; naming the fields the command broke (violations) and the rejection's structured extensions, which the caller reads from its CommandRejectedException.

Link copied to clipboard
fun succeeded(id: String? = null, version: Int = 1, results: Map<String, Any> = emptyMap()): PeerAnswer

The command committed at version, to the aggregate id: the call's own by default, else a new one, as a creation that names none gets; with the values its decision answered (results), which the caller reads from CommandResult.results.

Link copied to clipboard

The peer's node waited for the commit past its timeout: 504 wow.wait.timeout, whether the command committed unknown, which the caller may send again with the same request id.