Skip to content

Commit 539ee70

Browse files
committed
Removed cluster artifacts from Driver classes
1 parent 2e19061 commit 539ee70

File tree

3 files changed

+7
-34
lines changed

3 files changed

+7
-34
lines changed

driver/src/main/java/org/neo4j/driver/internal/BaseDriver.java

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,19 @@
1919

2020
package org.neo4j.driver.internal;
2121

22-
import org.neo4j.driver.internal.net.BoltServerAddress;
2322
import org.neo4j.driver.internal.security.SecurityPlan;
2423
import org.neo4j.driver.v1.Driver;
2524
import org.neo4j.driver.v1.Logger;
2625
import org.neo4j.driver.v1.Logging;
2726
import org.neo4j.driver.v1.Session;
2827

29-
import java.util.*;
30-
import java.util.concurrent.ThreadLocalRandom;
31-
3228
abstract class BaseDriver implements Driver
3329
{
34-
private final ConnectionSettings connectionSettings;
3530
private final SecurityPlan securityPlan;
36-
protected final List<BoltServerAddress> servers = new LinkedList<>();
3731
protected final Logger log;
3832

39-
BaseDriver( BoltServerAddress address, ConnectionSettings connectionSettings, SecurityPlan securityPlan, Logging logging )
33+
BaseDriver( SecurityPlan securityPlan, Logging logging )
4034
{
41-
this.servers.add( address );
42-
this.connectionSettings = connectionSettings;
4335
this.securityPlan = securityPlan;
4436
this.log = logging.getLog( Session.LOG_NAME );
4537
}
@@ -50,15 +42,4 @@ public boolean isEncrypted()
5042
return securityPlan.requiresEncryption();
5143
}
5244

53-
@Override
54-
public List<BoltServerAddress> servers()
55-
{
56-
return Collections.unmodifiableList( servers );
57-
}
58-
59-
protected BoltServerAddress randomServer()
60-
{
61-
return servers.get( ThreadLocalRandom.current().nextInt( 0, servers.size() ) );
62-
}
63-
6445
}

driver/src/main/java/org/neo4j/driver/internal/DirectDriver.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,33 @@
1919

2020
package org.neo4j.driver.internal;
2121

22-
import org.neo4j.driver.internal.net.pooling.SocketConnectionPool;
22+
import org.neo4j.driver.internal.net.BoltServerAddress;
2323
import org.neo4j.driver.internal.net.pooling.PoolSettings;
24+
import org.neo4j.driver.internal.net.pooling.SocketConnectionPool;
2425
import org.neo4j.driver.internal.security.SecurityPlan;
2526
import org.neo4j.driver.internal.spi.ConnectionPool;
26-
import org.neo4j.driver.internal.net.BoltServerAddress;
2727
import org.neo4j.driver.v1.Logging;
2828
import org.neo4j.driver.v1.Session;
2929

3030
import static java.lang.String.format;
3131

3232
public class DirectDriver extends BaseDriver
3333
{
34+
private final BoltServerAddress address;
3435
private final ConnectionPool connections;
3536

3637
public DirectDriver( BoltServerAddress address, ConnectionSettings connectionSettings, SecurityPlan securityPlan,
3738
PoolSettings poolSettings, Logging logging )
3839
{
39-
super( address, connectionSettings, securityPlan, logging );
40+
super( securityPlan, logging );
41+
this.address = address;
4042
this.connections = new SocketConnectionPool( connectionSettings, securityPlan, poolSettings, logging );
4143
}
4244

4345
@Override
4446
public Session session()
4547
{
46-
return new InternalSession( connections.acquire( randomServer() ), log );
48+
return new InternalSession( connections.acquire( address ), log );
4749
}
4850

4951
@Override

driver/src/main/java/org/neo4j/driver/v1/Driver.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
package org.neo4j.driver.v1;
2020

2121
import java.net.URI;
22-
import java.util.List;
23-
24-
import org.neo4j.driver.internal.net.BoltServerAddress;
2522

2623
/**
2724
* A Neo4j database driver, through which you can create {@link Session sessions} to run statements against the database.
@@ -73,13 +70,6 @@
7370
*/
7471
public interface Driver extends AutoCloseable
7572
{
76-
/**
77-
* Return a collection of the server addresses known by this driver.
78-
*
79-
* @return list of server addresses
80-
*/
81-
List<BoltServerAddress> servers();
82-
8373
/**
8474
* Return a flag to indicate whether or not encryption is used for this driver.
8575
*

0 commit comments

Comments
 (0)