001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.juneau.rest.server.mcp;
018
019/**
020 * App-facing, revision-neutral change-publish SPI for MCP {@code subscriptions/listen}.
021 *
022 * <p>
023 * Injected into tool/resource/prompt handlers via their {@link org.apache.juneau.commons.inject.BeanStore}
024 * argument (the same seam {@code RestRequest} and other request-scoped beans use), so application code can
025 * announce a change without any dependency on the v2 wire beans or transport. A {@link McpSubscriptionBroker}
026 * is the production implementation of this interface.
027 */
028public interface McpSubscriptions {
029
030   /**
031    * Announces that a specific subscribed resource's content changed.
032    *
033    * @param uri The exact resource URI that changed. Must not be {@code null}.
034    */
035   void resourceUpdated(String uri);
036
037   /** Announces that the tool list changed. */
038   void toolsListChanged();
039
040   /** Announces that the prompt list changed. */
041   void promptsListChanged();
042
043   /** Announces that the resource list changed. */
044   void resourcesListChanged();
045}