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
21 changes: 10 additions & 11 deletions driver/src/main/java/org/neo4j/driver/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,22 @@
* To build a simple config with custom logging implementation:
* <pre>
* {@code
* Config config = Config
* .build()
* .withLogging(new MyLogging())
* .toConfig();
* Config config = Config.builder()
* .withLogging(new MyLogging())
* .build();
* }
* </pre>
* <p>
* To build a more complicated config with tuned connection pool options:
* <pre>
* {@code
* Config config = Config.build()
* .withEncryption()
* .withConnectionTimeout(10, TimeUnit.SECONDS)
* .withMaxConnectionLifetime(30, TimeUnit.MINUTES)
* .withMaxConnectionPoolSize(10)
* .withConnectionAcquisitionTimeout(20, TimeUnit.SECONDS)
* .toConfig();
* Config config = Config.builder()
* .withEncryption()
* .withConnectionTimeout( 10, TimeUnit.SECONDS)
* .withMaxConnectionLifetime(30, TimeUnit.MINUTES)
* .withMaxConnectionPoolSize(10)
* .withConnectionAcquisitionTimeout(20, TimeUnit.SECONDS)
* .build();
* }
* </pre>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ private void addPerson( String name )
String username = "neo4j";
String password = "some password";

try ( Driver driver = createDriver( "neo4j://x.acme.com", username, password, ServerAddress.of( "a.acme.com", 7676 ),
ServerAddress.of( "b.acme.com", 8787 ), ServerAddress.of( "c.acme.com", 9898 ) ) )
try ( Driver driver = createDriver( "neo4j://x.example.com", username, password, ServerAddress.of( "a.example.com", 7676 ),
ServerAddress.of( "b.example.com", 8787 ), ServerAddress.of( "c.example.com", 9898 ) ) )
{
try ( Session session = driver.session( builder().withDefaultAccessMode( AccessMode.WRITE ).build() ) )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void testShouldRunConfigCustomResolverExample() throws Exception
StubServer server2 = StubServer.start( "return_1.script", 9002 );

// Given
try ( ConfigCustomResolverExample example = new ConfigCustomResolverExample( "neo4j://x.acme.com", ServerAddress.of( "localhost", 9001 ) ) )
try ( ConfigCustomResolverExample example = new ConfigCustomResolverExample( "neo4j://x.example.com", ServerAddress.of( "localhost", 9001 ) ) )
{
// Then
assertTrue( example.canConnect() );
Expand Down
2 changes: 1 addition & 1 deletion examples/src/test/resources/get_routing_table_only.script
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
!: AUTO HELLO
!: AUTO GOODBYE

C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": { "address": "x.acme.com:7687" }} {}
C: RUN "CALL dbms.cluster.routing.getRoutingTable($context)" {"context": { "address": "x.example.com:7687" }} {}
PULL_ALL
S: SUCCESS {"fields": ["ttl", "servers"]}
RECORD [9223372036854775807, [{"addresses": ["127.0.0.1:9001"],"role": "WRITE"}, {"addresses": ["127.0.0.1:9002"], "role": "READ"},{"addresses": ["127.0.0.1:9001"], "role": "ROUTE"}]]
Expand Down