Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x] - Update Neo4j module to generated config #7997

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 0 additions & 57 deletions docs/config/io_helidon_integrations_neo4j.adoc

This file was deleted.

62 changes: 62 additions & 0 deletions docs/config/io_helidon_integrations_neo4j_Neo4j.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
///////////////////////////////////////////////////////////////////////////////

Copyright (c) 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.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

///////////////////////////////////////////////////////////////////////////////

ifndef::rootdir[:rootdir: {docdir}/..]
:description: Configuration of io.helidon.integrations.neo4j.Neo4j
:keywords: helidon, config, io.helidon.integrations.neo4j.Neo4j
:basic-table-intro: The table below lists the configuration keys that configure io.helidon.integrations.neo4j.Neo4j
include::{rootdir}/includes/attributes.adoc[]

= Neo4j (integrations.neo4j) Configuration

// tag::config[]


Type: link:{javadoc-base-url}/io.helidon.integrations.neo4j/io/helidon/integrations/neo4j/Neo4j.html[io.helidon.integrations.neo4j.Neo4j]




== Configuration options



.Optional configuration options
[cols="3,3a,2,5a"]

|===
|key |type |default value |description

|`authentication-enabled` |boolean |`true` |Enable authentication.
|`certificate` |Path |{nbsp} |Set certificate path.
|`connection-acquisition-timeout` |Duration |`PT1MS` |Set connection acquisition timeout.
|`encrypted` |boolean |{nbsp} |Enable encrypted field.
|`hostname-verification-enabled` |boolean |{nbsp} |Enable hostname verification.
|`idle-time-before-connection-test` |Duration |`PT-1MS` |Set idle time.
|`log-leaked-sessions` |boolean |{nbsp} |Enable log leaked sessions.
|`max-connection-lifetime` |Duration |`PT5H` |Set max life time.
|`max-connection-pool-size` |int |`100` |Set pool size.
|`metrics-enabled` |boolean |{nbsp} |Enable metrics.
|`password` |string |{nbsp} |Create password.
|`trust-strategy` |TrustStrategy (TRUST_ALL_CERTIFICATES, TRUST_CUSTOM_CA_SIGNED_CERTIFICATES, TRUST_SYSTEM_CA_SIGNED_CERTIFICATES) |{nbsp} |Set trust strategy.
|`uri` |string |{nbsp} |Create uri.
|`username` |string |{nbsp} |Create username.

|===

// end::config[]
4 changes: 2 additions & 2 deletions docs/mp/integrations/neo4j.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////

Copyright (c) 2022 Oracle and/or its affiliates.
Copyright (c) 2022, 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 @@ -78,7 +78,7 @@ The driver can be used according to the link:https://neo4j.com/developer/java/[N

== Configuration

include::{rootdir}/config/io_helidon_integrations_neo4j.adoc[leveloffset=+1,tag=config]
/include::{rootdir}/config/io_helidon_integrations_neo4j_Neo4j.adoc[leveloffset=+1,tag=config]

== Examples

Expand Down
2 changes: 1 addition & 1 deletion docs/se/integrations/neo4j.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ The driver can be used according to the link:https://neo4j.com/developer/java/[N

== Configuration

include::{rootdir}/config/io_helidon_integrations_neo4j.adoc[leveloffset=+1,tag=config]
include::{rootdir}/config/io_helidon_integrations_neo4j_Neo4j.adoc[leveloffset=+1,tag=config]

== Examples

