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 * Revision-neutral resource-template descriptor returned from {@code resources/templates/list}. 021 * 022 * <p> 023 * This is a static descriptor: it carries no read callback, template matcher, cache hint, or dated-revision 024 * wire import. It is paired with a read callback and optional per-variable completers by 025 * {@link McpResourceTemplateHandler#descriptor()}, or registered on its own as a listing-only template via 026 * {@link McpServerConfig#addResourceTemplate(McpResourceTemplateSpec...)}. 027 * 028 * <p> 029 * Supersedes the wire-level {@code ResourceTemplate} bean. 030 */ 031public class McpResourceTemplateSpec { 032 033 private String uriTemplate; 034 private String name; 035 private String title; 036 private String description; 037 private String mimeType; 038 039 /** 040 * The URI template (RFC 6570) describing matching resource URIs. 041 * 042 * @return The URI template, or <jk>null</jk> if not set. 043 */ 044 public String getUriTemplate() { 045 return uriTemplate; 046 } 047 048 /** 049 * Sets the URI template. 050 * 051 * @param value The new value. Can be <jk>null</jk> to unset the property. 052 * @return This object. 053 */ 054 public McpResourceTemplateSpec setUriTemplate(String value) { 055 uriTemplate = value; 056 return this; 057 } 058 059 /** 060 * The template name. 061 * 062 * @return The name, or <jk>null</jk> if not set. 063 */ 064 public String getName() { 065 return name; 066 } 067 068 /** 069 * Sets the template name. 070 * 071 * @param value The new value. Can be <jk>null</jk> to unset the property. 072 * @return This object. 073 */ 074 public McpResourceTemplateSpec setName(String value) { 075 name = value; 076 return this; 077 } 078 079 /** 080 * The human-readable template title. 081 * 082 * @return The title, or <jk>null</jk> if not set. 083 */ 084 public String getTitle() { 085 return title; 086 } 087 088 /** 089 * Sets the template title. 090 * 091 * @param value The new value. Can be <jk>null</jk> to unset the property. 092 * @return This object. 093 */ 094 public McpResourceTemplateSpec setTitle(String value) { 095 title = value; 096 return this; 097 } 098 099 /** 100 * The human-readable template description. 101 * 102 * @return The description, or <jk>null</jk> if not set. 103 */ 104 public String getDescription() { 105 return description; 106 } 107 108 /** 109 * Sets the template description. 110 * 111 * @param value The new value. Can be <jk>null</jk> to unset the property. 112 * @return This object. 113 */ 114 public McpResourceTemplateSpec setDescription(String value) { 115 description = value; 116 return this; 117 } 118 119 /** 120 * The media type of resources matching this template. 121 * 122 * @return The media type, or <jk>null</jk> if not set. 123 */ 124 public String getMimeType() { 125 return mimeType; 126 } 127 128 /** 129 * Sets the media type of resources matching this template. 130 * 131 * @param value The new value. Can be <jk>null</jk> to unset the property. 132 * @return This object. 133 */ 134 public McpResourceTemplateSpec setMimeType(String value) { 135 mimeType = value; 136 return this; 137 } 138}