Skip to content

Commit 8fec321

Browse files
committed
Improve Javadoc
This update also enables failures on warnings for public Javadoc.
1 parent a8b609b commit 8fec321

37 files changed

+650
-8
lines changed

driver/src/main/java/module-info.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
* See the License for the specific language governing permissions and
1717
* limitations under the License.
1818
*/
19+
/**
20+
* The Neo4j Java Driver module.
21+
*/
1922
@SuppressWarnings({"requires-automatic", "requires-transitive-automatic"})
2023
module org.neo4j.driver {
2124
exports org.neo4j.driver;

driver/src/main/java/org/neo4j/driver/BookmarkManagerConfig.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ public BookmarkManagerConfigBuilder withBookmarksSupplier(Supplier<Set<Bookmark>
126126
return this;
127127
}
128128

129+
/**
130+
* Builds an instance of {@link BookmarkManagerConfig}.
131+
* @return the config
132+
*/
129133
public BookmarkManagerConfig build() {
130134
return new BookmarkManagerConfig(this);
131135
}

driver/src/main/java/org/neo4j/driver/Config.java

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,32 +75,77 @@ public final class Config implements Serializable {
7575

7676
private static final Config EMPTY = builder().build();
7777

78+
/**
79+
* The {@link QueryTask} {@link BookmarkManager}.
80+
*/
7881
private final BookmarkManager queryBookmarkManager;
7982

8083
/**
8184
* User defined logging
8285
*/
8386
private final Logging logging;
8487

88+
/**
89+
* The flag indicating if leaked sessions logging is enabled.
90+
*/
8591
private final boolean logLeakedSessions;
8692

93+
/**
94+
* The maximum connection pool size.
95+
*/
8796
private final int maxConnectionPoolSize;
8897

98+
/**
99+
* The idle time that defines if connection should be tested before being handed out by the connection pool.
100+
*/
89101
private final long idleTimeBeforeConnectionTest;
102+
/**
103+
* The maximum connection lifetime in milliseconds.
104+
*/
90105
private final long maxConnectionLifetimeMillis;
106+
/**
107+
* The maximum amount of time connection acquisition will attempt to acquire a connection from the connection pool.
108+
*/
91109
private final long connectionAcquisitionTimeoutMillis;
92110

111+
/**
112+
* The security settings.
113+
*/
93114
private final SecuritySettings securitySettings;
94115

116+
/**
117+
* The fetch size.
118+
*/
95119
private final long fetchSize;
120+
/**
121+
* The stale routing table purge delay in milliseconds.
122+
*/
96123
private final long routingTablePurgeDelayMillis;
124+
/**
125+
* The managed transactions maximum retry time.
126+
*/
97127
private final long maxTransactionRetryTimeMillis;
98128

129+
/**
130+
* The configured connection timeout value in milliseconds.
131+
*/
99132
private final int connectionTimeoutMillis;
133+
/**
134+
* The server address resolver.
135+
*/
100136
private final ServerAddressResolver resolver;
101137

138+
/**
139+
* The event loop thread count.
140+
*/
102141
private final int eventLoopThreads;
142+
/**
143+
* The user_agent configured for this driver.
144+
*/
103145
private final String userAgent;
146+
/**
147+
* The {@link MetricsAdapter}.
148+
*/
104149
private final MetricsAdapter metricsAdapter;
105150

106151
private Config(ConfigBuilder builder) {
@@ -185,10 +230,18 @@ public int connectionTimeoutMillis() {
185230
return connectionTimeoutMillis;
186231
}
187232

233+
/**
234+
* Returns the maximum connection pool size.
235+
* @return the maximum size
236+
*/
188237
public int maxConnectionPoolSize() {
189238
return maxConnectionPoolSize;
190239
}
191240

241+
/**
242+
* Returns the connection acquisition timeout in milliseconds.
243+
* @return the acquisition timeout
244+
*/
192245
public long connectionAcquisitionTimeoutMillis() {
193246
return connectionAcquisitionTimeoutMillis;
194247
}
@@ -250,10 +303,18 @@ public long maxTransactionRetryTimeMillis() {
250303
return maxTransactionRetryTimeMillis;
251304
}
252305

306+
/**
307+
* Returns the fetch size.
308+
* @return the fetch size
309+
*/
253310
public long fetchSize() {
254311
return fetchSize;
255312
}
256313

314+
/**
315+
* Returns the number of {@link io.netty.channel.EventLoop} threads.
316+
* @return the number of threads
317+
*/
257318
public int eventLoopThreads() {
258319
return eventLoopThreads;
259320
}
@@ -265,6 +326,10 @@ public boolean isMetricsEnabled() {
265326
return this.metricsAdapter != MetricsAdapter.DEV_NULL;
266327
}
267328

329+
/**
330+
* Returns the {@link MetricsAdapter}.
331+
* @return the metrics adapter
332+
*/
268333
public MetricsAdapter metricsAdapter() {
269334
return this.metricsAdapter;
270335
}
@@ -730,14 +795,35 @@ public static final class TrustStrategy implements Serializable {
730795
* The trust strategy that the driver supports
731796
*/
732797
public enum Strategy {
798+
/**
799+
* Trust all certificates.
800+
*/
733801
TRUST_ALL_CERTIFICATES,
802+
/**
803+
* Trust custom CA-signed certificates.
804+
*/
734805
TRUST_CUSTOM_CA_SIGNED_CERTIFICATES,
806+
/**
807+
* Trust system CA-signed certificates.
808+
*/
735809
TRUST_SYSTEM_CA_SIGNED_CERTIFICATES
736810
}
737811

812+
/**
813+
* The strategy type.
814+
*/
738815
private final Strategy strategy;
816+
/**
817+
* The configured certificate files.
818+
*/
739819
private final List<File> certFiles;
820+
/**
821+
* The flag indicating if hostname verification is enabled for this trust strategy.
822+
*/
740823
private boolean hostnameVerificationEnabled = true;
824+
/**
825+
* The revocation strategy used for verifying certificates.
826+
*/
741827
private RevocationCheckingStrategy revocationCheckingStrategy = RevocationCheckingStrategy.NO_CHECKS;
742828

743829
private TrustStrategy(Strategy strategy) {

driver/src/main/java/org/neo4j/driver/QueryConfig.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,25 @@ public final class QueryConfig implements Serializable {
3737

3838
private static final QueryConfig DEFAULT = builder().build();
3939

40+
/**
41+
* The routing mode.
42+
*/
4043
private final RoutingControl routing;
44+
/**
45+
* The target database.
46+
*/
4147
private final String database;
48+
/**
49+
* The impersonated user.
50+
*/
4251
private final String impersonatedUser;
52+
/**
53+
* The bookmark manager.
54+
*/
4355
private final BookmarkManager bookmarkManager;
56+
/**
57+
* The flag indicating if default bookmark manager should be used.
58+
*/
4459
private final boolean useDefaultBookmarkManager;
4560

4661
/**

driver/src/main/java/org/neo4j/driver/Records.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,42 @@
2929
public final class Records {
3030
private Records() {}
3131

32+
/**
33+
* Returns a function mapping record to a value from a given index.
34+
* @param index the index value
35+
* @return the function
36+
*/
3237
public static Function<Record, Value> column(int index) {
3338
return column(index, Values.ofValue());
3439
}
3540

41+
/**
42+
* Returns a function mapping record to a value from a given key.
43+
* @param key the key value
44+
* @return the function
45+
*/
3646
public static Function<Record, Value> column(String key) {
3747
return column(key, Values.ofValue());
3848
}
3949

50+
/**
51+
* Returns a function mapping record to a value of a target type from a given index.
52+
* @param index the index value
53+
* @param mapFunction the function mapping value to a value of a target type
54+
* @return the function
55+
* @param <T> the target type
56+
*/
4057
public static <T> Function<Record, T> column(final int index, final Function<Value, T> mapFunction) {
4158
return record -> mapFunction.apply(record.get(index));
4259
}
4360

61+
/**
62+
* Returns a function mapping record to a value of a target type from a given key.
63+
* @param key the key value
64+
* @param mapFunction the function mapping value to a value of a target type
65+
* @return the function
66+
* @param <T> the target type
67+
*/
4468
public static <T> Function<Record, T> column(final String key, final Function<Value, T> mapFunction) {
4569
return recordAccessor -> mapFunction.apply(recordAccessor.get(key));
4670
}

driver/src/main/java/org/neo4j/driver/RevocationCheckingStrategy.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ public enum RevocationCheckingStrategy {
2929
/** Require stapled revocation status and verify OCSP revocation checks, fail if no revocation status is stapled to the certificate. */
3030
STRICT;
3131

32+
/**
33+
* Returns whether a given strategy requires revocation checking.
34+
* @param revocationCheckingStrategy the strategy
35+
* @return whether revocation checking is required
36+
*/
3237
public static boolean requiresRevocationChecking(RevocationCheckingStrategy revocationCheckingStrategy) {
3338
return revocationCheckingStrategy.equals(STRICT) || revocationCheckingStrategy.equals(VERIFY_IF_PRESENT);
3439
}

driver/src/main/java/org/neo4j/driver/SessionConfig.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,29 @@ public final class SessionConfig implements Serializable {
4141

4242
private static final SessionConfig EMPTY = builder().build();
4343

44+
/**
45+
* The initial bookmarks.
46+
*/
4447
private final Iterable<Bookmark> bookmarks;
48+
/**
49+
* The default type of access.
50+
*/
4551
private final AccessMode defaultAccessMode;
52+
/**
53+
* The target database name.
54+
*/
4655
private final String database;
56+
/**
57+
* The fetch size.
58+
*/
4759
private final Long fetchSize;
60+
/**
61+
* The impersonated user.
62+
*/
4863
private final String impersonatedUser;
64+
/**
65+
* The bookmark manager.
66+
*/
4967
private final BookmarkManager bookmarkManager;
5068

5169
private SessionConfig(Builder builder) {
@@ -348,6 +366,10 @@ public Builder withBookmarkManager(BookmarkManager bookmarkManager) {
348366
return this;
349367
}
350368

369+
/**
370+
* Builds the {@link SessionConfig}.
371+
* @return the config
372+
*/
351373
public SessionConfig build() {
352374
return new SessionConfig(this);
353375
}

driver/src/main/java/org/neo4j/driver/TransactionConfig.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ public final class TransactionConfig implements Serializable {
6969

7070
private static final TransactionConfig EMPTY = builder().build();
7171

72+
/**
73+
* the transaction timeout
74+
*/
7275
private final Duration timeout;
76+
/**
77+
* The transaction metadata.
78+
*/
7379
private final Map<String, Object> metadata;
7480

7581
// Values are not serializable, hence, we keep a transient volatile map of them around

0 commit comments

Comments
 (0)