Skip to content

Commit ea20930

Browse files
authored
[4.x] - Update Neo4j module to generated config (helidon-io#7997)
* Update to generated config --------- Signed-off-by: Dmitry Aleksandrov <dmitry.aleksandrov@oracle.com>
1 parent 230f4dd commit ea20930

8 files changed

Lines changed: 104 additions & 65 deletions

File tree

docs/config/io_helidon_integrations_neo4j.adoc

Lines changed: 0 additions & 57 deletions
This file was deleted.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
///////////////////////////////////////////////////////////////////////////////
2+
3+
Copyright (c) 2023 Oracle and/or its affiliates.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
17+
///////////////////////////////////////////////////////////////////////////////
18+
19+
ifndef::rootdir[:rootdir: {docdir}/..]
20+
:description: Configuration of io.helidon.integrations.neo4j.Neo4j
21+
:keywords: helidon, config, io.helidon.integrations.neo4j.Neo4j
22+
:basic-table-intro: The table below lists the configuration keys that configure io.helidon.integrations.neo4j.Neo4j
23+
include::{rootdir}/includes/attributes.adoc[]
24+
25+
= Neo4j (integrations.neo4j) Configuration
26+
27+
// tag::config[]
28+
29+
30+
Type: link:{javadoc-base-url}/io.helidon.integrations.neo4j/io/helidon/integrations/neo4j/Neo4j.html[io.helidon.integrations.neo4j.Neo4j]
31+
32+
33+
34+
35+
== Configuration options
36+
37+
38+
39+
.Optional configuration options
40+
[cols="3,3a,2,5a"]
41+
42+
|===
43+
|key |type |default value |description
44+
45+
|`authentication-enabled` |boolean |`true` |Enable authentication.
46+
|`certificate` |Path |{nbsp} |Set certificate path.
47+
|`connection-acquisition-timeout` |Duration |`PT1MS` |Set connection acquisition timeout.
48+
|`encrypted` |boolean |{nbsp} |Enable encrypted field.
49+
|`hostname-verification-enabled` |boolean |{nbsp} |Enable hostname verification.
50+
|`idle-time-before-connection-test` |Duration |`PT-1MS` |Set idle time.
51+
|`log-leaked-sessions` |boolean |{nbsp} |Enable log leaked sessions.
52+
|`max-connection-lifetime` |Duration |`PT5H` |Set max life time.
53+
|`max-connection-pool-size` |int |`100` |Set pool size.
54+
|`metrics-enabled` |boolean |{nbsp} |Enable metrics.
55+
|`password` |string |{nbsp} |Create password.
56+
|`trust-strategy` |TrustStrategy (TRUST_ALL_CERTIFICATES, TRUST_CUSTOM_CA_SIGNED_CERTIFICATES, TRUST_SYSTEM_CA_SIGNED_CERTIFICATES) |{nbsp} |Set trust strategy.
57+
|`uri` |string |{nbsp} |Create uri.
58+
|`username` |string |{nbsp} |Create username.
59+
60+
|===
61+
62+
// end::config[]

docs/mp/integrations/neo4j.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
///////////////////////////////////////////////////////////////////////////////
22

3-
Copyright (c) 2022 Oracle and/or its affiliates.
3+
Copyright (c) 2022, 2023 Oracle and/or its affiliates.
44

55
Licensed under the Apache License, Version 2.0 (the "License");
66
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
7878
7979
== Configuration
8080
81-
include::{rootdir}/config/io_helidon_integrations_neo4j.adoc[leveloffset=+1,tag=config]
81+
/include::{rootdir}/config/io_helidon_integrations_neo4j_Neo4j.adoc[leveloffset=+1,tag=config]
8282
8383
== Examples
8484

docs/se/integrations/neo4j.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ The driver can be used according to the link:https://neo4j.com/developer/java/[N
7878
7979
== Configuration
8080
81-
include::{rootdir}/config/io_helidon_integrations_neo4j.adoc[leveloffset=+1,tag=config]
81+
include::{rootdir}/config/io_helidon_integrations_neo4j_Neo4j.adoc[leveloffset=+1,tag=config]
8282
8383
== Examples
8484

integrations/neo4j/neo4j/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@
4848
<artifactId>helidon-common-features-api</artifactId>
4949
<optional>true</optional>
5050
</dependency>
51+
<dependency>
52+
<groupId>io.helidon.config</groupId>
53+
<artifactId>helidon-config-metadata</artifactId>
54+
<optional>true</optional>
55+
</dependency>
5156
<dependency>
5257
<groupId>io.helidon.config</groupId>
5358
<artifactId>helidon-config-mp</artifactId>
@@ -67,6 +72,11 @@
6772
<artifactId>helidon-common-features-processor</artifactId>
6873
<version>${helidon.version}</version>
6974
</path>
75+
<path>
76+
<groupId>io.helidon.config</groupId>
77+
<artifactId>helidon-config-metadata-processor</artifactId>
78+
<version>${helidon.version}</version>
79+
</path>
7080
</annotationProcessorPaths>
7181
</configuration>
7282
</plugin>

integrations/neo4j/neo4j/src/main/java/io/helidon/integrations/neo4j/Neo4j.java

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
import java.util.logging.Level;
2424

2525
import io.helidon.common.config.Config;
26+
import io.helidon.config.metadata.Configured;
27+
import io.helidon.config.metadata.ConfiguredOption;
2628

2729
import org.neo4j.driver.AuthToken;
2830
import org.neo4j.driver.AuthTokens;
@@ -75,6 +77,7 @@ public Driver driver() {
7577
/**
7678
* Fluent API builder for Neo4j.
7779
*/
80+
@Configured
7881
public static final class Builder implements io.helidon.common.Builder<Builder, Neo4j> {
7982
private boolean encrypted;
8083
private boolean authenticationEnabled = true;
@@ -148,6 +151,7 @@ public Builder config(Config config) {
148151
* @param username parameter
149152
* @return Builder
150153
*/
154+
@ConfiguredOption
151155
public Builder username(String username) {
152156
Objects.requireNonNull(username);
153157
this.username = username;
@@ -162,6 +166,7 @@ public Builder username(String username) {
162166
* @param password parameter
163167
* @return Builder
164168
*/
169+
@ConfiguredOption
165170
public Builder password(String password) {
166171
Objects.requireNonNull(password);
167172
this.password = password;
@@ -174,18 +179,20 @@ public Builder password(String password) {
174179
* @param uri parameter
175180
* @return Builder
176181
*/
182+
@ConfiguredOption
177183
public Builder uri(String uri) {
178184
Objects.requireNonNull(uri);
179185
this.uri = uri;
180186
return this;
181187
}
182188

183189
/**
184-
* Enable ecrypted field.
190+
* Enable encrypted field.
185191
*
186192
* @param encrypted parameter
187193
* @return Builder
188194
*/
195+
@ConfiguredOption
189196
public Builder encrypted(boolean encrypted) {
190197
this.encrypted = encrypted;
191198
return this;
@@ -197,28 +204,32 @@ public Builder encrypted(boolean encrypted) {
197204
* @param authenticationEnabled parameter
198205
* @return Builder
199206
*/
207+
@ConfiguredOption("true")
200208
public Builder authenticationEnabled(boolean authenticationEnabled) {
201209
this.authenticationEnabled = authenticationEnabled;
202210
return this;
203211
}
204212

205213
/**
206-
* Enagle metrics.
214+
* Enable metrics.
207215
*
208216
* @param metricsEnabled parameter
209217
* @return Builder
210218
*/
219+
@ConfiguredOption
220+
211221
public Builder metricsEnabled(boolean metricsEnabled) {
212222
this.metricsEnabled = metricsEnabled;
213223
return this;
214224
}
215225

216226
/**
217-
* Eable log leaked sessions.
227+
* Enable log leaked sessions.
218228
*
219229
* @param logLeakedSessions parameter
220230
* @return Builder
221231
*/
232+
@ConfiguredOption
222233
public Builder logLeakedSessions(boolean logLeakedSessions) {
223234
this.logLeakedSessions = logLeakedSessions;
224235
return this;
@@ -230,6 +241,7 @@ public Builder logLeakedSessions(boolean logLeakedSessions) {
230241
* @param maxConnectionPoolSize parameter
231242
* @return Builder
232243
*/
244+
@ConfiguredOption("100")
233245
public Builder maxConnectionPoolSize(int maxConnectionPoolSize) {
234246
this.maxConnectionPoolSize = maxConnectionPoolSize;
235247
return this;
@@ -241,6 +253,7 @@ public Builder maxConnectionPoolSize(int maxConnectionPoolSize) {
241253
* @param idleTimeBeforeConnectionTest parameter
242254
* @return Builder
243255
*/
256+
@ConfiguredOption("PT1MS")
244257
public Builder idleTimeBeforeConnectionTest(Duration idleTimeBeforeConnectionTest) {
245258
Objects.requireNonNull(idleTimeBeforeConnectionTest);
246259
this.idleTimeBeforeConnectionTest = idleTimeBeforeConnectionTest;
@@ -253,6 +266,7 @@ public Builder idleTimeBeforeConnectionTest(Duration idleTimeBeforeConnectionTes
253266
* @param maxConnectionLifetime parameter
254267
* @return Builder
255268
*/
269+
@ConfiguredOption("PT5H")
256270
public Builder maxConnectionLifetime(Duration maxConnectionLifetime) {
257271
Objects.requireNonNull(maxConnectionLifetime);
258272
this.maxConnectionLifetime = maxConnectionLifetime;
@@ -265,6 +279,7 @@ public Builder maxConnectionLifetime(Duration maxConnectionLifetime) {
265279
* @param connectionAcquisitionTimeout parameter
266280
* @return Builder
267281
*/
282+
@ConfiguredOption("PT1M")
268283
public Builder connectionAcquisitionTimeout(Duration connectionAcquisitionTimeout) {
269284
Objects.requireNonNull(connectionAcquisitionTimeout);
270285
this.connectionAcquisitionTimeout = connectionAcquisitionTimeout;
@@ -277,6 +292,7 @@ public Builder connectionAcquisitionTimeout(Duration connectionAcquisitionTimeou
277292
* @param strategy parameter
278293
* @return Builder
279294
*/
295+
@ConfiguredOption(type = TrustStrategy.class)
280296
public Builder trustStrategy(TrustStrategy strategy) {
281297
this.trustStrategy = strategy;
282298
return this;
@@ -288,6 +304,7 @@ public Builder trustStrategy(TrustStrategy strategy) {
288304
* @param certFile parameter
289305
* @return Builder
290306
*/
307+
@ConfiguredOption
291308
public Builder certificate(Path certFile) {
292309
this.certFile = certFile;
293310
return this;
@@ -299,6 +316,7 @@ public Builder certificate(Path certFile) {
299316
* @param hostnameVerificationEnabled parameter
300317
* @return Builder
301318
*/
319+
@ConfiguredOption
302320
public Builder hostnameVerificationEnabled(boolean hostnameVerificationEnabled) {
303321
this.hostnameVerificationEnabled = hostnameVerificationEnabled;
304322
return this;

integrations/neo4j/neo4j/src/main/java/module-info.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@
2727
in = HelidonFlavor.SE,
2828
path = "Neo4j"
2929
)
30-
@SuppressWarnings({ "requires-automatic", "requires-transitive-automatic" })
30+
@SuppressWarnings({ "requires-automatic"})
3131
module io.helidon.integrations.neo4j {
3232

33-
requires java.logging;
3433
requires io.helidon.common;
34+
requires java.logging;
3535

3636
requires static io.helidon.common.features.api;
37+
requires static io.helidon.config.metadata;
3738

3839
requires transitive io.helidon.common.config;
3940
requires transitive org.neo4j.driver;

integrations/vault/auths/approle/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@
7373
<artifactId>helidon-common-features-processor</artifactId>
7474
<version>${helidon.version}</version>
7575
</path>
76+
<path>
77+
<groupId>io.helidon.config</groupId>
78+
<artifactId>helidon-config-metadata-processor</artifactId>
79+
<version>${helidon.version}</version>
80+
</path>
7681
</annotationProcessorPaths>
7782
</configuration>
7883
</plugin>

0 commit comments

Comments
 (0)