diff --git a/driver/src/main/java/org/neo4j/driver/NotificationCategory.java b/driver/src/main/java/org/neo4j/driver/NotificationCategory.java index f648c939a0..369afcb1a6 100644 --- a/driver/src/main/java/org/neo4j/driver/NotificationCategory.java +++ b/driver/src/main/java/org/neo4j/driver/NotificationCategory.java @@ -90,4 +90,15 @@ public sealed interface NotificationCategory extends Serializable permits Notifi * For instance, notifications that are not part of a more specific class. */ NotificationCategory GENERIC = NotificationClassification.GENERIC; + + /** + * A schema category. + *
+ * For instance, notifications about indexes and constraints. + *
+ * Please note that this category was added to a later server version. Therefore, a compatible server version is + * required to use it. + * @since 5.24.0 + */ + NotificationCategory SCHEMA = NotificationClassification.SCHEMA; } diff --git a/driver/src/main/java/org/neo4j/driver/NotificationClassification.java b/driver/src/main/java/org/neo4j/driver/NotificationClassification.java index ad3c794b73..bf517bfe5c 100644 --- a/driver/src/main/java/org/neo4j/driver/NotificationClassification.java +++ b/driver/src/main/java/org/neo4j/driver/NotificationClassification.java @@ -86,5 +86,15 @@ public enum NotificationClassification implements NotificationCategory { *
* For instance, notifications that are not part of a more specific class. */ - GENERIC + GENERIC, + /** + * A schema category. + *
+ * For instance, notifications about indexes and constraints. + *
+ * Please note that this category was added to a later server version. Therefore, a compatible server version is
+ * required to use it.
+ * @since 5.24.0
+ */
+ SCHEMA
}
diff --git a/driver/src/main/java/org/neo4j/driver/internal/NotificationConfigMapper.java b/driver/src/main/java/org/neo4j/driver/internal/NotificationConfigMapper.java
index e606beee79..c63be23ce3 100644
--- a/driver/src/main/java/org/neo4j/driver/internal/NotificationConfigMapper.java
+++ b/driver/src/main/java/org/neo4j/driver/internal/NotificationConfigMapper.java
@@ -17,6 +17,7 @@
package org.neo4j.driver.internal;
import java.util.stream.Collectors;
+import org.neo4j.driver.NotificationCategory;
import org.neo4j.driver.internal.bolt.api.NotificationClassification;
import org.neo4j.driver.internal.bolt.api.NotificationConfig;
import org.neo4j.driver.internal.bolt.api.NotificationSeverity;
@@ -46,7 +47,7 @@ private static NotificationSeverity map(org.neo4j.driver.NotificationSeverity se
};
}
- private static NotificationClassification map(org.neo4j.driver.NotificationCategory category) {
+ private static NotificationClassification map(NotificationCategory category) {
if (category == null) {
return null;
}
@@ -60,6 +61,7 @@ private static NotificationClassification map(org.neo4j.driver.NotificationCateg
case SECURITY -> new NotificationClassification(NotificationClassification.Type.SECURITY);
case TOPOLOGY -> new NotificationClassification(NotificationClassification.Type.TOPOLOGY);
case GENERIC -> new NotificationClassification(NotificationClassification.Type.GENERIC);
+ case SCHEMA -> new NotificationClassification(NotificationClassification.Type.SCHEMA);
};
}
}
diff --git a/driver/src/main/java/org/neo4j/driver/internal/bolt/api/NotificationClassification.java b/driver/src/main/java/org/neo4j/driver/internal/bolt/api/NotificationClassification.java
index 4958878af7..b9e72296f7 100644
--- a/driver/src/main/java/org/neo4j/driver/internal/bolt/api/NotificationClassification.java
+++ b/driver/src/main/java/org/neo4j/driver/internal/bolt/api/NotificationClassification.java
@@ -33,7 +33,8 @@ public enum Type {
DEPRECATION,
SECURITY,
TOPOLOGY,
- GENERIC
+ GENERIC,
+ SCHEMA
}
public static Optional