Skip to content

Commit 87beceb

Browse files
authored
feat(session): delete deprecated session methods (#1649)
BREAKING CHANGE: this update removes deprecated session methods on the `Driver` level. In addition, this also removes the experimental `defaultTypeSystem()` method.
1 parent 22b55b0 commit 87beceb

File tree

3 files changed

+30
-82
lines changed

3 files changed

+30
-82
lines changed

driver/clirr-ignored-differences.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,4 +770,34 @@
770770
<differenceType>8001</differenceType>
771771
</difference>
772772

773+
<difference>
774+
<className>org/neo4j/driver/Driver</className>
775+
<differenceType>7002</differenceType>
776+
<method>org.neo4j.driver.async.AsyncSession asyncSession()</method>
777+
</difference>
778+
779+
<difference>
780+
<className>org/neo4j/driver/Driver</className>
781+
<differenceType>7002</differenceType>
782+
<method>org.neo4j.driver.async.AsyncSession asyncSession(org.neo4j.driver.SessionConfig)</method>
783+
</difference>
784+
785+
<difference>
786+
<className>org/neo4j/driver/Driver</className>
787+
<differenceType>7002</differenceType>
788+
<method>org.neo4j.driver.types.TypeSystem defaultTypeSystem()</method>
789+
</difference>
790+
791+
<difference>
792+
<className>org/neo4j/driver/Driver</className>
793+
<differenceType>7002</differenceType>
794+
<method>org.neo4j.driver.reactive.ReactiveSession reactiveSession()</method>
795+
</difference>
796+
797+
<difference>
798+
<className>org/neo4j/driver/Driver</className>
799+
<differenceType>7002</differenceType>
800+
<method>org.neo4j.driver.reactive.ReactiveSession reactiveSession(org.neo4j.driver.SessionConfig)</method>
801+
</difference>
802+
773803
</differences>

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

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,8 @@
1717
package org.neo4j.driver;
1818

1919
import java.util.concurrent.CompletionStage;
20-
import org.neo4j.driver.async.AsyncSession;
2120
import org.neo4j.driver.exceptions.ClientException;
2221
import org.neo4j.driver.exceptions.UnsupportedFeatureException;
23-
import org.neo4j.driver.reactive.ReactiveSession;
24-
import org.neo4j.driver.types.TypeSystem;
25-
import org.neo4j.driver.util.Experimental;
2622

2723
/**
2824
* Accessor for a specific Neo4j graph database.
@@ -132,7 +128,6 @@ default Session session(SessionConfig sessionConfig) {
132128
* @throws IllegalArgumentException for unsupported session types
133129
* @since 5.2
134130
*/
135-
@SuppressWarnings("deprecation")
136131
default <T extends BaseSession> T session(Class<T> sessionClass) {
137132
return session(sessionClass, SessionConfig.defaultConfig());
138133
}
@@ -167,7 +162,6 @@ default <T extends BaseSession> T session(Class<T> sessionClass) {
167162
* @throws IllegalArgumentException for unsupported session types
168163
* @since 5.8
169164
*/
170-
@SuppressWarnings("deprecation")
171165
default <T extends BaseSession> T session(Class<T> sessionClass, AuthToken sessionAuthToken) {
172166
return session(sessionClass, SessionConfig.defaultConfig(), sessionAuthToken);
173167
}
@@ -198,7 +192,6 @@ default <T extends BaseSession> T session(Class<T> sessionClass, AuthToken sessi
198192
* @throws IllegalArgumentException for unsupported session types
199193
* @since 5.2
200194
*/
201-
@SuppressWarnings("deprecation")
202195
default <T extends BaseSession> T session(Class<T> sessionClass, SessionConfig sessionConfig) {
203196
return session(sessionClass, sessionConfig, null);
204197
}
@@ -235,63 +228,8 @@ default <T extends BaseSession> T session(Class<T> sessionClass, SessionConfig s
235228
* @throws IllegalArgumentException for unsupported session types
236229
* @since 5.8
237230
*/
238-
@SuppressWarnings("deprecation")
239231
<T extends BaseSession> T session(Class<T> sessionClass, SessionConfig sessionConfig, AuthToken sessionAuthToken);
240232

241-
/**
242-
* Create a new general purpose {@link ReactiveSession} with default {@link SessionConfig session configuration}. The {@link ReactiveSession} provides a
243-
* reactive way to run queries and process results.
244-
*
245-
* @return a new {@link ReactiveSession} object.
246-
* @deprecated superseded by {@link #session(Class)}
247-
*/
248-
@Deprecated
249-
default ReactiveSession reactiveSession() {
250-
return session(ReactiveSession.class);
251-
}
252-
253-
/**
254-
* Create a new {@link ReactiveSession} with a specified {@link SessionConfig session configuration}. Use {@link SessionConfig#forDatabase(String)} to
255-
* obtain a general purpose session configuration for the specified database. The {@link ReactiveSession} provides a reactive way to run queries and process
256-
* results.
257-
*
258-
* @param sessionConfig used to customize the session.
259-
* @return a new {@link ReactiveSession} object.
260-
* @deprecated superseded by {@link #session(Class, SessionConfig)}
261-
*/
262-
@Deprecated
263-
default ReactiveSession reactiveSession(SessionConfig sessionConfig) {
264-
return session(ReactiveSession.class, sessionConfig);
265-
}
266-
267-
/**
268-
* Create a new general purpose {@link AsyncSession} with default {@link SessionConfig session configuration}. The {@link AsyncSession} provides an
269-
* asynchronous way to run queries and process results.
270-
* <p>
271-
* Alias to {@link #asyncSession(SessionConfig)}}.
272-
*
273-
* @return a new {@link AsyncSession} object.
274-
* @deprecated superseded by {@link #session(Class)}
275-
*/
276-
@Deprecated
277-
default AsyncSession asyncSession() {
278-
return session(AsyncSession.class);
279-
}
280-
281-
/**
282-
* Create a new {@link AsyncSession} with a specified {@link SessionConfig session configuration}.
283-
* Use {@link SessionConfig#forDatabase(String)} to obtain a general purpose session configuration for the specified database.
284-
* The {@link AsyncSession} provides an asynchronous way to run queries and process results.
285-
*
286-
* @param sessionConfig used to customize the session.
287-
* @return a new {@link AsyncSession} object.
288-
* @deprecated superseded by {@link #session(Class, SessionConfig)}
289-
*/
290-
@Deprecated
291-
default AsyncSession asyncSession(SessionConfig sessionConfig) {
292-
return session(AsyncSession.class, sessionConfig);
293-
}
294-
295233
/**
296234
* Close all the resources assigned to this driver, including open connections and IO threads.
297235
* <p>
@@ -334,18 +272,6 @@ default AsyncSession asyncSession(SessionConfig sessionConfig) {
334272
*/
335273
boolean isMetricsEnabled();
336274

337-
/**
338-
* This will return the type system supported by the driver.
339-
* The types supported on a particular server a session is connected against might not contain all of the types defined here.
340-
*
341-
* @return type system used by this query runner for classifying values
342-
* @deprecated superseded by {@link TypeSystem#getDefault()}
343-
*/
344-
@Experimental
345-
@Deprecated
346-
@SuppressWarnings("SameReturnValue")
347-
TypeSystem defaultTypeSystem();
348-
349275
/**
350276
* This verifies if the driver can connect to a remote server or a cluster
351277
* by establishing a network connection with the remote and possibly exchanging a few data before closing the connection.

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@
4747
import org.neo4j.driver.internal.metrics.DevNullMetricsProvider;
4848
import org.neo4j.driver.internal.metrics.MetricsProvider;
4949
import org.neo4j.driver.internal.security.BoltSecurityPlanManager;
50-
import org.neo4j.driver.internal.types.InternalTypeSystem;
5150
import org.neo4j.driver.internal.util.Futures;
52-
import org.neo4j.driver.types.TypeSystem;
5351

5452
public class InternalDriver implements Driver {
5553
private static final Set<String> INVALID_TOKEN_CODES = Set.of(
@@ -151,12 +149,6 @@ public CompletionStage<Void> closeAsync() {
151149
return completedWithNull();
152150
}
153151

154-
@Deprecated
155-
@Override
156-
public final TypeSystem defaultTypeSystem() {
157-
return InternalTypeSystem.TYPE_SYSTEM;
158-
}
159-
160152
@Override
161153
public CompletionStage<Void> verifyConnectivityAsync() {
162154
return sessionFactory.verifyConnectivity();

0 commit comments

Comments
 (0)