Package at.aimon.session.web
Interface AgentSessionOpener
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Strategy used by
LocalSessionCache to lazily open an AgentSession.
Production wiring chooses one of two paths:
WebAgentSessionManagerBuilder.sessionFactory(...)— adaptsAgentSessionFactory.open(ConversationId, String, AgentSessionOptions)into this opener; the empty defaultOpenAttributesflowing through the manager is ignored. This is the simple-case path used by aimon-cli and the example modules.WebAgentSessionManagerBuilder.sessionOpener(...)— supplies a caller-defined opener directly so the implementation can read application-level attributes (e.g., tenant id, organization unit) from theOpenAttributesthat the caller attached to theWebSubmitRequest.
Tests can supply a fake opener to substitute controllable AgentSession instances without standing up a real
OrcaAgentExecutor.
Re-open semantics
The opener is invoked on cache miss only. While a session is cached on the holder node, subsequent submits with
different OpenAttributes have no effect on the open session. See OpenAttributes for the full
contract.
-
Method Summary
Modifier and TypeMethodDescriptiondefault at.aimon.core.agent.session.AgentSessionopen(at.aimon.core.agent.conversation.ConversationId conversationId, String agentRef, at.aimon.core.agent.session.AgentSessionOptions options) Convenience overload that delegates toopen(ConversationId, String, AgentSessionOptions, OpenAttributes)withOpenAttributes.empty().at.aimon.core.agent.session.AgentSessionopen(at.aimon.core.agent.conversation.ConversationId conversationId, String agentRef, at.aimon.core.agent.session.AgentSessionOptions options, at.aimon.core.agent.session.OpenAttributes openAttributes) Opens a session bound toconversationIdandagentRef, usingopenAttributesas the caller-provided attribute channel.
-
Method Details
-
open
at.aimon.core.agent.session.AgentSession open(at.aimon.core.agent.conversation.ConversationId conversationId, String agentRef, at.aimon.core.agent.session.AgentSessionOptions options, at.aimon.core.agent.session.OpenAttributes openAttributes) Opens a session bound toconversationIdandagentRef, usingopenAttributesas the caller-provided attribute channel.- Parameters:
conversationId- the conversation (must not be null)agentRef- the agent to bind on first open (must not be null)options- session options (must not be null)openAttributes- caller-provided attributes;OpenAttributes.empty()when the caller did not attach any (must not be null)- Returns:
- the opened session (never null)
-
open
default at.aimon.core.agent.session.AgentSession open(at.aimon.core.agent.conversation.ConversationId conversationId, String agentRef, at.aimon.core.agent.session.AgentSessionOptions options) Convenience overload that delegates toopen(ConversationId, String, AgentSessionOptions, OpenAttributes)withOpenAttributes.empty().Provided so simple callers (and adapters from
AgentSessionFactory) can ignore the attribute channel entirely.- Parameters:
conversationId- the conversation (must not be null)agentRef- the agent to bind on first open (must not be null)options- session options (must not be null)- Returns:
- the opened session (never null)
-