Class McpCacheConfig

java.lang.Object
org.apache.juneau.rest.server.mcp.v20260728.McpCacheConfig

public class McpCacheConfig extends Object
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 Details

  • Method Details

    • getDefaultHint

      The fallback hint applied when a method-specific hint is not configured.
      Returns:
      The hint, or null if not set.
    • setDefaultHint

      Sets the fallback hint.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object.
    • getToolsList

      The hint applied to tools/list.
      Returns:
      The hint, or null if not set.
    • setToolsList

      Sets the hint applied to tools/list.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object.
    • getPromptsList

      The hint applied to prompts/list.
      Returns:
      The hint, or null if not set.
    • setPromptsList

      Sets the hint applied to prompts/list.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object.
    • getResourcesList

      The hint applied to resources/list.
      Returns:
      The hint, or null if not set.
    • setResourcesList

      Sets the hint applied to resources/list.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object.
    • getResourceTemplatesList

      The hint applied to resources/templates/list.
      Returns:
      The hint, or null if not set.
    • setResourceTemplatesList

      Sets the hint applied to resources/templates/list.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object.
    • getResourcesRead

      The hint applied to resources/read when no per-URI override matches.
      Returns:
      The hint, or null if not set.
    • setResourcesRead

      Sets the hint applied to resources/read when no per-URI override matches.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object.
    • getServerDiscover

      The hint applied to server/discover.
      Returns:
      The hint, or null if not set.
    • setServerDiscover

      Sets the hint applied to server/discover.
      Parameters:
      value - The new value. Can be null to unset the property.
      Returns:
      This object.
    • getResourceReadOverrides

      Per-URI hint overrides for resources/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 (or null to clear). Every entry is validated; a null URI key is rejected.
      Returns:
      This object.
    • addResourceReadOverride

      Adds or replaces a single per-URI hint override.
      Parameters:
      uri - The exact resource URI. Must not be null.
      hint - The hint. Can be null.
      Returns:
      This object.