Expand Down
10 changes: 10 additions & 0 deletions integrations/neo4j/neo4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
<artifactId>helidon-common-features-api</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.helidon.config</groupId>
<artifactId>helidon-config-metadata</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.helidon.config</groupId>
<artifactId>helidon-config-mp</artifactId>
Expand All @@ -67,6 +72,11 @@
<artifactId>helidon-common-features-processor</artifactId>
<version>${helidon.version}</version>
</path>
<path>
<groupId>io.helidon.config</groupId>
<artifactId>helidon-config-metadata-processor</artifactId>
<version>${helidon.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import java.util.logging.Level;

import io.helidon.common.config.Config;
import io.helidon.config.metadata.Configured;
import io.helidon.config.metadata.ConfiguredOption;

import org.neo4j.driver.AuthToken;
import org.neo4j.driver.AuthTokens;
Expand Down Expand Up @@ -75,6 +77,7 @@ public Driver driver() {
/**
* Fluent API builder for Neo4j.
*/
@Configured
public static final class Builder implements io.helidon.common.Builder<Builder, Neo4j> {
private boolean encrypted;
private boolean authenticationEnabled = true;
Expand Down Expand Up @@ -148,6 +151,7 @@ public Builder config(Config config) {
* @param username parameter
* @return Builder
*/
@ConfiguredOption
public Builder username(String username) {
Objects.requireNonNull(username);
this.username = username;
Expand All @@ -162,6 +166,7 @@ public Builder username(String username) {
* @param password parameter
* @return Builder
*/
@ConfiguredOption
public Builder password(String password) {
Objects.requireNonNull(password);
this.password = password;
Expand All @@ -174,18 +179,20 @@ public Builder password(String password) {
* @param uri parameter
* @return Builder
*/
@ConfiguredOption
public Builder uri(String uri) {
Objects.requireNonNull(uri);
this.uri = uri;
return this;
}

/**
* Enable ecrypted field.
* Enable encrypted field.
*
* @param encrypted parameter
* @return Builder
*/
@ConfiguredOption
public Builder encrypted(boolean encrypted) {
this.encrypted = encrypted;
return this;
Expand All @@ -197,28 +204,32 @@ public Builder encrypted(boolean encrypted) {
* @param authenticationEnabled parameter
* @return Builder
*/
@ConfiguredOption("true")
public Builder authenticationEnabled(boolean authenticationEnabled) {
this.authenticationEnabled = authenticationEnabled;
return this;
}

/**
* Enagle metrics.
* Enable metrics.
*
* @param metricsEnabled parameter
* @return Builder
*/
@ConfiguredOption

public Builder metricsEnabled(boolean metricsEnabled) {
this.metricsEnabled = metricsEnabled;
return this;
}

/**
* Eable log leaked sessions.
* Enable log leaked sessions.
*
* @param logLeakedSessions parameter
* @return Builder
*/
@ConfiguredOption
public Builder logLeakedSessions(boolean logLeakedSessions) {
this.logLeakedSessions = logLeakedSessions;
return this;
Expand All @@ -230,6 +241,7 @@ public Builder logLeakedSessions(boolean logLeakedSessions) {
* @param maxConnectionPoolSize parameter
* @return Builder
*/
@ConfiguredOption("100")
public Builder maxConnectionPoolSize(int maxConnectionPoolSize) {
this.maxConnectionPoolSize = maxConnectionPoolSize;
return this;
Expand All @@ -241,6 +253,7 @@ public Builder maxConnectionPoolSize(int maxConnectionPoolSize) {
* @param idleTimeBeforeConnectionTest parameter
* @return Builder
*/
@ConfiguredOption("PT1MS")
public Builder idleTimeBeforeConnectionTest(Duration idleTimeBeforeConnectionTest) {
Objects.requireNonNull(idleTimeBeforeConnectionTest);
this.idleTimeBeforeConnectionTest = idleTimeBeforeConnectionTest;
Expand All @@ -253,6 +266,7 @@ public Builder idleTimeBeforeConnectionTest(Duration idleTimeBeforeConnectionTes
* @param maxConnectionLifetime parameter
* @return Builder
*/
@ConfiguredOption("PT5H")
public Builder maxConnectionLifetime(Duration maxConnectionLifetime) {
Objects.requireNonNull(maxConnectionLifetime);
this.maxConnectionLifetime = maxConnectionLifetime;
Expand All @@ -265,6 +279,7 @@ public Builder maxConnectionLifetime(Duration maxConnectionLifetime) {
* @param connectionAcquisitionTimeout parameter
* @return Builder
*/
@ConfiguredOption("PT1M")
public Builder connectionAcquisitionTimeout(Duration connectionAcquisitionTimeout) {
Objects.requireNonNull(connectionAcquisitionTimeout);
this.connectionAcquisitionTimeout = connectionAcquisitionTimeout;
Expand All @@ -277,6 +292,7 @@ public Builder connectionAcquisitionTimeout(Duration connectionAcquisitionTimeou
* @param strategy parameter
* @return Builder
*/
@ConfiguredOption(type = TrustStrategy.class)
public Builder trustStrategy(TrustStrategy strategy) {
this.trustStrategy = strategy;
return this;
Expand All @@ -288,6 +304,7 @@ public Builder trustStrategy(TrustStrategy strategy) {
* @param certFile parameter
* @return Builder
*/
@ConfiguredOption
public Builder certificate(Path certFile) {
this.certFile = certFile;
return this;
Expand All @@ -299,6 +316,7 @@ public Builder certificate(Path certFile) {
* @param hostnameVerificationEnabled parameter
* @return Builder
*/
@ConfiguredOption
public Builder hostnameVerificationEnabled(boolean hostnameVerificationEnabled) {
this.hostnameVerificationEnabled = hostnameVerificationEnabled;
return this;
Expand Down
5 changes: 3 additions & 2 deletions integrations/neo4j/neo4j/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@
in = HelidonFlavor.SE,
path = "Neo4j"
)
@SuppressWarnings({ "requires-automatic", "requires-transitive-automatic" })
@SuppressWarnings({ "requires-automatic"})
module io.helidon.integrations.neo4j {

requires java.logging;
requires io.helidon.common;
requires java.logging;

requires static io.helidon.common.features.api;
requires static io.helidon.config.metadata;

requires transitive io.helidon.common.config;
requires transitive org.neo4j.driver;
Expand Down
5 changes: 5 additions & 0 deletions integrations/vault/auths/approle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
<artifactId>helidon-common-features-processor</artifactId>
<version>${helidon.version}</version>
</path>
<path>
<groupId>io.helidon.config</groupId>
<artifactId>helidon-config-metadata-processor</artifactId>
<version>${helidon.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
Expand Down