Skip to content

Commit f0fc36d

Browse files
authored
feat(gql-status-object): make GQL Status Object GA (#1669)
This update makes GQL Status Object GA and deprecates Notification.
1 parent 26731c6 commit f0fc36d

28 files changed

+77
-30
lines changed

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
import org.neo4j.driver.net.ServerAddressResolver;
4141
import org.neo4j.driver.util.Experimental;
4242
import org.neo4j.driver.util.Immutable;
43-
import org.neo4j.driver.util.Preview;
4443
import org.neo4j.driver.util.Resource;
4544

4645
/**
@@ -144,6 +143,7 @@ public final class Config implements Serializable {
144143
/**
145144
* The notification config.
146145
*/
146+
@SuppressWarnings("deprecation")
147147
private final NotificationConfig notificationConfig;
148148
/**
149149
* The {@link MetricsAdapter}.
@@ -325,7 +325,10 @@ public long fetchSize() {
325325
*
326326
* @return the notification config
327327
* @since 5.7
328+
* @deprecated superseded by {@link Config#minimumNotificationSeverity()} and
329+
* {@link Config#disabledNotificationClassifications()}.
328330
*/
331+
@Deprecated
329332
public NotificationConfig notificationConfig() {
330333
return notificationConfig;
331334
}
@@ -336,7 +339,6 @@ public NotificationConfig notificationConfig() {
336339
* @return an {@link Optional} of minimum {@link NotificationSeverity} or an empty {@link Optional} if it is not set
337340
* @since 5.22.0
338341
*/
339-
@Preview(name = "GQL-status object")
340342
public Optional<NotificationSeverity> minimumNotificationSeverity() {
341343
return Optional.ofNullable(((InternalNotificationConfig) notificationConfig).minimumSeverity());
342344
}
@@ -346,7 +348,6 @@ public Optional<NotificationSeverity> minimumNotificationSeverity() {
346348
* @return the {@link Set} of disabled {@link NotificationClassification}
347349
* @since 5.22.0
348350
*/
349-
@Preview(name = "GQL-status object")
350351
public Set<NotificationClassification> disabledNotificationClassifications() {
351352
var disabledCategories = ((InternalNotificationConfig) notificationConfig).disabledCategories();
352353
return disabledCategories != null
@@ -428,6 +429,7 @@ public static final class ConfigBuilder {
428429
private long fetchSize = 1000;
429430
private int eventLoopThreads = 0;
430431

432+
@SuppressWarnings("deprecation")
431433
private NotificationConfig notificationConfig = NotificationConfig.defaultConfig();
432434

433435
private boolean telemetryDisabled = false;
@@ -824,7 +826,11 @@ public ConfigBuilder withUserAgent(String userAgent) {
824826
* @param notificationConfig the notification config
825827
* @return this builder
826828
* @since 5.7
829+
* @deprecated superseded by {@link ConfigBuilder#withMinimumNotificationSeverity(NotificationSeverity)} and
830+
* {@link ConfigBuilder#withDisabledNotificationClassifications(Set)}.
827831
*/
832+
@SuppressWarnings("DeprecatedIsStillUsed")
833+
@Deprecated
828834
public ConfigBuilder withNotificationConfig(NotificationConfig notificationConfig) {
829835
this.notificationConfig = Objects.requireNonNull(notificationConfig, "notificationConfig must not be null");
830836
return this;
@@ -837,7 +843,7 @@ public ConfigBuilder withNotificationConfig(NotificationConfig notificationConfi
837843
* @return this builder
838844
* @since 5.22.0
839845
*/
840-
@Preview(name = "GQL-status object")
846+
@SuppressWarnings("deprecation")
841847
public ConfigBuilder withMinimumNotificationSeverity(NotificationSeverity minimumNotificationSeverity) {
842848
if (minimumNotificationSeverity == null) {
843849
notificationConfig = NotificationConfig.disableAllConfig();
@@ -854,7 +860,7 @@ public ConfigBuilder withMinimumNotificationSeverity(NotificationSeverity minimu
854860
* @return this builder
855861
* @since 5.22.0
856862
*/
857-
@Preview(name = "GQL-status object")
863+
@SuppressWarnings("deprecation")
858864
public ConfigBuilder withDisabledNotificationClassifications(
859865
Set<NotificationClassification> disabledNotificationClassifications) {
860866
var disabledCategories = disabledNotificationClassifications == null

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
* Notification category.
2323
*
2424
* @since 5.7
25+
* @deprecated superseded by {@link NotificationClassification}.
2526
*/
27+
@Deprecated
2628
public sealed interface NotificationCategory extends Serializable permits NotificationClassification {
2729
/**
2830
* A hint category.

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@
1616
*/
1717
package org.neo4j.driver;
1818

19-
import org.neo4j.driver.util.Preview;
20-
2119
/**
2220
* Notification classification.
2321
*
2422
* @since 5.22.0
2523
*/
26-
@Preview(name = "GQL-status object")
24+
@SuppressWarnings("deprecation")
2725
public enum NotificationClassification implements NotificationCategory {
2826
/**
2927
* A hint category.
@@ -94,6 +92,7 @@ public enum NotificationClassification implements NotificationCategory {
9492
* <p>
9593
* Please note that this category was added to a later server version. Therefore, a compatible server version is
9694
* required to use it.
95+
*
9796
* @since 5.24.0
9897
*/
9998
SCHEMA

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import java.io.Serializable;
2020
import java.util.Set;
21+
import org.neo4j.driver.Config.ConfigBuilder;
2122
import org.neo4j.driver.internal.InternalNotificationConfig;
2223
import org.neo4j.driver.internal.InternalNotificationSeverity;
2324
import org.neo4j.driver.summary.ResultSummary;
@@ -37,8 +38,13 @@
3738
*
3839
* @since 5.7
3940
* @see ResultSummary#notifications()
40-
* @see org.neo4j.driver.summary.Notification
41+
* @deprecated superseded by e org.neo4j.driver.summary.Notification
42+
* {@link ConfigBuilder#withMinimumNotificationSeverity(NotificationSeverity)},
43+
* {@link ConfigBuilder#withDisabledNotificationClassifications(Set)},
44+
* {@link SessionConfig.Builder#withMinimumNotificationSeverity(NotificationSeverity)} and
45+
* {@link SessionConfig.Builder#withDisabledNotificationClassifications(Set)}.
4146
*/
47+
@Deprecated
4248
public sealed interface NotificationConfig extends Serializable permits InternalNotificationConfig {
4349
/**
4450
* Returns a default notification configuration.

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.io.Serializable;
2222
import org.neo4j.driver.Config.ConfigBuilder;
2323
import org.neo4j.driver.internal.InternalNotificationSeverity;
24-
import org.neo4j.driver.util.Preview;
2524

2625
/**
2726
* Notification severity level.
@@ -44,6 +43,5 @@ public sealed interface NotificationSeverity extends Serializable, Comparable<No
4443
* @see ConfigBuilder#withMinimumNotificationSeverity(NotificationSeverity)
4544
* @see SessionConfig.Builder#withMinimumNotificationSeverity(NotificationSeverity)
4645
*/
47-
@Preview(name = "GQL-status object")
4846
NotificationSeverity OFF = new InternalNotificationSeverity(Type.OFF, Integer.MAX_VALUE);
4947
}

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import org.neo4j.driver.exceptions.UnsupportedFeatureException;
3232
import org.neo4j.driver.internal.InternalNotificationConfig;
3333
import org.neo4j.driver.reactive.ReactiveSession;
34-
import org.neo4j.driver.util.Preview;
3534

3635
/**
3736
* The session configurations used to configure a session.
@@ -70,6 +69,7 @@ public final class SessionConfig implements Serializable {
7069
/**
7170
* The notification config.
7271
*/
72+
@SuppressWarnings("deprecation")
7373
private final NotificationConfig notificationConfig;
7474

7575
private SessionConfig(Builder builder) {
@@ -171,7 +171,10 @@ public Optional<BookmarkManager> bookmarkManager() {
171171
* Returns notification config.
172172
* @return the notification config
173173
* @since 5.7
174+
* @deprecated superseded by {@link SessionConfig#minimumNotificationSeverity()} and
175+
* {@link SessionConfig#disabledNotificationClassifications()}.
174176
*/
177+
@Deprecated
175178
public NotificationConfig notificationConfig() {
176179
return notificationConfig;
177180
}
@@ -182,7 +185,6 @@ public NotificationConfig notificationConfig() {
182185
* @return an {@link Optional} of minimum {@link NotificationSeverity} or an empty {@link Optional} if it is not set
183186
* @since 5.22.0
184187
*/
185-
@Preview(name = "GQL-status object")
186188
public Optional<NotificationSeverity> minimumNotificationSeverity() {
187189
return Optional.ofNullable(((InternalNotificationConfig) notificationConfig).minimumSeverity());
188190
}
@@ -192,7 +194,6 @@ public Optional<NotificationSeverity> minimumNotificationSeverity() {
192194
* @return the {@link Set} of disabled {@link NotificationClassification}
193195
* @since 5.22.0
194196
*/
195-
@Preview(name = "GQL-status object")
196197
public Set<NotificationClassification> disabledNotificationClassifications() {
197198
var disabledCategories = ((InternalNotificationConfig) notificationConfig).disabledCategories();
198199
return disabledCategories != null
@@ -247,6 +248,7 @@ public static final class Builder {
247248
private String impersonatedUser = null;
248249
private BookmarkManager bookmarkManager;
249250

251+
@SuppressWarnings("deprecation")
250252
private NotificationConfig notificationConfig = NotificationConfig.defaultConfig();
251253

252254
private Builder() {}
@@ -428,7 +430,11 @@ public Builder withBookmarkManager(BookmarkManager bookmarkManager) {
428430
* @param notificationConfig the notification config
429431
* @return this builder
430432
* @since 5.7
433+
* @deprecated superseded by {@link SessionConfig.Builder#withMinimumNotificationSeverity(NotificationSeverity)} and
434+
* {@link SessionConfig.Builder#withDisabledNotificationClassifications(Set)}.
431435
*/
436+
@SuppressWarnings("DeprecatedIsStillUsed")
437+
@Deprecated
432438
public Builder withNotificationConfig(NotificationConfig notificationConfig) {
433439
this.notificationConfig = Objects.requireNonNull(notificationConfig, "notificationConfig must not be null");
434440
return this;
@@ -441,7 +447,7 @@ public Builder withNotificationConfig(NotificationConfig notificationConfig) {
441447
* @return this builder
442448
* @since 5.22.0
443449
*/
444-
@Preview(name = "GQL-status object")
450+
@SuppressWarnings("deprecation")
445451
public Builder withMinimumNotificationSeverity(NotificationSeverity minimumNotificationSeverity) {
446452
if (minimumNotificationSeverity == null) {
447453
notificationConfig = NotificationConfig.disableAllConfig();
@@ -458,7 +464,7 @@ public Builder withMinimumNotificationSeverity(NotificationSeverity minimumNotif
458464
* @return this builder
459465
* @since 5.22.0
460466
*/
461-
@Preview(name = "GQL-status object")
467+
@SuppressWarnings("deprecation")
462468
public Builder withDisabledNotificationClassifications(
463469
Set<NotificationClassification> disabledNotificationClassifications) {
464470
var disabledCategories = disabledNotificationClassifications == null

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static GqlNotificationConfig defaultConfig() {
2929
return new GqlNotificationConfig(null, null);
3030
}
3131

32-
public static GqlNotificationConfig from(NotificationConfig notificationConfig) {
32+
public static GqlNotificationConfig from(@SuppressWarnings("deprecation") NotificationConfig notificationConfig) {
3333
Objects.requireNonNull(notificationConfig);
3434
var config = (InternalNotificationConfig) notificationConfig;
3535
var disabledClassifications = config.disabledCategories() != null

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.neo4j.driver.NotificationConfig;
2323
import org.neo4j.driver.NotificationSeverity;
2424

25+
@SuppressWarnings("deprecation")
2526
public record InternalNotificationConfig(
2627
NotificationSeverity minimumSeverity, Set<NotificationCategory> disabledCategories)
2728
implements NotificationConfig {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.neo4j.bolt.connection.NotificationSeverity;
2323
import org.neo4j.driver.NotificationCategory;
2424

25+
@SuppressWarnings("deprecation")
2526
public class NotificationConfigMapper {
2627
public static NotificationConfig map(org.neo4j.driver.NotificationConfig config) {
2728
var original = (InternalNotificationConfig) config;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public class SessionFactoryImpl implements SessionFactory {
7373
this.homeDatabaseCache = Objects.requireNonNull(homeDatabaseCache);
7474
}
7575

76+
@SuppressWarnings("deprecation")
7677
@Override
7778
public NetworkSession newInstance(
7879
SessionConfig sessionConfig, AuthToken overrideAuthToken, boolean telemetryDisabled) {
@@ -149,7 +150,7 @@ private NetworkSession createSession(
149150
String impersonatedUser,
150151
@SuppressWarnings("deprecation") Logging logging,
151152
BookmarkManager bookmarkManager,
152-
NotificationConfig notificationConfig,
153+
@SuppressWarnings("deprecation") NotificationConfig notificationConfig,
153154
AuthToken authToken,
154155
boolean telemetryDisabled,
155156
AuthTokenManager authTokenManager,

0 commit comments

Comments
 (0)