Skip to content

Commit 7b92d2a

Browse files
committed
removed Infos
1 parent 2c86448 commit 7b92d2a

File tree

67 files changed

+1716
-858
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1716
-858
lines changed

docs/src/main/asciidoc/mp/cors/cors.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ For each resource class in your application:
7676
7777
. Identify the resources and sub-resources--in other words, the paths--declared in the resource class which you want to support CORS.
7878
. For each of those resources and sub-resources which should support CORS:
79-
.. Find or create a Java method annotated with `@OPTIONS` and with the correct `@Path`.
79+
.. Find or create a Java method annotated with `@OPTIONS` and with the correct `@Completion`.
8080
.. To that `@OPTIONS` Java method add a Helidon link:{mp-cors-javadoc-base-url}/io/helidon/microprofile/cors/CrossOrigin.html[`@CrossOrigin`] annotation that describes the cross-origin sharing you want for that resource.
8181
8282
[NOTE]
@@ -157,7 +157,7 @@ include::{sourcedir}/mp/cors/CorsSnippets.java[tag=snippet_1, indent=0]
157157
<1> Existing `GreetResource` resource class with path `/greet`.
158158
<2> Existing `@GET` method for resource `/greet`.
159159
<3> Existing `@PUT` method for resource `/greet/greeting`.
160-
<4> New `@OPTIONS` method for `/greet`. (Just like the `@GET` method `getDefaultMessage`, this `@OPTIONS` method does not have a `@Path` annotation; both "inherit" the class-level `@Path` setting `/greet`.) The `@CrossOrigin` annotation declares default cross-origin sharing which permits sharing via all HTTP methods to all origins.
160+
<4> New `@OPTIONS` method for `/greet`. (Just like the `@GET` method `getDefaultMessage`, this `@OPTIONS` method does not have a `@Completion` annotation; both "inherit" the class-level `@Completion` setting `/greet`.) The `@CrossOrigin` annotation declares default cross-origin sharing which permits sharing via all HTTP methods to all origins.
161161
<5> New `@OPTIONS` method for `/greet/greeting`. The `@CrossOrigin` annotation specifies sharing only via the `PUT` HTTP method and only to the two listed origins.
162162
163163
=== Adding Configuration

docs/src/main/asciidoc/mp/cors/why-options.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ a resource.
4343
Unfortunately, there is no single Java element that is sure to correspond one-to-one with a JAX-RS resource,
4444
for two reasons.
4545
46-
. JAX-RS allows a resource class to define one or more subresources, denoted by the `@Path` annotation
46+
. JAX-RS allows a resource class to define one or more subresources, denoted by the `@Completion` annotation
4747
on methods. So a resource class does not necessarily represent only a single resource.
4848
. A JAX-RS resource class can contain multiple endpoints for the same resource.
4949
A common example is two methods, annotated with `@GET` and `@PUT` respectively, that have the same path.

docs/src/main/asciidoc/mp/guides/metrics.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ the `/cards` endpoint is called.
124124
----
125125
include::{sourcedir}/mp/guides/MetricsSnippets.java[tag=snippet_1, indent=0]
126126
----
127-
<1> This class is annotated with `Path` which sets the path for this resource
127+
<1> This class is annotated with `Completion` which sets the path for this resource
128128
as `/cards`.
129129
<2> The `@RequestScoped` annotation defines that this bean is
130130
request scoped. The request scope is active only for the duration of

docs/src/main/asciidoc/mp/guides/mp-tutorial.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ below:
169169
include::{sourcedir}/mp/guides/MpTutorialSnippets.java[tag=snippet_1, indent=0]
170170
----
171171
172-
<1> This class is annotated with `Path` which sets the path for this resource
172+
<1> This class is annotated with `Completion` which sets the path for this resource
173173
as `/greet`.
174174
<2> The `RequestScoped` annotation defines that this bean is
175175
request scoped. The request scope is active only for the duration of
@@ -420,7 +420,7 @@ include::{sourcedir}/mp/guides/MpTutorialSnippets.java[tag=snippet_6, indent=0]
420420
----
421421
422422
<1> The first of these two methods implements a new HTTP GET service
423-
that returns JSON, and it has a path parameter. The `Path` annotation
423+
that returns JSON, and it has a path parameter. The `Completion` annotation
424424
defines the next part of the path to be a parameter named `name`.
425425
In the method arguments the `PathParam("name")` annotation on
426426
`String name` has the effect of passing the parameter from the

