Class CdiAgentCardRouter
- All Implemented Interfaces:
AgentCardRouter
AgentCardRouter that resolves tenant-specific AgentCard beans.
Extended cards are resolved via @Tenant("x") @ExtendedAgentCard-qualified beans.
Tenant-specific public cards are resolved via @Tenant("x")-qualified beans that
carry neither @ExtendedAgentCard nor @PublicAgentCard. The @PublicAgentCard
qualifier must NOT be used on tenant-specific public cards because it would cause CDI
ambiguity on injection points requesting the default public card.
Falls back to the default (non-@Tenant) card when the tenant is null,
blank, or does not match any registered tenant.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable AgentCardresolveExtendedCard(@Nullable String tenant) Resolves the extendedAgentCardfor the given tenant.@Nullable AgentCardresolvePublicCard(@Nullable String tenant) Resolves the publicAgentCardfor the given tenant.
-
Constructor Details
-
CdiAgentCardRouter
public CdiAgentCardRouter()
-
-
Method Details
-
resolveExtendedCard
Description copied from interface:AgentCardRouterResolves the extendedAgentCardfor the given tenant.- Specified by:
resolveExtendedCardin interfaceAgentCardRouter- Parameters:
tenant- the tenant identifier, may benull- Returns:
- the resolved extended agent card, or
nullif none is configured
-
resolvePublicCard
Description copied from interface:AgentCardRouterResolves the publicAgentCardfor the given tenant.Returns
nullby default, signaling the handler to fall back to the default (non-tenant-specific) public agent card injected via@PublicAgentCard. Implementations that manage tenant-specific public cards should return a non-nullcard for known tenants.- Specified by:
resolvePublicCardin interfaceAgentCardRouter- Parameters:
tenant- the tenant identifier, may benull- Returns:
- the tenant-specific public agent card, or
nullto fall back to the default public card
-