Skip to content
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
15 changes: 15 additions & 0 deletions driver/src/main/java/org/neo4j/driver/v1/AccessMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
6 changes: 5 additions & 1 deletion driver/src/main/java/org/neo4j/driver/v1/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ public ConfigBuilder withSessionLivenessCheckTimeout( long timeout )
* application seeing connection problems, and performance.
* <p>
* 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
Expand Down Expand Up @@ -516,6 +517,9 @@ public enum EncryptionLevel
*/
public static class TrustStrategy
{
/**
* The trust strategy that the driver supports
*/
public enum Strategy
{
@Deprecated
Expand Down
39 changes: 39 additions & 0 deletions driver/src/main/java/org/neo4j/driver/v1/Logger.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}