PeerCommands

class PeerCommands(contracts: ContractDirectory, sender: CommandSender? = null, classLoader: ClassLoader = PeerCommands::class.java.classLoader)

The commands of peer contexts that the CommandGateway admits: the aggregates of a context another service serves, known from the contract its api jar carries (contracts). Such a command is written to the peer's command topic, wow.<context>.commands, through the node's command sender, the path a saga's command to another context takes, and the peer's intake executes it. Without one, the node has no command transport and refuses them.

A command's class is found from its contract's schema reference (#/$defs/<binary name>) on classLoader: the peer's api jar, which carries the contract, carries the class too.

Constructors

Link copied to clipboard
constructor(contracts: ContractDirectory, sender: CommandSender? = null, classLoader: ClassLoader = PeerCommands::class.java.classLoader)

Properties

Link copied to clipboard

Whether a command of a peer context can be sent: the node has a command transport.

Functions

Link copied to clipboard

The contract of the aggregate type of a peer context; null for one of this service or of no contract.

Link copied to clipboard

The aggregate types of the peer contexts whose contracts list command, a command class.

Link copied to clipboard

Where a command of the command type name (ctx.agg.Command) is written; null without a transport.

Link copied to clipboard
fun resolve(type: AggregateType, aggregate: AggregateManifest, command: String): PeerCommand?

The command type of aggregate, of type, that command names: its name (AddItem), its full name (ctx.agg.AddItem), one of its former names, or, for a request built from a command object, its class's binary name. A mounted command is an edge's only and is never sent. Null when none matches.