Class WebAgentSessionManagerBuilder

java.lang.Object
at.aimon.session.web.builder.WebAgentSessionManagerBuilder

public final class WebAgentSessionManagerBuilder extends Object
Fluent builder for WebAgentSessionManager (design §11.2).

Exactly one of sessionFactory(AgentSessionFactory) or sessionOpener(AgentSessionOpener) must be configured — they are mutually exclusive. The factory path is the simple lambda-friendly way to wire a stateless AgentSessionFactory; the opener path lets callers thread caller-domain attributes (tenant id, organization unit, ...) from the WebSubmitRequest into the per-conversation context build via OpenAttributes.

Other required collaborators: ConversationRepository. SPIs (ConversationLock, ConversationSignalBus, ConversationInbox, IdempotencyStore) are injected explicitly in DeploymentMode.DISTRIBUTED mode and default to in-memory implementations in SINGLE_NODE.

Operational tunables (idleTtl, maxCachedSessions, lockLease, lockExtendInterval, holderLossSweepInterval, idempotencyPrimaryTtl, idempotencySecondaryTtl) carry sensible defaults. Internal components (LeaseRenewer, InProcessEventPublisher, LocalSessionCache, BindingResolver) are managed by the manager and never injected from outside.

In DISTRIBUTED mode the builder fails fast at build() when any SPI is missing or nodeId is unset — this prevents accidentally running with an in-memory SPI on a multi-node deployment.