Skip to content

Commit 5cd8592

Browse files
committed
Better naming of a config method
Renamed `withSessionLivenessCheckTimeout` to `withConnectionLivenessCheckTimeout` because all other methods refer to connections instead of sessions and are actually settings for the connection pool and not session pool.
1 parent fb365d8 commit 5cd8592

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,18 +261,18 @@ public ConfigBuilder withMaxIdleSessions( int size )
261261
}
262262

263263
/**
264-
* Please use {@link #withSessionLivenessCheckTimeout(long, TimeUnit)}.
264+
* Please use {@link #withConnectionLivenessCheckTimeout(long, TimeUnit)}.
265265
*
266266
* @param timeout minimum idle time in milliseconds
267267
* @return this builder
268-
* @see #withSessionLivenessCheckTimeout(long, TimeUnit)
269-
* @deprecated please use overloaded method with {@link TimeUnit} parameter. This method will be removed in
270-
* future release.
268+
* @see #withConnectionLivenessCheckTimeout(long, TimeUnit)
269+
* @deprecated please use {@link #withConnectionLivenessCheckTimeout(long, TimeUnit)} method. This method
270+
* will be removed in future release.
271271
*/
272272
@Deprecated
273273
public ConfigBuilder withSessionLivenessCheckTimeout( long timeout )
274274
{
275-
withSessionLivenessCheckTimeout( timeout, TimeUnit.MILLISECONDS );
275+
withConnectionLivenessCheckTimeout( timeout, TimeUnit.MILLISECONDS );
276276
return this;
277277
}
278278

@@ -298,7 +298,7 @@ public ConfigBuilder withSessionLivenessCheckTimeout( long timeout )
298298
* @param unit the unit in which the duration is given
299299
* @return this builder
300300
*/
301-
public ConfigBuilder withSessionLivenessCheckTimeout( long value, TimeUnit unit )
301+
public ConfigBuilder withConnectionLivenessCheckTimeout( long value, TimeUnit unit )
302302
{
303303
long idleTimeBeforeConnectionTestMillis = unit.toMillis( value );
304304
if ( idleTimeBeforeConnectionTestMillis <= 0 )

driver/src/test/java/org/neo4j/driver/internal/ConfigTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void shouldChangeToTrustedCert()
8585
@Test
8686
public void shouldSupportLivenessCheckTimeoutSetting() throws Throwable
8787
{
88-
Config config = Config.build().withSessionLivenessCheckTimeout( 42, TimeUnit.SECONDS ).toConfig();
88+
Config config = Config.build().withConnectionLivenessCheckTimeout( 42, TimeUnit.SECONDS ).toConfig();
8989

9090
assertEquals( TimeUnit.SECONDS.toMillis( 42 ), config.idleTimeBeforeConnectionTest() );
9191
}
@@ -97,7 +97,7 @@ public void shouldThrowForZeroTimeoutInLivenessCheckTimeoutSetting() throws Thro
9797

9898
try
9999
{
100-
builder.withSessionLivenessCheckTimeout( 0, TimeUnit.SECONDS );
100+
builder.withConnectionLivenessCheckTimeout( 0, TimeUnit.SECONDS );
101101
fail( "Exception expected" );
102102
}
103103
catch ( Exception e )
@@ -113,7 +113,7 @@ public void shouldThrowForNegativeTimeoutInLivenessCheckTimeoutSetting() throws
113113

114114
try
115115
{
116-
builder.withSessionLivenessCheckTimeout( -42, TimeUnit.SECONDS );
116+
builder.withConnectionLivenessCheckTimeout( -42, TimeUnit.SECONDS );
117117
fail( "Exception expected" );
118118
}
119119
catch ( Exception e )

driver/src/test/java/org/neo4j/driver/v1/integration/CausalClusteringIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public void shouldDropBrokenOldSessions() throws Exception
201201
int livenessCheckTimeoutMinutes = 2;
202202

203203
Config config = Config.build()
204-
.withSessionLivenessCheckTimeout( livenessCheckTimeoutMinutes, TimeUnit.MINUTES )
204+
.withConnectionLivenessCheckTimeout( livenessCheckTimeoutMinutes, TimeUnit.MINUTES )
205205
.withEncryptionLevel( Config.EncryptionLevel.NONE )
206206
.toConfig();
207207

driver/src/test/java/org/neo4j/driver/v1/integration/ServerKilledIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public void shouldDropBrokenOldSessions() throws Throwable
9696
// config with set liveness check timeout
9797
int livenessCheckTimeoutMinutes = 10;
9898
Config config = Config.build()
99-
.withSessionLivenessCheckTimeout( livenessCheckTimeoutMinutes, TimeUnit.MINUTES )
99+
.withConnectionLivenessCheckTimeout( livenessCheckTimeoutMinutes, TimeUnit.MINUTES )
100100
.withEncryptionLevel( Config.EncryptionLevel.NONE )
101101
.toConfig();
102102

driver/src/test/java/org/neo4j/driver/v1/util/cc/Cluster.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ private static Config driverConfig()
289289
.withTrustStrategy( trustAllCertificates() )
290290
.withEncryptionLevel( Config.EncryptionLevel.NONE )
291291
.withMaxIdleSessions( 1 )
292-
.withSessionLivenessCheckTimeout( TimeUnit.HOURS.toMillis( 1 ) )
292+
.withConnectionLivenessCheckTimeout( 1, TimeUnit.HOURS )
293293
.toConfig();
294294
}
295295

0 commit comments

Comments
 (0)