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.bean.mcp.v20260728; 018 019/** 020 * SEP-2549 cache-hint authorization scope for a {@link CacheableResult} (MCP wire uses lowercase strings). 021 * 022 * <p> 023 * {@link #PUBLIC} means the result is not user-specific and may be shared across authentication/authorization 024 * contexts. {@link #PRIVATE} means the result is user- or authorization-specific and MUST NOT be shared across 025 * authentication/authorization contexts. 026 * 027 * <p> 028 * The protocol default for an absent {@code cacheScope} is {@code public}, but that is an interpretation rule for 029 * consumers, not a serialization default: Juneau never materializes {@code "cacheScope":"public"} when the 030 * property is unset. 031 */ 032public enum McpCacheScope { 033 034 /** Result is not user-specific; may be shared across authentication/authorization contexts. */ 035 PUBLIC("public"), 036 037 /** Result is user- or authorization-specific; MUST NOT be shared across authentication/authorization contexts. */ 038 PRIVATE("private"); 039 040 private final String wire; 041 042 McpCacheScope(String wire) { 043 this.wire = wire; 044 } 045 046 /** 047 * Wire token for JSON payloads. 048 * 049 * @return Lowercase MCP cache-scope string. 050 */ 051 public String toWire() { 052 return wire; 053 } 054 055 @Override /* Object */ 056 public String toString() { 057 return wire; 058 } 059}