diff --git a/docs/config/io_helidon_integrations_neo4j.adoc b/docs/config/io_helidon_integrations_neo4j.adoc deleted file mode 100644 index 3ed9f02d122..00000000000 --- a/docs/config/io_helidon_integrations_neo4j.adoc +++ /dev/null @@ -1,57 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// - - 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. - 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. - -/////////////////////////////////////////////////////////////////////////////// - -// MANUALLY CREATED DOC - -:description: Configuration of io_helidon_integrations_neo4j -:keywords: helidon, config, io_helidon_integrations_neo4j.adoc -:basic-table-intro: The table below lists the configuration keys that configure io_helidon_integrations_neo4j.adoc - -= Neo4j Configuration - -// tag::config[] - - -MicroProfile configuration options: -[cols="3,3,2,5"] - -|=== -|key |type |default value |description - -|`mp.jwt.verify.publickey` |string |{nbsp} |The property allows the Public Verification Key text itself to be supplied as a string. - - -|`authentication.username`|string |{nbsp} | Neo4j authentication user name -|`authentication.password`|string |{nbsp} | Neo4j authentication password -|`authentication.enabled`|boolean |TRUE | If Neo4j authentication is enabled -|`encrypted`|boolean |FALSE | If Neo4j encryption is enabled -|`pool.metricsEnabled`|boolean |FALSE | If Neo4J metrics is enabled -|`pool.logLeakedSessions`|boolean |{nbsp} | Log leaking sessions -|`pool.maxConnectionPoolSize`|string |{nbsp} | Maximum connection pool size -|`pool.idleTimeBeforeConnectionTest`|string |{nbsp} | Idle time before connection test -|`pool.maxConnectionLifetime`|string |{nbsp} | Connection lifetime in seconds -|`pool.connectionAcquisitionTimeout`|string |{nbsp} | Connection Acquisition Timeout -|`trustsettings.trustStrategy`|string |{nbsp} | Trust Strategy: Trust All certificates, `TRUST_ALL_CERTIFICATES`, Trust custom certificates - -`TRUST_CUSTOM_CA_SIGNED_CERTIFICATES`, Trust system CA - `TRUST_SYSTEM_CA_SIGNED_CERTIFICATES` -|`trustsettings.certificate`|string |{nbsp} | Path to trusted certificate -|`trustsettings.hostnameVerificationEnabled`|string |FALSE | If hostname verification is enabled. - - -|=== - -// end::config[] diff --git a/docs/config/io_helidon_integrations_neo4j_Neo4j.adoc b/docs/config/io_helidon_integrations_neo4j_Neo4j.adoc new file mode 100644 index 00000000000..610b363c47c --- /dev/null +++ b/docs/config/io_helidon_integrations_neo4j_Neo4j.adoc @@ -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[] \ No newline at end of file diff --git a/docs/mp/integrations/neo4j.adoc b/docs/mp/integrations/neo4j.adoc index f17e4567169..a5893e97c3d 100644 --- a/docs/mp/integrations/neo4j.adoc +++ b/docs/mp/integrations/neo4j.adoc @@ -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. @@ -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 diff --git a/docs/se/integrations/neo4j.adoc b/docs/se/integrations/neo4j.adoc index 737b9559bb5..9e2d3875349 100644 --- a/docs/se/integrations/neo4j.adoc +++ b/docs/se/integrations/neo4j.adoc @@ -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 diff --git a/integrations/neo4j/neo4j/pom.xml b/integrations/neo4j/neo4j/pom.xml index 5c712875e59..d2fa7c21187 100644 --- a/integrations/neo4j/neo4j/pom.xml +++ b/integrations/neo4j/neo4j/pom.xml @@ -48,6 +48,11 @@ helidon-common-features-api true + + io.helidon.config + helidon-config-metadata + true + io.helidon.config helidon-config-mp @@ -67,6 +72,11 @@ helidon-common-features-processor ${helidon.version} + + io.helidon.config + helidon-config-metadata-processor + ${helidon.version} + diff --git a/integrations/neo4j/neo4j/src/main/java/io/helidon/integrations/neo4j/Neo4j.java b/integrations/neo4j/neo4j/src/main/java/io/helidon/integrations/neo4j/Neo4j.java index 703f3ac869d..d9a18b3ad5e 100644 --- a/integrations/neo4j/neo4j/src/main/java/io/helidon/integrations/neo4j/Neo4j.java +++ b/integrations/neo4j/neo4j/src/main/java/io/helidon/integrations/neo4j/Neo4j.java @@ -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; @@ -75,6 +77,7 @@ public Driver driver() { /** * Fluent API builder for Neo4j. */ + @Configured public static final class Builder implements io.helidon.common.Builder { private boolean encrypted; private boolean authenticationEnabled = true; @@ -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; @@ -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; @@ -174,6 +179,7 @@ public Builder password(String password) { * @param uri parameter * @return Builder */ + @ConfiguredOption public Builder uri(String uri) { Objects.requireNonNull(uri); this.uri = uri; @@ -181,11 +187,12 @@ public Builder uri(String uri) { } /** - * Enable ecrypted field. + * Enable encrypted field. * * @param encrypted parameter * @return Builder */ + @ConfiguredOption public Builder encrypted(boolean encrypted) { this.encrypted = encrypted; return this; @@ -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; @@ -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; @@ -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; @@ -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; @@ -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; @@ -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; @@ -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; @@ -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; diff --git a/integrations/neo4j/neo4j/src/main/java/module-info.java b/integrations/neo4j/neo4j/src/main/java/module-info.java index f103034e3e8..74603920ff6 100644 --- a/integrations/neo4j/neo4j/src/main/java/module-info.java +++ b/integrations/neo4j/neo4j/src/main/java/module-info.java @@ -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; diff --git a/integrations/vault/auths/approle/pom.xml b/integrations/vault/auths/approle/pom.xml index f3ad4efa7b7..e85089f316a 100644 --- a/integrations/vault/auths/approle/pom.xml +++ b/integrations/vault/auths/approle/pom.xml @@ -73,6 +73,11 @@ helidon-common-features-processor ${helidon.version} + + io.helidon.config + helidon-config-metadata-processor + ${helidon.version} +