Class McpCacheConfig
java.lang.Object
org.apache.juneau.rest.server.mcp.v20260728.McpCacheConfig
Binding-owned, immutable-after-construction cache configuration for a v2
McpRevision.
Applications populate one McpCacheConfig and pass it to
McpRevision(org.apache.juneau.bean.mcp.v20260728.ServerCapabilities, McpCacheConfig). Every
setter validates its McpCacheHint argument eagerly (including entries assigned via
setResourceReadOverrides(Map)), so an invalid TTL fails at configuration time rather than at dispatch
time.
This type holds no resolution logic; precedence between getDefaultHint(), the per-method hints, and
getResourceReadOverrides() is owned by McpRevision.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddResourceReadOverride(String uri, McpCacheHint hint) Adds or replaces a single per-URI hint override.The fallback hint applied when a method-specific hint is not configured.The hint applied toprompts/list.Per-URI hint overrides forresources/read, keyed by exact resource URI.The hint applied toresources/list.The hint applied toresources/readwhen no per-URI override matches.The hint applied toresources/templates/list.The hint applied toserver/discover.The hint applied totools/list.setDefaultHint(McpCacheHint value) Sets the fallback hint.setPromptsList(McpCacheHint value) Sets the hint applied toprompts/list.Replaces the per-URI hint overrides.setResourcesList(McpCacheHint value) Sets the hint applied toresources/list.setResourcesRead(McpCacheHint value) Sets the hint applied toresources/readwhen no per-URI override matches.Sets the hint applied toresources/templates/list.setServerDiscover(McpCacheHint value) Sets the hint applied toserver/discover.setToolsList(McpCacheHint value) Sets the hint applied totools/list.
-
Constructor Details
-
McpCacheConfig
public McpCacheConfig()
-
-
Method Details
-
getDefaultHint
The fallback hint applied when a method-specific hint is not configured.- Returns:
- The hint, or
nullif not set.
-
setDefaultHint
Sets the fallback hint.- Parameters:
value- The new value. Can benullto unset the property.- Returns:
- This object.
-
getToolsList
The hint applied totools/list.- Returns:
- The hint, or
nullif not set.
-
setToolsList
Sets the hint applied totools/list.- Parameters:
value- The new value. Can benullto unset the property.- Returns:
- This object.
-
getPromptsList
The hint applied toprompts/list.- Returns:
- The hint, or
nullif not set.
-
setPromptsList
Sets the hint applied toprompts/list.- Parameters:
value- The new value. Can benullto unset the property.- Returns:
- This object.
-
getResourcesList
The hint applied toresources/list.- Returns:
- The hint, or
nullif not set.
-
setResourcesList
Sets the hint applied toresources/list.- Parameters:
value- The new value. Can benullto unset the property.- Returns:
- This object.
-
getResourceTemplatesList
The hint applied toresources/templates/list.- Returns:
- The hint, or
nullif not set.
-
setResourceTemplatesList
Sets the hint applied toresources/templates/list.- Parameters:
value- The new value. Can benullto unset the property.- Returns:
- This object.
-
getResourcesRead
The hint applied toresources/readwhen no per-URI override matches.- Returns:
- The hint, or
nullif not set.
-
setResourcesRead
Sets the hint applied toresources/readwhen no per-URI override matches.- Parameters:
value- The new value. Can benullto unset the property.- Returns:
- This object.
-
getServerDiscover
The hint applied toserver/discover.- Returns:
- The hint, or
nullif not set.
-
setServerDiscover
Sets the hint applied toserver/discover.- Parameters:
value- The new value. Can benullto unset the property.- Returns:
- This object.
-
getResourceReadOverrides
Per-URI hint overrides forresources/read, keyed by exact resource URI.Returns an unmodifiable view (in insertion order) so callers cannot bypass validation via direct mutation.
- Returns:
- An unmodifiable map. Never
null.
-
setResourceReadOverrides
Replaces the per-URI hint overrides.- Parameters:
value- The new value (ornullto clear). Every entry is validated; anullURI key is rejected.- Returns:
- This object.
-
addResourceReadOverride
Adds or replaces a single per-URI hint override.- Parameters:
uri- The exact resource URI. Must not benull.hint- The hint. Can benull.- Returns:
- This object.
-