TargetScope

class TargetScope @InternalWowApi constructor(val tenantId: String? = null, val scope: Scope? = null)

The tenant and scope a request asks to act in instead of its sender's own: tenantId, when given, replaces the sender's tenant; scope, when given, replaces the sender's scope as a whole, so a part it leaves out is not checked against the aggregate (Scope.NONE: replaced by none, nothing of it checked); a null scope keeps the sender's own (for a command a saga derives, the commit's; for a request a service route's handler sends through its call, the call's). A target that names only a tenant therefore acts in that tenant with that scope, on every path: an in-process client, an HTTP client and a saga alike.

Only a caller with me.ahoo.wow.api.caller.Caller.crossScope may act in another tenant or scope. On the wire it is the Wow-Scope header (me.ahoo.wow.api.wire.ScopeHeader), which always names a scope: an owner or a space it leaves out is none, so a header read gives a scope that is never null, and a client writes the scope it acts in.

Fields may be added: construct one with of; the constructor is internal to Wow.

Constructors

Link copied to clipboard
constructor(tenantId: String? = null, scope: Scope? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val scope: Scope?
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun scopeFor(own: Scope): Scope

The scope this target acts in for a sender whose own is own: scope, else own.

Link copied to clipboard
open override fun toString(): String