Package org.springframework.ai.session
Class SessionAttributes
java.lang.Object
org.springframework.ai.session.SessionAttributes
The well-known metadata attributes of a
Session, and the accessors that read
them. A session has no owner field: who it belongs to is the PRINCIPAL_NAME
attribute, in the shape of Spring Session's principal-name index, which every store
indexes (SessionRepository.findByMetadata(java.lang.String, java.lang.String)) and an authorization layer decides
on. AGENT_NAME, AGENT_VERSION and AGENT_MODEL label the
agent a session runs, set at creation, for listings and a UI.- Since:
- 2.1.0
- Author:
- Christian Tzolov
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe model the agent a session runs is configured with, when known.static final StringThe name of the agent a session runs; absent unless set at creation.static final StringThe version of the agent definition a session was created with, when known.static final StringThe name of the principal a session belongs to, asPrincipal.getName()returns it in Spring Security. -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable StringagentModel(Session session) The model of the agent a session runs, ornullwhen none was set.static @Nullable StringThe agent name of a session, ornullwhen none was set.static @Nullable StringagentVersion(Session session) The agent version of a session, ornullwhen none was set.static @Nullable StringprincipalName(Session session) The principal name of a session, ornullwhen it has none.
-
Field Details
-
PRINCIPAL_NAME
The name of the principal a session belongs to, asPrincipal.getName()returns it in Spring Security. Indexed by every repository.- See Also:
-
AGENT_NAME
The name of the agent a session runs; absent unless set at creation.- See Also:
-
AGENT_VERSION
The version of the agent definition a session was created with, when known.- See Also:
-
AGENT_MODEL
The model the agent a session runs is configured with, when known.- See Also:
-
-
Method Details
-
principalName
The principal name of a session, ornullwhen it has none. -
agentName
The agent name of a session, ornullwhen none was set. -
agentVersion
The agent version of a session, ornullwhen none was set. -
agentModel
The model of the agent a session runs, ornullwhen none was set.
-