docs/src/main/asciidoc/mp/jaxrs/jaxrs-applications.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ set to the default `annotated` value, it will be ignored.
6161
The discovery phase is carried out as follows (in no particular order):
6262
6363
1. Collect all beans that extend `Application`
64-
2. Collect all beans annotated with `@Path`
64+
2. Collect all beans annotated with `@Completion`
6565
3. Collect all beans annotated with `@Provider`
6666
6767
If no `Application` subclasses are found, create a _synthetic_ `Application` subclass that includes
@@ -71,13 +71,13 @@ If one or more `Application` subclasses are found, call the `getClasses` and `ge
7171
in each subclass using the collections in steps (2) and (3) only as defaults, i.e. if these methods
7272
both return empty sets.
7373
74-
NOTE: Helidon treats `@Path` and `@Provider` as bean-defining annotations but, as stated above,
74+
NOTE: Helidon treats `@Completion` and `@Provider` as bean-defining annotations but, as stated above,
7575
`Application` subclasses may require additional annotations depending on the discovery mode
7676
7777
== Setting Application Path
7878
7979
The application path, also known as context root, is the base URI used to serve all resource URIs provided
80-
by `@Path` annotation. This section describes how to set it with an annotation or configuration file.
80+
by `@Completion` annotation. This section describes how to set it with an annotation or configuration file.
8181
8282
When an `Application` subclass is provided, use the `@ApplicationPath`:
8383

docs/src/main/asciidoc/mp/metrics/metrics.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ the `/cards` endpoint is called.
141141
----
142142
include::{sourcedir}/mp/metrics/MetricsSnippets.java[tag=snippet_1, indent=0]
143143
----
144-
<1> This class is annotated with `Path` which sets the path for this resource
144+
<1> This class is annotated with `Completion` which sets the path for this resource
145145
as `/cards`.
146146
<2> The `@RequestScoped` annotation defines that this bean is
147147
request scoped. The request scope is active only for the duration of

docs/src/main/asciidoc/mp/websocket.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ include::{sourcedir}/mp/WebsocketSnippets.java[tag=snippet_2, indent=0]
116116
117117
Since `MessageBoardEndpoint` is just a POJO, it uses additional annotations for event handlers such as `@OnMessage`. One advantage of this approach, much like in the JAX-RS API, is that method signatures are not fixed. In the snipped above, the parameters (which could be specified in any order!) include the WebSocket session and the message received that triggered the call.
118118
119-
So what else is needed to run this Helidon MP app? Nothing else other than the supporting classes `MessageQueue` and `UppercaseEncoder`. Helidon MP declares both `@Path` and `@ServerEndpoint` as bean defining annotation, so all that is needed is for CDI discovery to be enabled --typically in your `beans.xml` file.
119+
So what else is needed to run this Helidon MP app? Nothing else other than the supporting classes `MessageQueue` and `UppercaseEncoder`. Helidon MP declares both `@Completion` and `@ServerEndpoint` as bean defining annotation, so all that is needed is for CDI discovery to be enabled --typically in your `beans.xml` file.
120120
121121
By default, both JAX-RS resources and WebSocket endpoints will be available under the _root path_ `"/"`. This default value can be overridden by providing subclasses/implementations for `jakarta.ws.rs.Application` and `jakarta.websocket.server.ServerApplicationConfig`, respectively. JAX-RS uses `@ApplicationPath` on application subclasses to provide this root path, but since there is no equivalent in the WebSocket API, Helidon MP uses its own annotation `@RoutingPath` on `jakarta.websocket.server.ServerApplicationConfig` implementations.
122122

docs/src/main/asciidoc/se/config/extensions.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ The "watcher" then watches for changes of the source and notifies the listener w
380380
This is designed to support sources that can react on changes (such as file system).
381381
When a polling mechanism is needed, please check `PollingStrategy` above.
382382
383-
The config system offers a change watcher for any `Path` based config source (such as `FileConfigSource`) and for the
383+
The config system offers a change watcher for any `Completion` based config source (such as `FileConfigSource`) and for the
384384
`etcd` config source.
385385
386386
To use a change watcher, simply create a config source using its builder and register the change watcher on the builder

docs/src/main/asciidoc/se/config/supported-formats.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ meta-configuration from a git config source set the following properties for the
348348
* `type` to `git` or `class` to `io.helidon.config.git.GitConfigSourceBuilder`
349349
* `path` (type `String`) - Relative path to the configuration file in repository.
350350
* `uri` (type `URI`) - URI to the git repository.
351-
* `directory` (type `Path`) - Directory with a cloned repository, by default
351+
* `directory` (type `Completion`) - Directory with a cloned repository, by default
352352
a temporary directory.
353353
* `branch` (type `String`) - git branch (default is `master`).
354354
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright (c) 2025 Oracle and/or its affiliates.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package io.helidon.integrations.mcp.server;
18+
19+
import java.util.function.Function;
20+
21+
/**
22+
* MCP server completion.
23+
*/
24+
public interface Completion {
25+
26+
/**
27+
* Completion information.
28+
*
29+
* @return information
30+
*/
31+
CompletionInfo info();
32+
33+
/**
34+
* Completion content.
35+
*
36+
* @return content
37+
*/
38+
CompletionContent complete(McpParameters parameters);
39+
40+
static Builder builder() {
41+
return new Builder();
42+
}
43+
44+
class Builder implements io.helidon.common.Builder<Builder, Completion> {
45+
private final CompletionInfo.Builder info = CompletionInfo.builder();
46+
private Function<McpParameters, CompletionContent> complete;
47+
48+
public Builder complete(Function<McpParameters, CompletionContent> complete) {
49+
this.complete = complete;
50+
return this;
51+
}
52+
53+
public Builder name(String name) {
54+
info.name(name);
55+
return this;
56+
}
57+
58+
public Builder uri(String uri) {
59+
info.uri(uri);
60+
return this;
61+
}
62+
63+
@Override
64+
public Completion build() {
65+
return new CompletionImpl(info.build(), complete);
66+
}
67+
}
68+
}

0 commit comments

Comments
 (0)