001/*
002 * Copyright 2022-2026 Revetware LLC.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package com.soklet;
018
019import org.jspecify.annotations.NonNull;
020
021import java.time.Instant;
022
023/**
024 * Read-only identity and metadata for an MCP session-bound SSE stream.
025 *
026 * @author <a href="https://www.revetkn.com">Mark Allen</a>
027 */
028public interface McpSseStream {
029        /**
030         * The request that established the MCP SSE stream.
031         *
032         * @return the request
033         */
034        @NonNull
035        Request getRequest();
036
037        /**
038         * The endpoint class associated with the stream.
039         *
040         * @return the endpoint class
041         */
042        @NonNull
043        Class<? extends McpEndpoint> getEndpointClass();
044
045        /**
046         * The MCP session ID associated with the stream.
047         *
048         * @return the session ID
049         */
050        @NonNull
051        String getSessionId();
052
053        /**
054         * Returns the moment at which this stream was established.
055         *
056         * @return the stream establishment moment
057         */
058        @NonNull
059        Instant getEstablishedAt();
060}