Skip to content

Commit

Permalink
Merge branch '1.2' into 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhen committed May 4, 2017
2 parents b3076ff + 0f1c3ba commit 42e4a67
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
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 @@ -312,7 +312,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 @@ -546,6 +547,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();
}

0 comments on commit 42e4a67

Please sign in to comment.