Interface McpSessionTransportAdmissionDecision
- All Known Implementing Classes:
McpSessionTransportAdmissionDecision.Accepted, McpSessionTransportAdmissionDecision.Rejected
@ThreadSafe
public sealed interface McpSessionTransportAdmissionDecision
permits McpSessionTransportAdmissionDecision.Accepted, McpSessionTransportAdmissionDecision.Rejected
Immutable HTTP admission decision for session-enabled
2025-06-18
and 2025-11-25 GET delivery or DELETE cleanup. Soklet's
2026-07-28 implementation does not use this decision.
Every acceptance supplies an explicit expiry. Soklet caps GET leases using its configured authorization, subscription and session lifetimes, and verifies expiry again before delivery or DELETE retirement. Application values reachable through the identity retain their own thread-safety and lifecycle contracts.
This is a closed domain; exhaustive switches are supported, and any new alternative requires an explicit reviewed contract amendment.
- Author:
- Mark Allen
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classAccepted HTTP identity, explicit expiry and immutable family selection.static final classRejected HTTP decision retaining the rejection carrier. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionaccepted(@NonNull McpAdmissionIdentity admissionIdentity, @NonNull Instant validUntil, @NonNull Set<@NonNull McpSubscriptionNotificationType> notificationTypes) Creates an accepted decision.rejected(@NonNull McpAdmissionRejection admissionRejection) Creates an HTTP rejection using the existing rejection's safe status and response headers.
-
Method Details
-
accepted
static @NonNull McpSessionTransportAdmissionDecision.Accepted accepted(@NonNull McpAdmissionIdentity admissionIdentity, @NonNull Instant validUntil, @NonNull Set<@NonNull McpSubscriptionNotificationType> notificationTypes) Creates an accepted decision. The selected notification families must be a subset of the context's offered families; DELETE requires an empty set. The expiry must still be in the future when Soklet applies the decision. These operation-dependent conditions are checked by the runtime.- Parameters:
admissionIdentity- freshly admitted identityvalidUntil- application authorization expirynotificationTypes- selected notification families, possibly empty- Returns:
- immutable accepted decision
- Throws:
NullPointerException- if an argument or notification type is null
-
rejected
static @NonNull McpSessionTransportAdmissionDecision.Rejected rejected(@NonNull McpAdmissionRejection admissionRejection) Creates an HTTP rejection using the existing rejection's safe status and response headers. GET and DELETE have no JSON-RPC request ID, so the rejection's JSON-RPC error is not rendered on these paths. Header safety and framework-owned status rules remain checked before transport.- Parameters:
admissionRejection- HTTP status and application response headers- Returns:
- immutable rejected decision
- Throws:
NullPointerException- if the rejection is null
-