diff --git a/driver/src/main/java/org/neo4j/driver/v1/AccessMode.java b/driver/src/main/java/org/neo4j/driver/v1/AccessMode.java index a3277efb97..0d343f1ed1 100644 --- a/driver/src/main/java/org/neo4j/driver/v1/AccessMode.java +++ b/driver/src/main/java/org/neo4j/driver/v1/AccessMode.java @@ -18,8 +18,23 @@ */ package org.neo4j.driver.v1; +/** + * Used by Routing Driver to decide if a transaction should be routed to a write server or a read server in a cluster. + * When running a transaction, a write transaction requires a server that supports writes. + * A read transaction, on the other hand, requires a server that supports read operations. + * This classification is key for routing driver to route transactions to a cluster correctly. + * + * While any {@link AccessMode} will be ignored while running transactions via a driver towards a single server. + * As the single server serves both read and write operations at the same time. + */ public enum AccessMode { + /** + * Use this for transactions that requires a read server in a cluster + */ READ, + /** + * Use this for transactions that requires a write server in a cluster + */ WRITE } diff --git a/driver/src/main/java/org/neo4j/driver/v1/Config.java b/driver/src/main/java/org/neo4j/driver/v1/Config.java index b2399edb8c..7e9c0ec5af 100644 --- a/driver/src/main/java/org/neo4j/driver/v1/Config.java +++ b/driver/src/main/java/org/neo4j/driver/v1/Config.java @@ -312,7 +312,8 @@ public ConfigBuilder withSessionLivenessCheckTimeout( long timeout ) * application seeing connection problems, and performance. *

* You normally should not need to tune this parameter. - * This feature is turned off by default. Value {@code 0} means connections will always be tested for + * No connection liveliness check is done by default. + * Value {@code 0} means connections will always be tested for * validity and negative values mean connections will never be tested. * * @param value the minimum idle time in milliseconds @@ -546,6 +547,9 @@ public enum EncryptionLevel */ public static class TrustStrategy { + /** + * The trust strategy that the driver supports + */ public enum Strategy { @Deprecated diff --git a/driver/src/main/java/org/neo4j/driver/v1/Logger.java b/driver/src/main/java/org/neo4j/driver/v1/Logger.java index b913320de0..ac52d2668b 100644 --- a/driver/src/main/java/org/neo4j/driver/v1/Logger.java +++ b/driver/src/main/java/org/neo4j/driver/v1/Logger.java @@ -23,17 +23,56 @@ */ public interface Logger { + /** + * Logs errors from this driver + * @param message the error message + * @param cause the cause of the error + */ void error( String message, Throwable cause ); + /** + * Logs information from the driver + * @param message the information message + * @param params parameters used in the information message + */ void info( String message, Object... params ); + /** + * Logs warnings that happened during using the driver + * @param message the warning message + * @param params parameters used in the warning message + */ void warn( String message, Object... params ); + /** + * Logs bolt messages sent and received by this driver. + * It is only enabled when {@link Logger#isDebugEnabled()} returns {@code True}. + * This logging level generates a lot of log entries. + * @param message the bolt message + * @param params parameters used in generating the bolt message + */ void debug( String message, Object... params ); + /** + * Logs binary sent and received by this driver. + * It is only enabled when {@link Logger#isTraceEnabled()} returns {@code True}. + * This logging level generates huge amount of log entries. + * @param message the bolt message in hex + * @param params parameters used in generating the hex message + */ void trace( String message, Object... params ); + /** + * Return true if the trace logging level is enabled. + * @see Logger#trace(String, Object...) + * @return true if the trace logging level is enabled. + */ boolean isTraceEnabled(); + /** + * Return true if the debug level is enabled. + * @see Logger#debug(String, Object...) + * @return true if the debug level is enabled. + */ boolean isDebugEnabled(); }