Record Class RetrievalScope
- Record Components:
tenantId- tenant identity, if configuredsessionId- conversation or execution-session identity, if configured
The complete value is a request isolation boundary. Retrieval engines must use this record, rather than only one of its fields, in request caches and mutable request-scoped stores. The engine's indexed source corpus has a separate engine-owned lifecycle boundary; this value does not partition or transfer ownership of that corpus. An unscoped request is supported for agents that do not configure tenant or session identity.
Each part has exactly one representation of absence. A part is either
Optional.empty() or non-blank stripped text: a present-but-blank
identity is rejected at construction rather than normalized to
Optional.empty(). A cache key therefore cannot confuse "no tenant"
with "the empty tenant", because the latter is unrepresentable — the two
cases a digest must distinguish are absence and non-blank text, and
nothing else can occur.
- Since:
- 0.13.0
-
Constructor Summary
ConstructorsConstructorDescriptionRetrievalScope(Optional<String> tenantId, Optional<String> sessionId) Validates and normalizes the identity fields. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static RetrievalScopeCreates a scope from nullable identity values.Returns the value of thesessionIdrecord component.tenantId()Returns the value of thetenantIdrecord component.final StringtoString()Returns a string representation of this record class.static RetrievalScopeunscoped()Returns the canonical scope for requests without identity.
-
Constructor Details
-
RetrievalScope
Validates and normalizes the identity fields.
-
-
Method Details
-
of
Creates a scope from nullable identity values.- Parameters:
tenantId- tenant identity, ornullwhen absentsessionId- session identity, ornullwhen absent- Returns:
- normalized retrieval scope
-
unscoped
Returns the canonical scope for requests without identity.- Returns:
- unscoped identity
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
tenantId
Returns the value of thetenantIdrecord component.- Returns:
- the value of the
tenantIdrecord component
-
sessionId
Returns the value of thesessionIdrecord component.- Returns:
- the value of the
sessionIdrecord component
-