Skip to content

Commit

Permalink
DOCS: SE Diffs 3.x to Main *.adoc (#7515)
Browse files Browse the repository at this point in the history
Forward port of 3.x doc changes to 4.x
  • Loading branch information
ljamen authored Sep 13, 2023
1 parent cb3e8bd commit 80b8a56
Show file tree
Hide file tree
Showing 33 changed files with 406 additions and 340 deletions.
14 changes: 10 additions & 4 deletions docs/se/aot.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////

Copyright (c) 2020, 2022 Oracle and/or its affiliates.
Copyright (c) 2020, 2023 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -16,12 +16,18 @@

///////////////////////////////////////////////////////////////////////////////
= GraalVM native image
= GraalVM Native Image
:description: Helidon AOT using GraalVM native-image
:keywords: helidon, aot, native, native-image, image, executable, se
:rootdir: {docdir}/..
include::{rootdir}/includes/se.adoc
include::{rootdir}/includes/se.adoc[]
== Contents
- <<Overview, Overview>>
- <<AOT Supported Modules, AOT Supported Modules>>
== Overview
Helidon applications can be compiled into a native executable using GraalVM
native image.
Expand All @@ -35,7 +41,7 @@ build a native image from your application:
2. Run Maven command `mvn clean package -Pnative-image`
3. Execute the native executable created in `target` directory of your project
== AOT supported modules
== AOT Supported Modules
Some Helidon components are not (yet) supported in native image, some have
restrictions. The following table lists all Helidon features and their support
Expand Down
15 changes: 7 additions & 8 deletions docs/se/cors.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
///////////////////////////////////////////////////////////////////////////////
= CORS in Helidon SE
:toc:
:toc-placement: preamble
:description: Helidon SE CORS Support
:keywords: helidon, java, cors, se, configuration, services
:feature-name: CORS
Expand Down Expand Up @@ -83,10 +82,10 @@ by including CORS into the routing you construct for your application.
For each distinct resource or subresource your application exposes:
. Create a link:{webserver-cors-javadoc-base-url}/io/helidon/reactive/webserver/cors/CorsSupport.html[`CorsSupport`] instance
corresponding to the resource.
. Create a link:{webserver-cors-javadoc-base-url}/io/helidon/webserver/cors/CorsSupport.html[`CorsSupport`] instance
corresponding to the resource.
. For each different type of sharing you want to provide for that resource:
.. Create a link:{webserver-cors-javadoc-base-url}/io/helidon/reactive/webserver/cors/CrossOriginConfig.html[`CrossOriginConfig`] instance. +
.. Create a link:{webserver-cors-javadoc-base-url}/io/helidon/webserver/cors/CrossOriginConfig.html[`CrossOriginConfig`] instance.
The `CrossOriginConfig` Java class represents the details for a particular type of sharing, such as
which origins are allowed to share via which HTTP methods, etc.
.. Add the `CrossOriginConfig` to the `CorsSupport` instance for this resource.
Expand Down Expand Up @@ -120,7 +119,7 @@ private static Routing createRouting(Config config) {
MetricsSupport metrics = MetricsSupport.create();
GreetService greetService = new GreetService(config);
HealthSupport health = HealthSupport.builder()
.add(HealthChecks.healthChecks()) // Adds a convenient set of checks
.addLiveness(HealthChecks.healthChecks()) // Adds a convenient set of checks
.build();
CorsSupport corsSupport = CorsSupport.builder() // <1>
.addCrossOriginConfig(CrossOriginConfig.builder() // <2>
Expand Down Expand Up @@ -202,7 +201,7 @@ private static Routing createRouting(Config config) {
MetricsSupport metrics = MetricsSupport.create();
GreetService greetService = new GreetService(config);
HealthSupport health = HealthSupport.builder()
.add(HealthChecks.healthChecks()) // Adds a convenient set of checks
.addLiveness(HealthChecks.healthChecks()) // Adds a convenient set of checks
.build();
CorsSupport.Builder builder = CorsSupport.builder();
Expand Down Expand Up @@ -283,7 +282,7 @@ private static Routing createRouting(Config config) {
.build();
GreetService greetService = new GreetService(config);
HealthSupport health = HealthSupport.builder()
.add(HealthChecks.healthChecks()) // Adds a convenient set of checks
.addLiveness(HealthChecks.healthChecks()) // Adds a convenient set of checks
.build();
return Routing.builder()
Expand Down
19 changes: 15 additions & 4 deletions docs/se/dbclient.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@
include::{rootdir}/includes/se.adoc[]
== Contents
- <<Overview, Overview>>
- <<Maven Coordinates, Maven Coordinates>>
- <<Usage, Usage>>
- <<API, API>>
- <<Configuration, Configuration>>
- <<Additional Information, Additional Information>>
== Overview
The Helidon SE DB Client provides a unified, reactive API for working with databases in non-blocking way.
include::{rootdir}/includes/dependencies.adoc[]
Expand Down Expand Up @@ -54,12 +65,12 @@ Or to use with MongoDB client add the following dependency:
</dependency>
----
== Helidon DB Client Features Overview
== Usage
The DB Client simplifies how you work with databases by abstracting the type of the database.
The API can be used both for relational and non-relational databases.
The API provides:
== API
* Database configuration abstraction
+
Expand Down Expand Up @@ -89,7 +100,7 @@ for backpressure (result set is processed as requested by the query subscriber)
The API offers support for health checks, metrics and tracing.
== Getting Started
== Configuration
Before you begin you must add the DB Client dependencies and configure the client.
Expand Down Expand Up @@ -292,7 +303,7 @@ Execution of a query statement will always return `Multi<DbRow>>`. `Multi` has s
* `Single<List<DbRow>> collectList()` to collect all rows and return them as a promise of `List<DbRow>`
* `<U> Multi<U> map(…)` to map returned result using provided mapper
== Next Steps
== Additional Information
Now that you understand how to build and execute statements, try it for yourself.
link:{helidon-github-tree-url}/examples/dbclient[DB Client Examples].
Expand Down
2 changes: 1 addition & 1 deletion docs/se/fault-tolerance.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////

Copyright (c) 2023 Oracle and/or its affiliates.
Copyright (c) 2020, 2023 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion docs/se/graphql.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////

Copyright (c) 2019, 2022 Oracle and/or its affiliates.
Copyright (c) 2019, 2023 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
39 changes: 27 additions & 12 deletions docs/se/grpc/client.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////

Copyright (c) 2019, 2022 Oracle and/or its affiliates.
Copyright (c) 2019, 2023 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,8 +29,19 @@ include::{rootdir}/includes/se.adoc[]
- <<Overview, Overview>>
- <<Maven Coordinates, Maven Coordinates>>
- <<Usage, Usage>>
- <<Configuration, Configuration>>
- <<Examples, Examples>>
** <<Client Implementation Basics, Client Implementation Basics>>
** <<Creating gRPC Clients From protoc Generated Artifacts, Creating gRPC Clients From protoc Generated Artifacts>>
** <<Invoking a Server Streaming Method on the StringService (Generated from protoc), Invoking a Server Streaming Method on the StringService (Generated from protoc)>>
** <<Invoking a Bi-Directional Streaming Method on the StringService (Generated from protoc), Invoking a Bi-Directional Streaming Method on the StringService (Generated from protoc)>>
** <<Programmatically Creating ClientServiceDescriptor for StringService, Programmatically Creating ClientServiceDescriptor for StringService>>
** <<Creating gRPC Clients for Non-Protobuf Services, Creating gRPC Clients for Non-Protobuf Services>>
** <<Marshalling, Marshalling>>
- <<Configuration, Configuration>>
** <<Configuring the ClientServiceDescriptor, Configuring the ClientServiceDescriptor>>
** <<Configuring the gRPC Channel, Configuring the gRPC Channel>>
- <<Examples, Examples>>
** <<Quick Start, Quick Start>>
** <<Additional gRPC Client Examples, Additional gRPC Client Examples>>
== Overview
Expand Down Expand Up @@ -79,7 +90,11 @@ available to the client.
. The next step is to create a gRPC `Channel` to use to communicate with the server.
. Finally, we create an instance of `GrpcServiceClient` passing the `ClientMethodDescriptor` and the `Channel` instances.
=== Creating gRPC clients from `protoc` generated artifacts
=== Creating gRPC Clients From protoc Generated Artifacts
- <<Creating and Initializing a ClientServiceDescriptor for StringService (Generated from protoc), Creating and Initializing a ClientServiceDescriptor for StringService (Generated from protoc)>>
- <<Invoking a Unary Method on the StringService, Invoking a Unary Method on the StringService>>
- <<Invoking a Client Streaming Method on the StringService, Invoking a Client Streaming Method on the StringService>>
As mentioned above, the easiest way to create a `ClientServiceDescriptor` is to create it from an `io.grpc.ServiceDescriptor` or
from a `io.grpc.BindableService`. It is fairly trivial to obtain these from a service generated from artifacts generated
Expand Down Expand Up @@ -109,7 +124,7 @@ If you run it through `protoc`, it will generate a class (among other things) ca
Assuming that the `StringService` server is running on port 1408, here is how you can create a Helidon gRPC
Client that uses the Client Framework to invoke various types of gRPC methods.
==== Creating and initializing a ClientServiceDescriptor for StringService (generated from `protoc`)
==== Creating and Initializing a ClientServiceDescriptor for StringService (Generated from protoc)
Let's build a class called `ProtoBasedStringServiceClient` that invokes the various types of
gRPC methods that our `StringService` offers.
Expand Down Expand Up @@ -167,7 +182,7 @@ and `Channel`. This `client` reference will be used to invoke various gRPC metho
of this class can be used wherever a `io.grpc.StreamObserver` is required (like server streaming,
bi-directional streaming methods).
==== Invoking a unary method on the StringService
==== Invoking a Unary Method on the StringService
The Client Framework provides many helper methods to invoke gRPC unary methods.
Expand Down Expand Up @@ -202,7 +217,7 @@ as its response thus allowing the client to obtain the result asynchronously.
<3> Here, we invoke the `unary` method by passing the `StringMessageStream` whose `onNext` method
will be called (once) when the result is available.
==== Invoking a client streaming method on the StringService
==== Invoking a Client Streaming Method on the StringService
Let's invoke the `Join` method which causes the server to return a single result *after* the client
has streamed the request values to the server. The gRPC API expects the client application to provide
Expand Down Expand Up @@ -264,7 +279,7 @@ stream.
<5> When all values have been stream, the client invokes the `onCompleted()` method signal that all values
have been streamed from the client.
=== Invoking a server streaming method on the StringService (generated from `protoc`)
=== Invoking a Server Streaming Method on the StringService (Generated from protoc)
Let's invoke the "Split" method which causes the server to stream the results back.
Expand Down Expand Up @@ -295,7 +310,7 @@ public class ProtoBasedStringServiceClient {
The server sends a stream of words by calling the `onNext()` method on the `StringMessageStream` for
each word.
=== Invoking a bi-directional streaming method on the StringService (generated from `protoc`)
=== Invoking a Bi-Directional Streaming Method on the StringService (Generated from protoc)
Now let's invoke the `Echo` method in which both the client and the server have to stream
the request and response.
Expand Down Expand Up @@ -336,7 +351,7 @@ server.
<4> We call the `onCompleted()` method on the `clientStream` to signal that the client has
streamed all its values.
=== Programmatically creating ClientServiceDescriptor for StringService
=== Programmatically Creating ClientServiceDescriptor for StringService
Assuming that the service is still running on port 1408, let's see how to create our Client
without using the ``StringService``'s proto `ServiceDescriptor`.
Expand Down Expand Up @@ -420,7 +435,7 @@ At this point the `client` object can be used to invoke any of the four types of
earlier sections.
=== Creating gRPC clients for non-protobuf services
=== Creating gRPC Clients for Non-Protobuf Services
If your service is *not* using protobuf for serialization, then the client framework allows
you to programmatically initialize `ClientMethodDescriptor` and create clients to invoke
Expand Down Expand Up @@ -535,7 +550,7 @@ a client that can be used to define the set of methods described by the specifie
<6> Invoke the `SayHello` method which returns a `CompletionStage<String>`.
<7> Print the result.
=== Additional gRPC client examples
=== Additional gRPC Client Examples
A set of gRPC client examples for Helidon SE can be found in the following links:
* link:{helidon-github-tree-url}/examples/grpc/client-standalone[Basic gRPC Standalone Client]
Expand Down
39 changes: 29 additions & 10 deletions docs/se/grpc/server.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////

Copyright (c) 2019, 2022 Oracle and/or its affiliates.
Copyright (c) 2019, 2023 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,8 +29,19 @@ include::{rootdir}/includes/se.adoc[]
- <<Overview, Overview>>
- <<Maven Coordinates, Maven Coordinates>>
- <<Usage, Usage>>
** <<gRPC Server Routing, gRPC Server Routing>>
** <<Service Implementation, Service Implementation>>
** <<Interceptors, Interceptors>>
** <<Service Health Checks, Service Health Checks>>
** <<Service Metrics, Service Metrics>>
** <<Security, Security>>
** <<Marshalling, Marshalling>>
- <<Configuration, Configuration>>
** <<Configuring the gRPC Server in the Code, Configuring the gRPC Server in the Code>>
** <<Configuring the gRPC Server in a Configuration File, Configuring the gRPC Server in a Configuration File>>
- <<Examples, Examples>>
** <<Quick Start, Quick Start>>
** <<Additional gRPC Server Examples, Additional gRPC Server Examples>>
== Overview
The Helidon gRPC server provides a framework for creating link:http://grpc.io/[gRPC] applications.
Expand Down Expand Up @@ -78,6 +89,8 @@ If `gRPC server security` is required as described in the <<Security>> section,
== Usage
=== gRPC Server Routing
- <<Customizing Service Definitions, Customizing Service Definitions>>
- <<Specifying Global Interceptors, Specifying Global Interceptors>>
Unlike the webserver, which allows you to route requests based on path expression
and the HTTP verb, the gRPC server always routes requests based on the service and
Expand Down Expand Up @@ -471,6 +484,12 @@ All gRPC health checks will now be available via the `/health` REST endpoint, in
addition to the standard gRPC `HealthService`
=== Service Metrics
- <<Enabling Metrics Capture, Enabling Metrics Capture>>
- <<Overriding Metrics Capture, Overriding Metrics Capture>>
- <<Exposing Metrics Externally, Exposing Metrics Externally>>
- <<Specifying Metric Metadata, Specifying Metric Metadata>>
- <<Overriding the Metric Name, Overriding the Metric Name>>
The Helidon gRPC server has built-in support for metrics capture, which allows
service developers to easily enable application-level metrics for their services.
Expand Down Expand Up @@ -724,7 +743,7 @@ security
roles-allowed: ["admin"]
----
===== Client security
===== Client Security
When using the Helidon SE gRPC client, API security can be configured for a gRPC service
or at the individual method level. The client API has a custom `CallCredentials` implementation that
integrates with the Helidon security APIs.
Expand All @@ -737,8 +756,8 @@ Security security = Security.builder() // <1>
.build();
GrpcClientSecurity clientSecurity = GrpcClientSecurity.builder(security.createContext("test.client")) // <2>
.property(HttpBasicAuthProvider.EP_PROPERTY_OUTBOUND_USER, user)
.property(HttpBasicAuthProvider.EP_PROPERTY_OUTBOUND_PASSWORD, password)
.property(EndpointConfig.PROPERTY_OUTBOUND_ID, user)
.property(EndpointConfig.PROPERTY_OUTBOUND_SECRET, password)
.build();
ClientServiceDescriptor descriptor = ClientServiceDescriptor // <3>
Expand All @@ -764,8 +783,8 @@ property expected by the basic auth provider.
.Example configuring client security for a specific method
----
GrpcClientSecurity clientSecurity = GrpcClientSecurity.builder(security.createContext("test.client")) // <1>
.property(HttpBasicAuthProvider.EP_PROPERTY_OUTBOUND_USER, user)
.property(HttpBasicAuthProvider.EP_PROPERTY_OUTBOUND_PASSWORD, password)
.property(EndpointConfig.PROPERTY_OUTBOUND_ID, user)
.property(EndpointConfig.PROPERTY_OUTBOUND_SECRET, password)
.build();
ClientServiceDescriptor descriptor = ClientServiceDescriptor // <2>
Expand Down Expand Up @@ -848,9 +867,9 @@ include::{rootdir}/includes/grpc-marshalling.adoc[leveloffset=2]
Configure the gRPC server using the Helidon configuration framework, either programmatically
or via a configuration file.
=== Configuring the gRPC server in your code
=== Configuring the gRPC Server in the Code
The easiest way to configure the gRPC server is in your application code.
The easiest way to configure the gRPC server is in the application code.
[source,java]
----
Expand All @@ -863,7 +882,7 @@ GrpcServer grpcServer = GrpcServer.create(configuration, routing);
See all configuration options
link:{javadoc-base-url}/io.helidon.grpc/GrpcServerConfiguration.html[here].
=== Configuring the gRPC server in a configuration file
=== Configuring the gRPC Server in a Configuration File
You can also define the gRPC server configuration in a file.
Expand Down Expand Up @@ -925,7 +944,7 @@ static class HelloService implements GrpcService { // <5>
<6> Specify a custom marshaller using the built-in JsonB marshaller to marshall requests and responses.
<7> Add unary method `HelloService/SayHello` to the service definition.
=== Additional gRPC server examples
=== Additional gRPC Server Examples
A set of gRPC server examples for Helidon SE can be found in the following links:
* link:{helidon-github-tree-url}/examples/grpc/basics[Basic gRPC Server]
Expand Down
2 changes: 1 addition & 1 deletion docs/se/guides/config.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////

Copyright (c) 2019, 2022 Oracle and/or its affiliates.
Copyright (c) 2019, 2023 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 80b8a56

Please sign in to comment.