tenantOf

open fun tenantOf(type: AggregateType, named: String?, acting: String?): String

The tenant a command of type is in, sent for the acting tenant (the caller's, or the execution's that derived it: the commit's, the receipt's or the job instance's; the scheduling aggregate's for a timer) to the tenant named, if it names one:

  • a tenant the same as acting is not named: a handler's CommandRequest.to(event.ref, …) acting in the event's tenant names none, as Wow's clients drop it (me.ahoo.wow.api.client.targetTenantOf). With no acting tenant known (null), whatever named says is named;

  • the type's fixed tenant when it has one: a named tenant that is another is a TenantConflictException, refused, never ignored nor rewritten;

  • else the named tenant, else acting. Whether its sender may name another tenant than its own is checked apart.


open fun tenantOf(type: AggregateType, caller: Caller, target: TargetScope? = null): String

The tenant caller addresses an aggregate of type in, with the cross-scope target it may name (whether the caller may name one is checked apart), by the one rule (tenantOf): a target's tenant is named, whoever names it, the caller's own included, since a request names it on purpose; with none, the caller's tenant is the acting one.